:root,
[data-theme="dark"] {
  --background: #0b0e13;
  --surface: #11151d;
  --surface-2: #161b26;
  --border: #232a38;
  --foreground: #e6e9ef;
  --muted: #8b93a5;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --menu: #252b3a;
  --menu-border: #404960;
  --menu-hover: #323a4d;
  color-scheme: dark;
}

[data-theme="light"] {
  --background: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #d8dde6;
  --foreground: #111827;
  --muted: #6b7280;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --menu: #ffffff;
  --menu-border: #d8dde6;
  --menu-hover: #eef0f4;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --background: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #eef0f4;
    --border: #d8dde6;
    --foreground: #111827;
    --muted: #6b7280;
    --accent: #d97706;
    --accent-soft: rgba(217, 119, 6, 0.12);
    --menu: #ffffff;
    --menu-border: #d8dde6;
    --menu-hover: #eef0f4;
    color-scheme: light;
  }
}

:root[data-theme="system"] {
  color-scheme: light dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.error { color: #f87171; }
.accent-link { color: var(--accent); text-decoration: none; }
.accent-link:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ inputs */

input[type="text"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  padding: 9px 12px;
  font: inherit;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }

button { font: inherit; cursor: pointer; }

.btn-accent {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 13px;
}
.btn-accent:hover { filter: brightness(1.1); }
.btn-accent:disabled { opacity: 0.4; cursor: default; }
.btn-sm { padding: 6px 11px; font-size: 12px; }

.btn-outline {
  background: var(--surface-2);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn-outline:hover { border-color: var(--accent); }

.icon-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 17px;
  color: var(--foreground);
}
.icon-btn:hover { border-color: var(--accent); }

.chip-btn {
  margin-left: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  padding: 2px 8px;
  font-size: 11px;
}
.chip-btn:hover { border-color: var(--accent); }

/* ------------------------------------------------------------ layout */

.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ----------------------------------------------------------- sidebar */

.sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 14px; margin: 0; letter-spacing: 0.02em; }
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.sidebar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn-sm { width: 28px; height: 28px; font-size: 13px; color: var(--muted); }
.icon-btn-sm:hover { color: var(--foreground); }
.sidebar-search { padding: 0 16px 8px; }
.sidebar-search input[type="text"] { width: 100%; margin-bottom: 8px; }
.search-status-filter {
  width: 100%;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 6px 8px;
  font-size: 12px;
  color: var(--foreground);
}
.loads-filter { padding: 0 16px 8px; }
.loads-filter-row { display: flex; gap: 8px; margin-bottom: 8px; }
.loads-filter-row select,
.loads-filter-row input[type="date"] {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
}
.loads-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { color: var(--text); }
.completed-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.sidebar-tabs { display: flex; gap: 4px; padding: 0 16px 8px; }
.tab {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}
.tab:hover { color: var(--foreground); }
.tab.active {
  background: var(--surface-2);
  color: var(--foreground);
  border-color: var(--border);
}
.search-note { padding: 0 16px 8px; font-size: 11px; }
.channel-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.channel.archived { opacity: 0.7; }

.channel {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  color: var(--foreground);
  display: block;
}
.channel:hover { background: rgba(22, 27, 38, 0.6); }
.channel.active { background: var(--surface-2); border-color: var(--border); }
.channel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.channel-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.channel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.channel-preview {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
}
.badge.c-sky { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.badge.c-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge.c-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge.c-violet { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge.c-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge.c-orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.badge.c-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge.c-zinc { background: rgba(113, 113, 122, 0.15); color: #a1a1aa; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.c-sky { background: #38bdf8; }
.dot.c-amber { background: #fbbf24; }
.dot.c-emerald { background: #34d399; }
.dot.c-violet { background: #a78bfa; }
.dot.c-rose { background: #fb7185; }
.dot.c-orange { background: #fb923c; }
.dot.c-cyan { background: #22d3ee; }
.dot.c-zinc { background: #a1a1aa; }

.empty-list { text-align: center; padding: 32px 12px; color: var(--muted); }

/* -------------------------------------------------------------- main */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.chat-title h2 {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-title p { margin: 3px 0 0; }
.header-controls { display: flex; align-items: center; gap: 12px; }
.header-controls select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  padding: 6px 8px;
  font-size: 12px;
  outline: none;
}
.header-controls select:focus { border-color: var(--accent); }
.sending-as { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sending-as input { width: 130px; padding: 6px 10px; font-size: 12px; }

/* ------------------------------------------------------------ thread */

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.day-divider::before, .day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.day-divider span { font-size: 11px; font-weight: 500; color: var(--muted); }

.msg { display: flex; padding: 4px 0; }
.msg.mine { justify-content: flex-end; }
.msg-inner { max-width: 70%; }
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 4px;
}
.msg.mine .msg-head { justify-content: flex-end; }
.msg-sender { font-size: 12px; font-weight: 600; }
.msg-time { font-size: 11px; color: var(--muted); }
.msg-bubble {
  background: var(--surface-2);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 10px 16px;
  line-height: 1.5;
  word-wrap: break-word;
}
.msg-text { white-space: pre-wrap; }
.msg.mine .msg-bubble {
  background: var(--accent);
  color: #000;
  border-radius: 16px;
  border-top-right-radius: 4px;
}
.msg-files { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.msg-bubble:has(> .msg-files:first-child) { padding-top: 8px; }
.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(11, 14, 19, 0.6);
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.file-card:hover { background: rgba(11, 14, 19, 0.9); }
.msg.mine .file-card { background: rgba(0, 0, 0, 0.15); }
.msg.mine .file-card:hover { background: rgba(0, 0, 0, 0.25); }
.file-card .file-name {
  font-size: 12px;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-card .file-meta { font-size: 10px; color: var(--muted); }
.img-card {
  display: block;
  width: 100%;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.img-card img {
  display: block;
  max-width: 100%;
  max-height: 256px;
  border-radius: 8px;
  object-fit: contain;
}
.msg.mine .file-card .file-meta { color: rgba(0, 0, 0, 0.6); }

.attachment-actions { position: relative; }
.attachment-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 20;
  min-width: 10.5rem;
  margin-top: 4px;
  background: var(--menu);
  color: var(--foreground);
  border: 1px solid var(--menu-border);
  border-radius: 10px;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.attachment-menu.open { display: block; }
.attachment-menu a,
.attachment-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  text-decoration: none;
  color: var(--foreground);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.attachment-menu a:hover,
.attachment-menu button:hover { background: var(--menu-hover); }
.attachment-preview img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  object-fit: contain;
}
.attachment-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
.attachment-rename .dialog { width: 100%; max-width: 420px; }
.attachment-rename .rename-input { width: 100%; margin-top: 12px; }
.attachment-rename .rename-error { margin-top: 8px; }
.empty-thread { text-align: center; color: var(--muted); padding: 64px 0; }

/* ---------------------------------------------------------- composer */

.composer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 24px;
}
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.doc-type-select {
  height: 40px;
  max-width: 8.5rem;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0 8px;
  font-size: 12px;
  color: var(--foreground);
}
.doc-type-select.hidden { display: none; }
.config-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.config-section-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.theme-select {
  max-width: 14rem;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 0 10px;
  font-size: 12px;
  color: var(--foreground);
}
.config-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
}
.sound-enable-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  width: 100%;
  text-align: left;
}
.sound-enable-banner.hidden { display: none; }
.sound-enable-banner-driver {
  flex-direction: column;
  align-items: stretch;
  padding: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  color: inherit;
}
.sound-enable-banner-driver .sound-enable-banner-text { display: block; line-height: 1.4; }
.sound-enable-banner-driver .sound-enable-banner-cta {
  display: inline-block;
  margin-top: 10px;
  align-self: flex-start;
}
.sound-enable-banner-warn {
  background: color-mix(in srgb, var(--accent-soft) 50%, #f59e0b 20%);
  border-bottom-color: color-mix(in srgb, var(--border) 70%, #f59e0b 30%);
}

.driver-alert-setup {
  margin: 0 16px 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft) 8%);
}
.driver-alert-setup.hidden { display: none; }
.driver-alert-setup-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}
.driver-alert-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.driver-alert-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  opacity: 0.45;
}
.driver-alert-step-active { opacity: 1; }
.driver-alert-step-done { opacity: 0.7; }
.driver-alert-step-done .driver-alert-step-num {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
}
.driver-alert-step-disabled .driver-alert-step-body > *:not(p) {
  pointer-events: none;
  opacity: 0.5;
}
.driver-alert-step-num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--muted);
}
.driver-alert-step-body { min-width: 0; flex: 1; }
.driver-alert-step-body strong { display: block; font-size: 13px; margin-bottom: 4px; }
.driver-alert-step-body p { margin: 0 0 8px; line-height: 1.4; }
.driver-alert-step-body .btn-accent { margin-top: 2px; }
.driver-alert-status { display: block; margin-top: 6px; }
.driver-session-audio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.driver-session-audio.hidden { display: none; }
.dialog-wide { max-width: 560px; }
.composer textarea {
  resize: vertical;
  min-height: 40px;
  max-height: 160px;
}
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chips:not(:empty) { margin-bottom: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
}
.chip button {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}
.chip button:hover { color: var(--foreground); }

/* -------------------------------------------------------------- docs */

.docs {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.docs-header {
  border-bottom: 1px solid var(--border);
  padding: 16px;
}
.docs-header h2 { margin: 0; font-size: 14px; }
.docs-header p { margin: 3px 0 0; }
.doc-list { flex: 1; overflow-y: auto; padding: 12px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(22, 27, 38, 0.6);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.doc-item:hover { border-color: var(--border); background: var(--surface-2); }
.doc-item .doc-info { min-width: 0; flex: 1; }
.doc-item .file-name {
  font-size: 12px;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-item .file-meta { font-size: 11px; color: var(--muted); }
.doc-arrow { color: var(--muted); }
.empty-docs { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 12px; }
.docs-footer { border-top: 1px solid var(--border); padding: 16px; }
.docs-footer .btn-outline { width: 100%; }

/* ----------------------------------------------------------- dialogs */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.dialog {
  width: 100%;
  max-width: 440px;
  min-height: 0;
  max-height: min(90vh, calc(100vh - 32px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin: auto;
}
.dialog h2 { margin: 0 0 14px; font-size: 14px; }
.dialog .dialog-sub { margin: -10px 0 14px; line-height: 1.5; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 10px; }
.form-row .btn-outline { flex-shrink: 0; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.status-rows { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.status-row { display: flex; align-items: center; gap: 6px; }
.status-move { display: flex; flex-direction: column; gap: 2px; }
.status-move button {
  width: 20px; height: 14px; padding: 0; font-size: 8px; line-height: 1;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px;
  color: var(--muted); cursor: pointer;
}
.status-move button:disabled { opacity: 0.3; cursor: default; }
.status-move button:not(:disabled):hover { color: var(--text); }
.final-toggle { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.status-row input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px; }
.status-row select, .status-add select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  padding: 6px;
  font-size: 12px;
  outline: none;
}
.status-row .builtin { width: 52px; text-align: center; font-size: 10px; color: var(--muted); }
.status-row .del {
  width: 52px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  padding: 6px 0;
  font-size: 11px;
}
.status-row .del:hover { border-color: #f87171; color: #f87171; }
.status-add { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.status-add input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px; }
.form-stack label { display: block; margin-bottom: 6px; font-weight: 500; }

/* ------------------------------------------------------------- login */

.login-wrap {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.login-brand h1 { margin: 0; font-size: 14px; }
.login-brand p { margin: 2px 0 0; }
.login-card input { margin-bottom: 12px; }
.login-card .btn-accent { width: 100%; }
.login-card .error { margin: -4px 0 10px; }

/* ----------------------------------------------------- driver portal */

.driver-app {
  max-width: 680px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.driver-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  flex-wrap: wrap;
}
.driver-alert-chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--foreground);
}
.driver-alert-chip.hidden { display: none; }
.driver-alert-chip-ok {
  background: color-mix(in srgb, #22c55e 18%, var(--surface));
  border-color: color-mix(in srgb, #22c55e 40%, var(--border));
  color: color-mix(in srgb, #22c55e 80%, var(--foreground));
}
.driver-alert-chip-warn {
  background: color-mix(in srgb, #f59e0b 18%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 40%, var(--border));
}
.driver-alert-chip-bad {
  background: color-mix(in srgb, #ef4444 15%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 35%, var(--border));
}
.driver-alert-checklist {
  list-style: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--border) 10%);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.driver-alert-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}
.driver-alert-check.hidden { display: none; }
.driver-alert-check-icon {
  flex: 0 0 18px;
  width: 18px;
  text-align: center;
  font-weight: 700;
}
.driver-alert-check-ok { color: #22c55e; }
.driver-alert-check-fail { color: #ef4444; }
.driver-alert-check-guide { color: #f59e0b; }
.driver-alert-check-pending { color: var(--muted); }
.driver-phone-settings-guide {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 12px;
}
.driver-phone-settings-guide.hidden { display: none; }
.driver-phone-settings-guide summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 6px;
}
.driver-phone-settings-guide ol {
  margin: 8px 0 10px 18px;
  padding: 0;
}
.driver-phone-settings-guide li { margin-bottom: 4px; }
.driver-header h1 {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-header p { margin: 2px 0 0; }
.driver-app .thread { padding: 12px 16px; }
.driver-app .composer { padding: 12px 16px; }
.driver-app .composer-row { flex-wrap: wrap; }
.driver-app .doc-type-select { max-width: 100%; min-width: 6.5rem; flex: 1 1 6.5rem; }
.driver-app .msg-inner { max-width: 82%; }
.center-note {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

@media (max-width: 900px) {
  .docs { display: none; }
  .sidebar { width: 260px; }
}
