/* Call Captain portal — clean, Apple-like, IBM blue accent. Light + dark. */

/* Manrope, self-hosted (CSP: font-src 'self'). SIL Open Font License — see /fonts/OFL-Manrope.txt. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/manrope-latin-800-normal.woff2") format("woff2"); }

:root {
  --accent: #0f62fe;          /* IBM Blue 60 */
  --accent-hover: #0353e9;
  --accent-soft: #edf5ff;     /* IBM Blue 10 */
  --accent-ink: #ffffff;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --line: #e5e5ea;
  --ink: #161616;             /* brand ink */
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --good: #198038;  --good-soft: #defbe6;
  --bad: #da1e28;   --bad-soft: #fff1f1;
  --warn: #8e6a00;  --warn-soft: #fcf4d6;
  --muted-soft: #f2f2f7;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "IBM Plex Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Headings: Manrope 800 (brand), self-hosted above. */
  --head: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --side-w: 248px;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4589ff;        /* IBM Blue 50 */
    --accent-hover: #78a9ff;
    --accent-soft: #0f2a5c;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --line: #38383a;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #8e8e93;
    --good: #42be65;  --good-soft: #0e2a17;
    --bad: #ff8389;   --bad-soft: #3a1214;
    --warn: #f1c21b;  --warn-soft: #332a07;
    --muted-soft: #2c2c2e;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell: sidebar (desktop) / top bar + bottom tabs (phone) ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; color: var(--ink); min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand picture { display: block; line-height: 0; }
.brand .logo { height: 28px; width: auto; display: block; } /* brand kit SVG, never stretched */
.brand small { display: block; font: 500 13px/1.25 var(--font); color: var(--ink-2); }
.spacer { flex: 1; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.big { width: 36px; height: 36px; color: var(--accent); }

.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.side .brand { padding: 0 8px; }
.side .brand .logo { height: 36px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 0; background: none;
  color: var(--ink-2); font: 500 14.5px/1.2 var(--font); cursor: pointer; text-align: left; width: 100%; }
.side-link:hover { background: var(--muted-soft); color: var(--ink); text-decoration: none; }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.side-link.signout { color: var(--ink-2); }
/* Count on a menu link (Sign-ups: how many are still New). */
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--bad); color: var(--surface); font-size: 12px; font-weight: 700; text-align: center; line-height: 18px; }

.main-col { min-width: 0; }
.mtop { display: none; }
.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; }
.sheet-panel { width: 100%; max-height: 80vh; overflow-y: auto; background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; font: 800 18px var(--head); }
.sheet-nav { display: grid; gap: 2px; }
.sheet-link { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  color: var(--ink); font: 500 16px var(--font); width: 100%; text-align: left; cursor: pointer; }
.sheet-link:hover { background: var(--muted-soft); text-decoration: none; }
.sheet-link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- Layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 96px; }
h1 { font: 800 28px/1.15 var(--head); letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font: 800 17px/1.3 var(--head); margin: 0 0 12px; letter-spacing: -.01em; }
.h3 { font: 700 15px/1.3 var(--font); margin: 8px 0 0; }
.sub { color: var(--ink-2); margin: 0 0 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px; }
.stack > * + * { margin-top: 16px; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.tile { padding: 16px; }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tile .num { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile.is-accent .num { color: var(--accent); }
.tile.is-bad .num { color: var(--bad); }
.tile.is-warn .num { color: var(--warn); }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tile .num { font-size: 28px; } }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--muted-soft); padding: 3px; border-radius: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dates { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dates input { width: auto; }

/* ---------- Call list ---------- */
.calls { list-style: none; margin: 0; padding: 0; }
.call { display: grid; grid-template-columns: 112px 1fr auto; gap: 4px 16px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; }
.calls li:first-child .call { border-top: 0; }
.call:hover { background: var(--surface-2); text-decoration: none; }
.call .when { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.call .who { font-weight: 600; }
.call .summary { grid-column: 2 / 4; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.call .badges { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  .call { grid-template-columns: 1fr auto; padding: 14px; }
  .call .when { grid-column: 1 / 3; order: -1; }
  .call .summary { grid-column: 1 / 3; }
}
.list-card { padding: 0; overflow: hidden; }
.empty { padding: 40px 18px; text-align: center; color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--muted-soft); color: var(--ink-2); }
.badge.booked { background: var(--good-soft); color: var(--good); }
.badge.emergency { background: var(--bad-soft); color: var(--bad); }
.badge.transferred { background: var(--accent-soft); color: var(--accent); }
.badge.missed { background: var(--warn-soft); color: var(--warn); }

/* ---------- Call detail ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-weight: 500; }
.detail-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .detail-grid { grid-template-columns: 1fr; } }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--ink-2); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
.summary-text { font-size: 16px; margin: 0; }

.transcript { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; overflow-wrap: anywhere; }
.bubble.agent { align-self: flex-start; background: var(--muted-soft); border-bottom-left-radius: 6px; }
.bubble.caller { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.tool, .bubble.system { align-self: center; max-width: 100%; background: none; color: var(--ink-3); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px dashed var(--line); border-radius: 10px; }
.bubble .who { display: block; font-size: 11px; font-weight: 600; opacity: .7; margin-bottom: 2px; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* ---------- Forms ---------- */
label.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[readonly] { background: var(--muted-soft); color: var(--ink-2); }
textarea { min-height: 76px; resize: vertical; }
.invalid input, .invalid textarea, .invalid select, input.invalid { border-color: var(--bad); }
.err { color: var(--bad); font-size: 12.5px; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 980px; padding: 9px 18px; font-weight: 600; font-size: 14.5px; cursor: pointer; background: var(--accent); color: var(--accent-ink); min-height: 40px; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--muted-soft); color: var(--ink); }
.btn.secondary:hover { background: var(--line); }
.btn.ghost { background: none; color: var(--accent); padding: 6px 10px; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: none; color: var(--bad); padding: 6px 10px; min-height: 32px; }
.btn.small { padding: 6px 12px; min-height: 32px; font-size: 13px; }

.hours { display: grid; grid-template-columns: 56px auto 1fr 1fr; gap: 10px 12px; align-items: center; }
.hours .day { font-weight: 600; }
.hours .closed { grid-column: 3 / 5; color: var(--ink-3); font-size: 14px; }
@media (max-width: 480px) { .hours { grid-template-columns: 44px auto 1fr 1fr; gap: 8px; } }

.switch { position: relative; width: 42px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.rows > .row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.rows > .row + .row { margin-top: 10px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 600; font-size: 14px; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.savebar-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.savebar .status { flex: 1; color: var(--ink-2); font-size: 14px; }
.savebar .status.bad { color: var(--bad); }
.savebar .status.good { color: var(--good); }

.notice { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

/* ---------- Sign-in screens: brand panel + card ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr); }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column;
  background: radial-gradient(60% 50% at 85% 10%, rgba(255,255,255,.18), transparent 70%),
              radial-gradient(50% 50% at 0% 100%, rgba(138,63,252,.35), transparent 70%),
              linear-gradient(150deg, #0f62fe 0%, #0043ce 55%, #002d9c 100%); }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.auth-logo:hover { text-decoration: none; }
.auth-logo img { height: 40px; width: auto; display: block; } /* white brand-kit logo on the blue panel */
.auth-pitch { margin: auto 0; padding: 40px 0; }
.auth-line { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 750; letter-spacing: -.03em; margin: 0 0 36px; max-width: 460px; }
.auth-art { max-width: 420px; }
.auth-svg { width: 100%; height: auto; display: block; overflow: visible; }
.aa-solid { fill: #fff; }
.aa-ink { fill: #0f62fe; }
.aa-ring { fill: none; stroke: #fff; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: aa-ring 2.4s ease-out infinite; }
.aa-r2 { animation-delay: 1.2s; }
.aa-glass { fill: rgba(255,255,255,.16); stroke: rgba(255,255,255,.28); }
.aa-text { fill: #fff; font: 500 14px var(--font, system-ui); }
.aa-card { fill: #fff; }
.aa-day { fill: #edf5ff; }
.aa-day-t { fill: #0f62fe; font: 800 20px var(--font, system-ui); }
.aa-card-t { fill: #161616; font: 650 15px var(--font, system-ui); }
.aa-card-s { fill: #525252; font: 500 12px var(--font, system-ui); }
.aa-ok { fill: #24a148; }
.aa-tick { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.aa-in { opacity: 0; transform-box: fill-box; animation: aa-rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.aa-1 { animation-delay: .2s; } .aa-2 { animation-delay: .8s; } .aa-3 { animation-delay: 1.4s; } .aa-4 { animation-delay: 2s; }
.aa-pop { opacity: 0; transform-box: fill-box; transform-origin: center; animation: aa-pop .5s cubic-bezier(.2,.7,.2,1) 2.6s forwards; }
@keyframes aa-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.9); opacity: 0; } }
@keyframes aa-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aa-pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }

.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { margin-bottom: 20px; }
.auth-card form > * + * { margin-top: 14px; }
.auth-notices:not(:empty) { margin-bottom: 16px; }
.auth-notices a, .notice a { color: inherit; font-weight: 700; text-decoration: underline; }
.btn-block { width: 100%; min-height: 46px; font-size: 15.5px; }

.btn-google { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative;
  border: 1px solid var(--line); border-radius: 980px; background: var(--surface); color: var(--ink); font: 600 15px/1.2 var(--font, system-ui);
  cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn-google:hover { background: var(--muted-soft); }
.btn-google:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-google .g-mark { display: inline-flex; }
.btn-google .soon { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--muted-soft); color: var(--ink-2); }
.btn-google.is-busy .g-mark { animation: spin .9s linear infinite; }

.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field-row { display: flex !important; justify-content: space-between; align-items: baseline; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: 600 13px var(--font, system-ui); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.back-to-signin { margin-top: 18px; font-size: 14px; }
.notice.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.notice.info { background: var(--accent-soft); color: var(--ink); }

.spinner.sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255,255,255,.35); border-top-color: #fff; display: none; }
.btn.is-busy .spinner.sm { display: inline-block; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 18px 20px; flex-direction: row; align-items: center; justify-content: space-between; }
  .auth-pitch { margin: 0; padding: 0; }
  .auth-line { font-size: 14px; font-weight: 600; margin: 0; opacity: .9; max-width: 180px; text-align: right; }
  .auth-art { display: none; }
  .auth-logo img { height: 28px; }
  .auth-main { justify-content: flex-start; padding: 24px 16px 40px; }
  .auth-card { padding: 26px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .aa-ring { display: none; }
  .aa-in, .aa-pop { animation: none; opacity: 1; }
}
.login-signup { text-align: center; margin: 18px 0 0; color: var(--ink-2); font-size: 15px; }
.login-signup a { font-weight: 600; }
.login-back { text-align: center; margin: 10px 0 0; font-size: 14px; }
.login-back a { color: var(--ink-2); }
.login-back a:hover { color: var(--ink); }

/* ---------- Portal v2 components ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px 8px; }
.card-head h2 { margin: 0; }
.card-head .sub { margin: 0; font-size: 13px; }
.tiles.six { grid-template-columns: repeat(6, 1fr); }
.tiles.two { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.tile-hint { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 1180px) { .tiles.six { grid-template-columns: repeat(3, 1fr); } }

.search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; max-width: 460px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-3); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search input { border: 0; outline: none; background: none; flex: 1; min-width: 0; min-height: 42px; color: var(--ink); font-size: 15px; box-shadow: none !important; padding: 0; }

/* Responsive table: a table on wide screens, cards on phones. */
.table-wrap { overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: 14px; }
.dt th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dt td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.dt tbody tr:first-child td { border-top: 0; }
.dt tr.linked { position: relative; cursor: pointer; }
.dt tr.linked:hover td { background: var(--surface-2); }
.dt a.rowlink { color: inherit; }
.dt a.rowlink::after { content: ""; position: absolute; inset: 0; }
.dt a.rowlink:hover { text-decoration: none; }
.dt td a:not(.rowlink) { position: relative; z-index: 1; }
.who2 { display: flex; flex-direction: column; gap: 2px; }
.who2 small { color: var(--ink-2); font-size: 13px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.coming { text-align: center; padding: 40px 20px; }
.coming h2 { margin-top: 10px; }
.coming .sub { max-width: 460px; margin: 0 auto; }

.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.int-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.int-head h2 { margin: 0; }
.int .sub { margin: 8px 0 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--muted-soft); font-size: 14px; }
.pill-x { border: 0; background: none; color: var(--ink-2); font-size: 18px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.pill-x:hover { background: var(--line); color: var(--ink); }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-add input { width: auto; }

/* Usage chart: one series, bars with 4px rounded tops anchored to the baseline, 2px gaps. */
.chart { margin: 0; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 180px auto auto; column-gap: 8px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--ink-3); text-align: right; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: end; height: 180px;
  border-bottom: 1px solid var(--line); background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat; }
.bar-col { position: relative; height: 100%; display: flex; align-items: flex-end; outline: none; }
.bar { display: block; width: 100%; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar-col.future .bar { background: none; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: var(--accent-hover); }
.bar-col:hover::after, .bar-col:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: var(--ink); color: var(--surface); font-size: 13px; padding: 4px 8px; border-radius: 6px; z-index: 2; pointer-events: none; }
.bar-col.future:hover::after { display: none; }
.chart-x { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; font-size: 12px; color: var(--ink-3); padding-top: 4px; }
.chart-table { grid-column: 1 / 3; margin-top: 12px; }
.chart-table summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* ---------- Phase 3: Surge Mode, queue, forms ---------- */
.surge-banner { display: flex; align-items: center; gap: 10px; padding: 8px 24px; background: var(--bad); color: #fff; font-size: 15px; }
.surge-banner a { color: #fff; flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; column-gap: 4px; }
.surge-banner a:hover { text-decoration: underline; }
.surge-banner .ico { width: 20px; height: 20px; }
.btn.light { background: #fff; color: var(--bad); }
.btn.light:hover { background: #ffe8e8; }
.btn.danger-solid { background: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
@media (prefers-color-scheme: dark) { .surge-banner { background: #a2191f; } .btn.danger-solid { background: #da1e28; } }

.surge-top { display: flex; align-items: center; gap: 18px; }
.surge-top h2 { margin: 0 0 4px; font-size: 20px; }
.surge-top .sub { margin: 0; }
.surge-switch { position: relative; flex: none; width: 112px; height: 56px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--line); color: var(--ink-2); font: 800 16px var(--head); transition: background .2s; }
.surge-switch .knob { position: absolute; top: 6px; left: 6px; width: 44px; height: 44px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.surge-switch .label { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }
.surge-switch.on { background: var(--bad); color: #fff; }
.surge-switch.on .knob { transform: translateX(56px); }
.surge-switch.on .label { right: auto; left: 18px; }
.confirm:not(:empty) { border: 2px solid var(--bad); border-radius: 12px; padding: 14px; background: var(--bad-soft); }
.confirm p { margin: 0 0 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check.urgent span { font-weight: 600; color: var(--bad); }
.status-line { font-size: 14px; color: var(--ink-2); min-height: 1em; }
.status-line.bad { color: var(--bad); }
.status-line.good { color: var(--good); }
.queue-head { margin-top: 28px; margin-bottom: 10px; }
.queue-head h2 { margin: 0 0 2px; font-size: 20px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.crud-form { margin-bottom: 16px; border-color: var(--accent); }

.queue { list-style: none; margin: 0; padding: 0; }
.q-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px 20px; padding: 16px 18px; border-top: 1px solid var(--line);
  border-left: 4px solid transparent; }
.q-item:first-child { border-top: 0; }
.q-item.p5 { border-left-color: var(--bad); }
.q-item.p4 { border-left-color: var(--warn); }
.q-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.q-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-who small { color: var(--ink-2); font-size: 13px; }
.prio { flex: none; min-width: 40px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font: 800 15px var(--head); background: var(--muted-soft); color: var(--ink-2); }
.prio.p5 { background: var(--bad); color: #fff; }
.prio.p4 { background: var(--warn-soft); color: var(--warn); }
.prio.p3 { background: var(--accent-soft); color: var(--accent); }
.q-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.q-body .tel { font-size: 16px; }
.q-summary { margin: 0; color: var(--ink-2); }
.q-actions { display: flex; flex-direction: column; gap: 8px; }
.q-actions textarea { min-height: 44px; }
@media (max-width: 820px) { .q-item { grid-template-columns: 1fr; } .tiles.three { grid-template-columns: 1fr; } }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 900px) {
  .layout { display: block; }
  .side { display: none; }
  .mtop { display: flex; align-items: center; position: sticky; top: 0; z-index: 20; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--tabbar-h);
    border: 0; background: none; color: var(--ink-2); font: 600 12px/1.1 var(--font); cursor: pointer; padding: 6px 2px; }
  .tab:hover { text-decoration: none; }
  .tab .ico { width: 24px; height: 24px; }
  .tab[aria-current="page"] { color: var(--accent); }
  main { padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .savebar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tiles.six { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  /* Tables become one card per row. */
  .dt thead { display: none; }
  .dt, .dt tbody, .dt tr, .dt td { display: block; width: 100%; }
  .dt tr { padding: 12px 16px; border-top: 1px solid var(--line); }
  .dt tbody tr:first-child { border-top: 0; }
  .dt td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border: 0; text-align: right; font-size: 15px; }
  .dt td::before { content: attr(data-label); color: var(--ink-2); font-size: 14px; text-align: left; flex: none; }
  .dt td.primary { text-align: left; font-size: 16px; padding-bottom: 6px; }
  .dt td.primary::before { display: none; }
  .dt td.blank { display: none; } /* empty fields take no room on a phone card */
  .dt td .who2 { align-items: inherit; }
  .dt td.primary .who2 { align-items: flex-start; }

  /* Nothing under 14px; every tap target at least 44px. */
  .tile .label, .sub, .badge, .chip, .seg button, .field > span, .field .hint, .hint, .err, .who2 small, .card-head .sub,
  .tile-hint, .call .when, .call .summary, .bubble .who, .toggle, .link-btn, .dt th, .notice { font-size: 14px; }
  .btn, .btn.small, .btn.ghost, .btn.danger, .chip, .seg button, .link-btn, .toggle, .pill-x { min-height: 44px; }
  .btn.small, .brand small, .tab { font-size: 14px; }
  .chip { min-width: 52px; }
  .search, .search input { min-height: 46px; }
  .dt td a:not(.rowlink) { display: inline-flex; align-items: center; min-height: 44px; }
  .tab span { font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
  .surge-banner { padding: 8px 16px; font-size: 14px; flex-wrap: wrap; }
  .surge-top { flex-direction: column; align-items: flex-start; }
  .q-who small, .status-line { font-size: 14px; }
  .q-item { padding: 14px 16px; }
  .q-actions .row-actions { flex-wrap: nowrap; gap: 6px; }
  .q-actions .row-actions .btn { flex: 1 1 0; min-width: 0; padding: 9px 6px; white-space: nowrap; }
  .q-body .tel { width: 100%; }
  .q-body a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
  .tile-hint a, .card-head a, .hint a, .notice a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn-google .soon, .or { font-size: 14px; }
  .btn-google .soon { position: absolute; top: -12px; right: 14px; white-space: nowrap; border: 1px solid var(--line); }
  .auth-logo, .login-signup a, .login-back a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Hours: "Mon [switch]" on one line, opens/closes below, wide enough to show AM/PM. */
  .hours { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; }
  .hours .day { grid-column: 1; padding-top: 10px; }
  .hours .switch { grid-column: 2; justify-self: end; }
  .hours input[type=time] { min-width: 0; }
  .hours .closed { grid-column: 1 / 3; padding-bottom: 6px; }
  .pill-x { min-width: 44px; }
  .switch { width: 52px; height: 44px; }
  .switch span { top: 9px; bottom: 9px; }
  input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], select, textarea { min-height: 44px; font-size: 16px; }
  .call { min-height: 44px; }

  .card { padding: 14px; }
  .chart-x span, .chart-y { font-size: 14px; }
  .page-head .btn { width: 100%; }
  .page-actions { width: 100%; }
}

/* ---------- Dashboard v3: charts, link tiles, Calls filters, follow-up ---------- */
/* Categorical chart colors, fixed per entity (never by rank). Validated set (CVD-safe adjacent
   order; light slots 3–5 are under 3:1, so every donut has a visible labelled legend). */
:root { --k1: #2a78d6; --k2: #eb6834; --k3: #1baf7a; --k4: #eda100; --k5: #e87ba4; --k6: #008300; --k7: #6250d6; --k8: #e34948; --chart-bar: #0f62fe; --chart-grid: #e5e5ea; }
@media (prefers-color-scheme: dark) {
  :root { --k1: #3987e5; --k2: #d95926; --k3: #199e70; --k4: #c98500; --k5: #d55181; --k6: #008300; --k7: #9085e9; --k8: #e66767; --chart-bar: #4589ff; --chart-grid: #38383a; }
}
.donut-seg.k1, .sw.k1 { stroke: var(--k1); background: var(--k1); } .donut-seg.k2, .sw.k2 { stroke: var(--k2); background: var(--k2); }
.donut-seg.k3, .sw.k3 { stroke: var(--k3); background: var(--k3); } .donut-seg.k4, .sw.k4 { stroke: var(--k4); background: var(--k4); }
.donut-seg.k5, .sw.k5 { stroke: var(--k5); background: var(--k5); } .donut-seg.k6, .sw.k6 { stroke: var(--k6); background: var(--k6); }
.donut-seg.k7, .sw.k7 { stroke: var(--k7); background: var(--k7); } .donut-seg.k8, .sw.k8 { stroke: var(--k8); background: var(--k8); }

.tiles.four { grid-template-columns: repeat(4, 1fr); }
a.link-tile { color: inherit; display: block; transition: border-color .15s; }
a.link-tile:hover { text-decoration: none; border-color: var(--accent); }
.pair-tile .num a { color: inherit; } .pair-tile .num a:hover { color: var(--accent); }
.pair-tile .slash { color: var(--ink-3); font-weight: 500; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.chart-card h2 { font-size: 16px; margin: 0 0 12px; }
.empty.small { padding: 18px 0; font-size: 14px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.donut-track { fill: none; stroke: var(--muted-soft); stroke-width: 18; }
.donut-seg { fill: none; stroke-width: 18; cursor: pointer; }
.donut a:hover .donut-seg, .donut a:focus .donut-seg { stroke-width: 22; }
.donut-total { font: 800 26px var(--head); fill: var(--ink); }
.donut-sub { font-size: 11px; fill: var(--ink-2); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: grid; gap: 2px; }
.legend a { display: flex; align-items: center; gap: 8px; color: var(--ink); padding: 6px 4px; border-radius: 8px; min-height: 36px; }
.legend a:hover { background: var(--surface-2); text-decoration: none; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-label { flex: 1; }
.lg-num { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hbars a { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 10px; color: var(--ink); padding: 6px 4px; border-radius: 8px; min-height: 36px; }
.hbars a:hover { background: var(--surface-2); text-decoration: none; }
.hbar-track { height: 10px; background: var(--muted-soft); border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--chart-bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-num { color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.daybars-wrap { position: relative; }
.daybars { display: block; width: 100%; height: 140px; }
.daybars .bar { fill: var(--chart-bar); }
.daybars .hit { fill: transparent; }
.daybars a:hover .bar, .daybars a:focus .bar { fill: var(--accent-hover); }
.daybars .grid { stroke: var(--chart-grid); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.daybars .axis { stroke: var(--line); vector-effect: non-scaling-stroke; }
.axis-max { position: absolute; top: -6px; left: 0; font-size: 12px; color: var(--ink-3); background: var(--surface); padding-right: 4px; font-variant-numeric: tabular-nums; }
.axis-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.seg.tabs button { font-weight: 600; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.filter-select > span { font-size: 12px; }
.filter-select select { width: 100%; }
.chips.applied { flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

button.clip { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 36ch; color: var(--ink); position: relative; z-index: 1; }
button.clip.open { display: block; -webkit-line-clamp: unset; }
button.clip:focus-visible { outline: 2px solid var(--accent); }
.badge.callback { background: var(--warn-soft); color: var(--warn); }
.dt td .fu-cell { display: grid; gap: 6px; position: relative; z-index: 1; }
.fu.compact .row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.fu.compact .btn.small { padding: 3px 7px; font-size: 12px; }
.fu .fu-note textarea { width: 100%; margin-top: 6px; }
.dt td button { position: relative; z-index: 1; }
.tel-link { white-space: nowrap; }
.dt td[data-label="Length"] { white-space: nowrap; }
.dt td[data-label="Result"] .badge { white-space: normal; border-radius: 8px; }
.dt td[data-label="Date/time"] { min-width: 96px; }
.dates input[type=date] { width: auto; } /* beats the generic full-width input rule */
.dt td[data-label="Follow-up"] { min-width: 170px; }
.dt td[data-label="Summary"] { min-width: 160px; }
.fu.compact .btn.small { white-space: nowrap; }
.dt td .fu-cell { justify-items: start; }
.dt td .sub-tel { display: block; font-size: 13px; position: relative; z-index: 1; width: max-content; }
a.play { font-size: 14px; }
audio { width: 100%; margin-bottom: 6px; }

@media (max-width: 1180px) { .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .tiles.four { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  button.clip { max-width: none; text-align: left; }
  .dt td .fu-cell { justify-items: end; }
  .fu.compact .btn.small { min-height: 44px; padding: 6px 12px; font-size: 14px; }
  .hbars a, .legend a { min-height: 44px; }
  .donut-wrap { justify-content: center; }
}

/* ---------- Team, on-call chain, VIPs, critical calls, chat alerts ---------- */
.badge.vip { background: color-mix(in srgb, var(--k7) 16%, transparent); color: var(--k7); letter-spacing: .02em; }
.badge.overdue { background: var(--bad); color: #fff; letter-spacing: .04em; }
.badge.emergency-soft { background: var(--warn-soft); color: var(--warn); }
.who-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stars { color: var(--k4); letter-spacing: 1px; white-space: nowrap; }
.warn-text { color: var(--bad); font-weight: 600; }
.err-text { color: var(--bad); }
.section-title { font-family: var(--head); font-size: 17px; margin: 24px 0 10px; }
.row-actions.wrap { flex-wrap: wrap; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* Follow-up log (append-only) */
.fu-log { display: grid; gap: 8px; margin-top: 12px; }
.fu-log textarea { width: 100%; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 10px; border-radius: 10px; background: var(--muted-soft); font-size: 14px; }
.log .log-note { grid-column: 1 / -1; margin: 0; color: var(--ink-2); white-space: pre-wrap; }

/* On-call chain on a call */
.chain { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.chain-step.answered strong { color: var(--good); }

/* Critical calls board */
.critical-list .q-item.crit { border-left: 4px solid var(--warn); }
.critical-list .q-item.crit.is-overdue { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 5%, var(--surface)); }
.q-head .badges { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* Team cards */
.view-toggle { margin: 12px 16px 0; }
.team-cards { list-style: none; margin: 0; padding: 12px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.team-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.team-card.inactive { opacity: .65; }
.tm-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.tm-phone, .tm-mail { font-size: 14px; }
.skills { display: flex; flex-wrap: wrap; gap: 4px; }
.skill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* On-call rotation (Schedule page) */
.oncall .h3 { margin-top: 8px; }
.ring-default { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.ring-default .h3 { margin: 0; }
.rot-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.rot-dow { font-size: 12px; color: var(--ink-2); text-align: center; padding-bottom: 2px; }
.rot-day { min-height: 54px; border-radius: 8px; padding: 4px 6px; display: grid; align-content: space-between; font-size: 12px; color: #fff; }
.rot-day.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.rot-day.rot-none { background: var(--muted-soft); color: var(--ink-2); }
.rot-num { font-weight: 600; }
.rot-who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc1 { background: var(--k1); } .pc2 { background: var(--k2); } .pc3 { background: var(--k3); } .pc4 { background: var(--k4); }
.pc5 { background: var(--k5); } .pc6 { background: var(--k6); } .pc7 { background: var(--k7); } .pc8 { background: var(--k8); }
.rot-legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.rot-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rot-weeks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rot-week { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.rot-week .row-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rot-week .row-head .btn { margin-left: auto; }
.rot-people { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.rot-create summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pick-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pick-list li .check { flex: 1; }
.ring-list li { cursor: grab; }
.ring-list .grip { color: var(--ink-2); letter-spacing: -2px; }
.ring-list .ring-pos { color: var(--ink-2); min-width: 1.5em; }
.ring-list li strong { flex: 1; }
.order-btns { display: inline-flex; gap: 2px; margin-left: auto; }

/* Chat alerts (Integrations) */
.chat-int .events { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.chat-int .events legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.chat-int input[type="url"] { width: 100%; }

@media (max-width: 720px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-cards, .rot-weeks { grid-template-columns: 1fr; padding-left: 12px; padding-right: 12px; }
  .rot-day { min-height: 44px; padding: 3px 4px; font-size: 11px; }
  .rot-who { font-size: 10px; }
  .fu-log .btn.small, .order-btns .btn, .pick-list .btn, .team-card .btn, .rot-week .btn, .chat-int .btn, .q-actions .btn { min-height: 44px; min-width: 44px; }
  .pick-list li, .chat-int .check, .oncall .check { min-height: 44px; }
  .log li { grid-template-columns: 1fr; }
  /* The Storm Queue keeps its 3 buttons on one line; the follow-up log's 5 wrap two by two. */
  .q-actions .fu-log .row-actions, .fu-log .row-actions { flex-wrap: wrap; }
  .q-actions .fu-log .row-actions .btn, .fu-log .row-actions .btn { flex: 1 1 calc(50% - 6px); }
  .critical-list .q-head { flex-wrap: wrap; align-items: flex-start; }
  .critical-list .q-head .q-who { flex: 1 1 100%; }
  .critical-list .q-head .badges { justify-content: flex-start; flex: 1 1 100%; }
}
