:root {
  --ink: #17342e;
  --soft: #4f6660;
  --line: #cfdcd6;
  --ledger: #eef4f0;
  --paper: #fbfdfc;
  --amber: #a85405;
  --amber-bg: #fdf0df;
  --stop: #a3211a;
  --stop-bg: #fbe7e4;
  --clear: #1f6b4f;
  --clear-bg: #e2f2ea;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --letter: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; background: var(--ledger); color: var(--ink); font: 15px/1.45 var(--sans); }
h1, h2, h3, p, ul, blockquote { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 2.6; }
.mark .second { stroke: var(--amber); }
.brand h1 { font-size: 21px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; }
.brand p { color: var(--soft); font-size: 14px; }
.ai-status { color: var(--soft); font-size: 13.5px; text-align: right; }
.ai-status.is-ready { color: var(--clear); }
.ai-status.is-off { color: var(--amber); }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); }
.inbox { display: flex; flex-direction: column; min-height: 0; padding: 16px 18px 16px 24px; gap: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 13.5px; }
.filter.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.search { margin-left: auto; }
.search input { width: 170px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.ghost { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; background: transparent; font-size: 13.5px; }
.grid { flex: 1; min-height: 300px; }

.chip { display: inline-block; padding: 1px 9px; border-radius: 5px; font-size: 13px; font-weight: 600; line-height: 22px; white-space: nowrap; }
.chip.stop { background: var(--stop-bg); color: var(--stop); }
.chip.look { background: var(--amber-bg); color: var(--amber); }
.chip.clear { background: var(--clear-bg); color: var(--clear); }
.chip.wait { color: var(--soft); font-weight: 400; }
.status-paid { color: var(--clear); font-weight: 600; }
.status-held { color: var(--stop); font-weight: 600; }

.add { display: grid; gap: 6px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.add > label { font-weight: 600; }
.add textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; background: #fff; }
.add-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; }
.inline input { flex: 1; min-width: 0; max-width: 240px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.primary { white-space: nowrap; padding: 8px 16px; border: 0; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 600; }
.note { color: var(--soft); font-size: 13px; }

.detail { position: relative; min-height: 0; overflow-y: auto; padding: 22px 26px; background: var(--paper); border-left: 1px solid var(--line); }
.empty { padding-top: 48px; text-align: center; color: var(--soft); }
.empty h2 { color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.verdict { display: inline-block; padding: 3px 12px; border-radius: 6px; font-weight: 700; }
.verdict.stop { background: var(--stop-bg); color: var(--stop); }
.verdict.look { background: var(--amber-bg); color: var(--amber); }
.verdict.clear { background: var(--clear-bg); color: var(--clear); }
.detail h2 { margin-top: 12px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.amount { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
blockquote { margin-top: 10px; padding: 12px 14px; background: var(--ledger); font-family: var(--letter); font-size: 15.5px; line-height: 1.5; }
.summary { margin-top: 12px; font-weight: 600; }
.detail h3 { margin-top: 16px; font-size: 14px; font-weight: 650; }
.why, .checks { margin-top: 4px; padding-left: 18px; color: var(--soft); }
.why li, .checks li { margin-top: 3px; }
.why .source { font-size: 12.5px; color: var(--soft); opacity: 0.85; }

.decide { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.hold { background: var(--stop); }
.hold.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.gate { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; }
.type { display: grid; gap: 4px; }
.type input { width: 150px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.paypal { min-height: 46px; }
.paypal.is-locked { display: none; }
.receipt { margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: var(--clear-bg); color: var(--clear); font-weight: 600; overflow-wrap: anywhere; }

/* The one flourish: a stamp lands when a payment is held. */
.stamp { position: absolute; top: 22px; right: 24px; padding: 2px 14px; border: 3px solid var(--stop); border-radius: 6px; color: var(--stop); font-size: 22px; font-weight: 800; letter-spacing: 0.04em; transform: rotate(-8deg); animation: stamp 260ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.9); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 24px; background: var(--paper); border-top: 1px solid var(--line); color: var(--soft); font-size: 13px; }

@media (max-width: 900px) {
  body { height: auto; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .inbox { padding: 14px; }
  .grid { height: 420px; flex: none; }
  .detail { border-left: 0; border-top: 1px solid var(--line); padding: 18px 16px; }
  .top { flex-wrap: wrap; padding: 12px 16px; }
  .ai-status { text-align: left; }
  .search { margin-left: 0; }
}
