:root {
  color-scheme: dark;
  --ink: #f7f2ff;
  --muted: #aaa2b7;
  --muted-soft: #9a91a6;
  --purple: #bd9bff;
  --purple-strong: #9868f3;
  --purple-deep: #7148d2;
  --mint: #8ee0c5;
  --surface: rgba(27, 23, 36, .9);
  --surface-soft: rgba(255, 255, 255, .045);
  --line: rgba(214, 195, 255, .11);
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0c0a12;
}

body {
  position: fixed;
  inset: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 48% 39%, rgba(110, 68, 176, .15), transparent 42%),
    radial-gradient(ellipse at 95% 5%, rgba(118, 83, 163, .1), transparent 31%),
    #0c0a12;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(65, 39, 95, .12), transparent 53%);
  content: "";
  pointer-events: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(202, 173, 255, .9);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  top: var(--app-offset-top, 0px);
  display: flex;
  width: min(100%, 880px);
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  min-height: 0;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  overflow: hidden;
  flex-direction: column;
  isolation: isolate;
}

.topbar,
.bottom-area {
  flex: 0 0 auto;
}

.topbar {
  display: flex;
  min-height: 70px;
  padding: 13px 20px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  min-width: 104px;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  box-shadow: 0 7px 26px rgba(126, 83, 220, .22);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 19px;
  font-weight: 640;
  letter-spacing: -.045em;
  line-height: 1;
}

.brand-caption {
  color: var(--muted-soft);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .16em;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.server-pill,
.model-select {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(222, 205, 255, .11);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: #d7d0e1;
  font-size: 11px;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), transform 300ms var(--ease);
}

.server-pill {
  display: inline-flex;
  padding: 0 11px;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.server-pill:hover,
.model-select:hover {
  border-color: rgba(202, 173, 255, .28);
  background: rgba(255, 255, 255, .07);
}

.server-pill:active,
.icon-button:active,
.send-button:active,
.voice-button:active {
  transform: scale(.97);
}

.status-light {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #716a7b;
  box-shadow: 0 0 0 3px rgba(128, 118, 141, .1);
}

.server-pill[data-connected="true"] .status-light {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(142, 224, 197, .1), 0 0 13px rgba(142, 224, 197, .43);
}

.model-select {
  max-width: 148px;
  padding: 0 29px 0 12px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #aaa2b7 50%),
    linear-gradient(135deg, #aaa2b7 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 15px,
    calc(100% - 10px) 15px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.model-select:disabled {
  color: #81798d;
  opacity: .72;
}

.model-select option,
.setting-select option {
  color: #f7f2ff;
  background: #181420;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(222, 205, 255, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: #c7bfd2;
  cursor: pointer;
  transition: background-color 350ms var(--ease), border-color 350ms var(--ease), color 350ms var(--ease), transform 350ms var(--ease);
}

.icon-button:hover {
  border-color: rgba(202, 173, 255, .3);
  background: rgba(173, 139, 240, .12);
  color: #fff;
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.main-area {
  display: flex;
  min-height: 0;
  padding: 12px 22px 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.conversation-nav {
  flex: 0 0 auto;
  padding: 0 20px 6px;
}

.conversation-picker {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: #ded5ec;
  font-size: 12px;
  cursor: pointer;
}

.conversation-picker > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.current-conversation-title {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-picker > span:first-of-type {
  flex: 0 0 auto;
}

.conversation-picker:hover {
  border-color: rgba(202, 173, 255, .3);
  background: rgba(173, 139, 240, .08);
}

.create-conversation-button {
  width: 100%;
}

.conversation-options {
  display: flex;
  margin: 16px 0 0;
  padding: 0;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.conversation-option {
  display: flex;
  width: 100%;
  min-height: 84px;
  padding: 13px 14px;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.conversation-option:hover,
.conversation-option[aria-current="true"] {
  border-color: rgba(202, 173, 255, .4);
  background: rgba(173, 139, 240, .1);
}

.conversation-option-title,
.conversation-option-preview {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-option-title {
  font-size: 14px;
  font-weight: 600;
}

.conversation-option-preview {
  color: var(--muted);
  font-size: 12px;
}

.conversation-option-meta {
  color: var(--muted);
  font-size: 11px;
}

.welcome {
  width: min(100%, 610px);
  min-height: 0;
  margin: auto auto 15px;
  padding: 18px 0 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  animation: arrive 850ms var(--ease) both;
}

.eyebrow,
.sheet-kicker {
  display: inline-flex;
  margin: 0;
  align-items: center;
  gap: 9px;
  color: #a99bbd;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .17em;
}

.eyebrow-mark {
  width: 17px;
  height: 1px;
  background: linear-gradient(90deg, var(--purple), transparent);
}

.welcome h1 {
  margin: 15px 0 9px;
  font-size: clamp(36px, 8vw, 60px);
  font-weight: 540;
  letter-spacing: -.065em;
  line-height: .98;
}

.welcome h1 span {
  color: #c3a7ff;
  font-weight: 470;
}

.welcome-copy {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.prompt-list {
  display: flex;
  margin-top: 25px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.prompt-list::-webkit-scrollbar {
  display: none;
}

.prompt-list button {
  min-height: 42px;
  padding: 0 13px;
  flex: 0 0 auto;
  border: 1px solid rgba(221, 205, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: #bcb3ca;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 360ms var(--ease), border-color 360ms var(--ease), color 360ms var(--ease), transform 360ms var(--ease);
}

.prompt-list button:hover {
  transform: translateY(-2px);
  border-color: rgba(193, 163, 255, .26);
  background: rgba(174, 132, 255, .09);
  color: #eee7fa;
}

.message-list {
  display: flex;
  width: min(100%, 650px);
  min-height: 0;
  margin: 0 auto;
  padding: 15px 0 18px;
  flex: 1;
  flex-direction: column;
  gap: 17px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(187, 155, 242, .25) transparent;
}

.message-row {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 7px;
  animation: arrive 540ms var(--ease) both;
}

.message-row[data-role="user"] {
  align-items: flex-end;
}

.message-row[data-role="assistant"] {
  align-items: flex-start;
}

.message-label {
  display: inline-flex;
  padding: 0 5px;
  align-items: center;
  gap: 6px;
  color: #8e849b;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.message-label-mark {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b994ff;
  box-shadow: 0 0 9px rgba(185, 148, 255, .5);
}

.message-bubble {
  max-width: min(88%, 580px);
  padding: 13px 16px;
  border: 1px solid rgba(227, 214, 255, .085);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(34, 29, 44, .95), rgba(24, 21, 31, .92));
  color: #e9e3f1;
  font-size: 14px;
  line-height: 1.52;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-row[data-role="user"] .message-bubble {
  border-color: rgba(202, 174, 255, .18);
  border-bottom-right-radius: 7px;
  background: linear-gradient(145deg, rgba(112, 78, 167, .47), rgba(59, 45, 79, .72));
  color: #f8f3ff;
}

.message-row[data-role="assistant"] .message-bubble {
  border-bottom-left-radius: 7px;
}

.message-row[data-error="true"] .message-bubble {
  border-color: rgba(255, 164, 166, .18);
  color: #e8c4c4;
}

.message-actions {
  display: flex;
  min-height: 44px;
  margin-top: -4px;
  align-items: center;
  gap: 4px;
}

.message-row[data-role="user"] .message-actions {
  justify-content: flex-end;
}

.copy-message-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #bdb1cc;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.copy-message-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.copy-message-button:hover {
  background: rgba(196, 167, 252, .08);
  color: #eee5fb;
}

.voice-deck {
  display: flex;
  min-height: 191px;
  padding: 2px 0 11px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.voice-controls {
  display: grid;
  width: min(100%, 380px);
  grid-template-columns: minmax(68px, 1fr) auto minmax(68px, 1fr);
  align-items: center;
  column-gap: 16px;
}

.live-mode-switch {
  display: inline-flex;
  min-height: 44px;
  justify-self: end;
  align-items: center;
  gap: 7px;
  color: #d5cbe2;
  font-size: 12px;
  font-weight: 570;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.live-mode-switch input {
  position: relative;
  width: 36px;
  height: 23px;
  margin: 0;
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(222, 206, 246, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  cursor: pointer;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.live-mode-switch input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #beb3cb;
  content: "";
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}

.live-mode-switch input:checked {
  border-color: rgba(213, 185, 255, .72);
  background: #8659ce;
}

.live-mode-switch input:checked::before {
  background: #fff;
  transform: translateX(13px);
}

.voice-stop-slot {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
}

.stop-voice-button {
  border-color: rgba(228, 211, 251, .22);
  color: #d9cce9;
}

.stop-voice-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke-width: 0;
}

.orb-shell {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  margin-bottom: 8px;
  place-items: center;
  border: 1px solid rgba(214, 188, 255, .11);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 94, 197, .12), rgba(23, 17, 32, .04) 69%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 16px 60px rgba(28, 15, 44, .22);
  transition: transform 700ms var(--ease), border-color 700ms var(--ease);
}

.orb-shell::before,
.orb-shell::after {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(194, 164, 246, .075);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  transition: transform 700ms var(--ease), opacity 700ms var(--ease);
}

.orb-shell::after {
  inset: -17px;
  border-color: rgba(194, 164, 246, .04);
}

.orb-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 106, 231, .25), rgba(120, 78, 183, .08) 43%, transparent 70%);
  opacity: .7;
  transform: scale(.92);
  transition: transform 800ms var(--ease), opacity 800ms var(--ease);
}

.voice-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 82px;
  height: 82px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(239, 225, 255, .54);
  border-radius: 50%;
  background: linear-gradient(145deg, #bea1ff, #8e62e0 60%, #744ad1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), inset 0 -10px 24px rgba(72, 42, 130, .29), 0 12px 34px rgba(106, 67, 164, .25);
  color: white;
  cursor: pointer;
  transition: transform 420ms var(--ease), filter 420ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.voice-button:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.voice-button-core {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .23);
  border-radius: 50%;
  background: rgba(78, 49, 121, .18);
  box-shadow: inset 0 1px rgba(255, 255, 255, .22);
}

.mic-icon,
.voice-send-icon,
.voice-interrupt-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.voice-send-icon,
.voice-interrupt-icon {
  display: none;
}

.voice-button[data-action="send"] .mic-icon,
.voice-button[data-action="interrupt"] .mic-icon {
  display: none;
}

.voice-button[data-action="send"] .voice-send-icon,
.voice-button[data-action="interrupt"] .voice-interrupt-icon {
  display: block;
}

.voice-status {
  margin: 1px 0 3px;
  color: #ded5eb;
  font-size: 12px;
  font-weight: 570;
  letter-spacing: .005em;
}

.voice-caption {
  min-height: 15px;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: #a39bad;
  font-size: 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.voice-mode-hint {
  max-width: 100%;
  margin: 4px 0 0;
  color: #b5a8c5;
  font-size: 11px;
  line-height: 1.35;
}

.voice-deck[data-state="listening"] .orb-shell {
  transform: scale(1.025);
  border-color: rgba(197, 162, 255, .34);
}

.voice-deck[data-state="listening"] .orb-glow {
  opacity: .96;
  transform: scale(1.11);
  animation: breathe 2.7s cubic-bezier(.32, .72, 0, 1) infinite;
}

.voice-deck[data-state="listening"] .orb-shell::before {
  transform: scale(1.08);
  opacity: .72;
}

.voice-deck[data-state="thinking"] .orb-glow {
  opacity: .9;
  transform: scale(1.06);
  animation: breathe 1.8s cubic-bezier(.32, .72, 0, 1) infinite;
}

.voice-deck[data-state="thinking"] .voice-button,
.voice-deck[data-state="speaking"] .voice-button {
  filter: hue-rotate(9deg) brightness(1.08);
}

.voice-deck[data-state="speaking"] .orb-glow {
  opacity: 1;
  transform: scale(1.13);
}

.voice-deck[data-state="error"] .orb-shell {
  border-color: rgba(240, 133, 145, .35);
}

.bottom-area {
  position: relative;
  padding: 11px 19px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(12, 10, 18, 0), rgba(12, 10, 18, .88) 20%, #0c0a12 88%);
}

.draft-status {
  display: flex;
  width: min(100%, 650px);
  min-height: 44px;
  margin: 0 auto 4px;
  padding: 0 4px 0 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #d4c5e8;
  font-size: 12px;
  line-height: 1.35;
}

.draft-status > span {
  min-width: 0;
}

.draft-status .discard-draft-button {
  min-height: 44px;
  color: #cbb2f6;
}

.composer {
  display: flex;
  width: min(100%, 650px);
  min-height: 57px;
  margin: 0 auto;
  padding: 5px;
  align-items: flex-end;
  gap: 6px;
  border: 1px solid rgba(216, 195, 255, .11);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  box-shadow: 0 12px 36px rgba(0, 0, 0, .19), inset 0 1px rgba(255, 255, 255, .055);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: min(125px, calc(var(--app-height, 100dvh) * .23));
  padding: 12px 12px 9px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f6f1fc;
  font-size: 14px;
  line-height: 1.4;
}

.composer textarea::placeholder {
  color: #a39bad;
  opacity: 1;
}

.composer textarea:focus-visible {
  outline: 0;
}

.send-button {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 1px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(227, 207, 255, .4);
  border-radius: 15px;
  background: linear-gradient(145deg, #ba99ff, #8357d6);
  box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 7px 19px rgba(82, 54, 131, .28);
  color: white;
  cursor: pointer;
  transition: transform 380ms var(--ease), filter 380ms var(--ease), opacity 380ms var(--ease);
}

.send-button:disabled {
  filter: saturate(.4);
  opacity: .42;
  cursor: default;
}

.send-button:not(:disabled):hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.send-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.footer-meta {
  display: flex;
  min-height: 23px;
  padding-top: 7px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9a92a3;
  font-size: 9px;
  letter-spacing: .01em;
}

.footer-model {
  overflow: hidden;
  max-width: 53%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5e566a;
}

.modal-backdrop {
  position: fixed;
  z-index: 5;
  top: var(--app-offset-top, 0px);
  right: 0;
  left: 0;
  height: 100vh;
  height: var(--app-height, 100dvh);
  display: flex;
  padding: 24px 16px calc(18px + env(safe-area-inset-bottom));
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 4, 8, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fade-in 260ms var(--ease) both;
}

.pair-sheet,
.settings-sheet {
  position: relative;
  width: min(100%, 480px);
  max-height: min(100%, 780px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border: 1px solid rgba(221, 203, 255, .17);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(146, 102, 203, .13), transparent 42%),
    linear-gradient(152deg, #211b2b, #15121c 66%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .07);
  animation: sheet-up 560ms var(--ease) both;
}

.pair-sheet {
  padding: 10px 25px 24px;
}

.settings-sheet {
  padding: 10px 23px 21px;
}

.sheet-grip {
  width: 36px;
  height: 4px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: rgba(228, 214, 246, .22);
}

.sheet-heading {
  margin-bottom: 24px;
}

.sheet-heading h2,
.settings-heading h2 {
  margin: 9px 0 8px;
  color: #f8f4fd;
  font-size: 28px;
  font-weight: 520;
  letter-spacing: -.05em;
}

.sheet-heading p {
  max-width: 340px;
  margin: 0;
  color: #aaa1b6;
  font-size: 13px;
  line-height: 1.5;
}

.sheet-heading p + p {
  margin-top: 12px;
}

.pair-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pair-form label,
.setting-label {
  color: #e3dced;
  font-size: 12px;
  font-weight: 590;
}

.pair-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(228, 211, 255, .15);
  border-radius: 15px;
  background: rgba(8, 7, 11, .42);
  color: #f8f4fd;
  font-size: 14px;
  letter-spacing: .04em;
}

.field-error {
  min-height: 14px;
  margin: 0;
  color: #f1a7ae;
  font-size: 11px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 47px;
  padding: 0 19px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  transition: transform 350ms var(--ease), filter 350ms var(--ease), border-color 350ms var(--ease);
}

.primary-button {
  border: 1px solid rgba(239, 226, 255, .38);
  background: linear-gradient(135deg, #b696fb, #8558d3);
  box-shadow: inset 0 1px rgba(255, 255, 255, .28), 0 10px 25px rgba(99, 67, 154, .24);
  color: #fff;
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.privacy-note {
  margin: 21px 4px 0;
  color: #a39bad;
  font-size: 10px;
  line-height: 1.55;
}

.settings-heading {
  display: flex;
  margin: 0 0 23px;
  align-items: center;
  justify-content: space-between;
}

.settings-heading h2 {
  margin-bottom: 0;
}

.close-button {
  align-self: flex-start;
}

.settings-content {
  display: flex;
  flex-direction: column;
}

.setting-block {
  display: flex;
  margin-bottom: 21px;
  flex-direction: column;
  gap: 8px;
}

.select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(225, 209, 255, .13);
  border-radius: 13px;
  background-color: rgba(8, 7, 11, .4);
  color: #eee8f5;
  font-size: 12px;
}

.full-select {
  appearance: auto;
}

.text-button,
.danger-text-button {
  min-height: 40px;
  padding: 0 9px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c4a7fc;
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color 320ms var(--ease), color 320ms var(--ease);
}

.text-button:hover,
.danger-text-button:hover {
  background: rgba(196, 167, 252, .09);
}

.setting-hint {
  margin: 0;
  color: #898192;
  font-size: 10px;
  line-height: 1.45;
}

.toggle-row {
  position: relative;
  display: flex;
  min-height: 59px;
  margin: 0 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.toggle-track {
  display: flex;
  width: 42px;
  height: 25px;
  padding: 3px;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid rgba(230, 214, 255, .11);
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  transition: background-color 320ms var(--ease), border-color 320ms var(--ease);
}

.toggle-track span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #afa6bb;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
  transition: transform 320ms var(--ease), background-color 320ms var(--ease);
}

.toggle-row input:checked + .toggle-track {
  border-color: rgba(197, 169, 255, .44);
  background: rgba(151, 103, 228, .55);
}

.toggle-row input:checked + .toggle-track span {
  background: #fff;
  transform: translateX(16px);
}

.toggle-row input:focus-visible + .toggle-track {
  outline: 2px solid rgba(202, 173, 255, .9);
  outline-offset: 3px;
}

.settings-divider {
  height: 1px;
  margin: 0 0 10px;
  background: linear-gradient(90deg, transparent, rgba(221, 203, 255, .13), transparent);
}

.lab-capability-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(204, 177, 245, .15);
  border-radius: 14px;
  background: rgba(170, 129, 226, .055);
  color: #c8b9dc;
  font-size: 12px;
  line-height: 1.5;
}

.danger-text-button {
  min-height: 43px;
  margin: 0 -8px 3px;
  align-self: flex-start;
  color: #e4a7ad;
}

.secondary-button {
  min-height: 42px;
  margin-top: 8px;
  align-self: flex-start;
  border: 1px solid rgba(225, 209, 255, .14);
  background: rgba(255, 255, 255, .035);
  color: #d3cadf;
}

.settings-footer {
  margin: 21px 2px 0;
  color: #9b93a5;
  font-size: 9px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 8;
  right: 16px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 16px;
  width: fit-content;
  max-width: min(460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 11px 15px;
  border: 1px solid rgba(226, 211, 255, .14);
  border-radius: 999px;
  background: rgba(35, 29, 45, .97);
  box-shadow: 0 15px 48px rgba(0, 0, 0, .35);
  color: #eee8f6;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  animation: toast-in 420ms var(--ease) both;
}

.toast-button {
  min-height: 32px;
  margin: -3px -4px -3px 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(191, 158, 255, .16);
  color: #d5bdff;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.permission-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sr-announcer,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from {
    opacity: .65;
    transform: translateY(18px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes breathe {
  0%, 100% {
    opacity: .56;
    transform: scale(.96);
  }
  50% {
    opacity: .96;
    transform: scale(1.08);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .topbar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .main-area {
    padding-right: 34px;
    padding-left: 34px;
  }

  .welcome {
    padding-top: 4vh;
  }

  .voice-deck {
    min-height: 220px;
    padding-bottom: 16px;
  }

  .orb-shell {
    width: 132px;
    height: 132px;
  }

  .voice-button {
    width: 90px;
    height: 90px;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 62px;
    padding: 11px 14px 7px;
    gap: 8px;
  }

  .brand {
    min-width: 92px;
    gap: 8px;
  }

  .brand img {
    width: 35px;
    height: 35px;
    border-radius: 11px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-caption {
    font-size: 7px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .server-pill {
    width: 44px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
  }

  .server-pill span:last-child {
    display: none;
  }

  .model-select {
    width: 122px;
    height: 44px;
    padding-right: 25px;
    padding-left: 10px;
    font-size: 10px;
    background-position:
      calc(100% - 12px) 14px,
      calc(100% - 8px) 14px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .main-area {
    padding: 6px 19px 0;
  }

  .welcome {
    margin-bottom: 8px;
    padding-top: 8px;
  }

  .welcome h1 {
    margin-top: 12px;
    font-size: clamp(38px, 11vw, 50px);
  }

  .welcome-copy {
    max-width: 310px;
    font-size: 13px;
  }

  .prompt-list {
    margin-top: 20px;
  }

  .prompt-list button {
    min-height: 44px;
    padding: 0 11px;
    font-size: 10px;
  }

  .message-list {
    padding-top: 10px;
    gap: 14px;
  }

  .message-bubble {
    max-width: 92%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .voice-deck {
    min-height: 175px;
    padding-bottom: 7px;
  }

  .orb-shell {
    width: 106px;
    height: 106px;
    margin-bottom: 5px;
  }

  .voice-button {
    width: 76px;
    height: 76px;
  }

  .voice-button-core {
    width: 48px;
    height: 48px;
  }

  .bottom-area {
    padding-right: 13px;
    padding-left: 13px;
  }

  .composer {
    min-height: 54px;
    border-radius: 20px;
  }

  .composer textarea {
    min-height: 42px;
    padding-left: 10px;
    font-size: 16px;
  }

  .send-button {
    width: 44px;
    height: 44px;
  }

  .footer-meta {
    font-size: 8px;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .brand {
    min-width: 76px;
    gap: 6px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 17px;
  }

  .model-select {
    width: 82px;
    padding-left: 7px;
    font-size: 8px;
  }

  .topbar-actions {
    gap: 2px;
  }

  #newChatButton {
    display: none;
  }

  .server-pill {
    width: 44px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 400px) {
  #newChatButton {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  input,
  textarea,
  select,
  .model-select,
  .setting-select,
  .pair-form input,
  .composer textarea {
    font-size: 16px;
  }
}

:root[data-compact-viewport] .welcome {
  margin-bottom: 4px;
  padding-top: 4px;
}

:root[data-compact-viewport] .welcome h1 {
  margin: 8px 0;
  font-size: clamp(30px, 9vw, 44px);
}

:root[data-compact-viewport] .prompt-list {
  margin-top: 12px;
}

:root[data-compact-viewport] .voice-deck {
  min-height: 144px;
  padding: 6px 0;
}

:root[data-compact-viewport] .orb-shell {
  width: 78px;
  height: 78px;
  margin-bottom: 4px;
}

:root[data-compact-viewport] .voice-button {
  width: 60px;
  height: 60px;
}

:root[data-compact-viewport] .voice-button-core {
  width: 40px;
  height: 40px;
}

:root[data-short-viewport] .welcome .eyebrow,
:root[data-short-viewport] .welcome-copy,
:root[data-short-viewport] .prompt-list,
:root[data-short-viewport] .footer-meta,
:root[data-short-viewport] .voice-mode-hint {
  display: none;
}

:root[data-short-viewport] .voice-deck {
  display: grid;
  min-height: 68px;
  padding: 4px 0;
  grid-template-columns: auto minmax(0, 240px);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-content: center;
  justify-content: center;
  text-align: left;
}

:root[data-short-viewport] .voice-controls {
  width: auto;
  grid-column: 1;
  grid-row: 1 / 3;
  grid-template-columns: 62px 52px 44px;
  column-gap: 6px;
}

:root[data-short-viewport] .live-mode-switch {
  gap: 4px;
  font-size: 11px;
}

:root[data-short-viewport] .live-mode-switch input {
  width: 32px;
  height: 22px;
}

:root[data-short-viewport] .live-mode-switch input::before {
  width: 14px;
  height: 14px;
}

:root[data-short-viewport] .live-mode-switch input:checked::before {
  transform: translateX(10px);
}

:root[data-short-viewport] .orb-shell {
  width: 52px;
  height: 52px;
  margin: 0;
}

:root[data-short-viewport] .voice-button {
  width: 44px;
  height: 44px;
}

:root[data-short-viewport] .voice-button-core {
  width: 32px;
  height: 32px;
}

:root[data-short-viewport] .voice-status {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

:root[data-short-viewport] .voice-caption {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

:root[data-short-viewport] .composer textarea {
  max-height: min(84px, calc(var(--app-height, 100dvh) * .18));
}

:root[data-keyboard-open] .bottom-area {
  padding-bottom: 6px;
}

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