/* Noticeboard
   ------------------------------------------------------------------
   Palette: cool slate paper, deep navy ink, cobalt signal.
   Type: Bricolage Grotesque for display, Hanken Grotesk for interface.
   ------------------------------------------------------------------ */

:root {
  --paper: #ECEFF3;
  --paper-2: #F5F7F9;
  --surface: #FFFFFF;
  --ink: #16202E;
  --ink-2: #4A5567;
  --ink-3: #7E899A;
  --line: #D6DCE3;
  --line-soft: #E7EBF0;
  --signal: #2C49D8;
  --signal-hover: #213CBF;
  --signal-soft: #E3E8FC;
  --rose: #B8304B;
  --rose-soft: #F8E1E6;
  --green: #1B7350;

  --am-bg: #DCE5FE;   --am-fg: #1E3A9C;
  --pm-bg: #D5EDE2;   --pm-fg: #135F40;
  --nt-bg: #E2DEF6;   --nt-fg: #43378A;
  --lv-bg: #F6DEE4;   --lv-fg: #962840;
  --ot-bg: #E6EAEF;   --ot-fg: #4A5567;
  --off: repeating-linear-gradient(135deg, #EEF1F4 0 5px, #E4E8ED 5px 10px);

  --display: 'Bricolage Grotesque', 'Hanken Grotesk', system-ui, sans-serif;
  --ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 15px/1.5 var(--ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 9px;
  font: 600 14px/1 var(--ui);
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ico { margin-left: -3px; }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #BCC4CF; background: #FAFBFC; }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { background: #9C2640; }
.btn-danger-text { background: none; color: var(--rose); padding: 0 4px; }
.btn-danger-text:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; height: 46px; font-size: 15px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: rgba(22, 32, 46, .06); color: var(--ink); }
.icon-btn-sm { width: 30px; height: 30px; color: var(--ink-3); }

.link-btn {
  justify-self: center; margin-top: 4px; padding: 4px 6px;
  border: 0; background: none; color: var(--signal);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.link-btn:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link { color: var(--signal); font-weight: 600; font-size: 14px; text-decoration: none; }

/* ------------------------------------------------------------------
   Form controls
   ------------------------------------------------------------------ */
.field { display: grid; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.field input, .inline-form input, .stack-form textarea, .pin input {
  width: 100%; height: 44px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  font-size: 15px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.stack-form textarea { height: auto; padding: 12px 13px; line-height: 1.6; resize: vertical; max-width: 440px; }
.field input:focus, .inline-form input:focus, .stack-form textarea:focus, .pin input:focus {
  outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft);
}
.field input::placeholder { color: var(--ink-3); }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--signal); cursor: pointer; }
.check small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.check.is-locked { opacity: .55; cursor: not-allowed; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui {
  position: relative; flex: none;
  width: 34px; height: 20px; border-radius: 999px;
  background: #C6CDD7; transition: background-color .18s;
}
.toggle-ui::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(22, 32, 46, .25);
  transition: transform .18s;
}
.toggle input:checked + .toggle-ui { background: var(--signal); }
.toggle input[name=urgent]:checked + .toggle-ui { background: var(--rose); }
.toggle input:checked + .toggle-ui::after { transform: translateX(14px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--signal); outline-offset: 2px; }
.toggle-row { display: flex; align-items: flex-start; margin-top: 20px; }
.toggle-row .toggle-ui { margin-top: 2px; }
.toggle-row small { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #E0E4EA; }
.seg-btn {
  padding: 6px 13px; border: 0; border-radius: 7px; background: transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 32, 46, .14); }
.seg-static { cursor: default; color: var(--ink-3); }

.select select {
  height: 40px; padding: 0 34px 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%234A5567' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: 14px; font-weight: 600; appearance: none; cursor: pointer;
}

.search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; min-width: 270px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }

.form-error { color: var(--rose); font-size: 13.5px; font-weight: 500; }
.form-error:empty { display: none; }

/* ------------------------------------------------------------------
   Sign in
   ------------------------------------------------------------------ */
.login { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(400px, 1fr); min-height: 100vh; }

.login-board {
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
  padding: 40px 52px 48px;
  background: var(--ink); color: #fff;
  overflow: hidden;
}
.login-date, .login-week { color: #8C98AC; font-size: 15px; font-weight: 500; }
.login-week { margin-bottom: 14px; }
.login-org {
  font-family: var(--display);
  font-size: clamp(56px, 7.6vw, 124px);
  font-weight: 600; line-height: .9; letter-spacing: -0.045em;
  overflow-wrap: break-word;
}

.board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 640px; }
.board-day { padding-bottom: 4px; text-align: center; font-size: 12px; font-weight: 600; color: #6F7C92; }
.board-tile {
  display: grid; place-items: center; height: 32px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .92);
  animation: tile-in .55s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i) * 16ms + 120ms);
}
.board-tile[data-kind=am] { background: #2C49D8; }
.board-tile[data-kind=pm] { background: #1D7A57; }
.board-tile[data-kind=night] { background: #5848B8; }
.board-tile[data-kind=leave] { background: #A8344F; }
.board-tile[data-kind=off] { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 5px, rgba(255,255,255,.09) 5px 10px); }
@keyframes tile-in { from { opacity: 0; transform: translateY(-10px); } }

.login-panel { display: grid; place-items: center; padding: 48px 24px; }
.login-form { display: grid; gap: 16px; width: 100%; max-width: 370px; }
.login-form h2 { font-family: var(--display); font-size: 34px; letter-spacing: -0.025em; line-height: 1.05; }
.login-form h2 + .muted { margin-top: -6px; margin-bottom: 4px; color: var(--ink-2); }
.login-form .btn-block { margin-top: 4px; }

.pin { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pin input { height: 62px; padding: 0; text-align: center; font: 600 26px/1 var(--display); border-radius: 10px; }
.shake { animation: shake .38s; }
@keyframes shake {
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}

/* ------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--ink) 252px, transparent 252px); }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--ink); color: #A9B4C3;
}
.side-head { padding: 6px 10px 24px; }
.side-org { font: 600 22px/1.1 var(--display); color: #fff; letter-spacing: -0.015em; }
.side-week { margin-top: 5px; font-size: 12.5px; color: #7F8BA0; }

.side-nav { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; color: #B3BDCB; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link.is-active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-link.is-active .ico { color: #93A6FF; }
.nav-badge {
  margin-left: auto; padding: 1px 7px; border-radius: 999px;
  background: var(--signal); color: #fff; font-size: 11.5px; font-weight: 700;
}
.nav-group { margin: 22px 10px 6px; font-size: 12px; font-weight: 600; color: #6B778C; }

.side-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: auto; padding: 14px 4px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.side-user-text { flex: 1; min-width: 0; line-height: 1.3; }
.side-user-text strong { display: block; color: #fff; font-size: 14px; }
.side-user-text small { display: block; color: #7F8BA0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .icon-btn { color: #A9B4C3; }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { min-width: 0; }
.topbar { display: none; }
.scrim { display: none; }

.view { max-width: 1260px; padding: 44px 52px 88px; outline: none; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 24px;
  margin-bottom: 28px;
}
.page-head h1 {
  font-family: var(--display);
  font-size: clamp(34px, 3.6vw, 50px);
  letter-spacing: -0.03em; line-height: 1;
}
.page-sub { margin-top: 10px; max-width: 62ch; color: var(--ink-2); }

/* Avatars */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 13px; font-weight: 700; letter-spacing: .01em;
}
.avatar[data-hue="0"] { background: var(--am-bg); color: var(--am-fg); }
.avatar[data-hue="1"] { background: #D3ECEF; color: #0E5E66; }
.avatar[data-hue="2"] { background: var(--pm-bg); color: var(--pm-fg); }
.avatar[data-hue="3"] { background: var(--nt-bg); color: var(--nt-fg); }
.avatar[data-hue="4"] { background: #E1E6EC; color: #33415A; }
.avatar[data-hue="5"] { background: var(--lv-bg); color: var(--lv-fg); }
.avatar[data-hue="m"] { background: #2A3547; color: #fff; }
.sidebar .avatar[data-hue="m"] { background: rgba(255, 255, 255, .1); }

/* Pills & status */
.pill {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: #E6EAEF; color: var(--ink-2);
  font-size: 12px; font-weight: 600; line-height: 1.5;
}
.pill-signal { background: var(--signal-soft); color: var(--signal); }
.pill-rose { background: var(--rose-soft); color: var(--rose); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-on { color: var(--green); }

/* ------------------------------------------------------------------
   Panels & toolbars
   ------------------------------------------------------------------ */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; }
.panel-head h2 { font: 600 19px/1.2 var(--display); letter-spacing: -0.01em; }
.panel-foot { margin-top: auto; padding: 13px 22px 15px; border-top: 1px solid var(--line-soft); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; }
.swatch[data-kind=off] { box-shadow: inset 0 0 0 1px var(--line); }

.empty-inline { padding: 22px; color: var(--ink-3); font-size: 14px; }

.empty {
  padding: 64px 24px; text-align: center;
  background: var(--surface); border: 1px dashed #C6CDD7; border-radius: 16px;
}
.empty-art { display: inline-grid; grid-template-columns: repeat(7, 22px); gap: 4px; margin-bottom: 20px; }
.empty-art i { height: 22px; border-radius: 5px; }
.empty-art i:nth-child(1), .empty-art i:nth-child(2) { background: var(--am-bg); }
.empty-art i:nth-child(3) { background: var(--pm-bg); }
.empty-art i:nth-child(4) { background: var(--off); }
.empty-art i:nth-child(5) { background: var(--nt-bg); }
.empty-art i:nth-child(6) { border: 1px dashed var(--line); }
.empty-art i:nth-child(7) { background: var(--lv-bg); }
.empty h2 { font: 600 22px/1.2 var(--display); letter-spacing: -0.015em; }
.empty p { max-width: 46ch; margin: 8px auto 0; color: var(--ink-2); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* Week switcher */
.weekswitch {
  display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.weekswitch-label { min-width: 176px; padding: 0 8px; text-align: center; line-height: 1.25; }
.weekswitch-label strong { display: block; font: 600 15px/1.3 var(--display); }
.weekswitch-label span { display: block; font-size: 12.5px; color: var(--ink-3); }
.weekswitch .btn-sm { margin: 0 2px 0 4px; }

/* ------------------------------------------------------------------
   Shift tiles (roster)
   ------------------------------------------------------------------ */
.tile {
  display: block; width: 100%; height: 34px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px;
  font: 600 13px/32px var(--ui); font-variant-numeric: tabular-nums;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
input.tile { appearance: none; cursor: text; outline: none; }
input.tile::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; }
input.tile:hover { border-color: rgba(22, 32, 46, .2); }
input.tile:focus { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }

[data-kind=am]    { background: var(--am-bg); color: var(--am-fg); }
[data-kind=pm]    { background: var(--pm-bg); color: var(--pm-fg); }
[data-kind=night] { background: var(--nt-bg); color: var(--nt-fg); }
[data-kind=leave] { background: var(--lv-bg); color: var(--lv-fg); }
[data-kind=other] { background: var(--ot-bg); color: var(--ot-fg); }
[data-kind=off]   { background: var(--off); color: var(--ink-3); }
.tile[data-kind=empty] { background: transparent; border: 1px dashed var(--line-soft); }
input.tile[data-kind=empty]:hover { border-color: var(--line); border-style: dashed; }
input.tile[data-kind=empty]:focus { background: var(--surface); border-style: solid; border-color: var(--signal); }
/* The login board uses its own darker tiles */
.login-board [data-kind] { color: rgba(255, 255, 255, .92); }

/* ------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------ */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid th, .grid td {
  padding: 8px 10px; text-align: left; vertical-align: middle;
  background: var(--surface); border-bottom: 1px solid var(--line-soft);
}
.grid th { font-weight: 400; }
.grid thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 10px; background: var(--paper-2); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid tbody tr:hover > * { background: #FAFBFC; }
.grid tfoot th, .grid tfoot td {
  background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 0;
  font-size: 13px; color: var(--ink-2);
}
.grid tfoot th { font-weight: 600; }

.th-sort {
  display: inline-flex; align-items: center; gap: 5px;
  margin: -3px -6px; padding: 3px 6px; border: 0; border-radius: 6px; background: none;
  font: inherit; color: inherit; cursor: pointer;
}
.th-sort:hover { color: var(--ink); background: rgba(22, 32, 46, .05); }
.th-sort .ico { opacity: .35; flex: none; }
.th-sort.is-on { color: var(--ink); }
.th-sort.is-on .ico { opacity: 1; color: var(--signal); }
.th-note { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--ink-3); }

.col-name { position: sticky; left: 0; z-index: 1; min-width: 180px; }
.grid thead .col-name { z-index: 3; }
.col-num { text-align: right !important; width: 72px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col-num .th-sort { flex-direction: row-reverse; }
.col-act { width: 44px; text-align: right !important; white-space: nowrap; }

input.plain {
  width: calc(100% + 16px); margin: 0 -8px; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  font-size: 14px; outline: none;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
input.plain:hover { border-color: var(--line); }
input.plain:focus { border-color: var(--signal); background: var(--surface); box-shadow: 0 0 0 3px var(--signal-soft); }
input.plain::placeholder { color: #B2BAC6; font-weight: 400; }
input.plain::-webkit-calendar-picker-indicator { opacity: 0; }
.strong { font-weight: 600; }

/* Roster grid */
.roster .col-name { border-right: 1px solid var(--line-soft); }
.roster .col-pos { min-width: 104px; color: var(--ink-2); }
.roster .col-name { min-width: 140px; }
.roster .col-day { min-width: 102px; padding: 6px 2px; }
.roster .tile { padding: 0 4px; letter-spacing: -0.015em; }
.roster thead .col-day { padding: 8px 6px; }
.day-h { display: inline-flex; align-items: baseline; gap: 5px; }
.day-h small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.roster thead .is-today { box-shadow: inset 0 -2px 0 var(--signal); }
.roster thead .is-today .day-h, .roster thead .is-today .day-h small { color: var(--signal); }
.roster tbody td.is-today, .roster tbody tr:hover td.is-today { background: #F5F7FF; }
.roster tfoot .col-day { text-align: center; }
.count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Comm allocation */
.comms .col-position { min-width: 120px; }
.comms .col-callsign { min-width: 130px; }
.comms .col-channel { min-width: 170px; }
.comms .col-radio { min-width: 100px; font-variant-numeric: tabular-nums; }
.comms .col-notes { min-width: 220px; color: var(--ink-2); }
.chan-input { display: flex; align-items: center; gap: 8px; }
.chan-input input.plain { margin-left: -6px; }

.chan {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 11px 3px 3px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chan > span:first-child { padding-left: 8px; }
.chan b {
  display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700;
}
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot[data-hue=none] { border: 1.5px dashed var(--line); }

[data-hue="0"].chan { background: var(--am-bg); color: var(--am-fg); }
[data-hue="1"].chan { background: #D3ECEF; color: #0E5E66; }
[data-hue="2"].chan { background: var(--pm-bg); color: var(--pm-fg); }
[data-hue="3"].chan { background: var(--nt-bg); color: var(--nt-fg); }
[data-hue="4"].chan { background: #E1E6EC; color: #33415A; }
[data-hue="5"].chan { background: var(--lv-bg); color: var(--lv-fg); }
[data-hue="0"].chan b, .dot[data-hue="0"] { background: #2C49D8; }
[data-hue="1"].chan b, .dot[data-hue="1"] { background: #138A94; }
[data-hue="2"].chan b, .dot[data-hue="2"] { background: #1F8A5B; }
[data-hue="3"].chan b, .dot[data-hue="3"] { background: #6550C9; }
[data-hue="4"].chan b, .dot[data-hue="4"] { background: #5B6B83; }
[data-hue="5"].chan b, .dot[data-hue="5"] { background: #C23A57; }

.panel-chan { margin-bottom: 20px; }
.chan-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line-soft); }
.panel-head + .chan-strip { border-top: 1px solid var(--line-soft); }
.chan-col { padding: 16px 22px 18px; background: var(--surface); }
.chan-count { margin: 12px 0 2px; font: 600 21px/1.2 var(--display); letter-spacing: -0.01em; }
.chan-names { font-size: 13px; color: var(--ink-3); }

/* People */
.people .col-name { min-width: 230px; }
.person { display: flex; align-items: center; gap: 12px; }
.person strong { display: block; font-size: 14.5px; }
.person small { display: block; font-size: 13px; color: var(--ink-3); }
.perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm {
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.perm-edit { background: var(--signal-soft); border-color: transparent; color: var(--signal); }
.perm-admin { background: var(--ink); border-color: var(--ink); color: #fff; }
.people .col-last { white-space: nowrap; color: var(--ink-2); }

/* ------------------------------------------------------------------
   This week (overview)
   ------------------------------------------------------------------ */
.overview { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.overview .panel { display: flex; flex-direction: column; }
.overview .panel-chan { grid-column: 1 / -1; margin: 0; }

.today-list li {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 22px; border-top: 1px solid var(--line-soft);
}
.today-list li:first-child { border-top: 0; }
.today-who strong { display: block; font-size: 14.5px; }
.today-who small { display: block; font-size: 13px; color: var(--ink-3); }
.callsign { margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.today-away { padding: 12px 22px; border-top: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink-2); }

.news-item {
  display: grid; gap: 4px; padding: 14px 22px;
  border-top: 1px solid var(--line-soft); text-decoration: none;
  transition: background-color .15s;
}
.news-list .news-item:first-child { border-top: 0; }
.news-item:hover { background: var(--paper-2); }
.news-item.is-urgent { box-shadow: inset 3px 0 0 var(--rose); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.news-item strong { font-size: 15.5px; }
.news-snippet { font-size: 14px; color: var(--ink-2); }

/* ------------------------------------------------------------------
   Announcements
   ------------------------------------------------------------------ */
.composer {
  margin-bottom: 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: #B7C1CF; box-shadow: 0 8px 24px -16px rgba(22, 32, 46, .35); }
.composer-title {
  display: block; width: 100%; padding: 18px 20px 4px;
  border: 0; outline: 0; background: transparent;
  font: 600 21px/1.3 var(--display); letter-spacing: -0.01em;
}
.composer textarea {
  display: block; width: 100%; min-height: 84px; padding: 6px 20px 16px;
  border: 0; outline: 0; background: transparent; resize: vertical;
  font-size: 15px; line-height: 1.6;
}
.composer-title::placeholder, .composer textarea::placeholder { color: var(--ink-3); }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line-soft); }
.composer-foot .btn { margin-left: auto; }

.feed { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px;
  padding: 20px 22px; border-top: 1px solid var(--line-soft);
}
.feed > .post:first-child { border-top: 0; }
.post.is-pinned { box-shadow: inset 3px 0 0 var(--signal); }
.post.is-urgent { box-shadow: inset 3px 0 0 var(--rose); }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; font-size: 13.5px; }
.post-head strong { font-size: 14px; }
.post-head time { color: var(--ink-3); }
.post-title { margin: 6px 0 6px; font: 600 20px/1.25 var(--display); letter-spacing: -0.012em; }
.post-body { max-width: 68ch; line-height: 1.6; }
.post-body p + p { margin-top: .75em; }
.post-body a { color: var(--signal); text-underline-offset: 3px; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 2px; align-self: start; margin: -4px -8px 0 0; }

/* ------------------------------------------------------------------
   Settings
   ------------------------------------------------------------------ */
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.set-row { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 16px 40px; padding: 26px 28px; border-top: 1px solid var(--line-soft); }
.set-row:first-child { border-top: 0; }
.set-label h2 { font: 600 17px/1.25 var(--display); }
.set-label p { margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input { flex: 1; max-width: 360px; min-width: 200px; }
.stack-form { display: grid; gap: 14px; }
.stack-form .form-grid { max-width: 520px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { cursor: pointer; }
.prose { max-width: 62ch; color: var(--ink-2); }

/* ------------------------------------------------------------------
   Dialogs
   ------------------------------------------------------------------ */
.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  margin: auto; padding: 0;
  border: 0; border-radius: 16px; background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -24px rgba(10, 18, 32, .5), 0 0 0 1px rgba(22, 32, 46, .06);
}
.modal[open] { animation: pop .18s cubic-bezier(.2, .7, .2, 1); }
.modal::backdrop { background: rgba(14, 22, 34, .5); }
.modal-wide { width: min(780px, calc(100vw - 32px)); }
.modal-sm { width: min(440px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 4px 26px; }
.modal-head h2 { font: 600 23px/1.2 var(--display); letter-spacing: -0.02em; }
.modal-body { padding: 14px 26px 6px; overflow: auto; }
.modal-sm .modal-body { padding-top: 26px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 16px 26px 20px; border-top: 1px solid var(--line-soft); }
.confirm-title { margin-bottom: 8px; font: 600 21px/1.25 var(--display); letter-spacing: -0.015em; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field-span { grid-column: 1 / -1; }

.perm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.perm-head h3 { font: 600 17px/1.2 var(--display); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perm-group { display: grid; align-content: start; gap: 10px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--paper-2); }
.perm-group h4 { font-size: 13.5px; font-weight: 700; }
.modal .form-error { margin-top: 14px; }

.ticket { display: grid; gap: 1px; margin-top: 18px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.ticket div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 18px; background: var(--paper-2); }
.ticket dt { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ticket dd { font: 600 20px/1.2 var(--display); letter-spacing: .005em; user-select: all; overflow-wrap: anywhere; text-align: right; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  padding: 11px 16px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -12px rgba(10, 18, 32, .55);
  animation: toast-in .22s cubic-bezier(.2, .7, .2, 1);
  transition: opacity .25s, transform .25s;
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .view { padding: 36px 32px 80px; }
  .overview { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: 280px;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .7, .2, 1);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(14, 22, 34, .45); }
  .topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: var(--ink); color: #fff;
  }
  .topbar .icon-btn { color: #fff; }
  .topbar .icon-btn:hover { background: rgba(255, 255, 255, .08); }
  .topbar-org { font: 600 18px/1 var(--display); letter-spacing: -0.01em; }

  .login { grid-template-columns: 1fr; }
  .login-board { gap: 28px; padding: 28px 22px 26px; }
  .login-org { font-size: clamp(44px, 13vw, 76px); }
  .board-tile { height: 20px; font-size: 0; }
  .login-panel { place-items: start center; padding: 32px 20px 48px; }
}

@media (max-width: 640px) {
  .view { padding: 26px 16px 72px; }
  .page-head { align-items: flex-start; }
  .page-aside { width: 100%; }
  .weekswitch { width: 100%; }
  .tile { padding: 0 4px; font-size: 12px; }
  .weekswitch-label { flex: 1; min-width: 0; }
  .toolbar .search { flex: 1 1 100%; min-width: 0; }
  .toolbar-actions { margin-left: 0; }
  .form-grid, .perm-grid { grid-template-columns: 1fr; }
  .set-row { grid-template-columns: 1fr; padding: 22px 18px; }
  .roster .col-day { min-width: 104px; }
  .roster .col-name { min-width: 130px; }
  .today-list li { grid-template-columns: 100px minmax(0, 1fr); padding: 10px 16px; }
  .today-list li .chan { grid-column: 2; justify-self: start; }
  .post { grid-template-columns: 32px minmax(0, 1fr); padding: 18px 16px; }
  .post .avatar { width: 32px; height: 32px; font-size: 12px; }
  .post-actions { grid-column: 2; margin: 0 0 0 -8px; }
  .modal-head { padding-left: 20px; }
  .modal-body { padding-left: 20px; padding-right: 20px; }
  .modal-foot { padding-left: 20px; padding-right: 20px; }
  .pin input { height: 54px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--paper-2); border: 1px solid var(--line-soft); font-size: .88em; }

/* ==================================================================
   Additions: visitors, week cycle, sign-ups, AI, phones
   ================================================================== */

.field > span:first-child small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.input-select {
  width: 100%; height: 44px; padding: 0 36px 0 13px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%234A5567' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 13px center;
  font-size: 15px; appearance: none; cursor: pointer;
}
.input-select:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.field input[type=date] { padding-right: 8px; }

/* Visitor block in the menu */
.side-guest { display: grid; gap: 12px; width: 100%; padding: 2px 4px 2px; }
.side-guest p { font-size: 13px; line-height: 1.45; color: #8C98AC; }
.btn-side { width: 100%; background: rgba(255, 255, 255, .1); color: #fff; }
.btn-side:hover { background: rgba(255, 255, 255, .16); }
.btn-top { height: 34px; padding: 0 14px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 13.5px; }
.btn-top:hover { background: rgba(255, 255, 255, .2); }
.topbar-account { margin-left: auto; }
.avatar-btn { border: 0; cursor: pointer; width: 34px; height: 34px; }
.topbar .avatar-btn[data-hue="m"] { background: rgba(255, 255, 255, .12); color: #fff; }

/* Sign-in screen: way back to the board */
.login-panel { position: relative; }
.back-link {
  position: absolute; top: 22px; left: 24px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin-left: -10px; border: 0; border-radius: 8px; background: none;
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.back-link:hover { background: rgba(22, 32, 46, .06); color: var(--ink); }

/* Week A / B card on This week */
.cycle-card {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.cycle-letter {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 10px;
  background: var(--ink); color: #fff;
  font: 600 34px/1 var(--display); letter-spacing: -0.03em;
}
.cycle-text strong { display: block; font: 600 17px/1.2 var(--display); }
.cycle-text small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink-2); }

.asm-tag {
  margin-left: 4px; padding: 1px 6px; border-radius: 999px;
  background: var(--signal-soft); color: var(--signal);
  font-size: 11px; font-style: normal; font-weight: 700;
}
.roster thead .is-today .asm-tag { color: var(--signal); }

/* Meter (sign-up progress) */
.meter { position: relative; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--signal); transition: width .3s; }

/* Overview: open sign-ups */
.signup-mini { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--signal); }
.signup-mini .meter { flex: 1; max-width: 180px; }
.overview .panel-signups { align-self: start; }

/* Composer: sign-up options */
.composer-signup { margin: 0 20px 16px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--paper-2); }
.signup-grid { display: grid; grid-template-columns: 120px 1fr 1fr 1.2fr; gap: 12px; }
.composer-signup .field input { height: 40px; font-size: 14.5px; }
.hint { margin-top: 12px; font-size: 13px; color: var(--ink-3); }

/* Sign-up box inside an announcement */
.signup {
  max-width: 560px; margin-top: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
}
.signup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.signup-head strong { display: block; font-size: 15px; }
.signup-head span { display: block; font-size: 13.5px; color: var(--ink-2); }
.signup-head .signup-count { flex: none; font-weight: 700; color: var(--signal); font-variant-numeric: tabular-nums; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.slot {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 4px 6px 4px 6px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 14px;
}
.slot-n {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--signal-soft); color: var(--signal); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.slot-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-name small { font-weight: 500; color: var(--ink-3); }
.slot.is-mine { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.slot-open { background: transparent; border-style: dashed; color: var(--ink-3); }
.slot-open .slot-n { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.slot-more { grid-column: 1 / -1; justify-content: center; }
.signup-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.signup-note { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.signup-note.is-in { color: var(--green); }
.signup-form { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.signup-form input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14.5px;
}
.signup-form input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.signup-form .btn { height: 36px; }
.signup-hint { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }

/* Roster: by day */
.dayview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px; border-bottom: 1px solid var(--line-soft); background: var(--paper-2); }
.day-chip {
  position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 0 6px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: var(--ink-2);
}
.day-chip span { font-size: 12px; font-weight: 600; }
.day-chip b { font: 600 17px/1.1 var(--display); color: var(--ink); }
.day-chip.is-today span, .day-chip.is-today b { color: var(--signal); }
.day-chip.is-on { background: var(--ink); }
.day-chip.is-on span, .day-chip.is-on b { color: #fff; }
.asm-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.day-chip.is-on .asm-dot { background: #93A6FF; }
.dv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 8px; font-size: 13.5px; color: var(--ink-2); }
.dv-head strong { font: 600 17px/1.2 var(--display); color: var(--ink); }
.dv-head span { display: inline-flex; align-items: center; gap: 8px; }
.dv-list { margin: 0; padding: 0 0 6px; list-style: none; }
.dv-list li { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line-soft); }
.dv-list li:first-child { border-top: 0; }
.dv-who strong { display: block; font-size: 14.5px; }
.dv-who small { display: block; font-size: 13px; color: var(--ink-3); }
.dv-list .tile[data-kind=empty] { border-color: var(--line); }
.dv-list input.tile::placeholder { color: #A8B1BE; font-weight: 500; }

/* People: AI access chip */
.perm-ai { background: #E2DEF6; border-color: transparent; color: #43378A; }

/* AI chat */
.chat {
  display: flex; flex-direction: column; min-height: 520px; height: calc(100vh - 230px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.chat-log { flex: 1; overflow-y: auto; padding: 24px 24px 12px; display: flex; flex-direction: column; gap: 14px; }
.chat-intro { margin: auto; max-width: 520px; text-align: center; padding: 24px 0; }
.chat-intro h2 { font: 600 24px/1.2 var(--display); letter-spacing: -0.015em; }
.chat-intro p { margin-top: 8px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chip {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--signal); background: var(--signal-soft); }
.msg { max-width: min(680px, 88%); font-size: 15px; line-height: 1.6; }
.msg-me { align-self: flex-end; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--ink); color: #fff; }
.msg-ai { align-self: flex-start; }
.msg-body { padding: 12px 16px; border-radius: 14px 14px 14px 4px; background: var(--paper-2); border: 1px solid var(--line-soft); }
.msg-body p + p, .msg-body p + ul, .msg-body p + ol, .msg-body ul + p, .msg-body ol + p { margin-top: .6em; }
.msg-body ul, .msg-body ol { padding-left: 1.25em; }
.msg-body li + li { margin-top: .2em; }
.msg-ai.is-error .msg-body { background: var(--rose-soft); border-color: transparent; color: var(--lv-fg); }
.msg-actions { display: flex; gap: 4px; margin-top: 4px; }
.text-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 0; border-radius: 6px; background: none;
  font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer;
}
.text-btn:hover { background: var(--paper-2); color: var(--ink); }
.is-thinking .dots { display: inline-flex; gap: 5px; padding: 16px 18px; border-radius: 14px 14px 14px 4px; background: var(--paper-2); border: 1px solid var(--line-soft); }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.chat-form textarea {
  flex: 1; min-height: 44px; max-height: 180px; padding: 11px 14px; resize: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 15px; line-height: 1.45;
}
.chat-form textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.chat-send { width: 44px; height: 44px; padding: 0; border-radius: 12px; }
.chat-send .ico { margin: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Settings pieces */
.field-set { border: 0; padding: 0; display: grid; gap: 8px; }
.field-set legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg-radio { width: max-content; }
.seg-radio .seg-btn { position: relative; padding: 8px 18px; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-radio .seg-btn:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 32, 46, .14); }
.seg-radio .seg-btn:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 1px; }
.check-list { display: grid; gap: 10px; }
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.ai-status.is-on { color: var(--green); font-weight: 600; }
.set-body .form-grid { max-width: 560px; }

/* Phone tab bar */
.tabbar { display: none; }

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

@media (max-width: 900px) {
  .back-link { position: static; justify-self: start; margin: 0 0 10px -10px; }
  .login-panel { display: flex; flex-direction: column; align-items: center; }
  .login-panel .back-link { align-self: flex-start; }

  body.has-tabbar .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  }
  .tabbar[hidden] { display: none !important; }
  .tab {
    position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px;
    border-radius: 10px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600;
  }
  .tab.is-active { color: var(--signal); }
  .tab .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; padding: 0 5px; font-size: 10px; line-height: 16px; }
  .topbar { padding-top: calc(8px + env(safe-area-inset-top)); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .chat { height: calc(100vh - 250px); height: calc(100dvh - 250px); min-height: 380px; }
}

@media (max-width: 640px) {
  /* Stop phones zooming into fields */
  .field input, .input-select, .search input, .signup-form input, .chat-form textarea, .inline-form input, .stack-form textarea,
  .composer textarea, input.plain { font-size: 16px; }
  .composer-title { font-size: 19px; }

  .page-head h1 { font-size: 34px; }
  .page-aside .cycle-card { width: 100%; }
  .signup-grid { grid-template-columns: 1fr 1fr; }
  .composer-signup { margin: 0 14px 14px; padding: 14px; }
  .composer-foot { gap: 12px 16px; padding: 12px 14px; }
  .composer-foot .btn { width: 100%; margin-left: 0; }
  .signup { padding: 14px; }
  .slots { grid-template-columns: 1fr; }
  .signup-form { max-width: none; }
  .dv-list li { grid-template-columns: minmax(0, 1fr) 120px; padding: 9px 14px; }
  .dv-head { padding: 12px 14px 8px; }
  .day-chips { padding: 8px 6px; gap: 2px; }
  .chat-log { padding: 16px 14px 10px; }
  .msg { max-width: 92%; }
  .seg-radio { width: 100%; }
  .seg-radio .seg-btn { flex: 1; text-align: center; }

  /* Comm allocation and People as cards */
  .table-wrap:has(.comms), .table-wrap:has(.people) { background: transparent; border: 0; overflow: visible; }
  .comms, .people, .comms tbody, .people tbody { display: block; }
  .comms thead, .people thead { display: none; }
  .comms tr, .people tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin-bottom: 10px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  }
  .comms tr[hidden], .people tr[hidden] { display: none; }
  .comms th, .comms td, .people th, .people td { display: block; padding: 4px 0; border: 0 !important; background: none !important; position: static; min-width: 0 !important; width: auto; }
  .comms .col-name, .people .col-name { grid-column: 1 / -1; font-size: 16px; padding-bottom: 6px; }
  .comms .col-notes, .people .col-access { grid-column: 1 / -1; }
  .comms td[data-label]::before, .people td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .comms .col-act, .people .col-act { grid-column: 1 / -1; text-align: left !important; }
  .comms input.plain { width: 100%; margin: 0; }
}
.msg-body ul { list-style: disc; } .msg-body ol { list-style: decimal; }
