    :root {
      color-scheme: dark;
      --bg-0: #070b16;
      --bg-1: #0b1124;
      --text: #e8eef9;
      --muted: #a6b1c7;
      --faint: #8b97b4;
      --line: rgba(255,255,255,.09);
      --glass: rgba(255,255,255,.045);
      --glass-strong: rgba(255,255,255,.07);
      --accent: #5b9dff;
      --accent-2: #22d3ee;
      --grad: linear-gradient(135deg, #6366f1 0%, #38bdf8 55%, #22d3ee 100%);
      --ok: #34d399;
      --err: #fb7185;
      --radius: 16px;
      --shadow: 0 20px 60px -25px rgba(0,0,0,.7);
      --spring: cubic-bezier(.22,1,.36,1);
    }
    * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    /* kill the dated focus rectangle on click; keep a clean ring for keyboard only */
    button:focus, summary:focus, .combo:focus, a:focus { outline: none; }
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
    html, body { height: 100%; }
    body {
      margin: 0; color: var(--text);
      font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
      font-size: 15px; line-height: 1.55; letter-spacing: -0.01em;
      background: var(--bg-0);
      -webkit-font-smoothing: antialiased;
      position: relative; overflow-x: hidden;
    }
    body::before, body::after {
      content: ""; position: fixed; z-index: -1; border-radius: 50%;
      filter: blur(90px); opacity: .55; pointer-events: none;
      animation: drift 18s ease-in-out infinite alternate;
    }
    body::before { width: 520px; height: 520px; top: -180px; left: -120px;
      background: radial-gradient(circle, #4f46e5, transparent 70%); }
    body::after  { width: 560px; height: 560px; bottom: -220px; right: -160px;
      background: radial-gradient(circle, #0ea5e9, transparent 70%); animation-delay: -9s; }
    @keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,30px) scale(1.08); } }

    /* Top progress bar (perceived speed) */
    #progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
      background: var(--grad); box-shadow: 0 0 12px var(--accent); opacity: 0;
      transition: width .25s ease, opacity .3s ease; }

    .wrap { max-width: 1040px; margin: 0 auto; padding: 3rem 1.25rem 5rem; }

    header { margin-bottom: 1.6rem; }
    .topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.4rem; }
    .brandmark { display: flex; align-items: center; gap: .6rem; min-width: 0; }
    .logo { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
      background: var(--grad); box-shadow: 0 8px 24px -8px rgba(56,189,248,.6);
      font-weight: 800; color: #04111f; font-size: .95rem; letter-spacing: -.04em; }
    .brandname { font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; white-space: nowrap; }
    .header-actions { display: flex; align-items: center; gap: .5rem; position: relative; flex-shrink: 0; }
    h1 { font-size: 1.6rem; font-weight: 700; margin: .15rem 0 0; letter-spacing: -.03em; }
    .tag { font-size: .72rem; font-weight: 600; color: var(--accent-2);
      text-transform: uppercase; letter-spacing: .12em; }
    .doclink { font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer;
      font-family: inherit; background: var(--glass); border: 1px solid var(--line); padding: .5rem .8rem;
      border-radius: 10px; white-space: nowrap; transition: color .15s, border-color .15s, transform .12s var(--spring); }
    .doclink:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
    #key-btn.set { color: var(--ok); border-color: rgba(52,211,153,.4); }
    .keypop { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; z-index: 250;
      background: rgba(13,20,40,.97); backdrop-filter: blur(18px); border: 1px solid var(--line);
      border-radius: 14px; box-shadow: var(--shadow); padding: 1rem; display: flex; flex-direction: column; gap: .55rem;
      animation: rise .3s var(--spring) both; }
    .keypop label { font-size: .76rem; }
    .keypop-actions { display: flex; gap: .5rem; align-items: center; }
    .keypop-note { margin: 0; font-size: .72rem; color: var(--faint); line-height: 1.45; }
    .sub { color: var(--muted); margin: .5rem 0 0; max-width: 56ch; }

    .layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
    @media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

    .card { background: var(--glass);
      backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
      border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
      padding: 1.6rem; animation: rise .55s var(--spring) both; }
    @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

    .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
    .field { display: flex; flex-direction: column; gap: .4rem; }
    .field.full { grid-column: 1 / -1; }
    label { font-size: .78rem; color: var(--muted); font-weight: 600; }
    label .opt { color: var(--faint); font-weight: 500; }
    .field .hint { font-size: .72rem; color: var(--faint); font-weight: 500; margin-top: -.05rem; }

    input, select {
      background: rgba(8,12,24,.6) !important; color: var(--text);
      border: 1px solid var(--line); border-radius: 11px; padding: .72rem .85rem;
      font-size: .95rem; width: 100%; font-family: inherit;
      transition: border-color .15s, box-shadow .15s, background .15s; }
    input::placeholder { color: var(--faint); }
    input:focus, select:focus { outline: none; border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(91,157,255,.18); }

    .actions { margin-top: 1.4rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
    .btn { position: relative; border: none; cursor: pointer; color: #04121f; font-weight: 700;
      font-size: .95rem; padding: .8rem 1.5rem; border-radius: 12px; background: var(--grad);
      box-shadow: 0 12px 28px -12px rgba(56,189,248,.7); overflow: hidden;
      transition: transform .12s var(--spring), box-shadow .2s, filter .2s; }
    .btn::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.25);
      transform: translateX(-100%) skewX(-20deg); }
    .btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
    .btn:hover::after { animation: sheen .7s ease; }
    @keyframes sheen { to { transform: translateX(200%) skewX(-20deg); } }
    .btn:active { transform: translateY(0) scale(.99); }
    .btn:disabled { opacity: .7; cursor: progress; }
    .btn .spin { display: none; }
    .btn.loading .spin { display: inline-block; }
    .spin { width: 14px; height: 14px; border: 2px solid rgba(4,18,31,.35);
      border-top-color: #04121f; border-radius: 50%; margin-right: .5rem;
      vertical-align: -2px; animation: rot .7s linear infinite; }
    @keyframes rot { to { transform: rotate(360deg); } }

    .msg { font-size: .88rem; display: inline-flex; align-items: center; gap: .45rem; transition: opacity .2s; }
    .msg.err { color: var(--err); }
    .msg.ok { color: var(--ok); }
    .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
    .dot.live { animation: pulse 1.1s ease-in-out infinite; }
    @keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

    .result { margin-top: 1.25rem; }
    .result h2 { margin: 0 0 1.1rem; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; }
    .badge-ok { font-size: .68rem; font-weight: 700; color: var(--ok);
      background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3);
      padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em;
      display: inline-flex; align-items: center; gap: .3rem; }
    .badge-cache { font-size: .66rem; font-weight: 700; color: var(--accent-2);
      background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3);
      padding: .15rem .5rem; border-radius: 999px; }
    .check { width: 13px; height: 13px; }
    .check path { stroke: var(--ok); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round;
      stroke-dasharray: 20; stroke-dashoffset: 20; animation: draw .5s .1s var(--spring) forwards; }
    @keyframes draw { to { stroke-dashoffset: 0; } }

    dl.kv { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem 1.4rem; margin: 0; }
    @media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; } }
    .kv .row { display: flex; flex-direction: column; gap: .15rem; min-width: 0;
      animation: rowIn .45s var(--spring) both; animation-delay: calc(var(--i,0) * 45ms); }
    @keyframes rowIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
    .kv dt { color: var(--faint); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
    .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
    .kv dd.amt { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }

    .downloads { display: flex; gap: .6rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
    .downloads a, .downloads button.dl { text-decoration: none; color: var(--text); font-weight: 600; font-size: .88rem;
      font-family: inherit; cursor: pointer;
      background: var(--glass-strong); border: 1px solid var(--line); border-radius: 11px;
      padding: .6rem 1rem; display: inline-flex; align-items: center; gap: .45rem;
      transition: border-color .15s, transform .12s var(--spring), background .15s; }
    .downloads a:hover, .downloads button.dl:hover { border-color: var(--accent); transform: translateY(-2px); }
    .dl-busy { opacity: .55; pointer-events: none; }
    .err-state { display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; }
    .err-state .err-ico { font-size: 1.7rem; line-height: 1; }
    .err-state p { margin: 0; color: var(--muted); }

    /* Skeleton (shimmer) */
    .sk { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.12) 37%, rgba(255,255,255,.04) 63%);
      background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
    @keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
    .sk-row { height: 12px; margin: .35rem 0; }

    .side h2 { font-size: .95rem; font-weight: 700; margin: 0 0 1rem; display: flex; justify-content: space-between; align-items: center; }
    .ghost { background: none; color: var(--muted); border: 1px solid var(--line);
      padding: .25rem .6rem; font-size: .72rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: .15s; }
    .ghost:hover { color: var(--text); border-color: var(--accent); }
    .recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
    .recent li { animation: rowIn .4s var(--spring) both; animation-delay: calc(var(--i,0) * 40ms); }
    .recent button { width: 100%; text-align: left; cursor: pointer; color: var(--text);
      background: rgba(8,12,24,.45); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem;
      transition: border-color .15s, transform .14s var(--spring), background .15s; }
    .recent button:hover { border-color: var(--accent); transform: translateX(3px); background: rgba(8,12,24,.7); }
    .r-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
    .r-name { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .r-amt { font-size: .82rem; color: var(--accent-2); font-weight: 700; white-space: nowrap; }
    .r-sub { font-size: .72rem; color: var(--faint); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .empty { color: var(--faint); font-size: .85rem; margin: 0; }
    .hidden { display: none; }

    .seo { margin-top: 3rem; max-width: 72ch; color: var(--muted); }
    .seo h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 1.6rem 0 .6rem; letter-spacing: -.01em; }
    .seo p { font-size: .92rem; line-height: 1.65; }
    .seo details { border-bottom: 1px solid var(--line); padding: .2rem 0; }
    .seo summary { cursor: pointer; list-style: none; padding: .7rem 0; font-weight: 600; color: var(--text);
      font-size: .92rem; display: flex; justify-content: space-between; align-items: center; }
    .seo summary::-webkit-details-marker { display: none; }
    .seo summary::after { content: "+"; color: var(--faint); font-weight: 400; font-size: 1.3rem; line-height: 1;
      transition: transform .2s var(--spring), color .2s; }
    .seo summary:hover::after { color: var(--accent); }
    .seo details[open] summary::after { content: "+"; transform: rotate(45deg); color: var(--accent); }
    .seo details p { margin: 0 0 .8rem; animation: fadeUp .28s var(--spring) both; }
    .foot-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
    .foot-links a { color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; }
    .foot-links a:hover { color: var(--accent); }
    .foot { color: var(--faint); font-size: .78rem; margin-top: 1rem; max-width: 70ch; }
    a.link { color: var(--accent); text-decoration: none; }
    a.link:hover { text-decoration: underline; }

    /* Toasts */
    #toasts { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: .55rem; }
    .toast { display: flex; align-items: center; gap: .55rem; padding: .7rem .95rem; border-radius: 12px;
      background: rgba(13,20,40,.85); backdrop-filter: blur(14px); border: 1px solid var(--line);
      box-shadow: var(--shadow); font-size: .85rem; font-weight: 500; min-width: 220px; max-width: 340px;
      animation: toastIn .4s var(--spring) both; }
    .toast.out { animation: toastOut .35s var(--spring) forwards; }
    .toast .tdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
    .toast.ok .tdot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
    .toast.err .tdot { background: var(--err); box-shadow: 0 0 10px var(--err); }
    @keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
    @keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.96); } }

    @keyframes calIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }

    /* ---------- Custom date picker (modern fintech calendar) ---------- */
    .datefield { cursor: pointer; }
    .cal {
      position: absolute; z-index: 300; width: 304px; padding: 14px 14px 12px;
      background: rgba(16,22,40,.94); backdrop-filter: blur(22px) saturate(150%);
      -webkit-backdrop-filter: blur(22px) saturate(150%);
      border: 1px solid var(--line); border-radius: 18px;
      box-shadow: 0 30px 70px -25px rgba(0,0,0,.85);
      color: var(--text); user-select: none; transform-origin: top center;
      animation: calIn .2s var(--spring);
    }
    .cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .cal-title { font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
    .cal-nav { width: 32px; height: 32px; border: none; background: transparent; color: var(--muted);
      border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem;
      font-family: inherit; transition: background .15s, color .15s; }
    .cal-nav:hover { background: rgba(255,255,255,.08); color: var(--text); }
    .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
    .cal-wd { text-align: center; font-size: .64rem; font-weight: 600; color: var(--faint);
      letter-spacing: .03em; padding-bottom: 8px; }
    .cal-day { aspect-ratio: 1 / 1; border: none; background: transparent; color: var(--text);
      border-radius: 50%; cursor: pointer; font-size: .86rem; font-weight: 500; font-family: inherit;
      display: grid; place-items: center; position: relative;
      transition: background .14s, color .14s, box-shadow .15s, transform .1s var(--spring); }
    .cal-day:hover { background: rgba(255,255,255,.08); }
    .cal-day.empty { background: none; cursor: default; }
    .cal-day.today { color: var(--accent); font-weight: 700; }
    .cal-day.today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px;
      border-radius: 50%; background: var(--accent); }
    .cal-day.selected { background-image: var(--grad); color: #04121f; font-weight: 700;
      box-shadow: 0 8px 18px -6px rgba(56,189,248,.6); transform: scale(1.04); }
    .cal-day.selected::after { display: none; }
    .cal-day.disabled { color: var(--faint); opacity: .28; cursor: default; pointer-events: none; }
    .cal-nav:disabled { opacity: .25; cursor: default; pointer-events: none; }
    @media (max-width: 640px) { .cal { width: calc(100vw - 2rem); } }

    /* ---------- Custom searchable combobox (glass, matches calendar) ---------- */
    .combo {
      width: 100%; text-align: left; font-family: inherit; font-size: .95rem;
      background: rgba(8,12,24,.6); color: var(--text); border: 1px solid var(--line);
      border-radius: 11px; padding: .72rem .85rem; cursor: pointer;
      display: flex; align-items: center; justify-content: space-between; gap: .5rem;
      transition: border-color .15s, box-shadow .15s;
    }
    .combo:hover { border-color: rgba(255,255,255,.18); }
    .combo.open, .combo:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,157,255,.18); }
    .combo .combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .combo .combo-label.placeholder { color: var(--faint); }
    .combo .combo-caret { flex: 0 0 auto; color: var(--faint); font-size: .7rem; transition: transform .2s var(--spring); }
    .combo.open .combo-caret { transform: rotate(180deg); }

    .combo-pop {
      position: absolute; z-index: 1000; padding: 6px;
      background: rgba(16,22,40,.94); backdrop-filter: blur(22px) saturate(150%);
      -webkit-backdrop-filter: blur(22px) saturate(150%);
      border: 1px solid var(--line); border-radius: 16px;
      box-shadow: 0 30px 70px -25px rgba(0,0,0,.85); color: var(--text);
      transform-origin: top center; animation: calIn .2s var(--spring);
    }
    .combo-search { padding: 4px 4px 8px; }
    .combo-search input {
      width: 100%; background: rgba(8,12,24,.6); border: 1px solid var(--line);
      border-radius: 10px; padding: .55rem .7rem; color: var(--text);
      font-family: inherit; font-size: .9rem; caret-color: var(--accent);
    }
    .combo-search input::placeholder { color: var(--faint); }
    .combo-search input:focus { outline: none; border-color: var(--accent); }
    .combo-list { max-height: 280px; overflow-y: auto; }
    .combo-opt {
      display: flex; align-items: center; width: 100%; min-height: 42px;
      text-align: left; background: none; border: none; color: var(--text);
      font-family: inherit; font-size: .9rem; line-height: 1.2; padding: 0 .75rem; margin: 1px 0;
      border-radius: 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      transition: background .12s, color .12s;
    }
    .combo-opt:hover, .combo-opt.active { background: rgba(91,157,255,.16); }
    .combo-opt.chosen { color: var(--accent); font-weight: 600; }
    .combo-empty { padding: .7rem .75rem; color: var(--faint); font-size: .85rem; }
    .combo-list::-webkit-scrollbar { width: 8px; }
    .combo-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

    /* ---------- orchestrated motion (SaaS feel) ---------- */
    @keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    @keyframes pop { 0% { opacity: 0; transform: scale(.55) rotate(-10deg); } 60% { transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: none; } }
    @keyframes ctaGrad { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
    @keyframes ripple { to { transform: scale(4); opacity: 0; } }

    /* Header entrance sequence */
    .brand { animation: fadeUp .6s var(--spring) both; }
    .logo { animation: pop .7s var(--spring) both; transition: transform .25s var(--spring); }
    .logo:hover { transform: translateY(-2px) scale(1.05) rotate(-3deg); }
    .sub { animation: fadeUp .6s var(--spring) .08s both; }

    /* Card entrance stagger */
    form#form.card { animation-delay: .16s; }
    aside.side { animation-delay: .26s; }
    /* Card "activates" while you interact with it */
    form#form.card { transition: border-color .3s var(--spring), box-shadow .3s var(--spring); }
    form#form.card:focus-within { border-color: rgba(91,157,255,.35); box-shadow: var(--shadow), 0 0 0 1px rgba(91,157,255,.15); }

    /* Form fields cascade in */
    .grid .field { animation: fadeUp .5s var(--spring) both; }
    .grid .field:nth-child(1) { animation-delay: .26s; }
    .grid .field:nth-child(2) { animation-delay: .31s; }
    .grid .field:nth-child(3) { animation-delay: .36s; }
    .grid .field:nth-child(4) { animation-delay: .41s; }
    .grid .field:nth-child(5) { animation-delay: .46s; }
    .grid .field:nth-child(6) { animation-delay: .51s; }
    .actions { animation: fadeUp .5s var(--spring) .56s both; }

    /* Living gradient on the primary CTA */
    .btn { background-image: linear-gradient(120deg, #6366f1, #38bdf8 38%, #22d3ee 60%, #6366f1 100%);
      background-size: 220% 220%; animation: ctaGrad 7s ease infinite; }
    .btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); pointer-events: none;
      background: rgba(255,255,255,.45); animation: ripple .6s ease-out forwards; }

    /* Cards lift slightly on hover (except the form, to avoid jitter while typing) */
    .result, .side { transition: transform .25s var(--spring), border-color .25s; }
    .result:hover, .side:hover { transform: translateY(-2px); }

    /* Replayed entrance for the dynamically shown result card */
    .pop-in { animation: resultIn .5s var(--spring) both; }
    @keyframes resultIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

    /* ---------- view toggle (segmented control) ---------- */
    .viewtabs { display: inline-flex; gap: .25rem; padding: .3rem; margin-bottom: 1.4rem;
      background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
      backdrop-filter: blur(12px); animation: fadeUp .5s var(--spring) .1s both; }
    .vtab { border: none; cursor: pointer; font-family: inherit; font-size: .88rem; font-weight: 600;
      color: var(--muted); background: transparent; padding: .55rem 1.1rem; border-radius: 9px;
      transition: color .2s, background .2s, box-shadow .2s; }
    .vtab:hover { color: var(--text); }
    .vtab.active { color: #04121f; background: var(--grad); box-shadow: 0 6px 18px -8px rgba(56,189,248,.6); }
    @media (max-width: 560px) { .viewtabs { width: 100%; } .vtab { flex: 1; padding: .55rem .6rem; } }

    /* ---------- batch upload ---------- */
    .batch-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
    .batch-title .hint { font-size: .7rem; color: var(--faint); font-weight: 600; }
    .batch-sub { color: var(--muted); margin: 0 0 1.1rem; font-size: .9rem; }
    .dropzone { display: block; border: 1.5px dashed var(--line); border-radius: 14px; padding: 1.7rem 1rem;
      text-align: center; cursor: pointer; transition: border-color .2s, background .2s, transform .12s var(--spring); }
    .dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(91,157,255,.06); }
    .dropzone.drag { transform: scale(1.01); }
    .dz-icon { font-size: 1.5rem; margin-bottom: .3rem; }
    .dz-meta { font-size: .75rem; color: var(--faint); margin-top: .3rem; }
    .filelist { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
    .filelist li { display: flex; align-items: center; gap: .5rem; background: var(--chip); border: 1px solid var(--line);
      border-radius: 999px; padding: .35rem .4rem .35rem .8rem; font-size: .8rem; animation: fadeUp .3s var(--spring) both; }
    .filelist li button { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 .2rem; }
    .filelist li button:hover { color: var(--err); }
    .batch-results { margin-top: 1.3rem; display: flex; flex-direction: column; gap: .6rem; }
    .bres { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--line);
      border-radius: 12px; background: rgba(8,12,24,.4); animation: fadeUp .4s var(--spring) both; }
    .bres .binfo { flex: 1; min-width: 180px; }
    .bres .bfile { font-weight: 600; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bres .bmeta { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
    .bstatus { font-size: .66rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
    .bstatus.valid { color: var(--ok); background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); }
    .bstatus.warn { color: #fbbf24; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); }
    .bstatus.err { color: var(--err); background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.3); }
    .bstatus.proc { color: var(--muted); background: rgba(148,163,184,.12); border: 1px solid rgba(148,163,184,.28); }
    .bres .bdl { display: flex; gap: .35rem; flex-wrap: wrap; }
    .bres .bdl a, .bres .bdl button { font-size: .73rem; font-weight: 600; color: var(--accent); border: 1px solid var(--line);
      border-radius: 8px; padding: .28rem .55rem; text-decoration: none; background: transparent;
      font-family: inherit; cursor: pointer; transition: border-color .15s; }
    .bres .bdl a:hover, .bres .bdl button:hover { border-color: var(--accent); }
    .bcomplete { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; flex-basis: 100%; }
    .bcomplete .bbank { width: auto; min-width: 170px; padding: .45rem .6rem; font-size: .82rem; }
    .bcomplete .ghost { padding: .45rem .8rem; }
    .bfield { display: flex; flex-direction: column; gap: 3px; }
    .bfield-cap { font-size: .68rem; font-weight: 600; color: var(--faint); letter-spacing: .02em; }

    /* ---------- responsive (phones) ---------- */
    @media (max-width: 640px) {
      /* iOS Safari zooms the whole page when a focused form control is < 16px.
         Force 16px on phones so tapping any field never triggers a jarring zoom
         (the desktop sizes above are unaffected). */
      input, select, textarea, .bbank, .combo-search input { font-size: 16px; }
      .wrap { padding: 1.4rem 1rem 4rem; }
      .brandname { display: none; }                 /* keep the topbar compact */
      h1 { font-size: 1.32rem; }
      .sub { font-size: .92rem; }
      .grid { grid-template-columns: 1fr; }         /* stack form fields */
      .doclink { padding: .5rem .7rem; font-size: .8rem; }
      .card { padding: 1.15rem; }
      .result, .side { padding: 1.15rem; }
      #submit, #batch-run { width: 100%; justify-content: center; }
      .actions { gap: .7rem; }
      /* API-key popover becomes a centered sheet so it never overflows */
      .keypop { position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; width: auto; }
      #toasts { left: 12px; right: 12px; }
      .toast { max-width: none; min-width: 0; }
      .vtab { font-size: .82rem; padding: .55rem .5rem; }
      .kv.kv, dl.kv { grid-template-columns: 1fr; }  /* result fields one per row */
      .bcomplete .bbank { flex: 1; min-width: 0; }
      .bres .bdl { width: 100%; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    }

/* utility classes (replacing former inline style attributes) */
.btn.sm { padding: .5rem .9rem; font-size: .82rem; }
.sk-title { width: 160px; height: 18px; display: inline-block; }
.sk-55 { width: 55%; }
.sk-85 { width: 85%; }

/* "Descargar todos (ZIP)" bar in batch results */
.zip-bar { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
