:root {
  color-scheme: light;
  --ink: #22213a;
  --muted: #5b5871;
  --paper: #f7f5f0;
  --line: #dcd8e2;
  --purple: #47277e;
  --accent: #d9ed66;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.masthead { background: var(--ink); color: white; border-bottom: 5px solid var(--accent); }
.mast-inner, main { width: min(1120px, 100% - 40px); margin-inline: auto; }
.mast-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--accent); text-transform: uppercase; font-weight: 850; font-size: 1.2rem; letter-spacing: .04em; }
.product { margin-left: 18px; padding-left: 18px; border-left: 1px solid #817991; }
main { padding-bottom: 55px; }
.demo { margin: 22px 0 32px; color: var(--muted); font-size: .9rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.07; }
h2 { font-size: 1.25rem; margin-bottom: 14px; }
h3 { font-size: 1.05rem; margin-bottom: 8px; }
.subtitle { color: var(--muted); margin-bottom: 24px; }
.panel { background: white; border: 1px solid var(--line); padding: 22px; border-radius: 10px; margin-top: 20px; }
.login { max-width: 570px; margin: 54px auto; }
.login .panel { padding: 26px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 305px); gap: 22px; }
.area { min-width: 0; }
.row, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.row > label { flex: 1 1 150px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 600; }
label small, .muted { color: var(--muted); font-weight: 400; }
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid #a8a1b6; border-radius: 5px; padding: 9px; width: 100%; background: white; color: var(--ink); }
textarea { min-height: 83px; }
button, .button { border: 1px solid transparent; border-radius: 5px; background: var(--purple); color: white; padding: 9px 14px; cursor: pointer; text-decoration: none; font-weight: 650; display: inline-block; }
button.secondary, .button.secondary { color: var(--purple); background: #f4eefb; border-color: #d9caeb; }
button.quiet { background: transparent; color: inherit; border-color: currentColor; }
button.link { color: var(--purple); background: transparent; padding: 0; text-decoration: underline; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #8662b3; outline-offset: 3px; }
a { color: var(--purple); }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li, .expense { border-top: 1px solid var(--line); padding: 14px 0; }
.notes li:last-child, .expense:last-child { padding-bottom: 0; }
.badge { display: inline-block; font-size: .82rem; background: #eee8f6; color: #3e265c; border-radius: 4px; padding: 4px 7px; }
.badge.approved { background: #e7f1d3; color: #344418; }
.badge.filed { background: #e1eef5; color: #214f64; }
.badge.waiting { background: #ffebd1; color: #6b3509; }
.badge.returned { background: #ffebd1; color: #6b3509; }
.total { font-size: 1.45rem; font-weight: 800; white-space: nowrap; }
.message { padding: 12px 14px; border-radius: 5px; }
.error { background: #ffe5e4; color: #841e22; }
.success { background: #e9f1d8; color: #334618; }
.notice { list-style: none; padding: 0; margin: 0; }
.notice li { border-top: 1px solid var(--line); padding: 10px 0; }
.notice li:last-child { padding-bottom: 0; }
.email-state { display: block; margin-top: 4px; }
.note-header { margin-top: 20px; }
.review-code { margin: 12px 0 0; max-width: 260px; }
.review-actions { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.check { display: flex; }
.check input { width: auto; }
.demo-code { font: 700 1.15rem ui-monospace, monospace; letter-spacing: 2px; }
.receipt-picker { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; margin: 0 0 12px; }
.receipt-picker legend { padding: 0 5px; font-weight: 650; }
.receipt-actions { margin-bottom: 10px; }
.file-source { position: relative; display: inline-flex; align-items: center; min-height: 44px; margin: 0;
  border: 1px solid #d9caeb; border-radius: 5px; padding: 8px 12px; color: var(--purple); background: #f4eefb; }
.file-source input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-source:focus-within { outline: 3px solid #8662b3; outline-offset: 3px; }
.receipt-limits, .receipt-picker [role="status"], .receipt-summary { margin: 8px 0; }
.receipt-files { list-style: none; margin: 8px 0; padding: 0; }
.receipt-files li { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px;
  border-top: 1px solid var(--line); padding: 6px 0; min-width: 0; }
.receipt-files li a, .receipt-files .file-name { flex: 1 1 175px; min-width: 0; overflow-wrap: anywhere; }
.receipt-files li a { display: inline-flex; align-items: center; min-height: 34px; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 470px) {
  .mast-inner, main { width: calc(100% - 24px); }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 15px; }
  .product { display: block; border: 0; padding: 0; margin: 2px 0 0; }
  button, .button, .receipt-files li a { min-height: 44px; }
  input, select, textarea { min-height: 44px; font-size: 1rem; }
  .check input { min-height: auto; }
  .file-source { flex: 1 1 auto; justify-content: center; }
}
