/* ==========================================================================
   Thrive Bar staff portal · NaggyBoss look (direction 1a "Calm")
   Light + dark. Dark follows the device unless <html data-theme="light|dark">.
   ========================================================================== */
/* Nunito (variable 400–800), self-hosted. SIL Open Font License 1.1, see nunito-OFL.txt. */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --paper: #ffffff;
  --ink: #1f2a2a;
  --ink-2: #3d4847;
  --muted: #66706e;
  --faint: #8a928f;
  --line: #e8e4db;
  --line-soft: #f0ece4;
  --subtle: #f4f1ea;
  --hover: #f1eee7;
  --input-bg: #ffffff;
  --header: #ffffff;
  --accent: #0b5d5b;
  --accent-hover: #084644;
  --accent-soft: #e4efec;
  --accent-line: #cfe2dd;
  --accent-ink: #ffffff;
  --warm: #e8734a;
  --warm-soft: #fceee6;
  --warm-ink: #9a3e1c;
  --sun-soft: #f3d9a4;
  --sun-ink: #5b4210;
  --ok: #2f6b4f;
  --ok-bg: #e4f0e8;
  --ok-line: #c3dccb;
  --err: #a33a26;
  --err-bg: #fbe9e4;
  --err-line: #efcabf;
  --hr: #4b3f86;
  --hr-bg: #ece9f6;
  --hr-line: #d6d0ec;
  --code-bg: #1f2a2a;
  --code-ink: #e6ecea;
  --scrim: rgba(20, 32, 31, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 40, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(20, 40, 40, 0.14);
  --sidebar: 248px;
  --focus: 0 0 0 3px rgba(11, 93, 91, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121716; --paper: #1a201f; --ink: #e6ecea; --ink-2: #c3ccca; --muted: #95a29f; --faint: #75827f;
    --line: #2a3432; --line-soft: #222a29; --subtle: #222a29; --hover: #252e2d; --input-bg: #151b1a; --header: #161c1b;
    --accent: #4cc2b2; --accent-hover: #6fd3c5; --accent-soft: #18322f; --accent-line: #24504a; --accent-ink: #06211f;
    --warm: #ff9370; --warm-soft: #3a2520; --warm-ink: #ffb79e; --sun-soft: #4a3a1c; --sun-ink: #f6d68e;
    --ok: #6ccb98; --ok-bg: #17302a; --ok-line: #24503f; --err: #ff8f7a; --err-bg: #3a1f1b; --err-line: #5a2c25;
    --hr: #b9aef0; --hr-bg: #26223d; --hr-line: #3c3566; --code-bg: #0c100f; --code-ink: #e6ecea;
    --scrim: rgba(0, 0, 0, 0.6); --shadow: none; --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    --focus: 0 0 0 3px rgba(76, 194, 178, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121716; --paper: #1a201f; --ink: #e6ecea; --ink-2: #c3ccca; --muted: #95a29f; --faint: #75827f;
  --line: #2a3432; --line-soft: #222a29; --subtle: #222a29; --hover: #252e2d; --input-bg: #151b1a; --header: #161c1b;
  --accent: #4cc2b2; --accent-hover: #6fd3c5; --accent-soft: #18322f; --accent-line: #24504a; --accent-ink: #06211f;
  --warm: #ff9370; --warm-soft: #3a2520; --warm-ink: #ffb79e; --sun-soft: #4a3a1c; --sun-ink: #f6d68e;
  --ok: #6ccb98; --ok-bg: #17302a; --ok-line: #24503f; --err: #ff8f7a; --err-bg: #3a1f1b; --err-line: #5a2c25;
  --hr: #b9aef0; --hr-bg: #26223d; --hr-line: #3c3566; --code-bg: #0c100f; --code-ink: #e6ecea;
  --scrim: rgba(0, 0, 0, 0.6); --shadow: none; --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 3px rgba(76, 194, 178, 0.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Nunito, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code { font-size: 0.9em; background: var(--subtle); padding: 1px 6px; border-radius: 6px; }

.wrap { width: min(1080px, calc(100% - 64px)); margin: 0 auto; }
.narrow { width: min(440px, calc(100% - 32px)); }

/* ---------- App shell: sidebar on desktop, drawer on phones ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar);
  z-index: 20;
  background: var(--header);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
body.has-nav { padding-left: var(--sidebar); }
.header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 10px;
  width: auto;
  margin: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.95rem;
}
.brand-text { display: grid; }
.brand-text span, .brand > span:not(.brand-mark):not(.brand-text) {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  margin: 0;
}
.nav-toggle { display: none; }
.nav-scrim { display: none; }
.nav-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 8px 12px 12px;
}
.nav-panel::-webkit-scrollbar { width: 6px; }
.nav-panel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.nav { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  margin: 0;
  padding: 0 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 38px;
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.who {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.who-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
}
.who-me:hover, .who-me.is-active { background: var(--hover); color: var(--ink); }
.who-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: var(--sun-soft); color: var(--sun-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 0.8rem;
}
.who-text { display: grid; line-height: 1.2; min-width: 0; }
.who-text strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-actions { display: flex; gap: 4px; padding: 0 4px; }
.who-actions a, .theme-toggle {
  font: inherit; font-size: 0.82rem; font-weight: 700;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 6px 8px; border-radius: 8px; text-decoration: none;
}
.who-actions a:hover, .theme-toggle:hover { background: var(--hover); color: var(--ink); }

.role-pill {
  justify-self: start;
  display: inline-block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0;
  padding: 0;
  background: none;
}

/* Guest pages (sign-in): no sidebar, centered */
body:not(.has-nav) .site-header {
  position: static;
  width: auto;
  border: 0;
  background: transparent;
}
body:not(.has-nav) .header-row { justify-content: center; padding: 48px 16px 8px; }

main.wrap, main.narrow { padding: 32px 0 64px; }

@media (max-width: 900px) {
  body.has-nav { padding-left: 0; }
  .wrap { width: min(1080px, calc(100% - 32px)); }
  .site-header {
    position: sticky;
    width: auto;
    bottom: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--header);
  }
  .header-row { padding: 8px 12px; min-height: 60px; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 44px; height: 44px; flex: 0 0 44px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; padding: 0;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--ink); }
  .nav-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(300px, 86vw);
    z-index: 40;
    background: var(--header);
    box-shadow: var(--shadow-pop);
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    visibility: hidden;
  }
  .nav-panel::before {
    content: "Menu";
    display: block;
    padding: 6px 10px 4px;
    font-weight: 800;
    font-size: 1.15rem;
  }
  body.nav-open .nav-panel { transform: none; visibility: visible; }
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  body.nav-open .site-header { z-index: 45; }
  .nav a { min-height: 46px; font-size: 1rem; }
  main.wrap, main.narrow { padding: 20px 0 48px; }
}

/* ---------- Page heading ---------- */
.hero { margin-bottom: 24px; }
.hero h1, .panel h1, .empty h1 {
  margin: 0 0 6px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hero > p:not(.eyebrow) { margin: 0; color: var(--muted); max-width: 62ch; }
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.muted { color: var(--muted); }
@media (max-width: 640px) {
  .hero { margin-bottom: 18px; }
  .hero h1, .panel h1, .empty h1 { font-size: 1.5rem; }
}

/* ---------- Cards + panels ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.card h2 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card:hover { border-color: var(--accent-line); color: inherit; transform: translateY(-1px); }

.panel, .empty {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; font-weight: 800; }
.panel h3 { font-weight: 800; }
@media (max-width: 640px) { .panel, .empty { padding: 18px 16px; } }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 14px; }
.form-grid { grid-template-columns: 1fr 1fr; }
.form-grid .btn { grid-column: 1 / -1; justify-self: start; }

label { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 700; color: var(--ink-2); }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--ink);
  font-weight: 500;
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 80px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: 0.86rem; border-radius: 10px; }
.btn-quiet { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.btn-quiet:hover { color: var(--ink); background: var(--hover); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: var(--err); filter: brightness(0.92); color: #fff; }

/* ---------- Flash / alerts ---------- */
.flash { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; list-style: none; font-weight: 600; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash.error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }

/* ---------- Tables (People) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.dir { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.dir th, table.dir td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.dir th { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); border-bottom-color: var(--line); }
table.dir tr:hover td { background: var(--subtle); }
tr.is-off td { color: var(--muted); }
.inline { display: inline; margin: 0; }
.row-actions { white-space: nowrap; }
.row-actions .btn, .row-actions form { margin: 0 4px 4px 0; }
.dir-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dir-head h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters a {
  text-decoration: none; color: var(--ink-2); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 0.86rem; font-weight: 700;
}
.filters a:hover { background: var(--hover); color: var(--ink); }
.filters a.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.site-footer { color: var(--faint); font-size: 0.8rem; padding: 0 0 28px; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Keg washer ---------- */
.keg-dash { max-width: 680px; }
.keg-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; gap: 8px; font-size: 0.95rem; }
.keg-row + .keg-row { border-top: 1px solid var(--line-soft); }
.keg-label { color: var(--muted); font-weight: 700; }
.keg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.keg-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.keg-dot.warn { background: #d1a426; box-shadow: 0 0 0 3px var(--sun-soft); }
.keg-dot.bad { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.keg-dot.idle { background: var(--faint); box-shadow: 0 0 0 3px var(--subtle); }
.keg-big { font-size: 1.9rem; font-weight: 800; margin: 6px 0 2px; letter-spacing: -0.01em; }
.keg-time { font-variant-numeric: tabular-nums; }
.keg-sub { color: var(--muted); font-size: 0.92rem; min-height: 1em; }
.keg-small { font-size: 0.82rem; margin-top: 8px; }
.keg-hnote { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 0.8rem; }
.keg-bar { height: 10px; background: var(--line-soft); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.keg-bar > div { height: 100%; background: var(--accent); width: 0; border-radius: 6px; transition: width .3s linear; }
.keg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.keg-btns .btn { width: 100%; text-align: center; }
.keg-msg { font-size: 0.88rem; margin-top: 8px; min-height: 1.2em; font-weight: 600; }
.keg-msg.ok { color: var(--ok); }
.keg-msg.bad { color: var(--err); }
.keg-vrow { display: grid; grid-template-columns: 1fr 88px 88px; gap: 8px; align-items: center; margin: 6px 0; }
.keg-vlbl { font-size: 0.95rem; font-weight: 600; }
.keg-vrow button {
  font: inherit; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-2); cursor: pointer; font-weight: 700; padding: 8px 10px;
}
.keg-vrow button:hover { background: var(--hover); }
.keg-vrow button:disabled { opacity: 0.4; cursor: not-allowed; }
.keg-vrow button.keg-on { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.keg-vrow button.keg-off { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.keg-vrow button.keg-span2 { grid-column: span 2; }
.keg-alloff-wrap { margin-top: 12px; }
.keg-alloff { width: 100%; }
.keg-grid { display: grid; grid-template-columns: 1fr 140px; gap: 8px 12px; align-items: center; margin-bottom: 6px; }
.keg-grid label { display: block; font-size: 0.88rem; font-weight: 600; }
.keg-grid input { margin: 0; }
@media (max-width: 640px) {
  .keg-btns { grid-template-columns: 1fr; }
  .keg-grid { grid-template-columns: 1fr; }
  .keg-vrow { grid-template-columns: 1fr 1fr; }
  .keg-vrow .keg-vlbl { grid-column: 1 / -1; }
  .keg-vrow button.keg-span2 { grid-column: 1 / -1; }
}

/* ---------- Policies ---------- */
html { scroll-padding-top: 1.5rem; }
.policy-toc {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px 14px; box-shadow: var(--shadow); margin-bottom: 22px;
  position: sticky; top: 16px; z-index: 8; max-height: min(55vh, 28rem); overflow: auto; -webkit-overflow-scrolling: touch;
}
.policy-toc-heading { margin: 0 0 8px; padding: 0 10px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.policy-toc-list, .policy-toc-list ul { list-style: none; margin: 0; padding: 0; }
.policy-toc-list { display: grid; gap: 2px; }
.policy-toc-list > li > a { font-weight: 700; }
.policy-toc a { display: flex; align-items: center; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.92rem; min-height: 40px; }
.policy-toc a:hover { background: var(--hover); color: var(--ink); }
.policy-toc-list ul { padding: 0 0 6px 12px; }
.policy-toc-list ul a { font-size: 0.86rem; font-weight: 600; color: var(--muted); min-height: 36px; padding: 6px 10px; }
.policy-article {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px 32px; box-shadow: var(--shadow); margin-bottom: 18px;
  font-size: 1.04rem; line-height: 1.7; scroll-margin-top: 1.5rem; max-width: 76ch;
}
.policy-article h2 { margin: 0 0 14px; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; scroll-margin-top: 1.5rem; }
.policy-article h3 { margin: 28px 0 10px; font-size: 1.14rem; font-weight: 800; scroll-margin-top: 1.5rem; }
.policy-article h4 { margin: 18px 0 8px; font-size: 0.98rem; font-weight: 800; }
.policy-article p { margin: 0 0 12px; }
.policy-article ul, .policy-article ol { margin: 0 0 14px; padding-left: 1.35em; }
.policy-article li { margin: 0 0 6px; }
.policy-sub { scroll-margin-top: 1.5rem; }
ol.policy-alpha { list-style: lower-alpha; }
ol.policy-decimal { list-style: decimal; }
.policy-callout { border-radius: 12px; padding: 14px 16px; margin: 12px 0 16px; border: 1px solid var(--line); background: var(--subtle); }
.policy-callout p { margin: 0 0 8px; }
.policy-callout p:last-child { margin-bottom: 0; }
.policy-callout ul { margin: 8px 0 0; padding-left: 1.2em; }
.policy-callout-title { font-weight: 800; margin: 0 0 8px !important; }
.policy-callout-rates { background: var(--accent-soft); border-color: var(--accent-line); }
.policy-callout-warn { background: var(--err-bg); border-color: var(--err-line); }
.policy-callout-note { background: var(--ok-bg); border-color: var(--ok-line); }
.policy-note, .policy-attr { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 900px) {
  html { scroll-padding-top: 5rem; }
  .policy-article, .policy-article h2, .policy-article h3, .policy-sub { scroll-margin-top: 5rem; }
}
@media (max-width: 640px) {
  .policy-toc { position: static; max-height: none; }
  .policy-article { padding: 20px 16px 24px; font-size: 1.04rem; }
}

/* ---------- Schedule (+ Home "today") ---------- */
.home-today { margin-bottom: 18px; }
.home-today h2 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.home-today h2 .muted { font-size: 0.85rem; font-weight: 600; }
.home-today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-today-grid .panel { margin-bottom: 0; }
.home-today-grid h3 { margin: 0 0 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.home-shift-list, .sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.home-shift-list li, .sched-list li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; justify-content: space-between; font-size: 0.93rem; }
.home-shift-list li span { color: var(--muted); font-size: 0.86rem; }
.home-shift.sched-closer span { color: var(--accent); font-weight: 700; }
.home-shift.is-off, .sched-status-approved { color: var(--muted); }
.sched-status-denied { text-decoration: line-through; color: var(--muted); }

.sched-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; }
.sched-board { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.sched-col h2 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; }
.sched-day {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 12px 10px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.sched-day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sched-day.is-today h3 { color: var(--accent); }
.sched-day h3 { margin: 0 0 8px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.sched-shifts { display: grid; gap: 6px; }
.sched-shift {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name lock" "hours src";
  gap: 0 8px; align-items: baseline; width: 100%; text-align: left;
  background: var(--subtle); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 11px; color: inherit; cursor: default; font: inherit;
}
button.sched-shift { cursor: pointer; }
button.sched-shift:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.sched-name { grid-area: name; font-weight: 700; }
.sched-hours { grid-area: hours; font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.sched-src { grid-area: src; font-size: 0.72rem; color: var(--faint); font-weight: 600; text-align: right; }
.sched-closer .sched-hours { color: var(--accent); font-weight: 700; }
.sched-lock { grid-area: lock; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.sched-shift.is-off { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.sched-empty { margin: 0; font-size: 0.9rem; color: var(--faint); }
.sched-pending-row .btn + .btn, .row-actions .btn + .btn, .cl-verify-actions .btn + .btn { margin-left: 6px; }
.sched-pending-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.sched-msg { margin: 0 0 14px; font-size: 0.92rem; font-weight: 600; }
.sched-msg.ok { color: var(--ok); }
.sched-msg.bad { color: var(--err); }
.sched-ics { margin-top: 16px; }
.sched-ics summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.sched-ics .stack, .sched-ics label { margin-top: 8px; }
.sched-token {
  background: var(--code-bg); color: var(--code-ink); padding: 12px 14px; border-radius: var(--radius-sm);
  overflow-x: auto; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem;
}

/* ---------- Modals (schedule, checklist editor, HR flag, spot check) ---------- */
.sched-modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim); z-index: 50;
  display: grid; place-items: center; padding: 16px;
}
.sched-modal-backdrop[hidden] { display: none !important; }
.sched-modal {
  width: min(460px, 100%); margin: 0; max-height: 90vh; overflow: auto;
  border-radius: 20px; box-shadow: var(--shadow-pop); padding: 24px;
}
.sched-modal h2 { font-size: 1.25rem; }
.sched-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
@media (max-width: 640px) {
  .sched-modal-backdrop { place-items: end center; padding: 0; }
  .sched-modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .sched-modal-actions .btn { flex: 1; }
}

label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
label.check input { width: auto; margin: 0; }

@media (max-width: 640px) {
  .home-today-grid, .sched-board { grid-template-columns: 1fr; }
}

/* ---------- Checklists ---------- */
.cl-board { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; align-items: start; }
.cl-col h2 { margin: 0 0 10px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cl-card { padding: 18px 18px 8px; }
.cl-card h3 { margin: 0 0 2px; font-size: 1.12rem; font-weight: 800; }
.cl-meta { margin: 0 0 10px; font-size: 0.88rem; font-weight: 600; }
.cl-empty-note { margin: 0; color: var(--muted); font-size: 0.95rem; }
.cl-items { list-style: none; margin: 0 -18px; padding: 0; display: grid; }
.cl-items li {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 10px 18px; border-top: 1px solid var(--line-soft);
}
.cl-items li > .cl-pri + * { margin-left: 36px; }
.cl-items li > label.check { flex: 1 1 calc(100% - 70px); min-height: 36px; font-weight: 700; font-size: 0.98rem; }
/* round, thumb-sized checkboxes */
.cl-items label.check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 26px;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--input-bg);
  cursor: pointer; display: grid; place-items: center; transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.cl-items label.check input[type="checkbox"]::before { content: ""; position: absolute; inset: -9px; }
.cl-items label.check input[type="checkbox"]:hover:not(:disabled) { border-color: var(--accent); }
.cl-items label.check input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
  border-color: var(--accent);
}
.cl-items label.check input[type="checkbox"]:disabled { cursor: default; }
.cl-items label.check input[type="checkbox"]:disabled:not(:checked) { background: var(--subtle); }
.cl-items label.check input:checked + span { color: var(--muted); font-weight: 600; }
.cl-who { font-size: 0.82rem; font-weight: 600; }
.cl-card.cl-status-verified { border-color: var(--ok-line); }
.cl-card.cl-status-awaiting_verify { border-color: var(--accent-line); }
.cl-card.cl-status-missed { border-color: var(--err-line); }
.cl-card.cl-deep { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transition: box-shadow 0.6s; }
.cl-card { scroll-margin-top: 16px; }
.cl-verify-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.cl-verify-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.cl-pri {
  display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0;
  padding: 2px 9px; border-radius: 999px; background: var(--subtle); color: var(--muted);
}
.cl-pri-1 { background: var(--warm-soft); color: var(--warm-ink); }
.cl-pri-2 { background: var(--subtle); color: var(--ink-2); }
.cl-pri-3 { background: transparent; color: var(--faint); border: 1px solid var(--line); }

.cl-tpl { border-top: 1px solid var(--line-soft); padding: 18px 0 10px; margin-top: 8px; }
.cl-tpl.is-off { opacity: 0.6; }
.cl-tpl-head h3 { margin: 0 0 2px; font-size: 1.05rem; }
.cl-tpl-head p { margin: 0 0 10px; }
.cl-tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cl-item-edit, .cl-item-add { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.cl-item-edit-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.cl-item-add { margin-top: 6px; }
.cl-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 8px; }
.cl-fieldset legend { font-size: 0.86rem; font-weight: 700; padding: 0 4px; }
@media (max-width: 640px) {
  .cl-board { grid-template-columns: 1fr; }
  .cl-card { padding: 16px 16px 6px; }
  .cl-items { margin: 0 -16px; }
  .cl-items li { padding: 10px 16px; }
}
@media (min-width: 641px) {
  .cl-item-edit, .cl-item-add { grid-template-columns: 1fr minmax(12rem, 16rem) auto; align-items: end; }
}

/* ---------- Feed + Messages ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--warm); color: #fff;
  font-size: 0.72rem; font-weight: 800; line-height: 1; vertical-align: middle;
}
.home-hero { margin-bottom: 18px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-bottom: 22px; }
.side-col { display: grid; gap: 14px; position: sticky; top: 24px; }
.side-col .home-today { margin: 0; }
.side-col .home-today-grid { grid-template-columns: 1fr; gap: 10px; }
.side-col .home-today h2 { font-size: 1rem; }
.side-col .panel { padding: 16px 18px; margin: 0; }
.side-msgs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; text-decoration: none; color: inherit; }
.side-msgs:hover { border-color: var(--accent-line); color: inherit; }
.side-msgs-sub { flex-basis: 100%; font-size: 0.86rem; }

.feed-msg { padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.feed-msg.bad { background: var(--err-bg); border-color: var(--err-line); }
.feed-msg.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.feed-composer { display: grid; gap: 10px; padding: 16px; }
.feed-composer textarea, .feed-composer input[type=text], .dm-send textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--input-bg); color: var(--ink); resize: vertical;
}
.feed-composer textarea { min-height: 64px; }
.fc-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.fc-actions { justify-content: space-between; }
.fc-inline { display: flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 700; color: var(--muted); }
.fc-inline select { width: auto; min-height: 36px; padding: 6px 10px; font-size: 0.88rem; font-weight: 700; background-color: var(--subtle); border-color: transparent; }
.fc-stock { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fc-stock label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 700; }
.feed-off { margin: 0 0 12px; }
.feed-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.feed-filters button {
  font: inherit; font-size: 0.86rem; font-weight: 700; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; min-height: 34px; white-space: nowrap;
}
.feed-filters button:hover { background: var(--hover); }
.feed-filters button.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.feed-list { display: grid; gap: 14px; }
.feed-post { margin: 0; padding: 18px; }
.feed-post.is-pinned { border-color: var(--accent-line); background: linear-gradient(var(--accent-soft), var(--paper) 72px); }
.feed-post.feed-sev-urgent { border-color: var(--err-line); box-shadow: 0 0 0 1px var(--err-line); }
.feed-post.feed-sev-warning { border-color: var(--line); }
.feed-head { display: flex; align-items: center; gap: 11px; position: relative; }
.feed-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 0.82rem;
}
.feed-avatar.is-bot { background: var(--sun-soft); color: var(--sun-ink); }
.feed-who { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.feed-name { font-weight: 800; text-decoration: none; color: var(--ink); }
.feed-name:hover { color: var(--accent); }
.feed-meta { font-size: 0.82rem; }
.feed-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.feed-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0; text-transform: none;
  padding: 3px 10px; border-radius: 999px; background: var(--subtle); color: var(--ink-2); white-space: nowrap;
}
.feed-badge-pin { background: var(--accent-soft); color: var(--accent); }
.feed-badge-urgent { background: var(--err-bg); color: var(--err); }
.feed-badge-warning { background: var(--warm-soft); color: var(--warm-ink); }
.feed-badge-hr { background: var(--hr-bg); color: var(--hr); }
.feed-menu { position: relative; }
.feed-menu summary {
  list-style: none; cursor: pointer; padding: 4px 8px; border-radius: 8px; font-size: 1.15rem; line-height: 1.2;
  color: var(--faint); min-width: 36px; min-height: 36px; display: grid; place-items: center; font-weight: 800;
}
.feed-menu summary:hover { background: var(--hover); color: var(--ink); }
.feed-menu summary::-webkit-details-marker { display: none; }
.feed-menu[open] summary { background: var(--hover); }
.feed-menu-items {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 210px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  display: grid; padding: 6px;
}
.feed-menu-items button { font: inherit; font-weight: 600; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.feed-menu-items button:hover { background: var(--hover); }
.feed-menu-items .is-danger, .linkish.is-danger { color: var(--err); }
.feed-content { margin: 12px 0 0; }
.feed-title { margin: 0 0 4px; font-size: 1.08rem; font-weight: 800; }
.feed-body { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.feed-note { margin: 6px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warm-soft); color: var(--warm-ink); font-weight: 600; font-size: 0.92rem; white-space: pre-wrap; }
.feed-about { margin: 0 0 6px; font-size: 0.88rem; }
.feed-stock { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 8px; font-size: 0.93rem; padding: 12px 14px; background: var(--subtle); border-radius: var(--radius-sm); }
.feed-stock dt { font-weight: 700; color: var(--muted); }
.feed-stock dd { margin: 0; }
.feed-stock-out_of_stock, .feed-stock-discontinued { color: var(--err); font-weight: 700; }
.feed-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 6px; }
.feed-score-nums { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.feed-score-delta { font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--subtle); }
.feed-score.is-up .feed-score-delta { background: var(--ok-bg); color: var(--ok); }
.feed-score.is-down .feed-score-delta { background: var(--err-bg); color: var(--err); }
.feed-actions { display: flex; gap: 4px; margin: 12px -8px 0; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.feed-act {
  font: inherit; font-size: 0.88rem; font-weight: 700; background: none; border: 0; border-radius: 8px;
  padding: 8px 12px; cursor: pointer; color: var(--muted); min-height: 40px;
}
.feed-act:hover { background: var(--hover); color: var(--ink); }
.feed-act.is-on, .feed-act[aria-pressed="true"] { color: var(--warm); }
.feed-comments { margin-top: 6px; }
.feed-c-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed-comment { background: var(--subtle); border-radius: 12px; padding: 9px 12px; }
.feed-comment.has-hr { box-shadow: inset 0 0 0 2px var(--hr-line); }
.feed-c-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 0.85rem; }
.feed-c-tools { margin-left: auto; display: flex; gap: 8px; }
.feed-comment .feed-body { margin: 2px 0 0; font-size: 0.93rem; }
.feed-c-form { display: flex; gap: 6px; margin-top: 8px; }
.feed-c-form input { flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--input-bg); color: var(--ink); min-height: 38px; }
.feed-c-form .btn { border-radius: 999px; min-height: 38px; }
.feed-c-form .btn:not(.btn-quiet) { background: var(--accent-soft); color: var(--accent); }
.feed-c-form .btn:not(.btn-quiet):hover { background: var(--accent); color: var(--accent-ink); }
.feed-c-form .btn-quiet { border-color: transparent; background: transparent; min-width: 38px; }
.linkish { font: inherit; font-size: 0.82rem; font-weight: 700; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.feed-more { margin: 16px auto 0; display: flex; }
.feed-empty p { margin: 0; }

.dm-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.dm-threads, .dm-convo { margin: 0; padding: 14px; }
.dm-new { display: grid; gap: 6px; margin-bottom: 12px; font-size: 0.86rem; font-weight: 700; }
.dm-new-row { display: flex; gap: 6px; }
.dm-new-row select { flex: 1; min-width: 0; }
.dm-thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dm-thread {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit;
  background: none; border: 0; border-radius: 12px; padding: 10px; cursor: pointer; color: inherit; min-height: 56px;
}
.dm-thread:hover { background: var(--hover); }
.dm-thread.is-on { background: var(--accent-soft); }
.dm-thread.is-unread strong { color: var(--ink); font-weight: 800; }
.dm-thread.is-unread .dm-thread-text::after { content: ""; }
.dm-thread-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.dm-thread-text .muted { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-convo-head { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.dm-convo-head h2 { margin: 0; font-size: 1.1rem; }
.dm-back { display: none; }
.dm-messages { display: flex; flex-direction: column; gap: 8px; min-height: 280px; max-height: 60vh; overflow-y: auto; padding: 6px 2px; margin-bottom: 10px; }
.dm-bubble { max-width: 80%; align-self: flex-start; background: var(--subtle); border-radius: 18px 18px 18px 6px; padding: 9px 14px; }
.dm-bubble.is-mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-radius: 18px 18px 6px 18px; }
.dm-bubble.is-mine .feed-body, .dm-bubble.is-mine .muted, .dm-bubble.is-mine a { color: inherit; }
.dm-bubble.is-mine .dm-when { opacity: 0.8; }
.dm-bubble.has-hr { box-shadow: 0 0 0 2px var(--hr-line); }
.dm-bubble .feed-body { margin: 0; }
.dm-when { font-size: 0.72rem; }
.dm-send { display: flex; gap: 8px; align-items: flex-end; }
.dm-send textarea { flex: 1; }

.fs-check { align-items: flex-start; margin: 0 0 12px; font-weight: 600; }
.fs-check input { margin-top: 4px; }

.hr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hr-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.hr-item-head { font-size: 0.9rem; margin-bottom: 4px; }
.hr-meta { font-size: 0.82rem; margin: 0 0 6px; }

@media (max-width: 1080px) {
  .home-layout { grid-template-columns: 1fr; }
  .side-col { position: static; order: -1; grid-template-columns: 1fr 1fr; }
  .side-col .home-today { grid-column: 1 / -1; }
  .side-col .home-today-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .fc-stock { grid-template-columns: 1fr; }
  .feed-post { padding: 16px 14px; }
  .side-col { grid-template-columns: 1fr; }
  .side-col .home-today-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .side-col .panel { padding: 14px; }
  .dm-layout { grid-template-columns: 1fr; }
  .dm-layout.dm-open .dm-threads { display: none; }
  .dm-layout:not(.dm-open) .dm-convo { display: none; }
  .dm-back { display: inline-flex; }
  .dm-messages { max-height: 58vh; }
  .feed-badges { max-width: 45%; }
}
@media (max-width: 400px) {
  .side-col .home-today-grid { grid-template-columns: 1fr; }
}

/* ---------- Feed media, links, reports ---------- */
.fc-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.fc-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-chip {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; padding: 6px 30px 6px 8px; font-size: 0.82rem; overflow: hidden;
}
.fc-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.fc-chip-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.fc-chip-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); transition: width 0.2s; }
.fc-chip.is-done .fc-chip-bar { display: none; }
.fc-chip.is-busy { opacity: 0.85; }
.fc-chip-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); padding: 4px 6px; }
.feed-media { display: grid; gap: 6px; margin: 10px 0 4px; grid-template-columns: 1fr; }
.feed-media-n2, .feed-media-n3, .feed-media-n4 { grid-template-columns: 1fr 1fr; }
.feed-img img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; background: var(--subtle); }
.feed-media-n1 .feed-img img { object-fit: cover; max-height: 440px; }
.feed-video { display: block; width: 100%; max-height: 480px; border-radius: 12px; background: #000; }
.feed-link-card {
  display: grid; gap: 2px; margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--subtle); color: var(--ink); text-decoration: none;
}
.feed-link-card:hover { border-color: var(--accent-line); color: var(--ink); }
.feed-link-site { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.feed-link-desc { font-size: 0.88rem; color: var(--muted); }
.feed-body a, .feed-note a { overflow-wrap: anywhere; }
.feed-c-form .btn-quiet { padding: 6px 10px; }
.dm-send { display: grid; gap: 8px; }
.dm-send-row { display: flex; gap: 8px; align-items: flex-end; }
.dm-send-row textarea { flex: 1; min-height: 44px; border-radius: 22px; padding: 11px 16px; }
.dm-send-row .btn { border-radius: 999px; }
.dm-bubble .feed-media { max-width: 320px; }
.dm-bubble.is-reported { box-shadow: 0 0 0 2px var(--err-line); }
.dm-reported { font-size: 0.72rem; color: var(--err); font-weight: 700; }
.dm-from { display: block; font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.dm-readonly { max-height: none; }
.report-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.fs-inline { display: inline-block; margin-top: 6px; }
@media (max-width: 640px) {
  .fc-right { width: 100%; justify-content: flex-end; }
  .fc-chip-name { max-width: 8rem; }
}

/* ---------- Checklist task reference media ---------- */
.cl-task-media { flex-basis: 100%; display: grid; gap: 6px; padding-left: 36px; }
.cl-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-thumb { padding: 0; border: 0; border-radius: 10px; background: var(--subtle); cursor: zoom-in; width: 64px; height: 64px; overflow: hidden; display: block; }
.cl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.cl-thumb:hover img { transform: scale(1.05); }
.cl-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-video-wrap { display: grid; gap: 6px; justify-items: start; }
.cl-video-btn { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.cl-video-btn:hover { background: var(--accent-soft); color: var(--accent-hover); }
.cl-video { width: 100%; max-width: 480px; max-height: 360px; border-radius: 12px; background: #000; }
.cl-lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(10, 16, 15, 0.9);
  display: flex; align-items: center; justify-content: center; padding: 56px 12px 12px;
}
.cl-lightbox[hidden] { display: none !important; pointer-events: none; }
.cl-lb-img { max-width: 100%; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); object-fit: contain; border-radius: 12px; background: #222; }
.cl-lb-close {
  position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.cl-lb-close:hover { background: rgba(255, 255, 255, 0.26); }
.cl-lb-close:focus-visible { outline: 2px solid #fff; }
body.cl-lb-open { overflow: hidden; }
.cl-item-media-edit { grid-column: 1 / -1; display: grid; gap: 8px; }
.cl-media-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.cl-media-cell { display: grid; gap: 4px; justify-items: center; }
.cl-media-vid { width: 64px; height: 64px; border-radius: 10px; background: var(--code-bg); color: #fff; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; }
.cl-media-tools { display: flex; gap: 2px; }
.cl-media-tools .btn { padding: 2px 7px; min-width: 0; min-height: 30px; }
.cl-media-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cl-media-hint, .cl-media-status { font-size: 0.8rem; }
@media (max-width: 640px) {
  .cl-task-media { padding-left: 36px; }
  .cl-thumb, .cl-media-vid { width: 72px; height: 72px; }
}

/* ---------- Photo spot checks ---------- */
.cl-spot { text-align: left; }
.cl-spot h2 { font-size: 1.3rem; }
.cl-spot-task { font-weight: 800; margin: 0; padding: 12px 14px; background: var(--subtle); border-radius: 12px; }
.cl-spot-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cl-spot-actions .btn { font-size: 1.05rem; padding: 12px 20px; min-height: 52px; flex: 1; }
.cl-spot-cant summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 0.9rem; padding: 8px 0; }
.cl-spot-cant[hidden] { display: none !important; }
.cl-spot-cant form .btn { justify-self: start; }
.cl-spot-need { padding: 4px 12px; }
.cl-spot-badge { font-size: 0.76rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--subtle); color: var(--muted); }
.cl-spot-badge.is-photo { background: var(--ok-bg); color: var(--ok); }
.cl-spot-badge.is-cant { background: var(--warm-soft); color: var(--warm-ink); }
.feed-proof-use { margin: 10px 0 0; }
.feed-proof-use .btn { background: var(--paper); color: var(--accent); border: 1px solid var(--accent-line); }
.feed-proof-use .btn:hover { background: var(--accent-soft); color: var(--accent-hover); }
.feed-proof-added { font-weight: 800; color: var(--ok); }
.fs-tiers { display: grid; gap: 8px; margin: 10px 0; }
.fs-tiers label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fs-tiers input[type=number] { width: 5.5rem; }

/* "Congrats!" toast before going to the feed: never blocks clicks */
.cl-congrats {
  position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 70;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.6rem;
  padding: 20px 32px; border-radius: 20px; box-shadow: var(--shadow-pop);
  pointer-events: none; white-space: nowrap; animation: cl-pop 0.3s cubic-bezier(.2, 1.4, .4, 1);
}
.cl-congrats[hidden] { display: none !important; }
@keyframes cl-pop { from { transform: translateX(-50%) scale(0.8); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Schedule calendar (week / month / day). Department colours:
   FOH = teal, Kitchen (BOH) = terracotta, Management (both) = indigo.
   ========================================================================== */
:root {
  --dept-foh: #0b5d5b; --dept-foh-bg: #e2efec; --dept-foh-line: #b9d8d1;
  --dept-boh: #b4532b; --dept-boh-bg: #fbe9df; --dept-boh-line: #f0c7b2;
  --dept-mgmt: #4b3f86; --dept-mgmt-bg: #ebe8f6; --dept-mgmt-line: #d0c9ea;
  --acc-0: #0b5d5b; --acc-1: #b4532b; --acc-2: #4b3f86; --acc-3: #2f6b4f;
  --acc-4: #8a5a12; --acc-5: #1e5a8a; --acc-6: #9a3e5c; --acc-7: #5a6b1f;
  --cal-today: #fff7e8; --cal-today-line: #f1cf8b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dept-foh: #4cc2b2; --dept-foh-bg: #163330; --dept-foh-line: #24504a;
    --dept-boh: #ff9a76; --dept-boh-bg: #3a241d; --dept-boh-line: #5c3528;
    --dept-mgmt: #b9aef0; --dept-mgmt-bg: #25213b; --dept-mgmt-line: #3c3566;
    --acc-0: #2f8f86; --acc-1: #c06a45; --acc-2: #6f62b5; --acc-3: #3f8f68;
    --acc-4: #a87a2e; --acc-5: #3d7fb5; --acc-6: #b55a78; --acc-7: #7b8f33;
    --cal-today: #2a2618; --cal-today-line: #6b5726;
  }
}
:root[data-theme="dark"] {
  --dept-foh: #4cc2b2; --dept-foh-bg: #163330; --dept-foh-line: #24504a;
  --dept-boh: #ff9a76; --dept-boh-bg: #3a241d; --dept-boh-line: #5c3528;
  --dept-mgmt: #b9aef0; --dept-mgmt-bg: #25213b; --dept-mgmt-line: #3c3566;
  --acc-0: #2f8f86; --acc-1: #c06a45; --acc-2: #6f62b5; --acc-3: #3f8f68;
  --acc-4: #a87a2e; --acc-5: #3d7fb5; --acc-6: #b55a78; --acc-7: #7b8f33;
  --cal-today: #2a2618; --cal-today-line: #6b5726;
}
.dept-foh { --d: var(--dept-foh); --d-bg: var(--dept-foh-bg); --d-line: var(--dept-foh-line); }
.dept-boh { --d: var(--dept-boh); --d-bg: var(--dept-boh-bg); --d-line: var(--dept-boh-line); }
.dept-mgmt { --d: var(--dept-mgmt); --d-bg: var(--dept-mgmt-bg); --d-line: var(--dept-mgmt-line); }
.acc-0 { --acc: var(--acc-0); } .acc-1 { --acc: var(--acc-1); } .acc-2 { --acc: var(--acc-2); } .acc-3 { --acc: var(--acc-3); }
.acc-4 { --acc: var(--acc-4); } .acc-5 { --acc: var(--acc-5); } .acc-6 { --acc: var(--acc-6); } .acc-7 { --acc: var(--acc-7); }

/* Toolbar + legend */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 10px; }
.cal-views { display: inline-flex; padding: 3px; background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; }
.cal-view-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); font-weight: 700; font-size: 0.9rem; text-decoration: none; }
.cal-view-btn:hover { color: var(--ink); }
.cal-view-btn.is-on { background: var(--paper); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.cal-nav { display: inline-flex; gap: 6px; }
.cal-nav .btn { min-height: 40px; padding: 6px 12px; }
.cal-arrow { font-size: 1.3rem; line-height: 1; width: 42px; padding: 0 !important; }
.cal-title { margin: 0; font-size: 1.15rem; font-weight: 800; flex: 1 1 auto; min-width: 10ch; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 16px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--d); flex: none; }
.cal-key-closer { width: 14px; height: 9px; border-radius: 3px; background: var(--subtle); border-right: 3px solid var(--ink-2); }
.cal-key-off { width: 14px; height: 9px; border-radius: 3px; border: 1px dashed var(--faint); }
.cal-key-mine { width: 14px; height: 9px; border-radius: 3px; box-shadow: 0 0 0 2px var(--warm); }
.cal { min-height: 200px; }
.cal[aria-busy="true"] > :not(.cal-loading) { opacity: 0.55; transition: opacity 0.15s; }
.cal-loading { padding: 40px 0; text-align: center; }

/* Avatar */
.cal-av { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--acc, var(--accent)); color: #fff;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.02em; line-height: 1; }

/* Shift chip (week) */
.cal-chip { display: flex; align-items: flex-start; gap: 7px; width: 100%; padding: 6px 7px 6px 6px; border-radius: 10px; text-align: left;
  background: var(--d-bg); border: 1px solid var(--d-line); border-left: 3px solid var(--d); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
button.cal-chip:hover, a.cal-chip:hover { border-color: var(--d); }
.cal-chip:focus-visible, .cal-bar:focus-visible, .cal-mday:focus-visible, .cal-dhead:focus-visible { outline: none; box-shadow: var(--focus); }
.cal-chip-main { display: grid; min-width: 0; line-height: 1.2; }
.cal-chip-name { font-weight: 800; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip-time { font-size: 0.76rem; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.cal-chip-pos { font-size: 0.66rem; color: var(--d); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.sched-closer { border-right: 3px solid var(--d); }
.cal-chip.sched-closer .cal-chip-time { color: var(--d); font-weight: 800; }
.cal-chip.is-mine, .cal-mchip.is-mine, .cal-bar.is-mine { box-shadow: 0 0 0 2px var(--warm); }
.cal-chip.is-conflict { background: repeating-linear-gradient(135deg, var(--d-bg), var(--d-bg) 6px, var(--paper) 6px, var(--paper) 12px); }
.cal-offchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border: 1px dashed var(--line); border-radius: 999px; font-size: 0.72rem; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cal-offchip-kind { font-weight: 800; color: var(--faint); text-transform: uppercase; font-size: 0.62rem; letter-spacing: 0.04em; }
.cal-empty { color: var(--faint); font-size: 0.85rem; }

/* Week grid: day columns × lane rows. Each .cal-day is display:contents on desktop, a card on phones. */
.cal-week { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); grid-template-rows: auto auto auto auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-day { display: contents; }
.cal-corner { grid-column: 1; grid-row: 1; border-bottom: 1px solid var(--line); }
.cal-lane-label { grid-column: 1; padding: 10px 8px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint);
  border-bottom: 1px solid var(--line-soft); }
.cal-lane-label.r-off { border-bottom: 0; }
.r-front { grid-row: 2; } .r-kitchen { grid-row: 3; } .r-off { grid-row: 4; }
.d0 > * { grid-column: 2; } .d1 > * { grid-column: 3; } .d2 > * { grid-column: 4; } .d3 > * { grid-column: 5; }
.d4 > * { grid-column: 6; } .d5 > * { grid-column: 7; } .d6 > * { grid-column: 8; }
.cal-dhead { grid-row: 1; display: grid; justify-items: start; gap: 0; padding: 10px 8px 8px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; position: relative; }
.cal-dhead:hover { background: var(--hover); }
.cal-dhead-wd { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.cal-dhead-num { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.cal-dhead-count { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.cal-today-pill { position: absolute; top: 9px; right: 7px; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 999px; background: var(--warm); color: #fff; }
.cal-cell { display: flex; flex-direction: column; gap: 5px; padding: 7px 6px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); min-height: 64px; min-width: 0; }
.cal-cell.r-off { border-bottom: 0; min-height: 0; padding-top: 6px; padding-bottom: 8px; gap: 4px; }
.cal-cell-lane { display: none; }
.cal-cell.is-editable { cursor: copy; }
.cal-add { align-self: stretch; margin-top: auto; padding: 4px; border: 1px dashed transparent; border-radius: 8px; background: none; color: var(--faint);
  font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; border-color: var(--line); }
.cal-add:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.cal-day.is-today > * { background: var(--cal-today); }
.cal-day.is-today .cal-dhead { box-shadow: inset 0 3px 0 var(--warm); }
.cal-day.is-today .cal-dhead-num { color: var(--warm-ink); }

/* Month grid */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-mwd { padding: 8px 8px 6px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); border-bottom: 1px solid var(--line); }
.cal-mday { display: flex; flex-direction: column; gap: 4px; min-height: 118px; padding: 7px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft);
  color: var(--ink); text-decoration: none; min-width: 0; }
.cal-mday:nth-child(7n + 1) { border-left: 0; }
.cal-mday:nth-child(-n + 14) { border-top: 0; }
.cal-mday:hover { background: var(--hover); }
.cal-mday.is-out { background: var(--subtle); color: var(--faint); }
.cal-mday.is-out .cal-mchip { opacity: 0.6; }
.cal-mday.is-today { background: var(--cal-today); box-shadow: inset 0 0 0 2px var(--cal-today-line); }
.cal-mtop { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-mnum { font-weight: 800; font-size: 0.95rem; }
.cal-mday.is-today .cal-mnum { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 999px; background: var(--warm); color: #fff; }
.cal-mday.has-mine .cal-mnum::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--warm); vertical-align: middle; }
.cal-mday.is-today.has-mine .cal-mnum::after { display: none; }
.cal-dots { display: inline-flex; gap: 3px; }
.cal-mcount { font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.cal-mchips { display: grid; gap: 3px; }
.cal-mchip { display: flex; align-items: center; gap: 5px; padding: 2px 6px 2px 3px; border-radius: 7px; background: var(--d-bg); border-left: 3px solid var(--d); font-size: 0.74rem; min-width: 0; }
.cal-mchip .cal-av { width: 18px; height: 18px; font-size: 0.55rem; }
.cal-mchip-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.cal-mchip-time { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 0.7rem; font-weight: 600; }
.cal-more { font-size: 0.72rem; font-weight: 800; color: var(--accent); }
.cal-moff { font-size: 0.68rem; color: var(--faint); font-weight: 700; margin-top: auto; }

/* Day view: coverage histogram + hour timeline */
.cal-dayview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; }
.cal-back { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-day-sum { margin-left: auto; font-size: 0.86rem; font-weight: 600; }
.cal-tl { --label: 210px; }
.cal-tl-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 0; }
.cal-tl-row.is-mine .cal-tl-label strong { color: var(--warm-ink); }
.cal-tl-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cal-tl-who { display: grid; min-width: 0; line-height: 1.25; }
.cal-tl-who strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-tl-meta { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.cal-tl-note { font-size: 0.74rem; color: var(--ink-2); font-style: italic; }
.cal-tl-warn { font-size: 0.72rem; color: var(--err); font-weight: 700; }
.cal-tl-track { position: relative; height: 32px; border-radius: 8px;
  background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px calc(100% / var(--hours))); }
.cal-tl-lane { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.cal-tl-lane-title { margin: 0 0 4px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.cal-empty-lane { margin: 4px 0 6px; font-size: 0.88rem; }
.cal-bar { position: absolute; top: 3px; bottom: 3px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 7px; min-width: 6px; overflow: hidden;
  background: var(--d); color: #fff; border: 0; font: inherit; font-size: 0.74rem; font-weight: 800; white-space: nowrap; text-align: left; cursor: default; }
:root[data-theme="dark"] .cal-bar { color: #0c1413; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-bar { color: #0c1413; } }
button.cal-bar { cursor: pointer; }
button.cal-bar:hover { filter: brightness(1.08); }
.cal-bar.is-open { background: linear-gradient(90deg, var(--d) 70%, color-mix(in srgb, var(--d) 35%, transparent)); }
.cal-bar-closer { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); }
.cal-now { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--warm); border-radius: 2px; pointer-events: none; }
.cal-tl-axis .cal-tl-track, .cal-tl-cov .cal-tl-track { background: none; height: auto; }
.cal-axis { position: relative; height: 18px; }
.cal-axis-t { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.68rem; font-weight: 700; color: var(--faint); white-space: nowrap; }
.cal-axis-t:first-child { transform: none; }
.cal-axis-t.is-minor { visibility: hidden; }
.cal-cov-title { position: absolute; left: calc(-1 * var(--label) - 12px); bottom: 2px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.cal-cov { position: relative; }
.cal-cov-bars { display: grid; grid-template-columns: repeat(var(--hours), minmax(0, 1fr)); align-items: end; gap: 3px; height: 64px; }
.cal-cov-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; min-width: 0; }
.cal-cov-n { font-size: 0.66rem; font-weight: 800; color: var(--ink-2); text-align: center; line-height: 1.3; }
.cal-cov-stack { display: flex; flex-direction: column-reverse; border-radius: 4px 4px 2px 2px; overflow: hidden; min-height: 0; }
.cal-cov-stack i { display: block; background: var(--d); min-height: 3px; }
.cal-cov-col.is-zero .cal-cov-stack { height: 2px !important; background: var(--line); }
.cal-tl-add .cal-tl-label { padding-left: 0; }
.cal-add-track { cursor: copy; border: 1px dashed var(--line); background: none; height: 28px; }
.cal-add-track:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.cal-day-off { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cal-day-off h3 { margin: 0 0 8px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.cal-off-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-off-list li { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; }
.cal-off-list .cal-av { opacity: 0.55; }
body.sched-modal-open { overflow: hidden; }

/* Narrow screens: week becomes a stacked day list, month shows counts + dots, timeline labels go on top. */
@media (max-width: 760px) {
  .cal-week { display: flex; flex-direction: column; gap: 10px; background: none; border: 0; border-radius: 0; overflow: visible; }
  .cal-corner, .cal-lane-label { display: none; }
  .cal-day { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .cal-day > * { background: transparent; }
  .cal-day.is-today { border-color: var(--cal-today-line); box-shadow: inset 0 3px 0 var(--warm); }
  .cal-day.is-today > * { background: var(--cal-today); }
  .cal-day.is-today .cal-dhead { box-shadow: none; }
  .cal-dhead { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 8px; border: 0; }
  .cal-dhead-wd { font-size: 0.78rem; }
  .cal-dhead-num { font-size: 1.15rem; }
  .cal-dhead-count { margin-left: auto; font-size: 0.8rem; }
  .cal-today-pill { position: static; }
  .cal-cell { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 4px 14px 10px; border: 0; min-height: 0; }
  .cal-cell-lane { display: block; grid-column: 1 / -1; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
  .cal-cell .cal-empty { grid-column: 1 / -1; }
  .cal-cell.r-off { display: flex; flex-wrap: wrap; padding: 0 14px 12px; }
  .cal-cell.r-off.is-empty { display: none; }
  .cal-add { opacity: 1; border-color: var(--line); grid-column: 1 / -1; min-height: 36px; }
  .cal-tl { --label: 1fr; }
  .cal-tl-row { grid-template-columns: 1fr; gap: 4px; padding: 6px 0; }
  .cal-tl-cov .cal-tl-label, .cal-tl-axis .cal-tl-label { display: none; }
  .cal-tl-add .cal-add-track { display: none; }
  .cal-cov-title { position: static; margin-bottom: 4px; }
  .cal-dayview { padding: 14px 12px 16px; }
}
@media (max-width: 640px) {
  .cal-title { flex-basis: 100%; order: -1; font-size: 1.1rem; }
  .cal-views { flex: 1; } .cal-view-btn { flex: 1; justify-content: center; padding: 0 8px; }
  #sched-add-top { width: 100%; }
  .cal-legend { font-size: 0.74rem; gap: 4px 12px; }
  .cal-mwd { padding: 6px 2px; text-align: center; font-size: 0.62rem; letter-spacing: 0.04em; }
  .cal-mday { min-height: 64px; padding: 4px 3px; gap: 3px; align-items: center; }
  .cal-mtop { flex-direction: column; gap: 3px; }
  .cal-mnum { font-size: 0.85rem; }
  .cal-mday.has-mine .cal-mnum::after { display: none; }
  .cal-mday.has-mine { box-shadow: inset 0 -3px 0 var(--warm); }
  .cal-mday.is-today.has-mine { box-shadow: inset 0 0 0 2px var(--cal-today-line), inset 0 -3px 0 var(--warm); }
  .cal-dot { width: 7px; height: 7px; }
  .cal-mcount { font-size: 0.66rem; }
  .cal-mcount { font-size: 0; } .cal-mcount::before { content: attr(data-n); font-size: 0.72rem; }
  .cal-mchips { display: flex; justify-content: center; }
  .cal-mchip { padding: 0; background: none; border: 0; margin-left: -7px; min-width: auto; }
  .cal-mchip:first-child { margin-left: 0; }
  .cal-mchip .cal-av { width: 16px; height: 16px; font-size: 0.5rem; box-shadow: 0 0 0 1.5px var(--paper); }
  .cal-mchip-name, .cal-mchip-time { display: none; }
  .cal-more { font-size: 0; } .cal-more::before { content: "+" attr(data-more); font-size: 0.68rem; }
  .cal-moff { display: none; }
}

/* ---------- Schedule: business hours on the day timeline + Schedule settings ---------- */
.cal-biz { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border-left: 2px solid var(--accent-line); border-right: 2px solid var(--accent-line); border-radius: 4px; pointer-events: none; }
.cal-tl-axis .cal-axis { height: 34px; }
.cal-bizline { position: absolute; top: 18px; transform: translateX(-50%); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: var(--accent); border-radius: 999px; padding: 0 6px; line-height: 15px; white-space: nowrap; }
:root[data-theme="dark"] .cal-bizline { color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-bizline { color: var(--accent-ink); } }
.sched-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.sched-settings fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.sched-settings legend { font-weight: 800; font-size: 0.85rem; padding: 0 4px; }
.sched-settings label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 700; }
.sched-settings input, .sched-settings select { width: 100%; min-width: 0; }
.sched-settings #ss-today, .sched-settings #ss-msg, .sched-settings #ss-save { grid-column: 1 / -1; margin: 0; }
.sched-settings #ss-save { justify-self: start; }
