/* Live Hospitality Operations · 2026-10 redesign. Loads after the base stylesheet.
   Palette: navy, sage and off-white. Normal cursor everywhere: no custom cursors, no motion tied to the mouse. */
:root {
  --paper: #f7f5ef;
  --card: #ffffff;
  --ink: #16213a;
  --navy: #1d2b45;
  --navy-2: #26375a;
  --mute: #5b6577;
  --line: #e4e1d8;
  --sage: #4f7a64;
  --sage-2: #6f9a83;
  --sage-soft: #e9f1ec;
  --slate: #1d2b45;
  --amber: #a86b12;
  --amber-soft: #fbf1df;
  --delete: #a4404b;
  --bad-soft: #f9e8ea;
  --side: 240px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
html, body, * { cursor: auto; }
a, button, summary, select, label.check, [data-record], [draggable="true"] { cursor: pointer; }
input, textarea { cursor: text; }
button:disabled { cursor: not-allowed; opacity: .55; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
body { background: var(--paper); color: var(--ink); font-size: 15px; }
a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
h1 { font-size: 1.5rem; color: var(--navy); }
h3 { font-size: 0.74rem; }

/* Buttons */
.primary, .dark, .danger, .plain { height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.primary { background: var(--sage); color: #fff; }
.primary:hover:not(:disabled) { background: #436b56; }
.dark { background: var(--navy); }
.plain:hover:not(:disabled) { border-color: #cfcabd; }
.plain.on { border-color: var(--sage); background: var(--sage-soft); color: var(--sage); }
.tiny, .plain.tiny, .primary.tiny { height: 30px; padding: 0 10px; font-size: 0.82rem; }
.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; font-weight: 600; }
.danger-link { background: none; border: 0; color: var(--delete); padding: 0; font-weight: 600; text-decoration: underline; }
.x { background: none; border: 0; color: var(--mute); font-size: 1.1rem; padding: 2px 6px; border-radius: 6px; }
.x:hover { background: var(--paper); }
.grow { flex: 1 1 auto; }
input, select, textarea { height: 40px; border-color: #d9d5ca; }
textarea { height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px rgba(79,122,100,.15); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 14px; margin: 14px 0 0; }
legend { font-size: 0.78rem; font-weight: 700; color: var(--mute); padding: 0 6px; }
.check.inline { display: inline-flex; margin: 0; font-weight: 600; font-size: 0.88rem; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pre { white-space: pre-wrap; }

/* Layout shell */
.app { grid-template-columns: var(--side) minmax(0, 1fr); }
.side { background: var(--navy); padding: 18px 12px; gap: 4px; overflow-y: auto; z-index: 30; }
.brand { padding: 4px 8px 14px; }
.brand span { color: #b6c0d2; }
.side nav { display: block; }
.nav-group { margin-bottom: 10px; }
.nav-title { padding: 10px 12px 4px; color: #93a0b8; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; color: #eef1f6; text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.on { background: var(--sage); color: #fff; }
.side nav a.chat-hot { box-shadow: inset 3px 0 0 #e7b45a; }
.nav-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: rgba(255,255,255,.16); color: #fff; font-size: 0.74rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.bad { background: #c2545f; }
.nav-badge.amber { background: #c58a2a; }
.nav-badge[hidden] { display: none; }
.side .ghost { color: #eef1f6; height: 36px; }
.side .ghost:hover { background: rgba(255,255,255,.06); }
.who { color: #b6c0d2; }
.main { padding: 0; width: auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { padding: 26px 36px 56px; width: min(1240px, 100%); flex: 1 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 36px; background: rgba(247,245,239,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); min-height: 58px; }
.menu-btn { display: none; height: 38px; width: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 1.1rem; }
.preview-pill { background: var(--amber-soft); color: var(--amber); border: 1px solid #ecd3a6; font-weight: 800; font-size: 0.74rem; letter-spacing: 0.1em; padding: 4px 10px; border-radius: 999px; }
.preview-banner { background: var(--amber-soft); color: #5e3d07; border-bottom: 1px solid #ecd3a6; padding: 9px 36px; font-size: 0.88rem; }
.preview-banner strong { background: var(--amber); color: #fff; border-radius: 4px; padding: 1px 7px; margin-right: 8px; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.preview-note { margin-top: 8px; background: var(--amber-soft); border: 1px solid #ecd3a6; color: #5e3d07; padding: 8px 12px; border-radius: 8px; font-size: 0.88rem; }
.foot { padding: 16px 36px 22px; color: var(--mute); font-size: 0.78rem; border-top: 1px solid var(--line); }
.scrim { display: none; }
.head { align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.head-actions { gap: 8px; }
.notice { background: var(--navy); }

/* Segmented control and tabs */
.seg { display: inline-flex; background: #ece9e0; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 7px; font-weight: 650; font-size: 0.86rem; color: var(--mute); }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 2px rgba(22,33,58,.12); }
.seg.small button { height: 26px; padding: 0 8px; font-size: 0.78rem; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1 1 0; }
.scope button.on { color: var(--sage); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 18px; flex-wrap: wrap; }
.tabs > a, .tabs > button { border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--mute); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 0.92rem; }
.tabs > .on { color: var(--navy); border-bottom-color: var(--sage); }
.tabs b { background: #ece9e0; border-radius: 9px; padding: 1px 7px; font-size: 0.74rem; margin-left: 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar input, .toolbar select { margin: 0; width: auto; min-width: 180px; height: 36px; }
.toolbar.tight { margin: 10px 0; }

/* Chips */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; background: #eef0f4; color: var(--navy); white-space: nowrap; }
.chip.lh { background: #e6ecf6; color: #24406f; }
.chip.co { background: #efe8f6; color: #5a3d7a; }
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--mute); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.bad { background: var(--bad-soft); color: var(--delete); }
.chip.ok, .chip.stage-won { background: var(--sage-soft); color: var(--sage); }
.chip.stage-new { background: #e6ecf6; color: #24406f; }
.chip.stage-contacted { background: #e8f0f3; color: #2b5866; }
.chip.stage-demo { background: #f1ecdf; color: #6b5420; }
.chip.stage-deciding { background: var(--amber-soft); color: var(--amber); }
.chip.stage-lost { background: #eeeeee; color: #666; }

/* Cards, panels, KPIs */
.panel { border-radius: 12px; padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.span-2 { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--sage-2); }
.kpi span { display: block; color: var(--mute); font-size: 0.8rem; font-weight: 650; }
.kpi strong { display: block; font-size: 1.7rem; color: var(--navy); line-height: 1.2; margin-top: 4px; }
.kpi small { display: block; color: var(--mute); font-size: 0.76rem; }
.kpi.hot { border-color: #ecd3a6; background: var(--amber-soft); }
.kpi.hot strong, .kpi.amber strong { color: var(--amber); }
.kpi.bad { border-color: #ecc7cc; background: var(--bad-soft); }
.kpi.bad strong { color: var(--delete); }
.empty { border: 1px dashed #d6d1c4; border-radius: 12px; padding: 22px; text-align: center; color: var(--mute); background: rgba(255,255,255,.5); }
.empty strong { display: block; color: var(--navy); margin-bottom: 4px; }
.empty p { margin: 0 0 10px; font-size: 0.9rem; }
.empty .primary, .empty .plain { margin-top: 6px; }
.info { background: #eef2f8; border: 1px solid #d6dfec; color: #24406f; border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; margin-bottom: 14px; }
.flag-line { margin-top: 10px; color: var(--delete); font-size: 0.9rem; }
.bad-panel { border-color: #ecc7cc; background: var(--bad-soft); }
.back-link { display: inline-block; margin-bottom: 8px; font-weight: 600; text-decoration: none; color: var(--mute); font-size: 0.9rem; }
.mobile-only { display: none; }
.sub-link { font-size: 0.86rem; }
.lead-text { color: var(--mute); margin-bottom: 12px; }
.stats-foot { margin-top: 14px; }

/* To-do rows (overview) */
.todo { list-style: none; margin: 0; padding: 0; }
.todo-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo-row:first-child { border-top: 0; }
.todo-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.facts dt { color: var(--mute); font-size: 0.78rem; font-weight: 650; }
.facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.facts.compact { gap: 6px 12px; font-size: 0.88rem; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 36px; gap: 10px; align-items: center; text-decoration: none; color: inherit; font-size: 0.88rem; }
.bar { height: 10px; background: #ece9e0; border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sage); border-radius: 5px; }
.bar.amber i { background: #c58a2a; }
.bar.bad i { background: #c2545f; }
.bar-row b { text-align: right; }
.weeks { display: flex; gap: 6px; align-items: flex-end; height: 160px; overflow-x: auto; padding-bottom: 2px; }
.week { flex: 1 0 22px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wbars { flex: 1; display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; }
.wbars i { width: 9px; min-height: 2px; border-radius: 3px 3px 0 0; }
.wbars i.lead, .sw.lead { background: var(--sage); }
.wbars i.in, .sw.in { background: var(--navy-2); }
.week span { font-size: 0.66rem; color: var(--mute); margin-top: 4px; white-space: nowrap; }
.legend { font-size: 0.8rem; color: var(--mute); display: inline-flex; gap: 6px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* Leads */
.quick { margin-bottom: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.quick-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dupes { background: var(--amber-soft); border: 1px solid #ecd3a6; border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.dupes ul { margin: 8px 0 0; padding-left: 18px; }
.dupe-panel { margin-bottom: 16px; }
.dupe-pairs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dupe-pairs li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #efece4; border-radius: 12px; padding: 10px; min-height: 160px; }
.col.over { outline: 2px dashed var(--sage); outline-offset: -2px; background: var(--sage-soft); }
.col h2, .col > header { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; padding: 2px 4px 8px; }
.col-body { display: grid; gap: 8px; }
.col-empty { color: var(--mute); font-size: 0.84rem; text-align: center; padding: 14px 0; }
.lead-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; box-shadow: 0 1px 1px rgba(22,33,58,.04); }
.lead-card:hover { border-color: var(--sage-2); }
.lead-card.dragging { opacity: 0.5; }
.lead-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.lead-top strong { overflow-wrap: anywhere; }
.lead-next { font-size: 0.84rem; color: var(--ink); }
.lead-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; color: var(--mute); }
.lead-foot select, .move select, select.move { height: 28px; width: auto; margin: 0; font-size: 0.8rem; padding: 0 6px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table thead th { border-top: 0; color: var(--mute); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; background: #faf9f5; }
.table tbody tr[data-record]:hover { background: #faf9f5; }

/* Follow-ups */
.fu-group { margin-bottom: 18px; }
.fu-group > h3, .fu-group > h2 { margin-bottom: 8px; }
.fu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fu { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fu.done { opacity: 0.85; }
.fu-main { min-width: 0; flex: 1 1 320px; }
.fu-note { color: var(--mute); font-size: 0.86rem; margin-top: 4px; }
.fu-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fu-form { flex-basis: 100%; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.flow li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.flow-day { background: var(--sage-soft); color: var(--sage); font-weight: 700; font-size: 0.78rem; border-radius: 6px; text-align: center; padding: 3px 0; }
.tpl-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tpl-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; flex-wrap: wrap; }
.tpl-list li:first-child { border-top: 0; padding-top: 0; }
.tpl-edit { margin-top: 12px; }

/* Clients */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.client { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.client:hover { border-color: var(--sage-2); }
.client-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.client-top h2 { font-size: 1rem; overflow-wrap: anywhere; }

/* Inbox and record */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 560px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); padding: 12px; min-width: 0; max-height: 78vh; overflow-y: auto; }
.inbox-conv { min-width: 0; padding: 16px 18px; max-height: 78vh; overflow-y: auto; }
.conv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.conv-list a { display: block; padding: 10px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.conv-list a:hover { background: #faf9f5; }
.conv-list a.on { background: var(--sage-soft); border-color: #cfe0d6; }
.conv-list a.unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); margin-right: 6px; vertical-align: middle; }
.conv-row-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-row-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.conv-placeholder { display: grid; place-items: center; height: 100%; }
.conv { display: grid; gap: 16px; }
.conv.with-side { grid-template-columns: minmax(0, 1fr) 280px; }
.conv-main { min-width: 0; }
.conv-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.conv-head h2 a { text-decoration: none; }
.conv-side { display: grid; gap: 12px; align-content: start; }
.side-card { background: #faf9f5; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.side-card h3 { margin-bottom: 8px; }
.stepper { display: flex; flex-wrap: wrap; gap: 4px; }
.stepper button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; height: 28px; padding: 0 10px; font-size: 0.8rem; font-weight: 650; color: var(--mute); }
.stepper button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.stepper button.on.won { background: var(--sage); border-color: var(--sage); }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.86rem; }
.mini-list li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.timeline { display: grid; gap: 10px; }
.thread-sep { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: 0.8rem; margin-top: 8px; flex-wrap: wrap; }
.thread-sep::before, .thread-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.status-pick { width: auto; height: 28px; margin: 0; font-size: 0.8rem; padding: 0 6px; }
.msg { max-width: 82%; border-radius: 12px; padding: 10px 12px; background: #f1efe8; }
.msg.out { margin-left: auto; background: #e6ecf6; }
.msg.note { background: var(--amber-soft); max-width: 100%; }
.msg.system { background: none; max-width: 100%; text-align: center; color: var(--mute); font-size: 0.82rem; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-copy { overflow-wrap: anywhere; }
.stamp { color: var(--mute); font-size: 0.78rem; }
.composer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.composer-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.composer-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.new-mail { margin-top: 12px; }
.new-mail summary { font-weight: 650; color: var(--navy); }
.record { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.record-main { min-width: 0; display: grid; gap: 16px; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.88rem; }
.diff-banner { margin-bottom: 10px; }
.diff-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.diff-table th, .diff-table td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); }
.diff-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Website */
.enq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.enq { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.enq-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.enq-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 0.92rem; }

/* Existing pages, recoloured */
.pipe-stage.on, .pipe-stage.live { border-color: #cfe0d6; }
.release-stack .panel, .tills > * { min-width: 0; }

@media (max-width: 1100px) {
  .conv.with-side, .record { grid-template-columns: 1fr; }
  .quick-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; height: 100vh; transform: translateX(-100%); transition: transform .2s ease; }
  .side nav, .side .push { display: block; }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(22,33,58,.35); z-index: 25; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar, .preview-banner, .foot { padding-left: 16px; padding-right: 16px; }
  .content { padding: 18px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { border-right: 0; max-height: none; }
  .inbox.has-conv .inbox-list { display: none; }
  .inbox:not(.has-conv) .inbox-conv { display: none; }
  .inbox-conv { max-height: none; }
  .mobile-only { display: inline-block; }
}
@media (max-width: 640px) {
  .quick-grid.three, .facts { grid-template-columns: 1fr; }
  .scope { width: 100%; }
  .scope button { flex: 1 1 0; padding: 0 6px; font-size: 0.78rem; }
  .topbar { flex-wrap: wrap; }
  .msg { max-width: 100%; }
  .bar-row { grid-template-columns: 90px minmax(0, 1fr) 30px; }
  .head-actions { width: 100%; }
}

/* Checkboxes and radios keep their native size */
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; box-shadow: none; cursor: pointer; accent-color: var(--sage); flex: none; }
label.check { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; }
.facts .wide { grid-column: 1 / -1; }

/* ---- Inbox and record layout (container-based, never overlapping) ---- */
.inbox-conv, .content { container-type: inline-size; }
.inbox-conv { container-name: conv; }
.content { container-name: page; }
.conv.with-side { grid-template-columns: minmax(0, 1fr); }
.conv-side { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@container conv (min-width: 780px) {
  .conv.with-side { grid-template-columns: minmax(0, 1fr) 270px; align-items: start; }
  .conv.with-side .conv-side { grid-template-columns: minmax(0, 1fr); position: sticky; top: 0; }
}
.record { grid-template-columns: minmax(0, 1fr); }
@container page (min-width: 940px) {
  .record { grid-template-columns: minmax(0, 1fr) 300px; }
  .record > .conv-side { grid-template-columns: minmax(0, 1fr); }
}
.conv-main, .timeline, .msg { min-width: 0; }
.msg { overflow-wrap: break-word; }
.facts.single { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.facts dd.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.facts dd.trunc a { display: inline; }
.thread-sep { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin: 12px 0 2px; min-width: 0; }
.thread-sep::before, .thread-sep::after { content: none; }
.thread-line { flex: 1 1 16px; min-width: 16px; border-top: 1px solid var(--line); }
.thread-subject { font-weight: 650; color: var(--ink, #1e232d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 40%; }
select.thread-status { width: auto; flex: none; height: 28px; margin: 0; padding: 0 26px 0 8px; font-size: 0.8rem; border-radius: 7px; }
.thread-state { font-size: 0.8rem; font-weight: 650; color: var(--mute); }
.thread-sep.closed .chip { opacity: .8; }
.seg.full { flex-wrap: nowrap; }
.seg button { white-space: nowrap; }
.seg.full button { min-width: 0; padding: 0 8px; }
.toolbar.tight { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0 0; }
.toolbar.tight input, .toolbar.tight select { width: 100%; min-width: 0; margin: 0; }
.mail-copy { max-width: 100%; overflow-x: auto; }
.mail-copy table { max-width: 100% !important; width: auto !important; }
.mail-copy img { max-width: 100%; height: auto; }
.inbox { grid-template-columns: 300px minmax(0, 1fr); }
@container page (max-width: 760px) {
  .inbox .back-link.mobile-only { display: inline-block; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { border-right: 0; max-height: none; }
  .inbox.has-conv .inbox-list { display: none; }
  .inbox:not(.has-conv) .inbox-conv { display: none; }
  .inbox-conv { max-height: none; }
}
.thread-sep .chip { flex: none; }
.thread-sep > button, .thread-state { flex: none; white-space: nowrap; }
.mail-copy { overflow-wrap: break-word; }

/* ---- long values: one line, cut with an ellipsis, full text in the tooltip ---- */
.host { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; overflow-wrap: normal; }
.meta.line, .line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; min-width: 0; }
.till > *, .account-top > *, .ship-venue > * { min-width: 0; }
.till.co .meta { overflow-wrap: break-word; }
.staff-card h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.draft-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.scope-label { font-size: 0.8rem; font-weight: 700; letter-spacing: .02em; color: var(--mute); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
@container page (max-width: 1100px) {
  .till, .till.co { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .till > :last-child { grid-column: 1 / -1; }
  .till .actions, .till.co .actions { justify-content: flex-start; }
}
@container page (max-width: 620px) { .till, .till.co { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .activity-head { display: none; }
  .activity-row { grid-template-columns: minmax(0, 1fr) !important; gap: 2px; }
  .activity-row > span:first-child { font-size: .8rem; color: var(--mute); }
}
.release-stack > *, .ship > *, .ship-grid, .ship-grid > *, .ship-box ul, .ship-box li, .ship-box li > *, .staff-list > *, .staff-card > *, .staff-card .row { min-width: 0; }
.ship-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.ship-head { flex-wrap: wrap; }
.staff-card .row { flex-wrap: wrap; }
.mail-copy * { max-width: 100% !important; box-sizing: border-box; }
.staff-card > :first-child { flex: 1 1 0; }
@media (max-width: 640px) { .staff-card { flex-direction: column; align-items: stretch; } }
.ship-box li.ship-venue { align-items: stretch; }
/* Narrow screens: email layout tables stack like a phone mail app, so plan columns read one under another */
@container conv (max-width: 520px) {
  .mail-copy table, .mail-copy tbody, .mail-copy tr, .mail-copy td { display: block; width: auto !important; max-width: 100% !important; }
  .mail-copy td { padding-left: 14px !important; padding-right: 14px !important; }
  .mail-copy td:empty { display: none; }
}
/* Narrow screens: email layout tables stack like a phone mail app, so plan columns read one under another */
@container page (max-width: 520px) {
  .mail-copy table, .mail-copy tbody, .mail-copy tr, .mail-copy td { display: block; width: auto !important; max-width: 100% !important; }
  .mail-copy td { padding-left: 14px !important; padding-right: 14px !important; }
  .mail-copy td:empty { display: none; }
}
.mail-copy table { border-collapse: collapse; }
.ship-head > :first-child { flex: 1 1 0; min-width: 0; }
.release-stack .block, .ship-head > * { min-width: 0; }
@container page (max-width: 1000px) { .board { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); overflow-x: visible; } }
.who { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ship-both select { width: auto; min-width: 11rem; max-width: 100%; }
.head > * { min-width: 0; }
.ship-buttons, .ship-both { flex-wrap: wrap; min-width: 0; }
@media (max-width: 640px) {
  .ship-buttons, .ship-both { width: 100%; }
  .ship-buttons > button, .ship-both > * { flex: 1 1 100%; }
}
@media (max-width: 640px) { .head { align-items: stretch; } .head .head-actions, .head > button { align-self: flex-start; } }
