:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182c43;
  background: #f4f6fa;
  color-scheme: light;
  --navy: #142c46;
  --teal: #126a65;
  --ink: #182c43;
  --muted: #4c6279;
  --line: #d5dfe9;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, textarea { border: 1px solid #b5c5d5; border-radius: .5rem; background: var(--white); }
button, input, select { min-height: 2.75rem; padding: .55rem .8rem; }
button { cursor: pointer; font-weight: 650; }
button:hover, button[aria-current="page"] { background: #e7f4f1; border-color: var(--teal); color: #0b554e; }
button:disabled { opacity: .62; cursor: wait; }
button.primary { background: var(--teal); border-color: var(--teal); color: white; }
button.primary:hover { background: #0c5752; }
a { color: var(--teal); font-weight: 650; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #147e76; outline-offset: 3px; }
textarea { width: 100%; padding: .65rem; min-height: 5.4rem; resize: vertical; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.04em; line-height: 1.1; margin-bottom: .5rem; }
h2 { font-size: 1.3rem; letter-spacing: -.022em; }
h3 { margin: .7rem 0 .45rem; font-size: 1.14rem; letter-spacing: -.016em; }
p { line-height: 1.5; }
[hidden] { display: none !important; }
.frame { max-width: 1250px; padding: 0 1.5rem; margin: 0 auto; }
.masthead { color: white; background: var(--navy); }
.masthead-inner { min-height: 4.65rem; display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.wordmark { color: white; font-size: clamp(1rem, 3vw, 1.25rem); text-decoration: none; letter-spacing: -.02em; }
.wordmark span { font-weight: 450; color: #cbdaea; }
.account { display: flex; align-items: center; gap: .65rem; }
.account button { color: white; border-color: #7187a1; background: transparent; min-height: 2.2rem; font-size: .84rem; }
.account button:hover { background: #284a69; }
main.frame { padding-top: 1.75rem; padding-bottom: 3rem; }
.hero { padding: 1.6rem 0 1.1rem; }
.hero p { color: var(--muted); margin-bottom: 0; }
nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.15rem 0 1.55rem; }
nav button { font-size: .9rem; }
.muted { color: var(--muted); font-size: .88rem; }
.grid, .stats { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.panel, .stat, .record { background: var(--white); border: 1px solid var(--line); border-radius: .85rem; padding: 1.2rem; }
.stat strong { display: block; font-size: 1.85rem; margin-top: .3rem; letter-spacing: -.04em; }
.panel + .panel { margin-top: .9rem; }
.scout { border-left: 4px solid #2b817b; margin-bottom: 1.35rem; }
.scout p:last-child, .record p:last-child { margin-bottom: 0; }
.split, .filters, .actions, .tags { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.split { justify-content: space-between; align-items: baseline; }
.filters { margin: .65rem 0; }
.filters input { flex: 1; min-width: 11rem; }
.tags { gap: .4rem; }
.tag { background: #e8eef5; padding: .28rem .55rem; border-radius: .35rem; font-size: .78rem; font-weight: 650; }
.tag.possible { background: #fff0d3; color: #714805; }
.tag.confirmed { background: #def2e8; color: #0e5c42; }
.tag.failed { background: #fee5e5; color: #882529; }
.amount { font-weight: 750; font-size: 1.3rem; }
.card-dates { margin: .8rem 0; }
.record details { border-top: 1px solid var(--line); padding: .7rem 0; }
summary { cursor: pointer; font-weight: 650; }
details p { margin: .65rem 0; white-space: pre-wrap; }
.actions { padding-top: .6rem; }
.actions select { width: min(100%, 17rem); }
.form-label { display: block; margin: .75rem 0 .35rem; font-weight: 650; }
.form-input { width: 100%; }
.form-actions { margin-top: .8rem; }
.login { width: min(100%, 30rem); margin: clamp(2rem, 9vh, 6rem) auto; padding: 1.8rem; }
.login .primary { width: 100%; margin-top: 1.1rem; }
.flash { border: 1px solid #b7d6d0; background: #e6f3ef; padding: .75rem 1rem; border-radius: .6rem; margin-bottom: .8rem; }
.flash.error { background: #fff0eb; border-color: #edc5b8; color: #8b3323; }
.deadline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .8rem; padding: .8rem .15rem; border-bottom: 1px solid var(--line); }
.deadline:last-child { border-bottom: 0; }
.deadline input { width: 1.15rem; height: 1.15rem; min-height: unset; accent-color: var(--teal); margin-top: .15rem; }
.deadline strong { display: block; }
.deadline.done strong { text-decoration: line-through; }
.deadline time { font-size: .84rem; font-weight: 750; }
.source { border-bottom: 1px solid var(--line); padding: .65rem 0; }
.source:last-child { border-bottom: 0; }
.source p { margin: .25rem 0; }
@media (max-width: 730px) {
  .frame { padding-left: .85rem; padding-right: .85rem; }
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .hero { padding-top: .65rem; }
  nav { gap: .35rem; }
  nav button { font-size: .84rem; padding: .4rem .55rem; min-height: 2.45rem; }
  .filters select { max-width: 100%; }
  .deadline { grid-template-columns: auto minmax(0, 1fr); }
  .deadline time { grid-column: 2; }
}
