/* YearWise
   One accent (amber) and only for things that need attention.
   Everything else is warm off-white on near-black, separated by hairlines. */

/* Draws the dollar sign from fonts with a single vertical stroke. */
@font-face { font-family: "Single Dollar Serif"; src: local("Georgia"), local("Times New Roman"); unicode-range: U+0024; }
@font-face { font-family: "Single Dollar Mono"; src: local("Menlo"), local("DejaVu Sans Mono"), local("Consolas"); unicode-range: U+0024; }

:root {
  --ground: #0E0D0C;
  --surface: #161412;
  --seg: #1A1816;
  --seg-on: #34302C;
  --toast: #262320;
  --text: #F2EDE6;
  --muted: #A39C93;
  --dim: #8A847C;
  --line: rgba(242, 237, 230, 0.09);
  --line-soft: rgba(242, 237, 230, 0.06);
  --line-input: rgba(242, 237, 230, 0.16);
  --amber: #E2A847;
  --serif: "Single Dollar Serif", "Newsreader", Georgia, serif;
  --serif-text: "Newsreader", Georgia, serif;
  --mono: "Single Dollar Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--ground); }
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.45; }
a { color: var(--text); }
input::placeholder { color: var(--dim); }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid rgba(242, 237, 230, 0.7); outline-offset: 2px; border-radius: 6px; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.icon { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon svg { display: block; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Shell ---------- */

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.year { display: flex; align-items: center; }
.year-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--text); min-width: 4ch; text-align: center; }
.actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 22px;
}
.icon-btn.sm { width: 32px; height: 44px; color: var(--muted); }
.icon-btn.add-phone { margin-right: -10px; }

.avatar {
  width: 44px; height: 44px; padding: 0;
  border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar span {
  width: 30px; height: 30px; border-radius: 15px;
  border: 1px solid var(--line-input);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}

.add-desk { display: none; }

.note {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted);
  padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}

.layout { display: flex; flex-direction: column; gap: 28px; }
.side, .main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }

/* ---------- Category: phone segmented control ---------- */

.seg {
  display: grid; gap: 2px; padding: 2px;
  border-radius: 10px; background: var(--seg);
}
.seg button {
  min-height: 36px; padding: 0 8px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--text); font-weight: 500; }
.seg.many { display: flex; overflow-x: auto; scrollbar-width: none; }
.seg.many::-webkit-scrollbar { display: none; }
.seg.many button { flex: 0 0 auto; padding: 0 14px; overflow: visible; }

/* ---------- Hero ---------- */

.hero { display: flex; flex-direction: column; gap: 12px; }
.hero-label { font-size: 15px; color: var(--muted); }
.hero-amt { font-family: var(--serif); font-size: 64px; line-height: 0.95; letter-spacing: -0.025em; }
.hero-progress { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.bar { height: 2px; background: rgba(242, 237, 230, 0.1); display: flex; }
.bar .fill { background: var(--text); width: 0; transition: width 0.4s ease; }
.hero-foot { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- Overdue line (only when needed) ---------- */

.overdue {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 0;
  border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: transparent; text-align: left;
}
.overdue-text { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.overdue-end { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.overdue-sum { font-family: var(--mono); font-size: 14px; color: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 3px; background: var(--amber); flex: none; }

/* ---------- Category: desktop list ---------- */

.cats { display: none; flex-direction: column; }
.cats h2 { margin: 0 0 8px; font-weight: 400; }
.cat-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0;
  border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; color: var(--muted);
  font-size: 15px; text-align: left;
}
.cat-row[aria-pressed="true"] { color: var(--text); }
.cat-row:hover { color: var(--text); }
.cat-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cat-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { width: 6px; height: 6px; border-radius: 3px; border: 1px solid rgba(242, 237, 230, 0.25); flex: none; }
.cat-row[aria-pressed="true"] .mark { background: var(--text); border: 0; }
.cat-nums { display: flex; gap: 16px; align-items: baseline; }
.cat-count { font-size: 13px; color: var(--dim); white-space: nowrap; }
.cat-total { font-family: var(--mono); font-size: 14px; min-width: 64px; text-align: right; }

/* ---------- Month grid ---------- */

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.tile {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 10px;
  min-height: 92px; padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(242, 237, 230, 0.07);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s ease;
}
.tile.is-paid, .tile.is-empty { background: transparent; }
.tile.is-empty { border: 1px dashed rgba(242, 237, 230, 0.1); }
.tile.is-selected { border: 1.5px solid var(--text); }
.tile-top { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 13px; }
.tile-label { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.tile.is-now .tile-label, .tile.is-selected .tile-label { color: var(--text); }
.now-dot { width: 4px; height: 4px; border-radius: 2px; background: var(--text); }
.tile .check { color: var(--dim); }
.tile-amt { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--text); white-space: nowrap; }
.tile.is-paid .tile-amt, .tile.is-empty .tile-amt { color: var(--dim); }
.tile-count { font-size: 13px; color: var(--dim); }

/* ---------- List ---------- */

.list { display: flex; flex-direction: column; scroll-margin-top: 16px; }
.list-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.list-title { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.list-title h2 { font-family: var(--serif-text); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; }
.link-btn {
  background: none; border: 0; padding: 6px 0;
  font-size: 14px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(163, 156, 147, 0.5);
}
.list-sum { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.views { display: flex; gap: 24px; font-size: 15px; flex-basis: 100%; }
.views button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 10px 0 6px; color: var(--muted); }
.views button[aria-pressed="true"] { border-bottom-color: var(--text); color: var(--text); }

.thead { display: none; }

.row {
  display: flex; align-items: center; gap: 10px;
  min-height: 68px;
  border-bottom: 1px solid var(--line-soft);
}
.ring {
  width: 44px; height: 44px; margin-left: -12px; flex: none;
  border: 0; background: transparent; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.ring-dot {
  width: 20px; height: 20px; border-radius: 10px;
  border: 1.5px solid rgba(242, 237, 230, 0.5);
  display: flex; align-items: center; justify-content: center;
  color: var(--ground);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ring[aria-pressed="true"] .ring-dot { background: var(--text); border-color: var(--text); }
.row.is-late .ring-dot { border-color: rgba(226, 168, 71, 0.75); }

.c-bill {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 0; border: 0; background: transparent; text-align: left;
}
.c-bill .name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-bill .meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-bill .meta:empty { display: none; }
.meta-desk { display: none; }
.c-amt { font-family: var(--mono); font-size: 16px; white-space: nowrap; }
.c-month, .c-cat, .c-act { display: none; }
.row.is-paid .name, .row.is-paid .c-amt { color: var(--dim); }

.empty { padding: 24px 0; font-size: 15px; color: var(--muted); }

.pill-btn {
  min-height: 36px; padding: 0 14px;
  border-radius: 18px; border: 1px solid var(--line-input);
  background: transparent; color: var(--text);
  font-size: 13px; white-space: nowrap;
}
.pill-btn.quiet { border-color: transparent; color: var(--muted); }

/* ---------- Welcome (no bills yet) ---------- */

.welcome {
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px; border: 1px solid var(--line); border-radius: 12px;
}
.welcome h2 { font-family: var(--serif-text); font-weight: 400; font-size: 26px; letter-spacing: -0.01em; }
.welcome p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.welcome .buttons { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.app.is-new .side, .app.is-new .grid, .app.is-new .list { display: none; }
.app.is-new .welcome { max-width: 560px; }
.set-row .text-btn { font-size: 14px; color: var(--dim); flex: none; }
.set-row .text-btn.warn { color: var(--amber); }

/* ---------- Buttons ---------- */

.btn {
  min-height: 44px; padding: 0 20px;
  border-radius: 22px; border: 1px solid var(--text);
  background: var(--text); color: var(--ground);
  font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line-input); font-weight: 400; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--amber); border-color: rgba(226, 168, 71, 0.4); font-weight: 400; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; inset: auto auto calc(24px + env(safe-area-inset-bottom)) 50%;
  margin: 0; border: 0; overflow: visible;
  width: max-content;
  transform: translate(-50%, 12px); opacity: 0;
  display: flex; align-items: center; gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px; min-height: 48px;
  border-radius: 12px; background: var(--toast); color: var(--text);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 15px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.plain { padding-right: 16px; }
.toast button {
  border: 0; background: transparent; color: var(--text); font-weight: 500;
  min-height: 36px; padding: 0 10px; border-radius: 8px;
}

/* ---------- Sheets ---------- */

dialog.sheet {
  width: 100%; max-width: 640px; max-height: calc(100dvh - 20px - env(safe-area-inset-top));
  margin: auto auto 0; padding: 0;
  border: 0; border-top: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  background: var(--ground); color: var(--text);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.6); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
  .toast, .bar .fill, .tile, .ring-dot { transition: none; }
}

.sheet-body {
  display: flex; flex-direction: column; gap: 28px;
  padding: 12px 20px calc(32px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; background: var(--ground); margin: -12px -20px 0; padding: 12px 20px 0; z-index: 1; }
.grabber { align-self: center; width: 36px; height: 5px; border-radius: 3px; background: rgba(242, 237, 230, 0.22); }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; }
.sheet-bar .title { font-size: 17px; font-weight: 500; }
.bar-btn { min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 17px; }
.bar-btn.start { justify-self: start; color: var(--muted); }
.bar-btn.end { justify-self: end; color: var(--text); font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.f-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.f-input {
  width: 100%; min-width: 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-input); border-radius: 0;
  padding: 6px 0 10px; font-size: 17px;
}
.f-input:focus { outline: none; border-bottom-color: var(--text); }
.f-input.big { font-family: var(--serif-text); font-size: 30px; letter-spacing: -0.01em; padding-bottom: 12px; }
.amount { display: flex; align-items: baseline; gap: 4px; border-bottom: 1px solid var(--line-input); padding: 6px 0 10px; }
.amount:focus-within { border-bottom-color: var(--text); }
.amount span { font-family: var(--mono); font-size: 17px; color: var(--muted); }
.amount input { border: 0; background: transparent; padding: 0; font-family: var(--mono); font-size: 17px; width: 100%; min-width: 0; }
.amount input:focus { outline: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0 0 12px; }

.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.chip {
  min-height: 44px; border-radius: 8px;
  border: 1px solid rgba(242, 237, 230, 0.12); background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--ground); border-color: var(--text); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line-input); background: transparent; color: var(--text);
  font-size: 15px;
}
.pill[aria-pressed="true"] { background: var(--text); color: var(--ground); border-color: var(--text); }
.pill.new { border-style: dashed; border-color: rgba(242, 237, 230, 0.2); color: var(--muted); }
.pill-input {
  min-height: 44px; width: 160px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--text); background: transparent; font-size: 15px;
}
.pill-input:focus { outline: none; }

.segmented {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-input); border-radius: 22px; padding: 3px;
}
.segmented button { min-height: 40px; border: 0; border-radius: 19px; background: transparent; color: var(--muted); font-size: 15px; }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--ground); font-weight: 500; }
.segmented + .hint { margin-top: 10px; }

.check-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.check-row label, .check-text { display: flex; flex-direction: column; gap: 3px; }
.check-row .main-text { font-size: 16px; }
.check-row .sub { font-size: 13px; color: var(--muted); }
input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--text); flex: none; }

.form-error { color: var(--amber); font-size: 14px; }
.form-error:empty { display: none; }

.danger-zone { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.text-btn { background: none; border: 0; padding: 10px 0; color: var(--muted); font-size: 15px; }
.text-btn.warn { color: var(--amber); }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- Settings ---------- */

.set-section { display: flex; flex-direction: column; }
.set-section > h3 { font-weight: 400; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; border-bottom: 1px solid var(--line-soft);
}
.set-row .k { color: var(--muted); font-size: 15px; flex: none; }
.set-row .v { font-size: 15px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row input.inline {
  flex: 1 1 auto; min-width: 0; text-align: right;
  background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0;
  padding: 8px 0; font-size: 15px;
}
.set-row input.inline:focus { outline: none; border-bottom-color: var(--text); }
.set-row input.inline.left { text-align: left; }
.set-stack { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.set-stack.plain { border-bottom: 0; padding-top: 0; }
.set-section .check-row { border-top: 0; border-bottom-color: var(--line-soft); }
.set-section .cat-count { flex: none; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status { font-size: 13px; color: var(--muted); }

/* ---------- Sign in ---------- */

.auth {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 28px; }
.auth-card .brand-mark { display: block; margin-bottom: 20px; }
.auth-card h1 { font-family: var(--serif-text); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: -0.02em; }
.auth-card .lede { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 12px; }
.auth-switch { color: var(--muted); font-size: 15px; }
.auth-switch button { background: none; border: 0; padding: 6px 0; color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

.boot-msg { min-height: 60dvh; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* ---------- Tablet ---------- */

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Desktop ---------- */

@media (min-width: 960px) {
  .app { max-width: 1200px; padding: 0 40px 64px; gap: 48px; }
  .top { min-height: 88px; border-bottom: 1px solid var(--line); }
  .brand { gap: 20px; }
  .year { gap: 2px; }
  .year-num { font-family: var(--serif-text); font-size: 22px; letter-spacing: 0; }
  .icon-btn.sm { width: 36px; height: 36px; }
  .actions { gap: 12px; }
  .add-phone { display: none; }
  .add-desk {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 20px;
    border: 1px solid rgba(242, 237, 230, 0.18); border-radius: 22px;
    background: transparent; font-size: 15px;
  }
  .add-desk:hover { border-color: rgba(242, 237, 230, 0.35); }
  kbd {
    font-family: var(--mono); font-size: 11px; color: var(--dim);
    border: 1px solid rgba(242, 237, 230, 0.14); border-radius: 4px; padding: 1px 5px;
  }

  .layout { flex-direction: row; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
  .side { flex: 1 1 280px; max-width: 340px; gap: 40px; position: sticky; top: 32px; }
  .main { flex: 999 1 560px; gap: 40px; }

  .seg { display: none; }
  .cats { display: flex; }
  .hero-amt { font-size: 80px; line-height: 0.92; letter-spacing: -0.03em; }
  .hero-progress { padding-top: 12px; }
  .overdue-end .icon { display: none; }

  .grid { grid-template-columns: repeat(auto-fit, minmax(min(108px, 100%), 1fr)); }
  .tile { min-height: 104px; padding: 14px; gap: 12px; }
  .tile:hover:not(.is-selected) { border-color: rgba(242, 237, 230, 0.2); }
  .tile-amt { font-size: 24px; }

  .list { gap: 8px; }
  .list-head { padding-bottom: 0; border-bottom: 0; align-items: center; gap: 24px; }
  .list-sum { display: none; }
  .views { flex-basis: auto; }
  .views button { padding: 10px 0; }

  .table { overflow-x: auto; }
  .table-inner { min-width: 600px; display: flex; flex-direction: column; }
  .thead, .row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 120px 110px 112px; align-items: center; gap: 0; }
  .thead {
    min-height: 44px; border-bottom: 1px solid var(--line);
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted);
  }
  .thead .r { text-align: right; padding-right: 12px; }
  .row { min-height: 64px; font-size: 15px; }
  .row:hover { background: rgba(242, 237, 230, 0.015); }
  .ring { display: none; }
  .c-month { display: block; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
  .row.is-late .c-month { color: var(--amber); }
  .c-bill { padding: 10px 12px 10px 0; gap: 2px; }
  .c-bill .name { font-size: 15px; }
  .c-bill:hover .name { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(242, 237, 230, 0.3); }
  .meta-phone { display: none; }
  .meta-desk { display: block; }
  .c-cat { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
  .c-amt { text-align: right; padding-right: 12px; font-size: 15px; }
  .c-act { display: flex; justify-content: flex-end; }
  .empty { padding: 28px 0; }

  dialog.sheet {
    max-width: 480px; margin: auto;
    border: 1px solid var(--line); border-radius: 14px;
    max-height: calc(100dvh - 64px);
  }
  .grabber { display: none; }
  .sheet-body { padding: 16px 28px 32px; }
  .sheet-head { margin: -16px -28px 0; padding: 16px 28px 0; }
}
