/* One token block per scheme, then structure. Calm, one column, prints nothing
   itself: the PDF is the printed thing. */
:root {
    color-scheme: light dark;
    --bg: #f6f7f4;
    --surface: #ffffff;
    --ink: #17191c;
    --muted: #666c75;
    --line: rgba(20, 24, 30, .10);
    --accent: #1f6f5a;
    --accent-ink: #ffffff;
    --danger: #c0392b;
    --radius: 14px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --control-font: 15px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101214; --surface: #181b1f; --ink: #eceef0; --muted: #9aa2ad;
        --line: rgba(255, 255, 255, .10); --accent: #5fc3a6; --accent-ink: #0d1f1a; --danger: #ff7b6b;
    }
}
@media (pointer: coarse) { :root { --control-font: 16px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); }
.en { color: var(--muted); font-weight: normal; }

.top, .page { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.top { padding-top: 36px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
.lead { margin: 0 0 8px; color: var(--muted); }
.lead strong { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 14px; margin: 18px 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input:not([type=checkbox]) { font-size: var(--control-font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; min-height: 42px; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input.invalid { border-color: var(--danger); }
.mono { font-family: var(--mono); }
.check { flex-direction: row; align-items: flex-start; gap: 10px; margin-top: 12px; color: var(--ink); font-size: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 30px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary .en { color: inherit; opacity: .75; }
.btn[disabled] { opacity: .6; cursor: default; }
.status { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--muted); }
.status.err { color: var(--danger); }
.foot { color: var(--muted); font-size: 12.5px; padding-bottom: 40px; }

#toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.out { opacity: 0; transition: opacity .2s; }
.toast-act, .toast-x { background: none; border: 0; color: inherit; cursor: pointer; }

.actions.tight { margin: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history li:first-child { border-top: 0; }
.history .h-no { font-family: var(--mono); min-width: 3ch; }
.history .h-who { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .h-amt { font-variant-numeric: tabular-nums; }
.history .btn { padding: 4px 10px; min-height: 32px; font-size: 13px; }
