/* FC Tickets, "Dispatch board". Daylight work surface for a phone used outdoors, dark command bar like the
   website header. Orange only on the actions that reach a client. Teal marks what Claude wrote.
   The CSP allows only this file for styles: no inline style attributes (JS sets widths through CSSOM). */

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/OpenSans-Variable-Latin.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bar: #071F33;
  --navy: #004F7E;
  --navy-deep: #003A5E;
  --orange: #F37121;
  --orange-deep: #D95B0E;
  --teal: #33C0CC;
  --teal-ink: #0B6F78;
  --teal-wash: #E3F6F8;
  --ink: #373435;
  --ink-soft: #545052;
  --muted: #66707A;
  --line: #D9E1E8;
  --line-soft: #E8EEF3;
  --ground: #F3F6F9;
  --paper: #FFFFFF;
  --ok: #1E8A5A;
  --ok-wash: #E2F4EA;
  --warn: #9A5B00;
  --warn-fill: #F2A93B;
  --warn-wash: #FFF3DC;
  --bad: #B42318;
  --bad-fill: #E0483A;
  --bad-wash: #FDE8E6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(7, 31, 51, .06), 0 6px 18px rgba(7, 31, 51, .06);
  --font: "Open Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --bar-h: 58px;
  --tab-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; min-height: 100vh; font: 15px/1.5 var(--font); color: var(--ink); background: var(--ground); font-variant-numeric: tabular-nums; }
::selection { background: rgba(51, 192, 204, .32); color: var(--ink); }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-deep); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--bar); }
h2 { font-size: 18px; font-weight: 700; color: var(--bar); }
h3 { font-size: 14px; font-weight: 700; color: var(--bar); display: flex; align-items: center; gap: 6px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bad-text { color: var(--bad); font-weight: 600; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--orange); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }
* { scrollbar-width: thin; scrollbar-color: #B9C6D1 transparent; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 15px; height: 15px; }
.ic-xl { width: 44px; height: 44px; stroke-width: 1.4; }

/* ---------- buttons and fields ---------- */
.btn, .btn-navy, .btn-ghost, .btn-small, .btn-quiet {
  font: 700 14px/1.2 var(--font); border-radius: 10px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active, .btn-navy:active, .btn-ghost:active, .btn-small:active { transform: translateY(1px); }
.btn { background: var(--orange); color: #fff; border: 0; box-shadow: 0 2px 0 var(--orange-deep), 0 6px 16px rgba(243, 113, 33, .25); }
.btn:hover { background: #F8812F; color: #fff; }
.btn-navy { background: var(--navy); color: #fff; border: 0; box-shadow: 0 2px 0 var(--navy-deep); }
.btn-navy:hover { background: #075D92; color: #fff; }
.btn-ghost { background: var(--paper); color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-quiet { background: transparent; color: var(--muted); border: 0; padding: 0 10px; font-weight: 600; }
.btn-quiet:hover { color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; background: var(--paper); color: var(--navy); border: 1.5px solid var(--line); }
.btn-small:hover { border-color: var(--navy); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-wide { width: 100%; }
button:disabled { opacity: .55; cursor: progress; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--navy); font: 600 13px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

input, select, textarea {
  font: 15px/1.4 var(--font); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 9px; padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #7B848D; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(51, 192, 204, .25); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23004F7E' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; flex: none; margin: 0; accent-color: var(--navy); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-foot, .dlg-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-height: 36px; padding: 6px 10px; }

/* ---------- command bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h); background: var(--bar); color: #fff;
  display: flex; align-items: center; gap: 14px; padding: 0 16px; box-shadow: 0 2px 10px rgba(7, 31, 51, .25);
}
.plate { display: inline-flex; flex: none; padding: 4px 8px; border-radius: 8px; background: #fff; }
.plate img { display: block; height: 28px; width: auto; }
.bar-title { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #9FB4C5; }
.search-wrap { position: relative; flex: 1; max-width: 520px; margin-left: 8px; display: flex; align-items: center; }
.search-wrap .ic { position: absolute; left: 11px; color: #9FB4C5; pointer-events: none; }
.search { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; padding-left: 38px; min-height: 40px; }
.search::placeholder { color: #8FA5B7; }
.search:focus { background: rgba(255, 255, 255, .12); border-color: var(--teal); box-shadow: none; }
.btn-new { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; margin-left: auto; border: 1px solid rgba(255, 255, 255, .16); }
.btn-new:hover { background: #075D92; color: #fff; }
.who { background: none; border: 0; padding: 0; cursor: pointer; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--bar); font-weight: 800; font-size: 13px; }
.avatar-s { width: 24px; height: 24px; font-size: 10px; }
.timer-pill { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(243, 113, 33, .2); border: 1px solid rgba(243, 113, 33, .5); white-space: nowrap; }
.timer-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- frame ---------- */
.frame { display: flex; min-height: calc(100vh - var(--bar-h)); }
.rail { width: 92px; flex: none; background: var(--paper); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); }
.rail a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.rail a:hover { background: var(--ground); color: var(--ink); }
.rail a.on { background: #E6EEF5; color: var(--navy); }
.rail .count { position: absolute; top: 4px; right: 14px; min-width: 20px; height: 20px; border-radius: 10px; font-size: 11px; display: grid; place-items: center; padding: 0 5px; color: #fff; }
.count.bad { background: var(--bad-fill); }
.tabbar { display: none; }
.main { flex: 1; min-width: 0; outline: none; }

/* ---------- inbox and split ---------- */
.split { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; height: calc(100vh - var(--bar-h)); }
.list-pane { overflow-y: auto; border-right: 1px solid var(--line); background: var(--ground); }
.detail-pane { overflow-y: auto; background: var(--paper); outline: none; }
.detail-pane.placeholder { display: grid; place-items: center; background: var(--ground); }
.placeholder-inner { text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.loading { padding: 40px; color: var(--muted); }

.pane-head { position: sticky; top: 0; z-index: 5; background: rgba(243, 246, 249, .96); backdrop-filter: blur(8px); padding: 16px 16px 8px; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.pane-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alarms { display: flex; gap: 6px; margin-left: auto; }
.alarm { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.alarm.bad { background: var(--bad-wash); color: var(--bad); }
.alarm.warn { background: var(--warn-wash); color: var(--warn); }
.alarm.calm { background: var(--ok-wash); color: var(--ok); }
.lanes { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
@media (min-width: 901px) { .lanes { flex-wrap: wrap; overflow: visible; } }
.lane { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft); font: 600 13px var(--font); cursor: pointer; }
.lane b { font-size: 12px; color: var(--muted); font-weight: 700; }
.lane[aria-selected="true"] { background: var(--bar); border-color: var(--bar); color: #fff; }
.lane[aria-selected="true"] b { color: #9FB4C5; }
.lane-claude .ic { color: var(--teal-ink); }
.lane-claude[aria-selected="true"] .ic { color: var(--teal); }
.view-switch { display: flex; gap: 14px; }

.tickets { list-style: none; margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.trow-link { display: block; padding: 12px 14px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(7, 31, 51, .04); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.trow-link:hover { border-color: #B8C7D4; box-shadow: var(--shadow); }
.trow.on .trow-link { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy), var(--shadow); }
.trow-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.num { font-weight: 700; color: var(--navy); letter-spacing: .01em; }
.age { margin-left: auto; }
.src { color: var(--muted); display: inline-flex; }
.by-claude { display: inline-flex; color: var(--teal-ink); }
.prio { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.prio-critical { color: var(--bad); }
.prio-high { color: var(--warn); }
.prio-normal { color: var(--muted); }
.trow-subject { font-weight: 700; font-size: 15px; color: var(--bar); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trow.unread .trow-subject::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 7px; vertical-align: 2px; }
.trow-who { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }
.trow-blurb { font-size: 13px; color: var(--muted); margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trow-blurb.is-claude { color: var(--teal-ink); }
.trow-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.status { font-size: 12px; color: var(--muted); margin-left: auto; }
.tickets.compact .trow-blurb { display: none; }

/* the fuse */
.fuse { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; min-width: 0; }
.fuse-track { width: 64px; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; flex: none; }
.fuse-burn { display: block; width: 100%; height: 100%; background: var(--ok); transform-origin: left center; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.fuse-text { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.fuse-ok .fuse-text { color: var(--ok); }
.fuse-warn .fuse-burn { background: var(--warn-fill); }
.fuse-warn .fuse-text { color: var(--warn); }
.fuse-bad .fuse-track { background: var(--bad-fill); }
.fuse-bad .fuse-text { color: var(--bad); }
.fuse-done .fuse-track, .fuse-late .fuse-track, .fuse-none .fuse-track { display: none; }
.fuse-done .fuse-text { color: var(--muted); font-weight: 600; }
.fuse-late .fuse-text { color: var(--warn); font-weight: 600; }
.fuse-big { font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--ground); }
.fuse-big .fuse-track { width: 90px; height: 8px; }
.fuse-big.fuse-bad { background: var(--bad-wash); }
.fuse-big.fuse-warn { background: var(--warn-wash); }
.fuse-big.fuse-ok { background: var(--ok-wash); }

.empty { padding: 48px 24px; text-align: center; display: grid; gap: 6px; }
.empty-big { font-size: 20px; font-weight: 800; color: var(--bar); }

/* ---------- ticket ---------- */
.ticket-pane { padding: 20px 24px 40px; max-width: 1180px; }
.tk-head { display: flex; align-items: flex-start; gap: 14px; }
.back { display: none; color: var(--navy); padding: 6px; margin: -4px 0 0 -8px; border-radius: 8px; }
.tk-title { flex: 1; min-width: 0; }
.tk-title h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.tk-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tk-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 18px; padding: 12px; background: var(--ground); border-radius: var(--radius); }
.mini-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini-field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-field select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: 14px; font-weight: 600; }
.mini-field b { min-height: 40px; display: flex; align-items: center; }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.tk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tk-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(7, 31, 51, .04); }
.kv { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.kv .k { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.plan { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-soft); vertical-align: 2px; }
.plan-partner { background: var(--bar); color: #fff; }
.plan-plus { background: #DCEAF5; color: var(--navy); }
.device { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.device-head { display: flex; align-items: center; gap: 8px; color: var(--bar); }
.device-facts { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.online { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.online.yes { background: var(--ok-wash); color: var(--ok); }
.online.no { background: var(--line-soft); color: var(--muted); }

.claude-card { background: var(--teal-wash); border-color: #BFE6EA; }
.claude-card h3 { color: var(--teal-ink); }
.claude-card .conf { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--teal-ink); text-transform: none; }
.claude-summary { font-size: 14px; color: var(--bar); }
.claude-card details summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--teal-ink); }
.fix { white-space: pre-wrap; font: 13px/1.5 var(--font); margin: 8px 0 0; background: var(--paper); border-radius: 8px; padding: 10px; border: 1px solid #BFE6EA; }
.claude-card.pending { background: var(--paper); }

.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border-radius: var(--radius); padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); }
.msg-in { background: var(--paper); }
.msg-out { background: #EEF4FA; border-color: #D3E2EF; margin-left: 28px; }
.msg-auto { background: transparent; border-style: dashed; margin-left: 28px; color: var(--muted); }
.msg-note { background: #FFF8EC; border-color: #F3DDB4; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; color: var(--bar); }
.msg-head time { margin-left: auto; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; max-width: 72ch; }
.msg-auto .msg-body { font-size: 13px; max-height: 6.5em; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-soft); text-decoration: none; }
.chip-orange { background: #FDE9DB; color: #A4430A; }
.atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.composer { gap: 10px; border-width: 1.5px; border-color: #C5D3DF; }
.composer.from-claude { border-color: #9ED9DF; }
.compose-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin: -2px 0 2px; }
.compose-tabs button { background: none; border: 0; border-radius: 0; border-bottom: 3px solid transparent; padding: 8px 10px 9px; font: 700 13px var(--font); color: var(--muted); cursor: pointer; }
.compose-tabs button[aria-selected="true"] { color: var(--bar); border-bottom-color: var(--orange); }
.claude-tag { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--teal-ink); font-weight: 600; background: var(--teal-wash); padding: 6px 10px; border-radius: 8px; }
.to-row { display: flex; align-items: center; gap: 10px; }
.to-row label { font-size: 13px; font-weight: 700; color: var(--muted); }
.to-row input { min-height: 38px; padding: 6px 10px; }
.reply-box { min-height: 170px; }
.compose-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose-foot select { width: auto; min-height: 40px; font-size: 14px; }
.btn-send { min-width: 120px; }
.banner { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.banner.info { background: #E6EEF5; color: var(--navy); }
.banner.bad { background: var(--bad-wash); color: var(--bad); }
.close-bar { display: flex; gap: 10px; align-items: center; padding-top: 4px; }
.closed-card { background: var(--ground); }

.time-card .total { margin-left: auto; font-size: 14px; color: var(--navy); }
.time-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.timer-on { background: #FDE9DB; border-color: var(--orange); color: #A4430A; }
.time-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.time-list li { display: flex; align-items: center; gap: 8px; }
.time-list li > span:first-child { font-weight: 700; min-width: 48px; }
.x { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; display: inline-flex; }
.x:hover { color: var(--bad); background: var(--bad-wash); }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.history summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.history ol { margin-top: 8px; }

/* ---------- pages ---------- */
.page { padding: 24px; max-width: 1180px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 680px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; font-weight: 600; text-decoration: none; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols-wide { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.notes { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.client-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.client-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.client-list a:hover { border-color: var(--navy); }
.client-list b { color: var(--bar); font-size: 15px; }
.client-list .muted { grid-column: 1; }
.open-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.open-count.has { color: var(--navy); }
.inactive { opacity: .55; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.people li:first-child { border-top: 0; padding-top: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- dialogs and toasts ---------- */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(7, 31, 51, .3); color: var(--ink); }
.dlg::backdrop { background: rgba(7, 31, 51, .45); backdrop-filter: blur(2px); }
.dlg-inner { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg .preview { font-size: 13.5px; min-height: 220px; }
.dlg[open] { animation: rise .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; transition: opacity .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1); background: var(--bar); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(7, 31, 51, .3); max-width: calc(100vw - 32px); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { background: var(--bad); }

/* ---------- sign-in and rating pages ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--bar); }
.auth-card { width: min(400px, 100%); background: var(--paper); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.auth-card .plate { align-self: flex-start; padding: 0; }
.auth-card .plate img { height: 44px; }
.auth-card form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.auth-card label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-top: 6px; }
.auth-card .btn { margin-top: 12px; }
.alert { background: var(--bad-wash); color: var(--bad); padding: 10px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.rate-card { width: min(460px, 100%); }
.stars { border: 0; padding: 0; margin: 4px 0 6px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.star { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0 !important; }
.star input { position: absolute; opacity: 0; }
.star span { font-size: 22px; font-weight: 800; color: var(--navy); }
.star small { font-size: 11px; color: var(--muted); text-align: center; }
.star:has(input:checked) { border-color: var(--navy); background: #E6EEF5; box-shadow: 0 0 0 1px var(--navy); }
.star:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ---------- printable report ---------- */
body.report { background: #E9EEF2; }
.report-tools { display: flex; gap: 10px; justify-content: center; padding: 16px; }
.sheet { width: min(210mm, 100%); margin: 0 auto 40px; background: #fff; padding: 18mm 16mm; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 14px; }
.sheet-head > div { text-align: right; }
.sheet-head h1 { font-size: 26px; }
.report-label { font-size: 13px; font-weight: 700; color: var(--orange-deep); }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.figures div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.figures b { font-size: 24px; color: var(--navy); font-weight: 800; }
.figures span { font-size: 12px; color: var(--muted); }
.sheet h2 { font-size: 16px; margin-top: 6px; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sheet-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1.5px solid var(--line); padding: 6px 6px; }
.sheet-table td { border-bottom: 1px solid var(--line-soft); padding: 7px 6px; vertical-align: top; }
.sheet-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
@media print {
  @page { size: A4; margin: 0; }
  body.report { background: #fff; }
  .no-print { display: none !important; }
  .sheet { box-shadow: none; margin: 0; width: auto; }
  .sheet-table tr { break-inside: avoid; }
}

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .bar { gap: 10px; padding: 0 12px; }
  .bar-title, .btn-new span, .timer-pill { display: none; }
  .search-wrap { margin-left: 0; }
  .btn-new { margin-left: 0; padding: 0 10px; }
  .rail { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(7, 31, 51, .06); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
  .tabbar a.on { color: var(--navy); }
  .tabbar a.on .ic { stroke-width: 2.3; }
  .frame { min-height: 0; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .split { display: block; height: auto; }
  .split.has-detail .list-pane { display: none; }
  .split:not(.has-detail) .detail-pane { display: none; }
  .list-pane { border-right: 0; overflow: visible; }
  .pane-head { top: var(--bar-h); }
  .detail-pane { overflow: visible; }
  .ticket-pane { padding: 14px 14px 28px; }
  .back { display: inline-flex; }
  .tk-head { flex-wrap: wrap; }
  .tk-head .fuse-big { width: 100%; }
  .tk-title h2 { font-size: 19px; }
  .tk-controls { grid-template-columns: 1fr 1fr; padding: 10px; }
  .tk-grid { grid-template-columns: 1fr; }
  .tk-side { position: static; }
  .msg-out, .msg-auto { margin-left: 14px; }
  .compose-foot .btn-send, .compose-foot .btn-navy { flex: 1; }
  .close-bar { flex-direction: column-reverse; align-items: stretch; }
  .close-bar .spacer { display: none; }
  .btn, .btn-navy, .btn-ghost { white-space: nowrap; }
  .page { padding: 16px 14px; }
  .cols, .cols-wide { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr 1fr; }
  .sheet { padding: 20px 16px; }
  .sheet-head { flex-direction: column; align-items: flex-start; }
  .sheet-head > div { text-align: left; }
  .toast { bottom: calc(var(--tab-h) + 16px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
