/* ─────────────────────────────────────────────
   EditKit.tools - Web tools page chrome
   Layered on top of v4/styles.css
   ───────────────────────────────────────────── */

/* ── Slim tool nav: breadcrumb in the middle ── */
.tool-nav .nav-links { display: none; }
.tool-breadcrumb {
  display: flex; align-items: center; gap: 0.55rem;
  margin-left: 1.4rem;
  font-family: var(--ui); font-size: 0.88rem;
  color: var(--ink-3);
}
.tool-breadcrumb .bc-link { color: var(--ink-3); transition: color 0.2s; }
.tool-breadcrumb .bc-link:hover { color: var(--ink); }
.tool-breadcrumb .bc-back { display: inline-flex; align-items: center; gap: 0.3rem; }
.tool-breadcrumb .bc-back svg { transition: transform 0.2s; }
.tool-breadcrumb .bc-back:hover svg { transform: translateX(-2px); }
.tool-breadcrumb .bc-sep { color: var(--border); }
.tool-breadcrumb .bc-current { color: var(--ink); font-weight: 500; }

/* ── Tool page header ── */
.tool-head {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(2rem, 3vw, 2.6rem);
  position: relative;
}
.tool-head .container { max-width: 900px; }
.tool-h1 {
  font-family: var(--display); font-weight: var(--display-weight, 800);
  font-size: calc(clamp(2.4rem, 5.5vw, 4.2rem) * var(--hero-scale, 1));
  line-height: 0.96; letter-spacing: -0.035em;
  color: var(--ink); margin: 0.9rem 0 1rem;
  text-wrap: balance;
}
.tool-h1 .head-em {
  font-style: italic;
  background: linear-gradient(180deg, var(--terra-3) 0%, var(--terra) 75%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tool-sub {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--ink-2); line-height: 1.6; max-width: 56ch;
  text-wrap: pretty;
}

/* ── Tool stage (where the tool itself sits) ── */
.tool-stage {
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(3.5rem, 6vw, 5rem);
  position: relative;
}

/* ─────────────────────────────────────────────
   TC PAD - running timecode calculator
   ───────────────────────────────────────────── */
.tcpad-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: 720px;
}

/* ── Calculator ── */
.tcpad-calc { display: flex; flex-direction: column; gap: 0.5rem; }

/* FPS row */
.tcpad-fps-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.tcpad-fps-label {
  font-family: var(--ui); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.tcpad-select-wrap { position: relative; }
.tcpad-select-wrap::after {
  content: ''; position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3); pointer-events: none;
}
.tcpad-select {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--ink); font-family: var(--ui); font-size: 0.83rem; font-weight: 400;
  padding: 0.45rem 2rem 0.45rem 0.75rem; outline: none;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  transition: border-color 0.2s;
}
.tcpad-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Total display */
.tcpad-total-card {
  background: var(--accent-light);
  border: 1px solid rgba(37,99,235,0.22);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.tcpad-total-top {
  display: flex; align-items: center; justify-content: space-between;
}
.tcpad-total-actions {
  display: flex; align-items: center; gap: 0.75rem;
}
.tcpad-total-label {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(37,99,235,0.55);
}
.tcpad-copy-btn {
  display: flex; align-items: center; gap: 0.3rem;
  background: transparent; border: none; cursor: pointer;
  color: rgba(37,99,235,0.45); padding: 0.15rem 0.4rem;
  border-radius: 4px; transition: color 0.15s;
  font-family: var(--ui); font-size: 0.68rem; font-weight: 500;
}
.tcpad-copy-btn:hover { color: var(--accent); }
.tcpad-copy-label { letter-spacing: 0.04em; }

.tcpad-mode-btn {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 700;
  color: var(--accent); background: var(--accent-light);
  border: none; padding: 0.15rem 0.55rem; border-radius: 9999px;
  cursor: pointer; transition: background 0.15s, color 0.15s; letter-spacing: 0.05em;
}
.tcpad-mode-btn:hover { background: var(--accent); color: white; }

.tcpad-entry-mode-btn {
  background: var(--bg-raised); color: var(--ink-3);
}
.tcpad-entry-mode-btn:hover { background: var(--border); color: var(--ink); }
.tcpad-mode-btn.hidden { display: none; }

.tcpad-total-tc {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

/* Entry row */
.tcpad-entry-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.7rem 1rem;
  display: flex; align-items: center; gap: 0.6rem;
  box-shadow: var(--shadow-sm);
}
.tcpad-entry-op {
  font-family: var(--display); font-size: 1rem; font-weight: 800;
  color: var(--accent); width: 1rem; text-align: center; flex-shrink: 0;
  transition: color 0.15s;
}
.tcpad-entry-op[data-op="subtract"] { color: #B91C1C; }
.tcpad-entry-op[data-op="multiply"],
.tcpad-entry-op[data-op="divide"]   { color: #b45309; }

.tcpad-entry-tc {
  flex: 1;
  font-family: var(--display); font-size: 1.15rem; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink);
  min-width: 0;
}
.tcpad-backspace-btn {
  background: transparent; border: none; color: var(--ink-3);
  cursor: pointer; padding: 0.2rem; border-radius: 4px;
  display: flex; align-items: center; transition: color 0.15s; flex-shrink: 0;
}
.tcpad-backspace-btn:hover { color: var(--ink); }

/* Numpad */
.tcpad-numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }

.tcpad-np {
  padding: 0.85rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); font-family: var(--display); font-size: 1.05rem;
  font-weight: 600; color: var(--ink); cursor: pointer;
  transition: all 0.1s ease; box-shadow: var(--shadow-sm); user-select: none;
}
.tcpad-np:hover { background: var(--bg-raised); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.tcpad-np:active { transform: translateY(0); box-shadow: none; }

/* ── Operator buttons ── */
.tcpad-np-op {
  background: var(--bg-raised);
  color: var(--accent);
  border-color: rgba(37,99,235,0.15);
}
.tcpad-np-op.tcpad-active {
  background: var(--accent-light); border-color: rgba(37,99,235,0.35);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
}
.tcpad-np-op.tcpad-active-sub {
  background: rgba(185,28,28,0.06); border-color: rgba(185,28,28,0.3);
  color: #B91C1C; box-shadow: 0 0 0 2px rgba(185,28,28,0.1);
}

/* Scalar op buttons - × and ÷ */
.tcpad-np-op-scalar {
  color: #b45309;
  border-color: rgba(180,83,9,0.18);
}
.tcpad-np-op-scalar.tcpad-active-scalar {
  background: rgba(180,83,9,0.08);
  border-color: rgba(180,83,9,0.3);
  color: #b45309;
  box-shadow: 0 0 0 2px rgba(180,83,9,0.10);
}

/* Enter / equals - spans 2 cols in bottom row */
.tcpad-np-enter {
  background: var(--accent); color: #fff; border-color: var(--accent-hover);
  grid-column: span 2;
  font-size: 1.3rem;
}
.tcpad-np-enter:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Zero - spans 2 cols */
.tcpad-np-zero { grid-column: span 2; }

.tcpad-np-action { font-family: var(--ui); font-size: 0.8rem; font-weight: 600; }
.tcpad-np-ce { background: var(--bg-raised); color: var(--ink-2); }
.tcpad-np-ac { background: var(--bg-raised); color: var(--ink-3); }
.tcpad-np-ac:hover { color: #B91C1C; }

/* ── Tape ── */
.tcpad-tape-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; position: sticky; top: calc(60px + 1.5rem);
}
.tcpad-tape-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.tcpad-tape-title {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
}
.tcpad-tape-btns { display: flex; gap: 0.25rem; align-items: center; }
.tcpad-tape-undo,
.tcpad-tape-clear {
  font-family: var(--ui); font-size: 0.75rem; font-weight: 500;
  color: var(--ink-3); background: transparent; border: none;
  cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 4px; transition: color 0.15s;
}
.tcpad-tape-undo:hover { color: var(--accent); }
.tcpad-tape-clear:hover { color: #B91C1C; }

.tcpad-tape {
  padding: 1rem 1.25rem;
  min-height: 220px; max-height: 460px;
  overflow-y: auto;
}

.tcpad-tape-empty {
  font-family: var(--ui); font-size: 0.83rem; font-weight: 300;
  color: var(--ink-3); text-align: center; padding: 2.5rem 0;
}

.tcpad-tape-row {
  display: flex; align-items: baseline; gap: 0.5rem; padding: 0.25rem 0;
}
.tcpad-tape-op {
  font-family: var(--display); font-size: 0.9rem; font-weight: 700;
  width: 1rem; text-align: right; flex-shrink: 0; color: var(--ink-3);
}
.tcpad-tape-op--add      { color: var(--accent); }
.tcpad-tape-op--subtract { color: #B91C1C; }
.tcpad-tape-op--scalar   { color: #b45309; }

.tcpad-tape-tc {
  font-family: var(--display); font-size: 1rem; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink-2);
}
.tcpad-tape-row--first .tcpad-tape-tc { color: var(--ink); font-weight: 700; }

.tcpad-tape-line { height: 1px; background: var(--border); margin: 0.3rem 0; }

.tcpad-tape-running {
  font-family: var(--display); font-size: 1.15rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--ink);
  text-align: right; padding-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .tcpad-layout { grid-template-columns: 1fr; }
  .tcpad-tape-wrap { position: static; }
}

/* ── How-to-use / shortcuts strip ── */
.tool-help {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
  position: relative;
}
.tool-help-grid {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.tool-help .eyebrow { margin-bottom: 1rem; }
.tool-steps {
  list-style: none;
  display: grid; gap: 1rem;
}
.tool-steps li {
  display: grid; grid-template-columns: 28px 1fr; gap: 0.9rem;
  font-size: 0.95rem; color: var(--ink-2); line-height: 1.6;
  text-wrap: pretty;
}
.tool-steps .step-n {
  font-family: var(--mono); font-size: 11px;
  color: var(--terra); letter-spacing: 0.04em;
  padding-top: 4px;
}
.tool-steps li > span:last-child { min-width: 0; }
.tool-steps strong { color: var(--ink); font-weight: 600; }
.tool-steps code {
  font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg-raised); padding: 1px 5px; border-radius: 3px;
  color: var(--ink); border: 1px solid var(--border);
}

.tool-keys {
  display: grid; gap: 0.55rem;
}
.tool-keys > div {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 0.8rem; align-items: baseline;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.tool-keys > div:last-child { border-bottom: none; }
.tool-keys dt {
  font-family: var(--ui); color: var(--ink); font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
}
.tool-keys dd { color: var(--ink-2); line-height: 1.5; }
.tool-keys kbd {
  font-family: var(--mono); font-size: 11px;
  background: #fff; border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 6px; border-radius: 4px;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(24,23,26,0.04);
}

@media (max-width: 720px) {
  .tool-help-grid { grid-template-columns: 1fr; }
  .tool-keys > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ── Other tools cross-promo ── */
.other-tools {
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(3.5rem, 6vw, 5rem);
  border-top: 1px solid var(--border);
  position: relative;
}
.other-tools .ot-head { margin-bottom: 2rem; }
.other-tools .ot-head h2 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.028em; line-height: 1.04;
  margin-top: 0.55rem;
}

/* ─────────────────────────────────────────────
   NATIVE-APP DOWNLOAD BAND
   Free desktop/mobile download for a tool that also runs in the browser.
   Mac direct is live; the rest are roadmap pills. Warm + generous (it's free),
   but lighter than the SequenceSuite £49 CTA.
   ───────────────────────────────────────────── */
.native-band {
  padding: clamp(2.5rem, 5vw, 4rem) 0 0;
  position: relative;
}
.native-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: start;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(234, 88, 12, 0.07), transparent 55%),
    var(--card);
  box-shadow: var(--shadow-sm);
}
.native-icon {
  width: 76px; height: 76px; border-radius: 18px;
  display: grid; place-items: center;
  background: #FFF7ED;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.16), inset 0 0 0 1px rgba(234, 88, 12, 0.10);
}
.native-icon img { width: 76px; height: 76px; display: block; }
.native-body { min-width: 0; }
.native-title {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  letter-spacing: -0.028em; line-height: 1.05;
  color: var(--ink); margin: 0.5rem 0 0;
}
.native-sub {
  color: var(--ink-2); line-height: 1.55;
  font-size: 0.98rem; max-width: 46ch;
  margin: 0.6rem 0 0; text-wrap: pretty;
}
.native-actions {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  gap: 1.1rem 1.5rem; margin-top: 1.4rem;
}
/* One download choice: button + a quiet caption beneath it. */
.native-dl-group { display: flex; flex-direction: column; gap: 0.5rem; }
.native-dl { justify-content: center; }
.native-dl-glyph { display: inline-flex; }
.native-dl-glyph svg { width: 15px; height: 15px; margin-top: -2px; }
.native-dl-meta {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.02em; color: var(--ink-3); padding-left: 0.1rem;
}
.native-foot {
  margin: 1.1rem 0 0; max-width: 52ch;
  font-size: 0.82rem; line-height: 1.5; color: var(--ink-3);
  text-wrap: pretty;
}

/* Roadmap row — quiet pills for platforms not shipped yet. */
.native-soon {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.6rem 0.85rem; margin-top: 1.5rem;
  padding-top: 1.25rem; border-top: 1px solid var(--border-light);
}
.native-soon-label {
  font-family: var(--ui); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
.native-platforms {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.native-plat {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.7rem; border-radius: 999px;
  border: 1px dashed var(--border);
  background: var(--bg-raised);
  font-family: var(--ui); font-size: 0.8rem; color: var(--ink-3);
}
.native-plat svg { width: 14px; height: 14px; opacity: 0.7; }
.native-plat-name { font-weight: 500; color: var(--ink-2); }
.native-plat-soon {
  font-style: normal; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3);
  background: var(--ink-4); border-radius: 5px; padding: 0.12em 0.4em;
}

@media (max-width: 600px) {
  .native-card { grid-template-columns: 1fr; gap: 1.1rem; }
  .native-icon { width: 60px; height: 60px; border-radius: 14px; }
  .native-icon img { width: 60px; height: 60px; }
  .native-actions { gap: 0.75rem; }
}

/* ─────────────────────────────────────────────
   SHARED CALCULATOR UI - tabs, input/result panels
   (used by bitrate, compression, aspect-ratio, timecode, sync)
   ───────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 2px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px;
  margin-bottom: 1.5rem; width: fit-content; flex-wrap: wrap;
}
.tab-btn {
  padding: 0.5rem 1rem; border-radius: calc(var(--radius-sm) - 2px);
  border: none; background: transparent;
  font-family: var(--ui); font-size: 0.85rem; font-weight: 400;
  color: var(--ink-3); cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap;
}
.tab-btn.is-active { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }

.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

.input-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 1.25rem;
}

.field-label {
  font-family: var(--ui); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); display: block; margin-bottom: 0.4rem;
}
.field-label-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-3); opacity: 0.7; }

.field-input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--ink); font-family: var(--ui);
  font-size: 0.9rem; font-weight: 400; padding: 0.6rem 0.85rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; -webkit-appearance: none;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.duration-row { display: flex; align-items: center; gap: 0.4rem; }
.duration-part { width: 4rem; text-align: center; flex-shrink: 0; }
.duration-sep { font-size: 0.8rem; font-weight: 500; color: var(--ink-3); }

.speed-chips { display: flex; flex-direction: column; gap: 0.5rem; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.preset-chip {
  padding: 0.3rem 0.7rem; border: 1px solid var(--border);
  border-radius: 100px; background: var(--bg);
  font-family: var(--ui); font-size: 0.78rem; font-weight: 500;
  color: var(--ink-2); cursor: pointer; transition: all 0.2s ease;
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.result-panel {
  position: sticky; top: calc(60px + 1.5rem);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.result-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm);
}
.result-main { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.5rem; }
.result-label { font-family: var(--ui); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.result-value { font-family: var(--display); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.04em; color: var(--ink); line-height: 1; }
.result-unit { font-size: 0.85rem; font-weight: 400; color: var(--ink-3); }
.result-divider { height: 1px; background: var(--border-light); margin-bottom: 1.25rem; }
.result-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.result-meta { display: flex; flex-direction: column; gap: 0.2rem; }
.meta-label { font-family: var(--ui); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.meta-value { font-family: var(--display); font-size: 1rem; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }

@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; }
  .result-panel { position: static; }
}
@media (max-width: 480px) {
  .input-panel, .result-card { padding: 1.25rem; }
  .tab-btn { font-size: 0.78rem; padding: 0.45rem 0.7rem; }
}

/* ── Select fields, mode toggle, note card ── */
.field-group { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3); pointer-events: none;
}
.field-select {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--ink); font-family: var(--ui);
  font-size: 0.9rem; font-weight: 400;
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none; -webkit-appearance: none; cursor: pointer;
}
.field-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.mode-toggle {
  display: flex; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px; gap: 3px;
}
.mode-btn {
  flex: 1; padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius-sm) - 2px); border: none;
  background: transparent; font-family: var(--ui);
  font-size: 0.8rem; font-weight: 500; color: var(--ink-3);
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.mode-btn.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.note-card {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: rgba(37,99,235,0.05); border: 1px solid rgba(37,99,235,0.15);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  color: var(--accent); font-size: 0.8rem; font-weight: 400; line-height: 1.5;
}
.note-card svg { flex-shrink: 0; margin-top: 0.15rem; }

@media (max-width: 480px) {
  .field-row.two-col { grid-template-columns: 1fr; }
}

/* ── Aspect Ratio - range slider, presets, ratio preview ── */
.field-range { width: 100%; margin-top: 0.5rem; accent-color: var(--accent); }
.preset-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.scale-presets { display: flex; gap: 0.4rem; margin-top: 0.75rem; flex-wrap: wrap; }
.crop-description {
  margin-top: 1rem; font-size: 0.8rem; font-weight: 300;
  color: var(--ink-3); line-height: 1.5;
}
.ratio-display { display: flex; gap: 1.5rem; align-items: flex-start; }
.ratio-preview {
  display: flex; align-items: center; justify-content: center;
  width: 200px; height: 120px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); flex-shrink: 0;
}
.ratio-frame {
  background: var(--accent-light); border: 2px solid var(--accent);
  border-radius: 3px; transition: all 0.2s ease;
  min-width: 4px; min-height: 4px;
}
.ratio-numbers { flex: 1; }
.aspect-tool .result-value { font-size: clamp(1.8rem, 4vw, 2.75rem); letter-spacing: -0.03em; }

@media (max-width: 860px) {
  .ratio-display { flex-direction: column; }
  .ratio-preview { width: 100%; }
}

/* ── Timecode - TC field button, mono results, error card ── */
.tc-field {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem; cursor: pointer; text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center;
}
.tc-field:hover { border-color: rgba(24,23,26,0.25); background: var(--bg-raised); }
.tc-field.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background: var(--bg);
}
.tc-field-value {
  font-family: 'Courier New', monospace; font-size: 0.9rem;
  letter-spacing: 0.05em; color: var(--ink-3);
  pointer-events: none; user-select: none; line-height: 1;
}
.tc-field-value.has-value { color: var(--ink); }

.result-value.mono { font-family: 'Courier New', monospace; font-size: clamp(1.5rem, 3.5vw, 2.5rem); letter-spacing: 0.02em; }
.meta-value.mono { font-family: 'Courier New', monospace; letter-spacing: 0.02em; font-weight: 600; }

.error-card {
  display: flex; align-items: flex-start; gap: 0.6rem;
  background: rgba(185,28,28,0.05); border: 1px solid rgba(185,28,28,0.2);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  color: #B91C1C; font-size: 0.8rem; font-weight: 400; line-height: 1.5;
}
.error-card svg { flex-shrink: 0; margin-top: 0.15rem; }

/* ── TC numpad (timecode + sync) ── */
.tc-numpad-backdrop { position: fixed; inset: 0; z-index: 199; background: transparent; }
.tc-numpad {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 200; width: 100%; max-width: 400px;
  background: var(--card); border: 1px solid var(--border); border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(24,23,26,0.12), 0 -2px 12px rgba(24,23,26,0.06);
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tc-numpad.is-open { transform: translateX(-50%) translateY(0); }
.tc-numpad-inner { padding: 1rem 1rem 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.tc-numpad-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-light);
}
.tc-numpad-label {
  font-family: var(--ui); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); flex: 0 0 auto;
}
.tc-numpad-value {
  flex: 1; font-family: 'Courier New', monospace;
  font-size: 1.4rem; font-weight: 700; letter-spacing: 0.04em;
  color: rgba(37,99,235,0.3); text-align: center; line-height: 1;
  transition: color 0.15s;
}
.tc-numpad-value.has-value { color: var(--accent); }
.tc-numpad-done {
  flex: 0 0 auto; padding: 0.4rem 1rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: 100px; font-family: var(--ui);
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.tc-numpad-done:active { background: var(--accent-hover); transform: scale(0.97); }
.tc-numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.tc-key {
  height: 52px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-raised); font-family: var(--display);
  font-size: 1.25rem; font-weight: 700; color: var(--ink);
  cursor: pointer; transition: background 0.1s, transform 0.08s, border-color 0.1s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.tc-key:active { background: var(--border); transform: scale(0.94); }
.tc-key--fn {
  background: var(--bg); color: var(--ink-2);
  font-family: var(--ui); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
}
.tc-key--fn:active { background: rgba(24,23,26,0.08); }
#tc-key-back { font-size: 1.1rem; }

@media (min-width: 700px) {
  .tc-numpad { bottom: 1.5rem; border-bottom: 1px solid var(--border); border-radius: 20px; }
}
@media (max-width: 480px) {
  .result-value.mono { font-size: 1.5rem; }
  .tc-numpad { max-width: 100%; }
}

/* ─────────────────────────────────────────────
   SYNC - multi-camera timecode sync pills
   ───────────────────────────────────────────── */
.sync-layout { display: flex; flex-direction: column; max-width: 900px; gap: 0; }

.sync-pill,
.sync-col-headers {
  display: grid;
  grid-template-columns: 210px 1px 1fr 1px 1fr 110px;
  align-items: stretch;
}

.sync-pill {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  margin-bottom: 0.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  background: var(--card);
}
.sync-pill:focus-within { border-color: rgba(24,23,26,0.2); box-shadow: var(--shadow-md); }

.sync-pill--query {
  background: var(--accent-light);
  border-color: rgba(37,99,235,0.22);
  margin-bottom: 0.25rem;
}
.sync-pill--query:focus-within {
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 4px 20px rgba(37,99,235,0.1), 0 2px 6px rgba(37,99,235,0.05);
}

.sync-col-headers { padding: 0.25rem 0 0.4rem; margin-bottom: 0.25rem; }
.sync-col-header {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 1.5rem;
}
.sync-col-header--identity { grid-column: 1; }
.sync-col-header--ref      { grid-column: 3; }
.sync-col-header--result   { grid-column: 5; }
.sync-col-header--actions  { grid-column: 6; }

.sync-col {
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
  gap: 0.35rem; min-width: 0;
}
.sync-col--result { background: rgba(24,23,26,0.02); }
.sync-col--actions {
  padding: 1rem; background: rgba(24,23,26,0.02);
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 0.4rem;
}
.sync-pill--query .sync-col--result,
.sync-pill--query .sync-col--actions { background: rgba(37,99,235,0.05); }

.sync-divider { width: 1px; background: var(--border); align-self: stretch; }
.sync-pill--query .sync-divider { background: rgba(37,99,235,0.2); }

.sync-col-label {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(37,99,235,0.65); display: block;
}
.sync-spacer { height: 1.6rem; }

.sync-query-select-wrap { position: relative; }
.sync-query-select-wrap::after {
  content: ''; position: absolute;
  right: 0.7rem; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--accent); pointer-events: none;
}
.sync-query-select {
  width: 100%;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--display); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  outline: none; appearance: none; -webkit-appearance: none;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.sync-query-select:focus { border-color: rgba(37,99,235,0.5); background: rgba(37,99,235,0.13); }

.sync-tc-field {
  display: flex; align-items: center;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 0.3rem 0.5rem; margin: -0.3rem -0.5rem;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  text-align: left; width: calc(100% + 1rem);
  -webkit-tap-highlight-color: transparent;
}
.sync-tc-field:hover { background: rgba(24,23,26,0.04); border-color: var(--border); }
.sync-tc-field.is-active {
  background: rgba(37,99,235,0.06);
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.sync-tc-field--query { padding: 0.2rem 0.4rem; margin: -0.2rem -0.4rem; width: calc(100% + 0.8rem); }

.sync-tc-value {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink-3); line-height: 1; pointer-events: none; user-select: none;
}
.sync-tc-value.has-value { color: var(--ink); }
.sync-tc-field--query .sync-tc-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.02em;
  color: rgba(37,99,235,0.3);
}
.sync-tc-field--query .sync-tc-value.has-value { color: var(--accent); }
.sync-tc-field--query.is-active .sync-tc-value:not(.has-value) { color: rgba(37,99,235,0.45); }
.sync-tc-field--ref .sync-tc-value { font-size: 1.15rem; color: var(--ink-3); }
.sync-tc-field--ref .sync-tc-value.has-value { color: var(--ink-2); }

.sync-name-input {
  background: transparent; border: none; outline: none;
  font-family: var(--display); font-size: 1rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink); padding: 0; width: 100%;
}
.sync-name-input::placeholder { color: var(--ink-3); font-weight: 400; }

.sync-result-tc {
  font-family: var(--display); font-size: 1.15rem; font-weight: 800;
  letter-spacing: -0.02em; color: var(--accent); line-height: 1;
}
.sync-offset {
  font-family: var(--ui); font-size: 0.72rem; font-weight: 400;
  color: var(--ink-3); min-height: 1em;
}

.sync-copy-btn {
  display: none; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.6rem; border: 1px solid var(--border);
  border-radius: 100px; background: var(--card);
  font-family: var(--ui); font-size: 0.7rem; font-weight: 500;
  color: var(--ink-3); cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.sync-copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.sync-remove-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--ink-3);
  cursor: pointer; padding: 0; opacity: 0; transition: all 0.15s;
}
.sync-pill--device:hover .sync-remove-btn:not([disabled]) { opacity: 1; }
.sync-remove-btn:hover:not([disabled]) { border-color: rgba(185,28,28,0.25); background: rgba(185,28,28,0.07); color: #B91C1C; }
.sync-remove-btn[disabled] { opacity: 0 !important; cursor: not-allowed; }

.sync-controls { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.25rem; }
.sync-add-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem; border: 1px dashed rgba(24,23,26,0.18);
  border-radius: var(--radius-sm); background: transparent;
  font-family: var(--ui); font-size: 0.83rem; font-weight: 500;
  color: var(--ink-3); cursor: pointer; transition: all 0.2s;
}
.sync-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.sync-fps-btn {
  display: inline-flex; align-items: center;
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: transparent;
  font-family: var(--ui); font-size: 0.83rem; font-weight: 500;
  color: var(--ink-3); cursor: pointer; transition: all 0.2s; margin-left: auto;
}
.sync-fps-btn:hover { color: var(--ink); border-color: rgba(24,23,26,0.22); }
.sync-fps-btn.is-active { color: var(--accent); border-color: rgba(37,99,235,0.3); background: var(--accent-light); }

.sync-fps-panel {
  margin-top: 0.75rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.sync-fps-panel-inner { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.sync-fps-global-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sync-fps-label { font-family: var(--ui); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.sync-fps-hint { font-size: 0.8rem; font-weight: 300; color: var(--ink-3); margin: 0; }
.sync-fps-overrides { display: flex; flex-direction: column; gap: 0.6rem; border-top: 1px solid var(--border-light); padding-top: 1rem; }
.sync-fps-override-row { display: flex; align-items: center; gap: 1rem; }
.sync-fps-override-name { font-family: var(--display); font-size: 0.9rem; font-weight: 600; color: var(--ink); flex: 1; }

.sync-select-wrap { position: relative; }
.sync-select-wrap::after {
  content: ''; position: absolute;
  right: 0.75rem; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3); pointer-events: none;
}
.sync-field-select {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--ink);
  font-family: var(--ui); font-size: 0.83rem; font-weight: 400;
  padding: 0.45rem 2rem 0.45rem 0.75rem; outline: none;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  transition: border-color 0.2s;
}
.sync-field-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

@media (max-width: 700px) {
  .sync-pill,
  .sync-col-headers { grid-template-columns: 1fr 1px 1fr; }
  .sync-col--identity { grid-column: 1 / -1; border-bottom: 1px solid var(--border); }
  .sync-divider:first-of-type { display: none; }
  .sync-divider { grid-column: 2; }
  .sync-col--ref { grid-column: 1; }
  .sync-col--result { grid-column: 3; }
  .sync-col--actions { display: none; }
  .sync-col-headers { display: none; }
}

/* ── Print ── */
@media print {
  .tool-nav, .tool-head .eyebrow, .tool-help, .other-tools, .foot,
  #bg-mount { display: none !important; }
  body { background: #fff; }
  .tool-head { padding-top: 0; }
}
