:root {
  --ink: #171713;
  --muted: #69685f;
  --paper: #f3f0e6;
  --sheet: #fffdf5;
  --line: #c7c2b3;
  --signal: #e5532d;
  --acid: #dfff45;
  --blue: #2247e6;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Arial, Helvetica, sans-serif; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #ffbe0b; outline-offset: 2px; }

.study-bar { position: sticky; z-index: 20; top: 0; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #a8a495; background: rgba(243, 240, 230, .96); backdrop-filter: blur(12px); }
.study-brand { font-size: 14px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.study-brand span { margin-left: 8px; color: var(--muted); font-weight: 400; }
.study-tabs { display: flex; height: 100%; }
.study-tab { min-width: 112px; border: 0; border-left: 1px solid #bbb7a9; padding: 0 18px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.study-tab:last-child { border-right: 1px solid #bbb7a9; }
.study-tab:hover { color: var(--ink); background: #ebe7dc; }
.study-tab.is-active { color: white; background: var(--ink); }

.direction { min-height: calc(100vh - 58px); }
.direction-number { margin: 0 0 16px; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* Direction A */
.direction-classic { display: grid; grid-template-columns: minmax(260px, 390px) minmax(440px, 620px); justify-content: center; align-items: start; gap: clamp(70px, 11vw, 180px); padding: 72px 42px 110px; background: #e9e5da; }
.classic-intro { position: sticky; top: 114px; padding-top: 22px; }
.classic-intro h1 { max-width: 380px; margin: 0; font-size: clamp(42px, 5vw, 70px); line-height: .94; letter-spacing: -.065em; }
.classic-intro > p:not(.direction-number) { max-width: 320px; margin: 23px 0 34px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.intro-facts { margin: 0; border-top: 1px solid #aaa597; }
.intro-facts div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #c7c1b3; }
.intro-facts dt { color: var(--muted); font-size: 11px; }
.intro-facts dd { margin: 0; font-size: 12px; font-weight: 700; }
.intro-actions { display: flex; gap: 18px; margin-top: 22px; }
.text-action { border: 0; border-bottom: 1px solid var(--ink); padding: 2px 0; background: transparent; font-size: 12px; font-weight: 700; }

.receipt { position: relative; width: 100%; min-width: 0; color: #26241e; background: var(--sheet); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; box-shadow: 0 22px 46px rgba(42, 37, 26, .14); }
.receipt::before, .receipt::after { position: absolute; right: 0; left: 0; height: 10px; content: ""; background: linear-gradient(135deg, transparent 7px, var(--sheet) 0) 0 0/14px 14px repeat-x; }
.receipt::before { top: -9px; transform: rotate(180deg); }
.receipt::after { bottom: -9px; }
.receipt-classic { padding: 48px 38px 52px; }
.receipt-wordmark { margin-bottom: 31px; text-align: center; font-size: 27px; font-weight: 900; letter-spacing: -.08em; }
.receipt-meta { display: flex; flex-direction: column; gap: 4px; text-align: center; font-size: 11px; }
.receipt-meta strong { margin-bottom: 4px; font-size: 15px; }
.receipt-rule { width: 100%; min-width: 0; overflow: hidden; margin: 21px 0; white-space: nowrap; letter-spacing: .11em; }
.receipt-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.receipt-summary span, .receipt-head { color: #777265; font-size: 9px; }
.receipt-summary strong { display: block; margin-top: 4px; font-size: 13px; }
.receipt-summary div:first-child { grid-column: span 2; }
.receipt-summary div:first-child strong { font-size: 22px; letter-spacing: -.06em; }
.receipt-columns { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 15px; }
.receipt-head { padding-bottom: 9px; border-bottom: 1px solid #c9c4b8; }
.receipt-head span:last-child { text-align: right; }
.receipt-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 13px 0; border-bottom: 1px dotted #beb8aa; text-decoration: none; }
.receipt-line:hover { background: #f3efdf; box-shadow: 10px 0 #f3efdf, -10px 0 #f3efdf; }
.receipt-line span { min-width: 0; font-size: 11px; font-weight: 700; line-height: 1.25; }
.receipt-line time { display: inline-block; width: 50px; color: #7b766a; font-weight: 400; }
.receipt-line small { display: block; overflow: hidden; margin: 4px 0 0 50px; color: #858073; font-size: 8px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line strong { align-self: start; font-size: 11px; font-variant-numeric: tabular-nums; }
.receipt-more { width: 100%; border: 0; border-bottom: 1px dotted #beb8aa; padding: 17px 0; color: #575349; background: transparent; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; }
.receipt-more:hover { color: #000; }
.receipt-note { color: #777266; text-align: center; font-size: 8px; line-height: 1.45; }
.receipt-note p { margin: 5px auto; }
.barcode { width: 76%; height: 44px; margin: 26px auto 10px; background: repeating-linear-gradient(90deg, #1f1e1a 0 2px, transparent 2px 4px, #1f1e1a 4px 5px, transparent 5px 9px, #1f1e1a 9px 12px, transparent 12px 14px); }
.receipt-end { margin: 0; text-align: center; font-size: 8px; letter-spacing: .08em; }

/* Direction B */
.direction-printer { grid-template-columns: minmax(300px, 470px) minmax(520px, 820px); align-items: center; justify-content: center; gap: clamp(50px, 9vw, 140px); padding: 70px 5vw 90px; color: #f5f3eb; background: #151516; }
.direction-printer.is-active { display: grid; }
.printer-copy h1 { max-width: 470px; margin: 0; font-size: clamp(46px, 6vw, 82px); line-height: .9; letter-spacing: -.07em; }
.printer-copy > p:not(.direction-number) { max-width: 430px; margin: 25px 0 42px; color: #a8a69e; font-size: 17px; line-height: 1.5; }
.printer-stats { border-top: 1px solid #454547; }
.printer-stats div { display: grid; grid-template-columns: 145px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #343436; }
.printer-stats span { color: #9f9d95; font-size: 11px; }
.printer-stats strong { font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.printer-control { display: flex; align-items: center; gap: 10px; margin-top: 25px; border: 1px solid #69696b; padding: 10px 14px; color: white; background: transparent; font-size: 12px; font-weight: 700; }
.printer-control:hover { border-color: var(--acid); color: var(--acid); }
.control-dot { width: 8px; height: 8px; background: var(--acid); box-shadow: 0 0 0 4px rgba(223,255,69,.12); }
.printer-control[aria-pressed="true"] .control-dot { background: #ff6542; box-shadow: 0 0 0 4px rgba(255,101,66,.14); }

.printer-machine { align-self: end; width: 100%; max-width: 820px; padding-top: 16px; }
.printer-housing { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border: 1px solid #454548; border-radius: 8px 8px 0 0; color: #aaa89f; background: linear-gradient(#323235, #242426); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .07em; }
.printer-status { display: flex; align-items: center; gap: 7px; color: var(--acid); }
.printer-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); }
.paper-feed { width: calc(100% - 64px); margin: -18px auto 0; padding: 28px 28px 36px; color: #222119; background: #f9f6e8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: 0 16px 50px rgba(0,0,0,.38); transform: perspective(900px) rotateX(1.5deg); transform-origin: top; }
.paper-header, .paper-footer { display: flex; justify-content: space-between; gap: 20px; font-size: 9px; font-weight: 800; }
.paper-header { padding-bottom: 16px; border-bottom: 1px solid #928d7e; }
.feed-lines { padding: 8px 0; }
.feed-lines div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 11px 0; border-bottom: 1px dotted #aaa496; font-size: 10px; }
.feed-lines span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-lines strong { font-size: 10px; font-variant-numeric: tabular-nums; }
.feed-lines .now-printing { margin: 0 -12px; padding-right: 12px; padding-left: 12px; background: var(--acid); }
.paper-footer { margin-top: 11px; color: #716c60; }
.printer-slot { width: calc(100% - 34px); height: 46px; margin: 0 auto; border: 1px solid #454548; border-top: 14px solid #09090a; border-radius: 0 0 10px 10px; background: #29292b; box-shadow: 0 24px 50px rgba(0,0,0,.28); }

/* Direction C */
.direction-index { padding: 46px clamp(24px, 4vw, 66px) 70px; background: #f7f6f1; }
.direction-index.is-active { display: block; }
.index-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 31px; border-bottom: 2px solid var(--ink); }
.index-header h1 { margin: 0; font-size: clamp(42px, 5.5vw, 76px); line-height: .9; letter-spacing: -.065em; }
.index-total { text-align: right; }
.index-total span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.index-total strong { font-size: clamp(24px, 3vw, 42px); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.index-controls { min-height: 72px; display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto; gap: 12px; align-items: end; padding: 13px 0; border-bottom: 1px solid #a8a69d; }
.index-controls label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.index-controls input, .index-controls select, .index-controls button { height: 39px; border: 1px solid #8d8a80; border-radius: 0; padding: 0 11px; color: var(--ink); background: white; font-size: 12px; text-transform: none; letter-spacing: 0; }
.index-controls button { color: white; background: var(--ink); font-weight: 700; }
.index-layout { display: grid; grid-template-columns: minmax(590px, 1.5fr) minmax(330px, .7fr); gap: clamp(36px, 6vw, 96px); align-items: start; padding-top: 25px; }
.index-table-head, .authority-row { display: grid; grid-template-columns: minmax(260px, 1fr) 90px 120px; gap: 16px; align-items: center; }
.index-table-head { padding: 0 12px 9px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.index-table-head span:last-child { text-align: right; }
.authority-index { border-top: 1px solid var(--ink); }
.authority-row { width: 100%; min-height: 65px; border: 0; border-bottom: 1px solid #cbc9c0; padding: 10px 12px; color: var(--ink); background: transparent; text-align: left; }
.authority-row:hover { background: #eceae3; }
.authority-row.is-selected { color: white; background: var(--blue); }
.authority-row span:first-child { font-size: 13px; font-weight: 700; }
.authority-row small { display: block; margin-top: 3px; color: inherit; opacity: .65; font-size: 10px; font-weight: 400; }
.authority-row > span:nth-child(2), .authority-row > strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.authority-row > strong { text-align: right; }
.indexed-receipt { position: sticky; top: 84px; margin-top: -1px; border-top: 9px solid var(--blue); padding: 23px 24px 27px; background: #ece9df; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.indexed-title { display: flex; justify-content: space-between; gap: 20px; color: #6a675d; font-size: 8px; font-weight: 700; }
.indexed-receipt h2 { max-width: 390px; margin: 32px 0 36px; font-family: Arial, Helvetica, sans-serif; font-size: clamp(28px, 3vw, 42px); line-height: .96; letter-spacing: -.05em; }
.indexed-values { display: grid; grid-template-columns: 1fr 1.4fr; gap: 15px; }
.indexed-values span { display: block; color: #777368; font-size: 8px; }
.indexed-values strong { display: block; margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.indexed-rule { height: 1px; margin: 23px 0; background: #aaa69a; }
.indexed-receipt > p { color: #605c53; font-size: 10px; line-height: 1.55; }
.open-receipt { width: 100%; display: flex; justify-content: space-between; margin-top: 24px; border: 0; padding: 12px 13px; color: white; background: var(--blue); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.open-receipt:hover { background: #1736bd; }
.indexed-notes { margin: 25px 0 0; }
.indexed-notes div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid #c7c3b7; }
.indexed-notes dt { color: #777368; font-size: 8px; }
.indexed-notes dd { margin: 0; font-size: 9px; line-height: 1.35; }

.toast { position: fixed; z-index: 40; right: 18px; bottom: 18px; max-width: min(360px, calc(100% - 36px)); padding: 11px 14px; color: white; background: var(--ink); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .16s ease; }
.toast.is-visible { opacity: 1; transform: none; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .direction-classic { grid-template-columns: 1fr; gap: 48px; padding: 48px 22px 80px; }
  .classic-intro { position: static; max-width: 620px; margin-inline: auto; }
  .receipt-classic { max-width: 620px; margin-inline: auto; }
  .direction-printer.is-active { grid-template-columns: 1fr; padding: 50px 24px 80px; }
  .printer-copy { max-width: 650px; }
  .printer-machine { justify-self: center; }
  .index-layout { grid-template-columns: 1fr; }
  .indexed-receipt { position: static; }
}

@media (max-width: 620px) {
  .study-bar { height: auto; align-items: stretch; flex-direction: column; padding: 0; }
  .study-brand { padding: 14px 16px 10px; }
  .study-tabs { width: 100%; height: 42px; }
  .study-tab { min-width: 0; flex: 1; padding: 0 7px; border-top: 1px solid #bbb7a9; }
  .direction-classic { padding: 34px 12px 70px; }
  .classic-intro { padding: 0 7px; }
  .classic-intro h1 { font-size: 46px; }
  .receipt-classic { padding: 39px 20px 46px; }
  .receipt-summary { grid-template-columns: 1fr 1fr; }
  .receipt-summary div:first-child { grid-column: 1 / -1; }
  .receipt-line { gap: 10px; }
  .receipt-line time { width: 42px; }
  .receipt-line small { margin-left: 42px; }
  .direction-printer.is-active { padding: 38px 12px 70px; }
  .printer-copy { padding: 0 8px; }
  .printer-copy h1 { font-size: 50px; }
  .paper-feed { width: calc(100% - 24px); padding: 23px 15px 28px; }
  .feed-lines div { gap: 8px; font-size: 8px; }
  .feed-lines strong { font-size: 8px; }
  .printer-housing { padding: 0 18px; }
  .direction-index { padding: 34px 13px 60px; }
  .index-header { align-items: start; flex-direction: column; }
  .index-total { text-align: left; }
  .index-controls { grid-template-columns: 1fr; padding: 14px 0; }
  .index-table-head, .authority-row { grid-template-columns: minmax(0, 1fr) 84px; }
  .index-table-head span:nth-child(2), .authority-row > span:nth-child(2) { display: none; }
  .indexed-receipt { padding: 20px 18px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
