/* Anglo Estate — hosted workspace styles (MON-03A; simplified by COM-DEV-01C). The Royal sign-in page loads it too.
   Loaded after tokens.css and shell.css (both dashboard_v2 files, served unchanged). This file carries the approved
   Anglo Estate rules the hosted pages use, copied from the dashboard_v2 Anglo Estate stylesheet with their section named, and the
   few additions the hosted workspace needs: the sign-in panel, the assignment cards, and the Connected / Not yet
   connected markers. Tokens only: no new colour, font or radius values, no external resource, no import. */

/* Anything hidden stays hidden, whatever display a rule gives it. */
.castle-online [hidden] { display: none !important; }

/* ── Header (shell.css ANGLO-NAV-02B.4A header chrome, plus the hosted sign-out) ──────────────────────────────── */
.castle-online .header-identity { gap: 10px; }
.castle-account { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.castle-account:hover b { color: var(--gold); }
.castle-signout {
  flex: none; min-height: 32px; margin-left: 4px; padding: 4px 10px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: transparent; color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.castle-signout:hover:not(:disabled) { color: var(--gold); border-color: var(--gold-soft); }
.castle-signout:disabled { opacity: .55; cursor: progress; }
/* Pilot: a half-filled diamond, between the hollow of practice data and the filled of live records. */
.mode-indicator[data-mode="pilot"] > summary { color: var(--status-partial); border-color: currentColor; }
.mode-indicator[data-mode="pilot"] .mode-mark { background: linear-gradient(135deg, currentColor 50%, transparent 50%); }
.is-signed-out .nav-open-btn, .is-pending .nav-open-btn { display: none; }

/* The approved data notice (MON-02, decision R6): one quiet line under the header, on every screen. */
#ws-data-notice {
  margin: 0; padding: 6px 20px; border-bottom: 1px solid var(--border);
  background: var(--gold-faint); color: var(--muted-foreground); font-size: var(--text-xs); letter-spacing: .01em;
}

/* Signed out: no sidebar, one centred column holding the sign-in panel. */
.is-signed-out .layout, .is-pending .layout { grid-template-columns: minmax(0, 1fr); }
#ws-loading { color: var(--muted-foreground); }
#ws-signed-out, #ws-unavailable {
  position: relative; max-width: 30rem; margin: 6vh auto 0; padding: 22px 24px 24px;
  background: linear-gradient(180deg, oklch(20% .008 80 / .92), oklch(18% .008 80 / .92));
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
#ws-signed-out::before, #ws-unavailable::before { content: ""; position: absolute; top: -1px; left: -1px; width: 12px; height: 12px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); border-top-left-radius: var(--radius-lg); }
#ws-signed-out::after, #ws-unavailable::after { content: ""; position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-bottom: 1px solid var(--gold-soft); border-right: 1px solid var(--gold-soft); border-bottom-right-radius: var(--radius-lg); }
#ws-signed-out > p:first-child, #ws-unavailable > p:first-child { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
#ws-signed-out h2 { margin: 8px 0 4px; font-size: var(--text-xl); color: var(--ivory); }
#ws-signed-out .ws-meta, #ws-unavailable .ws-meta { margin: 6px 0 12px; }
#ws-signin-qr { display: block; margin: 10px 0; background: var(--ivory); border-radius: var(--radius); padding: 6px; }
#ws-signin-secret { overflow-wrap: anywhere; font-family: var(--font-mono); }
#ws-signin-message:empty { display: none; }

/* ── Forms and buttons (Anglo stylesheet ANGLO-NAV-02B.4A fields; the established gold primary action) ──────────── */
.castle-online :where(input, select, textarea, button) { font-family: inherit; }
.castle-online :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid var(--field-border); border-radius: var(--radius);
  background-color: var(--field-bg); color: var(--foreground); font-size: var(--text-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.castle-online select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.castle-online :is(input, select, textarea):hover:not(:disabled) { border-color: var(--gold-soft); }
.castle-online :is(input, select, textarea):focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); }
.ws-form { display: grid; gap: 10px; max-width: 34rem; }
.ws-form label { display: grid; gap: 4px; font-size: var(--text-sm); color: var(--muted-foreground); }
.ws-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.ws-create-form .ws-wide, .ws-create-form .ws-form-actions { grid-column: 1 / -1; }
.ws-form button, .ws-actions button, #castle-retry {
  min-height: 34px; padding: 5px 12px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--stone); color: var(--foreground); font-size: var(--text-sm);
}
.ws-form button:hover:not(:disabled), .ws-actions button:hover:not(:disabled), #castle-retry:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.castle-online button.castle-primary, .ws-form button[type=submit] { border-color: var(--gold); background: var(--gold); color: var(--iron); font-weight: 600; }
.castle-online button.castle-primary:hover:not(:disabled), .ws-form button[type=submit]:hover:not(:disabled) { color: var(--iron); filter: brightness(1.06); }
.castle-online button.castle-quiet { border-color: transparent; background: transparent; color: var(--muted-foreground); }
.castle-online button:disabled { opacity: .55; cursor: progress; }
.ws-form-actions { display: flex; justify-content: flex-end; }
.ws-error { color: var(--status-alert); }

/* ── Status line for actions (castle-dashboard-design: p.bi-notice[role=status]) ──────────────────────────────── */
#ws-notice:empty { display: none; }
#ws-notice { margin: 0 0 12px; padding: 8px 12px; border-left: 2px solid var(--status-live); background: oklch(72% .11 150 / .1); color: var(--foreground); font-size: var(--text-sm); }
#ws-notice.ws-error { border-left-color: var(--status-alert); background: oklch(68% .14 35 / .1); color: var(--foreground); }

/* ── Sidebar (Anglo stylesheet ANGLO-NAV-01 estate sidebar; the department's full name on two lines) ────────────── */
.estate-group-toggle { width: 100%; min-height: 32px; background: none; border: 0; cursor: pointer; text-align: left; text-transform: uppercase; }
.estate-group-toggle:hover { color: var(--gold); }
.estate-group-toggle:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
.estate-group-toggle .chev { transform: rotate(45deg); margin-right: 4px; }
.estate-group-toggle[aria-expanded="true"] .chev { transform: rotate(225deg); }
.estate-list .nav-name { overflow: visible; line-height: 1.15; text-overflow: clip; white-space: normal; }
@media (min-width: 768px) {
  body.nav-collapsed .estate-group-toggle { visibility: hidden; height: 12px; min-height: 0; overflow: hidden; padding-block: 0; }
  body.nav-collapsed .estate-list[hidden] { display: block !important; }
}
/* Connected / not yet connected: word and shape, never colour alone. A planned room's monogram is outlined, not filled. */
.castle-nav-state.is-connected { color: var(--status-live); }
.castle-nav-state.is-connected::before { content: "◆ "; }
.castle-nav-state.is-planned::before { content: "◇ "; }
.nav-item.is-planned .nav-mono { color: var(--muted-foreground); background: transparent; border-style: dashed; border-color: var(--border-strong); }
.nav-item.is-planned .nav-name { color: var(--muted-foreground); }
.nav-item.is-planned .nav-link[aria-current] .nav-name { color: var(--gold); }
.drawer-open { overflow: hidden; }

/* ── Department bar, header, metrics, tabs (Anglo stylesheet ANGLO-NAV-01, -02, -02B.3, -02B.4A) ──────────────── */
.castle-online .main:has(.anglo-page) { padding-top: 16px; overflow-x: clip; }
.anglo-page { max-width: 1320px; margin: 0 auto; }
.anglo-icon { width: 15px; height: 15px; margin-right: 5px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.anglo-specialist-nav { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px 4px; margin: 0 0 16px; padding: 0; border-bottom: 1px solid var(--border-strong); }
.anglo-specialist-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: var(--radius) var(--radius) 0 0; background: transparent; color: var(--foreground); font-size: var(--text-sm); text-decoration: none; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.anglo-specialist-nav a:hover { color: var(--gold); border-bottom-color: var(--gold-soft); }
.anglo-specialist-nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); background: var(--gold-faint); }
.anglo-specialist-nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; box-shadow: none; }
.castle-tab-planned { font-family: var(--font-sans); font-size: .7rem; line-height: 1; color: var(--muted-foreground); }
.anglo-dept-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; padding: 6px 0; }
.anglo-dept-bar .anglo-specialist-nav { flex: 1 1 420px; min-width: 0; margin: 0; }
.anglo-dept-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 2px 0 2px 14px; border-left: 2px solid var(--gold); }
.anglo-dept-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--gold); border: 1px solid var(--gold-soft); border-radius: var(--radius-lg); background: var(--gold-faint); }
.anglo-dept-icon .anglo-icon { width: 22px; height: 22px; margin: 0; }
.anglo-dept-title { flex: 1 1 240px; min-width: 0; }
.anglo-dept-title h1 { margin: 0; font-size: var(--text-lg); line-height: 1.15; }
.anglo-dept-title p { margin: 2px 0 0; max-width: 75ch; color: var(--muted-foreground); font-size: var(--text-sm); }
.anglo-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-left: auto; }
.anglo-head-link { font-size: var(--text-sm); color: var(--foreground); }
.anglo-dept-action { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 12px; border: 1px solid var(--gold); border-radius: var(--radius); background: var(--gold); color: var(--iron); font-size: var(--text-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.anglo-dept-action:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
.anglo-kpi-group { container-type: inline-size; margin: 0 0 14px; }
.castle-group-label { margin: 0 0 6px; font-family: var(--font-mono); font-weight: 400; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-foreground); }
.anglo-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
@container (min-width: 600px) { .anglo-kpi-grid[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 480px) { .anglo-kpi-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.anglo-kpi { display: flex; flex-direction: column; justify-content: flex-start; gap: 3px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--foreground); text-decoration: none; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.anglo-kpi strong { color: var(--gold); font-family: var(--font-serif); font-weight: 500; font-size: 1.75rem; line-height: 1.1; }
.anglo-kpi span { font-size: var(--text-sm); font-weight: 600; line-height: 1.25; }
.anglo-kpi small { color: var(--muted-foreground); font-size: .7rem; line-height: 1.35; }
a.anglo-kpi:hover { border-color: var(--gold-soft); background: var(--gold-faint); }
a.anglo-kpi:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; box-shadow: none; }
.anglo-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 12px; }
.anglo-view-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.anglo-view-tabs button { min-height: 32px; padding: 5px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: var(--foreground); font-size: var(--text-sm); cursor: pointer; }
.anglo-view-tabs button:hover { border-color: var(--gold-soft); }
.anglo-view-tabs button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-faint); color: var(--gold); }
.anglo-empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: color-mix(in oklab, var(--iron) 45%, transparent); text-align: center; }
.anglo-empty-state p { margin: 0; max-width: 60ch; color: var(--muted-foreground); }
.anglo-empty-state a, .castle-links a, .castle-planned-status a { color: var(--gold); }
.castle-empty-title { font-family: var(--font-serif); font-style: italic; font-size: 1.12rem; color: var(--ivory) !important; }
.castle-failure { border-color: var(--status-alert); }
.castle-loading { color: var(--muted-foreground); font-size: var(--text-sm); }
/* The provisional-workspace hero (Anglo stylesheet .anglo-hero). */
.anglo-hero { padding: 24px; margin-bottom: 14px; border: 1px solid var(--gold-soft); background: linear-gradient(135deg, var(--card), var(--leather)); }
.anglo-hero h1 { margin: 5px 0 8px; font-size: var(--text-2xl); }
.anglo-hero p:not(.eyebrow) { max-width: 850px; color: var(--muted-foreground); }

/* ── Panels, connected / planned chips, rows ──────────────────────────────────────────────────────────────────── */
.castle-panel { margin: 0; }
.castle-panel + .anglo-kpi-group, .castle-failure + .anglo-kpi-group, .castle-panel + .castle-failure { margin-top: 14px; }
.castle-panel .panel-head h2 { font-size: 1.2rem; }
.castle-state { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; border-radius: 2px; }
.castle-state::before { content: ""; width: 6px; height: 6px; border: 1.5px solid currentColor; transform: rotate(45deg); }
.castle-state.is-connected { color: var(--status-live); }
.castle-state.is-connected::before { background: currentColor; }
.castle-state.is-planned { color: var(--muted-foreground); border-style: dashed; }
.castle-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: var(--text-sm); }
.castle-holds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 6px; }
.castle-holds li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted-foreground); font-size: var(--text-sm); }
.castle-holds .gh-icon { width: 15px; height: 15px; }
.castle-planned-status p + p { margin-top: 8px; }
.castle-planned-status p { color: var(--muted-foreground); }
.row-title a { color: var(--ivory); text-decoration: none; }
.row-title a:hover { color: var(--gold); }

/* ── Assignment cards (castle_workspace/static/workspace.css, in the Castle's card style) ─────────────────────── */
.castle-list-title { margin: 4px 0 8px; font-size: var(--text-md); color: var(--gold); }
.ws-cards { display: grid; gap: 10px; }
.ws-card { position: relative; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-left: 2px solid var(--gold-soft); border-radius: var(--radius-lg); }
.ws-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ws-card h3 { margin: 0 0 4px; font-size: 1.18rem; color: var(--ivory); overflow-wrap: anywhere; }
.ws-meta { color: var(--muted-foreground); font-size: var(--text-sm); margin: 0 0 6px; }
.ws-instructions { margin: 6px 0; overflow-wrap: anywhere; }
.ws-badge { flex: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; border-radius: 2px; color: var(--gold); }
.ws-badge[data-status="in-progress"] { color: var(--status-partial); }
.ws-badge[data-status="completed"] { color: var(--status-live); }
.ws-badge[data-status="cancelled"], .ws-badge[data-status="returned"] { color: var(--status-none); }
.ws-badge[data-status="return-pending"] { color: var(--status-alert); }
.ws-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ws-slot:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ws-events { margin: 0; padding-left: 1.1rem; color: var(--muted-foreground); font-size: var(--text-sm); }
.ws-events li + li { margin-top: 3px; }

/* ── Stacked panels and recorded text ─────────────────────────────────────────────────────────────────────────── */
.anglo-panel-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.castle-text { white-space: pre-line; overflow-wrap: anywhere; }
.gh-icon { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Commercial rooms (MON-04A Slice 1b): filters, register table, dossier facts, readiness markers ─────────────── */
.com-candidate { margin: 0 0 12px; padding: 7px 12px; border: 1px dashed var(--status-partial); border-radius: var(--radius); color: var(--muted-foreground); font-size: var(--text-xs); }
.com-caution { margin: 0 0 12px; padding: 8px 12px; border-left: 2px solid var(--status-partial); background: var(--gold-faint); font-size: var(--text-sm); }
.com-filter-box { margin: 0 0 14px; padding: 8px 12px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.com-filter-box:not([open]) { padding-bottom: 8px; }
.com-filter-box summary { cursor: pointer; color: var(--gold); font-size: var(--text-sm); }
.com-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px 10px; margin-top: 8px; }
.com-filters label { display: grid; gap: 3px; min-width: 0; font-size: var(--text-xs); color: var(--muted-foreground); }
.com-filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.castle-online :is(.com-button, .com-filter-actions button, .com-pager button) {
  min-height: 34px; padding: 5px 12px; cursor: pointer; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--stone); color: var(--foreground); font-size: var(--text-sm);
}
.castle-online :is(.com-button, .com-pager button):hover { border-color: var(--gold); color: var(--gold); }
.com-table { width: 100%; margin: 0 0 12px; border-collapse: collapse; background: var(--card); font-size: var(--text-sm); }
.com-table th { padding: 8px 10px; border-bottom: 1px solid var(--gold-soft); text-align: left; font-family: var(--font-mono); font-weight: 400; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); }
.com-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.com-line, .anglo-page span.ws-meta { display: block; }
.com-chips + span.ws-meta { margin-top: 8px; }
.com-sub { display: block; color: var(--muted-foreground); font-size: var(--text-xs); }
.castle-online button.com-open { padding: 0; border: 0; background: none; color: var(--ivory); font-family: var(--font-serif); font-size: 1.08rem; text-align: left; text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.castle-online button.com-open:hover { color: var(--gold); }
.com-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* Word and shape, never colour alone: ready is filled, held is dashed, the rest outlined. */
.com-chip { display: inline-flex; padding: 2px 7px; border: 1px solid currentColor; border-radius: 2px; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.com-chip.is-ready { color: var(--status-live); background: oklch(72% .11 150 / .12); font-weight: 600; }
.com-chip.is-held { color: var(--status-alert); border-style: dashed; }
.com-chip.is-unshown { border-style: dotted; }
.com-telephone { font-family: var(--font-mono); font-size: var(--text-md); color: var(--ivory); white-space: nowrap; }
.com-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 10px; }
.com-pager .ws-meta { margin: 0 auto 0 0; }
.com-dossier-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.com-dossier-head h2 { margin: 0; min-width: 0; color: var(--ivory); font-size: 1.5rem; overflow-wrap: anywhere; }
.com-facts { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 12px; margin: 0 0 8px; font-size: var(--text-sm); }
.com-facts dt { color: var(--muted-foreground); }
.com-facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.com-routes, .com-evidence { margin: 0 0 8px; padding: 0; list-style: none; }
.com-route, .com-evidence li { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.com-route + .com-route, .com-evidence li + li { margin-top: 8px; }
.com-route-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.castle-panel h3 { margin: 10px 0 6px; font-size: 1.05rem; color: var(--gold); }

/* ── Call desk (MON-04B-1B): the queue beside one prospect, outcome choices, confirmations and unsettled changes ─── */
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 27rem); gap: 14px; align-items: start; scroll-margin-top: calc(var(--header-h) + 8px); }
.desk-queue { min-width: 0; }
.desk-queue .com-table tr[aria-current="true"] { background: var(--gold-faint); box-shadow: inset 3px 0 0 var(--gold); }
.desk-queue .com-button, .com-nowrap { white-space: nowrap; }
.desk-panel { position: sticky; top: calc(var(--header-h) + 8px); display: grid; align-content: start; gap: 10px; min-width: 0; max-height: calc(100vh - var(--header-h) - 16px); overflow: auto; padding-right: 2px; }
.desk-panel .desk-alert, .desk-panel .desk-saved { margin: 0; }
.desk-block { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); font-size: var(--text-sm); }
.desk-block .desk-block { padding: 10px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; }
.desk-block h2 { margin: 0 0 4px; color: var(--ivory); font-size: 1.3rem; overflow-wrap: anywhere; }
.desk-block h3 { margin: 0 0 6px; color: var(--gold); font-size: 1.05rem; }
.desk-block p { margin: 6px 0; }
.desk-head { border-color: var(--gold-soft); }
.castle-online button.desk-close { float: right; margin: 0 0 4px 8px; }
.desk-number { font-family: var(--font-mono); font-size: 1.75rem; color: var(--ivory); overflow-wrap: anywhere; user-select: all; }
.desk-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.castle-online :is(.desk-actions, .desk-block, .com-table, .desk-alert, .desk-saved) button:not(.com-open) {
  min-height: 36px; padding: 6px 12px; cursor: pointer; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--stone); color: var(--foreground); font-size: var(--text-sm);
}
.castle-online :is(.desk-actions, .desk-block, .com-table, .desk-alert, .desk-saved) button.castle-primary { border-color: var(--gold); background: var(--gold); color: var(--iron); font-weight: 600; }
.castle-online .desk-panel button.com-view[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.desk-outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; border: 0; }
.desk-outcomes legend { margin-bottom: 6px; padding: 0; color: var(--gold); }
.desk-choice { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.desk-choice.is-chosen { border-color: var(--gold); background: var(--gold-faint); font-weight: 600; }
.desk-choice input { margin: 0; accent-color: var(--gold); }
.desk-date, .desk-need { margin-top: 10px; }
.desk-date label, .desk-need label, .desk-notes label { display: grid; gap: 3px; min-width: 0; font-size: var(--text-xs); color: var(--muted-foreground); }
.desk-need summary { min-height: 32px; cursor: pointer; color: var(--gold); }
.desk-need-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.desk-need-grid :is(input, select), .desk-date input { width: 100%; min-width: 0; }
.castle-online .desk-panel button.desk-save { width: 100%; min-height: 44px; margin-top: 10px; }
.desk-warning { padding: 6px 10px; border-left: 2px solid var(--status-partial); background: var(--gold-faint); }
.desk-error { padding: 6px 10px; border-left: 2px solid var(--status-alert); }
.desk-confirm { margin-top: 10px; padding: 10px; border: 1px solid var(--gold); border-radius: var(--radius); }
.desk-confirm-title { color: var(--ivory); font-weight: 600; }
.desk-confirm.is-optout, .desk-alert.is-optout { border: 2px solid var(--status-alert); }
.castle-online .desk-block button.desk-stop { border-color: var(--status-alert); color: var(--status-alert); }
.desk-history { margin: 0; padding: 0; list-style: none; }
.desk-history li { padding: 7px 0; border-top: 1px solid var(--border); }
.desk-stated, .desk-just { display: block; font-size: var(--text-xs); color: var(--gold); overflow-wrap: anywhere; }
.desk-alert, .desk-saved { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--status-partial); border-radius: var(--radius); background: var(--card); font-size: var(--text-sm); }
.desk-alert p, .desk-saved p { margin: 0; }
.desk-alert.is-refused, .desk-alert.is-unknown { border-color: var(--status-alert); }
.desk-saved { border-color: var(--status-live); background: oklch(72% .11 150 / .12); }
@media (max-width: 1200px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-panel { position: static; max-height: none; overflow: visible; }
  .desk-grid.has-prospect .desk-panel { order: -1; }
  .desk-grid:not(.has-prospect) .desk-panel { display: none; }
}
/* ── Smaller screens (shell.css and Anglo stylesheet breakpoints) ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .com-table, .com-table tbody, .com-table tr, .com-table td { display: block; width: 100%; }
  .com-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .com-table { background: transparent; }
  .com-table tr { margin-bottom: 10px; padding: 6px 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
  .com-table td { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: 8px; padding: 5px 12px; border: 0; }
  .com-table td::before { content: attr(data-label); color: var(--muted-foreground); font-size: var(--text-xs); }
  .com-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .com-facts dd { margin-bottom: 6px; }
}
/* On a phone the queue is a list of names and numbers: the column names would double its length. */
@media (max-width: 767px) {
  .desk-queue .com-table td { display: block; }
  .desk-queue .com-table td::before { content: none; }
}
@media (max-width: 900px) {
  .anglo-overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .castle-online .app-header { gap: 6px; }
  .castle-signout { padding: 4px 8px; }
  #ws-data-notice { padding: 6px var(--gutter); }
  #ws-signed-out, #ws-unavailable { margin-top: 3vh; padding: 18px 16px 20px; }
}
@media (max-width: 650px) {
  .anglo-dept-head { padding-left: 10px; }
  .anglo-dept-icon { width: 34px; height: 34px; }
  .anglo-head-actions { margin-left: 0; flex-basis: 100%; }
  .anglo-specialist-nav a { min-height: 30px; padding: 4px 7px; font-size: .8rem; }
  .anglo-hero { padding: 18px; }
  .anglo-hero h1 { font-size: 2rem; }
  .ws-create-form { grid-template-columns: minmax(0, 1fr); }
  .ws-card-top { flex-direction: column-reverse; gap: 6px; }
}
@media (max-width: 420px) {
  .mode-indicator .mode-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .castle-online .identity-text { max-width: 96px; }
}
