:root {
  color-scheme: light;
  --canvas: #f4f4f1;
  --paper: rgba(251, 251, 248, .84);
  --sidebar: #e9e9e4;
  --ink: #1d1e1c;
  --muted: #747770;
  --faint: #a5a79f;
  --line: rgba(29, 30, 28, .09);
  --glass: rgba(246, 246, 242, .78);
  --accent: #252724;
  --accent-soft: #dfe3dc;
  --green: #657d69;
  --danger: #a64f47;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(41, 43, 39, .10);
  --app-viewport-height: 100dvh;
  --app-viewport-top: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, textarea, select, input { font: inherit; }
button { color: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); width: 100%; height: var(--app-viewport-height); min-height: 0; }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--sidebar); border-right: 1px solid rgba(0,0,0,.045); padding: calc(20px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); z-index: 30; }
.brand-row { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 8px 14px; flex: 0 0 auto; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 50%; background: #2a2c29; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.brand-mark::before { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; left: 8px; top: 7px; background: #eff3ea; box-shadow: 0 0 12px rgba(235,242,228,.55); }
.brand-mark span { position: absolute; width: 28px; height: 17px; border-radius: 50% 60% 45% 55%; background: #aab5a6; transform: rotate(-24deg); right: -2px; bottom: 3px; opacity: .82; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 15px; letter-spacing: -.25px; font-weight: 630; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-close { display: none !important; margin-left: auto; }
.icon-button { appearance: none; border: 0; background: transparent; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.icon-button:hover { background: rgba(0,0,0,.055); }
.icon-button:active { transform: scale(.94); }

.new-chat { flex: 0 0 auto; width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: rgba(255,255,255,.62); display: flex; align-items: center; gap: 10px; padding: 0 12px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.52); transition: background .18s ease, transform .18s ease; }
.new-chat:hover { background: rgba(255,255,255,.9); }
.new-chat:active { transform: scale(.985); }
.new-chat svg { width: 18px; }
.new-chat span { font-size: 14px; font-weight: 560; }
kbd { margin-left: auto; border: 0; background: transparent; color: var(--faint); font-size: 11px; }
.sidebar-label { flex: 0 0 auto; display: flex; justify-content: space-between; padding: 23px 10px 9px; color: var(--muted); font-size: 11px; font-weight: 570; text-transform: uppercase; letter-spacing: .06em; }
.thread-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.thread-list::-webkit-scrollbar { display: none; }
.thread-item { position: relative; display: flex; align-items: center; width: 100%; border: 0; background: transparent; border-radius: 12px; padding: 11px 36px 11px 11px; text-align: left; cursor: pointer; transition: background .16s ease; }
.thread-item.active { background: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.thread-main { min-width: 0; pointer-events: none; }
.thread-main strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 1.25; font-weight: 520; letter-spacing: -.1px; }
.thread-main small { display: block; margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 10.5px; }
.thread-delete { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; opacity: 0; }
.thread-item.active .thread-delete { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .thread-item:hover { background: rgba(255,255,255,.45); }
  .thread-item:hover .thread-delete { opacity: 1; }
}
.thread-delete svg { width: 15px; }
.sidebar-footer { flex: 0 0 auto; padding-top: 12px; }
.machine-card { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 8px 9px 11px; border-top: 1px solid rgba(0,0,0,.065); }
.machine-light { width: 8px; height: 8px; border-radius: 50%; background: #a7aaa4; box-shadow: 0 0 0 4px rgba(120,125,118,.09); }
.machine-light.online { background: var(--green); box-shadow: 0 0 0 4px rgba(101,125,105,.12); }
.machine-card div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.machine-card strong { font-size: 12px; font-weight: 570; }
.machine-card small { margin-top: 3px; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-card .icon-button { width: 34px; height: 34px; }
.machine-card svg { width: 16px; }

.workspace { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--canvas); }
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 24px 10px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(150%) blur(24px); -webkit-backdrop-filter: saturate(150%) blur(24px); z-index: 10; }
.menu-button { display: none; }
.model-control { display: flex; flex-direction: column; min-width: 0; }
.model-control > label { font-size: 9px; line-height: 1; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 5px 2px; }
.select-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.select-wrap select { appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 590; letter-spacing: -.18px; padding: 0 26px 0 0; max-width: 310px; cursor: pointer; }
.select-wrap svg { position: absolute; right: 3px; width: 16px; pointer-events: none; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.connection-status { display: flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 10px; background: rgba(255,255,255,.56); border-radius: 999px; }
.connection-status span { width: 6px; height: 6px; border-radius: 50%; background: #a7aaa4; }
.connection-status.online span { background: var(--green); }
.connection-status.offline span { background: var(--danger); }
.connection-status em { font-style: normal; color: var(--muted); font-size: 10.5px; }

.conversation { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; padding: 0 max(24px, calc((100vw - 290px - 820px) / 2)); }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 52px 0 38px; text-align: center; }
.quiet-orb { position: relative; width: 76px; height: 76px; margin-bottom: 27px; border-radius: 50%; background: #262825; overflow: hidden; box-shadow: 0 18px 45px rgba(40,43,38,.16); }
.quiet-orb i { position: absolute; width: 29px; height: 29px; top: 14px; left: 16px; border-radius: 50%; background: #f0f3eb; box-shadow: 0 0 18px rgba(237,243,230,.48); }
.quiet-orb b { position: absolute; width: 65px; height: 38px; right: -10px; bottom: 2px; border-radius: 60% 40% 50% 40%; background: #aeb8aa; transform: rotate(-18deg); opacity: .86; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font-size: 10px; letter-spacing: .13em; font-weight: 600; }
.empty-state h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.08; letter-spacing: -1.8px; font-weight: 610; }
.empty-copy { margin: 18px 0 30px; color: var(--muted); font-size: 14px; line-height: 1.55; letter-spacing: -.15px; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; width: min(680px, 100%); }
.suggestions button { min-height: 84px; border: 0; border-radius: 16px; background: rgba(255,255,255,.58); box-shadow: inset 0 0 0 1px rgba(255,255,255,.64); padding: 15px; text-align: left; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.suggestions button:hover { background: rgba(255,255,255,.9); transform: translateY(-1px); }
.suggestions span { display: block; font-size: 13px; font-weight: 590; }
.suggestions small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.message-list { display: none; width: min(780px, 100%); min-height: 100%; margin: 0 auto; padding: 46px 0 40px; }
.message-list.has-messages { display: block; }
.message { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 13px; margin-bottom: 34px; animation: rise .25s ease both; }
.message-list.has-streaming .message { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-top: 1px; font-size: 11px; font-weight: 650; }
.message.user .avatar { background: #d9ddd6; color: #444840; }
.message.assistant .avatar { background: #272926; color: #eef1ea; }
.message-body { min-width: 0; }
.message-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; margin-bottom: 6px; }
.message-head strong { font-size: 12px; font-weight: 630; }
.message-head small { color: var(--faint); font-size: 10px; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 9px; max-width: 100%; min-width: 0; margin: 2px 0 12px; }
.message-attachments .image-attachment { flex: 0 0 112px; }
.message-attachments .file-attachment { flex: 1 1 180px; width: auto; min-width: 0; max-width: 240px; }
.attachment-card { position: relative; color: inherit; text-decoration: none; }
.image-attachment { width: 112px; overflow: hidden; border-radius: 14px; background: rgba(0,0,0,.045); box-shadow: inset 0 0 0 1px rgba(0,0,0,.055); }
.image-attachment img { display: block; width: 112px; height: 92px; object-fit: cover; }
.image-attachment > span { display: block; overflow: hidden; padding: 7px 9px; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.file-attachment { display: flex; align-items: center; gap: 9px; width: min(240px, 100%); min-height: 56px; padding: 8px 11px 8px 8px; border-radius: 13px; background: rgba(255,255,255,.58); box-shadow: inset 0 0 0 1px rgba(0,0,0,.055); }
.file-badge { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: #dfe4db; color: #596155; font-size: 9px; font-weight: 700; }
.file-copy { min-width: 0; display: flex; flex-direction: column; }
.file-copy strong { overflow: hidden; font-size: 11px; font-weight: 570; white-space: nowrap; text-overflow: ellipsis; }
.file-copy small { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.message-content { font-size: 15px; line-height: 1.68; letter-spacing: -.12px; overflow-wrap: anywhere; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 13px; }
.message-content h1, .message-content h2, .message-content h3 { margin: 23px 0 10px; line-height: 1.25; letter-spacing: -.4px; }
.message-content h1 { font-size: 23px; }.message-content h2 { font-size: 19px; }.message-content h3 { font-size: 16px; }
.message-content ul, .message-content ol { padding-left: 22px; margin: 9px 0 14px; }
.message-content li { margin: 5px 0; }
.message-content code { padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.055); font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }
.code-block { position: relative; margin: 14px 0; border-radius: 13px; overflow: hidden; background: #292b28; color: #eef0eb; }
.code-block pre { margin: 0; padding: 17px; overflow-x: auto; }
.code-block code { padding: 0; background: transparent; color: inherit; font-size: 12.5px; line-height: 1.55; }
.message-content blockquote { margin: 12px 0; padding-left: 14px; border-left: 2px solid #a8aea4; color: var(--muted); }
.message-content a { color: #496358; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.thinking { margin: 1px 0 13px; border-radius: 12px; background: rgba(223,227,220,.55); overflow: hidden; }
.thinking summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; color: var(--muted); font-size: 11px; cursor: pointer; }
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8c9788; }
.thinking.is-streaming summary::before { animation: thinking-glow 1.15s infinite ease-in-out; }
@keyframes thinking-glow { 0%, 100% { opacity: .35; box-shadow: 0 0 0 0 rgba(101,125,105,.1); } 50% { opacity: 1; box-shadow: 0 0 0 5px rgba(101,125,105,.1); } }
.thinking[open] summary { border-bottom: 1px solid rgba(0,0,0,.06); }
.thinking-text { padding: 12px 14px; color: #62665e; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.typing { display: inline-flex; align-items: center; gap: 4px; min-height: 23px; }
.waiting-state { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: #91958d; animation: pulse 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.composer-zone { z-index: 8; padding: 12px max(24px, calc((100vw - 290px - 820px) / 2)) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(244,244,241,0), var(--canvas) 18%); }
.composer { width: min(780px, 100%); margin: 0 auto; padding: 13px 13px 10px 17px; border-radius: var(--radius); background: rgba(255,255,255,.86); box-shadow: 0 12px 40px rgba(43,45,41,.08), inset 0 0 0 1px rgba(255,255,255,.8); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); transition: box-shadow .2s ease; }
.composer:focus-within { box-shadow: 0 15px 46px rgba(43,45,41,.12), inset 0 0 0 1px rgba(88,96,84,.18); }
.attachment-tray { display: flex; gap: 9px; overflow-x: auto; padding: 1px 1px 10px; scrollbar-width: none; }
.attachment-tray[hidden] { display: none; }
.attachment-tray::-webkit-scrollbar { display: none; }
.attachment-tray .attachment-card { flex: 0 0 auto; }
.attachment-remove { position: absolute; top: 5px; right: 5px; z-index: 2; display: grid; place-items: center; width: 23px; height: 23px; border: 0; border-radius: 50%; padding: 0 0 2px; background: rgba(25,27,24,.82); color: white; font-size: 17px; line-height: 1; cursor: pointer; }
.composer textarea { display: block; width: 100%; max-height: 160px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 2px 0 8px; font-size: 15px; line-height: 1.45; }
.composer textarea::placeholder { color: #999c95; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 9px; }
.attachment-button { appearance: none; display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.11); border-radius: 50%; padding: 0; background: transparent; color: var(--ink); cursor: pointer; transition: background .18s ease, transform .18s ease, opacity .18s ease; }
.attachment-button:hover { background: rgba(0,0,0,.05); }
.attachment-button:active { transform: scale(.92); }
.attachment-button:disabled { opacity: .3; }
.attachment-button svg { width: 18px; }
.composer-meta { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 10px; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: #899987; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: var(--accent); color: white; cursor: pointer; transition: opacity .18s ease, transform .18s ease; }
.send-button svg { width: 17px; }
.send-button:active { transform: scale(.92); }
.send-button:disabled { opacity: .24; cursor: default; }
.composer-note { margin: 8px auto 0; text-align: center; color: var(--faint); font-size: 9.5px; }

.settings-sheet { width: min(430px, calc(100% - 28px)); border: 0; border-radius: 24px; padding: 0; background: rgba(248,248,245,.96); box-shadow: var(--shadow); color: var(--ink); }
.settings-sheet::backdrop { background: rgba(20,21,19,.23); backdrop-filter: blur(3px); }
.settings-sheet form { padding: 9px 22px 22px; }
.sheet-handle { width: 34px; height: 4px; margin: 0 auto 15px; border-radius: 3px; background: #d3d4cf; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.sheet-head small { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.sheet-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.55px; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row span { display: grid; gap: 4px; }
.toggle-row strong { font-size: 13px; font-weight: 570; }
.toggle-row small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: #d8dad5; transition: background .18s ease; }
.toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .18s ease; }
.toggle-row input:checked + i { background: #68766a; }
.toggle-row input:checked + i::after { transform: translateX(16px); }
.toggle-row input:focus-visible + i { outline: 2px solid #758477; outline-offset: 3px; }
.range-row { display: block; padding: 17px 0; border-top: 1px solid var(--line); }
.range-row span { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.range-row strong { font-size: 13px; font-weight: 570; }
.range-row em { font-size: 12px; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-row input { width: 100%; accent-color: #535950; }
.sheet-tip { margin: 2px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sheet-done { width: 100%; min-height: 44px; border: 0; border-radius: 13px; background: var(--accent); color: white; font-size: 13px; font-weight: 560; }
.toast { position: fixed; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; max-width: calc(100% - 34px); padding: 10px 14px; border-radius: 999px; background: rgba(32,33,31,.91); color: white; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 11px; text-align: center; animation: rise .2s ease; }
.toast.actionable { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(20,21,19,.2); backdrop-filter: blur(2px); }

@media (max-height: 720px) and (min-width: 761px) {
  .empty-state { padding: 18px 0 16px; }
  .quiet-orb { width: 54px; height: 54px; margin-bottom: 14px; }
  .quiet-orb i { width: 21px; height: 21px; top: 10px; left: 11px; }
  .quiet-orb b { width: 48px; height: 29px; }
  .eyebrow { margin-bottom: 8px; font-size: 9px; }
  .empty-state h1 { font-size: 35px; line-height: 1.03; }
  .empty-copy { margin: 10px 0 15px; font-size: 12px; }
  .suggestions button { min-height: 62px; padding: 11px 13px; }
  .suggestions small { margin-top: 4px; }
}

@media (max-width: 760px) {
  .app-shell { position: fixed; top: var(--app-viewport-top); right: 0; bottom: auto; left: 0; display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 24px 0 55px rgba(35,37,33,.16); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid !important; }
  .workspace { height: 100%; max-height: 100%; overflow: hidden; }
  .topbar { min-height: 62px; padding-left: 10px; padding-right: 10px; }
  .model-control { margin-left: 2px; margin-right: auto; max-width: calc(100vw - 146px); }
  .model-control > label { font-size: 10px; }
  .select-wrap select { max-width: 52vw; font-size: 14.5px; line-height: 21px; }
  .connection-status { width: 26px; height: 26px; min-height: 26px; padding: 0; justify-content: center; background: transparent; }
  .connection-status em { display: none; }
  .topbar-actions { gap: 0; }
  .topbar-actions .icon-button { width: 36px; height: 36px; }
  .conversation { padding: 0 18px; }
  .empty-state { padding: 36px 0 20px; justify-content: center; }
  .quiet-orb { width: 66px; height: 66px; margin-bottom: 23px; }
  .quiet-orb i { width: 25px; height: 25px; }
  .empty-state h1 { font-size: 36px; letter-spacing: -1.4px; }
  .empty-copy { margin: 16px 0 24px; font-size: 15.5px; }
  .suggestions { grid-template-columns: 1fr; width: min(390px, 100%); gap: 7px; }
  .suggestions button { min-height: 62px; padding: 12px 14px; }
  .suggestions span { font-size: 14.5px; }
  .suggestions small { margin-top: 4px; font-size: 12.5px; }
  .message-list { padding: 30px 0 26px; }
  .message { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin-bottom: 28px; }
  .avatar { width: 27px; height: 27px; font-size: 10px; }
  .message-head strong { font-size: 13px; }
  .message-head small { font-size: 11px; }
  .message-content { font-size: 19px; line-height: 1.7; letter-spacing: -.08px; }
  .message-content h1 { font-size: 25px; }
  .message-content h2 { font-size: 22px; }
  .message-content h3 { font-size: 19px; }
  .code-block code { font-size: 14px; }
  .thinking summary { font-size: 13px; }
  .thinking-text { font-size: 14px; line-height: 1.68; }
  .composer-zone { padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); }
  .composer { border-radius: 20px; padding: 12px 11px 9px 15px; }
  .composer textarea { font-size: 18px; line-height: 1.5; }
  .composer textarea::placeholder { color: #858980; }
  .composer-meta { color: var(--muted); font-size: 11.5px; }
  .attachment-button { width: 38px; height: 38px; }
  .attachment-button svg { width: 20px; }
  .attachment-tray { padding-bottom: 11px; }
  .image-attachment, .image-attachment img { width: 104px; }
  .message-attachments .image-attachment { flex-basis: 104px; }
  .image-attachment img { height: 88px; }
  .file-copy strong { font-size: 12px; }
  .composer-note { display: none; }
  .thread-main strong { font-size: 14.5px; }
  .thread-main small, .machine-card small { font-size: 12px; }
  .machine-card strong { font-size: 13.5px; }
  .toggle-row strong, .range-row strong { font-size: 14px; }
  .toggle-row small, .sheet-tip { font-size: 12px; }
  .settings-sheet { align-self: end; width: 100%; max-width: none; margin: auto 0 0; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}

.login-page {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 18% 12%, rgba(158, 190, 235, .45), transparent 38%),
    radial-gradient(circle at 85% 88%, rgba(216, 199, 239, .38), transparent 34%),
    var(--canvas);
  color: var(--ink);
}
.login-shell {
  width: min(430px, 100%);
  padding: 42px 34px 34px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(38, 50, 70, .14);
  backdrop-filter: blur(26px);
}
.login-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--ink);
  color: var(--canvas);
  font: 650 19px/1 system-ui;
}
.login-eyebrow { margin: 28px 0 8px; color: var(--faint); font-size: 11px; letter-spacing: .18em; }
.login-shell h1 { margin: 0; font: 560 clamp(32px, 8vw, 42px)/1.08 system-ui; letter-spacing: -.045em; }
.login-copy { margin: 16px 0 30px; color: var(--muted); line-height: 1.65; }
.login-form label { display: block; margin: 0 0 9px 3px; color: var(--muted); font-size: 13px; }
.login-field { display: flex; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 19px; background: var(--glass); }
.login-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0 10px; background: transparent; color: var(--ink); font-size: 16px; }
.login-field button { min-width: 82px; border: 0; border-radius: 13px; padding: 13px 17px; background: var(--ink); color: var(--canvas); font-weight: 650; }
.login-field button:disabled { opacity: .58; }
.login-error { min-height: 22px; margin: 10px 3px 0; color: #b44a42; font-size: 13px; }
.login-footnote { margin: 16px 3px 0; color: var(--faint); font-size: 12px; line-height: 1.55; }

@media (max-width: 520px) {
  .login-shell { padding: 34px 24px 28px; border-radius: 28px; }
}

@media (prefers-color-scheme: dark) {
  :root { --canvas:#161714; --paper:rgba(31,32,29,.88); --sidebar:#20211e; --ink:#f1f2ed; --muted:#9b9f96; --faint:#73776f; --line:rgba(255,255,255,.075); --glass:rgba(24,25,22,.8); --accent:#e7eae3; --accent-soft:#343832; }
  .brand-mark, .quiet-orb { background:#e7e9e3; }
  .brand-mark::before, .quiet-orb i { background:#2d302b; box-shadow:none; }
  .brand-mark span, .quiet-orb b { background:#758070; }
  .new-chat, .suggestions button, .thread-item.active, .connection-status { background:rgba(255,255,255,.065); box-shadow:inset 0 0 0 1px rgba(255,255,255,.035); }
  .new-chat:hover, .suggestions button:hover { background:rgba(255,255,255,.1); }
  @media (hover: hover) and (pointer: fine) { .thread-item:hover { background:rgba(255,255,255,.1); } }
  .composer { background:rgba(39,40,36,.91); box-shadow:0 12px 40px rgba(0,0,0,.24), inset 0 0 0 1px rgba(255,255,255,.055); }
  .send-button { background:#e8ebe4; color:#20221f; }
  .thinking { background:rgba(255,255,255,.055); }
  .message-content code { background:rgba(255,255,255,.075); }
  .settings-sheet { background:rgba(35,36,32,.98); }
  .sheet-done { background:#e7eae3; color:#21231f; }
}

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

#stop-generation { border: 1px solid var(--faint); border-radius: 16px; background: transparent; color: var(--ink); padding: 8px 12px; white-space: nowrap; }
