[hidden] { display: none !important; }
:root {
  --ink: #14181d;
  --ink-2: #3b434d;
  --muted: #6a737d;
  --line: #dcdfe4;
  --line-2: #eceef1;
  --bg: #f4f5f7;
  --card: #ffffff;
  --brand: #14181d;
  --primary: #1f5fbf;
  --primary-ink: #ffffff;
  --go: #1d7a52;
  --warn: #a8460a;
  --warn-bg: #fdf1e7;
  --crit: #b42318;
  --crit-bg: #fdecea;
  --ok-bg: #e7f4ed;
  --radius: 6px;
  --tap: 52px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.4; }
body.has-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1rem; margin: 24px 0 8px; display: flex; align-items: baseline; gap: 8px; }
h3 { font-size: .95rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.test-strip { background: #ffd84d; color: #2b2300; font-size: .75rem; font-weight: 600; text-align: center; padding: 3px 8px; letter-spacing: .02em; }
.syncbar { background: var(--ink); color: #fff; font-size: .85rem; padding: 8px 16px; }
.syncbar a { color: #fff; text-decoration: none; display: block; }
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; }
.loading { color: var(--muted); padding: 32px 0; }

/* Page header */
.page-head { display: flex; align-items: center; gap: 12px; padding: 18px 0 12px; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; }
.page-head .sub { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.page-head .titles { flex: 1; min-width: 0; }
.page-head .back { font-size: 2rem; line-height: 1; text-decoration: none; color: var(--ink); width: 36px; height: 44px; display: grid; place-items: center; margin-left: -8px; }

/* Bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.bottom-nav:empty { display: none; }
.bottom-nav a { flex: 1; text-align: center; padding: 12px 4px 14px; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; border-top: 3px solid transparent; }
.bottom-nav a[aria-current="page"] { color: var(--ink); border-top-color: var(--ink); }
@media (min-width: 900px) {
  body.has-nav { padding-bottom: 0; padding-top: 0; }
  .bottom-nav { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  .bottom-nav a { flex: 0 0 auto; padding: 14px 22px; border-top: 0; border-bottom: 3px solid transparent; }
  .bottom-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
  body.has-nav #nav { order: -1; }
  body { display: flex; flex-direction: column; }
  .test-strip { order: -3; } .syncbar { order: -2; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.go { background: var(--go); border-color: var(--go); color: #fff; }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.secondary { background: var(--card); }
.btn.big { min-height: 60px; font-size: 1.08rem; width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-size: .88rem; padding: 6px; cursor: pointer; text-decoration: underline; }
.big-actions { display: grid; gap: 10px; margin: 4px 0 8px; }
@media (min-width: 700px) { .big-actions { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.stack { display: grid; gap: 14px; margin-top: 12px; }
.narrow { max-width: 560px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

/* Forms */
.field { display: grid; gap: 6px; }
.field .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .8rem; }
input, select, textarea { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #c7ccd3; border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; min-height: 46px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--ink); vertical-align: middle; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 160px; }

.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.segmented button, .type-grid button { min-height: var(--tap); border: 1px solid #c7ccd3; border-radius: var(--radius); background: #fff; font: inherit; font-weight: 600; color: var(--ink); padding: 8px 10px; cursor: pointer; }
.segmented button[aria-checked="true"], .type-grid button[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }

.photo-field { display: grid; gap: 8px; justify-items: start; }
.photo-preview img { max-width: 220px; max-height: 220px; border-radius: var(--radius); border: 1px solid var(--line); display: block; }

/* Pills */
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pills, .card-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.st-open { background: #e8eefb; color: #1b4a94; }
.st-in_progress { background: #fff4d6; color: #7a5300; }
.st-fixed, .vr-done { background: var(--ok-bg); color: #165c3d; }
.pr-critical, .overdue, .vr-missed { background: var(--crit-bg); color: var(--crit); }
.pr-high, .tr-partial { background: var(--warn-bg); color: var(--warn); }
.tr-closed { background: var(--ink); color: #fff; }
.vr-unplanned { background: #eee8fb; color: #4b2a94; }
.warn-text { color: var(--crit); }
.count-warn { color: var(--crit); font-size: .85rem; font-weight: 600; }

/* Cards (phone lists) */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; text-decoration: none; }
.card.is-overdue { border-left-color: var(--crit); }
.card-top { display: flex; justify-content: space-between; gap: 8px; }
.card-mid { color: var(--ink-2); font-size: .92rem; }
.card-note { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.age { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; }
.more-link { display: block; padding: 12px 0; font-weight: 600; }
.empty { color: var(--muted); padding: 8px 0; }
.banner { display: grid; gap: 2px; background: #fff8db; border: 1px solid #f0d77a; border-radius: var(--radius); padding: 12px 14px; color: var(--ink); text-decoration: none; margin-bottom: 12px; }
.banner span { font-size: .85rem; color: var(--ink-2); }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.tabs a { padding: 10px 12px; white-space: nowrap; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Tables */
.table-wrap { overflow: auto; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overscroll-behavior: contain; }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; z-index: 2; white-space: nowrap; box-shadow: 0 1px 0 var(--line); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: #fbfbfc; }
table.data tr.link { cursor: pointer; }
table.data tr.link:hover td { background: #f1f4f9; }
table.data td.note { color: var(--ink-2); max-width: 280px; }
tr.overdue-row td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
tr.neglected-row td { background: #fff6ef !important; }
tr.inactive-row td { color: var(--muted); }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.table-head h2 { margin: 0; }
.table-head input { max-width: 340px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.filters .field .label { font-size: .8rem; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px; }
.tile-v { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-l { font-size: .8rem; color: var(--muted); }
.tile.warn { border-color: #f1b7b1; }
.tile.warn .tile-v { color: var(--crit); }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }

/* Issue page */
.fix-time { font-weight: 600; margin: 10px 0; }
.fix-time.late { color: var(--crit); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.issue-note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; white-space: pre-wrap; }
.update-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; margin-top: 16px; display: grid; gap: 10px; }
.update-box h2 { margin-top: 12px; }
.update-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.update-actions .btn { min-height: var(--tap); }
details > summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--ink-2); }
.more-details { border-top: 1px solid var(--line); margin-top: 18px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0 8px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); }
.timeline time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; }
.timeline small { color: var(--muted); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.history { list-style: none; padding: 0; margin: 0; font-size: .85rem; color: var(--ink-2); display: grid; gap: 4px; }

/* Visits */
.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.day.today { border-color: var(--ink); }
.day h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.day-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.row-end { display: flex; align-items: center; gap: 6px; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .88rem; }
.check-items { display: grid; gap: 10px; }
.check-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.check-item p { margin: 0; font-weight: 600; }
.check-extra { display: grid; gap: 8px; }
.raise { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.warn-box { background: var(--warn-bg); border: 1px solid #f0c39e; border-radius: var(--radius); padding: 10px 12px; color: var(--warn); }
.checklist-stores { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: 8px; }
.checklist-stores label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }

ul.simple { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
ul.simple li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
ul.simple li:last-child { border-bottom: 0; }
.menu { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.menu a { display: block; padding: 16px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-weight: 600; }
.menu li:last-child a { border-bottom: 0; }
.news { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.news.unread { border-left: 4px solid var(--primary); }
.news .meta { color: var(--muted); font-size: .82rem; margin: 2px 0 6px; }
.news p { margin: 0; white-space: pre-wrap; }
.error-box { background: var(--crit-bg); color: var(--crit); padding: 10px 12px; border-radius: var(--radius); margin: 0; }
.error-text { color: var(--crit); margin: 4px 0 0; font-size: .88rem; }
.offline-note { background: #eef0f3; color: var(--ink-2); padding: 8px 12px; border-radius: var(--radius); font-size: .85rem; }
.done-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.big-tick { font-size: 1.3rem; font-weight: 700; margin: 0 0 6px; color: var(--go); }
.done-box p { margin: 4px 0; }
.switches { display: grid; gap: 8px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); }
.notice-text { margin-top: 24px; color: var(--ink-2); font-size: .9rem; }

/* Login */
.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.brand .mark { width: 44px; height: 44px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; }
.brand div { display: grid; }
.brand strong { font-size: 1.25rem; }
.brand span { color: var(--muted); font-size: .9rem; }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: rgba(20, 24, 29, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-box { background: var(--card); border-radius: 8px; padding: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal-box h2 { margin-top: 0; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); font-size: .92rem; z-index: 60; max-width: calc(100% - 32px); transition: opacity .3s; }
.toast.err { background: var(--crit); }
.toast.warn { background: var(--warn); }
.toast.out { opacity: 0; }

/* Where this week */
.week-grid td { min-width: 130px; font-size: .84rem; }
.week-grid td:first-child, .week-grid th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 150px; }
.week-grid th:first-child { z-index: 3; background: #fafbfc; }
.week-grid .today-col { background: #f3f6fb !important; }
.wk-cell { display: grid; gap: 4px; }
.wk-item { border-radius: 4px; padding: 4px 6px; background: #eef1f5; line-height: 1.25; }
.wk-item small { color: inherit; opacity: .8; }

/* Manager home: store cards */
.hello { padding: 18px 0 10px; }
.hello h1 { font-size: 1.35rem; }
.hello .sub { margin: 2px 0 10px; color: var(--muted); font-size: .9rem; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .88rem; color: var(--ink-2); }
.chip strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.chip.bad { border-color: #f1b7b1; background: var(--crit-bg); } .chip.bad strong { color: var(--crit); }
.chip.warn { border-color: #f0c39e; background: var(--warn-bg); } .chip.warn strong { color: var(--warn); }
.chip.good strong { color: var(--go); }
.store-search { margin: 12px 0 4px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 700px) { .store-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.store-card { --c: var(--go); display: grid; gap: 6px; padding: 14px; min-height: 112px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 8px; color: var(--ink); text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
.store-card:active { transform: scale(.98); }
.store-card:hover { box-shadow: 0 2px 8px rgba(20, 24, 29, .08); }
.store-card.warn { --c: #e08a2c; } .store-card.bad { --c: var(--crit); }
.sc-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.sc-name { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.sc-code { font-size: .75rem; color: var(--muted); font-weight: 600; }
.sc-status { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--c); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.sc-meta { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); margin-top: auto; }
.sc-today { color: var(--primary); font-weight: 600; }

/* Store page */
.store-hero { --c: var(--go); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.store-hero.warn { --c: #e08a2c; } .store-hero.bad { --c: var(--crit); }
.store-hero > div { display: flex; align-items: center; gap: 8px; color: var(--c); font-size: 1.05rem; }
.issue-card { padding: 0; overflow: hidden; }
.issue-link { display: grid; gap: 4px; padding: 12px 14px 8px; color: inherit; text-decoration: none; }
.type-line { display: inline-flex; align-items: center; gap: 8px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 12px; }
.quick .btn { min-height: 44px; }
.ticon { display: inline-grid; place-items: center; color: var(--ink-2); }
a.plain { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.day-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-btn { border: 1px solid #c7ccd3; background: #fff; border-radius: 999px; padding: 10px 14px; font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; min-height: 44px; }

/* Type tiles with icons */
.type-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; }
.type-grid button .ticon { color: inherit; }
.type-grid button .ticon svg { width: 28px; height: 28px; }
.type-grid button[aria-checked="true"] { box-shadow: 0 0 0 3px rgba(20, 24, 29, .15); }

/* Reminders and meetings */
.today-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px 10px; margin: 12px 0 4px; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.today-head h2 { margin: 14px 0 8px; }
.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rem-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line-2); }
.rem-list li:first-child { border-top: 0; }
.rem-body { display: grid; gap: 2px; }
.rem-body small { color: var(--muted); }
.rem-kind { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 6px; }
.rem-list li.meeting .rem-kind { color: var(--primary); }
.rem-list li.late small { color: var(--crit); }
.rem-list li.done .rem-body { text-decoration: line-through; opacity: .55; }
.tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #b8bec6; background: #fff; cursor: pointer; margin-top: 2px; position: relative; }
.tick[aria-pressed="true"] { background: var(--go); border-color: var(--go); }
.tick[aria-pressed="true"]::after { content: ""; position: absolute; left: 9px; top: 4px; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sc-meet { color: var(--primary); font-weight: 600; }
.wk-meet { background: #e8eefb; color: #1b4a94; }

/* ---------- Plan my week ---------- */
.plan { max-width: 560px; margin: 0 auto; padding: 0 0 24px; }
.plan-head { background: var(--card); padding: 18px 16px 12px; border-bottom: 1px solid var(--line-2); }
.plan-range { font-size: .75rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; font-weight: 600; }
.plan-head h1 { font-size: 1.45rem; letter-spacing: -.02em; margin: 2px 0 10px; }
.week-tabs { display: flex; gap: 6px; }
.week-tabs a { font-size: .8rem; font-weight: 600; padding: 7px 12px; border-radius: 99px; background: var(--bg); color: var(--ink-2); text-decoration: none; }
.week-tabs a.on { background: var(--ink); color: #fff; }
.plan-status { margin: 12px 10px 0; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: .85rem; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.plan-status > div { flex: 1; }
.plan-status.late { background: var(--crit-bg); color: var(--crit); }
.plan-status.ok { background: var(--ok-bg); color: var(--go); font-weight: 600; display: block; }
.plan-status.ok span { font-weight: 400; }
.pbar { height: 5px; background: rgba(0,0,0,.08); border-radius: 9px; margin-top: 7px; overflow: hidden; }
.pbar > div { height: 100%; background: currentColor; border-radius: 9px; transition: width .3s; }
.pbar.go { color: var(--go); }
.plan-grid { width: calc(100% - 20px); margin: 12px 10px 0; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.plan-grid th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 9px 8px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.plan-grid th:first-child { width: 50px; }
.plan-grid td { border-bottom: 1px solid var(--line-2); padding: 6px; height: 58px; vertical-align: middle; }
.plan-grid td + td { border-left: 1px solid var(--line-2); }
.plan-grid tr:last-child td { border-bottom: 0; }
.plan-grid .pd { padding-left: 10px; }
.plan-grid .pd b { display: block; font-size: .88rem; }
.plan-grid .pd span { font-size: .72rem; color: var(--muted); }
.plan-grid tr.today .pd b { color: var(--primary); }
.plan-grid tr.today .pd span::after { content: ' today'; }
.plan-grid tr.we td { background: #fafbfc; }
.plan-grid tr.we .pd b { color: #8a929b; }
.plan-grid tr.past td { opacity: .55; }
.plan-grid .sq { cursor: pointer; transition: background .12s; -webkit-tap-highlight-color: transparent; }
.plan-grid .sq:active { background: #eaf1fb; }
.plan-grid tr.past .sq { cursor: default; }
.plan-grid .plus { display: block; text-align: center; color: #c3c8ce; font-size: 1.3rem; font-weight: 300; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.plan-grid td[colspan] .chips { justify-content: center; }
.pc { font-size: .74rem; font-weight: 600; padding: 4px 6px; border-radius: 6px; background: #eaf1fb; color: var(--primary); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pc.done { background: var(--ok-bg); color: var(--go); }
.pc.done::before { content: '✓ '; }
.pc.meet { background: #efedfa; color: #5b4bb7; }
.pc.oth { background: #eef0f2; color: var(--ink-2); }
.chips .full { font-size: .72rem; color: var(--muted); }
.plan-key { margin: 8px 12px 0; font-size: .72rem; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; }
.plan-key .k { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: -6px; }
.k.store { background: #cfe0f7; } .k.done { background: #bfe3cf; } .k.meet { background: #d9d4f4; } .k.oth { background: #dde0e4; }
.plan-foot { display: flex; gap: 8px; margin: 14px 10px 0; position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); }
.plan-foot .btn { flex: 1; border-radius: 14px; min-height: 52px; font-size: 1rem; }
.plan-foot .btn.secondary { flex: .75; background: #fff; }
.plan-foot .btn[disabled] { opacity: .45; }
.sent-ok { flex: 1; display: grid; place-items: center; border-radius: 14px; background: var(--ok-bg); color: var(--go); font-weight: 700; min-height: 52px; }
.plan-link { display: block; margin: 18px 12px 0; font-size: .88rem; text-decoration: none; }
.plan-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); text-decoration: none; font-size: .9rem; }
.plan-bar span { font-size: .8rem; opacity: .9; }
.plan-bar::after { content: '›'; font-size: 1.3rem; margin-left: auto; padding-left: 6px; }
.plan-bar span { margin-left: auto; }
.plan-bar.late { background: var(--crit-bg); color: var(--crit); }
.plan-bar.ok { background: var(--ok-bg); color: var(--go); }

/* bottom panel */
body.no-scroll { overflow: hidden; }
.sheet-bg { position: fixed; inset: 0; background: rgba(20,24,29,.38); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: rise .2s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.grab { width: 38px; height: 5px; border-radius: 9px; background: #d5d9de; margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.done-btn { font-size: 1rem; font-weight: 700; color: var(--primary); padding: 6px 2px; }
.sheet-label { font-size: .7rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 8px; }
.ps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ps { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink); min-height: 54px; cursor: pointer; transition: all .12s; }
.ps b { display: block; font-size: .7rem; color: var(--muted); }
.ps span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps em { display: block; font-style: normal; font-size: .66rem; color: var(--muted); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps em.red { color: var(--crit); font-weight: 600; }
.ps[aria-pressed=true] { border-color: var(--primary); background: #eaf1fb; box-shadow: 0 0 0 1px var(--primary); color: var(--primary); }
.ps[aria-pressed=true] b { color: var(--primary); }
.po-list { display: flex; flex-wrap: wrap; gap: 7px; }
.po { font: inherit; font-size: .84rem; font-weight: 600; padding: 9px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.po[aria-pressed=true] { background: #eef0f2; border-color: var(--ink-2); color: var(--ink); box-shadow: 0 0 0 1px var(--ink-2); }
.po.meet { color: #5b4bb7; border-color: #cfc8f0; background: #f7f6fd; }
.po.new { border-style: dashed; color: var(--primary); border-color: #9fbbe6; }
.po.more { color: var(--muted); }
.p-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); border-radius: 12px; padding: 10px; }
.p-form input, .p-form select { font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.p-row { display: flex; gap: 8px; }
.p-row > * { flex: 1; }
.p-sugg { display: flex; flex-direction: column; }
.p-sugg button { font: inherit; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--line-2); padding: 11px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; cursor: pointer; }
.p-sugg button:first-child { border-radius: 10px 10px 0 0; } .p-sugg button:last-child { border-radius: 0 0 10px 10px; border-bottom: 0; } .p-sugg button:only-child { border-radius: 10px; }
.p-sugg span { color: var(--muted); font-size: .78rem; }
.pm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pm { background: #efedfa; color: #5b4bb7; border-radius: 10px; padding: 9px 12px; font-size: .85rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pm-r { display: flex; gap: 10px; align-items: center; font-weight: 700; white-space: nowrap; }
.pm .link-btn { color: #5b4bb7; }
.p-both { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 10px; font: inherit; font-size: .9rem; color: var(--ink-2); background: var(--bg); border: 0; border-radius: 10px; padding: 11px 12px; cursor: pointer; text-align: left; }
.p-both .sw { width: 36px; height: 21px; border-radius: 99px; background: #cdd2d8; position: relative; flex: none; transition: background .15s; }
.p-both .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.p-both[aria-pressed=true] .sw { background: var(--go); }
.p-both[aria-pressed=true] .sw::after { transform: translateX(15px); }
.plan-done .modal-box { text-align: center; max-width: 380px; }
.big-check { width: 68px; height: 68px; border-radius: 50%; background: var(--go); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 8px auto 12px; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done-stats { display: flex; gap: 8px; margin: 18px 0 12px; }
.done-stats div { flex: 1; background: var(--bg); border-radius: 12px; padding: 12px 4px; }
.done-stats b { display: block; font-size: 1.4rem; }
.done-stats span { font-size: .75rem; color: var(--muted); }
.last-week { background: var(--bg); border-radius: 12px; padding: 12px; text-align: left; font-size: .88rem; margin-bottom: 14px; }
.wk-oth { background: #eef0f2 !important; color: var(--ink-2) !important; }
.sent-pill { font-size: .72rem; font-weight: 600; display: block; margin-top: 2px; }
.sent-pill.ok { color: var(--go); } .sent-pill.no { color: var(--crit); } .sent-pill.chg { color: var(--warn); }
.done-btn { text-decoration: none; }
.plan-done h2 { justify-content: center; margin-top: 0; }
