:root {
  --chat-accent: #cf6d9a;
  --chat-accent-deep: #8e3f68;
  --chat-accent-soft: rgba(233, 160, 193, .28);
  --chat-ink: #31242c;
  --chat-muted: #6e5965;
  --bg-a: #f8d1ca;
  --bg-b: #d5a7c8;
  --bg-c: #a994d2;
  --glow-a: rgba(255, 217, 204, .86);
  --glow-b: rgba(227, 155, 205, .66);
  --glow-c: rgba(154, 126, 211, .58);
  --glass-fill: rgba(255, 248, 251, .48);
  --glass-border: rgba(255, 255, 255, .66);
  --glass-divider: rgba(100, 67, 88, .1);
  --focus-ring: rgba(127, 54, 94, .34);
  --sidebar-width: 264px;
  --content-width: 780px;
  --chat-viewport-height: 100svh;
  color-scheme: light;
}

body.chat-page[data-theme="ocean"] {
  --chat-accent: #4f88c5; --chat-accent-deep: #2d5c91; --chat-accent-soft: rgba(113, 169, 224, .25);
  --bg-a: #dcecf3; --bg-b: #b8d6e8; --bg-c: #8aa7cf;
  --glow-a: rgba(235, 250, 255, .92); --glow-b: rgba(141, 204, 226, .66); --glow-c: rgba(108, 132, 196, .54);
}

body.chat-page[data-theme="sage"] {
  --chat-accent: #5e9877; --chat-accent-deep: #326347; --chat-accent-soft: rgba(110, 171, 134, .24);
  --bg-a: #e6efde; --bg-b: #bdd7c2; --bg-c: #8db2a0;
  --glow-a: rgba(246, 252, 232, .92); --glow-b: rgba(157, 205, 166, .64); --glow-c: rgba(90, 144, 119, .52);
}

body.chat-page[data-theme="amber"] {
  --chat-accent: #b67a3c; --chat-accent-deep: #7b4b20; --chat-accent-soft: rgba(225, 169, 94, .25);
  --bg-a: #f7e4c4; --bg-b: #efc28f; --bg-c: #c98f75;
  --glow-a: rgba(255, 248, 214, .94); --glow-b: rgba(246, 182, 105, .68); --glow-c: rgba(190, 111, 81, .5);
}

body.chat-page[data-theme="violet"] {
  --chat-accent: #7868bd; --chat-accent-deep: #51428e; --chat-accent-soft: rgba(137, 115, 203, .24);
  --bg-a: #e9dff2; --bg-b: #cbb8e1; --bg-c: #9a89c9;
  --glow-a: rgba(249, 235, 255, .92); --glow-b: rgba(199, 157, 224, .66); --glow-c: rgba(118, 96, 182, .56);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body.chat-page {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  overflow: hidden;
  color: var(--chat-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, var(--glow-a), transparent 32%),
    radial-gradient(circle at 86% 20%, var(--glow-b), transparent 36%),
    linear-gradient(138deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  transition: background 420ms ease;
}

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

.ambient-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  display: block;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, .96) 0 4%, transparent 18%),
    radial-gradient(circle at 68% 72%, var(--glow-c), transparent 50%),
    linear-gradient(145deg, rgba(255, 255, 255, .48), var(--chat-accent-soft));
  box-shadow:
    inset -18px -22px 38px rgba(89, 52, 106, .16),
    inset 12px 14px 26px rgba(255, 255, 255, .6),
    0 22px 50px rgba(90, 53, 95, .16);
  transition: transform 700ms cubic-bezier(.2, .8, .2, 1);
}

.orb-one { width: 270px; height: 270px; top: -72px; right: 7vw; }
.orb-two { width: 150px; height: 150px; right: -42px; bottom: 8vh; }
.orb-three { width: 104px; height: 104px; left: -28px; bottom: 5vh; }

.ambient-ribbon {
  position: absolute;
  width: 82vw;
  height: 28vh;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: linear-gradient(100deg, rgba(255, 255, 255, .18), var(--glow-b), rgba(255, 255, 255, .08));
  box-shadow: inset 0 18px 42px rgba(255, 255, 255, .22);
}

.ribbon-one { left: -18vw; bottom: -17vh; transform: rotate(7deg); }
.ribbon-two { right: -28vw; top: 32vh; opacity: .62; transform: rotate(-34deg); }
body[data-theme="ocean"] .orb-one { transform: translate(-8vw, 12vh) scale(1.18); }
body[data-theme="sage"] .orb-two { transform: translate(-12vw, -20vh) scale(.86); }
body[data-theme="amber"] .orb-one { transform: translate(-28vw, 18vh) scale(1.38); }
body[data-theme="violet"] .orb-three { transform: translate(18vw, -58vh) scale(.72); }

.glass-shell {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 1px 2px rgba(83, 52, 76, .08),
    0 18px 44px rgba(75, 49, 83, .16),
    0 42px 96px rgba(74, 42, 86, .14),
    inset 0 1px 0 rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
  backdrop-filter: blur(30px) saturate(130%);
}

.chat-app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: min(1480px, calc(100vw - 48px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: min(920px, calc(100svh - 48px));
  min-height: min(560px, calc(100svh - 48px));
  margin: 24px auto;
  overflow: hidden;
  border-radius: 30px;
}

.chat-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--glass-divider);
  background: rgba(255, 248, 251, .25);
}

.sidebar-top, .topbar-leading, .setting-heading, .sidebar-footer, .composer-actions, .activity-item {
  display: flex;
  align-items: center;
}

.sidebar-top { min-height: 44px; justify-content: space-between; }

.chat-brand {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 10px;
  color: var(--chat-ink);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-orb, .empty-orb {
  display: block;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, #fff 0 7%, transparent 22%),
    linear-gradient(145deg, var(--glow-a), var(--chat-accent) 54%, var(--bg-c));
  box-shadow: inset -6px -8px 12px rgba(89, 48, 104, .16), 0 5px 12px var(--chat-accent-soft);
}

.brand-orb { width: 28px; height: 28px; }

.quiet-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.quiet-icon svg, .new-chat-button svg, .send-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiet-icon:hover, .quiet-icon:active { background: rgba(255, 255, 255, .42); }
.sidebar-close { display: none; }

.new-chat-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 13px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 14px;
  background: rgba(255, 255, 255, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .68);
  cursor: pointer;
  font-size: 14px;
  font-weight: 620;
  text-align: left;
}

.new-chat-button:hover { background: rgba(255, 255, 255, .5); }
.conversation-nav { flex: 1; min-height: 0; margin-top: 26px; }
.nav-label { margin: 0 8px 8px; color: var(--chat-muted); font-size: 12px; font-weight: 580; }

.conversation-item {
  width: 100%;
  min-height: 54px;
  padding: 9px 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.conversation-item.is-current { background: rgba(255, 255, 255, .34); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .44); }
.conversation-item span { display: block; }
.conversation-title { overflow: hidden; font-size: 14px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item span:last-child { margin-top: 4px; color: var(--chat-muted); font-size: 12px; }
.sidebar-settings { display: grid; gap: 14px; }

.key-section, .theme-section {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 16px;
  background: rgba(255, 255, 255, .22);
}

.setting-heading { min-height: 24px; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 620; }
.setting-heading strong { color: var(--chat-accent-deep); font-size: 11px; font-weight: 650; }
.private-badge { color: var(--chat-muted); font-size: 11px; font-weight: 520; }

.key-section input {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  padding: 9px 11px;
  color: var(--chat-ink);
  border: 1px solid rgba(91, 55, 78, .13);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, .44);
}

.key-section p, .theme-section p { margin: 7px 0 0; color: var(--chat-muted); font-size: 11px; line-height: 1.45; }
.theme-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 10px; }

.theme-swatch {
  display: grid;
  min-width: 0;
  height: 34px;
  padding: 4px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.theme-swatch span {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  box-shadow: inset -3px -4px 7px rgba(64, 42, 70, .12), 0 2px 7px rgba(64, 42, 70, .12);
}

.theme-swatch[aria-pressed="true"] { border-color: var(--chat-accent); background: rgba(255, 255, 255, .34); }
.theme-swatch[data-theme-option="cherry"] span { background: linear-gradient(135deg, #ffdbe2, #d56e9f); }
.theme-swatch[data-theme-option="ocean"] span { background: linear-gradient(135deg, #e0f4ff, #5c91cb); }
.theme-swatch[data-theme-option="sage"] span { background: linear-gradient(135deg, #e9f5dc, #69a07e); }
.theme-swatch[data-theme-option="amber"] span { background: linear-gradient(135deg, #fff0c9, #c18443); }
.theme-swatch[data-theme-option="violet"] span { background: linear-gradient(135deg, #f0e3ff, #806fc2); }

.sidebar-footer { justify-content: space-between; padding: 0 4px; color: var(--chat-muted); font-size: 11px; }
.sidebar-footer a { min-height: 28px; color: inherit; text-decoration: none; }
.sidebar-footer a:hover { color: var(--chat-ink); }

.chat-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: rgba(255, 255, 255, .08);
}

.chat-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 68px;
  padding: 10px 22px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-divider);
  background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.topbar-leading { gap: 11px; }
.topbar-leading p { display: flex; margin: 3px 0 0; align-items: center; gap: 5px; color: var(--chat-muted); font-size: 11px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: #4b986a; box-shadow: 0 0 0 3px rgba(75, 152, 106, .12); }

.model-selector { position: relative; }
.model-selector-trigger {
  display: inline-flex;
  min-height: 32px;
  margin: -5px -8px -3px;
  padding: 4px 8px;
  align-items: center;
  gap: 5px;
  color: var(--chat-ink);
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -.01em;
}
.model-selector-trigger:hover,
.model-selector-trigger[aria-expanded="true"] { background: rgba(255, 255, 255, .38); }
.model-selector-trigger:active:not(:disabled) { transform: scale(.98); }
.model-selector-trigger:disabled { cursor: wait; opacity: .62; }
.model-selector-trigger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: transform 180ms cubic-bezier(.2, .8, .2, 1); }
.model-selector.is-open .model-selector-trigger > svg { transform: rotate(180deg); }

.model-selector-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 12px);
  left: -8px;
  width: min(310px, calc(100vw - 32px));
  padding: 7px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255, 250, 253, .9), rgba(244, 224, 241, .78));
  box-shadow:
    0 1px 2px rgba(75, 42, 64, .08),
    0 14px 34px rgba(76, 45, 78, .18),
    0 34px 68px rgba(74, 42, 86, .12),
    inset 0 1px 0 rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  backdrop-filter: blur(28px) saturate(135%);
}
.model-selector-menu[hidden] { display: none; }
.model-selector-menu button {
  display: flex;
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.model-selector-menu button:hover,
.model-selector-menu button:focus-visible { background: rgba(255, 255, 255, .5); }
.model-selector-menu button:active { transform: scale(.985); }
.model-selector-menu button > span { display: grid; min-width: 0; gap: 3px; }
.model-selector-menu strong { font-size: 14px; font-weight: 650; letter-spacing: -.006em; }
.model-selector-menu small { color: var(--chat-muted); font-size: 11px; line-height: 1.35; }
.model-check { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--chat-accent-deep); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; opacity: 0; }
.model-selector-menu [aria-checked="true"] .model-check { opacity: 1; }

.session-label {
  padding: 7px 10px;
  color: var(--chat-muted);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 10px;
  background: rgba(255, 255, 255, .22);
  font-size: 11px;
  font-weight: 560;
}

.sidebar-open, .mobile-new-chat { display: none; }
.chat-stage { display: grid; min-height: 0; flex: 1; grid-template-rows: minmax(0, 1fr) auto; }

.messages {
  display: flex;
  min-height: 0;
  padding: 32px max(24px, calc((100% - var(--content-width)) / 2));
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(80, 56, 71, .18) transparent;
  color: var(--chat-ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.empty-state {
  display: grid;
  width: min(100%, 620px);
  margin: auto;
  padding: 40px 20px 82px;
  place-items: center;
  text-align: center;
}

.empty-orb {
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
  box-shadow:
    inset -10px -12px 18px rgba(89, 48, 104, .16),
    0 10px 30px var(--chat-accent-soft),
    0 0 0 10px rgba(255, 255, 255, .14);
}

.empty-state h2 { max-width: 100%; margin: 0; font-size: clamp(27px, 4vw, 38px); font-weight: 650; letter-spacing: -.035em; line-height: 1.12; }
.empty-state p { max-width: 470px; margin: 12px 0 0; color: var(--chat-muted); font-size: 15px; line-height: 1.65; }

.message {
  width: min(100%, var(--content-width));
  margin: 0 auto 24px;
  color: var(--chat-ink);
  font-size: 15px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.assistant { padding: 4px 48px 4px 0; }
.message.assistant { color: var(--chat-ink); border: 0; background: transparent; }
.message.assistant::before {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 1px 12px 0 0;
  vertical-align: top;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--glow-a), var(--chat-accent));
  box-shadow: 0 4px 10px var(--chat-accent-soft);
  content: "";
}

.message.user {
  width: fit-content;
  max-width: min(72%, 620px);
  margin-right: max(0px, calc((100% - var(--content-width)) / 2));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .56);
  border-radius: 20px 20px 6px 20px;
  background: rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62), 0 8px 22px rgba(82, 48, 76, .08);
  color: var(--chat-ink);
}

.chat-dock {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding-bottom: max(15px, env(safe-area-inset-bottom));
}

.activity-card {
  display: grid;
  margin-bottom: 8px;
  padding: 8px;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 15px;
  background: rgba(255, 255, 255, .32);
  box-shadow: 0 8px 24px rgba(73, 44, 72, .08), inset 0 1px 0 rgba(255, 255, 255, .54);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  backdrop-filter: blur(20px) saturate(125%);
  transition: opacity 220ms ease, transform 220ms ease;
}

.activity-card[data-visible="false"] { position: absolute; pointer-events: none; opacity: 0; transform: translateY(8px); }
.activity-item { min-height: 28px; padding: 2px 5px; gap: 9px; color: var(--chat-muted); font-size: 12px; }
.activity-indicator { width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid var(--chat-accent); border-radius: 50%; background: transparent; }
.activity-item > span:nth-child(2) { flex: 1; color: var(--chat-ink); font-weight: 560; }
.activity-state { font-size: 11px; font-weight: 560; }
.activity-item[data-state="active"] .activity-indicator { background: var(--chat-accent); box-shadow: 0 0 0 4px var(--chat-accent-soft); animation: activity-pulse 1.2s ease-in-out infinite; }
.activity-item[data-state="done"] .activity-indicator { background: var(--chat-accent-deep); }
@keyframes activity-pulse { 50% { transform: scale(1.32); } }

.chat-status { min-height: 0; margin: 0 8px 7px; color: var(--chat-muted); font-size: 12px; line-height: 1.45; }
.chat-status:empty { display: none; }
.chat-status.error { color: #8d2d45; }
.chat-status.success { color: #376c4b; }

.composer {
  padding: 13px 13px 9px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 23px;
  outline: 1px solid rgba(98, 61, 85, .07);
  background: linear-gradient(180deg, rgba(255, 255, 255, .52), rgba(255, 246, 251, .36));
  box-shadow:
    0 1px 2px rgba(75, 42, 64, .08),
    0 12px 30px rgba(76, 45, 78, .13),
    0 28px 60px rgba(74, 42, 86, .09),
    inset 0 1px 0 rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  backdrop-filter: blur(28px) saturate(135%);
}

.composer:focus-within { border-color: rgba(255, 255, 255, .92); box-shadow: 0 0 0 3px var(--focus-ring), 0 16px 36px rgba(76, 45, 78, .14), inset 0 1px 0 rgba(255, 255, 255, .82); }

.composer textarea {
  display: block;
  width: 100%;
  min-height: 34px;
  max-height: 176px;
  padding: 5px 6px;
  resize: none;
  overflow-y: auto;
  color: var(--chat-ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.55;
}

.composer textarea::placeholder { color: var(--chat-muted); opacity: .76; }
.composer-actions { min-height: 38px; padding: 2px 1px 0 6px; justify-content: space-between; gap: 12px; }
.composer-actions > span { color: var(--chat-muted); font-size: 11px; }

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--chat-accent), var(--chat-accent-deep));
  box-shadow: 0 6px 14px var(--chat-accent-soft), inset 0 1px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
}

.send-button:hover:not(:disabled) { transform: translateY(-1px); }
.send-button:active:not(:disabled) { transform: scale(.95); }
.send-button:disabled { cursor: not-allowed; filter: grayscale(.4); opacity: .52; }
.privacy-note { margin: 8px 0 0; color: var(--chat-muted); font-size: 10px; line-height: 1.4; text-align: center; }

.sidebar-scrim { position: fixed; z-index: 4; inset: 0; border: 0; background: rgba(55, 34, 48, .22); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

.quiet-icon:focus-visible, .new-chat-button:focus-visible, .conversation-item:focus-visible,
.model-selector-trigger:focus-visible, .model-selector-menu button:focus-visible,
.theme-swatch:focus-visible, .send-button:focus-visible, .sidebar-footer a:focus-visible, .key-section input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-shell, .chat-topbar, .activity-card, .composer, .model-selector-menu { background: rgba(255, 249, 251, .94); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-shell, .chat-topbar, .activity-card, .composer, .model-selector-menu { background: rgba(255, 249, 251, .96); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

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

@media (max-width: 840px) {
  body.chat-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--chat-viewport-height);
    min-height: 0;
  }
  .ambient-scene { opacity: .84; }
  .orb-one { width: 190px; height: 190px; top: -56px; right: -38px; }
  .orb-two { width: 110px; height: 110px; right: -48px; bottom: 18vh; }
  .orb-three, .ribbon-two { display: none; }
  .ribbon-one { width: 130vw; height: 24vh; left: -30vw; bottom: -15vh; }
  .chat-app {
    display: block;
    width: 100vw;
    height: var(--chat-viewport-height);
    min-height: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .chat-sidebar {
    position: fixed;
    z-index: 5;
    inset: 0 auto auto 0;
    width: min(340px, 76vw);
    height: var(--chat-viewport-height);
    padding:
      max(16px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right-color: rgba(255, 255, 255, .58);
    background: rgba(255, 245, 250, .86);
    box-shadow: 20px 0 50px rgba(64, 39, 58, .16);
    transform: translateX(-104%);
    transition: transform 280ms cubic-bezier(.2, .8, .2, 1);
    -webkit-backdrop-filter: blur(24px) saturate(120%);
    backdrop-filter: blur(24px) saturate(120%);
  }
  body.sidebar-visible .chat-sidebar { transform: translateX(0); }
  .sidebar-close, .sidebar-open, .mobile-new-chat { display: inline-grid; }
  .quiet-icon { width: 44px; height: 44px; }
  .theme-swatch { height: 44px; }
  .key-section input { min-height: 44px; }
  .send-button { width: 44px; height: 44px; }
  .conversation-nav { flex: 0 0 auto; min-height: 92px; margin-top: 18px; }
  .sidebar-settings { margin-top: 10px; }
  .chat-main { height: 100%; }
  .chat-stage { height: auto; min-height: 0; flex: 1; }
  .chat-topbar {
    min-height: calc(72px + env(safe-area-inset-top));
    padding:
      max(16px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      12px
      max(12px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, .18);
  }
  .topbar-leading { min-width: 0; flex: 1; }
  .model-selector-trigger { min-height: 44px; margin: -8px -8px -6px; font-size: 16px; }
  .model-selector-menu { top: calc(100% + 10px); left: -4px; }
  .mobile-new-chat { margin-left: 8px; flex: 0 0 auto; }
  .messages {
    padding: 24px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left));
    scroll-padding-bottom: 20px;
  }
  .chat-dock {
    width: 100%;
    margin: 0;
    padding:
      0
      max(12px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .composer {
    position: relative;
    min-height: 58px;
    padding: 8px 60px 8px 14px;
    border-radius: 29px;
  }
  .composer textarea {
    min-height: 40px;
    max-height: min(144px, 28vh);
    padding: 7px 0;
    font-size: 16px;
    line-height: 1.5;
  }
  .composer-actions {
    position: absolute;
    right: 7px;
    bottom: 7px;
    min-height: 44px;
    padding: 0;
  }
  .composer-actions > span { display: none; }
  .privacy-note { margin-top: 6px; padding: 0 4px; font-size: 9px; }
  .activity-card { margin: 0 2px 8px; }
  .chat-status { margin-right: 10px; margin-left: 10px; }
  .sidebar-scrim:not([hidden]) { display: block; }
  .sidebar-scrim {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width: 520px) {
  .session-label { display: none; }
  .messages { padding-top: 18px; }
  .empty-state { padding: 20px 4px 54px; }
  .empty-orb { width: 54px; height: 54px; margin-bottom: 18px; }
  .empty-state h2 { font-size: 27px; }
  .empty-state p { max-width: 310px; margin-top: 10px; font-size: 14px; line-height: 1.55; }
  .message { margin-bottom: 20px; font-size: 15px; line-height: 1.68; }
  .message.user { max-width: 88%; padding: 10px 14px; }
  .message.assistant { padding-right: 0; }
}

@media (max-width: 840px) and (max-height: 600px) {
  .empty-state { padding-bottom: 18px; }
  .empty-orb { width: 42px; height: 42px; margin-bottom: 12px; }
  .empty-state h2 { font-size: 23px; }
  .empty-state p, .privacy-note { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .chat-sidebar,
  .sidebar-scrim {
    background: #fff7fb;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
