/* Text Match Cut Generator — tool-specific styles (page shell comes from ../assets/css/tools.css) */

.tmc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; scroll-margin-top: 90px; }

/* ---------- controls ---------- */
.tmc-controls { display: grid; gap: 18px; min-width: 0; }
.tmc-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.tmc-field > label, .tmc-field legend { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%;
  margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 700; color: var(--tl-ink); }
.tmc-count, .tmc-field output { font-size: 13px; font-weight: 600; color: var(--tl-muted); font-variant-numeric: tabular-nums; }
.tmc-controls input[type="text"], .tmc-controls input:not([type]), .tmc-controls select {
  width: 100%; padding: 12px 14px; border: 1px solid #d4dce8; border-radius: 10px; background: #fbfcfe;
  font-size: 16px; color: var(--tl-ink); transition: border-color .15s, box-shadow .15s, background .15s; }
.tmc-controls input:not([type]):focus, .tmc-controls select:focus { outline: none; border-color: var(--tl-cyan-600); background: #fff; box-shadow: 0 0 0 4px rgba(56, 184, 208, .18); }
.tmc-controls select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--tl-muted) 50%), linear-gradient(135deg, var(--tl-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.tmc-row { display: flex; gap: 10px; }
.tmc-row select { flex: 1; min-width: 0; }
.tmc-icon-btn { flex: none; }

/* format segmented control */
.tmc-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tmc-seg label { position: relative; cursor: pointer; }
.tmc-seg input { position: absolute; opacity: 0; pointer-events: none; }
.tmc-seg span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1.5px solid #d4dce8; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: var(--tl-body); background: #fff; transition: border-color .15s, background .15s, color .15s; text-align: center; }
.tmc-seg input:checked + span { border-color: var(--tl-navy); background: #eef3fb; color: var(--tl-navy); }
.tmc-seg input:focus-visible + span { box-shadow: 0 0 0 4px rgba(56, 184, 208, .25); }
.tmc-ar { display: block; border: 2px solid currentColor; border-radius: 3px; }
.ar-916 { width: 12px; height: 20px; } .ar-11 { width: 17px; height: 17px; } .ar-169 { width: 24px; height: 14px; }

/* highlight swatches */
.tmc-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.tmc-swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1.5px #d4dce8; transition: transform .15s, box-shadow .15s; display: grid; place-items: center; }
.tmc-swatch:hover { transform: scale(1.08); }
.tmc-swatch.is-active { box-shadow: 0 0 0 2.5px var(--tl-navy); }
.tmc-custom { background: #fff; color: var(--tl-navy); overflow: hidden; }
.tmc-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* sliders */
.tmc-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.tmc-sliders input[type="range"] { width: 100%; accent-color: var(--tl-navy); height: 22px; cursor: pointer; }

/* actions */
.tmc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tmc-actions .tl-btn-lg { flex: 1; min-width: 200px; }
.tmc-progress { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: var(--tl-navy); font-variant-numeric: tabular-nums; }
.tmc-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--tl-line); overflow: hidden; }
.tmc-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--tl-cyan-600), var(--tl-navy)); transition: width .2s; }
.tmc-status { margin: 0; font-size: 13.5px; color: var(--tl-muted); }
.tmc-status[data-tone="ok"] { color: #138a48; font-weight: 600; }
.tmc-status[data-tone="error"] { color: #c0392b; font-weight: 600; }

/* ---------- preview stage ---------- */
.tmc-stage { position: sticky; top: 92px; display: grid; gap: 14px; justify-items: center; min-width: 0;
  padding: 22px; border-radius: 18px; background: linear-gradient(160deg, #0b1222 0%, #121d33 100%); }
.tmc-screen { position: relative; width: 100%; display: grid; place-items: center; }
.tmc-screen video, .tmc-empty { display: block; max-width: 100%; border-radius: 12px; background: #000; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .8); }
.tmc-screen[data-aspect="9:16"] video, .tmc-screen[data-aspect="9:16"] .tmc-empty { height: min(560px, 62vh); width: auto; aspect-ratio: 9 / 16; }
.tmc-screen[data-aspect="1:1"] video, .tmc-screen[data-aspect="1:1"] .tmc-empty { width: min(100%, 460px); height: auto; aspect-ratio: 1; }
.tmc-screen[data-aspect="16:9"] video, .tmc-screen[data-aspect="16:9"] .tmc-empty { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.tmc-stage-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tmc-stage .tl-btn-ghost { color: #e6edf7; border-color: rgba(255, 255, 255, .25); }
.tmc-stage .tl-btn-ghost:hover { color: #fff; border-color: #fff; }
.tmc-stage .tl-btn:not(.tl-btn-ghost) { background: var(--tl-cyan); border-color: var(--tl-cyan); color: var(--tl-navy-950); }
.tmc-empty { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center;
  color: #9fb0cc; background: repeating-linear-gradient(135deg, #0f1a2e 0 14px, #121f37 14px 28px); border: 1.5px dashed rgba(255, 255, 255, .18); box-shadow: none; }
.tmc-empty[hidden] { display: none !important; }
.tmc-empty iconify-icon { color: var(--tl-cyan); }
.tmc-empty p { margin: 4px 0 0; color: #fff; font-weight: 700; font-size: 15px; }
.tmc-empty span { font-size: 13px; max-width: 220px; }
.tmc-empty b { color: #fff; }
.tmc-hint { margin: 0; text-align: center; font-size: 12.5px; color: #9fb0cc; }

/* ---------- features ---------- */
.tmc-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tmc-features > div { background: #fff; border: 1px solid var(--tl-line); border-radius: 16px; padding: 22px; box-shadow: var(--tl-shadow-sm); }
.tmc-features iconify-icon { color: #fff; background: var(--tl-navy); border-radius: 12px; padding: 10px; }
.tmc-features h3 { margin: 14px 0 6px; font-size: 16.5px; color: var(--tl-ink); }
.tmc-features p { margin: 0; font-size: 14.5px; }

@media (max-width: 980px) {
  .tmc { grid-template-columns: 1fr; }
  .tmc-stage { position: static; order: -1; }
  .tmc-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .tmc-sliders { grid-template-columns: 1fr; }
  .tmc-features { grid-template-columns: 1fr; }
  .tmc-stage { padding: 14px; }
  .tmc-screen[data-aspect="9:16"] video, .tmc-screen[data-aspect="9:16"] .tmc-empty { height: min(460px, 56vh); }
  .tmc-seg span { font-size: 12px; }
}
