/* Lodge employee portal.
   Plain CSS, no external fonts or scripts (CSP). The design language is written
   down in web/DESIGN.md; the short version:

     one question per page, one primary action;
     a row is two lines: a title with at most one pill, then one line of facts;
     colour means "needs attention", everything else is neutral;
     blank fields are not drawn, empty sections fold to a line;
     figures only when the number changes what you do next;
     explanations fold under "How this works";
     the rail lists what you use, badges count only what is yours to do.

   Every class names the thing it styles. */

:root {
  color-scheme: light;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --ink: #15181c;
  --ink-2: #454c56;
  --ink-3: #6f7681;
  --line: #e5e7eb;
  --line-2: #d2d7dd;

  --accent: #1f3a2e;
  --accent-2: #2b5240;
  --accent-soft: #e6efe9;
  --accent-ink: #163226;
  --accent-contrast: #f6f1e7;

  --ok: #1f7a48;
  --ok-soft: #e4f3ea;
  --warn: #9a5208;
  --warn-soft: #fcf1e2;
  --danger: #c0202f;
  --danger-soft: #fce9eb;
  --neutral-soft: #eef0f3;
  --store-soft: #fbece3;
  --store-ink: #9a4a1f;
  --mine-soft: #dff3f3;
  --mine-ink: #0e6b6b;

  --side-bg: #f4f5f7;
  --bar-bg: #ffffff;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bar-h: 56px;
  --side-w: 228px;
  --tab-h: 60px;

  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --row-x: 18px;      /* the horizontal inset of a row inside a card */
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111316;
  --surface: #191c21;
  --surface-2: #1f2328;
  --surface-3: #272b32;
  --ink: #eceef1;
  --ink-2: #c1c6ce;
  --ink-3: #8f96a0;
  --line: #272b32;
  --line-2: #383e47;
  --accent: #8fc7a2;
  --accent-2: #a6d6b5;
  --accent-soft: #1b2e23;
  --accent-ink: #c9e8d3;
  --accent-contrast: #0f1f16;
  --ok: #5ec98d;
  --ok-soft: #16301f;
  --warn: #f2b25b;
  --warn-soft: #362710;
  --danger: #ff7a86;
  --danger-soft: #3a191e;
  --neutral-soft: #262a31;
  --store-soft: #3a2418;
  --store-ink: #f0a676;
  --mine-soft: #143333;
  --mine-ink: #7fd8d8;
  --side-bg: #111316;
  --bar-bg: #15181c;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; }
h2 { font-size: 14px; }
h3 { font-size: 13px; }
h4 { font-size: 13px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
strong { font-weight: 600; }
kbd { font-family: var(--mono); font-size: 11px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.sm { width: 14px; height: 14px; vertical-align: -2px; }
svg.i.left { transform: rotate(90deg); }
svg.i.right { transform: rotate(-90deg); }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px; z-index: 99; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.problem { color: var(--danger); }
.link { color: var(--accent); text-decoration: underline; }
.footnote { font-size: 13px; color: var(--ink-3); margin-top: 14px; max-width: 80ch; }
.form input[readonly], .form textarea[readonly], .form select[disabled] { background: var(--neutral-soft); color: var(--ink-2); cursor: not-allowed; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Company mark ---------- */

.mark { display: block; width: 28px; height: 28px; flex: none; color: var(--ink); }
.mark.lg { width: 48px; height: 48px; }

/* ---------- Sign-in ---------- */

.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); position: relative; }
.signin .theme-btn { position: absolute; top: 12px; right: 16px; }
.signin-art { position: relative; overflow: hidden; background: #0a0e1c; color: #ffffff; --banner: #e3a63b; --trim: #c4622d; display: flex; flex-direction: column; justify-content: flex-end; padding: 36px 40px; }
.signin-art.sky-day { color: #172140; --banner: #c4622d; --trim: #c4622d; }
.signin-art .art { position: absolute; inset: 0; width: 100%; height: 100%; animation: art-in 0.9s ease-out both; }
.signin-art .banner, .signin-art .flag { fill: var(--banner); }
.signin-art .trim { stroke: var(--trim); }
.signin-art .celestial { animation: float 9s ease-in-out infinite alternate; }
.signin-art .clouds { animation: clouds-drift 150s linear infinite; }
.signin-art .hall-light { animation: hall-pulse 5s ease-in-out infinite alternate; transform-origin: 300px 598px; }
.signin-art .flag { animation: flag-wave 2.2s ease-in-out infinite; transform-origin: 300px 349px; }
.signin-art .banner { animation: banner-sway 3.6s ease-in-out infinite alternate; }
.signin-art .banner-l { transform-origin: 216px 452px; }
.signin-art .banner-r { transform-origin: 384px 452px; animation-delay: -1.8s; }
.signin-art .win-flicker { animation: flicker 3.2s ease-in-out infinite alternate; }
.signin-art .puff { animation: smoke 5s ease-out infinite; transform-origin: 357px 404px; }
.signin-art .puff.p1 { animation-delay: -1.7s; }
.signin-art .puff.p2 { animation-delay: -3.4s; }
.signin-art .wing { animation: flap 0.5s ease-in-out infinite alternate; transform-origin: 0 0; }
.signin-art .wing.bat { animation-duration: 0.16s; }
.signin-art .wing.w1 { animation-delay: -0.15s; }
.signin-art .wing.w2 { animation-delay: -0.3s; animation-duration: 0.42s; }
.signin-art .wing.w3 { animation-delay: -0.08s; animation-duration: 0.56s; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(0.25); } }
.signin-art .star { animation: twinkle 4s ease-in-out infinite; }
.signin-art .star.s1 { animation-duration: 5.5s; animation-delay: -1.2s; }
.signin-art .star.s2 { animation-duration: 3.4s; animation-delay: -2.1s; }
.signin-art .star.s3 { animation-duration: 6.2s; animation-delay: -0.6s; }
.signin-art .star.s4 { animation-duration: 4.6s; animation-delay: -3s; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes clouds-drift { from { transform: translateX(0); } to { transform: translateX(-600px); } }
@keyframes hall-pulse { from { transform: scale(0.94); } to { transform: scale(1.06); } }
@keyframes art-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flag-wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(0.94); } }
@keyframes banner-sway { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
@keyframes flicker { from { opacity: 0.82; } to { opacity: 1; } }
@keyframes smoke { 0% { transform: translateY(0) scale(0.5); opacity: 0.45; } 100% { transform: translateY(-80px) scale(1.8); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .signin-art .celestial, .signin-art .clouds, .signin-art .hall-light, .signin-art .art, .signin-art .flag, .signin-art .banner, .signin-art .win-flicker, .signin-art .puff, .signin-art .star, .signin-art .wing { animation: none; } }
.art-text { position: relative; }
.art-text h1 { color: inherit; }
.art-sub { font-size: 13px; opacity: 0.72; margin-top: 2px; }
.signin-panel { display: grid; place-items: center; padding: 48px 24px; }
.signin-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 18px; }
.signin-card h1 { font-size: 20px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none;
}
.google-btn:hover { background: var(--surface-2); }
.google-btn svg { width: 18px; height: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.preview-roles { display: grid; gap: 6px; }
.preview-role {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; text-align: left;
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; cursor: pointer;
}
.preview-role:hover { background: var(--surface-2); border-color: var(--line); }
.preview-role .who { font-weight: 600; }
.preview-role .blurb { color: var(--ink-3); font-size: 12.5px; }
.signin-card .form .actions { justify-content: stretch; }
.signin-card .form .actions .btn { flex: 1; }
.signin-error { padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.signin-note { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.signin-note code { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: var(--bar-h) 1fr; min-height: 100vh; }

.topbar {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 16px 0 18px;
  background: var(--bar-bg); border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; width: calc(var(--side-w) - 34px); flex: none; }
.topbar .brand .company { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.search { position: relative; flex: 0 1 400px; margin-right: auto; }
.search input {
  width: 100%; height: 36px; padding: 0 36px 0 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { background: var(--surface); border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 16px; pointer-events: none; }
.search input:focus ~ kbd { display: none; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.search-results a { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 6px; color: inherit; }
.search-results a > svg { margin-top: 2px; color: var(--ink-3); }
.search-results a:hover, .search-results a.sel { background: var(--surface-3); text-decoration: none; }
.search-results .name { display: block; font-weight: 600; }
.search-results .blurb { display: block; color: var(--ink-3); font-size: 12.5px; }
.search-results .none { padding: 8px 10px; color: var(--ink-3); }

.iconbtn { position: relative; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); flex: none; padding: 0; }
.iconbtn:hover { background: var(--surface-3); text-decoration: none; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 6px; }
.iconbtn .badge { position: absolute; top: 3px; left: 19px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; border: 2px solid var(--bar-bg); }
.menu-btn { display: none; }

.userbtn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink-2); }
.userbtn:hover { background: var(--surface-3); }
.userbtn .uname { font-weight: 600; color: var(--ink); }

/* Fixed, like the sticky bar it drops from, so it opens in view however far the page is scrolled. */
.popover { position: fixed; top: calc(var(--bar-h) - 6px); right: 16px; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden; }
.popover .pop-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.popover .pop-head h3 { font-size: 14px; }
.popover .pop-body { max-height: min(440px, calc(100vh - var(--bar-h) - 80px)); overflow: auto; padding-bottom: 6px; }
.popover .pop-sec { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 12px 16px 2px; }
.popover .pop-list { list-style: none; margin: 0; padding: 2px 6px; }
.popover .pop-list a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; color: inherit; }
.popover .pop-list a > svg { margin-top: 1px; color: var(--ink-3); }
.popover .pop-list a.danger > svg { color: var(--danger); }
.popover .pop-list a:hover { background: var(--surface-3); text-decoration: none; }
.popover .pop-list .t { font-weight: 600; }
.popover .pop-list .m { color: var(--ink-3); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popover .pop-empty { padding: 24px 16px; color: var(--ink-3); text-align: center; }
.popover .pop-user { padding: 14px 16px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.popover .pop-menu { padding: 6px; display: grid; }
.popover .pop-menu + .pop-menu, .pop-theme + .pop-menu { border-top: 1px solid var(--line); }
.popover .pop-menu a, .popover .pop-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; color: inherit; width: 100%; }
.popover .pop-menu a:hover, .popover .pop-menu button:hover { background: var(--surface-3); text-decoration: none; }
.popover.user { width: 272px; }
.pop-theme { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.pop-theme .seg .btn { padding: 3px 8px; font-size: 12px; }

.rail {
  background: var(--side-bg); border-right: 1px solid var(--line); padding: 14px 10px 24px;
  display: flex; flex-direction: column; position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); overflow-y: auto;
}
.rail .sec { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.02em; padding: 20px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; margin: 1px 0; color: var(--ink-2); border-radius: 7px;
  text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; font-weight: 500;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.nav-item .i { color: var(--ink-3); }
.nav-item.active .i { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 600; min-width: 20px; padding: 0 6px; line-height: 18px; border-radius: 9px; text-align: center; background: var(--accent-soft); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.rail .more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.rail .more > summary { color: var(--ink-3); }
.rail .more > summary .i { transition: transform 0.15s; transform: rotate(-90deg); }
.rail .more[open] > summary .i { transform: none; }
.scrim { display: none; }
.tabbar { display: none; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink); flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.large { width: 48px; height: 48px; font-size: 16px; }
.avatar.bot { background: var(--neutral-soft); color: var(--ink-2); }

/* ---------- Page ---------- */

.main { padding: 28px 40px 72px; max-width: 1180px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tabs move between the views of one page. */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -8px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { min-width: 18px; padding: 0 6px; line-height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }

/* The row of controls above a view: where you are in time, and how you are looking at it. */
.viewbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.viewbar .spacer { flex: 1; }
.pager { display: inline-flex; align-items: center; gap: 2px; }
.pager .iconbtn { width: 32px; height: 32px; }
.pager-label { font-weight: 600; font-size: 15px; min-width: 0; padding: 0 6px; white-space: nowrap; }
.pager .btn { margin-left: 8px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 0 2px 18px; max-width: 90ch; }
.hint .off { color: var(--ink-3); }

.about { margin-top: 22px; font-size: 13px; color: var(--ink-3); max-width: 80ch; }
.about > summary { cursor: pointer; width: max-content; }
.about > summary:hover { color: var(--ink-2); }
.about > div { margin-top: 8px; display: grid; gap: 8px; line-height: 1.55; }

/* ---------- Cards and sections ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .summary + .card, .summary + .grid { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px var(--row-x); border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-head h2 .n { font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card-head a { font-size: 13px; }
.card-head .head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.card-body { padding: 16px var(--row-x); }
.card-body.flush { padding: 0; }
.card-action { margin-top: 12px; }

/* A card that folds: its head is the summary. Used for things worth having but not worth reading every visit. */
details.card > summary.card-head { cursor: pointer; border-bottom: 0; justify-content: flex-start; gap: 8px; }
details.card > summary.card-head:hover { background: var(--surface-2); border-radius: var(--radius-lg); }
details.card[open] > summary.card-head:hover { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
details.card[open] > summary.card-head { border-bottom: 1px solid var(--line); }
details.card > summary.card-head .i { color: var(--ink-3); transform: rotate(-90deg); transition: transform 0.15s; }
details.card[open] > summary.card-head .i { transform: none; }

.grid { display: grid; gap: 18px; align-items: start; }
.grid > .card + .card { margin-top: 0; }
.grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* Figures: one light strip, only where the number decides what happens next. */
.summary { display: flex; flex-wrap: wrap; margin: 0 0 18px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.summary.grid { gap: 0; }
.summary .figure { flex: 1 1 150px; display: flex; flex-direction: column-reverse; gap: 1px; padding: 12px var(--row-x); box-shadow: -1px 0 0 var(--line); }
.summary dt { color: var(--ink-3); font-size: 12.5px; }
.summary dd { margin: 0; font-weight: 600; font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.summary .figure.warn dd { color: var(--danger); }

/* Status pills: one per row, for the state that decides what happens next.
   gem = in hand, gold = waiting on someone, moss = done, sash = needs attention, grey = just a label. */
.status { display: inline-block; font-size: 11.5px; font-weight: 600; white-space: nowrap; padding: 1px 8px; border-radius: 999px; line-height: 1.55; vertical-align: 1px; }
.status::first-letter { text-transform: uppercase; }
.status.gem { background: var(--accent-soft); color: var(--accent-ink); }
.status.sash { background: var(--danger-soft); color: var(--danger); }
.status.gold { background: var(--warn-soft); color: var(--warn); }
.status.moss { background: var(--ok-soft); color: var(--ok); }
.status.grey { background: var(--neutral-soft); color: var(--ink-2); font-weight: 500; }
.status.release { margin-top: 4px; }
tr.released td { opacity: .6; }
.role-chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.role-chip.owner, .role-chip.it_admin { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tag-text { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.tag-text.you { color: var(--accent-ink); font-weight: 600; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.error { background: var(--danger); }
.dot.off { background: var(--line-2); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; text-decoration: none; color: var(--ink); line-height: 1.3;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary, .btn.gem { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.btn.primary:hover, .btn.gem:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.ghost.danger { color: var(--danger); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: inherit; }
.linkbtn:hover { text-decoration: underline; }

.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--radius); gap: 2px; }
.seg .btn { border: 0; background: transparent; color: var(--ink-2); padding: 4px 12px; border-radius: 6px; }
.seg .btn:hover { background: var(--surface); }
.seg .btn.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); }
.seg.wrap-row { flex-wrap: wrap; margin: 0 0 14px; }

/* The overflow menu: everything a row can do that is not its one visible action.
   The list is positioned by app.js when it opens, so a scrolling table cannot clip it. */
.menu { position: relative; display: inline-block; }
.menu > summary { cursor: pointer; color: var(--ink-3); }
.menu[open] > summary { background: var(--surface-3); color: var(--ink); }
.menu-pop { position: fixed; z-index: 45; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; color: var(--ink); font-size: 13.5px; white-space: nowrap; text-decoration: none; }
.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.menu-item[disabled] { opacity: 0.5; cursor: not-allowed; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------- Lists and tables ----------
   A row is two lines: .title (with at most one .status) and .meta. */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; align-items: center; padding: 12px var(--row-x); border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .title .status { margin-left: 6px; }
.list .title a { color: inherit; }
.list .meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.list .meta.problem { color: var(--danger); }
.list .right { text-align: right; flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.list .right .when { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.list li.mandatory { box-shadow: inset 3px 0 0 var(--danger); }
.list li.open { cursor: pointer; }
.list li.open:hover { background: var(--surface-2); }
.list.flush { border: 0; }
.empty { padding: 28px var(--row-x); color: var(--ink-3); text-align: center; }
.list .empty { padding: 20px var(--row-x); }

.datebox { width: 50px; text-align: center; flex: none; padding: 5px 0; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.datebox-month { font-size: 11px; color: var(--danger); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }
.datebox-day { font-weight: 600; font-size: 20px; line-height: 1.1; }
.event-note, .post-body { font-size: 13px; margin-top: 4px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.results .status { cursor: help; }
.results a.status { text-decoration: none; }
.results a.status:hover { filter: brightness(1.08); }
.post-thumb { width: 44px; height: 44px; object-fit: cover; flex: none; border-radius: 6px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .menu, td.actions .btn + .btn { margin-left: 4px; }
tr.low td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.table-wrap table { min-width: 720px; }
td.mono, td.nowrap, th { white-space: nowrap; }
.card > .table-wrap:first-child { border-radius: var(--radius-lg); }
.person-cell { display: flex; gap: 10px; align-items: center; }
.muted-row td { opacity: 0.55; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px var(--row-x); border-bottom: 1px solid var(--line); }
.toolbar input[type="search"], .toolbar select { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.toolbar input[type="search"] { min-width: 240px; flex: 1 1 240px; max-width: 360px; }
.toolbar-check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.toolbar .spacer { flex: 1; }

/* Facts: label / value pairs, drawn only for values that exist. */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; margin: 0; align-items: baseline; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.wide { grid-template-columns: 220px 1fr; }
.kv .status { vertical-align: 0; }
.code-big { font-size: 18px; font-weight: 700; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.checklist .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; margin-top: 1px; color: transparent; }
.checklist .tick.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.bar { height: 6px; background: var(--surface-3); margin-bottom: 14px; border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.sm { height: 4px; margin: 6px 0 0; max-width: 260px; }

.person { display: flex; gap: 14px; padding: 16px; }
.person-name { font-weight: 600; }
.person-tags { margin: 6px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Notices ---------- */

.notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.n-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.notice.sash { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.notice.sash .n-ico { background: var(--danger-soft); color: var(--danger); }
.notice.gold .n-ico { background: var(--warn-soft); color: var(--warn); }
.notice.moss .n-ico { background: var(--ok-soft); color: var(--ok); }
.notice > div { padding-top: 3px; }
.grid > .notice { margin: 0; }
.notice.quiet { border: 0; background: none; padding: 0; margin: -6px 0 16px; color: var(--ink-3); font-size: 13px; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form input, .form select, .form textarea { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus, .toolbar input:focus, .chat .compose input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form textarea { min-height: 96px; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .row[hidden], .form label[hidden] { display: none; }
.form .actions, .doc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.doc-actions { margin-top: 16px; }
.doc-body { margin-top: 12px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.checks { display: grid; gap: 4px; }
.checks label { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 6px 0; cursor: pointer; }
.checks label.off { opacity: 0.55; }
.checks.inline { display: flex; flex-wrap: wrap; gap: 0 14px; }
.checks input { width: auto; accent-color: var(--accent); }
.checks.tight { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks.tight label { display: inline-flex; align-items: center; gap: 5px; }
.checks.pkgs { max-height: 50vh; overflow: auto; padding-right: 6px; }
.checks.pkgs .ver { color: var(--ink-3); font-size: 12.5px; font-family: var(--mono); }
.pick-person { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit; }
/* A tick box sits beside its words, not stretched across the form like a text field. */
.form .check-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.form .check-line input[type="checkbox"] { width: auto; margin: 2px 0 0; flex: none; }
.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.fold > summary { padding: 10px 12px; cursor: pointer; font-weight: 600; }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold .fold-body { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.invite-url { padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; user-select: all; }

/* ---------- Home ---------- */

.home { max-width: 1080px; }
.home-head { margin-bottom: 22px; }
.home-head .date { font-size: 13px; color: var(--ink-3); margin-bottom: 2px; }
.home-head h1 { font-size: 26px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-col { display: grid; gap: 20px; min-width: 0; }
.home-col > .card + .card { margin-top: 0; }

.shift-card { padding: 20px 22px 0; }
.shift-card.on { box-shadow: inset 3px 0 0 var(--ok); }
.shift-top { display: flex; align-items: center; gap: 20px; }
.shift-top .grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.shift-card.on .eyebrow { color: var(--ok); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.shift-card .when { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.shift-card .where { color: var(--ink-2); margin-top: 2px; }
.clock-btn { min-width: 128px; justify-content: center; padding: 11px 20px; font-size: 14.5px; border-radius: 10px; }
.shift-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 18px; padding: 12px 0 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.shift-foot > span { margin-right: auto; }
.shift-foot strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.punches { margin: 0 -22px; border-top: 1px solid var(--line); }
.punches > summary { padding: 11px 22px; cursor: pointer; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.punches > summary:hover { color: var(--ink); }
.punches > summary .i { color: var(--ink-3); transform: rotate(-90deg); transition: transform 0.15s; }
.punches[open] > summary .i { transform: none; }
.punches .clock-recent, .punches .clock-sub { margin: 0 22px; }
.punches .clock-recent:last-child { margin-bottom: 8px; }
.clock-recent > li { padding: 9px 0; }
.clock-recent .title { font-size: 13px; }
.clock-sub { margin-top: 10px; }

.needs .card-head { border-bottom: 0; padding-bottom: 4px; }
.tally { font-size: 12px; font-weight: 700; min-width: 22px; line-height: 22px; padding: 0 7px; text-align: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); }
.todo { list-style: none; margin: 0; padding: 0 0 4px; }
.todo > li { display: flex; align-items: center; gap: 12px; padding: 10px var(--row-x); }
.todo > li + li { border-top: 1px solid var(--line); }
.todo .title { font-weight: 600; color: var(--ink); }
.todo .meta { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo .grow { flex: 1; min-width: 0; }
.t-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.todo li.danger .t-ico { background: var(--danger-soft); color: var(--danger); }
.todo li.danger .title { color: var(--danger); }
.todo .go { color: var(--ink-3); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.todo .go:hover { background: var(--surface-3); color: var(--ink); }
.todo.team > li { padding: 8px var(--row-x); }
.todo.team .title { font-weight: 500; }
.todo-sec { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 12px var(--row-x) 2px; border-top: 1px solid var(--line); }
.todo-more > summary { padding: 8px var(--row-x) 12px 62px; font-size: 13px; color: var(--accent); cursor: pointer; }
.todo-more.team > summary { padding-left: var(--row-x); }
.todo-more[open] > summary { display: none; }
.needs.clear { display: flex; align-items: center; gap: 14px; padding: 16px var(--row-x); }
.needs.clear .t-ico { background: var(--ok-soft); color: var(--ok); }

.announce { display: flex; gap: 14px; align-items: flex-start; padding: 14px var(--row-x); color: inherit; }
.announce:hover { text-decoration: none; border-color: var(--line-2); }
.announce .a-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.announce .a-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }

.side-sec + .side-sec { border-top: 1px solid var(--line); }
.side-sec { padding-bottom: 8px; }
.side-sec h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; padding: 14px var(--row-x) 6px; }
.side-sec h3 a { font-size: 12.5px; font-weight: 500; }
.side-empty, .side-note { font-size: 13px; color: var(--ink-3); padding: 2px var(--row-x) 8px; }
.people, .mini, .agenda { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 5px var(--row-x); font-size: 13.5px; }
.people .grow { flex: 1; min-width: 0; }
.people .muted { font-variant-numeric: tabular-nums; font-size: 13px; }
.mini li { display: flex; align-items: center; gap: 10px; padding: 7px var(--row-x); }
.mini .grow, .agenda .grow { flex: 1; min-width: 0; }
.mini .title, .agenda .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .meta, .agenda .meta { font-size: 12.5px; color: var(--ink-3); }
.mini .meta.problem { color: var(--danger); }
.agenda li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 7px var(--row-x); align-items: baseline; }
.agenda .day { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.agenda li.mand .meta { color: var(--danger); }

/* ---------- Schedule ---------- */

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week .day { border-right: 1px solid var(--line); padding: 12px 10px; min-height: 180px; }
.week .day:last-child { border-right: 0; }
.week .day.today { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.week .dh { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.week .dn { font-weight: 600; font-size: 20px; margin-bottom: 10px; }
.week .day.today .dn { color: var(--accent); }
.shift { position: relative; font-size: 12px; line-height: 1.35; padding: 5px 8px; margin-bottom: 4px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); overflow-wrap: anywhere; }
.shift .when { display: block; white-space: nowrap; opacity: 0.85; }
.shift.me { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.shift.off { background: var(--warn-soft); color: var(--warn); }
.shift.ev { background: var(--ok-soft); color: var(--ok); }
.shift.ev.mand { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.shift.grab { cursor: grab; }
.shift.grab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.shift.dragging { opacity: 0.4; }
.shift.cancelled { text-decoration: line-through; opacity: 0.6; }
.shift .loc { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; margin-left: 4px; }
.shift .del { position: absolute; top: 2px; right: 4px; border: 0; background: transparent; color: inherit; opacity: 0; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 3px; }
.shift:hover .del, .shift:focus-within .del { opacity: 0.8; }
.week .day.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Calendar ---------- */

.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .dow { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.month .cell { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 8px; min-height: 104px; cursor: pointer; min-width: 0; }
.month .cell:nth-child(7n) { border-right: 0; }
.month .cell:nth-last-child(-n+7) { border-bottom: 0; }
.month .cell:hover { background: var(--surface-2); }
.month .cell.out { color: var(--ink-3); background: var(--surface-2); }
.month .cell.today { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.month .cell .dn { font-weight: 600; font-size: 13px; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; }
.month .cell.today .dn { color: var(--accent); }
.month .cell .dn .n { font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.month .more { font-size: 11px; color: var(--ink-3); }
.month .dots { display: none; gap: 3px; flex-wrap: wrap; }
.chip { display: block; font-size: 11px; line-height: 1.3; padding: 2px 6px; margin-bottom: 3px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.me { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.chip.ev { background: var(--ok-soft); color: var(--ok); }
.chip.mand { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.chip.off { background: var(--warn-soft); color: var(--warn); }
.chip.store { background: var(--store-soft); color: var(--store-ink); }
.chip.mine { background: var(--mine-soft); color: var(--mine-ink); }
.chip.pkg { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-2); }
.chip.gone { text-decoration: line-through; opacity: 0.6; }
.cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.cdot.me { background: var(--accent); } .cdot.ev { background: var(--ok); } .cdot.mand { background: var(--danger); } .cdot.off { background: var(--warn); }
.cdot.store { background: var(--store-ink); } .cdot.mine { background: var(--mine-ink); } .cdot.pkg { background: var(--line-2); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px var(--row-x); font-size: 12px; color: var(--ink-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.agenda-day { padding: 12px var(--row-x) 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); border-top: 1px solid var(--line); }
.agenda-day.today { color: var(--accent-ink); }
.agenda-day:first-child { border-top: 0; }
.agenda-day + .list > li:first-child { border-top: 0; }
.cal-when { font-size: 12.5px; color: var(--ink-2); min-width: 118px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.cal-preview { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; font-family: var(--sans); }
.cal-recent .meta { overflow-wrap: anywhere; }
.cal-seg { margin-bottom: 12px; }
.form .cal-allday { align-self: end; }
.cal-actions { margin-top: 14px; }
.cal-note { margin-top: 10px; }

/* ---------- Time clock and timesheets ---------- */

.ts-date { padding: 5px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.table-wrap .ts-table { min-width: 720px; }
.ts-table .num { text-align: right; }
.ts-table tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.ts-entry { white-space: nowrap; }
.ts-entry + .ts-entry { margin-top: 4px; }

/* ---------- Messaging ---------- */

.chat { display: grid; grid-template-columns: 230px 1fr; min-height: 580px; }
.chat .threads { border-right: 1px solid var(--line); padding: 8px; background: var(--surface-2); border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.chat .threads button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink-2); }
.chat .threads button:hover { background: var(--surface-3); }
.chat .threads button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.chat .threads .unread { margin-left: auto; background: var(--accent); color: var(--accent-contrast); font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 10px; }
.thread-group { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 8px 10px 4px; }
.thread-group.later { padding-top: 16px; }
.thread-new { color: var(--accent) !important; }
.chat .pane { display: flex; flex-direction: column; min-width: 0; }
.chat .msgs { flex: 1; padding: 18px; display: grid; gap: 16px; align-content: start; }
.msg { display: grid; grid-template-columns: 32px 1fr; gap: 10px; }
.msg .who { font-weight: 600; }
.msg .when { color: var(--ink-3); font-size: 12px; margin-left: 8px; }
.chat .compose { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat .compose input { flex: 1; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }

/* ---------- Marketing composer ---------- */

.composer { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.preview-label { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.preview .ph { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.preview .pt { font-weight: 600; margin-bottom: 4px; }
.preview-img { width: 100%; max-height: 220px; object-fit: cover; margin-bottom: 10px; display: block; border-radius: 6px; }
.upload { position: relative; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.upload.over { border-color: var(--accent); background: var(--accent-soft); }
.upload.has { border-style: solid; }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload.has input[type="file"] { display: none; }
.upload-empty { font-size: 13px; color: var(--ink-2); text-align: center; }
.upload-has { display: flex; gap: 12px; align-items: center; }
.upload-has img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.upload-has iframe { width: 160px; height: 90px; border: 0; border-radius: 6px; background: #000; pointer-events: none; flex: none; }
.upload-name { font-weight: 600; }
.quick-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.steps { margin: 0 0 14px 18px; padding: 0; display: grid; gap: 6px; }

/* ---------- Modal and toast ---------- */

.modal-bg { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: 90vh; overflow: auto; }
.modal.wide { width: min(860px, 100%); }
.modal .card-head { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal .card-head h2 { font-size: 15px; }
.modal .card-body { padding: 18px; }
.modal .close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--ink-3); }
.modal .close:hover { background: var(--surface-3); color: var(--ink); }
.modal .kv + .doc-body, .modal .kv + .doc-actions { margin-top: 16px; }
.detail-para { margin-top: 14px; white-space: pre-wrap; line-height: 1.55; }
.detail-para + .detail-para { margin-top: 10px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(6px); background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 10px 16px; font-size: 13.5px; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 60; box-shadow: var(--shadow-lg); }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- IT tickets ---------- */

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ticket-layout .card + .card { margin-top: 18px; }
.ticket-num { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); margin-right: 6px; }
.ticket-subject { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.thread-list .msg { padding: 14px var(--row-x); border-bottom: 1px solid var(--line); }
.thread-list .msg:last-child { border-bottom: 0; }
.msg .body { white-space: pre-wrap; margin-top: 2px; overflow-wrap: anywhere; }
.msg.internal { background: var(--warn-soft); }
.msg .tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn); margin-left: 8px; }
.compose-box { display: grid; gap: 10px; padding: 14px var(--row-x); border-top: 1px solid var(--line); }
/* A task's checklist: one step per row, the box is the action. A ticked step greys out but stays. */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist > li { display: flex; align-items: flex-start; gap: 12px; padding: 10px var(--row-x); border-bottom: 1px solid var(--line); }
.checklist > li:last-child { border-bottom: 0; }
.checklist label { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.checklist input[type="checkbox"]:disabled { cursor: default; }
.checklist .step { overflow-wrap: anywhere; }
.checklist li.done .step { color: var(--ink-3); text-decoration: line-through; }
.checklist .meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; text-decoration: none; }
.checklist .right { flex: none; }
.checklist-add { display: flex; gap: 8px; padding: 10px var(--row-x); border-top: 1px solid var(--line); }
.checklist-add input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.checklist-add input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.task-progress { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.task-progress .bar { margin: 0; width: 90px; }
.task-progress .bar > i.full { background: var(--ok); }
.list .meta.overdue, .sub .overdue, .overdue { color: var(--danger); }
.form textarea.steps { min-height: 120px; font-family: inherit; }
.task-body { white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.compose-box textarea { min-height: 84px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.compose-box textarea:focus { border-color: var(--accent); outline: none; }
.compose-box .row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.detail-kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 12px; font-size: 13.5px; margin: 0; align-items: center; }
.detail-kv dt { color: var(--ink-3); }
.detail-kv dd { margin: 0; min-width: 0; }
.detail-kv select, .detail-kv input[type="date"] { width: 100%; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; }
.detail-kv select:focus, .detail-kv input[type="date"]:focus { border-color: var(--accent); outline: none; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.timeline li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 6px 0; align-items: start; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 5px; }
.timeline .when { color: var(--ink-3); }
tr.urgent td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ---------- Lobby TV ---------- */

.slide-list li.off { opacity: 0.55; }
.slide-thumb {
  width: 64px; height: 40px; flex: none;
  border-radius: 6px; border: 1px solid var(--line);
  object-fit: cover; background: var(--surface-3);
  display: grid; place-items: center; color: var(--ink-3);
}
.slide-thumb.ink { background: var(--neutral-soft); }
.slide-thumb.blue { background: var(--accent-soft); color: var(--accent-ink); }
.slide-thumb.gold { background: var(--warn-soft); color: var(--warn); }
.slide-thumb.moss { background: var(--ok-soft); color: var(--ok); }
.slide-thumb.sash { background: var(--danger-soft); color: var(--danger); }
.reorder { display: inline-flex; gap: 2px; }
.reorder .btn { min-width: 26px; padding: 2px 6px; line-height: 1.3; }
.reorder .btn[disabled] { opacity: 0.35; }

.pair-url { margin: 12px 0; padding: 12px 14px; background: var(--surface-3); border-radius: var(--radius); overflow-wrap: anywhere; }
.pair-url code { font-family: var(--mono); font-size: 13px; }
.devlog { max-height: 55vh; overflow: auto; margin: 0 0 12px; padding: 12px 14px; background: var(--surface-3); border-radius: var(--radius); font-family: var(--mono); font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The preview runs the real player page in an iframe at panel proportions. */
.tv-preview { width: 100%; background: #0d1017; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); }
.tv-preview.landscape { aspect-ratio: 16 / 9; }
.tv-preview.portrait { aspect-ratio: 9 / 16; max-width: 420px; margin: 0 auto; }
.tv-preview iframe { width: 100%; height: 100%; border: 0; display: block; }

.slide-form .kind-only[hidden] { display: none; }   /* a class with display beats the UA rule for [hidden] */
.slide-form .kind-seg { margin: 4px 0 6px; }
.slide-form .block-head { font-weight: 600; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.slide-form .event-block { display: flex; flex-direction: column; gap: 14px; }
.slide-form .check-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.slide-form .check-line input { margin: 0; }

/* ---------- Integrations ---------- */

.int-detail { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

/* Kind colours: the same keys and colours as the website calendar. */
.gdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; background: #9ca3af; }
.gdot.show { background: #c4622d; }
.gdot.open_house { background: #e3a63b; }
.gdot.delivery { background: #2457c5; }
.gdot.vendor { background: #a855f7; }
.gdot.training { background: #10b981; }
.gdot.other { background: #9ca3af; }

/* ---------- Personnel records: the on-screen record and the paper copy for signatures ---------- */

.record-h { margin: 16px 0 4px; font-size: 14px; }
h4.record-h { font-size: 13px; color: var(--ink-2); }
.print-sig { display: none; }
@media print {
  body > *:not(.modal-bg) { display: none !important; }
  .modal-bg { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; border: 0; max-height: none; width: 100%; overflow: visible; }
  .modal .close, .modal .actions, .modal form, .modal .doc-actions { display: none !important; }
  .print-sig { display: grid; gap: 28px; margin-top: 40px; font-size: 13px; }
}

/* ---------- Documents ----------
   Found by number or title, opened as a PDF, printed. The number is the handle: it is on the
   printout's file name, so it gets its own quiet chip everywhere it appears. */

.doc-no { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--neutral-soft); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.doc-search { flex: none; width: 280px; margin: 0; }
/* The app bar's search hides on a phone; this one is how a phone finds a document, so it stays. */
.search.doc-search { display: block; }
.doc-summary { margin: -8px 0 16px; color: var(--ink-2); max-width: 80ch; }
.doc-tags { margin-left: 4px; }
.doc-tags .status { margin-right: 2px; }
.doc-preview { overflow: hidden; padding: 0; }
.doc-preview iframe { display: block; width: 100%; height: min(80vh, 1100px); border: 0; background: var(--surface-2); }
.pin-btn { color: var(--ink-3); }
.pin-btn.on { color: var(--accent); }
.pin-btn.on svg path:first-child { fill: currentColor; }
.card-head select, .card-head input[type="search"] { padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); font-size: 13px; max-width: 55%; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.form .check-line input[type="radio"] { width: auto; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.form fieldset legend { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.acl { display: grid; gap: 8px; }
.acl:empty { display: none; }
.acl-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; align-items: center; }
.acl-add { justify-self: start; }
@media (max-width: 600px) {
  .doc-search { width: 100%; }
  .acl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .acl-row .acl-level { grid-column: 1; grid-row: 2; }
  .doc-preview iframe { height: 70vh; }
}

/* ---------- HR ----------
   Two audiences on the same components: an employee on a phone reading a policy and
   signing it, and an owner at the counter working through who has not. */

.card.hr-clear .card-head h2 { color: var(--ok); }
.hr-timeline > li { position: relative; padding-left: 30px; }
.hr-timeline .hr-dot { position: absolute; left: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.hr-timeline > li::before { content: ""; position: absolute; left: 19.5px; top: 26px; bottom: -12px; width: 1px; background: var(--line); }
.hr-timeline > li:last-child::before { display: none; }
.hr-history .meta { text-transform: none; }

/* The document being read before it is signed. Scrolls on its own so the signature
   controls stay reachable on a phone without scrolling the whole modal. */
.hr-doc-body { max-height: 46vh; overflow-y: auto; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.65; }
.hr-sign { margin-top: 16px; }
.hr-receipt .mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.hr-sig-img { max-width: 320px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.hr-manage .summary { margin-bottom: 18px; }
.hr-manage .list { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
/* The app bar's search styling, reused in the HR page header rather than centred in it. */
.hr-search { flex: none; width: 240px; margin: 0; }
tr.hr-row { cursor: pointer; }
tr.hr-row:hover td { background: var(--surface-2); }
/* A person's file: facts in two columns, then what is on record. */
.profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.profile .kv { align-content: start; }
.profile-missing { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

/* Price tags: two lines of fields per item (what it is, then how it is priced), more on a phone.
   A custom band's wording takes a third line when it is asked for. */
.tag-size { max-width: 320px; }
.tag-rows { display: grid; gap: 14px; }
.tag-row {
  display: grid; gap: 8px; align-items: end;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) 32px;
  grid-template-areas: "name name detail detail remove" "band was price copies .";
}
.tag-row + .tag-row { border-top: 1px solid var(--line); padding-top: 14px; }
.tag-row .t-name { grid-area: name; }
.tag-row .t-detail { grid-area: detail; }
.tag-row .t-remove { grid-area: remove; }
.tag-row .t-band { grid-area: band; }
.tag-row .t-text { grid-column: 1 / 3; }
.tag-row .t-was { grid-area: was; }
.tag-row .t-price { grid-area: price; }
.tag-row .t-copies { grid-area: copies; }
.tag-row [data-remove-tag] { width: 32px; height: 36px; padding: 0; justify-content: center; color: var(--ink-3); }
.tag-row [data-remove-tag][hidden] { display: inline-flex; visibility: hidden; }  /* keeps the columns lined up */
.tag-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) {
  .tag-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "name name" "detail detail" "band text" "was price" "copies remove";
  }
  .tag-row .t-text { grid-area: text; }
  .tag-row .t-remove { justify-self: end; }
}

/* ---------- Hollis: a slice of Discord in Lodge's own colours ----------
   The channel list, the conversation, the composer: shaped like Discord so what you
   write reads the way it will land, drawn with the same tokens as every other page. */

.dc { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 620px; overflow: hidden; }
.dc-side { display: flex; flex-direction: column; background: var(--surface-2); border-right: 1px solid var(--line); min-width: 0; }
.dc-server { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.dc-server-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-pic { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.dc-pic.dc-server-pic { width: 28px; height: 28px; border-radius: 8px; }
.dc-pic.dc-avatar { width: 40px; height: 40px; }
.dc-pic.dc-avatar.sm { width: 32px; height: 32px; }
.dc-initial { display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast); font-weight: 700; font-size: 15px; }
.dc-channels { flex: 1; overflow: auto; padding: 8px; }
.dc-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 14px 8px 4px; }
.dc-cat:first-child { padding-top: 6px; }
.dc-ch { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink-3); font: inherit; font-size: 14.5px; font-weight: 500; }
.dc-ch:hover { background: var(--surface-3); color: var(--ink-2); }
.dc-ch.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.dc-ch.locked { opacity: 0.7; }
.dc-ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.dc-hash { color: var(--ink-3); font-weight: 500; font-size: 18px; line-height: 1; width: 18px; flex: none; display: inline-flex; justify-content: center; }
.dc-hash .i { width: 16px; height: 16px; }
.dc-lock .i { width: 13px; height: 13px; }
.dc-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 10px; min-width: 16px; text-align: center; }
.dc-empty { color: var(--ink-3); font-size: 13px; padding: 12px 10px; }
.dc-me { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface-3); }
.dc-me .dc-name { font-size: 13.5px; font-weight: 600; }
.dc-me-sub { font-size: 12px; color: var(--ink-3); }
.dc-bot { display: inline-block; background: var(--accent); color: var(--accent-contrast); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; vertical-align: 2px; margin-left: 4px; letter-spacing: 0.02em; }
.dc-main { display: flex; flex-direction: column; min-width: 0; }
.dc-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.dc-head .dc-hash { font-size: 22px; width: 22px; }
.dc-head .dc-hash .i { width: 20px; height: 20px; }
.dc-topic { color: var(--ink-3); font-size: 13px; border-left: 1px solid var(--line-2); padding-left: 10px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-msgs { flex: 1; overflow: auto; padding: 8px 0 12px; display: flex; flex-direction: column; max-height: 62vh; }
.dc-welcome { margin: auto 16px 8px; padding: 8px 0 16px; border-bottom: 1px solid var(--line); }
.dc-welcome-hash { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 34px; color: var(--ink-2); margin-bottom: 8px; }
.dc-welcome-hash .i { width: 30px; height: 30px; }
.dc-welcome h3 { margin: 0 0 4px; font-size: 22px; }
.dc-welcome p { margin: 0; color: var(--ink-3); font-size: 14px; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 8px 16px; }
.dc-msg:hover { background: var(--surface-2); }
.dc-msg-head { display: flex; align-items: baseline; gap: 2px; }
.dc-name { font-weight: 600; }
.dc-when { color: var(--ink-3); font-size: 12px; margin-left: 8px; }
.dc-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; margin-top: 2px; }
.dc-mention { background: var(--accent-soft); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.dc-state { display: inline-flex; align-items: center; gap: 4px; }
.dc-state .i { width: 13px; height: 13px; }
.dc-state.ok { color: var(--ok); }
.dc-state.bad { color: var(--danger); }
.dc-state.wait { color: var(--warn); }
.dc-msg.queued .dc-text { opacity: 0.6; }
.dc-msg.failed .dc-msg-body { border-left: 2px solid var(--danger); padding-left: 8px; margin-left: -10px; }
.dc-compose { padding: 0 16px 14px; }
.dc-input { display: flex; align-items: flex-end; gap: 6px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 6px 6px 14px; }
.dc-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dc-input textarea { flex: 1; border: 0; background: transparent; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 6px 0; max-height: 220px; color: var(--ink); outline: none; min-width: 0; }
.dc-send { width: 34px; height: 34px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-contrast); display: grid; place-items: center; cursor: pointer; flex: none; }
.dc-send:hover { background: var(--accent-2); }
.dc-send[disabled] { opacity: 0.5; cursor: default; }
.dc-compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; }
.dc-closed { color: var(--ink-3); font-size: 13.5px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .dc { grid-template-columns: 1fr; min-height: 0; }
  .dc-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .dc-channels { display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .dc-cat { padding: 6px 4px; align-self: center; white-space: nowrap; }
  .dc-ch { width: auto; white-space: nowrap; }
  .dc-me { display: none; }
  .dc-msgs { max-height: 50vh; min-height: 260px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
  .composer { grid-template-columns: 1fr; }
  .ticket-layout { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
  .main { padding: 24px 28px 64px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 8px 0 6px; gap: 4px; }
  .topbar .brand { width: auto; margin-right: auto; }
  .menu-btn { display: grid; }
  .search { display: none; }
  .userbtn .uname, .userbtn > .i { display: none; }
  .rail {
    position: fixed; top: var(--bar-h); left: 0; bottom: 0; width: min(280px, 85vw); z-index: 40; height: auto;
    transform: translateX(-100%); transition: transform 0.2s ease; background: var(--surface);
  }
  .shell.menu-open .rail { transform: none; box-shadow: var(--shadow-lg); }
  .scrim:not([hidden]) { display: block; position: fixed; inset: var(--bar-h) 0 0 0; background: rgba(16, 24, 40, 0.4); z-index: 35; }
  .main { padding: 18px 14px calc(var(--tab-h) + 32px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--bar-bg); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--ink-3); font-size: 11px; font-weight: 500; cursor: pointer; text-decoration: none; }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  .tabbar i { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; font-style: normal; line-height: 16px; text-align: center; }
  .page-head { margin-bottom: 14px; }
  .page-head .actions { width: 100%; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-head h1 { font-size: 22px; }
  .shift-card { padding: 16px 16px 0; }
  .shift-top { flex-wrap: wrap; gap: 14px; }
  .shift-card .when { font-size: 24px; }
  .clock-btn { width: 100%; padding: 13px 20px; }
  .punches { margin: 0 -16px; }
  .punches > summary { padding: 11px 16px; }
  .punches .clock-recent, .punches .clock-sub { margin: 0 16px; }
  .summary .figure { flex-basis: 45%; }
  .signin { grid-template-columns: 1fr; grid-template-rows: 260px 1fr; }
  .signin-art { padding: 16px 20px; justify-content: flex-start; }
  .art-text h1 { font-size: 18px; }
  .art-sub { font-size: 12px; }
  .signin-panel { padding: 28px 16px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .profile { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  /* A day is a line: "Mon 7", then its shifts underneath. */
  .week .day { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
  .week .day:last-child { border-bottom: 0; }
  .week .dh { font-size: 13px; }
  .week .dn { font-size: 15px; flex: 1; margin: 0 0 6px; }
  .week .day > .shift { flex: 1 1 100%; }
  .month .cell { min-height: 58px; padding: 4px 5px; }
  .month .cell .dn { font-size: 12px; }
  .month .cell .dn .n, .month .chip, .month .more { display: none; }
  .month .dots { display: flex; }
  .cal-when { min-width: 0; }
  .chat { grid-template-columns: 1fr; }
  .chat .threads { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .chat .threads button { width: auto; white-space: nowrap; }
  .thread-group { display: none; }
  .form .row { grid-template-columns: 1fr; }
  .popover { right: 8px; left: 8px; width: auto; }
  .popover.user { width: auto; }
  .hr-search { max-width: none; width: 100%; }
  .hr-doc-body { max-height: 40vh; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; font-size: 12.5px; }
  .kv dt:first-child { margin-top: 0; }
  .kv.wide { grid-template-columns: 1fr; }
  /* Row actions sit under the text rather than squeezing it on a narrow screen. */
  .list > li { flex-wrap: wrap; align-items: flex-start; }
  .list .right { flex-wrap: wrap; align-items: center; width: 100%; justify-content: flex-start; }
  #toast { bottom: calc(var(--tab-h) + 16px); }
}

/* Price tags: the Needs tags queue. The checkbox column is narrow, the count and size sit in
   the row so a sheet can be set up without opening anything, and the bulk bar appears above
   the table once something is ticked. */
th.check, td.check { width: 32px; padding-right: 0; }
.tags-table .tag-qty { width: 64px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); text-align: right; }
.tags-table select { max-width: 200px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.tags-table select.unset { border-color: var(--danger); }
.tags-table .sub { white-space: normal; }
.toolbar.bulkbar { background: var(--accent-soft); }
.toolbar.bulkbar select { padding: 4px 8px; }

/* ---------- Guided tour: a spotlight on one thing and a card that says what it is ---------- */
.tour-bg { position: fixed; inset: 0; z-index: 60; }
.tour-spot { position: fixed; z-index: 61; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(16, 24, 40, 0.55), 0 0 0 2px var(--accent); transition: top 0.18s, left 0.18s, width 0.18s, height 0.18s; }
.tour-spot[hidden] { display: none; }
.tour-bg:has(+ .tour-spot[hidden]) { background: rgba(16, 24, 40, 0.55); }
.tour-card { position: fixed; z-index: 62; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 16px 18px 14px; }
.tour-card.center { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); }
.tour-card h2 { font-size: 16px; margin-bottom: 6px; }
.tour-card p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.tour-card p + p { margin-top: 8px; }
.tour-card kbd { padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface-2); }
.tour-count { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; min-height: 14px; margin-bottom: 4px; }
.tour-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.tour-actions .spacer { flex: 1; }
.tour-actions .linkbtn { color: var(--ink-3); }
.tour-actions .linkbtn:hover { color: var(--ink); }
@media (max-width: 860px) {
  .tour-card:not(.center) { top: auto !important; left: 12px !important; right: 12px; bottom: calc(var(--tab-h) + 12px); width: auto; }
  .tour-card:not(.center).up { top: calc(var(--bar-h) + 12px) !important; bottom: auto; }
}
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* ---------- Help: the written tour ---------- */
.help-search { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.help-q { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 480px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-3); }
.help-q input { flex: 1; border: 0; background: transparent; padding: 8px 0; font-size: 14px; color: var(--ink); outline: none; }
.help { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.help-toc { position: sticky; top: calc(var(--bar-h) + 16px); display: grid; gap: 2px; font-size: 13px; max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto; }
.help-toc a { padding: 5px 10px; border-radius: 6px; color: var(--ink-2); }
.help-toc a:hover { background: var(--surface-3); text-decoration: none; }
.help-toc a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.help-toc a.dim { opacity: 0.4; }
.help-secs { display: grid; gap: 16px; min-width: 0; }
.help-sec { scroll-margin-top: calc(var(--bar-h) + 12px); }
.help-body { max-width: 78ch; line-height: 1.55; font-size: 14px; }
.help-body .help-who { color: var(--ink-3); font-size: 13px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.help-body .help-who .field-label { margin: 0; }
.help-body .help-summary { font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.help-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); margin: 18px 0 6px; }
.help-body p + p { margin-top: 8px; }
.help-body ul, .help-body ol { margin: 6px 0 6px 20px; padding: 0; display: grid; gap: 5px; }
.help-body dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; }
.help-body dt { font-weight: 600; white-space: nowrap; }
.help-body dd { margin: 0; color: var(--ink-2); }
.help-body kbd { padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface-2); }
.help-body .tip { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; margin-top: 10px; font-size: 13.5px; }
@media (max-width: 860px) {
  .help { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .help-body dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .help-body dd { margin-bottom: 6px; }
}

/* Rentals: the step tracker, the next-step card, inspection photos, and the condition choice. */
.rental-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; align-items: center; gap: 10px; }
.rental-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.rental-steps li:last-child { flex: none; }
.rental-steps li:not(:last-child)::after { content: ""; flex: 1; min-width: 12px; height: 2px; border-radius: 1px; background: var(--line-2); }
.rental-steps li.done:not(:last-child)::after { background: var(--accent); }
.rental-steps .dot { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line-2); font-size: 12px; font-weight: 600; }
.rental-steps .dot .i { width: 14px; height: 14px; stroke-width: 3; }
.rental-steps li.done { color: var(--ink-2); }
.rental-steps li.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.rental-steps li.now { color: var(--ink); font-weight: 600; }
.rental-steps li.now .dot { border-color: var(--accent); color: var(--accent); }
.card.next { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card.next .card-head { background: var(--accent-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card.next .card-head h2 { color: var(--accent-ink); font-size: 15px; }
.card.next.late { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.card.next.late .card-head { background: var(--danger-soft); }
.card.next.late .card-head h2 { color: var(--danger); }
.card.next.done { border-color: var(--line); }
.card.next.done .card-head { background: var(--surface-2); }
.card.next.done .card-head h2 { color: var(--ink); }
.card.next p:first-child { margin-top: 0; }
.rental-go { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rental-go .btn.primary { min-width: 140px; justify-content: center; }
.btn.full { width: 100%; justify-content: center; padding-top: 11px; padding-bottom: 11px; font-size: 14.5px; }
.rental-cust { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.rental-contact { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.rental-kv { grid-template-columns: 1fr; gap: 1px 0; }
.rental-kv dt { margin-top: 9px; font-size: 12px; }
.rental-kv dt:first-child { margin-top: 0; }
.rental-fix { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 16px; align-items: start; }
.photo-grid figure { margin: 0; min-width: 0; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--neutral-soft); }
.photo-grid figcaption { font-size: 12px; line-height: 1.35; color: var(--ink-3); margin-top: 4px; overflow-wrap: anywhere; }
.photo-grid figcaption .linkbtn { font-size: 12px; }
.photo-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; text-align: center; }
.photo-tile:hover, .photo-tile:focus-within { border-color: var(--accent); color: var(--accent); }
.photo-tile .i { width: 24px; height: 24px; }
.form .choice-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .choice-tiles legend { grid-column: 1 / -1; }
.form .choice-tiles label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 600; }
.form .choice-tiles label small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.form .choice-tiles input { width: auto; flex: none; margin: 3px 0 0; padding: 0; accent-color: var(--accent); }
.form .choice-tiles label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form .choice-tiles label.bad input { accent-color: var(--danger); }
.form .choice-tiles label.bad:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); }
@media (max-width: 600px) {
  .rental-steps { gap: 6px; }
  .rental-steps li { flex-direction: column; gap: 4px; font-size: 11.5px; position: relative; flex: 1; }
  .rental-steps li:last-child { flex: 1; }
  .rental-steps li:not(:last-child)::after { position: absolute; top: 11px; left: calc(50% + 16px); right: calc(-50% + 13px); min-width: 0; }
  .rental-go .btn { flex: 1; justify-content: center; }
  .form .choice-tiles { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}
