  html { scroll-behavior: smooth; }
  body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  ::selection { background: rgba(99,102,241,.28); }

  /* ── Tabs ── */
  .tab {
    padding: .5rem 1.05rem; border-radius: .6rem; font-size: .8125rem;
    font-weight: 600; color: #71717a; transition: all .18s ease; white-space: nowrap;
  }
  .tab:hover { color: #18181b; }
  .dark .tab:hover { color: #fff; }
  .tab[aria-selected="true"] {
    background: #fff; color: #18181b;
    box-shadow: 0 1px 2px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.05);
  }
  .dark .tab[aria-selected="true"] {
    background: rgba(255,255,255,.1); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  }

  /* ── Live clock digits ── */
  .clock-digits { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; text-shadow: 0 0 28px rgba(99,102,241,.45); }
  .dark .clock-digits { text-shadow: 0 0 34px rgba(129,140,248,.5); }
  .clock-ms { font-variant-numeric: tabular-nums; }

  /* ── Inputs ── */
  .field {
    width: 100%; border-radius: .85rem; padding: .8rem 1rem;
    background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.1);
    font-size: 14px; color: #18181b; transition: border-color .18s ease, box-shadow .18s ease;
  }
  .field::placeholder { color: #a1a1aa; }
  .field:focus { outline: none; border-color: rgba(99,102,241,.65); box-shadow: 0 0 0 4px rgba(99,102,241,.13); }
  .dark .field { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #f4f4f5; }
  .dark .field::placeholder { color: #52525b; }
  .dark .field:focus { border-color: rgba(129,140,248,.6); box-shadow: 0 0 0 4px rgba(129,140,248,.15); }
  select.field {
    appearance: none; cursor: pointer; padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .9rem center; background-size: 1rem;
  }
  .pane-area { scrollbar-width: thin; scrollbar-color: rgba(113,113,122,.4) transparent; }
  .pane-area::-webkit-scrollbar { width: 8px; height: 8px; }
  .pane-area::-webkit-scrollbar-thumb { background: rgba(113,113,122,.35); border-radius: 99px; }
  .pane-area::-webkit-scrollbar-track { background: transparent; }

  /* ── Output rows ── */
  .row {
    display: flex; align-items: center; gap: .75rem;
    /* Grid and flex items default to min-width:auto, so a nowrap child can
       force the row wider than its track. This keeps the row inside the grid. */
    min-width: 0;
    border-radius: .85rem; border: 1px solid rgba(0,0,0,.07);
    background: rgba(255,255,255,.55); padding: .7rem .85rem;
    transition: border-color .18s ease, background .18s ease;
  }
  .row:hover { border-color: rgba(99,102,241,.4); background: rgba(255,255,255,.9); }
  .dark .row { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.025); }
  .dark .row:hover { border-color: rgba(129,140,248,.4); background: rgba(255,255,255,.05); }
  /* min-width:0 is what lets a flex item shrink below its content, which is
     what gives overflow-x a chance to scroll. Without it the nowrap value
     widened the row past a 320px screen and scrolled the whole page. */
  .row-val { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; min-width: 0; }
  .row-val::-webkit-scrollbar { display: none; }

  /* ── Copy button success animation ── */
  .copy-btn { transition: transform .16s cubic-bezier(.34,1.56,.64,1), background .18s ease, color .18s ease; }
  .copy-btn:active { transform: scale(.9); }
  .copy-btn[data-copied="true"] {
    background: #10b981 !important; color: #fff !important; border-color: #10b981 !important;
    animation: pop .38s cubic-bezier(.34,1.56,.64,1);
  }
  @keyframes pop { 0% { transform: scale(.86); } 55% { transform: scale(1.1); } 100% { transform: scale(1); } }

  /* ── FAQ smooth accordion (grid-rows trick = no JS height calc) ── */
  .faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.4,0,.2,1); }
  .faq-item[data-open="true"] .faq-body { grid-template-rows: 1fr; }
  .faq-body > div { overflow: hidden; }
  .faq-chevron { transition: transform .3s ease; }
  .faq-item[data-open="true"] .faq-chevron { transform: rotate(180deg); }

  /* ── Toast ── */
  #toast { transition: opacity .25s ease, transform .25s ease; }
  #toast[data-show="false"] { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

  /* ── Live clock pulse ── */
  @keyframes tick { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
  .tick-dot { animation: tick 1s ease-in-out infinite; }

  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
  }

  /* ── Paused live clock ── */
  .tick-dot[style*="paused"] { animation-play-state: paused !important; }

  /* ── Preset chips ── */
  .preset {
    display: inline-flex; align-items: center; gap: .35rem;
    border-radius: .65rem; border: 1px solid rgba(0,0,0,.1);
    background: rgba(255,255,255,.6); padding: .42rem .7rem;
    font-size: 11.5px; font-weight: 600; color: #52525b;
    transition: all .16s ease; white-space: nowrap;
  }
  .preset:hover { border-color: rgba(99,102,241,.45); color: #4f46e5; background: #fff; }
  .dark .preset { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #a1a1aa; }
  .dark .preset:hover { border-color: rgba(129,140,248,.5); color: #c7d2fe; background: rgba(255,255,255,.07); }

  /* ── Epoch cluster interlinking grid ── */
  .epoch-cluster { margin-top: 3rem; }
  .epoch-cluster-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
  @media (min-width: 640px) { .epoch-cluster-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1024px) { .epoch-cluster-grid { grid-template-columns: repeat(3, 1fr); } }
  .epoch-cluster-card {
    display: block; border-radius: 1rem; border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.65); padding: 1rem 1.1rem;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  .epoch-cluster-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,.45); box-shadow: 0 12px 30px -18px rgba(79,70,229,.45); }
  .dark .epoch-cluster-card { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.035); }
  .dark .epoch-cluster-card:hover { border-color: rgba(129,140,248,.5); }
  .epoch-cluster-card strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
  .epoch-cluster-card span { display: block; margin-top: .3rem; font-size: 12.5px; line-height: 1.5; color: #71717a; }
  .dark .epoch-cluster-card span { color: #a1a1aa; }
  .epoch-cluster-card.is-current { border-color: rgba(99,102,241,.55); background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(34,211,238,.05)); }

  /* ── GEO summary directly under the tool ── */
  .geo-summary {
    margin-top: 1.25rem; border-radius: 1rem;
    border: 1px solid rgba(99,102,241,.28);
    background: linear-gradient(135deg, rgba(99,102,241,.09), rgba(34,211,238,.05));
    padding: 1rem 1.15rem;
  }
  .geo-summary strong { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #4f46e5; }
  .dark .geo-summary strong { color: #a5b4fc; }
  .geo-summary p { margin-top: .4rem; font-size: 13.5px; line-height: 1.65; color: #3f3f46; }
  .dark .geo-summary p { color: #d4d4d8; }

/* Long inline identifiers (Intl.RelativeTimeFormat, EXTRACT(EPOCH FROM NOW()))
   must break inside prose on narrow screens instead of widening the page. */
@media (max-width: 640px) {
  p code, li code { overflow-wrap: anywhere; }
}
