:root {
  color-scheme: light;
  --ink: #0d1e30;
  --ink-soft: #34495c;
  --muted: #6d7c88;
  --paper: #f5f7f7;
  --surface: #ffffff;
  --line: #dce5e7;
  --line-soft: #edf1f2;
  --aqua: #5bb2bc;
  --green: #287783;
  --green-dark: #216973;
  --green-pale: #e6f3f4;
  --blue-pale: #eaf0f4;
  --amber: #bf7b21;
  --amber-pale: #fff3df;
  --danger: #b94f4f;
  --shadow: 0 18px 55px rgba(13, 30, 48, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-brand: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", sans-serif;
  font-family: var(--font-ui);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef5f6;
  --ink-soft: #c7d3d8;
  --muted: #93a6ae;
  --paper: #09141e;
  --surface: #10202b;
  --line: #2a3c48;
  --line-soft: #20323e;
  --green: #6ac0c9;
  --green-dark: #8ed5dc;
  --green-pale: #16343b;
  --blue-pale: #1b3040;
  --amber-pale: #3b2d19;
  --shadow: 0 18px 55px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }

body { min-height: 100dvh; overflow: hidden; }
body.auth-gate-open .app-shell { filter: blur(8px); transform: scale(.995); }

button, input, textarea { font: inherit; }
button { color: inherit; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(22px, var(--safe-top)) 18px max(22px, var(--safe-bottom));
  overflow: auto;
  background: rgba(245, 247, 247, .9);
  backdrop-filter: blur(22px);
}
.auth-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-logo { width: 64px; height: 64px; margin-bottom: 17px; object-fit: contain; }
.auth-card h1 { margin: 7px 0 9px; font-family: var(--font-brand); font-size: 31px; font-weight: 500; letter-spacing: -.7px; }
.auth-intro { max-width: 330px; margin: 0 auto 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-form { display: grid; gap: 10px; text-align: left; }
.auth-confirm { display: grid; gap: 10px; }
.auth-form label { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.auth-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
.auth-form input:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(91,178,188,.14); }
.auth-form input[readonly] { background: var(--blue-pale); color: var(--ink-soft); }
.auth-primary {
  min-height: 50px;
  margin-top: 3px;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.auth-primary:hover { background: var(--green-dark); }
.auth-primary:disabled { opacity: .55; cursor: wait; }
.auth-status { min-height: 20px; margin: 13px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-status[data-tone="success"] { color: var(--green-dark); }
.auth-status[data-tone="warning"] { color: var(--amber); }
.auth-status[data-tone="error"] { color: var(--danger); }
.auth-demo { min-height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--green-dark); font-size: 13px; font-weight: 800; cursor: pointer; }
.auth-link-button { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.auth-link-button:hover { color: var(--green-dark); }
.auth-footnote { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
}

.app-sidebar {
  position: relative;
  grid-area: sidebar;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 13px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 5px 0 18px rgba(13,30,48,.035);
  z-index: 25;
}
.sidebar-brand-row { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.sidebar-brand-mark { width: 39px; height: 39px; flex: 0 0 auto; object-fit: contain; }
.sidebar-brand-copy { min-width: 0; display: grid; gap: 1px; }
.sidebar-brand-copy strong { font-family: var(--font-brand); color: var(--ink); font-size: 23px; font-weight: 500; letter-spacing: -.5px; line-height: 1; }
.sidebar-brand-copy small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.sidebar-close-button, .sidebar-menu-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.sidebar-close-button { display: none; width: 38px; height: 38px; font-size: 26px; }
.sidebar-nav { min-height: 0; display: flex; flex: 1; flex-direction: column; gap: 18px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-section { display: grid; gap: 5px; }
.sidebar-section-label { margin: 0 8px 4px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 1.15px; text-transform: uppercase; }
.sidebar-nav-item { width: 100%; min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 760; text-align: left; cursor: pointer; }
.sidebar-nav-item:hover { background: var(--paper); color: var(--ink); }
.sidebar-nav-item.active { border-color: rgba(91,178,188,.36); background: var(--green-pale); color: var(--green-dark); }
.sidebar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-count { min-width: 21px; height: 21px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--green-dark); font-size: 9px; font-weight: 900; }
.sidebar-count[hidden] { display: none; }
.sidebar-settings-item { margin-top: auto; }
.sidebar-scrim { display: none; }
.sidebar-menu-button { display: none; width: 42px; height: 42px; padding: 10px; border-radius: 11px; }
.sidebar-menu-button span { display: block; height: 2px; margin: 4px 0; border-radius: 99px; background: currentColor; }
.mobile-brand-lockup { display: none; align-items: center; gap: 9px; }

.topbar {
  grid-area: topbar;
  height: calc(76px + var(--safe-top));
  padding: calc(14px + var(--safe-top)) 24px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 2px solid var(--ink);
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 12px rgba(13, 30, 48, 0.08);
  z-index: 10;
}

.brand-lockup, .topbar-actions, .profile-topline, .task-card-header, .safety-card, .title-line { display: flex; align-items: center; }
.brand-mark { width: 46px; height: 46px; display: block; object-fit: contain; }
.topbar h1 { margin: 0; font-family: var(--font-brand); font-size: 30px; font-weight: 400; letter-spacing: -1px; }
.topbar .eyebrow { color: var(--green-dark); }
.topbar-actions { gap: 10px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }

.connection-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 0 4px rgba(91,178,188,.14); }

.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 12px; background: var(--green-pale); color: var(--ink); cursor: pointer; }
.icon-button:hover { background: #d9eef0; }
.icon-button.pale { background: #eff3f1; color: var(--ink-soft); }
.icon-button.pale:hover { background: #e2ebe7; }

.workspace, .work-view, .host-family-view, .settings-view { grid-area: main; }
.workspace { min-height: 0; display: grid; grid-template-columns: 330px minmax(420px, 1fr) 315px; background: var(--surface); }
.inbox-panel, .context-panel { min-height: 0; overflow: auto; background: #fbfcfa; }
.inbox-panel { border-right: 1px solid var(--line); }
.context-panel { padding: 0 20px 24px; border-left: 1px solid var(--line); }
.conversation-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr auto; background: #f5f8f6; }

.panel-heading { min-height: 82px; padding: 20px 2px 16px; display: flex; align-items: center; justify-content: space-between; }
.inbox-heading { padding-inline: 20px; }
.panel-heading h2 { margin: 4px 0 0; font-family: var(--font-brand); font-size: 25px; font-weight: 600; }
.count-badge { display: inline-grid; min-width: 23px; height: 23px; place-items: center; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--green-pale); color: var(--green-dark); font-family: var(--font-ui); font-size: 12px; }

.search-wrap { position: relative; margin: 0 20px 14px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { width: 100%; height: 42px; padding: 0 14px 0 39px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: white; color: var(--ink); font-size: 13px; }
.search-wrap input:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(91,178,188,.16); }

.filter-row { display: flex; gap: 8px; padding: 0 20px 15px; border-bottom: 1px solid var(--line-soft); }
.filter-pill { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px; background: #edf1ef; color: var(--ink-soft); font-size: 13px; font-weight: 700; cursor: pointer; }
.filter-pill.active { background: var(--ink); color: white; }

.conversation-list { padding: 9px; }
.empty-state { min-height: 210px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state > span:last-child { font-size: 13px; line-height: 1.45; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-weight: 900; }
.conversation-item { position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: start; padding: 13px 12px; border: 0; border-radius: 16px; background: transparent; text-align: left; cursor: pointer; }
.conversation-item:hover { background: #f0f4f1; }
.conversation-item.active { background: white; box-shadow: 0 5px 22px rgba(21,59,68,.08); }
.conversation-item.active::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--green); }
.avatar { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: #e7efec; color: var(--green-dark); font-weight: 800; }
.avatar.large { width: 44px; height: 44px; border-radius: 14px; }
.conversation-copy { min-width: 0; }
.conversation-copy h3 { overflow: hidden; margin: 1px 0 4px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.conversation-meta { display: grid; justify-items: end; gap: 7px; }
.conversation-meta time { color: var(--muted); font-size: 10px; }
.unread-dot { min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: var(--green); color: white; font-size: 10px; font-weight: 800; }

.conversation-header { min-height: 76px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.conversation-title { min-width: 0; flex: 1; }
.conversation-title h2 { overflow: hidden; margin: 0; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.title-line { gap: 8px; }
.channel-badge { padding: 4px 7px; border-radius: 7px; font-size: 9px; font-weight: 800; letter-spacing: .4px; }
.channel-badge.whatsapp { background: var(--green-pale); color: var(--green-dark); }
.channel-badge.email { background: var(--blue-pale); color: #4b7088; }
.mobile-back { display: none; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 12px; background: #eff3f1; }

.conversation-scroll { min-height: 0; overflow: auto; padding: 28px clamp(22px, 6vw, 82px); }
.email-subject { display: grid; gap: 4px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.email-subject span, .queue-email-subject span, .task-source-preview > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.email-subject strong { color: var(--ink); font-size: 13px; line-height: 1.45; }
.day-divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 24px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message-row { display: flex; margin: 10px 0; }
.message-row.outgoing { justify-content: flex-end; }
.message-bubble { max-width: min(78%, 560px); padding: 11px 13px 8px; border-radius: 15px 15px 15px 4px; background: white; box-shadow: 0 2px 7px rgba(16,43,54,.06); }
.message-row.outgoing .message-bubble { border-radius: 15px 15px 4px 15px; background: var(--green-pale); }
.sender-name { display: block; margin-bottom: 4px; color: var(--green-dark); font-size: 10px; font-weight: 800; }
.message-bubble p { margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.message-time { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; text-align: right; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.attachment-chip { max-width: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--blue-pale); color: var(--ink-soft); font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.attachment-chip > span { color: #4b7088; font-weight: 900; }

.draft-composer { padding: 15px 18px 18px; border-top: 1px solid var(--line); background: white; }
.draft-label-row, .composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.draft-label-row { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.draft-label { display: flex; align-items: center; gap: 6px; color: var(--green-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.sparkle { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 7px; background: var(--green-pale); }
.draft-composer.no-reply { padding-block: 13px; background: #f7fbf9; }
.draft-composer.no-reply .draft-label-row { margin: 0; }
.draft-composer.no-reply textarea, .draft-composer.no-reply .composer-footer { display: none; }
.draft-composer textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 14px; outline: none; background: #fbfcfb; color: var(--ink); line-height: 1.5; }
.draft-composer textarea { min-height: 88px; padding: 12px 13px; font-size: 13px; }
.draft-composer textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(91,178,188,.16); }
.composer-footer { margin-top: 11px; }
.composer-footer { justify-content: flex-end; }
.cancel-reply-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 800; cursor: pointer; }
.cancel-reply-button:hover { background: var(--line-soft); }
.cancel-reply-button:disabled { opacity: .5; cursor: default; }
.send-button { border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 800; cursor: pointer; box-shadow: 0 7px 18px rgba(47,135,145,.22); }
.send-button { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 0 18px; font-size: 14px; }
.send-button svg { width: 17px; height: 17px; }
.send-button:hover { background: var(--green-dark); }
.send-button:disabled { background: #b6c5c0; cursor: default; box-shadow: none; }

.profile-card, .task-card, .safety-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.profile-card { padding: 15px; }
.profile-topline { gap: 11px; }
.profile-topline h3 { margin: 0 0 4px; font-size: 14px; }
.profile-topline p { margin: 0; color: var(--muted); font-size: 11px; }
.crm-chip { margin-left: auto; padding: 5px 7px; border-radius: 7px; background: var(--blue-pale); color: #4b7088; font-size: 9px; font-weight: 800; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 12px; margin: 17px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.profile-grid dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.profile-grid dd { overflow: hidden; margin: 4px 0 0; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.task-card { margin-top: 15px; padding: 15px; }
.task-card-header { gap: 11px; }
.task-card-header h3 { margin: 4px 0 0; font-size: 14px; }
.route-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--amber-pale); color: var(--amber); font-size: 10px; font-weight: 900; }
.task-summary { margin: 14px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.route-line { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.route-line strong { color: var(--ink); }
.task-status { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 5px; border-radius: 11px; background: var(--green-pale); color: var(--green-dark); font-size: 11px; font-weight: 800; }
.task-status span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 10px; }

.safety-card { margin-top: 15px; padding: 13px; gap: 10px; background: #f6fbf8; }
.safety-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: var(--green-pale); color: var(--green-dark); }
.safety-icon svg { width: 19px; height: 19px; }
.safety-card h3 { margin: 0 0 4px; font-size: 11px; }
.safety-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }

.mobile-nav { display: none; }

.work-view, .host-family-view { min-height: 0; overflow: auto; padding: 34px clamp(20px, 5vw, 70px) 70px; background: var(--paper); }
.work-container { width: min(920px, 100%); margin: 0 auto; }
.host-family-container { width: min(980px, 100%); margin: 0 auto; }
.work-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.work-hero h2 { margin: 6px 0 7px; font-family: var(--font-brand); font-size: clamp(30px, 4vw, 40px); font-weight: 600; }
.work-hero > div > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.work-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.summary-card { min-height: 76px; display: flex; align-items: center; gap: 13px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 700; text-align: left; }
.queue-tab { cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.queue-tab:hover { border-color: rgba(91,178,188,.55); background: var(--green-pale); }
.queue-tab:focus-visible { outline: 3px solid rgba(91,178,188,.25); outline-offset: 2px; }
.queue-tab.active { border-color: var(--aqua); background: var(--green-pale); box-shadow: 0 7px 20px rgba(22,88,94,.1); }
.queue-tab.active .summary-number { background: var(--green); color: white; }
.summary-number { min-width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--green-pale); color: var(--green-dark); font-size: 19px; font-weight: 850; }
.work-section { margin-top: 20px; }
.work-section[hidden] { display: none; }
.work-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.work-section-heading h3 { margin: 0 0 4px; font-size: 18px; }
.work-section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.section-count { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 8px; border-radius: 999px; background: var(--ink); color: white; font-size: 12px; font-weight: 850; }
.work-list { display: grid; gap: 12px; }
.work-card { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 6px 22px rgba(13,30,48,.04); }
.task-overview-head, .task-overview-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.15fr) minmax(210px, 1.65fr) auto 58px; align-items: center; gap: 14px; }
.task-overview-head { padding: 0 15px 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .65px; text-transform: uppercase; }
.task-overview-row { min-height: 70px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 18px rgba(13,30,48,.035); }
.task-overview-person { min-width: 0; display: flex; align-items: center; gap: 10px; }
.avatar.compact { width: 36px; height: 36px; border-radius: 11px; font-size: 12px; }
.task-overview-person > span:last-child { min-width: 0; display: grid; gap: 2px; }
.task-overview-person strong, .task-overview-cell strong { overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.task-student-name { display: block; }
.student-name-mobile { display: none; }
.task-overview-person small { color: var(--muted); font-size: 10px; font-weight: 700; }
.task-overview-cell { min-width: 0; display: grid; gap: 3px; }
.task-overview-stage strong { color: var(--ink-soft); font-weight: 700; }
.task-overview-kicker { display: none; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
.task-overview-open { min-height: 36px; padding: 0 12px; border: 1px solid rgba(91,178,188,.5); border-radius: 10px; background: var(--green-pale); color: var(--green-dark); font-size: 11px; font-weight: 850; cursor: pointer; }
.task-overview-open:hover { border-color: var(--aqua); background: var(--surface); }
.host-action-state { color: var(--green-dark); font-size: 11px; font-weight: 800; text-align: right; }
.work-card-heading { display: flex; align-items: center; gap: 11px; }
.work-person { min-width: 0; flex: 1; }
.work-person h4 { overflow: hidden; margin: 0 0 4px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.work-person p { margin: 0; color: var(--muted); font-size: 11px; }
.work-badge { flex: 0 0 auto; padding: 6px 8px; border-radius: 8px; font-size: 10px; font-weight: 850; }
.work-badge.reply { background: var(--green-pale); color: var(--green-dark); }
.work-badge.task { background: var(--amber-pale); color: var(--amber); }
.work-badge.task.waiting { background: var(--blue-pale); color: #356684; }
.work-badge.task.needs_approval, .work-badge.task.needs_info { background: #fff1dd; color: #9a5a08; }
.queue-email-subject { display: grid; gap: 4px; margin: 14px 0 0; padding: 10px 12px; border-radius: 11px; background: var(--blue-pale); color: var(--ink); font-size: 12px; line-height: 1.45; }
.queue-label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.queue-draft { width: 100%; min-height: 92px; resize: vertical; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: #fbfcfb; color: var(--ink); font-size: 13px; line-height: 1.55; }
.queue-draft:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(91,178,188,.16); }
.queue-card-footer, .task-queue-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.reply-actions { display: flex; align-items: center; gap: 8px; }
.receive-only-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.open-chat-button { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 800; cursor: pointer; }
.open-chat-button:hover { background: var(--line-soft); }
.task-queue-summary { margin: 16px 0 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.case-progress { margin: 0 0 12px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.case-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.case-progress-heading span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.case-progress-heading strong { color: var(--green-dark); font-size: 11px; }
.case-progress h5 { margin: 8px 0 4px; color: var(--ink); font-size: 15px; }
.case-progress > p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.case-state-grid { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.3fr); gap: 8px; margin-top: 12px; }
.case-state-grid > div { display: grid; gap: 3px; padding: 9px 10px; border-radius: 11px; background: var(--surface); }
.case-state-grid span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
.case-state-grid strong { color: var(--ink); font-size: 11px; line-height: 1.4; }
.case-progress-track { height: 6px; margin: 12px 0 0; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.case-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.case-step-details { margin-top: 10px; }
.case-step-details summary { width: max-content; color: var(--green-dark); font-size: 11px; font-weight: 800; cursor: pointer; }
.case-step-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.case-step-list li { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.case-step-list li.current { color: var(--ink); font-weight: 800; }
.case-step-list li.completed { color: var(--ink-soft); }
.case-step-dot { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 10px; font-weight: 850; }
.case-step-list li.completed .case-step-dot { border-color: var(--green); background: var(--green); color: white; }
.case-step-list li.current .case-step-dot { border: 2px solid var(--aqua); background: var(--green-pale); color: var(--green-dark); }
.task-source-preview { display: grid; gap: 6px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--paper); }
.task-source-preview p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.next-step { display: grid; gap: 5px; padding: 13px 14px; border-radius: 13px; background: var(--green-pale); }
.next-step span, .task-queue-footer p span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.next-step strong { color: var(--ink); font-size: 13px; line-height: 1.5; }
.task-queue-footer p { display: grid; gap: 4px; margin: 0; }
.task-queue-footer p strong { font-size: 12px; }
.task-actions { display: flex; align-items: center; gap: 8px; }
.waiting-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.complete-task-button { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border: 0; border-radius: 11px; background: var(--green); color: white; font-size: 12px; font-weight: 850; cursor: pointer; }
.complete-task-button:hover { background: var(--green-dark); }
.complete-task-button span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 10px; }
.queue-empty { min-height: 96px; display: flex; align-items: center; gap: 13px; padding: 16px; border: 1px dashed var(--line); border-radius: 16px; background: var(--surface); }
.queue-empty > span { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--green-pale); color: var(--green-dark); font-weight: 900; }

.host-family-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 27px; }
.host-summary-card { min-height: 82px; display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.host-summary-card > span:last-child { display: grid; gap: 4px; }
.host-summary-card strong { color: var(--ink); font-size: 13px; }
.host-summary-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.host-summary-number { min-width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--green-pale); color: var(--green-dark); font-size: 19px; font-weight: 850; }
.host-summary-card.attention .host-summary-number { background: var(--amber-pale); color: var(--amber); }
.host-summary-card.waiting .host-summary-number { background: var(--blue-pale); color: #356684; }
.host-family-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.host-family-list-heading h3 { margin: 0 0 4px; font-size: 18px; }
.host-family-list-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.host-family-case-list { display: grid; gap: 14px; }
.host-case-card { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 7px 24px rgba(13,30,48,.05); }
.host-case-header { display: flex; align-items: center; gap: 11px; }
.host-case-person { min-width: 0; flex: 1; }
.host-case-person h4 { overflow: hidden; margin: 0 0 4px; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.host-case-person p { margin: 0; color: var(--muted); font-size: 11px; }
.host-case-stage { margin-top: 16px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 15px; background: var(--paper); }
.host-case-stage-line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.host-case-stage-line span { flex: 0 0 auto; color: var(--green-dark); font-size: 11px; font-weight: 850; }
.host-case-stage-line strong { color: var(--ink); font-size: 15px; text-align: right; }
.host-case-stage > p { margin: 10px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.host-case-facts { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(250px, 1.5fr); gap: 10px; margin-top: 12px; }
.host-case-facts > div { display: grid; gap: 5px; padding: 13px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line-soft); }
.host-case-facts .host-next-action { background: var(--green-pale); border-color: transparent; }
.host-case-facts span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.host-case-facts strong { color: var(--ink); font-size: 13px; line-height: 1.5; }
.host-case-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.host-case-footer .case-step-details { margin-top: 0; }
.host-case-footer .case-step-list { min-width: min(520px, 75vw); }
.host-case-note { color: var(--muted); font-size: 11px; }
.open-host-task-button { min-height: 42px; flex: 0 0 auto; padding: 0 14px; border: 0; border-radius: 11px; background: var(--green); color: white; font-size: 12px; font-weight: 850; cursor: pointer; }
.open-host-task-button:hover { background: var(--green-dark); }
.queue-empty strong { display: block; margin-bottom: 4px; font-size: 13px; }
.queue-empty p { margin: 0; color: var(--muted); font-size: 11px; }

.settings-view { min-height: 0; overflow: auto; padding: 34px clamp(20px, 5vw, 70px) 70px; background: var(--paper); }
.settings-container { width: min(980px, 100%); margin: 0 auto; }
.settings-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.settings-hero h2 { margin: 0 0 7px; font-family: var(--font-brand); font-size: clamp(30px, 4vw, 40px); font-weight: 600; }
.settings-hero > div > p:last-child { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 690px); gap: 36px; align-items: start; }
.settings-sidebar { position: sticky; top: 0; display: grid; gap: 4px; }
.settings-tab { min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; }
.settings-tab:hover { background: var(--line-soft); }
.settings-tab.active { background: var(--green-pale); color: var(--green-dark); font-weight: 800; }
.settings-panels { min-width: 0; }
.settings-panel-heading { margin-bottom: 17px; }
.settings-panel-heading-row { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.settings-panel-heading h3 { margin: 0 0 6px; font-size: 20px; }
.settings-panel-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.settings-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; border-top: 1px solid var(--line-soft); }
.settings-row:first-child { border-top: 0; }
.settings-row-copy { min-width: 0; display: grid; gap: 4px; }
.settings-row-copy strong { font-size: 13px; }
.settings-row-copy small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.settings-select { min-width: 112px; height: 38px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 12px; }
.switch-control { position: relative; flex: 0 0 auto; width: 44px; height: 26px; margin: 0; appearance: none; border: 0; border-radius: 99px; background: #c8d1d4; cursor: pointer; transition: background .16s ease; }
.switch-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .16s ease; }
.switch-control:checked { background: var(--green); }
.switch-control:checked::after { transform: translateX(18px); }
.switch-control:focus-visible, .settings-tab:focus-visible, .settings-select:focus-visible { outline: 3px solid rgba(91,178,188,.25); outline-offset: 2px; }
.settings-value-pill { flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.settings-value-pill.always-on { background: var(--green-pale); color: var(--green-dark); }
.connection-list { display: block; }
.connection-row { min-width: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; min-height: 68px; padding: 11px 14px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.connection-row:first-child { border-top: 0; }
.connection-row > span:nth-child(2), .locked-rule > span:last-child { min-width: 0; display: grid; gap: 3px; }
.connection-row strong, .locked-rule strong { font-size: 12px; }
.connection-row small, .locked-rule small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.service-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; font-size: 11px; font-weight: 900; }
.service-icon.wa { background: #27a87c; }
.service-icon.ai { background: #17395b; }
.service-icon.gm { background: #d7675c; }
.service-icon.db { background: #3b8f73; }
.service-icon.crm { background: #57758e; }
.connection-state { padding: 5px 7px; border-radius: 7px; font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.connection-state.pending { background: var(--line-soft); color: var(--muted); }
.connection-state.planned { background: var(--blue-pale); color: var(--ink-soft); }
.connection-state.ready { background: var(--green-pale); color: var(--green-dark); }
.secondary-button { min-height: 44px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 800; cursor: pointer; }
.locked-rule { display: flex; align-items: start; gap: 11px; padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.locked-rule:first-child { border-top: 0; }
.rule-check { flex: 0 0 auto; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--green-pale); color: var(--green-dark); font-size: 11px; font-weight: 900; }
.settings-note { margin: 13px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-text-value { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

body.compact-mode .conversation-list { padding-block: 5px; }
body.compact-mode .conversation-item { padding-top: 8px; padding-bottom: 8px; }
body.compact-mode .conversation-copy p { -webkit-line-clamp: 1; }
/* Empty Inbox uses the space for the main conversation instead of showing blank student fields. */
.workspace.context-empty { grid-template-columns: 330px minmax(420px, 1fr); }
.workspace.context-empty .context-panel { display: none; }
body.hide-case-details .context-panel { display: none; }
body.hide-case-details .workspace { grid-template-columns: 330px minmax(420px, 1fr); }

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .conversation-header,
:root[data-theme="dark"] .message-bubble,
:root[data-theme="dark"] .draft-composer,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .safety-card,
:root[data-theme="dark"] .work-card,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .queue-empty,
:root[data-theme="dark"] .host-summary-card,
:root[data-theme="dark"] .host-case-card,
:root[data-theme="dark"] .app-sidebar { background: var(--surface); }
:root[data-theme="dark"] .inbox-panel,
:root[data-theme="dark"] .context-panel { background: #0d1b25; }
:root[data-theme="dark"] .conversation-panel,
:root[data-theme="dark"] .conversation-scroll { background: #0a1721; }
:root[data-theme="dark"] .search-wrap input,
:root[data-theme="dark"] .draft-composer textarea,
:root[data-theme="dark"] .queue-draft,
:root[data-theme="dark"] .message-bubble.outgoing { background: #17343b; color: var(--ink); }
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .icon-button.pale,
:root[data-theme="dark"] .filter-pill { background: var(--line-soft); }
:root[data-theme="dark"] .auth-gate { background: rgba(9, 20, 30, .9); }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 50; max-width: min(440px, calc(100% - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: all .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.with-action { display: flex; align-items: center; gap: 18px; }
.toast.show.with-action { pointer-events: auto; }
.toast-action { min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--surface); color: var(--green-dark); font: inherit; font-weight: 850; cursor: pointer; }
.toast-action:focus-visible { outline: 3px solid rgba(91,178,188,.5); outline-offset: 2px; }

@media (max-width: 1050px) {
  .connection-chip { display: none; }
  .workspace { grid-template-columns: 300px 1fr; }
  body.hide-case-details .workspace { grid-template-columns: 300px 1fr; }
  .context-panel { display: none; }
}

@media (max-width: 720px) {
  body { overflow: hidden; }
  .auth-gate { align-items: end; padding-inline: 0; padding-bottom: 0; }
  .auth-card { width: 100%; padding: 28px 22px calc(22px + var(--safe-bottom)); border-width: 1px 0 0; border-radius: 24px 24px 0 0; }
  .auth-logo { width: 58px; height: 58px; margin-bottom: 13px; }
  .auth-card h1 { font-size: 29px; }
  .auth-intro { margin-bottom: 20px; font-size: 13px; }
  .auth-form input, .auth-primary { min-height: 52px; }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "topbar" "main";
  }
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    padding: calc(13px + var(--safe-top)) 14px calc(16px + var(--safe-bottom));
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 45px rgba(13,30,48,.22);
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 40;
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-close-button { display: grid; place-items: center; }
  .sidebar-menu-button { display: block; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(7,18,27,.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 35;
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar { height: calc(67px + var(--safe-top)); padding: calc(10px + var(--safe-top)) 15px 10px; justify-content: space-between; }
  .mobile-brand-lockup { display: flex; }
  .brand-mark { width: 41px; height: 41px; }
  .topbar h1 { font-size: 26px; letter-spacing: -.8px; }
  .topbar-actions { display: none; }
  .workspace { position: relative; display: block; min-height: 0; overflow: hidden; }
  .settings-view, .work-view, .host-family-view { min-height: 0; padding: 20px 13px 34px; }
  .work-hero { align-items: start; margin-bottom: 17px; }
  .work-hero h2 { font-size: 28px; }
  .work-hero .secondary-button { display: none; }
  .host-family-summary { gap: 8px; margin-bottom: 22px; }
  .host-summary-card { min-height: 88px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 11px; }
  .host-summary-number { min-width: 32px; width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .host-summary-card strong { font-size: 12px; }
  .host-summary-card small { display: none; }
  .host-case-card { padding: 14px; }
  .host-case-stage-line { display: grid; gap: 5px; }
  .host-case-stage-line strong { text-align: left; }
  .host-case-facts { grid-template-columns: 1fr; }
  .host-case-footer { align-items: flex-end; }
  .open-host-task-button { min-height: 46px; font-size: 13px; }
  .work-summary { gap: 8px; margin-bottom: 22px; }
  .summary-card { min-height: 82px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 10px; font-size: 12px; line-height: 1.2; }
  .summary-number { min-width: 32px; width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .work-section { margin-top: 18px; }
  .work-section-heading h3 { font-size: 18px; }
  .work-section-heading p { font-size: 12px; }
  .work-card { padding: 14px; }
  .task-overview-head { display: none; }
  .task-overview-row { min-height: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 9px; padding: 10px 12px; }
  .task-overview-person { grid-column: 1; align-items: baseline; }
  .task-overview-person .avatar { display: none; }
  .task-overview-person > span:last-child { display: flex; align-items: baseline; gap: 6px; }
  .student-name-desktop { display: none; }
  .student-name-mobile { display: inline; }
  .task-overview-person small::before { content: "·"; margin-right: 6px; }
  .task-overview-cell { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 7px; padding-left: 0; }
  .task-overview-row.has-detail .task-overview-cell { grid-column: 1; }
  .task-overview-kicker { display: block; flex: 0 0 auto; }
  .task-overview-row > .work-badge { grid-column: 2; grid-row: 1; align-self: center; }
  .task-overview-open { min-height: 32px; grid-column: 2; grid-row: 2 / span 2; align-self: center; padding: 0 10px; }
  .task-overview-spacer { display: none; }
  .work-person h4 { font-size: 15px; }
  .work-person p { font-size: 12px; }
  .queue-draft { min-height: 104px; font-size: 15px; }
  .task-queue-summary, .next-step strong { font-size: 14px; }
  .case-state-grid { grid-template-columns: 1fr; }
  .open-chat-button, .cancel-reply-button, .queue-send-button, .complete-task-button { min-height: 46px; font-size: 14px; }
  .task-queue-footer { align-items: flex-end; }
  .task-actions { flex-wrap: wrap; justify-content: flex-end; }
  .settings-hero { align-items: start; margin-bottom: 17px; }
  .settings-hero h2 { font-size: 28px; }
  .settings-hero > div > p:last-child { font-size: 13px; }
  .settings-hero .secondary-button { display: none; }
  .settings-layout { display: block; }
  .settings-sidebar { position: static; display: flex; gap: 5px; margin: 0 -2px 20px; overflow-x: auto; scrollbar-width: none; }
  .settings-sidebar::-webkit-scrollbar { display: none; }
  .settings-tab { flex: 0 0 auto; min-height: 38px; padding: 0 13px; text-align: center; }
  .settings-panel-heading h3 { font-size: 19px; }
  .settings-row { min-height: 72px; padding: 14px; }
  .settings-row-copy strong { font-size: 14px; }
  .settings-row-copy small { font-size: 12px; }
  .settings-select { min-width: 104px; }
  .connection-row { grid-template-columns: auto 1fr; }
  .connection-state { grid-column: 2; justify-self: start; }
  .connection-row strong, .locked-rule strong { font-size: 14px; }
  .connection-row small, .locked-rule small { font-size: 12px; }
  .connection-state { font-size: 11px; }
  .settings-panel-heading-row { align-items: center; }
  .inbox-panel, .conversation-panel { position: absolute; inset: 0; min-height: 0; width: 100%; transition: transform .24s ease; }
  .inbox-panel { z-index: 2; border-right: 0; transform: translateX(0); }
  .conversation-panel { z-index: 3; transform: translateX(100%); }
  .workspace.show-conversation .inbox-panel { transform: translateX(-25%); }
  .workspace.show-conversation .conversation-panel { transform: translateX(0); }
  .mobile-back { display: grid; }
  .conversation-header { min-height: 72px; padding: 10px 13px; }
  .conversation-header .avatar { width: 42px; height: 42px; border-radius: 12px; }
  .conversation-title h2 { font-size: 17px; }
  .conversation-title p { font-size: 13px; }
  .channel-badge { font-size: 11px; }
  .conversation-scroll { padding: 17px 13px; }
  .message-bubble { max-width: 88%; }
  .message-bubble p { font-size: 15px; }
  .sender-name { font-size: 12px; }
  .message-time, .day-divider { font-size: 11px; }
  .draft-composer { padding: 11px 12px 12px; }
  .draft-label-row { font-size: 12px; }
  .draft-composer textarea { min-height: 82px; font-size: 15px; }
  .composer-footer { align-items: end; }
  .composer-footer > * { flex: 1; justify-content: center; }
  .send-button { min-height: 44px; padding-inline: 17px; }
  .panel-heading { min-height: 71px; }
  .search-wrap input { height: 44px; font-size: 15px; }
  .filter-pill { min-height: 44px; }
  .conversation-copy h3 { font-size: 15px; }
  .conversation-copy p { font-size: 14px; }
  .conversation-meta time { font-size: 11px; }
  .unread-dot { min-width: 20px; height: 20px; font-size: 11px; }
  .mobile-nav { display: none; }
  .toast { bottom: calc(18px + var(--safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
