:root { color-scheme: light; font-family: system-ui, sans-serif; color: #172a26; background: #edf2ef; --green: #1c684e; --border: #d4dfd9; --muted: #52665d; }
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { max-width: 930px; margin: auto; padding-inline: 18px; }
.top { background: #112824; color: #f1fbf4; }
.top .wrap, .history-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.top .wrap { min-height: 62px; }
.top strong { font-size: 1.1rem; }
.hero { padding: 30px 0 22px; }
h1, h2, p, dl { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 2.7rem); letter-spacing: -.04em; }
h2 { font-size: 1.14rem; letter-spacing: -.02em; }
.hero p, .hint, dialog p { color: var(--muted); }
.hero p { margin-top: 5px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.card, dialog { border: 1px solid var(--border); border-radius: 18px; background: #fff; padding: 20px; min-width: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 16px 0; }
label { display: grid; gap: 5px; font-size: .84rem; font-weight: 650; min-width: 0; }
.fields label { align-content: start; }
.field-hint { font-weight: 400; color: var(--muted); }
input, button { font: inherit; border-radius: 9px; min-height: 44px; }
input { width: 100%; min-width: 0; border: 1px solid #b8c8bf; padding: 8px 9px; color: inherit; background: #fff; font-size: 1rem; }
button { cursor: pointer; border: 1px solid transparent; padding: 8px 13px; font-weight: 650; }
:focus-visible { outline: 3px solid #3c9a76; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .6; }
.primary { background: var(--green); color: #fff; width: 100%; }
.ghost { background: transparent; border-color: #8ea79c; color: inherit; }
.quiet { color: #195c46; background: #edf5f0; }
.money { display: grid; gap: 4px; background: #e5f4ea; border-radius: 13px; padding: 14px; margin: 15px 0 8px; }
.money span, dt { font-size: .86rem; }
.money strong { font-size: clamp(1.7rem, 5vw, 2.3rem); overflow-wrap: anywhere; }
.loss { color: #9e2424; }
.result dl div, .day { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
dd { margin: 0; font-weight: 700; text-align: right; }
.hint, .message { font-size: .82rem; margin-top: 10px; }
.message:empty { display: none; }
.history { margin: 16px 0 24px; }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 4px; }
.totals div { background: #f2f6f3; padding: 9px; border-radius: 9px; }
.totals dt { color: var(--muted); }
.totals dd { text-align: left; margin-top: 4px; overflow-wrap: anywhere; }
.day { display: grid; grid-template-columns: 1fr auto auto; }
.day small { display: block; color: var(--muted); }
.day:last-child { border-bottom: 0; }
dialog { width: min(calc(100% - 32px), 420px); }
dialog::backdrop { background: #112824a8; }
dialog p, dialog form { margin: 12px 0; }
dialog form button { margin-top: 10px; }
@media (max-width: 650px) { .grid { grid-template-columns: 1fr; } .card { padding: 15px; } }
