:root {
  --ink: #1f2924;
  --muted: #6e776f;
  --paper: #f7f4ee;
  --surface: rgba(255, 255, 255, 0.82);
  --white: #fff;
  --line: #e5e1d8;
  --sage: #3e6856;
  --sage-dark: #29483b;
  --sage-soft: #e8f0eb;
  --apricot: #f0a775;
  --apricot-soft: #fff0e5;
  --red: #b65353;
  --red-soft: #fbeaea;
  --shadow: 0 24px 70px rgba(43, 54, 47, 0.12);
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.is-hidden { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .55;
  pointer-events: none;
}
.ambient-one { width: 420px; height: 420px; background: #dceadf; top: -160px; right: -100px; }
.ambient-two { width: 360px; height: 360px; background: #f8ddc8; bottom: -190px; left: 22%; }

.app-shell { display: grid; grid-template-columns: 238px 1fr; height: 100dvh; padding: 12px; gap: 12px; }

.sidebar {
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px;
  padding: 22px 14px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(50, 62, 54, .06);
  backdrop-filter: blur(16px);
}

.brand-block, .mobile-brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 24px; }
.brand-block strong, .mobile-brand strong { display: block; font-family: Georgia, serif; font-size: 21px; letter-spacing: -.4px; }
.brand-block span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.brand-mark {
  width: 37px; height: 37px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sage-dark); color: white; font-family: Georgia, serif; font-weight: 700; font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.13);
}
.brand-mark-large { width: 48px; height: 48px; border-radius: 15px; font-size: 25px; margin-bottom: 24px; }

.main-nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%; border: 0; background: transparent; border-radius: 13px; min-height: 45px;
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px; padding: 0 11px;
  color: #59635d; text-align: left; cursor: pointer; font-size: 13px; font-weight: 560;
}
.nav-item:hover { background: rgba(62, 104, 86, .07); }
.nav-item.active { color: var(--sage-dark); background: var(--sage-soft); }
.nav-icon { font-size: 18px; text-align: center; }
.nav-count { min-width: 23px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--sage); color: white; font-size: 11px; }
.sidebar-spacer { flex: 1; }

.assistant-card {
  border: 1px solid #dfe8e1; background: linear-gradient(145deg, #f0f5f1, #f9fbf9); border-radius: 16px;
  padding: 13px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; text-align: left; cursor: pointer;
}
.assistant-card .spark { width: 29px; height: 29px; display: grid; place-items: center; color: var(--sage); background: white; border-radius: 10px; }
.assistant-card strong, .profile-row strong { display: block; font-size: 12px; }
.assistant-card small, .profile-row small { color: var(--muted); font-size: 10px; }
.profile-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; background: transparent; border: 0; border-top: 1px solid var(--line); margin-top: 13px; padding: 14px 5px 2px; text-align: left; cursor: pointer; }
.profile-avatar { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; background: #e3d8cd; color: #5e4d41; font-size: 10px; font-weight: 750; }
.more { color: #9a9f9c; letter-spacing: 1px; }

.workspace { min-width: 0; height: calc(100dvh - 24px); background: rgba(255,255,255,.52); border: 1px solid rgba(255,255,255,.86); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.topbar { height: 86px; padding: 0 23px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.62); }
.page-heading { flex: 1; }
.eyebrow { margin: 0 0 5px; color: var(--sage); letter-spacing: 1.55px; font-size: 9px; font-weight: 800; }
.page-heading h1 { font-family: Georgia, serif; font-weight: 500; font-size: 25px; line-height: 1; margin: 0; letter-spacing: -.5px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); font-size: 10px; font-weight: 700; }
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: #6c9c7f; box-shadow: 0 0 0 4px rgba(108,156,127,.13); }
.live-pill.live { background: #e7f4eb; color: #23583a; }
.live-pill.live span { background: #2f8d55; }
.icon-button, .close-button { width: 36px; height: 36px; display: grid; place-items: center; background: white; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 18px; }
.icon-button:hover, .close-button:hover { border-color: #c8d5cc; color: var(--sage); }
.mobile-brand { display: none; }

.inbox-layout { display: grid; grid-template-columns: minmax(310px, 37%) 1fr; height: calc(100% - 86px); }
.message-list-pane { min-width: 0; border-right: 1px solid var(--line); background: rgba(251,250,247,.68); display: flex; flex-direction: column; }
.toolbar { padding: 15px 15px 11px; border-bottom: 1px solid var(--line); }
.search-box { height: 40px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 0 12px; color: #929892; }
.search-box:focus-within { border-color: #adc3b5; box-shadow: 0 0 0 3px rgba(62,104,86,.08); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); font-size: 12px; background: transparent; }
.filter-row { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); padding: 6px 10px; cursor: pointer; font-size: 10px; color: #66706a; }
.filter-chip.active { background: var(--ink); color: white; border-color: var(--ink); }
.mini-channel { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 4px; margin-right: 3px; font-size: 8px; font-weight: 800; color: white; }
.mini-channel.ig { background: linear-gradient(135deg, #7047c8, #e65770 60%, #f2ac51); }
.mini-channel.gm { background: #e4584c; }

.message-list { flex: 1; overflow-y: auto; padding: 8px; }
.message-card { position: relative; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 16px; padding: 13px 12px; display: grid; grid-template-columns: 40px 1fr; gap: 10px; text-align: left; cursor: pointer; transition: .16s ease; }
.message-card:hover { background: rgba(255,255,255,.72); }
.message-card.active { background: white; border-color: #e0e5df; box-shadow: 0 8px 23px rgba(43,54,47,.07); }
.message-card + .message-card { margin-top: 3px; }
.avatar-wrap { position: relative; }
.avatar { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; background: #e6ded5; color: #5f554b; font-size: 11px; font-weight: 750; }
.channel-badge { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border: 2px solid white; border-radius: 6px; display: grid; place-items: center; color: white; font-size: 8px; font-weight: 800; }
.channel-badge.instagram { background: linear-gradient(135deg, #7047c8, #e65770 60%, #f2ac51); }
.channel-badge.gmail { background: #e4584c; }
.message-card-head { display: flex; gap: 8px; align-items: baseline; }
.message-card-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.message-card time { font-size: 9px; color: #959b97; }
.message-subject { margin: 4px 0 0; font-size: 11px; font-weight: 620; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-snippet { margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; }
.message-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.meta-tag { padding: 3px 6px; background: #f0f1ee; border-radius: 5px; color: #68716b; font-size: 8px; font-weight: 650; }
.priority-dot { position: absolute; left: 4px; top: 29px; width: 5px; height: 5px; border-radius: 50%; background: var(--apricot); }
.empty-list { padding: 60px 25px; text-align: center; color: var(--muted); }
.empty-list strong { display: block; color: var(--ink); margin-bottom: 6px; }

.detail-pane { min-width: 0; overflow-y: auto; background: rgba(255,255,255,.72); position: relative; }
.detail-pane.empty { display: grid; place-items: center; }
.empty-state { max-width: 300px; text-align: center; padding: 30px; }
.empty-orbit { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 18px; border: 1px solid #d7dfd9; border-radius: 50%; box-shadow: inset 0 0 0 10px #f1f5f2; color: var(--sage); font-size: 21px; }
.empty-state h2 { font-family: Georgia, serif; margin: 0 0 8px; font-size: 22px; font-weight: 500; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.detail-content { max-width: 780px; margin: 0 auto; padding: 20px 26px 112px; }
.mobile-back { display: none; }
.detail-header { display: grid; grid-template-columns: 49px 1fr auto; align-items: center; gap: 12px; margin-bottom: 18px; }
.detail-avatar { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 16px; background: #e6ded5; font-size: 13px; font-weight: 750; }
.detail-header h2 { margin: 0 0 3px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.detail-header p { margin: 0; color: var(--muted); font-size: 10px; }
.status-badge { padding: 7px 9px; border-radius: 999px; font-size: 9px; font-weight: 750; background: var(--apricot-soft); color: #a35b31; }
.status-badge.approved { background: var(--sage-soft); color: var(--sage); }
.status-badge.sent { background: #e3f3e8; color: #247048; }
.status-badge.rejected { background: #eee; color: #717171; }

.analysis-card { border: 1px solid #dfe8e1; background: linear-gradient(145deg, #f0f5f1, #fbfcfb); border-radius: 17px; padding: 15px; }
.analysis-title { display: flex; align-items: center; gap: 8px; color: var(--sage); font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.analysis-card > p { margin: 9px 0 12px; font-size: 11px; line-height: 1.55; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.fact { background: rgba(255,255,255,.75); border: 1px solid #e3e9e4; border-radius: 11px; padding: 9px; min-width: 0; }
.fact span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .65px; margin-bottom: 3px; }
.fact strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.risk-tag { background: var(--apricot-soft); color: #9d5d37; border-radius: 7px; padding: 4px 7px; font-size: 8px; font-weight: 700; }

.section-kicker { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; color: #737b76; font-size: 9px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; }
.section-kicker::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.conversation { display: grid; gap: 9px; }
.bubble { max-width: 82%; border-radius: 15px 15px 15px 4px; padding: 11px 13px; background: #f0eee9; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.bubble.me { justify-self: end; background: var(--sage-soft); border-radius: 15px 15px 4px 15px; }
.bubble time { display: block; color: #989d99; margin-top: 6px; font-size: 8px; }

.draft-card { border: 1px solid #dcded9; background: white; border-radius: 17px; overflow: hidden; box-shadow: 0 9px 28px rgba(45,55,49,.06); }
.draft-toolbar { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid #ecebe7; color: var(--sage); font-size: 9px; font-weight: 750; }
.draft-toolbar span:first-child { margin-right: 6px; }
.draft-saved { margin-left: auto; color: #96a098; font-weight: 500; }
.draft-card textarea { display: block; width: 100%; min-height: 164px; resize: vertical; border: 0; outline: 0; padding: 14px; color: var(--ink); background: transparent; font-size: 11px; line-height: 1.65; }
.instruction-box { margin-top: 10px; border: 1px solid #e3ded6; background: #fbf9f5; border-radius: 15px; padding: 11px; }
.instruction-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #6b655f; font-size: 9px; font-weight: 750; }
.instruction-input-row { display: flex; gap: 7px; }
.instruction-input-row input { min-width: 0; flex: 1; height: 39px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: white; padding: 0 11px; font-size: 10px; }
.instruction-input-row input:focus { border-color: #adc3b5; box-shadow: 0 0 0 3px rgba(62,104,86,.08); }
.quick-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.quick-command { border: 1px solid #e2dfd9; background: white; border-radius: 999px; padding: 5px 8px; font-size: 8px; color: #696c68; cursor: pointer; }
.quick-command:hover { border-color: #aebfb3; color: var(--sage); }

.detail-actions { position: sticky; bottom: -112px; margin: 18px -26px -112px; padding: 13px 26px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; gap: 8px; z-index: 3; }
.button { min-height: 42px; border-radius: 12px; border: 1px solid transparent; padding: 0 16px; font-weight: 720; font-size: 11px; cursor: pointer; transition: .15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button.primary { background: var(--sage-dark); color: white; box-shadow: 0 7px 16px rgba(41,72,59,.18); }
.button.primary:hover { background: #203c30; }
.button.ghost { background: white; border-color: var(--line); }
.button.danger { color: var(--red); background: white; border-color: #ecd7d7; }
.button.compact { min-height: 39px; }
.detail-actions .approve { margin-left: auto; min-width: 145px; }

.sheet, .confirm-dialog { border: 0; padding: 0; background: transparent; overflow: visible; }
.sheet::backdrop, .confirm-dialog::backdrop { background: rgba(28,36,31,.38); backdrop-filter: blur(4px); }
.sheet-card { width: min(590px, calc(100vw - 28px)); max-height: calc(100dvh - 30px); overflow-y: auto; margin: 0; padding: 24px; border-radius: 23px; border: 1px solid rgba(255,255,255,.7); background: #fdfcf9; box-shadow: var(--shadow); }
.sheet.narrow .sheet-card { width: min(470px, calc(100vw - 28px)); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.sheet-header h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.close-button { font-size: 20px; flex: 0 0 auto; }
.sheet-intro { margin: 13px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.field-label { display: block; margin: 15px 0 7px; color: #58615b; font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.sheet textarea, .sheet select, .login-card input { width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; outline: 0; padding: 11px; font-size: 11px; line-height: 1.5; }
.sheet textarea:focus, .sheet select:focus, .login-card input:focus { border-color: #adc3b5; box-shadow: 0 0 0 3px rgba(62,104,86,.08); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guardrail-box { display: flex; gap: 11px; align-items: flex-start; margin-top: 17px; padding: 12px; border-radius: 13px; background: var(--sage-soft); color: var(--sage-dark); }
.guardrail-box > span { font-size: 18px; }
.guardrail-box p { margin: 0; font-size: 10px; line-height: 1.5; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.connection-list { display: grid; gap: 8px; }
.connection-item { display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.connection-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 800; }
.connection-logo.instagram { background: linear-gradient(135deg, #7047c8, #e65770 60%, #f2ac51); }
.connection-logo.gmail { background: #e4584c; }
.connection-logo.openai { background: var(--ink); }
.connection-item strong { display: block; font-size: 11px; }
.connection-item small { color: var(--muted); font-size: 9px; }
.connection-state { color: #9b5e38; background: var(--apricot-soft); padding: 5px 7px; border-radius: 999px; font-size: 8px; font-weight: 750; }
.connection-state.ok { color: var(--sage); background: var(--sage-soft); }
.connect-link { border: 0; cursor: pointer; text-decoration: none; }
.live-toggle-card { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 17px; padding: 14px; background: #f4f2ed; border-radius: 14px; }
.live-toggle-card strong { font-size: 11px; }
.live-toggle-card p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toggle-visual { width: 37px; height: 21px; flex: 0 0 auto; padding: 3px; background: #cccac5; border-radius: 999px; }
.toggle-visual i { display: block; width: 15px; height: 15px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.toggle-visual.on { background: var(--sage); }
.toggle-visual.on i { transform: translateX(16px); }

.confirm-card { width: min(430px, calc(100vw - 28px)); padding: 25px; border-radius: 23px; background: #fdfcf9; box-shadow: var(--shadow); text-align: center; }
.confirm-icon { width: 47px; height: 47px; margin: 0 auto 13px; display: grid; place-items: center; background: var(--sage-soft); color: var(--sage); border-radius: 50%; font-size: 19px; }
.confirm-card h2 { font-family: Georgia, serif; font-size: 23px; font-weight: 500; margin: 0 0 7px; }
.confirm-card > p { color: var(--muted); font-size: 10px; margin: 0 0 13px; }
.confirm-preview { max-height: 160px; overflow: auto; padding: 12px; background: #f2f0eb; border-radius: 12px; text-align: left; white-space: pre-wrap; font-size: 10px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }

.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); padding: 35px; background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); border-radius: 25px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-card h1 { font-family: Georgia, serif; font-size: 31px; font-weight: 500; margin: 0 0 9px; letter-spacing: -.6px; }
.login-card > p:not(.eyebrow):not(.form-error) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-input-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.login-card input { height: 41px; }
.form-error { min-height: 18px; margin: 9px 0 0; color: var(--red); font-size: 10px; }

.toast-region { position: fixed; z-index: 50; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 250px; max-width: 360px; padding: 12px 14px; border-radius: 13px; background: var(--ink); color: white; box-shadow: 0 13px 30px rgba(30,40,34,.24); font-size: 10px; animation: toast-in .22s ease; }
.toast.error { background: #7d3333; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.loading-lines { padding: 15px; }
.loading-line { height: 75px; border-radius: 14px; margin-bottom: 7px; background: linear-gradient(90deg,#eeeae3,#f7f5f0,#eeeae3); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mobile-nav { display: none; }

@media (max-width: 850px) {
  body { overflow: hidden; }
  .app-shell { display: block; padding: 0; }
  .sidebar { display: none; }
  .workspace { height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { height: 69px; padding: env(safe-area-inset-top) 14px 0; }
  .page-heading { display: none; }
  .mobile-brand { display: flex; flex: 1; padding: 0; }
  .mobile-brand .brand-mark { width: 33px; height: 33px; border-radius: 10px; font-size: 17px; }
  .mobile-brand strong { font-size: 19px; }
  .live-pill { display: none; }
  .inbox-layout { grid-template-columns: 1fr; height: calc(100dvh - 69px - 66px - env(safe-area-inset-bottom)); }
  .message-list-pane { border: 0; }
  .detail-pane { position: fixed; inset: 0; z-index: 9; padding-top: env(safe-area-inset-top); background: #fbfaf7; transform: translateX(105%); transition: transform .24s ease; }
  .detail-pane.mobile-open { transform: translateX(0); }
  .detail-pane.empty { display: none; }
  .detail-content { padding: 13px 16px 92px; }
  .mobile-back { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; margin: 0 0 10px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 10px; }
  .detail-header { grid-template-columns: 44px 1fr auto; }
  .detail-avatar { width: 44px; height: 44px; border-radius: 14px; }
  .detail-header h2 { font-size: 20px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:last-child { grid-column: 1 / -1; }
  .detail-actions { bottom: -92px; margin: 18px -16px -92px; padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); }
  .detail-actions .button { padding: 0 11px; }
  .detail-actions .approve { min-width: 128px; }
  .mobile-nav { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 18px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.9); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .mobile-nav button { border: 0; background: transparent; color: #7e8580; font-size: 9px; font-weight: 650; }
  .mobile-nav button span { display: block; font-size: 19px; line-height: 1.3; }
  .mobile-nav button.active { color: var(--sage); }
  body.detail-open .mobile-nav { display: none; }
  .message-list { padding-bottom: 16px; }
  .sheet { margin: auto auto 0; }
  .sheet-card { width: 100vw !important; max-height: 88dvh; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .toast-region { left: 12px; right: 12px; bottom: calc(75px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 430px) {
  .toolbar { padding: 11px 12px 9px; }
  .message-card { padding: 13px 9px; }
  .bubble { max-width: 92%; }
  .analysis-card { padding: 13px; }
}

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