
:root {
    --teal-ink: #1f4a57;
    --ink: #14323d;
    --azure: #34a6eb;
    --azure-text: #2e7e94;
    --body: #46585d;
    --soft: #5a6b70;
    --mono-ink: #6e8388;
    --line: #dce5e5;
    --line-strong: #c6d3d3;
    --rule: #eaf0f0;
    --surface: #ffffff;
    --surface-2: #eef3f3;
    --ground: #f6f8f8;
    --ok: #34a6eb;
    --err: #c24236;
    --err-bg: #fbeae8;
    --err-border: #f1c7c2;
    --warn: #8a6d1f;
    --warn-bg: #fbf6e8;
    --warn-border: #f0e4bc;
    --focus: 0 0 0 3px rgba(52, 166, 235, 0.35);
    --font: "Hanken Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  .ar-scope * { box-sizing: border-box; }

  .ar-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: clamp(28px, 6vh, 72px) 18px;
    color: var(--ink);
    font-family: var(--font);
    background: var(--ground);
    -webkit-font-smoothing: antialiased;
  }

  .ar-stack {
    width: min(680px, 100%);
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  /* ---------- Brand ---------- */
  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
  }
  .brand svg { width: 28px; height: 28px; display: block; }
  .brand__word { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }

  /* ---------- Card ---------- */
  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 16px 40px -28px rgba(20, 50, 61, 0.5);
    padding: clamp(24px, 4.5vw, 44px);
    text-align: center;
  }
  .card__lock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 20px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--azure-text);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
  }
  .card h1 {
    margin: 0 0 12px;
    font-size: clamp(1.7rem, 3.8vw, 2.3rem);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
  }
  .subtext {
    max-width: 520px;
    margin: 0 auto 28px;
    color: var(--body);
    font-size: 16.5px;
    line-height: 1.6;
  }

  /* ---------- Dropzone ---------- */
  .drop {
    position: relative;
    border: 2px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  }
  .drop:hover, .drop:focus-visible {
    border-color: var(--azure);
    background: #e7f0f0;
    outline: none;
  }
  .drop:focus-visible { box-shadow: var(--focus); }
  .drop.is-drag {
    border-color: var(--azure);
    background: #e1eef0;
    box-shadow: inset 0 0 0 3px rgba(52, 166, 235, 0.12);
  }
  .drop__inner {
    min-height: 206px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 13px;
    padding: 34px 24px;
  }
  .drop__icon {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(52,166,235,.16), rgba(31,74,87,.10));
    color: var(--azure-text);
  }
  .drop__icon svg { width: 28px; height: 28px; }
  .drop__title { font-size: 1.12rem; font-weight: 700; color: var(--ink); }
  .drop__or { color: var(--mono-ink); font-size: .9rem; }
  .drop__hint { color: var(--mono-ink); font-size: .8rem; margin-top: 2px; font-family: var(--mono); letter-spacing: .03em; }

  /* ---------- Buttons ---------- */
  .btn {
    appearance: none;
    border: 0;
    border-radius: 5px;
    padding: 13px 26px;
    font: inherit;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    color: var(--ground);
    background: var(--teal-ink);
    transition: filter .15s ease, background .15s ease;
  }
  .btn:hover { filter: brightness(1.12); }
  .btn:focus-visible { outline: none; box-shadow: var(--focus); }
  .btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
  .btn--ghost {
    color: var(--teal-ink);
    background: transparent;
    border: 1px solid #bccbcb;
    filter: none;
  }
  .btn--ghost:hover { background: var(--surface); filter: none; }
  .drop .btn { padding: 12px 24px; }

  /* visually-hidden native input */
  .vh {
    position: absolute !important; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
    clip-path: inset(50%); white-space: nowrap; border: 0;
  }

  /* ---------- File list ---------- */
  .files { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
  .file {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .file__ico {
    width: 38px; height: 38px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--surface-2); color: var(--azure-text);
  }
  .file__ico svg { width: 19px; height: 19px; }
  .file__body { min-width: 0; }
  .file__name {
    font-weight: 600; font-size: .94rem; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .file__meta { font-size: .79rem; color: var(--mono-ink); margin-top: 2px; }
  .file__bar { height: 6px; margin-top: 9px; border-radius: 999px; background: var(--rule); overflow: hidden; }
  .file__bar > i {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--azure), var(--teal-ink));
    border-radius: inherit; transition: width .18s linear;
  }
  .file__right { display: flex; align-items: center; gap: 10px; }
  .file__pct { font-family: var(--mono); font-size: .82rem; color: var(--mono-ink); min-width: 38px; text-align: right; }
  .file__x {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    width: 30px; height: 30px; border-radius: 6px; color: #8aa0a5;
    display: grid; place-items: center; transition: background .15s, color .15s;
  }
  .file__x:hover { background: var(--err-bg); color: var(--err); }
  .file__x:focus-visible { outline: none; box-shadow: var(--focus); }
  .file[data-state="done"] .file__pct { color: var(--ok); font-weight: 700; }
  .file[data-state="error"] { border-color: var(--err-border); background: var(--err-bg); }
  .file[data-state="error"] .file__meta { color: var(--err); }
  .badge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
  .badge--ok { background: var(--ok); color: #fff; }
  .badge--ok svg { width: 13px; height: 13px; }

  /* ---------- Actions ---------- */
  .actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
  .actions[hidden], .ar-hide { display: none !important; }

  /* ---------- Status / alerts ---------- */
  .status {
    margin-top: 18px; min-height: 1.2em;
    font-size: .92rem; font-weight: 600; color: var(--soft);
  }
  .alert {
    margin-top: 16px; padding: 12px 16px; border-radius: 8px;
    font-size: .9rem; text-align: left; display: flex; gap: 10px; align-items: flex-start;
  }
  .alert svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
  .alert--err { background: var(--err-bg); color: #9c342a; border: 1px solid var(--err-border); }
  .alert[hidden] { display: none; }

  /* ---------- Receipt ---------- */
  .receipt {
    margin-top: 20px; padding: 22px; text-align: left;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  }
  .receipt[hidden] { display: none; }
  .receipt__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .receipt__head strong { color: var(--ink); font-size: 1.05rem; font-weight: 700; }
  .receipt__head .badge { width: 26px; height: 26px; flex: 0 0 auto; }
  .receipt__head .badge svg { width: 15px; height: 15px; }
  .receipt ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
  .receipt li { font-size: .9rem; color: #33474d; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
  .receipt li span.lbl {
    color: var(--mono-ink); min-width: 116px;
    font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  }
  .receipt code {
    font-family: var(--mono);
    background: rgba(20,35,61,.06); padding: 2px 8px; border-radius: 5px; word-break: break-all; color: var(--ink);
  }

  .footer { margin: 0; color: var(--mono-ink); font-size: .8rem; text-align: center; line-height: 1.6; }
  .footer a { color: var(--azure-text); text-decoration: none; }
  .footer a:hover { text-decoration: underline; }

  .demo-flag {
    display: none; margin: 16px auto 0; max-width: 560px;
    font-size: .78rem; line-height: 1.5; text-align: left;
    color: var(--warn);
    background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 9px 13px;
  }
  .demo-flag code { font-family: var(--mono); }
  .ar-scope[data-demo="true"] .demo-flag { display: block; }

  .expired-msg {
    margin-top: 8px;
    padding: 22px;
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--body);
    font-size: 16px;
    line-height: 1.6;
  }
  .expired-msg p { margin: 0 0 12px; }
  .expired-msg p:last-child { margin-bottom: 0; }
  .drop.is-disabled {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
  }

  @media (max-width: 560px) {
    .file { grid-template-columns: 34px 1fr; }
    .file__right { grid-column: 1 / -1; justify-content: space-between; margin-top: 2px; }
    .receipt li span.lbl { min-width: 0; width: 100%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ar-scope * { transition: none !important; animation: none !important; }
  }