/* Tipbook — styled after a server's guest check pad: pale green paper,
   green ruled lines, green ink, and the red of the printed check number. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo.woff2) format("woff2-variations"), url(../fonts/archivo.woff2) format("woff2");
}

:root {
  --paper: #eef4ee;
  --paper-2: #e2ece3;
  --sheet: #fbfdfb;
  --ink: #1e4d3b;
  --ink-soft: #4f7363;
  --ink-faint: #7d9a8c;
  --rule: #bcd3c4;
  --rule-strong: #8fb39e;
  --red: #c4303a;
  --red-soft: #f5dadb;
  --on-ink: #f4faf5;
  --focus: #2f7dd1;
  --shadow: 0 -8px 30px rgba(20, 50, 38, 0.18);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --tabbar-h: 62px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Night mode: back-of-house after close. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1b16;
    --paper-2: #14231c;
    --sheet: #18291f;
    --ink: #d7eadd;
    --ink-soft: #a3c2b0;
    --ink-faint: #6e8d7c;
    --rule: #26392f;
    --rule-strong: #375244;
    --red: #ff6b72;
    --red-soft: #3a1e22;
    --on-ink: #0f1b16;
    --focus: #79b4ff;
    --shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1b16; --paper-2: #14231c; --sheet: #18291f; --ink: #d7eadd; --ink-soft: #a3c2b0;
  --ink-faint: #6e8d7c; --rule: #26392f; --rule-strong: #375244; --red: #ff6b72; --red-soft: #3a1e22;
  --on-ink: #0f1b16; --focus: #79b4ff; --shadow: 0 -8px 30px rgba(0, 0, 0, 0.5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: pan-x pan-y; } /* scroll, but no pinch or double-tap zoom */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { font-stretch: 78%; font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-stretch: 90%; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.num { font-stretch: 70%; font-weight: 700; }
.neg { color: var(--red); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app shell ---------- */
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 760px; margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-name { font-stretch: 70%; font-weight: 800; font-size: 1.35rem; letter-spacing: 0.01em; }
.check-no { color: var(--red); font-stretch: 62%; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.04em; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--sheet);
  border-top: 1px solid var(--rule-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h); text-decoration: none; color: var(--ink-faint);
  font-size: 0.72rem; font-weight: 600; font-stretch: 85%;
}
.tabbar svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.3; }

/* ---------- buttons and forms ---------- */
.btn {
  appearance: none; border: 2px solid var(--ink); background: var(--ink); color: var(--on-ink);
  font: inherit; font-weight: 700; font-stretch: 85%; font-size: 1rem;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-s);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink); border-color: transparent; padding: 0 10px; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.9rem; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  appearance: none; background: transparent; border: 0; color: var(--ink); width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--paper-2); }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; min-width: 0; }
.field label, .field .label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 0.8rem; color: var(--ink-faint); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius-s);
  min-height: 46px; padding: 10px 12px; width: 100%; font-size: 16px; /* 16px stops iOS zooming */
}
textarea { min-height: 70px; resize: vertical; }
/* Drop-downs and date/time pickers: draw them ourselves so phones don't shrink or restyle them,
   and they line up with the text boxes next to them. */
select, input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none; height: 46px; line-height: 1.2;
}
select {
  padding-right: 36px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 18px center, right 13px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; }
::placeholder { color: var(--ink-faint); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
input[type="color"] { padding: 4px; width: 64px; }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.money input { padding-left: 24px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > .field, .row3 > .field { justify-content: flex-end; } /* a two-line label next to a one-line one keeps the boxes level */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.actions .spacer { flex: 1; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--ink); }

.alert { border-left: 4px solid var(--ink); background: var(--paper-2); padding: 10px 14px; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 12px 0; }
.alert.error { border-color: var(--red); background: var(--red-soft); }

/* Ruled section: the guest check's horizontal lines instead of floating cards. */
.ruled { border-top: 1px solid var(--rule-strong); padding: 18px 0 8px; }
.ruled:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--rule); padding: 12px 0; display: flex; align-items: center; gap: 12px; }
.list > li:last-child { border-bottom: 0; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }

/* ---------- auth pages ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px 40px; }
.stub {
  background: var(--sheet); border: 1.5px solid var(--rule-strong); border-radius: var(--radius-m);
  padding: 22px 20px 18px; position: relative;
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px);
  background-position: 0 70px; background-repeat: no-repeat; background-size: 100% calc(100% - 70px);
}
.stub-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.stub-head .brand-name { font-size: 1.9rem; }
.stub-head .check-no { font-size: 1.15rem; }
.stub .field input { background: var(--sheet); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 0.95rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); margin: 16px 0; font-size: 0.9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px dashed var(--rule-strong); }

/* ---------- calendar ---------- */
.month-bar { display: flex; align-items: center; gap: 4px; padding: 14px 0 6px; }
.month-bar h1 { flex: 1; font-size: 1.6rem; }
.month-total { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 22px; padding: 4px 0 14px; }
.month-total .big { font-size: 2.6rem; font-stretch: 66%; font-weight: 800; line-height: 1; grid-column: 1 / -1; }
.month-total .stat { font-size: 0.85rem; color: var(--ink-soft); }
.month-total .stat b { color: var(--ink); font-stretch: 75%; font-size: 1.05rem; }

.cal { border: 2px solid var(--ink); border-radius: var(--radius-s); background: var(--sheet); overflow: hidden; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow div { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); padding: 6px 0; border-bottom: 1.5px solid var(--ink); font-stretch: 85%; }
.cal-cell {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  min-height: 74px; padding: 5px 4px 4px 6px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; min-width: 0;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell > * { pointer-events: none; } /* taps always land on the day button itself */
.cal-cell.out { color: var(--ink-faint); background: var(--paper); }
.cal-cell:active { background: var(--paper-2); }
.cal-cell .d { font-size: 0.85rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; margin: -3px 0 0 -4px; border-radius: 50%; }
.cal-cell.today .d { color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.cal-cell .amt { font-size: 1.12rem; font-stretch: 64%; font-weight: 800; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.cal-cell .sched {
  font-size: 0.7rem; font-weight: 600; font-stretch: 75%; color: var(--ink-soft);
  border: 1.5px dashed var(--rule-strong); border-radius: 4px; padding: 1px 3px; align-self: flex-start; white-space: nowrap; max-width: 100%; overflow: hidden;
}
.cal-cell .dots { display: flex; gap: 3px; position: absolute; top: 8px; right: 6px; }
.cal-cell .dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--ink); }

.welcome { border: 2px dashed var(--rule-strong); border-radius: var(--radius-m); padding: 16px; margin: 0 0 16px; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 25, 18, 0.45); z-index: 50; opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 640px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sheet); border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.open { transform: translateY(0); }
.sheet-backdrop.open { opacity: 1; }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--rule-strong); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sheet-head h2 { font-size: 1.4rem; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; left: 50%; right: auto; width: 560px; border-radius: var(--radius-l); transform: translate(-50%, -40%); opacity: 0; transition: transform 0.22s, opacity 0.22s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
}

.shift-line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.shift-line .grow { flex: 1; min-width: 0; }
.shift-line .amt { font-size: 1.5rem; font-stretch: 66%; font-weight: 800; }
.shift-line .meta { font-size: 0.85rem; color: var(--ink-soft); }

.calc {
  border: 1.5px solid var(--ink); border-radius: var(--radius-s); padding: 10px 12px; margin: 6px 0 14px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.calc div { display: flex; flex-direction: column; }
.calc span { font-size: 0.75rem; color: var(--ink-soft); }
.calc b { font-size: 1.3rem; font-stretch: 68%; font-weight: 800; }

.scan {
  display: flex; gap: 12px; align-items: flex-start; width: 100%;
  border: 1.5px dashed var(--rule-strong); border-radius: var(--radius-s); padding: 12px; margin-bottom: 14px;
  background: var(--paper); color: var(--ink);
}
.scan.drag { border-color: var(--ink); background: var(--paper-2); }
.scan-body { flex: 1; min-width: 0; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.scan svg { width: 28px; height: 28px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scan small { display: block; color: var(--ink-soft); }
.scan-result { font-size: 0.85rem; margin: -6px 0 14px; color: var(--ink-soft); }
.filled { animation: filled 1.2s ease-out; }
@keyframes filled { from { background: color-mix(in srgb, var(--focus) 22%, var(--sheet)); } to { background: var(--sheet); } }

/* ---------- stats ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid var(--ink); border-radius: var(--radius-s); overflow: hidden; margin: 14px 0; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-stretch: 85%; min-height: 40px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.figures { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--ink); }
.figures > div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
/* The lead figure spans both columns, so even children sit on the left. */
.figures > div:nth-child(even) { padding-right: 12px; border-right: 1px solid var(--rule); }
.figures > div:nth-child(odd):not(.lead) { padding-left: 14px; }
.figures span { display: block; font-size: 0.82rem; color: var(--ink-soft); }
.figures b { font-size: 1.7rem; font-stretch: 66%; font-weight: 800; line-height: 1.15; }
.figures .lead { grid-column: 1 / -1; }
.figures .lead b { font-size: 3rem; }
.chart { width: 100%; height: auto; display: block; margin: 8px 0; }
.chart .bar { fill: var(--ink); }
.chart .axis { stroke: var(--rule-strong); }
.chart text { fill: var(--ink-soft); font-size: 20px; font-family: var(--font); font-stretch: 80%; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); padding: 6px 4px; }
.table td { border-bottom: 1px solid var(--rule); padding: 9px 4px; }
.table td.r, .table th.r { text-align: right; }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translate(-50%, -20px);
  background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: var(--radius-s); z-index: 80;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: calc(100% - 32px); font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }
.codes { columns: 2; font-stretch: 80%; font-weight: 700; font-size: 1.1rem; padding: 12px 16px; border: 1.5px dashed var(--ink); border-radius: var(--radius-s); list-style: none; margin: 8px 0; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: var(--radius-s); }
.secret { font-stretch: 80%; font-weight: 700; word-break: break-all; }
details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 10px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details:not(.plain) > summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px; opacity: 0.6; }
details[open]:not(.plain) > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.offline-banner { background: var(--red); color: #fff; text-align: center; font-size: 0.85rem; font-weight: 600; padding: 4px; }

@media (min-width: 560px) {
  .cal-cell { min-height: 92px; padding: 8px; }
  .cal-cell .amt { font-size: 1.4rem; }
  .cal-cell .d { margin: -4px 0 0 -4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- tip-out rows ---------- */
.tipout-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.tipout-row .icon-btn { width: 40px; height: 40px; }
.tipout-row .t-rule { grid-column: 1 / -1; margin-top: -4px; font-size: 0.78rem; color: var(--ink-faint); }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 74px 40px; gap: 6px; align-items: center; margin: 8px 0; }
.rule-row select { padding-left: 8px; padding-right: 22px; background-position: right 11px center, right 6px center; }
.rule-row .icon-btn { width: 40px; height: 40px; }

/* ---------- goals ---------- */
.goals:empty:not(.reserving) { display: none; }
.goals { margin: 0 0 14px; display: grid; gap: 12px; }
.goal-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; color: var(--ink-soft); }
.goal-head b { color: var(--ink); font-stretch: 75%; font-size: 1.05rem; }
.goal-bar { height: 10px; border: 1.5px solid var(--ink); border-radius: 6px; margin: 5px 0 4px; overflow: hidden; background: var(--sheet); }
.goal-bar i { display: block; height: 100%; background: var(--ink); transition: width 0.4s ease-out; }
.goal.done .goal-bar i { background: repeating-linear-gradient(45deg, var(--ink) 0 8px, var(--ink-soft) 8px 16px); }
.goal-foot { font-size: 0.82rem; color: var(--ink-faint); }
#goal-progress { display: grid; gap: 12px; margin-bottom: 4px; }

/* ---------- invites and admin ---------- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; font-size: 0.85rem; min-height: 40px; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; font-stretch: 85%; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 5px; vertical-align: 2px; }
.tag.off { border-color: var(--red); color: var(--red); }
.status-list > li { padding: 8px 0; font-size: 0.92rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 2px; align-self: flex-start; }
.dot.on { background: var(--ink); }
.dot.off { background: transparent; box-shadow: inset 0 0 0 2px var(--red); }
fieldset.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
fieldset.choices .check { align-items: flex-start; padding: 6px 0; }
fieldset.choices .check input { margin-top: 2px; }
.user-row { display: block !important; }
.user-row > details > summary { list-style: none; display: flex; align-items: center; gap: 10px; }
.user-row > details > summary::-webkit-details-marker { display: none; }
.user-row > details > summary::after { margin-right: 6px; }
.user-detail { padding: 4px 0 6px; }
.user-detail .actions form { margin: 0; }

/* ---------- import preview ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.preview-table { font-size: 0.86rem; min-width: 520px; }
.preview-table tr.note td { padding-top: 0; font-size: 0.8rem; border-bottom: 1px solid var(--rule); }
.preview-table tr.st-ok + tr:not(.note) td, .preview-table tr.st-error:not(.note) td, .preview-table tr.st-duplicate:not(.note) td { border-bottom: 0; }
.preview-table tr.st-ok td { border-bottom: 1px solid var(--rule); }
.preview-table tr.st-error td { color: var(--red); }
.preview-table tr.st-duplicate td { color: var(--ink-faint); }

/* ---------- add to home screen tip ---------- */
.install-tip {
  position: fixed; z-index: 40; left: 12px; right: 12px; max-width: 520px; margin: 0 auto;
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius-m);
  padding: 12px 6px 12px 12px; box-shadow: 0 10px 30px rgba(20, 50, 38, 0.22);
  opacity: 0; transform: translateY(12px); transition: opacity 0.25s, transform 0.25s;
}
.install-tip.show { opacity: 1; transform: none; }
.install-tip img { border-radius: 10px; flex: none; }
.install-body { flex: 1; min-width: 0; font-size: 0.92rem; }
.install-body b:first-child { display: block; font-stretch: 85%; font-size: 1rem; margin-bottom: 2px; }
.install-body p { margin: 0 0 4px; color: var(--ink-soft); }
.install-body .actions { margin-top: 8px; gap: 6px; }
.install-body .actions .btn.quiet:first-child, .install-body .actions .hidden + .btn.quiet { padding-left: 0; }
.install-close { width: 36px; height: 36px; margin-top: -6px; flex: none; }
.share-icon { width: 18px; height: 18px; vertical-align: -3px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- support link ---------- */
.support { display: flex; gap: 14px; align-items: flex-start; }
.support .cup { width: 34px; height: 34px; flex: none; margin-top: 2px; stroke: var(--red); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.support p { margin-bottom: 10px; }

/* ---------- passkey list ---------- */
.list > li.passkey-row { display: block; }
.passkey-row form { margin: 0; }
.passkey-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.passkey-foot .faint { font-size: 0.8rem; }
.passkey-buttons { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- shift form: log tips vs. add to schedule ---------- */
.mode-seg { margin: 0 0 12px; }
#shift-form[data-mode="schedule"] .log-only,
#shift-form:not([data-mode="schedule"]) .schedule-only,
#shift-form.editing #repeat-field { display: none !important; }
body[data-time="duration"] #shift-form:not([data-mode="schedule"]) .clock-row { display: none; }
.duration { display: flex; align-items: center; gap: 6px; }
.duration input { width: 0; flex: 1; text-align: center; padding-left: 6px; padding-right: 6px; }
.duration span { color: var(--ink-soft); font-weight: 600; }
.sched-actions { display: flex; align-items: center; gap: 4px; }

.day-loading { padding: 18px 0; text-align: center; }
.app-version { text-align: center; font-size: 0.8rem; margin: 18px 0 4px; }
