body { min-height: 100dvh; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 64px; }

.bar { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent) !important; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 20px; }
.pill { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.pill.on { color: var(--paid); border-color: currentColor; }
.pill.off { color: var(--wait); border-color: currentColor; }

.tabs { display: flex; max-width: 640px; margin: 0 auto; padding: 8px 16px 0; gap: 4px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 0; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-image: var(--grad) 1; }

h2 { font-size: 20px; margin: 28px 0 4px; letter-spacing: -.02em; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: 14px; color: var(--muted); }
.field span { font-weight: 500; }
.field input, .field textarea, textarea { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-size: 16px; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 14px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > .primary, .row > .secondary { flex: 1; min-width: 140px; }
.grow { flex: 1; min-width: 160px; }
.indent { padding-left: 26px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 15px; }
.check input { margin-top: 4px; }

.primary, .secondary, .danger { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border-radius: 12px; padding: 13px 16px; font-weight: 600; cursor: pointer; border: 1px solid transparent; text-align: center; }
.primary { background: var(--grad); color: var(--brand-ink); box-shadow: 0 6px 20px rgba(25, 199, 155, .25); }
.secondary { background: var(--paper); border-color: var(--line); }
.danger { background: var(--paper); border-color: var(--stop); color: var(--stop); }
.primary:disabled { opacity: .6; cursor: progress; }
.link { border: 0; background: none; color: var(--brand); text-decoration: underline; padding: 0; cursor: pointer; }
.file { position: relative; }

.demo, .nudge { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.demo p { margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chips button:hover { border-color: var(--brand); }

/* verdict */
#result:empty { display: none; }
.verdict { margin: 16px 0; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); border: 2px solid var(--line); overflow: hidden; }
.verdict > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 18px 4px; flex-wrap: wrap; }
.stamp { font-weight: 900; font-size: 34px; letter-spacing: -.02em; }
.amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.say { margin: 0 18px 12px; font-size: 17px; font-weight: 500; }
.verdict.paid { border-color: var(--paid); } .verdict.paid header, .verdict.paid .say { color: var(--paid); } .verdict.paid > header { background: var(--paid-bg); }
.verdict.stop { border-color: var(--stop); } .verdict.stop header, .verdict.stop .say { color: var(--stop); } .verdict.stop > header { background: var(--stop-bg); }
.verdict.wait { border-color: var(--wait); } .verdict.wait header, .verdict.wait .say { color: var(--wait); } .verdict.wait > header { background: var(--wait-bg); }
.verdict.paid .say, .verdict.stop .say, .verdict.wait .say { padding-top: 0; }
.checks { list-style: none; margin: 0; padding: 0 18px 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.checks li::before { font-weight: 800; }
.checks li.ok::before { content: '✓'; color: var(--paid); }
.checks li.bad::before { content: '✗'; color: var(--stop); }
.checks li.unk::before { content: '?'; color: var(--wait); }
.looks { margin: 0 18px; font-size: 14px; color: var(--muted); }
.looks:empty { display: none; }
.looks ul { margin: 4px 0 8px; padding-left: 18px; }
.read { margin: 4px 18px 12px; font-size: 14px; }
.read summary { cursor: pointer; color: var(--muted); }
.read dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0; }
.read dt { color: var(--muted); }
.read dd { margin: 0; font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.read dd.rej { color: var(--stop); text-decoration: line-through; }
.meta { color: var(--muted); font-size: 12px; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 16px; }
.actions:empty { display: none; }
.actions button { flex: 1; min-width: 140px; }
.expect { margin: 0 18px 12px; padding: 12px; border-radius: 10px; background: var(--bg); font-size: 15px; }
.expect strong { font-variant-numeric: tabular-nums; }
.shot { display: block; max-height: 220px; margin: 0 auto 12px; border-radius: 8px; border: 1px solid var(--line); }

.working { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 16px 0; }
.working::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* waiting + today */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.wait-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.wait-item:first-of-type { border-top: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.good b { color: var(--paid); } .stat.bad b { color: var(--stop); }
.chainline { padding: 10px 14px; border-radius: 10px; font-size: 15px; margin: 8px 0; }
.chainline.ok { background: var(--paid-bg); color: var(--paid); } .chainline.gap { background: var(--wait-bg); color: var(--wait); }
.book { list-style: none; padding: 0; margin: 0; }
.book li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.book .who { font-weight: 600; }
.book .amt { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.book .cr { color: var(--paid); } .book .blocked { color: var(--stop); text-decoration: line-through; }
.book .sub { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.tag.paid { background: var(--paid-bg); color: var(--paid); } .tag.stop { background: var(--stop-bg); color: var(--stop); } .tag.wait { background: var(--wait-bg); color: var(--wait); } .tag.mine { background: var(--line); color: var(--muted); }

@media (max-width: 420px) {
  .stamp { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
}
