/* Thoth Desk theme — enterprise layout, Apple-style finish. Overrides index.html inline styles. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", Roboto, sans-serif;
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f0f0f3; --ink: #1d1d1f; --muted: #636366; --line: #e3e3e8;
  --accent: #0a66c2; --accent-ink: #ffffff; --accent-soft: #e8f1fb;
  --ok: #1f8f4e; --warn: #c27c0e; --danger: #d0342c;
  --sidebar: #fbfbfd; --sidebar-ink: #1d1d1f; --sidebar-muted: #6e6e73;
  --radius-s: 8px; --radius: 12px; --radius-l: 16px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
  --shadow-2: 0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.05);
  --shadow: var(--shadow-2);
  --header-h: 56px; --ease: cubic-bezier(.2,.8,.2,1);
  --text: var(--ink); --card: var(--surface); --border: var(--line); --sans: var(--font); --serif: var(--font);
}
html, body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font); letter-spacing: -0.01em; }
* { transition-timing-function: var(--ease); scrollbar-width: thin; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --ink: #f5f5f7; --muted: #a1a1a6; --line: #38383a;
    --accent: #3b8ef0; --accent-soft: #10243d; --sidebar: #161618; --sidebar-ink: #f5f5f7; --sidebar-muted: #8e8e93;
    --shadow-1: 0 1px 2px rgba(0,0,0,.5); --shadow-2: 0 6px 20px rgba(0,0,0,.45); }
}

/* Override hard-coded light colours from index.html (large areas) */
#app, .workspace, .panes, #login { background: var(--bg); color: var(--ink); }
.list, .pane, .desk-col, .app-top-bar, .login-card,
.access-modal-panel, .drawer-panel, .modal-panel,
.comp-card, .wf-card, .dash-kpi, .dash-trend-wrap, .dash-table-wrap, .dash-drawer,
.ref-list, .ref-detail, .col, table { background: var(--surface); color: var(--ink); }
nav button.active,
.workspace-switch button.active { background: var(--bg); color: var(--ink); }
.item:hover, .desk-view-btn:hover, .desk-ticket-row:hover,
.dash-kpi.dash-kpi-click:hover { background: var(--surface-2); }
.item.active, .desk-view-btn.active, .desk-ticket-row.active { background: var(--surface-2); }
.pane-compose, .desk-thread, .pwa-ios-banner, th, .deal-card,
.msg.in, .desk-bubble.in { background: var(--surface-2); color: var(--ink); }
#mktPreview { background: var(--surface); }

/* T062 — global header bar */
#app { grid-template-rows: var(--header-h) minmax(0, 1fr); }
.app-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 0 16px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.app-header-left, .app-header-right { display: flex; align-items: center; gap: 10px; }
.app-header-center { display: flex; align-items: center; justify-content: center; min-width: 0; }
.app-wordmark { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
.app-search { max-width: 520px; width: 100%; justify-self: center; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; color: var(--ink); }
.app-header .workspace-switch { margin: 0; }
.app-header .workspace-switch button { flex: none; padding: 6px 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.app-header .workspace-switch button.active { background: var(--bg); color: var(--ink); border-color: transparent; }
.app-header #agentIdentity { color: var(--muted); padding: 0; }
.app-header .nav-toggle { position: static; }
.app-header #localeSelect { width: auto; margin: 0; max-width: 140px; }
#app > .workspace { height: auto; min-height: 0; }
@media (max-width: 700px) { .app-header-center { display: none; } }

/* T063 — grouped light navigation */
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); width: 248px; color: var(--sidebar-ink); }
nav button { width: 100%; height: 36px; border-radius: 8px; text-align: left; color: var(--sidebar-ink);
  background: transparent; border: 0; padding: 0 12px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
nav button:hover { background: var(--surface-2); color: var(--sidebar-ink); }
nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-muted); margin: 16px 12px 6px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.app-header .nav-collapse { height: 32px; width: 32px; padding: 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 1; }
body.nav-collapsed .sidebar { width: 0; overflow: hidden; padding: 0; border: none; }
body.nav-collapsed #app { grid-template-columns: 0 1fr; }
@media (max-width: 700px) {
  body.nav-collapsed .sidebar { width: min(280px, 86vw); overflow: auto; padding: 22px 16px 16px; border-right: 1px solid var(--line); }
  body.nav-collapsed #app { grid-template-columns: 1fr; }
  .app-header .nav-collapse { display: none; }
}

/* T064 — buttons, inputs, selects, badges */
#app button, #login button {
  height: 36px; border-radius: 8px; padding: 0 14px; font-weight: 500; box-sizing: border-box;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
#app button:hover, #login button:hover { background: var(--surface-2); }
#app button:focus-visible, #login button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--accent-soft); }
#app button.primary, #login button.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
}
#app button.primary:hover, #login button.primary:hover {
  background: var(--accent); filter: brightness(.94);
}
#app button.danger, #login button.danger {
  color: var(--danger); background: transparent;
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
#app button.danger:hover, #login button.danger:hover { background: transparent; }
#app input, #app select, #app textarea,
#login input, #login select, #login textarea {
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 12px; min-height: 36px; box-sizing: border-box; color: var(--ink);
}
#app input:focus-visible, #app select:focus-visible, #app textarea:focus-visible,
#login input:focus-visible, #login select:focus-visible, #login textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
#app .badge, #login .badge {
  display: inline-block; border-radius: 999px; font-size: 12px; padding: 2px 8px;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink);
}
#app .badge.pending_agent, #login .badge.pending_agent {
  background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn);
}
#app .badge.assigned, #login .badge.assigned {
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
#app .badge.waiting_customer, #login .badge.waiting_customer {
  background: color-mix(in srgb, var(--muted) 14%, transparent); color: var(--muted);
}
#app .badge.closed, #login .badge.closed {
  background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok);
}
/* keep T063 nav + header controls above default button chrome */
#app nav button {
  width: 100%; height: 36px; border-radius: 8px; text-align: left; color: var(--sidebar-ink);
  background: transparent; border: 0; padding: 0 12px; font-size: 13.5px; font-weight: 500;
  box-shadow: none; filter: none;
}
#app nav button:hover { background: var(--surface-2); color: var(--sidebar-ink); }
#app nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#app .app-header .workspace-switch button {
  flex: none; padding: 6px 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--muted); height: auto; box-shadow: none; filter: none;
}
#app .app-header .workspace-switch button.active { background: var(--bg); color: var(--ink); border-color: transparent; }
#app .app-header .nav-collapse {
  height: 32px; width: 32px; padding: 0; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); box-shadow: none; filter: none;
}

/* T065 — cards / panels and data tables */
.comp-card, .wf-card, .deal-card, .dash-kpi, .dash-trend-wrap,
.access-modal-panel, .drawer-panel, .modal-panel, .desk-side {
  background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-1);
  border: 1px solid var(--line); padding: 20px;
}
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); box-shadow: none; border-radius: 0; overflow: visible;
}
th {
  position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--muted);
  font-size: 12px; text-transform: uppercase; font-weight: 600; letter-spacing: .06em;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
td { padding: 12px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--surface-2); }
.table-wrap, .dash-table-wrap {
  overflow: auto; border-radius: var(--radius-l); border: 1px solid var(--line); background: var(--surface);
}

/* T066 — page header + content width; T088 — actions wrap under 700px */
.page-header { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; padding: 24px 0 16px; }
.page-header h1 { font-size: 28px; font-weight: 600; margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.page-header .actions { display:flex; gap:8px; flex-wrap: wrap; align-items:center; justify-content:flex-end; }
.page-header .dash-toolbar { margin-bottom: 0; }
.page {
  max-width: 1440px; margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px; box-sizing: border-box;
}
#deskInboxView.desk-inbox {
  grid-template-rows: auto 1fr;
  max-width: 1440px; width: 100%; margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px; box-sizing: border-box;
}
#deskInboxView > .page-header { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .page, #deskInboxView.desk-inbox { padding-left: 16px; padding-right: 16px; }
  .page-header { align-items: flex-start; }
  .page-header .actions { width: 100%; justify-content: flex-start; }
}

/* T069 — home springboard */
.home-group { margin-bottom: 24px; }
.home-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.home-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-1); padding: 20px; min-height: 120px; height: auto; width: 100%;
  cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.home-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); background: var(--surface); }
.home-tile-icon {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex-shrink: 0;
}
.home-tile-name { font-size: 16px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; width: 100%; }
.home-tile-desc { font-size: 13px; color: var(--muted); line-height: 1.35; }
.home-tile-count { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
@media (max-width: 700px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-tile { padding: 14px; min-height: 100px; }
}
.app-wordmark { cursor: pointer; }

/* T070 — inbox list-detail + iOS chat bubbles */
.desk-views, #deskPaneViews { background: var(--surface); }
.desk-view-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; font-size: 13px; height: auto; box-shadow: none;
}
.desk-view-btn:hover { background: var(--surface-2); }
.desk-view-btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: none; }
.desk-view-count {
  margin-left: auto; background: var(--surface-2); color: var(--muted); border-radius: 999px;
  padding: 2px 8px; font-size: 12px; font-weight: 500; line-height: 1.3;
}
.desk-ticket-row {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px;
  height: 64px; max-height: 64px; padding: 0 12px; box-sizing: border-box;
  border-bottom: 1px solid var(--line); cursor: pointer; position: relative; overflow: hidden;
}
.desk-ticket-row:hover { background: var(--surface-2); }
.desk-ticket-row.active { background: var(--accent-soft); }
.desk-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  flex-shrink: 0; text-transform: uppercase;
}
.desk-ticket-mid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.desk-ticket-title { font-weight: 600; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-ticket-preview { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.desk-ticket-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.desk-ticket-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.desk-unread-dot {
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.desk-ticket-row.is-new { padding-left: 14px; }
.desk-thread { background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.desk-bubble {
  margin: 4px 0; max-width: 72%; padding: 10px 14px; font-size: 14px; line-height: 1.4;
  word-break: break-word; box-sizing: border-box;
}
.desk-bubble.in { background: var(--surface-2); color: var(--ink); border-radius: 18px 18px 18px 4px; }
.desk-bubble.out { background: var(--accent); color: #fff; border-radius: 18px 18px 4px 18px; margin-left: auto; }
.desk-bubble.note {
  background: color-mix(in srgb, var(--warn) 14%, transparent); border-radius: 12px; border: 0; color: var(--ink);
}
.desk-bubble.system { background: transparent; color: var(--muted); font-size: 12px; text-align: center; max-width: 100%; margin: 8px auto; }
.desk-bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.desk-bubble.out .who { color: color-mix(in srgb, #fff 70%, transparent); }
/* T081 — compact ticket action toolbar */
.desk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; }
.desk-actions select { width: auto; max-width: 180px; min-height: 32px; }
.desk-tool { display: inline-flex; gap: 4px; align-items: center; }
.desk-actions button { height: 32px; }
.desk-actions .danger { margin-left: auto; }
@media (max-width: 700px) {
  .desk-actions { overflow-x: auto; flex-wrap: nowrap; }
}

/* T082 — message thread fills available height */
#deskPaneTicket { display: flex; flex-direction: column; min-height: 0; }
.desk-ticket-main { flex: 1; min-height: 0; }
.desk-ticket-main > div:first-child { display: flex; flex-direction: column; min-height: 0; }
#deskThread { flex: 1; min-height: 280px; overflow-y: auto; }
.desk-thread { height: auto; max-height: none; }
.desk-side { position: static; }
@media (max-width: 900px) { #deskThread { min-height: 50vh; } }

.desk-compose {
  position: sticky; bottom: 0; z-index: 2; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow-1); padding: 12px 14px;
}
#deskComposeBody { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
#deskComposeBody textarea {
  flex: 1 1 180px; min-width: 0; border-radius: 16px; resize: vertical; min-height: 44px;
  border: 1px solid var(--line); background: var(--surface-2); padding: 10px 14px;
}
#deskComposeBody > button.primary { margin-left: auto; flex-shrink: 0; }

/* T071 — dashboard infolet tiles */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
#app .dash-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  height: auto; min-height: 0; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line); border-top-width: 3px; border-radius: var(--radius-l);
  background: var(--surface); box-shadow: var(--shadow-1); cursor: default;
}
#app .dash-kpi.dash-kpi-click { cursor: pointer; }
#app .dash-kpi.dash-kpi-click:hover { background: var(--surface-2); }
#app .dash-kpi.status-green { border-top-color: var(--ok); border-left-color: var(--line); }
#app .dash-kpi.status-amber { border-top-color: var(--warn); border-left-color: var(--line); }
#app .dash-kpi.status-red { border-top-color: var(--danger); border-left-color: var(--line); }
#app .dash-kpi.status-grey { border-top-color: var(--muted); border-left-color: var(--line); }
.dash-kpi-top { display: flex; align-items: center; gap: 8px; width: 100%; }
.dash-kpi-top .dash-dot { margin-right: 0; flex-shrink: 0; }
.dash-kpi-label { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.35; }
.dash-kpi-value { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.02em; }
.dash-kpi-sub { font-size: 11px; color: var(--muted); margin: 0; }
.dash-kpi-status { display: none; }
.dash-spark { display: block; width: 120px; height: 32px; margin-top: 4px; }
.dash-dot-amber { background: var(--warn); }
@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; }
}

/* T072 — centred Apple-style login */
#login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px; box-sizing: border-box; grid-template-columns: none;
}
#login .login-card {
  width: min(400px, 100%); background: transparent; padding: 0; display: flex;
  flex-direction: column; align-items: stretch; gap: 16px;
}
#login .login-card .stack {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); box-shadow: var(--shadow-1); padding: 32px 28px; box-sizing: border-box;
}
#login .login-wordmark {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em; text-align: center; margin: 0 0 8px; color: var(--ink);
}
#login .login-subtitle {
  margin: 0 0 24px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.4;
}
#login input, #login select:not(.login-locale) {
  min-height: 44px; height: 44px; padding: 0 12px;
}
#login button.primary {
  width: 100%; height: 44px; margin-top: 18px;
}
#login .login-locale {
  width: 100%; max-width: 400px; min-height: 36px; margin: 0 auto;
  background: transparent; border-color: transparent; color: var(--muted); text-align: center;
}
#login .login-locale:focus-visible { box-shadow: none; border-color: var(--line); outline: 2px solid var(--accent); outline-offset: 2px; }

/* T073 — modals, toasts, empty states */
@keyframes modal-in {
  from { opacity: 0; transform: scale(.98); }
  to { opacity: 1; transform: scale(1); }
}
.access-modal, .modal {
  justify-content: center; align-items: center;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.access-modal-panel, .modal-panel {
  border-radius: 16px; box-shadow: var(--shadow-2);
  animation: modal-in 180ms var(--ease);
}
.pane-notice {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  font-size: 14px; padding: 12px 16px; margin: 8px;
  animation: modal-in 180ms var(--ease);
}
#deskTicketEmpty, .ref-muted,
p[style*="padding:16px;color:var(--muted)"],
p[style*="padding:20px;color:var(--muted)"] {
  text-align: center; color: var(--muted) !important; font-size: 14px; padding: 48px !important; margin: 0;
}

/* T074 / T084 — mobile bottom tab bar (beat generic nav / #app nav rules) */
#app nav.tabbar { display: none; }
@media (max-width: 700px) {
  #app nav.tabbar {
    display: flex; flex-direction: row; flex: none; gap: 0;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line); align-items: stretch; justify-content: space-around;
  }
  #app nav.tabbar button {
    flex: 1; width: auto; height: 56px; border: 0; border-radius: 0; background: transparent; color: var(--muted);
    font-size: 12px; font-weight: 500; padding: 0; text-align: center; box-shadow: none; filter: none;
  }
  #app nav.tabbar button.active { color: var(--accent); font-weight: 600; background: transparent; }
  #app nav.tabbar button.hidden { display: none; }
  .workspace { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .desk-compose { bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .app-header #agentIdentity { display: none; }
  .sidebar-phone-chrome {
    display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-phone-chrome:empty { display: none; border: 0; margin: 0; padding: 0; }
  .sidebar-phone-chrome .workspace-switch { margin: 0; }
  .sidebar-phone-chrome #localeSelect { width: 100%; max-width: none; }
}
@media (min-width: 701px) {
  .sidebar-phone-chrome { display: none; }
}

/* T075 — accessibility */
#app a:focus-visible, #login a:focus-visible,
#app [role="button"]:focus-visible, #login [role="button"]:focus-visible,
#app [tabindex]:not([tabindex="-1"]):focus-visible,
#login [tabindex]:not([tabindex="-1"]):focus-visible,
#app .home-tile:focus-visible, #app .desk-view-btn:focus-visible,
#app .desk-ticket-row:focus-visible, #app .dash-kpi-click:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 3px var(--accent-soft);
}
@media (max-width: 700px) {
  #app button, #login button, #app nav button,
  #app input, #app select, #app textarea,
  #login input, #login select, #login textarea,
  #app .app-search, #app .app-header .nav-collapse {
    min-height: 40px; min-width: 40px;
  }
  #app .app-header .nav-collapse { width: 40px; height: 40px; }
  #app .app-header .workspace-switch button { min-height: 40px; height: 40px; padding: 0 12px; }
  #app .pane-x, #app .tag button, #app .wf-step-actions button { min-width: 40px; min-height: 40px; }
}

/* T083 — collapsible setup banner */
#setupBanner .setup-banner {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}
#setupBanner .setup-banner-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 40px; height: 40px; padding: 0 16px; box-sizing: border-box;
}
#setupBanner .setup-banner-summary { font-size: 13.5px; font-weight: 600; color: var(--warn); }
#setupBanner .setup-banner-toggle {
  height: 28px; min-height: 28px; padding: 0 10px; border-radius: 8px; border: 0;
  background: transparent; color: var(--warn); font-size: 13px; font-weight: 600;
  box-shadow: none; filter: none; cursor: pointer;
}
#setupBanner .setup-banner-toggle:hover { background: color-mix(in srgb, var(--warn) 12%, transparent); }
#setupBanner .setup-banner-body { display: none; padding: 0 16px 10px; }
#setupBanner .setup-banner.open .setup-banner-body { display: block; }
#setupBanner .setup-banner-body ul { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }

/* T076 — public pages */
body.public-page {
  min-height: 100vh; margin: 0; display: flex; justify-content: center;
  background: var(--bg); color: var(--ink); padding: 56px 24px; box-sizing: border-box;
}
.public-card {
  width: min(560px, 100%); max-width: 560px; height: fit-content;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-1); padding: 32px; box-sizing: border-box;
}
