/* The Plan. Paper, wine ink, one amber accent. Playfair carries dates and numbers; Inter does the work. */
:root {
  --paper: #FBF7F1; --wash: #F3EAE0; --ink: #3A1818; --muted: #8A6C64; --rule: #E6DACB;
  --amber: #B8721C; --amber-ink: #8F5713; --coral: #D9442A; --green: #4E7A5A; --white: #FFFDFA;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: Inter, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --nav-h: 58px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
a { color: var(--amber-ink); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; line-height: 1.15; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }
.hidden, [hidden] { display: none !important; }

/* header */
.top { padding: calc(14px + env(safe-area-inset-top, 0px)) 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.top .brand { font-family: var(--serif); font-size: 17px; letter-spacing: .01em; }
.top .who { font-size: 13px; color: var(--muted); }
.top .who button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.hero { padding: 6px 0 18px; border-bottom: 1px solid var(--rule); }
.hero .days { font-family: var(--serif); font-size: 44px; line-height: 1; }
.hero .days small { font-size: 17px; color: var(--muted); font-family: var(--sans); margin-left: 8px; }
.hero .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--white); border-top: 1px solid var(--rule); display: flex; z-index: 20; }
.nav button { flex: 1; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.nav button .n { font-family: var(--serif); font-size: 19px; line-height: 1; color: var(--ink); }
.nav button.on { color: var(--ink); }
.nav button.on .n { color: var(--amber); }
.nav button.on::after { content: ''; width: 22px; height: 2px; background: var(--amber); border-radius: 1px; margin-top: 1px; }

/* screens */
.screen { padding: 14px 0 30px; }
.section { margin-top: 26px; }
.section > h2 { font-size: 22px; margin-bottom: 8px; }
.section > h2 .count { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 8px; }
.section > p.lead { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip { border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--white); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.btn { border: 1px solid var(--ink); border-radius: 8px; padding: 8px 14px; font-size: 14px; background: var(--white); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.quiet { border-color: var(--rule); color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* item rows */
.rows { border-top: 1px solid var(--rule); }
.row { border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 40px 1fr; padding: 12px 0 12px; align-items: start; }
.row .tick { width: 26px; height: 26px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; background: var(--white); transition: background .15s, border-color .15s; }
.row .tick.waiting { border-color: var(--amber); background: linear-gradient(90deg, var(--amber) 50%, var(--white) 50%); }
.row .tick.done { border-color: var(--green); background: var(--green); }
.row .tick.done::after { content: ''; width: 7px; height: 12px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.row .tick:active { transform: scale(.92); }
.row .body { min-width: 0; }
.row .meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.row .when { font-family: var(--serif); font-size: 17px; }
.row .when.today, .row .when.overdue { color: var(--coral); }
.row .when.soon { color: var(--amber-ink); }
.row .owner { font-size: 12.5px; color: var(--muted); }
.row .title { margin-top: 1px; font-size: 15.5px; line-height: 1.35; }
.row.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .sub .age { color: var(--coral); }
.row .more { display: none; margin-top: 10px; }
.row.expanded .more { display: block; }
.row .detail { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.row .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.notes { margin-top: 12px; }
.note { font-size: 14px; padding: 8px 10px; background: var(--wash); border-radius: 8px; margin-top: 6px; white-space: pre-wrap; }
.note .by { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.addnote { display: flex; gap: 8px; margin-top: 8px; }
.addnote input { flex: 1; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; background: var(--white); min-width: 0; }
.edit { display: grid; gap: 8px; margin-top: 10px; padding: 12px; background: var(--wash); border-radius: 10px; }
.edit label { font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.edit input, .edit select, .edit textarea { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; background: var(--white); width: 100%; }
.edit textarea { min-height: 90px; }
.edit .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 0; }

/* vendors */
.vendor { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.vendor .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; cursor: pointer; }
.vendor h3 { font-size: 20px; }
.vendor .role { font-size: 13px; color: var(--muted); }
.vendor .status { margin-top: 6px; font-size: 14px; }
.vendor .more { display: none; margin-top: 10px; }
.vendor.expanded .more { display: block; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 14px; margin-top: 10px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.send { margin-top: 14px; }
.send h4 { font: 500 15px var(--serif); margin: 0 0 6px; }
.send pre { white-space: pre-wrap; font: 13.5px/1.5 var(--sans); background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: 12px; margin: 0; }
.send .actions { display: flex; gap: 8px; margin-top: 8px; }
.linked { margin-top: 10px; font-size: 14px; }
.linked li { margin: 3px 0; }

/* the day */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--rule); margin-top: 4px; }
.tabs button { padding: 10px 0; font-family: var(--serif); font-size: 19px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--amber); }
.timeline { border-top: 1px solid var(--rule); }
.tl { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tl .t { font-family: var(--serif); font-size: 19px; }
.tl .l { font-size: 15.5px; }
.tl .w { font-size: 13px; color: var(--amber-ink); }
.tl .n { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.plan { margin-top: 12px; }
.plan h3 { font-size: 18px; margin-bottom: 4px; }
.plan .cap { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.plan svg { width: 100%; height: auto; display: block; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--rule); }
.steps li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.steps li b { font: 500 17px var(--serif); }
.crew { display: grid; gap: 8px; margin-top: 8px; }
.crew label { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.crew input { border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 2px; color: var(--ink); }
.crew input:focus { outline: none; border-bottom-color: var(--amber); }
.list { padding-left: 18px; margin: 6px 0; font-size: 14.5px; }
.list li { margin: 4px 0; }
.contacts { list-style: none; padding: 0; margin: 6px 0 0; }
.contacts li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.contacts .r { color: var(--muted); font-size: 13px; }
.contacts a { margin-right: 12px; }
.groups h4 { font: 500 16px var(--serif); margin: 12px 0 4px; }

/* numbers */
.big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.big div { padding: 12px 12px 10px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; }
.big b { display: block; font: 500 30px/1 var(--serif); }
.big span { font-size: 12.5px; color: var(--muted); }
.big .warn b { color: var(--coral); }
.flags { margin: 12px 0 0; padding: 0; list-style: none; }
.flags li { padding: 10px 12px; border-left: 3px solid var(--coral); background: var(--white); margin-top: 8px; font-size: 14px; border-radius: 0 8px 8px 0; }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 8px; }
.inputs label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.inputs input { border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 2px; font: 500 20px var(--serif); color: var(--ink); width: 100%; }
.inputs input:focus { outline: none; border-bottom-color: var(--amber); }
.inputs label.check { grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.inputs label.check input { width: 18px; height: 18px; }
.table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14.5px; }
.table td { padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table td:last-child { text-align: right; font-family: var(--serif); font-size: 17px; white-space: nowrap; }
.table tr.total td { font-weight: 600; }
.table td .q { color: var(--muted); font-size: 13px; }
.saved { font-size: 13px; color: var(--green); margin-left: 10px; }

/* login */
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 22px; text-align: center; }
.login h1 { font-size: 30px; }
.login p { color: var(--muted); font-size: 14px; }
.login input { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 11px 12px; background: var(--white); margin-top: 10px; }
.login button { width: 100%; margin-top: 14px; }
.login .err { color: var(--coral); font-size: 14px; margin-top: 10px; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; display: flex; gap: 14px; z-index: 30; box-shadow: 0 6px 20px rgba(58,24,24,.18); }
.toast button { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 700px) { .big b { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .nav, .top .who, .toolbar, .chips, .addnote, .actions, .edit { display: none !important; }
  body { padding: 0; background: #fff; }
  .row .more, .vendor .more { display: block; }
}
