
    :root {
      color-scheme: dark;
      --navy: #071925;
      --panel: #102d3f;
      --panel-2: #0b2231;
      --line: #38708a;
      --cyan: #6ce8ff;
      --gold: #ffd76a;
      --green: #8df0b5;
      --red: #ffb0a4;
      --ink: #f5fbff;
      --muted: #c1d7e2;
      --shadow: 0 20px 50px rgba(0, 0, 0, .28);
    }

    * { box-sizing: border-box; }
    html { min-height: 100%; background: var(--navy); }
    body {
      min-height: 100vh;
      margin: 0;
      background:
        radial-gradient(circle at 8% 0%, rgba(108, 232, 255, .15), transparent 31rem),
        linear-gradient(160deg, #061824, #0a2332 56%, #061824);
      color: var(--ink);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.5;
    }

    button, input { font: inherit; }
    button:focus-visible, input:focus-visible {
      outline: 3px solid var(--gold);
      outline-offset: 3px;
    }

    .shell { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 1rem 0 3rem; }
    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 1rem;
      align-items: center;
      padding: .85rem 0 1.2rem;
    }
    .brand { font-weight: 900; letter-spacing: .02em; }
    .build {
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--cyan);
      padding: .4rem .7rem;
      font-size: .82rem;
      font-weight: 800;
    }

    .hero, .card {
      background: linear-gradient(180deg, rgba(16, 45, 63, .96), rgba(8, 29, 43, .96));
      border: 1px solid var(--line);
      border-radius: 1.4rem;
      box-shadow: var(--shadow);
    }
    .hero { padding: clamp(1.2rem, 4vw, 2.4rem); }
    .eyebrow {
      margin: 0 0 .45rem;
      color: var(--gold);
      font-size: .78rem;
      font-weight: 900;
      letter-spacing: .14em;
      text-transform: uppercase;
    }
    h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; letter-spacing: -.045em; }
    .lede { max-width: 47rem; color: var(--muted); font-size: 1.05rem; }
    .local-note {
      display: inline-flex;
      gap: .45rem;
      align-items: center;
      border: 1px solid rgba(141, 240, 181, .48);
      border-radius: 999px;
      background: rgba(141, 240, 181, .09);
      color: var(--green);
      padding: .45rem .75rem;
      font-weight: 800;
    }

    .steps {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: .7rem;
      list-style: none;
      margin: 1rem 0;
      padding: 0;
    }
    .steps li {
      min-height: 5rem;
      border: 1px solid var(--line);
      border-radius: 1rem;
      background: rgba(255, 255, 255, .045);
      padding: .75rem;
      color: var(--muted);
      font-weight: 750;
    }
    .steps b {
      display: grid;
      place-items: center;
      width: 1.65rem;
      height: 1.65rem;
      margin-bottom: .35rem;
      border-radius: 50%;
      background: var(--cyan);
      color: #06202d;
    }

    .workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; }
    .card { padding: 1.15rem; }
    .card h2 { margin: 0 0 .35rem; }
    .muted { color: var(--muted); }
    .picker {
      display: grid;
      min-height: 10rem;
      place-items: center;
      border: 2px dashed #5796b3;
      border-radius: 1rem;
      background: rgba(255, 255, 255, .035);
      padding: 1rem;
      text-align: center;
    }
    .picker .visually-hidden-file {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }
    .picker-button { display: inline-flex; align-items: center; justify-content: center; }
    .visually-hidden-file:focus-visible + .picker-button {
      outline: 3px solid var(--gold);
      outline-offset: 3px;
    }
    .limits { margin: .7rem 0 0; color: var(--muted); font-size: .88rem; }
    .preview-wrap {
      display: grid;
      min-height: 18rem;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 1rem;
      background: rgba(0, 0, 0, .2);
      overflow: hidden;
      padding: .8rem;
    }
    .preview-wrap img { display: block; max-width: 100%; max-height: 28rem; object-fit: contain; }
    .empty-preview { color: var(--muted); text-align: center; }

    .actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
    .button {
      min-height: 2.8rem;
      border: 0;
      border-radius: .8rem;
      background: var(--gold);
      color: #10202a;
      cursor: pointer;
      font-weight: 900;
      padding: .7rem 1rem;
    }
    .button.secondary { background: var(--cyan); }
    .button.ghost { border: 1px solid var(--line); background: rgba(255, 255, 255, .07); color: var(--ink); }
    .button.warn { border: 1px solid rgba(255, 176, 164, .5); background: rgba(255, 176, 164, .1); color: #ffd8d2; }
    .button:disabled { cursor: not-allowed; opacity: .46; }

    .status {
      min-height: 3rem;
      margin: 1rem 0 0;
      border-left: .35rem solid var(--cyan);
      border-radius: .5rem;
      background: rgba(108, 232, 255, .08);
      padding: .7rem .85rem;
    }
    .status.good { border-color: var(--green); background: rgba(141, 240, 181, .09); }
    .status.error { border-color: var(--red); background: rgba(255, 176, 164, .1); }

    .receipt { margin-top: 1rem; }
    .receipt-grid { display: grid; grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
    .qr-frame { display: grid; place-items: center; border-radius: 1rem; background: #fff; padding: 1rem; }
    #qrCanvas { display: block; width: min(100%, 28rem); height: auto; image-rendering: pixelated; }
    .receipt-details { margin: 0; }
    .receipt-details div { border-bottom: 1px solid var(--line); padding: .55rem 0; }
    .receipt-details dt { color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; }
    .receipt-details dd { margin: .18rem 0 0; overflow-wrap: anywhere; font-weight: 750; }
    code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; }
    .privacy { margin-top: 1rem; border: 1px solid var(--line); border-radius: 1rem; padding: .9rem; color: var(--muted); }
    [hidden] { display: none !important; }

    @media (max-width: 52rem) {
      .steps { grid-template-columns: 1fr 1fr; }
      .workspace, .receipt-grid { grid-template-columns: 1fr; }
    }

    @media (max-width: 32rem) {
      .steps { grid-template-columns: 1fr; }
      .topbar { align-items: flex-start; flex-direction: column; }
      .shell { width: min(100% - 1rem, 72rem); }
    }

  
    textarea { display: block; width: 100%; min-height: 8rem; padding: .85rem; margin: .6rem 0; border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); background: var(--panel-2); font: inherit; overflow-wrap: anywhere; }
    .reader-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
    .reader-file { display: block; max-width: 100%; margin-top: .7rem; }
    .qr-frame canvas { display: block; width: min(100%, 24rem); height: auto; image-rendering: pixelated; }
    a { color: var(--cyan); text-underline-offset: .2em; }
    @media (max-width: 48rem) { .reader-grid { grid-template-columns: 1fr; } }
    @media print { .reader-grid, .hero, .topbar, .status, .actions, .privacy { display: none !important; } body { background: white; color: black; } .receipt { color: black; background: white; border: 0; box-shadow: none; } .receipt-details dt { color: #333; } }
