:root {
  color-scheme: light;
  --brand: #075e54;
  --brand-dark: #054b43;
  --accent: #12a675;
  --accent-soft: #dff7ed;
  --ink: #17211f;
  --muted: #66746f;
  --line: #dce5e1;
  --surface: #ffffff;
  --canvas: #eef3f1;
  --bubble-out: #d9fdd3;
  --bubble-in: #ffffff;
  --warning: #fff3d7;
  --shadow: 0 18px 50px rgba(22, 48, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--canvas);
  color: var(--ink);
}

body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.agent-app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
  background: var(--surface);
  box-shadow: none;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.app-header {
  position: relative;
  min-height: 66px;
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
  z-index: 5;
}

.brand-lockup, .header-actions, .thread-header, .owner-control, .ai-control {
  display: flex;
  align-items: center;
}

.brand-lockup { gap: 10px; }
.brand-lockup > span:last-child { display: grid; line-height: 1.05; }
.brand-lockup strong { font-size: 15px; color: var(--brand); }
.brand-lockup small { margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.header-actions { gap: 9px; }
.live-state { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 12px; font-weight: 750; }
.live-state i { width: 7px; height: 7px; border-radius: 50%; background: #24c483; box-shadow: 0 0 0 4px #dcf8ee; }

.icon-button, .avatar-button, .back-button {
  border: 0;
  display: grid;
  place-items: center;
  background: #f0f5f3;
  color: var(--brand);
}
.icon-button { width: 36px; height: 36px; border-radius: 50%; font-size: 22px; }
.icon-button.is-enabled { background: #dcf8ee; color: #087952; box-shadow: 0 0 0 3px rgba(18, 166, 117, .12); }
.avatar-button { width: 36px; height: 36px; border-radius: 11px; background: #dff4ed; font-weight: 800; }

.profile-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 14px;
  z-index: 25;
  width: min(260px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(19, 48, 40, .2);
}
.profile-identity { display: grid; gap: 3px; padding: 8px 10px 10px; border-bottom: 1px solid #edf1ef; }
.profile-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.profile-identity span { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.profile-menu > a, .profile-menu > button { width: 100%; min-height: 38px; margin-top: 4px; padding: 8px 10px; display: flex; align-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; text-decoration: none; font-size: 12px; font-weight: 700; }
.profile-menu > a:hover, .profile-menu > button:hover { background: #eff7f4; color: var(--brand); }
.profile-menu > button { color: #9b2f2f; }

.connection-banner {
  min-height: 46px;
  padding: 7px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6f5419;
  background: #fff8e7;
  border-bottom: 1px solid #f4dfad;
  z-index: 4;
}
.connection-banner > span:nth-child(2) { display: grid; line-height: 1.15; flex: 1; }
.connection-banner strong { font-size: 12px; }
.connection-banner small { margin-top: 3px; font-size: 11px; }
.connection-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #ffe9ad; font-weight: 900; }
.connection-banner button { border: 1px solid #cf9f32; border-radius: 999px; padding: 6px 11px; background: #fff; color: #6c4c0a; font-weight: 750; font-size: 12px; }

.inbox-shell {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(310px, 365px) minmax(0, 1fr);
}

.conversation-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #fff;
}

.search-wrap { margin: 12px 14px 8px; height: 42px; padding: 0 5px 0 13px; display: flex; align-items: center; gap: 8px; background: #f0f4f2; border: 1px solid transparent; border-radius: 13px; }
.search-wrap:focus-within { background: #fff; border-color: #77c5ad; box-shadow: 0 0 0 3px #e3f6f0; }
.search-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-wrap button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--brand); font-size: 18px; }

.inbox-filterbar { margin: 0 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inbox-filterbar label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.inbox-filterbar select { min-width: 0; max-width: 210px; height: 32px; border: 1px solid #cbdad5; border-radius: 9px; padding: 0 28px 0 10px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 750; }
.inbox-filterbar select:focus { outline: 0; border-color: #77c5ad; box-shadow: 0 0 0 3px #e3f6f0; }

.inbox-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); padding: 0 8px; }
.inbox-tabs.has-admin-all { grid-template-columns: repeat(4, 1fr); }
.inbox-tabs button { min-width: 0; padding: 11px 3px 10px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.inbox-tabs button.is-active { color: var(--brand); border-bottom-color: var(--accent); }
.inbox-tabs span { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: #edf2f0; font-size: 10px; }
.inbox-tabs button.is-active span { background: var(--accent-soft); }

.conversation-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.inbox-pagination { position: sticky; bottom: 0; z-index: 2; display: grid; justify-items: center; gap: 7px; padding: 10px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); color: var(--muted); font-size: 10px; }
.inbox-pagination button, .load-older-messages { border: 1px solid #b8d4ca; border-radius: 999px; padding: 8px 13px; background: #fff; color: var(--brand); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.conversation-card { width: 100%; padding: 12px 13px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; border: 0; border-bottom: 1px solid #edf1ef; background: #fff; text-align: left; color: inherit; }
.conversation-card:hover, .conversation-card.is-active { background: #f0faf6; }
.conversation-avatar, .customer-avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #0d6f63, #19aa7d); font-weight: 800; }
.conversation-avatar { width: 46px; height: 46px; font-size: 17px; position: relative; }
.conversation-avatar::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #25d366; }
.conversation-main { min-width: 0; }
.conversation-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conversation-line time { color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.conversation-preview { margin: 4px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.conversation-meta { display: flex; align-items: center; gap: 5px; min-width: 0; }
.meta-chip { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 7px; border-radius: 999px; background: #edf3f1; color: #52635e; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .02em; }
.meta-chip.ai { color: #1855a1; background: #eaf2ff; }
.meta-chip.ad { max-width: 170px; color: #8a5a16; background: #fff1dc; }
.meta-chip.unassigned { color: #8b5700; background: #fff1cf; }
.meta-chip.closed { color: #9f2336; background: #ffe8ed; }
.unread-badge { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; align-self: center; border-radius: 999px; background: #18ad78; color: #fff; font-size: 10px; font-weight: 800; }

.loading-card, .empty-list { min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 25px; text-align: center; color: var(--muted); font-size: 13px; }
.loading-card i { width: 28px; height: 28px; border: 3px solid #dbe8e3; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.thread-pane { min-width: 0; min-height: 0; overflow: hidden; background: #e9efec; position: relative; }
.thread-pane::before { content: ""; position: absolute; inset: 0; opacity: .38; pointer-events: none; background-image: radial-gradient(circle at 20% 15%, #c6d5ce 0 1px, transparent 1.5px), radial-gradient(circle at 75% 75%, #c6d5ce 0 1px, transparent 1.5px); background-size: 28px 28px, 36px 36px; }
.thread-empty { position: relative; z-index: 1; height: 100%; min-height: 480px; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; }
.thread-empty .empty-mark { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 24px; background: #dceae5; color: var(--brand); font-size: 42px; }
.thread-empty h1 { margin: 20px 0 8px; font-size: 22px; }
.thread-empty p { max-width: 460px; margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.thread-empty button { margin-top: 18px; border: 0; border-radius: 10px; padding: 10px 15px; background: var(--brand); color: #fff; font-weight: 750; }

.thread-content { position: relative; z-index: 1; height: 100%; min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto auto auto auto auto max-content minmax(0, 1fr) auto auto auto; }
.thread-header { grid-row: 1; }
.thread-controlbar { grid-row: 2; }
.calling-panel { grid-row: 3; }
.lead-strip { grid-row: 4; }
.ad-context-card { grid-row: 5; }
.thread-notice { grid-row: 6; align-self: start; min-width: 0; min-height: 0; height: auto; max-height: min(96px, 20svh); overflow-y: auto; }
.message-list-shell { grid-row: 7; min-height: 0; position: relative; }
.quick-replies { grid-row: 8; }
.composer { grid-row: 9; }
.composer-hint { grid-row: 10; }
.thread-header { min-height: 64px; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.back-button { display: none; width: 34px; height: 34px; border-radius: 50%; font-size: 30px; line-height: 1; }
.customer-avatar { width: 42px; height: 42px; }
.thread-identity { min-width: 0; flex: 1; display: grid; }
.thread-identity strong, .thread-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-identity strong { font-size: 15px; }
.thread-identity span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.crm-link { padding: 7px 10px; border: 1px solid #b8d4ca; border-radius: 9px; text-decoration: none; color: var(--brand); font-weight: 800; font-size: 11px; }

.thread-controlbar { padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.owner-control { min-width: 0; gap: 7px; color: var(--muted); font-size: 11px; }
.owner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.owner-control strong { color: var(--ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-control button, .owner-control select { border: 1px solid #bdd5cc; border-radius: 8px; padding: 6px 8px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 750; }
.claim-button { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.ai-control { flex: 0 0 auto; gap: 2px; padding: 2px; border-radius: 9px; background: #e8efec; }
.ai-control button { border: 0; border-radius: 7px; padding: 6px 7px; background: transparent; color: #68756f; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.ai-control button.is-active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(25,55,47,.14); }
.ai-control button:disabled { opacity: .45; cursor: not-allowed; }

.calling-panel {
  margin: 8px 12px 0;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #cfe5dd;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(20, 76, 61, .06);
}
.calling-panel[hidden] { display: none; }
.calling-label { color: #55716a; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.calling-panel strong { display: block; margin-top: 2px; font-size: 12px; color: var(--ink); }
.calling-panel p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.calling-actions { display: flex; align-items: center; gap: 6px; }
.calling-actions button { border: 1px solid #b8d4ca; border-radius: 999px; padding: 7px 10px; background: #f7fbf9; color: var(--brand); font-size: 10px; font-weight: 800; }
.calling-actions button:disabled { opacity: .55; cursor: not-allowed; }

.lead-strip { padding: 9px 13px; display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 12px; border-bottom: 1px solid #cfe5dd; background: #eaf9f4; }
.lead-strip > div:first-child { min-width: 0; display: grid; }
.lead-label { color: #55716a; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lead-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; font-size: 12px; }
.lead-facts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lead-facts span { padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.75); color: #47665d; font-size: 10px; }
.lead-strip a { color: var(--brand); font-size: 10px; font-weight: 800; text-decoration: none; }

.ad-context-card { margin: 8px 12px 0; padding: 9px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid #cfe5dd; border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgba(20, 76, 61, .06); }
.ad-context-card[hidden] { display: none; }
.ad-context-card img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #eef5f2; }
.ad-context-copy { min-width: 0; display: grid; gap: 2px; }
.ad-context-copy > span { width: max-content; padding: 2px 6px; border-radius: 999px; background: #e8f1ff; color: #245f9e; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.ad-context-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #173f35; font-size: 12px; }
.ad-context-copy p { margin: 0; overflow: hidden; color: #5a6f69; font-size: 10px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ad-context-card > a { color: var(--brand); font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }

.thread-notice { margin: 8px 12px 0; padding: 8px 11px; border: 1px solid #efd18b; border-radius: 10px; background: var(--warning); color: #72541c; font-size: 11px; line-height: 1.4; }
.thread-notice.ai { border-color: #bdd9f5; background: #edf6ff; color: #24577e; }
.thread-notice:empty { display: none; }

.message-list { width: 100%; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; touch-action: pan-y; padding: 18px clamp(12px, 4vw, 54px); display: flex; flex-direction: column; gap: 5px; }
.jump-to-latest { position: absolute; right: clamp(18px, 4vw, 58px); bottom: 14px; z-index: 3; min-height: 36px; padding: 0 14px; border: 1px solid #bad8ce; border-radius: 999px; background: #fff; color: var(--brand); box-shadow: 0 8px 22px rgba(19,44,37,.18); font-size: 11px; font-weight: 800; }
.jump-to-latest[hidden] { display: none; }
.load-older-messages { align-self: center; margin: 2px 0 10px; flex: 0 0 auto; }
.message-list:focus-visible { outline: 2px solid rgba(18, 166, 117, .45); outline-offset: -2px; }
.message-row { display: flex; }
.message-row.outbound { justify-content: flex-end; }
.message-row.system { justify-content: center; }
.message-bubble { max-width: min(74%, 560px); padding: 8px 10px 6px; border-radius: 11px 11px 11px 3px; background: var(--bubble-in); box-shadow: 0 1px 1px rgba(19,44,37,.12); }
.message-row.outbound .message-bubble { border-radius: 11px 11px 3px 11px; background: var(--bubble-out); }
.message-row.system .message-bubble { max-width: 88%; border-radius: 8px; background: #fff8cf; color: #6c643c; text-align: center; }
.message-sender { display: block; margin-bottom: 3px; color: var(--brand); font-size: 10px; font-weight: 800; }
.message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.42; font-size: 13px; }
.message-meta { margin-top: 3px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: #6c7975; font-size: 9px; }
.message-meta .ticks { color: #2f84bd; font-weight: 900; }
.message-attachment { display: block; margin-bottom: 6px; color: var(--brand); font-size: 11px; font-weight: 700; }
.message-media { display: block; max-width: min(100%, 360px); margin: 0 0 7px; border-radius: 9px; background: #d9e5e1; }
img.message-media { max-height: 320px; object-fit: cover; }
video.message-media { max-height: 320px; }
audio.message-media { width: min(100%, 320px); min-width: 220px; background: transparent; }

.quick-replies { height: 43px; padding: 5px 12px 7px; display: flex; align-items: center; gap: 7px; overflow-x: auto; background: rgba(242,247,245,.94); }
.quick-replies button { flex: 0 0 auto; align-self: center; height: 30px; padding: 0 10px; border: 1px solid #a9d1c4; border-radius: 999px; background: #fff; color: var(--brand); font-size: 10px; }
.composer { padding: 7px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 7px; background: #f0f4f2; }
.composer > button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--brand); font-size: 21px; }
.composer textarea { width: 100%; min-height: 40px; max-height: 120px; resize: none; padding: 10px 12px; border: 1px solid #d4dedb; border-radius: 20px; outline: 0; background: #fff; color: var(--ink); line-height: 1.35; }
.composer textarea:focus { border-color: #78bca7; }
.composer .send-button { background: var(--brand); color: #fff; font-size: 16px; }
.composer .send-button:disabled, .composer textarea:disabled { opacity: .5; cursor: not-allowed; }
.composer-hint { margin: 0; padding: 3px 12px max(5px, env(safe-area-inset-bottom)); background: #f0f4f2; color: var(--muted); text-align: center; font-size: 9px; }

.bottom-nav { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); max-width: min(88vw, 420px); padding: 10px 14px; border-radius: 10px; background: #173c35; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 12px; text-align: center; }

@media (max-width: 720px) {
  body { overflow: hidden; background: #fff; }
  .agent-app { width: 100%; height: 100dvh; min-height: 100dvh; grid-template-rows: auto auto minmax(0, 1fr) auto; box-shadow: none; }
  .app-header { min-height: 58px; padding-inline: 14px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .live-state { display: none; }
  .connection-banner { min-height: 42px; padding-inline: 12px; }
  .connection-banner small { max-width: 235px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .inbox-shell { display: block; min-height: 0; overflow: hidden; }
  .conversation-pane, .thread-pane { height: 100%; border-right: 0; }
  .agent-app[data-mobile-view="list"] .thread-pane { display: none; }
  .agent-app[data-mobile-view="thread"] .conversation-pane { display: none; }
  .thread-empty { display: none; }
  .agent-app[data-mobile-view="thread"] { grid-template-rows: minmax(0, 1fr); }
  .agent-app[data-mobile-view="thread"] > .app-header,
  .agent-app[data-mobile-view="thread"] > .connection-banner { display: none; }
  .thread-content { height: 100%; grid-template-rows: auto auto auto auto auto 0 minmax(0, 1fr) 0 auto 0; }
  .back-button { display: grid; }
  .thread-header { min-height: 50px; padding: 5px 8px; gap: 7px; }
  .back-button { width: 32px; height: 32px; }
  .customer-avatar { width: 34px; height: 34px; }
  .thread-identity strong { font-size: 14px; }
  .thread-identity span { margin-top: 1px; font-size: 10px; }
  .crm-link { padding: 5px 7px; }
  .thread-controlbar { min-height: 42px; padding: 5px 8px; gap: 6px; }
  .owner-control { gap: 5px; }
  .owner-control button, .owner-control select { padding: 5px 6px; }
  .ai-control button { padding: 5px 6px; }
  .owner-control strong { max-width: 98px; }
  .calling-panel { min-height: 42px; margin: 4px 7px 0; padding: 6px 7px; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .calling-actions { display: none; }
  .calling-panel p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lead-strip { min-height: 38px; grid-template-columns: minmax(0, 1fr) auto; padding: 5px 8px; gap: 8px; }
  .lead-facts { display: none; }
  .lead-strip > a { grid-column: 2; grid-row: 1; }
  .ad-context-card { min-height: 42px; margin: 4px 7px 0; padding: 4px 6px; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 6px; border-radius: 9px; }
  .ad-context-card img { width: 32px; height: 32px; border-radius: 6px; }
  .ad-context-copy { gap: 0; }
  .ad-context-copy > span { display: none; }
  .ad-context-copy strong { font-size: 11px; }
  .ad-context-copy p { -webkit-line-clamp: 1; font-size: 9px; line-height: 1.2; }
  .ad-context-card > a { grid-column: 3; grid-row: 1; font-size: 9px; }
  .thread-notice { display: none !important; }
  .message-list { padding: 9px 8px; }
  .jump-to-latest { right: 12px; bottom: 10px; }
  .message-bubble { max-width: 86%; }
  .quick-replies, .composer-hint { display: none; }
  .composer { padding: 5px 7px max(5px, env(safe-area-inset-bottom)); gap: 6px; align-items: center; }
  .composer > button { width: 38px; height: 38px; }
  .composer textarea { min-height: 38px; padding: 8px 11px; }
  .bottom-nav { min-height: 58px; padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: #fff; z-index: 5; }
  .bottom-nav button, .bottom-nav a { border: 0; display: grid; place-content: center; justify-items: center; gap: 2px; background: transparent; color: #73807c; text-decoration: none; font-size: 9px; font-weight: 700; }
  .bottom-nav span { font-size: 18px; }
  .bottom-nav .is-active { color: var(--brand); }
  .agent-app[data-mobile-view="thread"] .bottom-nav { display: none; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .agent-app[data-mobile-view="thread"] .toast { bottom: 24px; }
}

@media (min-width: 721px) and (max-height: 720px) {
  .agent-app { height: 100dvh; }
}

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