:root {
  --bg: #f3f4f8;
  --card: #ffffff;
  --text: #1b1c22;
  --muted: #8a8d99;
  --line: #e8e9f0;
  --accent: #a85070;     /* muted dusty rose — white text passes AA (5.2:1) */
  --accent-2: #c98aa2;   /* decorative gradient only */
  --accent-deep: #8c4460;
  --note: #10b981;
  --today: #f59e0b;
  --am: #b45309;     /* morning crossover — dark enough for white bg */
  --lunch: #a21caf; /* lunch crossover (holidays / half terms) */
  --school: #475569; /* school run */
  --pm: #0369a1;     /* evening crossover */
  --bh: #e11d48;     /* bank holiday */
  --danger: #e5484d;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 1px 2px rgba(16, 18, 30, .05), 0 10px 26px rgba(16, 18, 30, .06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101116; --card: #1a1b22; --text: #ecedf2; --muted: #888b98; --line: #2a2c36;
    --accent: #c9748f; --accent-2: #dda3b6; --accent-deep: #a85874; --note: #34d399; --today: #fbbf24;
    --am: #fbbf24; --lunch: #e879f9; --school: #94a3b8; --pm: #38bdf8; --bh: #fb7185;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 26px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
}
.app {
  max-width: 540px; margin: 0 auto;
  padding: calc(var(--safe-top) + 8px) 14px calc(var(--safe-bottom) + 30px);
}

/* Header */
.app-header { display: flex; align-items: center; gap: 8px; padding: 8px 4px 4px; }
.app-header h1 { flex: 1; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.icon-btn { border: none; background: var(--card); color: var(--text); width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; box-shadow: var(--shadow); cursor: pointer; flex: none; }
.icon-btn[hidden] { display: none; }
.icon-btn:active { transform: scale(.94); }
#backBtn { font-size: 1.7rem; }

.page[hidden] { display: none; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 14px; }
.card-title { margin: 0 0 12px; font-size: 1rem; font-weight: 700; }

/* Handover */
.handover { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; }
.handover .tonight { margin: 0; font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
.handover .next { margin: 6px 0 0; font-size: .95rem; opacity: .95; }

/* Calendar toolbar */
.cal-toolbar { margin-top: 14px; }
.nav-row { display: flex; align-items: center; justify-content: space-between; }
.nav-btn { border: none; background: transparent; color: var(--text); width: 42px; height: 42px; border-radius: 12px; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.nav-btn:active { background: var(--line); }
.month-label { border: none; background: transparent; color: var(--text); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; cursor: pointer; padding: 6px 12px; border-radius: 10px; }
.month-label:active { background: var(--line); }
.view-toggle { display: flex; gap: 4px; background: var(--card); border-radius: 12px; padding: 3px; margin: 10px auto 0; width: fit-content; box-shadow: var(--shadow); }
.vt { border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; padding: 7px 22px; border-radius: 9px; cursor: pointer; }
.vt.active { background: var(--accent); color: #fff; }

/* Month grid */
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, 1fr); column-gap: 0; }
.grid { row-gap: 11px; }
.weekdays { margin-bottom: 8px; }
.weekdays[hidden] { display: none; }
.grid[hidden] { display: none; }
.weekdays span { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cell {
  position: relative; aspect-ratio: 6 / 7; min-width: 0; border: none; background: transparent; color: var(--text);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.cell:active { opacity: .65; }
.cell .dnum { font-size: 1rem; font-weight: 600; line-height: 1; width: 27px; height: 27px; display: flex; align-items: center; justify-content: center; border-radius: 999px; }
.cell.muted { color: var(--muted); opacity: .42; }
/* connected "with Harry" block (hotel-range style): solid fill (accessible white text),
   rounded only at the run's start/end, thin divider between consecutive days */
.cell.harry { background: var(--accent); color: #fff; }
.cell.harry.rl { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.cell.harry.rr { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.cell.harry.contL::after { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: rgba(255,255,255,.3); }
.cell.today .dnum { background: var(--today); color: #16171d; }
.cell.harry.today .dnum { background: #fff; color: var(--accent); }
.mkrow { display: flex; gap: 5px; min-height: 10px; line-height: 1; align-items: center; }
.mk { font-size: 9.5px; font-weight: 800; letter-spacing: .02em; }
.mk.am { color: var(--am); } .mk.lu { color: var(--lunch); } .mk.s { color: var(--school); } .mk.pm { color: var(--pm); }
.cell.harry .mk { color: #fff; }
.ndot { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--note); }
.cell.harry .ndot { background: #fff; }
/* bank holiday: rose circle behind the number + a tinted cell, so it's unmistakable */
.cell.bh .dnum { background: var(--bh); color: #fff; }
.cell.bh:not(.harry) { background: color-mix(in srgb, var(--bh) 15%, transparent); border-radius: var(--radius-sm); }
.cell.today.bh .dnum { background: var(--today); color: #16171d; } /* if it's also today, keep the today colour */

/* Week list — consecutive nights join into a vertical block */
.week-list { display: flex; flex-direction: column; gap: 6px; }
.week-list[hidden] { display: none; }
.wrow { position: relative; display: flex; gap: 12px; text-align: left; border: none; background: var(--bg); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; align-items: stretch; }
.wrow:active { opacity: .7; }
.wrow.harry { background: var(--accent); color: #fff; border-radius: 0; }
.wrow.harry.rt { border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm); }
.wrow.harry.rb { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.wrow.harry.contT { margin-top: -6px; }
.wrow.harry.contT::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: rgba(255,255,255,.22); }
.wrow.today { outline: 2px solid var(--today); outline-offset: -2px; z-index: 1; }
.wdate { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 42px; }
.wdate .wdow { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.wdate .wdn { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.wrow.harry .wdate .wdow { color: rgba(255,255,255,.8); }
.wbody { flex: 1; display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.wstatus { font-weight: 700; font-size: .95rem; }
.wrow.harry .wstatus, .wrow.harry .wnote { color: #fff; }
.wtags { display: flex; flex-wrap: wrap; gap: 6px; }
.wtag { font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--card); color: var(--text); display: inline-flex; gap: 5px; align-items: center; }
.wtag.am { color: var(--am); } .wtag.lu { color: var(--lunch); } .wtag.s { color: var(--school); } .wtag.pm { color: var(--pm); }
.wtag.bh { background: color-mix(in srgb, var(--bh) 16%, transparent); color: var(--bh); }
.wrow.harry .wtag { background: rgba(255,255,255,.18); color: #fff; }
.wrow.harry .wtag.bh { background: rgba(255,255,255,.22); color: #fff; }
.wnote { font-size: .82rem; color: var(--muted); }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: .76rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.swatch.harry { background: linear-gradient(150deg, var(--accent), var(--accent-2)); }
.lk { font-size: 11px; font-weight: 800; letter-spacing: .02em; min-width: 18px; text-align: center; }
.lk.am { color: var(--am); } .lk.lu { color: var(--lunch); } .lk.s { color: var(--school); } .lk.pm { color: var(--pm); }
.bh-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bh); display: inline-block; }

/* Stats */
.card-title.sub { margin-top: 22px; }
.stat-list { display: flex; flex-direction: column; }
.stat-line { display: flex; align-items: baseline; justify-content: space-between; padding: 11px 2px; border-top: 1px solid var(--line); }
.stat-line:first-child { border-top: none; }
.sl-label { font-size: .98rem; font-weight: 600; }
.sl-val { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.sl-val small { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }

/* Admin page */
.admin-section { margin-top: 18px; }
.admin-section-title { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 6px 8px; }
.admin-row { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: none; background: var(--card); color: var(--text); padding: 15px 16px; cursor: pointer; box-shadow: var(--shadow); }
.admin-section .admin-row:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.admin-section .admin-row:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.admin-section .admin-row:only-of-type { border-radius: var(--radius); }
.admin-section .admin-row + .admin-row { box-shadow: var(--shadow); position: relative; }
.admin-section .admin-row + .admin-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.admin-row:active { background: var(--bg); }
.ar-icon { font-size: 1.4rem; width: 28px; text-align: center; flex: none; }
.ar-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ar-text b { font-size: 1rem; }
.ar-text small { color: var(--muted); font-size: .82rem; }
.ar-chev { color: var(--muted); font-size: 1.4rem; flex: none; }

/* Settings page — holiday add */
.hd-arrow { color: var(--muted); flex: none; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; max-width: 540px; margin: 0 auto;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tab { flex: 1; border: none; background: transparent; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 7px; font: inherit; font-size: .68rem; font-weight: 600; }
.tab .ti { font-size: 1.3rem; filter: grayscale(1); opacity: .6; }
.tab.active { color: var(--accent); }
.tab.active .ti { filter: none; opacity: 1; }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10,11,16,.42); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .15s ease; }
.sheet-backdrop[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 22px 22px 0 0; padding: 10px 18px calc(var(--safe-bottom) + 22px); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: slideup .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slideup { from { transform: translateY(100%); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }

.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 1.05rem; font-weight: 600; gap: 12px; }
.switch-row.compact { font-size: .95rem; }
.switch-row span small { display: block; font-size: .76rem; font-weight: 500; color: var(--muted); }
.switch { position: relative; width: 52px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; }
.slider::before { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(21px); }

/* Day options (segmented) */
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.opt-label { font-weight: 600; font-size: .98rem; }
.opt-label small { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); margin-left: 26px; }
.ol-tag { display: inline-block; font-size: .72rem; font-weight: 800; width: 22px; text-align: center; margin-right: 4px; }
.ol-tag.am { color: var(--am); } .ol-tag.lu { color: var(--lunch); } .ol-tag.s { color: var(--school); } .ol-tag.pm { color: var(--pm); }
.seg { display: flex; background: var(--bg); border-radius: 11px; padding: 3px; flex: none; }
.seg button { border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .82rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

.note-label { display: block; margin: 14px 0 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
textarea, input[type="text"], input[type="date"], input[type="email"] { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 12px; padding: 11px 12px; font: inherit; resize: vertical; }
textarea:focus, input[type="text"]:focus, input[type="date"]:focus, input[type="email"]:focus { outline: 2px solid var(--accent); border-color: transparent; }

.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn { flex: 1; border: none; border-radius: 13px; padding: 13px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--bg); color: var(--text); }
.btn.ghost.danger { color: var(--danger); }
.btn.block { width: 100%; margin-top: 12px; }

/* Menu */
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-item { display: flex; align-items: center; gap: 14px; text-align: left; border: none; background: transparent; color: var(--text); padding: 12px 8px; border-radius: 12px; cursor: pointer; width: 100%; }
.menu-item:active { background: var(--bg); }
.mi-icon { font-size: 1.4rem; width: 30px; text-align: center; flex: none; }
.mi-text { display: flex; flex-direction: column; }
.mi-text small { color: var(--muted); font-size: .8rem; }

/* Importer */
.import-summary { font-size: 1rem; margin: 0 0 10px; }
.import-summary small { color: var(--muted); font-weight: 600; }
.import-hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.ir-head { font-size: .82rem; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.ir-head small { font-weight: 500; }
.rules-list { display: flex; flex-direction: column; gap: 6px; }
.rule-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 11px; padding: 7px 8px 7px 12px; }
.rule-text { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-badge { border: none; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; }
.rule-badge.night { background: var(--accent); } .rule-badge.note { background: var(--note); } .rule-badge.skip { background: var(--muted); }
.rule-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 8px; flex: none; }
.rule-del:active { background: var(--line); }
.rule-add { display: flex; gap: 8px; margin-top: 10px; }
.rule-add input { flex: 1; }
.rule-add select { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 12px; padding: 0 8px; font: inherit; font-weight: 600; }
.rule-add-btn { flex: none; padding: 10px 16px; }
.skipped-toggle { width: 100%; text-align: left; border: none; background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; padding: 14px 2px 6px; cursor: pointer; }
.skipped-toggle .chev { display: inline-block; transition: transform .15s; color: var(--muted); }
.skipped-toggle.open .chev { transform: rotate(90deg); }
.skipped-list { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.skipped-list[hidden] { display: none; }
.skip-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.skip-text { flex: 1; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skip-text em { color: var(--muted); font-style: normal; font-size: .78rem; }
.skip-acts { display: flex; gap: 6px; flex: none; }
.skip-acts button { border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: .74rem; font-weight: 700; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.skip-acts button:active { background: var(--line); }
.muted-note { color: var(--muted); font-size: .85rem; text-align: center; padding: 10px; margin: 0; }

/* Sync */
.sync-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: 13px; padding: 14px 14px 14px 18px; margin: 4px 0 8px; }
.sync-code span { font-size: 1.02rem; font-weight: 800; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.copy-btn { border: none; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: .82rem; padding: 8px 14px; border-radius: 9px; cursor: pointer; flex: none; }
.copy-btn:active { transform: scale(.96); }
.sync-status { font-size: .82rem; color: var(--muted); margin: 0 0 8px; }
#syncOn .ir-head, #syncOff .ir-head { margin-top: 16px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); transform: translateX(-50%); background: #1b1c22; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600; z-index: 80; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: fade .15s ease; }

/* Admin — holidays */
.holiday-list { display: flex; flex-direction: column; gap: 6px; }
.hol-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 11px; padding: 8px 8px 8px 12px; }
.hol-text { flex: 1; font-size: .9rem; font-weight: 600; }
.hol-text small { display: block; font-size: .76rem; font-weight: 500; color: var(--muted); }
.holiday-add { margin-top: 8px; }
.holiday-add > input { margin-bottom: 8px; }
.holiday-dates { display: flex; align-items: center; gap: 8px; }
.holiday-dates input[type="date"] { flex: 1; min-width: 0; }
.holiday-dates span { color: var(--muted); }
@media (prefers-color-scheme: dark) { .toast { background: #2a2c36; } }

/* ============================================================
   DIARY — mode toggle + Me (weekends) styles
   ============================================================ */
.mode-toggle { display: flex; gap: 4px; background: var(--card); border-radius: 14px; padding: 4px; margin: 12px 0 2px; box-shadow: var(--shadow); }
.mode-toggle[hidden] { display: none; }
.mode-btn { flex: 1; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .98rem; padding: 10px 0; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mode-btn .mb-emoji { filter: grayscale(1); opacity: .6; }
.mode-btn.active { background: var(--accent); color: #fff; }
.mode-btn.active .mb-emoji { filter: none; opacity: 1; }

/* Summary card */
.summary-card { margin-top: 14px; }
.sum-list { display: flex; flex-direction: column; }
.sum-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); text-align: left; }
.sum-row:first-child { border-top: none; }
.sum-ic { font-size: 1.3rem; width: 30px; text-align: center; flex: none; }
.sum-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.sum-txt b { font-size: 1.02rem; font-weight: 700; }
.sum-txt small { color: var(--muted); font-size: .82rem; }
.sum-row.tap { width: 100%; border: none; background: transparent; color: var(--text); cursor: pointer; border-top: 1px solid var(--line); }
.sum-row.tap:active { opacity: .6; }
.sum-chev { color: var(--muted); font-size: 1.3rem; flex: none; }

/* Me toolbar / filters */
.me-toolbar { margin-top: 14px; display: flex; justify-content: center; }
.meFilter { width: fit-content; }
.meFilter button { padding: 7px 14px; font-size: .84rem; }

/* Month blocks */
.me-month { margin-top: 18px; }
.me-month-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 6px 8px; }
.wk-list { display: flex; flex-direction: column; gap: 8px; }
.wk-card { width: 100%; text-align: left; border: none; background: var(--card); color: var(--text); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 13px 14px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.wk-card:active { opacity: .7; }
.wk-card.now { outline: 2px solid var(--accent); outline-offset: -2px; }
.wk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wk-range { font-weight: 700; font-size: 1rem; }
.wk-range .now-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); margin-left: 6px; }
.wk-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-b { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; gap: 4px; align-items: center; }
.wk-b.free { background: color-mix(in srgb, var(--note) 16%, transparent); color: var(--note); }
.wk-b.harry { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.wk-b.plans { background: var(--bg); color: var(--muted); }
.wk-b.ev { background: var(--bg); color: var(--text); }
.wk-chev { color: var(--muted); font-size: 1.4rem; flex: none; }

/* Weekend detail */
.wk-detail-head { margin-top: 16px; padding: 0 4px; }
.wdh-row { display: flex; align-items: flex-start; gap: 12px; }
.wdh-row > div { flex: 1; min-width: 0; }
.wk-detail-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.wk-detail-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.wdh-btn { flex: none; width: auto; padding: 9px 14px; font-size: .88rem; background: var(--card); box-shadow: var(--shadow); }

/* Day toggles */
.day-tabs { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab { flex: 1 0 auto; min-width: 58px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer;
  border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.day-tab .dt-dow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.day-tab .dt-num { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.day-tab .dt-dots { display: flex; gap: 3px; height: 6px; align-items: center; }
.dt-dot { width: 5px; height: 5px; border-radius: 50%; }
.dt-dot.plan { background: var(--muted); } .dt-dot.harry { background: var(--accent); }
.day-tab.today .dt-num { color: var(--today); }
.day-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-tab.on .dt-dow, .day-tab.on .dt-num { color: #fff; }
.day-tab.on .dt-dot { background: rgba(255,255,255,.85); }

/* Day columns — one at a time on mobile, side by side on desktop */
.day-cols { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; align-items: start; }
.day-card { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 13px 14px; }
.day-cols .day-card:not(.sel) { display: none; }
.day-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.day-card-head .dch-name { font-weight: 800; font-size: 1.05rem; }
.day-card-head .dch-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dbh-harry { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); display: inline-flex; gap: 5px; align-items: center; }
.dbh-harry.none { background: var(--bg); color: var(--muted); }
.sh-tag { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.slot-items { display: flex; flex-direction: column; gap: 6px; }
.pitem { display: flex; align-items: center; gap: 10px; background: var(--bg); border: none; color: var(--text); border-radius: 11px; padding: 10px 12px; cursor: pointer; text-align: left; width: 100%; }
.pitem:active { opacity: .7; }
.pitem .pi-emoji { font-size: 1.05rem; flex: none; }
.pitem .pi-label { flex: 1; font-weight: 600; font-size: .95rem; min-width: 0; }
/* time leads the row so the day reads as a timeline */
.pitem .pi-time { font-size: .78rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; flex: none; width: 40px; letter-spacing: -.01em; }
.pitem.ev, .pitem.sleep { cursor: default; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pitem.sleep { background: color-mix(in srgb, var(--pm) 12%, transparent); }
.pitem.sleep .pi-time, .pitem.sleep .pi-label { color: var(--pm); }
.pitem.ev .pi-time { color: var(--muted); }

/* Days-range quick picks */
.days-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.days-quick button { border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; font-size: .88rem; padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.days-quick button:active { background: var(--line); }

@media (min-width: 820px) {
  .app.wide { max-width: 1120px; }
  .app.wide .day-cols { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
  .app.wide .day-cols .day-card:not(.sel) { display: block; }
  .app.wide .day-card.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
  .app.wide .day-tabs { justify-content: flex-start; }
  .app.wide .day-tab { flex: 0 0 auto; min-width: 72px; }
}
.pitem.ev.f1 { background: color-mix(in srgb, #ef4444 9%, transparent); }
.pitem.ev.liverpool { background: color-mix(in srgb, #dc2626 9%, transparent); }
.pitem.ev.golf { background: color-mix(in srgb, #16a34a 9%, transparent); }
.slot-add { margin-top: 8px; width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .88rem; padding: 9px; border-radius: 11px; cursor: pointer; }
.slot-add:active { background: var(--bg); }
.slot-empty { color: var(--muted); font-size: .85rem; padding: 2px 2px 4px; }

/* Picker modal */
.pick-time-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.pick-time-row input[type="time"] { width: auto; flex: none; }
.pick-added { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); border-radius: 12px; padding: 10px; margin: 6px 0 4px; }
.pick-added .pa { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #fff; }
.pick-cats { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.pcat-title { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0 2px 7px; display: flex; align-items: center; gap: 6px; }
.pchips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 13px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pchip:active { transform: scale(.96); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pchip.new { border-style: dashed; border-color: var(--accent); background: transparent; color: var(--accent); font-weight: 700; }
.pchip-input { width: 140px; border: 1px solid var(--accent); background: var(--bg); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 13px; border-radius: 999px; }
.pchip-input:focus { outline: none; }

/* Item move buttons */
.item-move { display: flex; gap: 10px; margin-top: 14px; }
.item-move .btn { padding: 11px; }

/* Chip editor page */
.chip-cat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-top: 12px; }
.chip-cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chip-cat-head input { flex: 1; font-weight: 700; }
.chip-cat-head .cc-del { border: none; background: transparent; color: var(--danger); font-size: 1rem; cursor: pointer; padding: 4px 8px; flex: none; }
.chip-edit-list { display: flex; flex-direction: column; gap: 6px; }
.chip-edit-row { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 10px; padding: 6px 6px 6px 12px; }
.chip-edit-row .cer-label { flex: 1; font-size: .92rem; font-weight: 600; }
.chip-edit-row button { border: none; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 3px 6px; border-radius: 7px; flex: none; }
.chip-edit-row button:active { background: var(--line); }
.chip-edit-row .cer-del { color: var(--danger); }
.chip-add { display: flex; gap: 8px; margin-top: 10px; }
.chip-add input { flex: 1; }
.chip-add button { flex: none; padding: 10px 16px; }

/* Plan import review */
.plan-import-list { display: flex; flex-direction: column; gap: 6px; max-height: 48vh; overflow-y: auto; }
.pi-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 11px; padding: 9px 12px; }
.pi-row input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.pi-row .pir-txt { flex: 1; min-width: 0; }
.pi-row .pir-txt b { font-size: .92rem; font-weight: 600; display: block; }
.pi-row .pir-txt small { color: var(--muted); font-size: .78rem; }
