
  [data-theme="light"] { color-scheme:light; --page:#f5eedf;--sheet:#fbf7ee;--sheet-alt:#f1e9d8;--sheet-shadow:#f3ebda;--field:#fffdf8;--ink:#1c2230;--ink-2:#353a48;--muted:#4e5363;--line:#cfc4ae;--primary:#1c2230;--stamp:#a54926;--placeholder:#757063;--disabled:#ecd9cd;--signature:#353a48;--on-primary:#fbf7ee; }
[data-theme="dark"] { color-scheme:dark; --page:#1a1512;--sheet:#231c17;--sheet-alt:#2b231d;--sheet-shadow:#1e1814;--field:#17120f;--ink:#f0e6d4;--ink-2:#d9ceba;--muted:#b9ad99;--line:#3e342b;--primary:#f0e6d4;--stamp:#ee8f6b;--placeholder:#8f8474;--disabled:#3f2e26;--signature:#d9ceba;--on-primary:#231c17; }
:root { --mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
    --serif: 'IBM Plex Serif', Georgia, serif;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --script: 'Caveat', 'Brush Script MT', cursive;
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); }
  a { color: var(--primary); }
  a:hover { color: var(--stamp); }
  .mono { font-family: var(--mono); }
  .wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 28px; }
  .col { width: 100%; max-width: 820px; }

  /* Header */
  .top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
  .brand { display: flex; flex-direction: column; gap: 2px; }
  .brand__name { font-family: var(--serif); font-weight: 600; font-size: 24px; }
  .brand__sub { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
  .ticket { display: flex; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; font-family: var(--mono); }
  .ticket__label { padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; border-right: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
  .ticket__label b { font-weight: 400; font-size: 11px; letter-spacing: .08em; }
  .ticket__no { padding: 6px 16px; font-size: 28px; font-weight: 600; color: var(--stamp); display: flex; align-items: center; }

  /* Sheet (stacked-paper shadow) */
  .sheet { background: var(--sheet); border: 1px solid var(--line);
    box-shadow: 0 1px 0 var(--line), 0 3px 0 var(--sheet-shadow), 0 4px 0 var(--line), 0 6px 0 var(--sheet-shadow), 0 7px 0 var(--line); }
  .strip { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 32px; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 12px; color: var(--muted); }

  .intro { padding: 32px 32px 4px; display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 12px 16px; align-items: start; }
  .intro__text { display: contents; }
  .intro .lead { grid-column: 1; }
  h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 5vw, 46px); line-height: 1.08; }
  .lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 50ch; }
  .stamp { width: 148px; height: 148px; grid-column: 2; grid-row: 1 / 3; align-self: center; transform: rotate(-12deg); opacity: .88; }

  /* Form sections */
  form { padding: 20px 32px 8px; }
  .sec { display: grid; grid-template-columns: 44px minmax(0, 1fr); border-top: 1px solid var(--line); padding: 16px 0; }
  .sec__no { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 1px; }
  .sec__body { display: flex; flex-direction: column; gap: 8px; }
  .label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
  .value { font-size: 16px; font-weight: 500; }
  .note { font-family: var(--mono); font-style: italic; font-size: 12px; color: var(--muted); }
  .row { display: flex; gap: 8px; }
  .row input { flex: 1; min-width: 0; }
  input[type=password], input[type=text] { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 2px; background: var(--field); font: inherit; font-size: 16px; color: var(--ink); }
  input::placeholder { color: var(--placeholder); }
  input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
  .btn-ghost { height: 48px; min-width: 76px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 2px; background: var(--sheet-alt); font-family: var(--mono); font-size: 13px; color: var(--ink); cursor: pointer; }
  .check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; cursor: pointer; }
  .check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }

  .submit-row { border-top: 1px solid var(--ink); padding: 20px 0 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
  .sigs { display: flex; gap: 28px; flex-wrap: wrap; }
  .sig { display: flex; flex-direction: column; gap: 2px; }
  .sig__hand { font-family: var(--script); font-size: 28px; line-height: 1; color: var(--signature); transform: rotate(-3deg); }
  .sig__val { font-family: var(--mono); font-size: 15px; line-height: 28px; }
  .sig__cap { border-top: 1px solid var(--ink); padding-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); }
  .submit { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
  .btn-primary { display: inline-flex; align-items: center; height: 54px; padding: 0 30px; border: 0; border-radius: 2px; background: var(--primary); color: var(--on-primary); font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .04em; text-decoration: none; cursor: pointer; }
  .btn-primary:hover { color: var(--on-primary); opacity: .9; }
  .small-mono { font-family: var(--mono); font-size: 11px; color: var(--muted); }
  .error { display: none; font-family: var(--mono); font-size: 12px; color: var(--stamp); }
  .error.is-on { display: block; }

  /* Filed (success) state */
  .filed { display: none; padding: 48px 32px 40px; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .is-filed .filed { display: flex; }
  .is-filed .intro, .is-filed form { display: none; }
  .filed__receipt { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px dashed var(--line); padding: 10px 16px; }
  .filed__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }

  /* Perforated receipt stub */
  .perf { position: relative; border-top: 2px dashed var(--line); }
  .perf::before, .perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--page); }
  .perf::before { left: -12px; border-right: 1px solid var(--line); }
  .perf::after { right: -12px; border-left: 1px solid var(--line); }
  .stub { padding: 16px 32px 18px; background: var(--sheet-alt); display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--muted); }
  .stub div { display: flex; flex-direction: column; gap: 2px; }
  .stub b { font-weight: 400; font-size: 11px; letter-spacing: .08em; }
  .stub span { color: var(--ink); }

  .aside { margin: 24px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
  footer { margin-top: auto; padding-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
  footer nav { display: flex; gap: 20px; }

  @media (max-width: 560px) {
    .strip, .intro, form, .stub, .filed { padding-left: 20px; padding-right: 20px; }
    .intro { grid-template-columns: minmax(0, 1fr) 76px; padding-top: 24px; gap: 18px 10px; }
    .intro h1 { font-size: clamp(27px, 7.4vw, 34px); }
    .intro .lead { grid-column: 1 / -1; }
    .stamp { width: 76px; height: 76px; grid-row: 1; align-self: start; }
    .submit { align-items: stretch; width: 100%; }
    .btn-primary { justify-content: center; padding: 0 16px; font-size: 14px; }
    .sec { grid-template-columns: 30px minmax(0, 1fr); }
  }
