/* Cove Admin. One stylesheet for every page. */

/* Anything marked hidden stays hidden, whatever its class sets display to.
   Without this, buttons like "Delete this expense" showed on a new expense. */
[hidden] { display: none !important; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/atkinson-hyperlegible-next.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --page: #f4f7f7;
  --surface: #ffffff;
  --surface-alt: #f8fafa;
  --ink: #152221;
  --muted: #586866;
  --line: #dfe7e6;
  --line-soft: #eef2f1;
  --field: #9fb2b0;
  --accent: #0f766e;
  --accent-hover: #0b5953;
  --accent-soft: #e3f4f1;
  --warn: #8a3c0a;
  --warn-soft: #fdf0e3;
  --info: #1d4f86;
  --info-soft: #e8f1fb;
  --quiet-soft: #eef2f1;
  --quiet: #3d4b49;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1514;
    --surface: #172120;
    --surface-alt: #111918;
    --ink: #e6eeed;
    --muted: #9dafad;
    --line: #2a3634;
    --line-soft: #223029;
    --field: #4d605d;
    --accent: #2bb3a3;
    --accent-hover: #4cc7b8;
    --accent-soft: #143a35;
    --warn: #f0a868;
    --warn-soft: #3a2614;
    --info: #8cbcf0;
    --info-soft: #182a3f;
    --quiet-soft: #223029;
    --quiet: #c3d0ce;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: Lexend, system-ui, sans-serif; margin: 0; font-weight: 600; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: Lexend, system-ui, sans-serif; font-weight: 600; font-size: 20px; padding: 0 12px 20px; }
.nav { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav:hover { background: var(--quiet-soft); color: var(--ink); }
.nav[aria-current="page"] { background: var(--accent); color: #ffffff; }
@media (prefers-color-scheme: dark) { .nav[aria-current="page"] { color: #0b1f1d; } }
.main { min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; max-width: 1100px; width: 100%; }
.main.narrow { max-width: 860px; }

.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.big { font-family: Lexend, system-ui, sans-serif; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.good { color: var(--accent); }
.warn { color: var(--warn); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.g2 > .span-all { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.span2 { grid-column: span 2; }

.btn, .btn2, .tab { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn { background: var(--accent); color: #ffffff; border: 0; }
.btn:hover { background: var(--accent-hover); color: #ffffff; }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #0b1f1d; } }
.btn2 { background: var(--surface); color: var(--ink); border: 1px solid var(--field); }
.btn2:hover { background: var(--quiet-soft); color: var(--ink); }
.btn[disabled], .btn2[disabled] { opacity: 0.6; cursor: progress; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 44px; }
.tab { border-radius: 999px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); padding: 0 16px; }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in { color: var(--accent); font-weight: 700; }
tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
tr.group th { padding-top: 20px; color: var(--ink); }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
.scroll { overflow-x: auto; position: relative; }
.tablecard { padding: 8px 12px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.p-me { background: var(--warn-soft); color: var(--warn); }
.p-them { background: var(--info-soft); color: var(--info); }
.p-new { background: var(--accent-soft); color: var(--accent-hover); }
.p-done { background: var(--quiet-soft); color: var(--quiet); }
@media (prefers-color-scheme: dark) { .p-new { color: var(--accent); } }

.bar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); border-radius: 99px; }
.bar.warning > div { background: var(--warn); }

.field { display: flex; flex-direction: column; gap: 6px; }
label, .label { font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); min-height: 44px; padding: 8px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); width: 100%; }
input[type="radio"] { width: 22px; height: 22px; min-height: 22px; padding: 0; }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
.check input { width: 22px; min-height: 22px; height: 22px; }
.drop { border: 2px dashed var(--field); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--surface-alt); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.calc { background: var(--accent-soft); color: var(--accent-hover); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.calc:empty { display: none; }
@media (prefers-color-scheme: dark) { .calc { color: var(--accent); } }

.card.attention { border-color: var(--warn); background: var(--warn-soft); }
.card.attention h2 { color: var(--warn); }
.due { display: inline-block; font-size: 14px; font-weight: 600; color: var(--muted); }
.due.soon { color: var(--warn); }
.notice { border-radius: 12px; padding: 12px 16px; background: var(--info-soft); color: var(--info); }
.notice.error { background: var(--warn-soft); color: var(--warn); }
.notice:empty { display: none; }

.msg { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.msg.in { background: var(--surface-alt); color: var(--ink); font-weight: 400; }
.msg.out { background: var(--accent-soft); }
.msg.note { background: var(--warn-soft); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.log { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; border-bottom: 1px solid var(--line-soft); }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; border-bottom: 1px solid var(--field); }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .colbar { background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; }
.weeks { display: flex; gap: 10px; }
.weeks span { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 24px; max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

@media (max-width: 860px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .brand { width: 100%; padding: 0 12px 8px; }
  .main { padding: 20px 16px; }
  .g4, .g3, .g2, .split { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
}
.gap16 { gap: 16px; }
.gap12 { gap: 12px; }
.gap8 { gap: 8px; }
h3.usage-service { font-size: 15px; margin: 0; }
.usage-unmeasured summary { cursor: pointer; font-weight: 600; }
.usage-unmeasured ul { list-style: none; padding: 0; margin: 12px 0 0; }
select.auto { width: auto; }
.bar > div { width: 0; }

/* Surveys */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.results { display: flex; flex-direction: column; gap: 16px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(0, 3fr) 88px; gap: 12px; align-items: center; }
.hbar .num { color: var(--muted); }
.hbar.unknown span:first-child { font-style: italic; }
@media (max-width: 760px) { .hbar { grid-template-columns: minmax(0, 1fr) 72px; } .hbar .bar { grid-column: 1 / -1; grid-row: 2; } }
.money-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: baseline; }
@media (max-width: 760px) { .money-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.grow { flex: 1 1 240px; width: auto; }
.tab.count { gap: 8px; }

/* Growth */
.chart.dense { gap: 2px; height: 140px; }
.chart.dense .colbar { border-radius: 3px 3px 0 0; }
.checks { display: flex; flex-direction: column; gap: 12px; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.check-row h3 { margin: 0; font-size: 16px; }
.check-row p { margin: 0; grid-column: 1 / -1; }
.check-row .val { font-variant-numeric: tabular-nums; font-weight: 700; }
.lv-good { background: var(--accent-soft); color: var(--accent-hover); }
.lv-watch { background: var(--info-soft); color: var(--info); }
.lv-act { background: var(--warn-soft); color: var(--warn); }
.lv-wait { background: var(--quiet-soft); color: var(--quiet); }
@media (prefers-color-scheme: dark) { .lv-good { color: var(--accent); } }
.pad { padding: 4px 12px; }
.subhead { margin: 8px 0 0; font-size: 15px; }

/* Sign-in page (login.html) */
.signin { max-width: 440px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 16px; }
.signin h1 { margin: 0; text-align: center; }
.signin-logo { align-self: center; width: 96px; height: 96px; border-radius: 22px; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.people li:last-child { border-bottom: 0; }

/* What an equipment class covers, under its dropdown on the expense page. */
.cca-def { display: grid; gap: 4px; font-size: 0.9rem; }
.cca-def:empty { display: none; }
.cca-def p { margin: 0; }

/* Settings (the gear on every page), the Overview's hello, and the
   first-paying-household celebration. */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gear { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); text-decoration: none; }
.gear:hover { background: var(--quiet-soft); color: var(--ink); }
.gear[aria-current="page"] { background: var(--accent); color: #ffffff; }
.hello-row { display: flex; align-items: center; gap: 16px; }
.cove-pic { flex: none; width: 80px; height: 80px; object-fit: contain; }
.greeting { margin: 0; font-family: Lexend, system-ui, sans-serif; font-weight: 600; font-size: 26px; line-height: 1.2; }
.allow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.choices legend { font-weight: 700; padding: 0 0 6px; }
.choices .check { align-items: flex-start; padding: 6px 0; }
.choices .check input { margin-top: 2px; flex: none; }
.small.block { display: block; }
.celebrate { border: 0; border-radius: 18px; padding: 32px 28px 24px; max-width: min(420px, calc(100vw - 32px)); text-align: center; background: var(--surface); color: var(--ink); overflow: hidden; }
.celebrate[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.celebrate::backdrop { background: rgb(0 0 0 / 0.45); }
.celebrate h2, .celebrate p { margin: 0; position: relative; }
.celebrate img { position: relative; object-fit: contain; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.9; }
.confetti i:nth-child(1) { left: 8%; background: #0f766e; }
.confetti i:nth-child(2) { left: 20%; background: #f2a541; animation-delay: 0.5s; }
.confetti i:nth-child(3) { left: 33%; background: #e45a84; animation-delay: 1.1s; }
.confetti i:nth-child(4) { left: 47%; background: #4fc2b4; animation-delay: 0.2s; }
.confetti i:nth-child(5) { left: 60%; background: #f2a541; animation-delay: 1.6s; }
.confetti i:nth-child(6) { left: 72%; background: #e45a84; animation-delay: 0.8s; }
.confetti i:nth-child(7) { left: 84%; background: #0f766e; animation-delay: 2s; }
.confetti i:nth-child(8) { left: 94%; background: #4fc2b4; animation-delay: 1.3s; }
@media (prefers-reduced-motion: no-preference) {
  .confetti i { animation: confetti-fall 3.4s linear infinite; }
  @keyframes confetti-fall { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(460px) rotate(320deg); } }
}
@media (prefers-reduced-motion: reduce) {
  .confetti i:nth-child(odd) { top: 12%; }
  .confetti i:nth-child(even) { top: 70%; }
}
@media (max-width: 760px) { .brand { width: 100%; } }

/* "?" page help, the walk-through, home's extras, kind words, colours. */
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.help-btn { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--field); background: var(--surface); color: var(--muted); font: inherit; font-size: 16px; font-weight: 700; line-height: 1; vertical-align: middle; cursor: pointer; }
.help-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.page-help { margin: 0; max-width: 60ch; background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; }
dialog.tour { display: none; max-width: min(520px, calc(100vw - 32px)); }
dialog.tour[open] { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
dialog.tour .cove-pic { width: 96px; height: 96px; }
.tour-text { margin: 0; font-size: 17px; }
.side a.tour-lit { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) { dialog.tour[open] { grid-template-columns: 1fr; justify-items: start; } }
.card.milestone { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
.card.milestone img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.card.milestone .stack { flex: 1 1 200px; }
.card.milestone h2 { margin: 0; }
.card.milestone p { margin: 0; }
.kind-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kind { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.kind blockquote { margin: 0; font-size: 16px; }
.kind figcaption { color: var(--muted); font-size: 14px; }
.small-btn { min-height: 36px; padding: 0 12px; align-self: flex-start; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 99px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; font-weight: 700; }
.swatch-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--swatch, #0f766e); flex: none; }
.hello-row .grow { flex: 1 1 200px; }
.hello-row { flex-wrap: wrap; }

/* Choosing the Overview's Cove */
.cove-pick-btn { flex: none; padding: 0; border: 0; background: none; border-radius: 16px; cursor: pointer; }
.cove-pick-btn:hover .cove-pic, .cove-pick-btn:focus-visible .cove-pic { transform: scale(1.06); }
.cove-pick-btn .cove-pic { transition: transform 0.15s ease; }
dialog.cove-picker { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px); border: 0; border-radius: 18px; padding: 20px; background: var(--surface); color: var(--ink); }
dialog.cove-picker::backdrop { background: rgba(0, 0, 0, 0.35); }
.cove-picker h2 { margin: 0; }
.cove-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cove-choice { padding: 6px; border: 2px solid transparent; border-radius: 14px; background: transparent; cursor: pointer; min-height: 44px; }
.cove-choice:hover { border-color: var(--line); }
.cove-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.cove-choice img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .cove-pick-btn .cove-pic { transition: none; } }

/* Learn: the article form and its preview */
textarea.tall { min-height: 320px; }
.checklist { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.checklist .todo { color: var(--warn); }
.checklist .ok { color: var(--accent); font-weight: 600; }
.article-preview { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; max-height: 480px; overflow: auto; line-height: 1.6; }
.article-preview h2 { font-size: 20px; margin: 18px 0 6px; }
.article-preview blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--accent); }
.article-file { white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--info-soft); padding: 12px; border-radius: 10px; max-height: 320px; overflow: auto; }

/* The Overview's Cove: a column of its own beside the greeting and
   whatever sits under it, as tall as that space, never stretched. */
.home-top { display: grid; grid-template-columns: clamp(132px, 16vw, 200px) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 32px); align-items: center; }
.home-top .cove-pick-btn { justify-self: center; align-self: stretch; display: flex; align-items: center; }
.cove-pic.cove-big { width: 100%; height: auto; max-height: 240px; min-height: 0; aspect-ratio: auto; }
@media (max-width: 560px) {
  .home-top { grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 14px; }
  .home-top .cove-pick-btn { align-self: start; }
  .cove-pic.cove-big { max-height: 120px; }
}
