/* Show Base internal side. Layout from the approved preview (App 0.1.0).
   Every color is a token. Light tokens sit on :root; dark tokens are set for
   [data-theme="dark"] and for [data-theme="system"] when the computer is in dark mode.
   scripts/check-contrast.js checks the text pairs in both themes (WCAG AA). */

/* 4Wall brand fonts, served from this app (Bebas Neue: OFL; Open Sans: Apache 2.0). */
@font-face { font-family: "Bebas Neue"; src: url("../brand/fonts/BebasNeue-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../brand/fonts/OpenSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../brand/fonts/OpenSans-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../brand/fonts/OpenSans-Semibold.ttf") format("truetype"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../brand/fonts/OpenSans-Bold.ttf") format("truetype"); font-weight: 700 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --side: #f5f6f8;
  --panel: #ffffff;
  --soft: #f7f8fa;
  --hover: #eceef2;
  --field: #ffffff;
  --line: #e4e7eb;
  --line-2: #eef0f3;
  --line-strong: #c9ced5;
  --ink: #1c2026;
  --ink-2: #4a525d;
  --ink-3: #636b76;
  --ink-faint: #6b737e;
  --on-color: #ffffff;
  /* 4Wall brand (Logo & Brand Identity Guidelines): 4Wall Blue, Pantone 300 C, #005eb8. */
  --brand-blue: #005eb8;
  --brand-blue-dark: #004a93;
  --brand-blue-tint: #66a6ec;
  --brand-black: #000000;
  --brand-white: #ffffff;
  --accent: var(--brand-blue);
  --accent-hover: var(--brand-blue-dark);
  --accent-soft: #e6eff9;
  --accent-ink: #00427f;
  --focus: #005eb8;
  --btn-bg: #005eb8;
  --btn-bg-hover: #004a93;
  --btn-ink: #ffffff;
  --danger: #b42a33;
  --danger-soft: #fdecee;
  --danger-line: #f4c9cd;
  --internal-row: #fff7f7;
  --ok: #17734a;
  --ok-soft: #e5f5ed;
  --ok-line: #bfe6d2;
  --warn: #8f5400;
  --warn-soft: #fff4de;
  --warn-line: #f3dca9;
  --urgent: #a34700;
  --urgent-soft: #ffeedd;
  --urgent-line: #f6c9a0;
  --off-a: #d6dae0;
  --off-b: #e9ecef;
  --day-off-bg: #4b5563;
  --day-off-ink: #ffffff;
  --other-month: #fbfbfc;
  --scrim: rgba(20, 24, 30, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.25);
  --toast-bg: #1c2026;
  --toast-ink: #ffffff;
  --logo-bg: #1c2026;
  --logo-ink: #ffffff;
  /* Status dots (shapes next to a text label, so 3:1 is enough). */
  --st-quote: #8a5cf0;
  --st-order: #2a5bd7;
  --st-active: #17734a;
  --st-archive: #7d858f;
  --st-cancelled: #c0353e;
  /* Badge and show colors carry white text, so each one passes 4.5:1 against white. */
  --c-slate: #56657a; --c-blue: #005eb8; --c-purple: #7146c4; --c-amber: #985700;
  --c-teal: #0b6f72; --c-red: #b8323b; --c-gray: #636b76; --c-green: #17734a;
  --c-pink: #a03f81; --c-steel: #2f6a8a; --c-brown: #8a5214; --c-grape: #5a4fb0;
  --radius: 10px;
  --pad: 24px;
  --row: 10px;
  --font: "Open Sans", Arial, sans-serif;
  --font-head: "Bebas Neue", "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171c;
  --side: #1a1e24;
  --panel: #1b1f26;
  --soft: #222730;
  --hover: #262c35;
  --field: #11141a;
  --line: #2f3641;
  --line-2: #272d36;
  --line-strong: #46505d;
  --ink: #e8ebef;
  --ink-2: #c3c9d1;
  --ink-3: #9aa3ae;
  --ink-faint: #8f98a3;
  --on-color: #ffffff;
  --accent: #66a6ec;
  --accent-hover: #8dbdf2;
  --accent-soft: #14273d;
  --accent-ink: #b3d3f7;
  --focus: #66a6ec;
  --btn-bg: #005eb8;
  --btn-bg-hover: #1a6fc4;
  --btn-ink: #ffffff;
  --danger: #ff8a8f;
  --danger-soft: #3a1d21;
  --danger-line: #6b2f35;
  --internal-row: #241a1d;
  --ok: #5fd39a;
  --ok-soft: #15301f;
  --ok-line: #24553a;
  --warn: #f2bd5b;
  --warn-soft: #33270f;
  --warn-line: #5e4719;
  --urgent: #ffab70;
  --urgent-soft: #3a2414;
  --urgent-line: #6b3f1d;
  --off-a: #3a414c;
  --off-b: #2b313a;
  --day-off-bg: #6b7482;
  --day-off-ink: #ffffff;
  --other-month: #171a20;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  --toast-bg: #e8ebef;
  --toast-ink: #14171c;
  --logo-bg: #e8ebef;
  --logo-ink: #14171c;
  --st-quote: #a98bff;
  --st-order: #6f9bff;
  --st-active: #4cc48a;
  --st-archive: #8e96a0;
  --st-cancelled: #ff6b73;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #14171c;
    --side: #1a1e24;
    --panel: #1b1f26;
    --soft: #222730;
    --hover: #262c35;
    --field: #11141a;
    --line: #2f3641;
    --line-2: #272d36;
    --line-strong: #46505d;
    --ink: #e8ebef;
    --ink-2: #c3c9d1;
    --ink-3: #9aa3ae;
    --ink-faint: #8f98a3;
    --on-color: #ffffff;
    --accent: #66a6ec;
    --accent-hover: #8dbdf2;
    --accent-soft: #14273d;
    --accent-ink: #b3d3f7;
    --focus: #66a6ec;
    --btn-bg: #005eb8;
    --btn-bg-hover: #1a6fc4;
    --btn-ink: #ffffff;
    --danger: #ff8a8f;
    --danger-soft: #3a1d21;
    --danger-line: #6b2f35;
    --internal-row: #241a1d;
    --ok: #5fd39a;
    --ok-soft: #15301f;
    --ok-line: #24553a;
    --warn: #f2bd5b;
    --warn-soft: #33270f;
    --warn-line: #5e4719;
    --urgent: #ffab70;
    --urgent-soft: #3a2414;
    --urgent-line: #6b3f1d;
    --off-a: #3a414c;
    --off-b: #2b313a;
    --day-off-bg: #6b7482;
    --day-off-ink: #ffffff;
    --other-month: #171a20;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
    --toast-bg: #e8ebef;
    --toast-ink: #14171c;
    --logo-bg: #e8ebef;
    --logo-ink: #14171c;
    --st-quote: #a98bff;
    --st-order: #6f9bff;
    --st-active: #4cc48a;
    --st-archive: #8e96a0;
    --st-cancelled: #ff6b73;
  }
}
body.compact { --pad: 16px; --row: 6px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
[hidden] { display: none !important; }

.app { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 288px; flex: none; background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; padding: 16px 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; }
/* 4Wall logo: never under 48px tall on screen, with clear space at least the height of the "W"
   (about 1/6 of the logo height) on every side. Blue on light, white (reverse) on dark. */
.brand-logo { height: 56px; width: auto; flex: none; margin: 10px; display: block; }
.signin-card .brand-logo { height: 72px; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-on-light { display: none; }
  :root[data-theme="system"] .logo-on-dark { display: block; }
}
.brand-name { font-family: var(--font-head); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: 0.02em; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.brand .icon-btn { margin-left: auto; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-ghost { background: transparent; }
.btn-danger-soft { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-new { width: 100%; padding: 10px; font-size: 14px; }
.icon-btn { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; }
.row-btn { border: 1px solid transparent; background: transparent; color: var(--ink-3); border-radius: 6px; cursor: pointer; padding: 2px 7px; font-size: 13px; }
.row-btn:hover { border-color: var(--line); color: var(--ink); background: var(--panel); }

.side-section { display: flex; flex-direction: column; gap: 8px; }
.side-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 4px 4px 0; }
.count { background: var(--line); color: var(--ink-2); border-radius: 10px; padding: 1px 7px; font-size: 11px; }
.search { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--field); }
.search:focus, select:focus, .form input:focus, .form select:focus, .form textarea:focus { border-color: var(--focus); }
.filter-row { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; gap: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.toggle input { accent-color: var(--accent); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filters select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 6px; background: var(--field); font-size: 12px; }
.show-list { display: flex; flex-direction: column; gap: 2px; }
.show-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; border: 1px solid transparent; }
.show-item:hover { background: var(--hover); text-decoration: none; }
.show-item.active { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow); }
.show-item .si-name { font-weight: 600; font-size: 13px; display: flex; gap: 7px; align-items: center; }
.show-item .si-meta { font-size: 12px; color: var(--ink-3); margin-left: 15px; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.st-Quote { background: var(--st-quote); } .st-Order { background: var(--st-order); } .st-Active { background: var(--st-active); }
.st-Archive { background: var(--st-archive); } .st-Cancelled { background: var(--st-cancelled); }
.empty-list { font-size: 12px; color: var(--ink-3); padding: 8px 10px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.ni { width: 18px; text-align: center; color: var(--ink-3); }
.archive-btn { margin-top: 6px; border-style: dashed; color: var(--ink-2); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 54px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.crumbs { font-size: 13px; color: var(--ink-3); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs a { text-decoration: underline; text-underline-offset: 2px; }
.viewas { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.viewas b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.viewas select { border: 1px solid var(--line); border-radius: 20px; padding: 6px 10px; background: var(--soft); font-weight: 600; font-size: 13px; color: var(--ink); }
.user-menu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 70; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); font-size: 13px; }
.menu button:hover, .menu a:hover { background: var(--hover); text-decoration: none; }
.menu .menu-head { padding: 8px 10px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.content { flex: 1; overflow-y: auto; padding: var(--pad); }
.page-title { font-family: var(--font-head); font-size: 32px; font-weight: 400; line-height: 1.05; letter-spacing: 0.01em; margin-bottom: 4px; }
.page-sub { color: var(--ink-3); margin-bottom: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

/* Show header */
.show-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.show-title { font-family: var(--font-head); font-size: 36px; font-weight: 400; line-height: 1.05; letter-spacing: 0.01em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.pub { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.pill.internal { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.facts .k { color: var(--ink-3); margin-right: 5px; }
.orders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.order-chip { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; background: var(--panel); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.order-chip b { color: var(--ink-3); font-weight: 600; margin-right: 4px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-size: 13px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab.tab-internal { color: var(--danger); }
.tab.tab-internal.active { border-bottom-color: var(--danger); }

/* Cards and grids */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; min-width: 0; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 .pill, .card h3 .btn, .card h3 a { text-transform: none; letter-spacing: 0; }
.card ul { margin: 0; padding-left: 18px; }
.card li { margin: 4px 0; color: var(--ink-2); }
.callout { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink-2); font-style: italic; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.callout.internal { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); font-style: normal; font-weight: 600; align-items: center; justify-content: flex-start; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.section-gap { margin-top: 16px; }
.sec-label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 22px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ok-text { color: var(--ok); }
.note-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.note-row .row-btn { flex: none; }
.pre { white-space: pre-wrap; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 700; background: var(--soft); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: var(--row) 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.row-internal td { background: var(--internal-row); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--soft); }
td.actions { white-space: nowrap; text-align: right; width: 1%; }
.ev { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 7px; margin: 1px 4px 1px 0; color: var(--on-color); white-space: nowrap; }
.ev-slate { background: var(--c-slate); } .ev-blue { background: var(--c-blue); } .ev-purple { background: var(--c-purple); }
.ev-amber { background: var(--c-amber); } .ev-teal { background: var(--c-teal); } .ev-red { background: var(--c-red); } .ev-gray { background: var(--c-gray); }
.who { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.person { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--on-color); flex: none; }
.chip { display: inline-block; font-size: 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 2px 9px; color: var(--ink-2); }
.chip-link { cursor: pointer; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.conflict-text { color: var(--danger); }

/* To-dos */
.todo-group { margin-bottom: 14px; }
.todo-group h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; }
.bar { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-bottom: 8px; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.todo { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 13px; cursor: pointer; }
.todo input { width: 16px; height: 16px; accent-color: var(--ok); flex: none; }
.todo.done span { color: var(--ink-3); text-decoration: line-through; }
.todo .row-btn { margin-left: auto; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-title { font-family: var(--font-head); font-size: 24px; font-weight: 400; letter-spacing: 0.02em; min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.cal .dh { background: var(--soft); font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.cal .cell { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 4px; min-width: 0; }
.cal .cell:nth-child(7n) { border-right: 0; }
.cal .cell.other { background: var(--other-month); }
.cal .cell.other .dn { color: var(--ink-faint); }
.cal .cell.today .dn { background: var(--btn-bg); color: var(--btn-ink); border-radius: 10px; padding: 0 6px; }
.dn { font-size: 12px; font-weight: 600; color: var(--ink-2); display: inline-block; margin: 2px 2px 4px; }
.cal-ev { display: block; font-size: 11px; font-weight: 600; color: var(--on-color); border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev.is-internal { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,0.14) 6px 9px); }
.cal-ev:hover { filter: brightness(1.1); text-decoration: none; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.lg-off { background: repeating-linear-gradient(45deg, var(--off-a), var(--off-a) 3px, var(--off-b) 3px, var(--off-b) 6px); }
.legend i.lg-clash { background: var(--panel); box-shadow: inset 0 0 0 2px var(--danger); }

/* Crew availability grid */
.avail-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.avail { border-collapse: separate; border-spacing: 0; font-size: 12px; width: auto; }
.avail th, .avail td { padding: 0; border-bottom: 1px solid var(--line-2); }
.avail th.name, .avail td.name { position: sticky; left: 0; background: var(--panel); z-index: 2; min-width: 170px; padding: 6px 10px; border-right: 1px solid var(--line); text-align: left; }
.avail th.name { background: var(--soft); }
.avail th.d { min-width: 26px; text-align: center; font-size: 10px; padding: 4px 0; text-transform: none; letter-spacing: 0; }
.avail th.d.wk { background: var(--hover); }
.avail th.d.today { background: var(--btn-bg); color: var(--btn-ink); }
.avail td.c { height: 30px; text-align: center; border-right: 1px solid var(--line-2); }
.avail td.c.wk { background: var(--other-month); }
.blk { display: block; height: 20px; margin: 0 -1px; color: var(--on-color); font-size: 10px; line-height: 20px; font-weight: 700; cursor: pointer; }
.blk:hover { text-decoration: none; filter: brightness(1.1); }
.blk.off { background: repeating-linear-gradient(45deg, var(--off-a), var(--off-a) 4px, var(--off-b) 4px, var(--off-b) 8px); color: var(--ink); cursor: default; }
.blk.clash { box-shadow: inset 0 0 0 2px var(--danger); }
.blk.clash::after { content: ""; }

/* Record pages */
.record-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.record-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.record-head .grow { flex: 1; min-width: 200px; }
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer; background: var(--panel); }
.link-row:hover { border-color: var(--accent); text-decoration: none; }
.link-row.static { cursor: default; }
.link-row.static:hover { border-color: var(--line); }
.link-row .lr-main { min-width: 0; }
.link-row .lr-title { font-weight: 600; }
.link-row .lr-sub { font-size: 12px; color: var(--ink-3); }
.lr-end { display: flex; gap: 6px; align-items: center; flex: none; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10px; text-align: center; }
.mini-cal .h { color: var(--ink-3); font-weight: 700; padding: 2px 0; }
.mini-cal .m { padding: 4px 0; border-radius: 4px; color: var(--ink-2); }
.mini-cal .m.b { color: var(--on-color); font-weight: 700; }
.mini-cal .m.o { background: repeating-linear-gradient(45deg, var(--off-a), var(--off-a) 3px, var(--off-b) 3px, var(--off-b) 6px); color: var(--ink); }
.mini-cal .m.x { box-shadow: inset 0 0 0 2px var(--danger); }
.mini-cal .m.t { outline: 2px solid var(--accent); }
.mini-month { font-weight: 700; font-size: 12px; margin: 0 0 4px; }

/* Lists */
.list-tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.list-tools .search { max-width: 280px; }
.list-tools select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--field); }
.list-tools .grow { flex: 1; }
.list-tools.between { justify-content: space-between; }

/* Home */
.home-cards .card { cursor: pointer; display: block; color: var(--ink); }
.home-cards .card:hover { border-color: var(--line-strong); text-decoration: none; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; background: var(--scrim); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 16px; overflow-y: auto; }
.modal { background: var(--panel); color: var(--ink); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--font-head); font-size: 24px; font-weight: 400; letter-spacing: 0.02em; }
.modal-body { padding: 18px 20px 20px; }
.pub-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pub-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.pub-col.public h4 { color: var(--ok); }
.pub-col.private h4 { color: var(--danger); }
.pub-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.pub-col.private .pub-item { background: var(--internal-row); border-color: var(--danger-line); }
.pub-item input { accent-color: var(--ok); }
.share { display: flex; gap: 6px; margin-top: 14px; }
.share-off { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.pub-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }

/* Live updates (App 0.4.0) */
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--ok-soft); border: 1px solid var(--ok-line); color: var(--ok); white-space: nowrap; flex: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live-pill.wait { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.conflict { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.conflict b { color: var(--warn); }
.conflict table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.conflict th, .conflict td { text-align: left; padding: 4px 6px; border-top: 1px solid var(--warn-line); vertical-align: top; overflow-wrap: anywhere; }
.conflict th { color: var(--ink-2); font-weight: 600; }
.conflict .modal-actions { margin-top: 8px; }
.stale-note { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; }
.share input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--soft); font-size: 13px; }
.style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.style-opt { border: 2px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 13px; background: var(--panel); color: var(--ink); text-align: left; }
.style-opt.sel { border-color: var(--accent); }
.swatch { width: 40px; height: 30px; border-radius: 6px; flex: none; }
.sw-stage { background: linear-gradient(135deg, #0d0f14 40%, #e9a23b); }
.sw-clean { background: linear-gradient(135deg, #ffffff 45%, #1d3f8f); border: 1px solid var(--line); }
.sw-light { background: linear-gradient(135deg, #ffffff 50%, #f5f6f8 50%); border: 1px solid var(--line); }
.sw-dark { background: linear-gradient(135deg, #14171c 50%, #1b1f26 50%); border: 1px solid var(--line); }
.sw-system { background: linear-gradient(135deg, #ffffff 50%, #14171c 50%); border: 1px solid var(--line); }
.theme-pick { grid-template-columns: repeat(3, 1fr); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.form label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form label.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.form input, .form select, .form textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14px; background: var(--field); color: var(--ink); width: 100%; }
.form textarea { min-height: 80px; resize: vertical; }
.form .hint { font-weight: 400; color: var(--ink-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--field); }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; color: var(--ink); }
.checks input { width: auto; accent-color: var(--accent); }
.form-error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.auto-note { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--accent-ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 90; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.error { background: var(--danger); color: var(--bg); }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.signin-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-lg); }
.signin-card .brand { margin-bottom: 18px; }
.loading { padding: 40px; color: var(--ink-3); }

.only-mobile { display: none; }
/* App 1.1.0: the phone's bottom bar and phone-only views (css/phone.css shows them on a phone). */
.phone-nav, .phone-only { display: none; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --pad: 16px; }
  .only-mobile { display: inline-block; }
  .cal-nav { flex-wrap: wrap; width: 100%; }
  .cal-title { min-width: 0 !important; flex: 1; font-size: 20px !important; }
  .avail th.name, .avail td.name { min-width: 120px; max-width: 120px; padding: 6px 8px; }
  .avail td.name .small { display: none; }
  .avail td.name .avatar { display: none; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); width: 300px; max-width: 86vw; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 55; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .viewas > span { display: none; }
  .viewas select { max-width: 130px; }
  .topbar { gap: 8px; }
  .show-title { font-size: 28px; }
  .page-title { font-size: 28px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .cal .cell { min-height: 64px; padding: 2px; }
  .cal-ev { font-size: 9px; padding: 1px 3px; }
  .cal .dh { padding: 4px 2px; text-align: center; font-size: 10px; }
  .pub-cols, .form-row, .style-pick { grid-template-columns: 1fr; }
  .theme-pick { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .list-tools .search { max-width: none; flex: 1 1 100%; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 12px; }
  table.stack td.actions { text-align: left; width: 100%; }
  table.stack td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 86px; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
}

/* First start of the installed app (App 0.5.0) */
.setup-card { max-width: 520px; }
.setup-title { font-family: var(--font-head); font-weight: 400; font-size: 26px; letter-spacing: .5px; margin: 0 0 10px; }
.setup-choice { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.setup-choice h3, .setup-h { font-size: 15px; margin: 0 0 6px; }
.setup-choice p { margin: 0 0 8px; }
.setup-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.setup-busy { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }

/* ---------- App 0.6.0 (Build Session 08): round 1 ---------- */
/* Sidebar search (searches the whole app) */
.app-search { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.search-hint { font-size: 11px; color: var(--ink-3); padding: 0 4px; }
.side-section .nav-item { font-size: 13.5px; }

/* Segmented view switch (Week / Month / 3 Months) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--btn-bg); color: var(--btn-ink); }
.seg-btn:not(.on):hover { background: var(--hover); }

/* Calendar filters and color key */
.cal-filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.cal-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.cal-person select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--field); max-width: 260px; }
.key-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.key-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-right: 4px; }
.key-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 16px; padding: 3px 10px 3px 7px; font-size: 12px; font-weight: 600; cursor: pointer; }
.key-chip i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.key-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.key-chip:hover { border-color: var(--line-strong); }
.cal-month-title { font-family: var(--font-head); font-size: 20px; letter-spacing: 0.02em; margin: 14px 0 6px; }
.cal-month-title:first-of-type { margin-top: 0; }
.cal.cal-small .cell { min-height: 78px; }
.cal-more { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--accent); font-size: 11px; font-weight: 700; padding: 1px 4px; cursor: pointer; border-radius: 4px; }
.cal-more:hover { background: var(--hover); }
button.cal-ev { border: 0; width: 100%; text-align: left; font-family: inherit; }
.cal-ev.is-quote { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85); outline: 1px dashed var(--ink-2); outline-offset: -1px; }
.cal .cell.overlap, .wk-day.overlap { box-shadow: inset 0 0 0 2px var(--danger); }
.overlap-tag { float: right; font-size: 10px; font-weight: 700; color: var(--danger); margin: 3px 2px 0 0; }
.legend i.lg-internal { background: var(--c-slate); background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(255,255,255,0.35) 3px 5px); }
.legend i.lg-quote { background: var(--c-blue); outline: 1px dashed var(--ink-2); outline-offset: 1px; }
.legend i.lg-overlap { background: var(--panel); box-shadow: inset 0 0 0 2px var(--danger); }
/* Week view: a column per day, each entry with as much as fits */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.wk-day { min-height: 340px; border-right: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wk-day:last-child { border-right: 0; }
.wk-day.today { background: var(--accent-soft); }
.wk-head { display: flex; gap: 6px; align-items: baseline; padding: 2px 2px 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 2px; }
.wk-dow { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; }
.wk-dn { font-size: 13px; font-weight: 700; }
.wk-none { font-size: 12px; color: var(--ink-3); padding: 4px 2px; }
.cal-ev-full { display: flex; flex-direction: column; gap: 1px; white-space: normal; padding: 5px 7px; line-height: 1.25; }
.cal-ev-full b { font-size: 12px; }
.cal-ev-full span { font-size: 12px; font-weight: 600; }
.cal-ev-full small { font-size: 11px; font-weight: 400; opacity: 0.95; }
.day-list { display: flex; flex-direction: column; gap: 6px; }
.day-list .cal-ev-full { font-size: 13px; }

/* Lists: sortable headers, copy buttons, flags */
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort:hover { color: var(--ink); }
.email-cell { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.copy-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
a.pill.warn:hover { text-decoration: none; filter: brightness(0.97); }
.list-tools .link-btn { font-size: 13px; }
.list-tools .toggle { white-space: nowrap; }
.shows-table td { vertical-align: middle; }

/* Crew Availability: name on the left, discipline on the right, compact rows */
.avail th.name, .avail td.name { min-width: 250px; max-width: 300px; }
.avail td.name { padding: 2px 10px; height: 24px; }
.avail .nmrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.avail td.name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; min-width: 0; }
.avail td.name .nm a { color: var(--ink); }
.avail td.name .disc { font-size: 11px; color: var(--ink-3); white-space: nowrap; flex: none; }
.avail td.c { height: 24px; }
.avail .blk { height: 18px; line-height: 18px; }
.avail tr.grp th.name { background: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); padding: 4px 10px; }
.avail tr.grp td { background: var(--soft); }
.avail th.d.picked { box-shadow: inset 0 -3px 0 var(--accent); }
.avail-tools input[type="date"] { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--field); }
.avail-dates { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* Forms: section headings, "Already in 615 HQ?", new items */
.form-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 10px 0 2px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.form .form-sub:first-of-type, .card .form-sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.dup-check { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.dup-check b { color: var(--warn); }
.dup-check ul { margin: 4px 0 0; padding-left: 18px; }
.multi-new { margin-top: 6px; }
.notes-box { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--field); color: var(--ink); resize: vertical; }
.pick-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 8px 2px 0; }

/* PM Resources as a list */
.res-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.res-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.res-row:last-child { border-bottom: 0; }
.res-icon { width: 22px; flex: none; text-align: center; font-size: 18px; color: var(--accent); line-height: 1.3; }
.res-main { flex: 1; min-width: 0; }
.res-title { font-weight: 700; }
.res-body summary { cursor: pointer; }
.res-body .pre { margin-top: 6px; max-height: 320px; overflow: auto; }

/* Home: Needs attention first */
.home-top { margin-bottom: 4px; }
.attention { max-height: 460px; overflow-y: auto; }
.card h3 .count { margin-left: 6px; margin-right: auto; }
.sec-label .count { margin-left: 6px; text-transform: none; letter-spacing: 0; }

@media (max-width: 820px) {
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .wk-day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .wk-day:last-child { border-bottom: 0; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; }
  .cal.cal-small .cell { min-height: 54px; }
  .cal-more { font-size: 9px; padding: 0 2px; }
  .overlap-tag { display: none; }
  .avail th.name, .avail td.name { min-width: 150px; max-width: 150px; }
  .avail td.name .disc { display: none; }
  .key-chip { font-size: 11px; padding: 2px 8px 2px 6px; }
  .avail-dates { width: 100%; }
  .list-tools select { flex: 1 1 45%; min-width: 0; }
}
/* Links inside a sentence are underlined, so they don't rely on color alone (WCAG). */
.page-sub a, .dup-check a { text-decoration: underline; text-underline-offset: 2px; }

/* PM review round (App 0.7.0) */
.update-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #005eb8; color: #fff; padding: 6px var(--pad); font-size: 13px; line-height: 1.35; }
.update-bar[hidden] { display: none; }
.update-bar b { color: #fff; }
.update-bar .ub-sub { opacity: 0.92; }
.update-bar .btn-primary { background: #fff; color: #00407d; border-color: #fff; }
.review-banner { flex: none; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--warn-line); padding: 8px var(--pad); font-size: 13px; line-height: 1.4; }
.review-banner b { color: var(--warn); }
.review-banner .btn { margin-left: 8px; }
.feedback-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; flex: none; }
@media (max-width: 820px) {
  .feedback-btn .fb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .feedback-btn { padding: 6px 9px; font-size: 14px; }
  .review-banner { padding: 8px 16px; font-size: 12px; }
}
.who-list { display: grid; gap: 6px; margin: 4px 0 12px; max-height: 52vh; overflow-y: auto; }
.who-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; }
.who-btn:hover { background: var(--hover); border-color: var(--line-strong); }
.who-btn .who-name { font-weight: 600; font-size: 14px; }
.who-btn .who-role { font-size: 12px; color: var(--ink-3); }
.who-head { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 2px 0 6px; }
.kind-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-pick button { border: 1px solid var(--line-strong); background: var(--soft); color: var(--ink); border-radius: 20px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.kind-pick button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.fb-auto { font-size: 12px; color: var(--ink-3); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.fb-shot { max-width: 100%; max-height: 160px; border: 1px solid var(--line); border-radius: 6px; display: block; margin-top: 6px; }
.fb-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.welcome-list { margin: 0 0 10px; padding-left: 18px; }
.welcome-list li { margin: 4px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); border-radius: 8px; padding: 8px 10px; }

/* ---------- App 0.8.0 (Build Session 10): Round 2, the show page's internal side ---------- */
.pill.urgent { background: var(--urgent-soft); border-color: var(--urgent-line); color: var(--urgent); }
.pill-btn { cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.nowrap { white-space: nowrap; }
.h3-links { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card h3 .h3-links a { text-transform: none; letter-spacing: 0; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 16px 0 6px; }
tr.total-row td { border-top: 2px solid var(--line-strong); }

/* Click to change a value (Show Home, Schedule cells) */
.kv-edit { border: 1px dashed transparent; background: none; color: var(--ink); font: inherit; text-align: left; padding: 2px 6px; margin: -3px -7px; border-radius: 6px; cursor: pointer; min-height: 24px; }
.kv-edit:hover, .kv-edit:focus-visible { border-color: var(--line-strong); background: var(--soft); }
.kv-edit.block { display: block; width: calc(100% + 14px); white-space: pre-wrap; }
.kv-cell { display: block; }
.welcome-callout { padding: 10px 12px; flex-direction: column; align-items: stretch; gap: 6px; }
.welcome-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-style: normal; }
.welcome-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.welcome-tag { font-size: 11px; padding: 1px 8px; }
.welcome-edit { width: 100%; font-style: italic; color: var(--ink-2); margin: 0; }
.welcome-text { font-style: italic; }
td.cell-edit { cursor: pointer; }
td.cell-edit:hover, td.cell-edit:focus-visible { background: var(--soft); outline: 1px dashed var(--line-strong); outline-offset: -3px; }
td.cell-edit.editing, td.cell-edit.editing:hover { background: var(--panel); outline: 0; cursor: default; }
.inl-box { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.inl-box input, .inl-box select, .inl-box textarea { border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px; background: var(--field); color: var(--ink); font: inherit; width: 100%; }
.inl-dates { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inl-dates input { width: auto; flex: 1 1 130px; }
.inl-actions { display: flex; gap: 6px; }
.inl-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 420px; }
.inl-checks label { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
.inl-checks .inl-new { flex: 1 1 100%; }
.vis-toggle { border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--ok); border-radius: 20px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.vis-toggle.internal { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
[data-rate].vis-toggle { border-color: var(--line); background: var(--soft); color: var(--ink-2); }

/* Show Home */
.home-grid > div { min-width: 0; }
.kd-list { display: flex; flex-direction: column; }
.kd-row { display: grid; grid-template-columns: minmax(120px, 0.8fr) 2fr; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.kd-row:last-child { border-bottom: 0; }
.kd-label { font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.kd-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.kd-val { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.kd-val:hover, .kd-val:focus-visible { border-color: var(--accent); }
.kd-val.unset { border-style: dashed; color: var(--ink-3); }
span.kd-val { cursor: default; }
.order-list { display: flex; flex-direction: column; gap: 6px; }
.order-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; }
.order-main { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; min-width: 0; }
.order-num { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.order-desc { color: var(--ink-2); }
.order-add { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 6px; margin-top: 10px; }
.order-add input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--field); color: var(--ink); font: inherit; min-width: 0; }
.order-msg { grid-column: 1 / -1; }
.doc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.doc-tile { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; color: var(--ink); font: inherit; }
.doc-tile:hover { border-color: var(--accent); }
.doc-open { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); width: 100%; }
.doc-open:hover { text-decoration: none; }
.doc-ico { width: 44px; height: 44px; border-radius: 10px; color: var(--on-color); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.02em; }
.doc-ico.add { background: var(--soft); color: var(--ink-2); border: 1px dashed var(--line-strong); font-size: 22px; }
.doc-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.doc-foot { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); }
.doc-foot .row-btn { width: 24px; height: 24px; }
.doc-add { cursor: pointer; justify-content: center; }
.pub-dot { color: var(--ok); font-weight: 600; }
.int-dot { color: var(--ink-3); }

/* Bigger calendar pop-up */
.bigcal-wrap { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.bigcal { background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px; width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.bigcal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bigcal-head h2 { font-size: 18px; margin: 0; }
.bigcal-nav { display: flex; gap: 6px; margin: 10px 0; }
.bigcal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bigcal-mname { font-family: var(--font-head); font-size: 20px; letter-spacing: 0.02em; margin-bottom: 6px; }
.bigcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bigcal-dow { font-size: 11px; color: var(--ink-3); text-align: center; font-weight: 700; padding-bottom: 2px; }
.bigcal-day { position: relative; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; height: 46px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 4px 2px; gap: 3px; }
.bigcal-day:hover { border-color: var(--accent); }
.bigcal-day.today .bigcal-num { text-decoration: underline; text-underline-offset: 3px; }
.bigcal-day.on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); font-weight: 700; }
.bigcal-num { font-size: 14px; }
.bigcal-mark { width: 16px; height: 4px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px var(--panel); }
.bigcal-sum { margin-top: 12px; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.date-field { display: flex; gap: 6px; align-items: stretch; }
.date-field input { flex: 1 1 auto; min-width: 0; }
.cal-btn { flex: none; padding: 0 9px; }

/* Type to search */
.ta-wrap { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 320px; overflow: auto; }
.ta-item { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.ta-item.on, .ta-item:hover { background: var(--accent-soft); color: var(--accent-ink); }
.ta-item.on .muted, .ta-item:hover .muted { color: var(--accent-ink); }
.ta-extra { padding: 6px 6px 4px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.add-person { margin-bottom: 14px; }
.add-person .search { width: 100%; max-width: 520px; }
.add-label { display: block; font-weight: 700; margin-bottom: 6px; }
.chip-btn { cursor: pointer; font: inherit; font-size: 12px; }

/* On / off switch (published or hidden) */
.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px; white-space: nowrap; }
.switch .sw-knob { width: 34px; height: 20px; border-radius: 10px; background: var(--off-a); position: relative; flex: none; transition: background .15s; }
.switch .sw-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch.on .sw-knob { background: var(--ok); }
.switch.on .sw-knob::after { left: 16px; }
.switch.on .sw-text { color: var(--ok); }

/* Crew tab */
tr.open-pos td { background: var(--soft); }
.hours-card { padding-top: 12px; }
.hours-rules { margin-bottom: 4px; }

/* Venue & Logistics */
.venue-block { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.venue-block:first-of-type { padding-top: 0; }
.venue-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.venue-name { font-weight: 700; font-size: 15px; }

/* Needs attention: Dismiss */
.att-row { display: flex; align-items: stretch; gap: 6px; }
.att-row .link-row { flex: 1 1 auto; min-width: 0; }
.att-x { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink-3); border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; padding: 0 10px; cursor: pointer; }
.att-x:hover { color: var(--ink); border-color: var(--line-strong); }
.open-card { margin-bottom: 14px; }

/* Shows list: the name column never squashes (Gabe) */
.shows-table { table-layout: auto; min-width: 860px; }
.shows-table col.c-name { width: 34%; }
.shows-table td.name-cell { min-width: 260px; }
.shows-table td.name-cell b { overflow-wrap: normal; word-break: normal; }

.setup-more { margin-top: 8px; }
.setup-more summary { cursor: pointer; color: var(--ink-3); padding: 8px 0; }
.shop-row { margin-bottom: 6px; }
.shop-row label:first-child { flex: 0 0 90px; }
.form-html { font-size: 13px; }

@media (max-width: 820px) {
  .bigcal-months { grid-template-columns: 1fr; }
  .bigcal-months .bigcal-month + .bigcal-month { display: none; }
  .bigcal { padding: 14px; }
  .bigcal-day { height: 42px; }
  .order-add { grid-template-columns: 1fr; }
  .kd-row { grid-template-columns: 1fr; gap: 4px; }
  .shows-table { min-width: 0; }
  .shows-table td.name-cell { min-width: 0; }
  .doc-tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .att-x { padding: 0 8px; }
}

/* ---------- App 0.9.0 (Build Session 12, Round 3) ---------- */
.back-btn { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.modal.wide { max-width: 1040px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
/* Dates: Day and Date columns (the "columns" style). The day reads lighter so the date stands out. */
/* Grey weekday (App 0.9.1, Gabe): the weekday in a one-line date ("Thu, Apr 12") is marked .wd by markWeekdays() in
   util.js. Same muted color as the Day column. On colored chips, buttons and pills it keeps the chip's own color. */
.wd { color: var(--ink-3); }
.btn-primary .wd, .pill .wd, .toast .wd, [style*="background"] .wd { color: inherit; }
.dc-day { color: var(--ink-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em; }
th.dc-day, td.dc-day { width: 1%; }
.dc-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.dc-day { padding-right: 4px; }
.dc-one { white-space: nowrap; }
span.dc-day { display: inline-block; min-width: 76px; margin-right: 6px; }
.date-pick .style-opt { flex-direction: column; align-items: flex-start; gap: 2px; }
.ds-ex { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Show Home dates */
.kd-list2 { display: flex; flex-direction: column; }
.kd-row2 { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: start; padding: 7px 6px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; color: var(--ink); font: inherit; text-align: left; width: 100%; border-radius: 6px; }
button.kd-row2 { cursor: pointer; }
button.kd-row2:hover, button.kd-row2:focus-visible { background: var(--hover); }
.kd-row2:last-child { border-bottom: 0; }
.kd-row2 .kd-dot { margin-top: 5px; }
.kd-what { min-width: 0; }
.kd-ev { font-weight: 700; }
.kd-purpose, .kd-loc { color: var(--ink-2); font-size: 13px; }
.kd-note { display: block; color: var(--ink-3); font-size: 12.5px; white-space: pre-wrap; margin-top: 1px; }
.kd-when { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.kd-run { display: inline-flex; gap: 0; }
.kd-run span.dc-day { min-width: 64px; text-align: left; }
.kd-run span.dc-date { min-width: 92px; text-align: left; font-weight: 600; }
.kd-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.kd-add .chip-btn { display: inline-flex; gap: 6px; align-items: center; }
.disc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.disc-chips.small .dchip { font-size: 12px; padding: 3px 8px; }
.dchip { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.dchip.on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.dchip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc, var(--ink-3)); display: inline-block; flex: none; }
.dchip.on .dchip-dot { outline: 2px solid var(--btn-ink); }
.disc-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--dc, var(--c-slate)); color: #fff; white-space: nowrap; align-self: start; margin-top: 2px; }
.disc-tag.all { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
tr.disc-row td:first-child { box-shadow: inset 4px 0 0 var(--dc); }
/* Schedule alongside */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.with-aside.aside-closed { grid-template-columns: minmax(0, 1fr) 150px; }
.sched-aside { position: sticky; top: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 13px; }
.sa-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.sa-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.sa-row { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 8px; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.sa-row .kd-dot { margin-top: 4px; }
.sa-what { font-weight: 600; }
.sa-when { grid-column: 2; display: flex; flex-direction: column; }
.sa-day { color: var(--ink-3); font-weight: 600; font-size: 12px; display: inline-block; min-width: 70px; }
.sa-date { font-variant-numeric: tabular-nums; }
/* Below 1600 px wide the schedule sits above the tab as a strip (sticky), so wide tables keep their room. */
@media (max-width: 1599px) {
  .with-aside, .with-aside.aside-closed { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  /* App 0.11.2: the strip sits above the tab and scrolls away with the page (it used to stay stuck on top and
     cover the crew grid's dates and first rows). */
  .sched-aside { order: -1; max-height: none; position: static; padding: 8px 10px; }
  .sched-aside .sa-head { margin-bottom: 4px; }
  .sched-aside > a.small { display: none; }
  .sched-aside .disc-chips { margin-bottom: 6px; }
  .sa-list { flex-direction: row; flex-wrap: wrap; gap: 4px 6px; max-height: 128px; overflow-y: auto; margin-bottom: 0; }
  .sa-row { display: inline-grid; grid-template-columns: 10px auto; border: 1px solid var(--line-2); border-radius: 8px; padding: 3px 8px; gap: 0 6px; }
  .sa-when { flex-direction: row; flex-wrap: wrap; gap: 0 8px; }
  .sa-day { min-width: 0; }
}
@media (max-width: 820px) { .sched-aside { position: static; } }
/* Drag to sort */
.drag-handle { border: 0; background: transparent; color: var(--ink-3); cursor: grab; padding: 2px 4px; font-size: 13px; letter-spacing: -3px; line-height: 1; border-radius: 4px; flex: none; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); background: var(--hover); }
.dragging { opacity: 0.5; }
.handle-cell { width: 1%; padding-right: 0 !important; }
.note-list { list-style: none; padding-left: 0; }
.note-row .note-body { flex: 1; min-width: 0; }
.doc-tile { position: relative; }
.doc-tile > .drag-handle { position: absolute; top: 2px; left: 2px; }
.add-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.add-row .ta-wrap { flex: 1; min-width: 220px; }
.inline-sel { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--ink-2); }
.inline-sel select { padding: 4px 8px; }
/* Crew list (Notion-like): a color band by discipline */
.crew-table tr.crew-row td:first-child { box-shadow: inset 4px 0 0 var(--dc); }
.crew-table tr.crew-row { background: color-mix(in srgb, var(--dc) 7%, var(--panel)); }
.crew-table tr.open-pos { background: color-mix(in srgb, var(--dc) 3%, var(--panel)); }
.crew-table tbody.grp-head td { padding: 10px 12px 6px; border-bottom: 2px solid var(--dc); background: var(--panel); font-weight: 700; }
.crew-table .grp-name { font-family: var(--font-head); font-size: 19px; font-weight: 400; letter-spacing: 0.03em; }
.crew-tools { gap: 10px; flex-wrap: wrap; }
/* App 0.13.0 (Round 7): crew groups. A colored bar down the left of each group header ties a department or team to
   its prep labor group, which sits right under it, indented, with the same color. Teams have their own groups. */
.crew-table.grouped tbody.grp-head td { border-bottom: 2px solid var(--dc); box-shadow: inset 4px 0 0 var(--dc); }
.crew-table .grp-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crew-table .grp-tools { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; font-weight: 400; }
.crew-table.grouped tbody.grp-prep td { padding-top: 6px; padding-left: 34px; border-bottom-style: dashed; box-shadow: inset 4px 0 0 var(--dc), inset 22px 0 0 var(--panel), inset 26px 0 0 var(--dc); }
.crew-table tbody.grp-prep .grp-name { font-size: 16px; }
.crew-table .grp-tie { color: var(--dc); font-weight: 700; font-size: 16px; }
.crew-table tbody.grp-prep-rows tr.crew-row td:first-child { box-shadow: inset 4px 0 0 var(--dc), inset 22px 0 0 color-mix(in srgb, var(--dc) 7%, var(--panel)), inset 26px 0 0 var(--dc); padding-left: 30px; }
.crew-table tbody.grp-prep-rows tr.open-pos td:first-child { box-shadow: inset 4px 0 0 var(--dc), inset 22px 0 0 color-mix(in srgb, var(--dc) 3%, var(--panel)), inset 26px 0 0 var(--dc); }
.crew-table tr.grp-empty td { padding: 10px 12px 10px 16px; box-shadow: inset 4px 0 0 var(--dc, var(--line-2)); }

/* Crew schedule grid */
/* isolation keeps the grid's frozen layers (date row, schedule rows, Position and Name) inside the grid box, so
   nothing outside it can slide between them (App 0.11.2). */
.grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-height: 70vh; background: var(--panel); position: relative; isolation: isolate; }
.crew-grid { border-collapse: separate; border-spacing: 0; font-size: 11.5px; width: max-content; }
.crew-grid th, .crew-grid td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; height: 30px; }
.crew-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--soft); }
.crew-grid .gc-sticky { position: sticky; z-index: 2; background: var(--panel); text-align: left; padding: 4px 8px; white-space: nowrap; font-weight: 600; }
.crew-grid thead .gc-sticky { z-index: 4; background: var(--soft); }
.crew-grid .gc-pos { left: 0; min-width: 130px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.crew-grid .gc-name { left: 130px; min-width: 130px; box-shadow: 1px 0 0 var(--line); }
.crew-grid tr.gc-sched .gc-pos, .crew-grid tr.gc-group .gc-pos { box-shadow: inset 4px 0 0 var(--dc, var(--line)), 1px 0 0 var(--line); }
.crew-grid tr.gc-person .gc-pos { box-shadow: inset 4px 0 0 var(--dc); }
.crew-grid tr.gc-group th { font-family: var(--font-head); font-weight: 400; font-size: 16px; letter-spacing: 0.03em; padding-top: 8px; }
.gc-day { min-width: 58px; text-align: center; padding: 3px 2px !important; }
.gc-day span { display: block; line-height: 1.25; }
.gc-dow { color: var(--ink-3); font-weight: 600; }
.gc-md { font-weight: 700; color: var(--ink); }
.crew-grid .wk { background-color: var(--line-2); }
.crew-grid thead th.today { box-shadow: inset 0 -3px 0 var(--accent); }
.crew-grid td { text-align: center; }
.gc-btn { width: 100%; height: 100%; min-height: 29px; border: 0; background: transparent; padding: 2px; cursor: pointer; font: inherit; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.gc-btn:hover, .gc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gc-ev { display: inline-block; background: var(--ec); color: #fff; border-radius: 4px; padding: 2px 4px; font-weight: 700; white-space: nowrap; max-width: 56px; overflow: hidden; text-overflow: ellipsis; }
.crew-grid tr.gc-person td.in { background: color-mix(in srgb, var(--dc) 14%, var(--panel)); }
.crew-grid tr.gc-person td.in.wk { background: color-mix(in srgb, var(--dc) 20%, var(--panel)); }
.gc-work { color: var(--ink-2); font-weight: 600; }
.gc-lbl { color: var(--ink); font-weight: 700; font-style: italic; }
.gc-off { color: var(--ink-3); font-weight: 700; text-decoration: line-through; }
.pop-menu { position: fixed; z-index: 120; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.pop-menu button { border: 0; background: transparent; color: var(--ink); text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; }
.pop-menu button:hover, .pop-menu button:focus-visible { background: var(--hover); }
.pm-html { padding: 6px 10px; font-size: 13px; }
.pm-html input { width: 100%; margin-top: 4px; }
/* Trucking and hotels */
.suggested { color: var(--ink-2); font-style: italic; }
.sugg-btn { display: block; margin-top: 4px; font-size: 12.5px; text-align: left; }
.hotel-block { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; }
.hotel-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.hotel-name { font-size: 15px; }
.conf-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.form-row.wrap3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
@media (max-width: 820px) { .form-row.wrap3 { grid-template-columns: minmax(0, 1fr); } }
/* Browse all contacts */
.bulk-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.bulk-head .search { flex: 1; }
.bulk-list { max-height: 58vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.bulk-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
.bulk-row.picked { background: var(--accent-soft); }
.bigcal-extra { margin-top: 12px; display: grid; gap: 8px; }
.bigcal-extra textarea { min-height: 54px; }
.crew-table .email-cell { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.crew-table .email-cell a { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.crew-table td { vertical-align: middle; }
.crew-table td[data-l="Position"] b { white-space: nowrap; }
.crew-table .email-cell { flex-wrap: nowrap; }
.crew-table .email-cell a { max-width: 150px; }
@media (max-width: 1599px) { .crew-table .email-cell a { max-width: 130px; } }
.crew-table th, .crew-table td { padding-left: 7px; padding-right: 7px; }
.crew-table .copy-btn { padding: 1px 6px; font-size: 11px; }
.crew-table .avatar { display: none; }
@media (max-width: 820px) { #backLabel { display: none; } .back-btn { padding-left: 10px; padding-right: 10px; } }

/* ---------- App 0.10.0 (Build Session 14, Gabe's Round 4) ---------- */
/* Show Home: Show info and Order numbers beside the schedule. Order numbers fill down to the schedule panel's
   bottom and never past it (show-r4.js fitOrders hides what doesn't fit and says "N more"). */
.home-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.home-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-right { display: flex; flex-direction: column; min-width: 0; }
.home-right > .key-dates { flex: 1 1 auto; }
.orders-fit { flex: 1 1 0; height: 0; min-height: 190px; display: flex; flex-direction: column; overflow: hidden; }
.orders-fit .order-list { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.orders-fit .order-add { flex: none; }
.orders-more { flex: none; align-self: flex-start; margin-top: 6px; }
@media (max-width: 820px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
  .orders-fit { flex: none; height: auto; min-height: 0; }
  .orders-fit .order-list { flex: none; overflow: visible; }
}
.home-grid .docs-card .doc-tiles { margin-top: 2px; }
/* Order numbers: the number on the left in its own column, then what it's for, then the shop. */
.order-row { justify-content: flex-start; padding: 6px 8px; }
.order-row > .row-btn { margin-left: auto; }
.order-main { display: grid; grid-template-columns: minmax(8.5ch, max-content) minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; flex: 1 1 auto; text-align: left; }
.order-num { text-align: left; white-space: nowrap; }
.order-desc { min-width: 0; overflow-wrap: anywhere; }
.order-shop { white-space: nowrap; }
.order-shop:empty { display: none; }
/* Dates on Show Home: Discipline, Date, Event. */
.kd-row2.kd-r4 { grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.4fr); align-items: start; }
.kd-row2.kd-r4.has-disc { grid-template-columns: minmax(78px, 0.55fr) minmax(150px, 0.9fr) minmax(0, 1.4fr); }
.kd-r4 .kd-when { align-items: flex-start; text-align: left; }
.kd-r4 .kd-what { display: block; }
.kd-r4 .kd-what .kd-dot { display: inline-block; margin: 0 6px 0 0; vertical-align: 0; }
.kd-r4 .kd-disc { min-width: 0; }
.disc-tags { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.kd-combine { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0 8px; }
/* Every row's columns line up: the list sets the widths (as wide as the widest date), each row uses them. */
@supports (grid-template-columns: subgrid) {
  .kd-list2:has(> .kd-r4) { display: grid; grid-template-columns: max-content minmax(0, 1fr); }
  .kd-list2:has(> .kd-r4.has-disc) { grid-template-columns: max-content max-content minmax(0, 1fr); }
  .kd-list2 > .kd-row2.kd-r4 { grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 14px; }
  .kd-list2 > .muted { grid-column: 1 / -1; }
}
.kd-r4 .kd-when { white-space: nowrap; }
@media (max-width: 820px) {
  .kd-list2:has(> .kd-r4), .kd-list2:has(> .kd-r4.has-disc) { display: flex; }
  .kd-row2.kd-r4, .kd-row2.kd-r4.has-disc, .kd-list2 > .kd-row2.kd-r4 { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kd-r4 .kd-when { white-space: normal; }
}
/* The event window: prompts as small text under the label; Venue and Shop one click away. */
.form .hint-below { display: block; font-size: 12px; margin-top: 1px; }
.loc-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -4px; }
/* Calendar pop-up: the start date outlined while picking "Through". */
.bigcal-day.anchor { box-shadow: inset 0 0 0 2px var(--accent); border-color: var(--accent); }
.bigcal-day.anchor.on { box-shadow: inset 0 0 0 2px var(--btn-ink); }
/* Duplicate: the row Cmd+D (Ctrl+D) copies. */
tr.row-sel > td { background: var(--accent-soft); }
.order-row.row-sel, li.row-sel, .doc-tile.row-sel { box-shadow: 0 0 0 2px var(--accent); border-radius: 8px; }
/* Shows list: click a heading to sort. */
.th-sort { display: inline-flex; align-items: center; gap: 4px; }
.th-sort.on { color: var(--ink); }
.th-arrow { font-size: 9px; min-width: 9px; }

/* ---------- App 0.11.0 (Build Session 15, Gabe's notes after 0.10.0) ---------- */
/* The check mark on the accent color: white in Light, near black in Dark (the dark accent is a light blue). */
:root { --check-ink: #ffffff; }
:root[data-theme="dark"] { --check-ink: #0b1320; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --check-ink: #0b1320; } }
/* Item 4: one checkbox look everywhere, drawn by the app so it is the same in the Mac window, on Windows and in a
   browser, and clear in Light and Dark. A ticked box is filled with the accent color and has a white check. */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px !important; height: 18px; min-width: 18px; padding: 0 !important; margin: 0; vertical-align: middle;
  border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--field); cursor: pointer;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before { content: ""; width: 10px; height: 10px; transform: scale(0); background: var(--check-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; transform: scale(0); background: var(--check-ink); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .6; cursor: default; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.todo input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
/* Option lists (multi selects in forms, in a cell, in the pick window): each option is a tile with its checkbox; a
   picked one is tinted and bold, so what is picked shows at a glance. */
.checks, .inl-checks { gap: 6px; }
.checks label, .inl-checks label, .pick-grid .opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; line-height: 1.25; }
.checks label:hover, .inl-checks label:hover, .pick-grid .opt:hover { border-color: var(--line-strong); }
.checks label:has(input:checked), .inl-checks label:has(input:checked), .pick-grid .opt.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.checks { max-height: 260px; }
.inl-checks .inl-new { flex: 1 1 100%; }
.pub-item:has(input) { display: flex; align-items: center; gap: 8px; }
/* A choice in a small menu (Working / Off this day): a round mark, filled for the current one. */
.opt-mark { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 50%; display: inline-grid; place-content: center; margin-right: 8px; vertical-align: -3px; }
.pop-menu .pm-choice { display: flex; align-items: center; }
.pop-menu .pm-choice.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pop-menu .pm-choice.on .opt-mark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }

/* Item 2: the pick window (4Wall location, PMs): big enough for every option, no scrolling. */
.pick-wrap { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 85; padding: 16px; }
.pick-win { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px 20px;
  width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.pick-grid .opt { padding: 9px 12px; font-size: 14px; }
.pick-group { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.pick-sum { min-height: 18px; }
.pick-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: var(--field); }
.pick-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

/* Item 1: names stay on one line (each name wraps as a whole). */
.nm { white-space: nowrap; }
.names { display: inline-flex; flex-wrap: wrap; column-gap: 0; row-gap: 2px; }
.names .nm:not(:last-child)::after { content: ","; margin-right: 4px; }
.home-left .kv { grid-template-columns: max-content minmax(0, 1fr); }
.chip { white-space: nowrap; }

/* Item 7: an email or cell is a link that opens a small menu. */
.contact-link { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
/* Item 5: the Published column shows a check mark only. */
.pub-mark { color: var(--ok); font-weight: 700; font-size: 15px; }
.shows-table td.pub-cell, .shows-table th:last-child { text-align: center; width: 1%; white-space: nowrap; }
/* Items 8 to 12: Crew tab. */
.labor-note { border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--ink); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; line-height: 1.45; }
.labor-note b { color: var(--warn); }
.crew-table .idx-cell, .crew-table th.idx-cell { width: 1%; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; padding-right: 6px; white-space: nowrap; }
.crew-table .contact-link { display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.crew-table td[data-l="Cell"] .contact-link { max-width: none; }
.dept-chip { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.calls-table td { vertical-align: top; }
.tab-note { margin: 0 0 10px; }
/* Items 13 to 15: the crew schedule grid (grid.js). The discipline schedule rows are frozen under the date row and
   colored all the way across (white text on the discipline color, which passes 4.5:1 in Light and Dark). */
.crew-grid thead th { z-index: 4; }
.crew-grid thead .gc-sticky { z-index: 7; }
.crew-grid .gc-top { position: sticky; z-index: 3; height: 30px; box-sizing: border-box; }
.crew-grid tr.gc-sched td, .crew-grid tr.gc-sched th { background: var(--dc); color: var(--on-color); font-weight: 700; border-bottom-color: color-mix(in srgb, var(--dc) 70%, #000); border-right-color: color-mix(in srgb, var(--dc) 80%, #000); }
.crew-grid tr.gc-sched th.gc-sticky { z-index: 6; box-shadow: 1px 0 0 var(--line); }
.crew-grid tr.gc-sched td.wk { background: color-mix(in srgb, var(--dc) 82%, #000); }
.crew-grid tr.gc-sched td { padding: 2px 4px; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.crew-grid td.gc-cell { padding: 2px 4px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; cursor: cell; position: relative; font-weight: 600; color: var(--ink); }
/* A day off on a crew line (App 0.11.3, Gabe): solid dark grey, so it stands out from scheduled days, empty days and weekends. */
.crew-grid tr.gc-person td.gc-cell.k-off, .crew-grid tr.gc-person td.gc-cell.k-off.wk { background-color: var(--day-off-bg); color: var(--day-off-ink); }
/* Total days (App 0.11.3): frozen on the right. */
.crew-grid .gc-total { position: sticky; right: 0; z-index: 2; background: var(--panel); text-align: center; min-width: 64px; padding: 2px 6px; font-weight: 700; color: var(--ink); box-shadow: -1px 0 0 var(--line); white-space: nowrap; }
.crew-grid thead .gc-total { z-index: 7; background: var(--soft); font-size: 11px; color: var(--ink-2); }
.crew-grid tr.gc-sched td.gc-total { z-index: 6; background: var(--panel); }
.crew-grid tr.gc-grand th, .crew-grid tr.gc-grand td { border-top: 2px solid var(--line); font-weight: 700; }
.crew-grid td.gc-cell.k-label { font-style: italic; }
.crew-grid td.gc-cell.differs { box-shadow: inset 0 0 0 1.5px var(--warn); }
.crew-grid td.gc-cell.k-work:not(.differs) { color: var(--ink-2); }
.crew-grid td[data-k]:focus { outline: none; }
.crew-grid td.sel { box-shadow: inset 0 0 0 2px var(--accent) !important; background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); color: var(--accent-ink); }
.crew-grid tr.gc-sched td.sel { box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 5px var(--dc) !important; background-image: none; color: var(--on-color); }
.crew-grid tr.gc-group th { color: var(--ink); box-shadow: inset 4px 0 0 var(--dc), 1px 0 0 var(--line); }
/* App 0.13.0: a team or prep labor group inside a discipline on the grid (same color bar; prep labor indented). */
.crew-grid tr.gc-subgroup th { color: var(--ink-2); font-weight: 700; font-size: 11.5px; height: 24px; padding-left: 12px; box-shadow: inset 4px 0 0 var(--dc), 1px 0 0 var(--line); }
.crew-grid tr.gc-subgroup.gc-subprep th { padding-left: 24px; box-shadow: inset 4px 0 0 var(--dc), inset 14px 0 0 var(--panel), inset 17px 0 0 var(--dc), 1px 0 0 var(--line); }
.crew-grid tr.gc-subgroup td { height: 24px; }
.gc-edit { width: 100%; min-width: 90px; height: 26px; border: 0; outline: 2px solid var(--accent); background: var(--field); color: var(--ink); font: inherit; font-weight: 600; padding: 0 4px; }
.gc-call { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.gc-prep { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.grid-filter { margin: 4px 0 8px; }
.grid-help { margin-bottom: 6px; }
/* Item 16: truck lines. */
.truck-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.time-pill { display: inline-block; border-radius: 12px; padding: 1px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent); }
.truck-loc { color: var(--ink-2); margin-top: 2px; }

/* App 0.11.2: the grid's Unassigned group is flagged; a line opened from the Crew list's days-off note is highlighted. */
.crew-grid tr.gc-unassigned th { color: var(--warn); }
.crew-grid .gc-flag { font-family: inherit; font-size: 11px; letter-spacing: 0; vertical-align: middle; margin-left: 6px; }
.crew-grid tr.gc-focus th.gc-sticky { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); box-shadow: inset 4px 0 0 var(--accent), 1px 0 0 var(--line); }
.crew-grid tr.gc-focus td { box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
/* The Crew list's days-off note under a line's dates. */
.off-note { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-family: inherit; }
.off-note:hover, .off-note:focus-visible { color: var(--ink); }

/* ---------- App 0.12.0 (Build Session 19) ---------- */
/* Time picker (public/js/timepick.js). App 0.13.0: iPhone alarm style wheels; kept the same as TIME_PICK_CSS there. */
.time-pick {
  position: fixed;
  z-index: 1100;
  width: 236px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  padding: 8px 8px 6px;
  user-select: none;
  -webkit-user-select: none;
}
.time-pick[hidden] { display: none; }
.tw-wheels {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 238px;
  perspective: 600px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.tw-band {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 18px);
  height: 36px;
  border-radius: 10px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}
.tw-wheel {
  position: relative;
  overflow: hidden;
  cursor: ns-resize;
  touch-action: none;
  transform-style: preserve-3d;
}
.tw-item {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 17px);
  height: 34px;
  line-height: 34px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  backface-visibility: hidden;
  will-change: transform;
}
.tw-item::before { content: attr(data-v); }
.tw-item.on { color: var(--ink); font-weight: 600; }
.tw-h .tw-item { text-align: right; padding-right: 14px; }
.tw-m .tw-item { text-align: center; }
.tw-ap .tw-item { text-align: left; padding-left: 10px; font-size: 20px; }
.tw-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.tw-btn { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.tw-btn:hover { background: var(--hover); }
.tw-done { color: var(--accent); }
input.time-input { font-variant-numeric: tabular-nums; }
input.time-input.bad { border-color: var(--danger); outline-color: var(--danger); }
/* Documents & Links tiles: a service icon in a soft square of its color, the name, and what it is. */
.doc-tiles { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.doc-tile { border-radius: 12px; padding: 12px 8px 8px; transition: border-color .12s, box-shadow .12s, transform .12s; box-shadow: inset 0 3px 0 color-mix(in srgb, var(--lc, var(--accent)) 70%, transparent); }
.doc-tile:hover { border-color: color-mix(in srgb, var(--lc, var(--accent)) 60%, var(--line)); box-shadow: inset 0 3px 0 var(--lc, var(--accent)), 0 4px 14px rgba(0, 0, 0, .12); transform: translateY(-1px); }
.doc-ico { width: 52px; height: 52px; border-radius: 14px; position: relative; background: color-mix(in srgb, var(--lc, var(--accent)) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--lc, var(--accent)) 30%, var(--line)); }
.doc-ico svg { width: 32px; height: 32px; display: block; }
.doc-badge { position: absolute; right: -6px; bottom: -5px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; font-size: 9.5px; font-weight: 800; padding: 0 4px; line-height: 15px; letter-spacing: .02em; }
.doc-kind { font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.doc-tile.doc-add { box-shadow: none; }
/* Contacts on a show: cell, email and Role edited right in the list. */
.inline-in { width: 100%; min-width: 110px; border: 1px solid transparent; background: transparent; color: var(--ink); font: inherit; padding: 4px 6px; border-radius: 6px; }
.inline-in:hover { border-color: var(--line); background: var(--panel); }
.inline-in:focus { border-color: var(--accent); background: var(--panel); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.inline-in::placeholder { color: var(--ink-3); }
.inline-in.saved { border-color: var(--ok-line); background: var(--ok-soft); }
.inline-in[aria-invalid="true"] { border-color: var(--danger); }
/* Show header: the dates only, on the left. */
.facts.facts-left { justify-content: flex-start; }
/* Crew: take the person off but keep the position. */
.remove-crew { margin: 2px 0 6px; color: var(--ink-2); font-size: 13px; }
.btn.btn-remove-crew { display: block; width: 100%; padding: 12px 14px; font-size: 15px; font-weight: 800; letter-spacing: .04em; background: var(--warn-soft); color: var(--warn); border: 2px solid var(--warn-line); border-radius: 10px; cursor: pointer; }
.btn.btn-remove-crew:hover { background: color-mix(in srgb, var(--warn-soft) 70%, var(--warn-line)); }
.remove-crew-note { margin-top: 6px; color: var(--ink-2); }
/* Hotels: one view grouped by hotel; Hotels, Flights and Rental cars fold up. */
.hotel-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.hotel-name-big { font-size: 21px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.hotel-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.fold-btn { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; width: 26px; height: 26px; border-radius: 6px; margin-right: 4px; padding: 0; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.fold-btn:hover, .fold-btn:focus-visible { background: var(--hover); color: var(--ink); }
.fold-card.folded h3 { margin-bottom: 0; }
.grouped tbody.grp-head td { padding: 10px 12px 6px; border-bottom: 2px solid var(--line-strong); background: var(--panel); font-weight: 700; }
/* Trucking */
.tk-sum { text-transform: none; letter-spacing: 0; margin-left: 6px; font-family: var(--font-body, inherit); font-size: 12px; }
.tk-pocs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; }
.tk-poc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--soft); min-width: 0; }
.tk-poc-h { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 4px; }
.tk-poc-p { position: relative; padding: 4px 26px 4px 0; border-top: 1px solid var(--line-2); font-size: 13px; overflow-wrap: anywhere; }
.tk-poc-p:first-of-type { border-top: 0; }
.tk-poc-x { position: absolute; right: 0; top: 4px; }
/* App 0.14.0 (Gabe's trucking redesign, mockup B): one row per truck, the truck then its four steps side by side.
   Fits the card's width with no side scrolling; narrower cards stack the steps two by two, then one per line. */
.truck-card { container-type: inline-size; }
.truck-card > h3 { flex-wrap: wrap; }
.truck-card > h3 .h3-links { margin-left: auto; justify-content: flex-end; }
.tk-rows { display: grid; gap: 8px; }
.tk-head, .tk-row { display: grid; grid-template-columns: minmax(150px, 1.15fr) repeat(4, minmax(0, 1fr)); gap: 6px; }
.tk-head > div { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 0 8px; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }
.tk-row { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--panel); }
.tk-row.row-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.tk-row.all-done { background: var(--ok-soft); border-color: var(--ok-line); }
.tk-truck { min-width: 0; padding: 4px 6px; display: flex; flex-direction: column; gap: 4px; }
.tk-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-name { font: inherit; font-weight: 800; font-size: 14px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.tk-name:hover { color: var(--accent); text-decoration-color: currentColor; }
.tk-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tk-dept { display: inline-block; border-radius: 10px; padding: 0 8px; margin-right: 4px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--dc) 16%, var(--panel)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--dc) 45%, var(--line)); white-space: nowrap; }
.tk-color { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 11.5px; border: 1px dashed var(--line); color: var(--ink-2); }
.tk-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.tk-prog { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: auto; }
.tk-prog > span { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .2s; }
.tk-step { min-width: 0; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; overflow-wrap: anywhere; background: var(--panel); }
.tk-step.done { background: var(--ok-soft); border-color: var(--ok-line); }
.tk-step-lbl { display: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.tk-when { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tk-when:hover { color: var(--accent); }
.tk-place { color: var(--ink-2); }
.tk-drv { color: var(--ink); }
.tk-drv-n { font-weight: 600; }
.tk-pill-btn { background: none; border: 0; padding: 0; cursor: pointer; align-self: flex-start; margin-top: 2px; border-radius: 10px; }
.tk-pill { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; background: color-mix(in srgb, var(--dc) 16%, var(--panel)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--dc) 50%, var(--line)); white-space: nowrap; align-self: flex-start; margin-top: 2px; }
.tk-pill-btn .tk-pill { margin-top: 0; }
.tk-pill-btn:hover .tk-pill { border-color: var(--accent); }
.tk-step.done .tk-pill { background: var(--ok); color: var(--panel); border-color: var(--ok); }
#recForm label.tk-follow input { background: var(--soft); color: var(--ink-2); }
/* App 0.14.1: "Uses the Load at shop driver. [Change driver]" under Deliver to venue and Back at shop. */
.tk-follow-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 10px; }
@container (max-width: 860px) {
  .tk-head { display: none; }
  .tk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-truck { grid-column: 1 / -1; }
  .tk-step-lbl { display: block; }
}
@container (max-width: 460px) { .tk-row { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .tk-pocs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tk-pocs { grid-template-columns: 1fr; } .hotel-name-big { font-size: 18px; } }

/* App 0.15.0: photos, the photo window, Save contact, the Reports tab. */
img.avatar-photo { object-fit: cover; background: var(--soft); padding: 0; border: 0; }
.ph-head { position: relative; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; flex: none; line-height: 0; }
.ph-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ph-head .ph-cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); font-size: 12px; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.record-head .btn + .btn { margin-left: 6px; }
.ph-wrap { display: grid; gap: 12px; justify-items: start; }
.ph-drop { display: block; position: relative; width: 100%; border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-2); cursor: pointer; background: var(--soft); }
.ph-drop.over { border-color: var(--accent); }
.ph-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ph-crop { display: grid; gap: 10px; justify-items: center; width: 100%; }
.ph-crop[hidden] { display: none; }
.ph-stage { position: relative; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; cursor: grab; touch-action: none; }
.ph-stage:active { cursor: grabbing; }
.ph-stage canvas { display: block; }
.ph-mask { position: absolute; inset: 0; pointer-events: none; }
.ph-mask.circle { border-radius: 50%; box-shadow: 0 0 0 400px rgba(0, 0, 0, .5); }
.ph-mask.square { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); }
.ph-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.ph-zoom { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.vc-btn { font-size: 12px; width: auto; padding: 0 6px; }
.tab .new-count { background: var(--danger, #c62828); color: #fff; }
.reports-table tr[data-report]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rp { display: grid; gap: 10px; }
.rp-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.rp-h { margin: 10px 0 0; font-size: 15px; }
.rp-kv { grid-template-columns: minmax(160px, 38%) 1fr; }
.rp-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.rp-file { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px; word-break: break-all; }
.rp-file img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.rp-doc { grid-template-columns: 46px 1fr; align-items: center; }
.rp-ext { width: 46px; height: 46px; border-radius: 6px; display: grid; place-items: center; background: var(--soft); font-weight: 700; font-size: 11px; }
/* Printing an open report prints the report only. */
@media print {
  body:has(.rp) #app { display: none !important; }
  body:has(.rp) #modal { position: static !important; background: none !important; }
  body:has(.rp) #modal .modal { box-shadow: none !important; max-height: none !important; overflow: visible !important; }
  .rp .modal-actions, body:has(.rp) #modalClose { display: none !important; }
}

/* App 0.16.0: 615 HQ users' photos: beside the Home greeting, the agent and PMs on Home show cards and in Show info. */
.home-hello { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.home-hello .page-title { margin-bottom: 0; }
.faces { display: flex; align-items: center; gap: 0; margin-top: 10px; min-width: 0; }
.faces .avatar { border: 2px solid var(--panel); margin-right: -6px; }
.faces .small { margin-left: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-av { display: inline-flex; align-items: center; gap: 6px; }
.person .ph-head .ph-cam { width: 16px; height: 16px; font-size: 9px; right: -5px; bottom: -5px; }

/* App 1.2.0: email and password sign-in, Set up or reset my password, and an Admin's sign-in code. */
.signin-card p { margin: 0; font-size: 14px; line-height: 1.45; }
.signin-card .btn-wide { width: 100%; justify-content: center; padding: 11px 14px; font-size: 15px; }
.signin-reset { text-align: center; font-size: 14px; }
.signin-note { border-top: 1px solid var(--line-2); padding-top: 12px; }
.signin-card .setup-title { margin: 0; }
.signin-reset .link-btn { font-size: 14px; }
.form input.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.12em; text-transform: uppercase; font-size: 16px; }
.code-show { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 34px; font-weight: 700; letter-spacing: 0.14em; text-align: center; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--field); color: var(--ink); user-select: all; }
