/* Daybook: graph paper and highlighter strokes. */

:root {
  --paper: #edf1ef;
  --sheet: #fbfcfb;
  --field: #f4f7f5;
  --ink: #16202a;
  --ink-2: #4b5763;
  --ink-3: #86919b;
  --rule: #e1e7e4;
  --rule-2: #c9d3cf;
  --hover: rgba(22, 32, 42, 0.035);
  --live: #e5484d;
  --focus: #2f6feb;
  --danger: #c8323a;
  --on-color: #10171e;
  --blend: multiply;
  --shadow: 0 14px 36px rgba(16, 24, 32, 0.14), 0 2px 6px rgba(16, 24, 32, 0.08);
  /* Vazirmatn picks up Persian text the Latin face doesn't cover. */
  --font: 'Archivo', 'Vazirmatn', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-fa: 'Vazirmatn', 'Archivo', ui-sans-serif, system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11161b;
    --sheet: #182027;
    --field: #1e2730;
    --ink: #e7ecef;
    --ink-2: #a3aeb8;
    --ink-3: #6c7883;
    --rule: #222b33;
    --rule-2: #33404a;
    --hover: rgba(255, 255, 255, 0.035);
    --danger: #f06a70;
    --blend: normal;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--rule-2); border-radius: 8px;
  background: var(--sheet); cursor: pointer;
  font-weight: 500; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.icon { width: 36px; padding: 0; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn.primary:hover { opacity: 0.88; }
.btn.wide { width: 100%; height: 42px; }
.btn[disabled] { opacity: 0.5; cursor: progress; }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2);
}
.link:hover { text-decoration-color: currentColor; }
.link.danger { color: var(--danger); }

.text-input, .field input, .field select, .note textarea {
  width: 100%; height: 38px; padding: 0 10px;
  border: 1px solid var(--rule-2); border-radius: 8px;
  background: var(--field); color: var(--ink);
}
.text-input:hover, .field input:hover, .field select:hover, .note textarea:hover { border-color: var(--ink-3); }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select { font-size: 15px; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; }
.form-error[hidden] { display: none; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: clamp(12px, 3vw, 28px);
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--rule-2);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-stretch: 125%; font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  text-decoration: none;
}
.brand .mark { width: 24px; height: 24px; }
.views { display: flex; gap: 2px; }
.views a {
  padding: 6px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.views a:hover { color: var(--ink); }
.views a[aria-current="page"] { color: var(--ink); background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-2); }
.account {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  font-weight: 500; color: var(--ink-2); max-width: 40vw;
}
.account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account:hover { color: var(--ink); }
.account svg { width: 14px; height: 14px; flex: none; }

/* ---------- Page ---------- */
.main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 64px; }

.day-head {
  display: grid; grid-template-columns: 1fr auto; align-items: end;
  gap: 10px 24px; margin: clamp(20px, 4vw, 36px) 0 18px;
}
.title { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; line-height: 0.95; }
.title .big {
  font-stretch: 125%; font-weight: 800;
  font-size: clamp(40px, 7.4vw, 80px); letter-spacing: -0.03em;
}
.title .small {
  font-stretch: 75%; font-weight: 500;
  font-size: clamp(18px, 2.4vw, 26px); color: var(--ink-2); letter-spacing: 0.005em;
}
.day-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.date-input {
  height: 36px; padding: 0 8px;
  border: 1px solid var(--rule-2); border-radius: 8px; background: var(--sheet);
}
.summary { grid-column: 1 / -1; margin: 6px 0 0; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.summary strong { color: var(--ink); font-weight: 700; font-stretch: 87.5%; font-variant-numeric: tabular-nums; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 500; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }

/* ---------- The sheet ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 14px; overflow: hidden; }
.grid-scroll { overflow-x: auto; }
.grid { min-width: 720px; --hours: 10; }

.row {
  display: grid;
  grid-template-columns: 54px minmax(130px, 220px) minmax(0, 1fr) 84px;
  min-height: 50px;
  border-bottom: 1px solid var(--rule);
}
.row:not(.row-head):hover { background: var(--hover); }
.row-head { min-height: 36px; border-bottom-color: var(--rule-2); }

.cell-toggle { display: flex; align-items: center; justify-content: center; }
.cell-toggle .dot { width: 12px; height: 12px; }
.toggle {
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 2px solid var(--c); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: transform 120ms ease;
}
.toggle svg { width: 14px; height: 14px; }
.toggle:hover { background: color-mix(in srgb, var(--c) 16%, transparent); }
.toggle:active { transform: scale(0.92); }
.toggle[aria-pressed="true"] { background: var(--c); color: var(--on-color); }

.cell-name {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-width: 0; padding: 4px 12px 4px 2px;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.cell-name .name { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-name .since { font-size: 12px; color: var(--ink-2); font-stretch: 87.5%; white-space: nowrap; }
.row.is-running .cell-name .since { color: var(--ink); }

.track, .hours { position: relative; border-left: 1px solid var(--rule-2); }
.track {
  background-image:
    linear-gradient(to right, var(--rule-2) 1px, transparent 1px),
    linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / var(--hours)) 100%, calc(100% / (var(--hours) * 4)) 100%;
  cursor: crosshair;
  touch-action: pan-x pan-y;
}
.hour {
  position: absolute; top: 50%; transform: translateY(-50%);
  padding-left: 6px; white-space: nowrap;
  font-size: 12px; font-stretch: 75%; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Highlighter strokes: multiply lets the grid lines show through, like ink on graph paper. */
.bar {
  position: absolute; top: 10px; bottom: 10px; min-width: 4px;
  padding: 0; border: 0; border-radius: 4px;
  background: var(--c); mix-blend-mode: var(--blend);
  cursor: pointer;
}
.bar:hover { filter: saturate(1.15) brightness(0.96); }
.bar:focus-visible { outline-offset: 1px; mix-blend-mode: normal; }
.bar.is-live { border-radius: 4px 0 0 4px; }
.bar.is-live::after {
  content: ''; position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 3px var(--sheet);
  animation: tip 1.8s ease-in-out infinite;
}
@keyframes tip {
  50% { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 8px color-mix(in srgb, var(--c) 28%, transparent); }
}
.bar.ghost { mix-blend-mode: normal; opacity: 0.55; pointer-events: none; outline: 2px dashed var(--c); outline-offset: 1px; }
.ghost-label {
  position: absolute; bottom: calc(100% + 4px); left: 0; white-space: nowrap;
  font-size: 12px; font-weight: 600; font-stretch: 87.5%;
  background: var(--ink); color: var(--sheet); padding: 1px 6px; border-radius: 4px;
}

.now { position: absolute; top: 0; bottom: -1px; width: 2px; margin-left: -1px; background: var(--live); pointer-events: none; z-index: 2; }
.now-label {
  position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  background: var(--live); color: #fff; border-radius: 999px; padding: 1px 7px;
  font-size: 11px; font-weight: 600; font-stretch: 87.5%; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cell-total {
  display: flex; align-items: center; justify-content: flex-end; padding-right: 18px;
  font-weight: 600; font-stretch: 87.5%; font-variant-numeric: tabular-nums;
}
.cell-total.head { font-size: 12px; font-weight: 500; color: var(--ink-2); }

.empty { padding: 28px 24px 22px 54px; color: var(--ink-2); max-width: 640px; }
.empty strong { display: block; color: var(--ink); font-size: 17px; font-weight: 700; font-stretch: 112.5%; margin-bottom: 2px; }

.add-row { display: grid; grid-template-columns: 54px minmax(0, 420px) auto; justify-content: start; align-items: center; gap: 0 10px; padding: 10px 12px 12px 0; }
.swatch {
  justify-self: center; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  border: 2px solid var(--sheet); background: var(--c); box-shadow: 0 0 0 1px var(--rule-2); cursor: pointer;
}
.swatch:hover { box-shadow: 0 0 0 1px var(--ink-3); }

/* ---------- Daily report ---------- */
.day-report { margin: 30px 0 0; }
.report-head h2 { margin: 0; font-size: 20px; font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.01em; }
.report-head .hint { margin: 2px 0 14px; color: var(--ink-2); }
.report-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 28px; align-items: start; }
.report-fields .note { grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); }
.note-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea { font-size: 15px; font-weight: 400; color: var(--ink); }
.note.blockers .note-task { color: var(--ink); }

.report-preview {
  position: sticky; top: 16px;
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 14px; overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--rule);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.preview-text {
  margin: 0; padding: 16px 18px; max-height: min(60vh, 560px); overflow: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.8;
}
.preview-text:lang(fa) { font-family: var(--font-fa); line-height: 1.95; }
.preview-actions { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--rule); }
.preview-actions .btn.primary { flex: 1; }

.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.seg button { border: 0; background: none; padding: 4px 10px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg button[lang="fa"] { font-family: var(--font-fa); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

/* ---------- Notes ---------- */
.notes { margin: 30px 0 0; max-width: 820px; }
.notes h2 { margin: 0; font-size: 20px; font-weight: 700; font-stretch: 112.5%; letter-spacing: -0.01em; }
.notes .hint { margin: 2px 0 14px; color: var(--ink-2); }
.note { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; align-items: start; padding: 10px 0; border-top: 1px solid var(--rule-2); }
.note-task { display: flex; align-items: center; gap: 8px; font-weight: 500; padding-top: 8px; min-width: 0; }
.note-task span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-task small { color: var(--ink-2); font-weight: 400; font-stretch: 87.5%; margin-left: auto; padding-left: 8px; font-variant-numeric: tabular-nums; }
.note textarea { height: auto; min-height: 38px; padding: 8px 10px; resize: vertical; line-height: 1.45; }

/* ---------- Week report ---------- */
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.report table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 720px; }
.report th, .report td { padding: 12px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.report th:first-child, .report td:first-child { text-align: left; padding-left: 18px; }
.report th:last-child, .report td:last-child { padding-right: 18px; }
.report thead th { font-size: 12px; font-weight: 600; font-stretch: 87.5%; color: var(--ink-2); border-bottom-color: var(--rule-2); }
.report thead a { text-decoration: none; }
.report thead a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.report .is-today { background: var(--hover); }
.report td.zero { color: var(--ink-3); }
.report .task-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.report td.total, .report th.total { font-weight: 700; font-stretch: 87.5%; }
.report tfoot th, .report tfoot td { border-bottom: 0; border-top: 1px solid var(--rule-2); font-weight: 700; font-stretch: 87.5%; }
.share { display: block; height: 4px; border-radius: 2px; background: var(--c); margin-top: 6px; mix-blend-mode: var(--blend); }

.done-day { padding: 14px 0; border-top: 1px solid var(--rule-2); }
.done-day h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; display: flex; gap: 12px; align-items: baseline; }
.done-day h3 small { font-weight: 500; color: var(--ink-2); font-stretch: 87.5%; font-variant-numeric: tabular-nums; }
.done-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.done-day li { display: grid; grid-template-columns: 10px minmax(120px, 200px) 64px 1fr; gap: 10px; align-items: baseline; }
.done-day li .dot { transform: translateY(-1px); }
.done-day li .d { text-align: right; font-stretch: 87.5%; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.done-day li .n { color: var(--ink); display: grid; gap: 2px; }
.done-day li .left { color: var(--ink-2); }
.done-day h3 a { text-decoration: none; }
.done-day h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.blocker { margin: 8px 0 0 20px; color: var(--ink); }
.blocker strong { font-weight: 600; color: var(--danger); }
.report-actions .seg { align-self: center; }

/* ---------- People ---------- */
.panel { padding: 18px 20px; margin-bottom: 16px; display: grid; gap: 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.switch-text { display: grid; gap: 2px; }
.switch-text strong { font-weight: 600; }
.switch-text span { color: var(--ink-2); font-size: 14px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 44px; height: 26px; border-radius: 999px; position: relative;
  background: var(--rule-2); transition: background 140ms ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 140ms ease;
}
.switch:checked { background: #1fa88a; }
.switch:checked::after { transform: translateX(18px); }
.add-person { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 300px) auto; justify-content: start; gap: 10px; align-items: end; padding-top: 18px; border-top: 1px solid var(--rule); }

.people th, .people td { text-align: left; }
.people td { vertical-align: middle; }
.people th:last-child, .people td:last-child { text-align: right; }
.person { display: grid; }
.person-name { font-weight: 500; }
.person-email { color: var(--ink-2); font-size: 13px; }
.people tr.is-off .person-name, .people tr.is-off .person-email { color: var(--ink-3); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, #1fa88a 16%, transparent); color: var(--ink);
}
.badge.off { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn.small { height: 30px; padding: 0 10px; font-size: 14px; }

.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  margin-bottom: 16px; padding: 16px 20px; border-radius: 14px;
  background: color-mix(in srgb, #f0b429 16%, var(--sheet)); border: 1px solid color-mix(in srgb, #f0b429 55%, var(--rule-2));
}
.notice-text { max-width: 62ch; }
.notice-text p { margin: 2px 0 0; color: var(--ink-2); }
.secret { display: flex; align-items: center; gap: 8px; }
.secret code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: 8px; background: var(--sheet); border: 1px solid var(--rule-2); user-select: all;
}

.pop-menu { display: grid; gap: 2px; }
.pop-menu .pop-title { margin-bottom: 0; }
.pop-menu .pop-meta { margin: 0 0 8px; }
.menu-item {
  display: grid; text-align: left; gap: 1px; padding: 8px 10px; margin: 0 -6px;
  border: 0; border-radius: 8px; background: none; cursor: pointer; font-weight: 500;
}
.menu-item small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }

/* ---------- Popover ---------- */
.pop {
  position: absolute; z-index: 50; width: 312px; max-width: calc(100vw - 24px);
  background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 12px;
  padding: 14px; box-shadow: var(--shadow);
}
.pop form { display: grid; gap: 12px; margin: 0; }
.pop-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; min-width: 0; }
.pop-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-meta { margin: -6px 0 0; font-size: 13px; color: var(--ink-2); }
.pop-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.pop-actions .link:first-child { margin-right: auto; }
.pop-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.running-now { height: 38px; display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 400; }
.swatches { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.swatches legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--sheet); box-shadow: 0 0 0 1px var(--rule-2); }
.sw input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.sw input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.menu-email { margin: 0; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 460px) 1fr; }
.auth-panel {
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 48px clamp(20px, 5vw, 56px);
  background: var(--sheet); border-right: 1px solid var(--rule-2);
}
.auth-title { margin: 16px 0 0; font-size: clamp(34px, 4vw, 44px); font-stretch: 125%; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.lede { margin: 0; color: var(--ink-2); font-size: 16px; max-width: 34ch; }
.auth-form { display: grid; gap: 12px; margin-top: 6px; }
.switch { margin: 0; color: var(--ink-2); }
.auth-art { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: clamp(24px, 5vw, 64px); overflow: hidden; }
.auth-art .sheet { pointer-events: none; }
.auth-art .grid { min-width: 0; }
.auth-art .row { grid-template-columns: 48px 150px minmax(0, 1fr) 64px; }
.auth-art .cell-total { padding-right: 14px; }
.auth-art .caption { margin: 0; color: var(--ink-2); max-width: 52ch; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--sheet); padding: 10px 16px; border-radius: 10px;
  font-weight: 500; transition: opacity 160ms ease, transform 160ms ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dragging, body.dragging * { cursor: ew-resize !important; user-select: none; }

/* ---------- Small screens ---------- */
@media (max-width: 1080px) {
  .report-wrap { grid-template-columns: 1fr; }
  .report-preview { position: static; }
}
@media (max-width: 1180px) {
  .auth { grid-template-columns: 1fr; }
  .auth-panel { border-right: 0; background: transparent; width: 100%; max-width: 480px; margin: 0 auto; }
  .auth-art { display: none; }
}
@media (max-width: 760px) {
  .day-head { grid-template-columns: 1fr; }
  .day-nav { justify-content: flex-start; }
  /* The timeline scrolls sideways; the play buttons and names stay put. */
  .row { grid-template-columns: 48px 124px minmax(0, 1fr) 68px; }
  .row > :nth-child(1), .row > :nth-child(2) { position: sticky; z-index: 4; background: var(--sheet); }
  .row > :nth-child(1) { left: 0; }
  .row > :nth-child(2) { left: 48px; box-shadow: 1px 0 0 var(--rule-2); }
  .add-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .add-person { grid-template-columns: 1fr; }
  .people table { min-width: 640px; }
  .note { grid-template-columns: 1fr; }
  .note-task { padding-top: 0; }
  .note-fields { grid-template-columns: 1fr; }
  .report-fields .note { grid-template-columns: 1fr; }
  .done-day li { grid-template-columns: 10px 1fr auto; }
  .done-day li .n { grid-column: 2 / -1; }
  .add-row { grid-template-columns: 54px minmax(0, 1fr) auto; }
}
@media (max-width: 480px) {
  .views a { padding: 6px 8px; }
  .account span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bar.is-live::after { animation: none; }
  .toggle, #toast { transition: none; }
}

/* ---------- Print ---------- */
@media print {
  :root { --paper: #fff; --sheet: #fff; --blend: normal; }
  body { font-size: 12px; }
  .topbar, .day-nav, .add-row, .report-actions, .no-print, .toggle, .preview-actions, .seg { display: none !important; }
  .report-preview { position: static; }
  .preview-text { max-height: none; overflow: visible; }
  .main { padding: 0; max-width: none; }
  .sheet { border-color: #bbb; break-inside: avoid; }
  .grid, .report table { min-width: 0; }
  .grid-scroll { overflow: visible; }
  .bar.is-live::after { display: none; }
  .note textarea { border: 0; padding: 0; resize: none; background: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
