:root {
  color-scheme: light;
  --page: #e9e7dd;
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --elevated: #f0f0e7;
  --ink: #232a23;
  --muted: #626b60;
  --line: #dedfd4;
  --accent: #49654f;
  --accent-ink: #fffdf7;
  --sage: #e2eadf;
  --bubble: #eeeee4;
  --clay: #d9b9a7;
  --clay-ink: #583f33;
  --avatar: #ccd8bd;
  --avatar-ink: #3c4d32;
  --shadow: 0 18px 60px #2632230b;
  --serif: Georgia, "Times New Roman", serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111713;
  --paper: #161d19;
  --surface: #202923;
  --elevated: #28332b;
  --ink: #efefe6;
  --muted: #adb9ad;
  --line: #3c483e;
  --accent: #b4c4ac;
  --accent-ink: #1b291e;
  --sage: #304033;
  --bubble: #303b32;
  --clay: #715648;
  --clay-ink: #f5e1d2;
  --avatar: #4d6047;
  --avatar-ink: #e5ecd9;
  --shadow: 0 18px 60px #0002;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.demo-banner { height: 38px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 11px; letter-spacing: .015em; }
.demo-banner strong { color: var(--ink); font-weight: 600; }
.banner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.app-shell { display: grid; grid-template-columns: 288px minmax(0,1fr) 248px; max-width: 1480px; height: calc(100dvh - 58px); min-height: 540px; margin: 0 20px 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--line); padding: 24px 16px 16px; }
.brand-row { display: flex; align-items: center; gap: 9px; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border: 1.5px solid var(--accent); border-radius: 50%; font: italic 30px/.8 var(--serif); color: var(--accent); padding: 0 3px 5px 0; }
.brand-row h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.06em; line-height: 1.2; }
.brand-period { color: var(--accent); }
.eyebrow { margin: 1px 0 0; color: var(--muted); font-size: 10px; letter-spacing: .015em; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; font-size: 19px; color: var(--muted); }
.icon-button:hover { background: var(--elevated); color: var(--ink); }
.brand-row .icon-button { margin-left: auto; }
.inbox-heading { display: flex; align-items: center; justify-content: space-between; margin: 35px 12px 21px; }
.inbox-heading h2 { margin: 0; font-size: 31px; font-weight: 550; letter-spacing: -.065em; line-height: 1; }
.inbox-heading h2 span { color: var(--accent); }
.count-pill { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 11px; }
.search-wrap { display: flex; align-items: center; gap: 8px; margin: 0 6px; min-height: 43px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.search-wrap svg { width: 17px; flex: none; }
.search-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-wrap kbd { flex: none; font: 10px ui-sans-serif, sans-serif; opacity: .8; }
.side-heading { display: flex; justify-content: space-between; padding: 26px 12px 12px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.conversation-list { display: grid; gap: 7px; }
.conversation-card { display: flex; align-items: flex-start; gap: 11px; width: 100%; position: relative; padding: 16px 12px; text-align: left; border: 1px solid transparent; border-radius: 13px; background: transparent; }
.conversation-card:hover { background: var(--elevated); }
.conversation-card.selected { background: var(--sage); border-color: var(--line); }
.avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 16px; font-size: 12px; font-weight: 650; letter-spacing: -.03em; }
.avatar-clay { background: var(--clay); color: var(--clay-ink); }
.avatar-sage { background: var(--avatar); color: var(--avatar-ink); }
.avatar-self { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 9px; }
.conversation-copy { display: grid; gap: 4px; min-width: 0; width: 100%; }
.conversation-name { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.conversation-name strong { font-size: 12px; font-weight: 650; }
.conversation-name small { font-size: 9px; color: var(--muted); white-space: nowrap; }
.conversation-preview { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.contact-tag { font-size: 9px; color: var(--accent); }
.unread-dot { position: absolute; bottom: 18px; right: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.sidebar-note { margin: auto 13px 25px; padding-top: 30px; color: var(--muted); }
.note-flower { color: var(--accent); font-size: 31px; line-height: 1; }
.sidebar-note p { margin: 9px 0 0; font-size: 15px; line-height: 1.45; letter-spacing: -.02em; }
.sidebar-note em { font-family: var(--serif); font-size: 19px; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 17px 7px 0; border-top: 1px solid var(--line); }
.sidebar-footer strong { display: block; font-size: 11px; font-weight: 600; }
.sidebar-footer small { display: block; font-size: 9px; color: var(--muted); }
.appearance-control { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; margin-left: auto; color: var(--muted); border-radius: 8px; }
.appearance-control svg { width: 16px; height: 16px; pointer-events: none; }
.appearance-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.appearance-control:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.conversation-header { display: flex; align-items: center; gap: 10px; padding: 23px 28px; min-height: 91px; border-bottom: 1px solid var(--line); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.035em; }
.person p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.header-actions { display: flex; align-items: center; margin-left: auto; gap: 2px; }
.mobile-back { display: none; }
.view-tabs { display: flex; flex: none; align-items: center; gap: 4px; padding: 13px 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { min-height: 34px; padding: 7px 16px; border: 0; border-radius: 8px; white-space: nowrap; background: transparent; color: var(--muted); font-size: 11px; font-weight: 550; }
.tab:hover { background: var(--elevated); }
.tab.active { background: var(--sage); color: var(--ink); }
.request-card { display: flex; flex: none; align-items: center; gap: 10px; margin: 21px 28px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.request-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--sage); color: var(--accent); }
.request-copy { flex: 1; min-width: 0; }
.request-copy strong { display: block; font-size: 11px; font-weight: 650; }
.request-copy p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.request-actions { display: flex; gap: 6px; }
.primary-button, .secondary-button { min-height: 36px; padding: 8px 12px; border-radius: 8px; font-size: 11px; font-weight: 550; white-space: nowrap; }
.primary-button { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; }
.primary-button:hover { filter: brightness(.93); }
.secondary-button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.secondary-button:hover { background: var(--elevated); }
.timeline { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 30px 16px; scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
.timeline:focus-visible { outline-offset: -3px; }
.day-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 29px; color: var(--muted); font-size: 9px; letter-spacing: .045em; }
.day-divider:before, .day-divider:after { content: ""; width: 35px; height: 1px; background: var(--line); }
.message-row { display: flex; gap: 9px; margin: 0 0 20px; max-width: 84%; }
.message-row.mine { margin-left: auto; justify-content: flex-end; }
.message-content { min-width: 0; }
.message-avatar { width: 25px; height: 25px; border-radius: 9px; font-size: 8px; margin-top: 3px; }
.bubble { padding: 13px 16px; border-radius: 4px 17px 17px 17px; background: var(--bubble); line-height: 1.6; font-size: 13px; }
.mine .bubble { border-radius: 17px 4px 17px 17px; background: var(--accent); color: var(--accent-ink); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-meta { margin: 5px 3px 0; color: var(--muted); font-size: 9px; }
.mine .message-meta { text-align: right; }
.thread-intro { margin: 8px 0 23px; color: var(--muted); font: italic 18px/1.4 var(--serif); text-align: center; }
.composer { flex: none; padding: 10px 28px 22px; background: var(--surface); }
.composer-mode { display: flex; align-items: center; gap: 4px; padding: 0 3px 9px; color: var(--muted); font-size: 10px; }
.composer-mode select { border: 0; color: var(--accent); background: transparent; font-size: 11px; font-weight: 600; padding: 3px; }
.draft-count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 9px; }
.compose-box { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.compose-box:focus-within { border-color: var(--accent); }
.composer textarea { display: block; flex: 1; width: 100%; min-width: 0; min-height: 39px; max-height: 120px; resize: none; border: 0; background: transparent; color: var(--ink); outline: 0; padding: 8px 0; font-size: 12px; line-height: 1.65; }
::placeholder { color: var(--muted); opacity: .9; }
.attachment-button { width: 30px; height: 38px; flex: none; border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.send-button { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 11px; }
.send-button:disabled { opacity: .38; }
.send-button:not(:disabled):hover { filter: brightness(.94); transform: translateY(-1px); }
.composer input { width: 100%; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 12px; }
.composer-tools { display: flex; justify-content: space-between; gap: 10px; padding: 8px 3px 0; color: var(--muted); font-size: 9px; }
.details-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; padding: 29px 23px 22px; border-left: 1px solid var(--line); background: var(--paper); }
.detail-topline { text-align: center; color: var(--muted); font-size: 8px; letter-spacing: .12em; font-weight: 600; }
.profile-orbit { position: relative; width: 84px; margin: 36px auto 18px; }
.details-avatar { width: 84px; height: 84px; border-radius: 30px; font: 24px var(--serif); }
.profile-flower { position: absolute; right: -8px; bottom: -6px; color: var(--accent); font-size: 30px; line-height: 1; }
.details-panel > h2 { text-align: center; font: 25px/1.15 var(--serif); letter-spacing: -.04em; margin: 0; }
.muted { text-align: center; color: var(--muted); font-size: 10px; margin: 8px 0 0; }
.detail-rule { height: 1px; min-height: 1px; background: var(--line); margin: 30px 0 22px; }
.shared-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.shared-heading h3 { margin: 0; font-size: 11px; font-weight: 600; }
.shared-heading span { color: var(--muted); }
.sample-art { position: relative; flex: none; height: 148px; border-radius: 12px; background: #d8c7ad; overflow: hidden; isolation: isolate; }
.art-sun { position: absolute; width: 41px; height: 41px; border-radius: 50%; background: #f4e8cb; top: 25px; right: 35px; }
.art-hill { position: absolute; width: 250px; height: 180px; border-radius: 50%; }
.art-hill.back { background: #83967c; top: 82px; left: 45px; transform: rotate(-30deg); }
.art-hill.front { background: #4f6a50; top: 82px; left: -105px; transform: rotate(18deg); }
.art-label { position: absolute; left: 13px; bottom: 13px; color: #fffdf7; font: italic 16px var(--serif); }
.media-caption { margin: 8px 1px 23px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.details-panel dl { margin: 0 0 24px; font-size: 10px; }
.details-panel dl div { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.details-panel dt { color: var(--muted); }
.details-panel dd { margin: 0; text-align: right; }
.truth-card { display: flex; align-items: flex-start; gap: 7px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.truth-dot { width: 5px; height: 5px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.truth-card strong { font-size: 10px; font-weight: 550; }
.truth-card p { margin: 4px 0 0; font-size: 9px; color: var(--muted); line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1520px) { .app-shell { margin-inline: auto; } }
@media (max-width: 1180px) { .app-shell { grid-template-columns: 268px minmax(0,1fr); } .details-panel { display: none; } }
@media (max-height: 720px) and (min-width: 761px) { .sidebar-note { display: none; } .sidebar-footer { margin-top: auto; } }
@media (max-width: 760px) {
  body { background: var(--paper); }
  .demo-banner { height: 32px; font-size: 9px; gap: 7px; }
  .app-shell { display: block; height: calc(100dvh - 32px); min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { height: 100%; border: 0; overflow-y: auto; padding: 24px 19px max(17px,env(safe-area-inset-bottom)); }
  .brand-row { padding: 0 6px; }
  .brand-row h1 { font-size: 25px; }
  .inbox-heading { margin: 43px 6px 23px; }
  .inbox-heading h2 { font-size: 42px; }
  .search-wrap { margin: 0 5px; min-height: 48px; border-radius: 12px; }
  .search-wrap input { font-size: 14px; }
  .search-wrap kbd { display: none; }
  .side-heading { padding: 28px 7px 13px; font-size: 10px; }
  .conversation-card { padding: 20px 12px; gap: 13px; }
  .conversation-name strong { font-size: 15px; }
  .conversation-name small, .conversation-preview { font-size: 11px; }
  .contact-tag { font-size: 10px; }
  .conversation-card .avatar { width: 48px; height: 48px; border-radius: 18px; }
  .sidebar-note { margin: auto 10px 33px; }
  .sidebar-note p { font-size: 17px; }
  .sidebar-note em { font-size: 22px; }
  .sidebar-footer { padding-top: 19px; }
  .sidebar-footer strong { font-size: 13px; }
  .sidebar-footer small, .appearance-control select { font-size: 11px; }
  .appearance-control select { min-height: 44px; max-width: 100px; }
  .app-shell[data-pane="inbox"] .conversation { display: none; }
  .app-shell[data-pane="thread"] .sidebar { display: none; }
  .conversation { height: 100%; }
  .conversation-header { padding: 11px 13px 11px 7px; min-height: 76px; gap: 3px; }
  .mobile-back { display: inline-grid; font-size: 32px; width: 40px; }
  .person { gap: 9px; }
  .person .avatar { width: 37px; height: 37px; border-radius: 14px; font-size: 11px; }
  .person h2 { font-size: 14px; white-space: nowrap; }
  .person p { font-size: 9px; }
  .header-actions { gap: 0; }
  .icon-button { width: 44px; min-height: 44px; }
  .appearance-control { width: 44px; height: 44px; }
  .header-actions #details-toggle { display: none; }
  .header-actions svg { width: 18px; }
  .view-tabs { gap: 0; padding: 8px 13px; justify-content: space-between; }
  .tab { min-height: 42px; padding: 7px 10px; font-size: 11px; }
  .request-card { margin: 14px 17px 0; padding: 12px; gap: 9px; flex-wrap: wrap; }
  .request-copy strong { font-size: 12px; }
  .request-actions { width: 100%; justify-content: flex-end; padding-top: 5px; }
  .primary-button, .secondary-button { min-height: 42px; }
  .timeline { padding: 24px 18px 12px; }
  .message-row { max-width: 95%; }
  .bubble { padding: 12px 14px; font-size: 14px; }
  .message-meta { font-size: 9px; }
  .composer { padding: 10px 16px max(14px,env(safe-area-inset-bottom)); }
  .composer textarea { font-size: 16px; }
  .composer input { font-size: 16px; }
  .composer-mode { font-size: 11px; }
  .composer-mode select { min-height: 30px; font-size: 12px; }
  .keyboard-hint { display: none; }
  .send-button, .attachment-button { width: 40px; height: 42px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: transform 120ms ease; }
  .message-row:last-child { animation: arrive 160ms ease-out; }
  @keyframes arrive { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 760px) and (max-height: 680px) {
  .sidebar-note { display: none; }
  .sidebar-footer { margin-top: auto; }
  .inbox-heading { margin-top: 25px; }
}
