:root {
  --bg: #030712;
  --bg-soft: rgba(6, 13, 28, 0.78);
  --surface: rgba(11, 20, 38, 0.68);
  --surface-strong: rgba(16, 29, 52, 0.82);
  --surface-soft: rgba(125, 211, 252, 0.07);
  --surface-muted: rgba(148, 163, 184, 0.1);
  --surface-hover: rgba(103, 232, 249, 0.13);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(103, 232, 249, 0.28);
  --text: #eaf7ff;
  --text-soft: #bfd7e6;
  --text-muted: #7892a6;
  --accent: #67e8f9;
  --accent-strong: #38bdf8;
  --accent-deep: #0e7490;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --gold: #a7f3d0;
  --gold-soft: rgba(45, 212, 191, 0.12);
  --danger: #fda4af;
  --danger-soft: rgba(244, 63, 94, 0.14);
  --glow: rgba(34, 211, 238, 0.22);
  --glow-strong: rgba(56, 189, 248, 0.34);
  --sidebar-width: 260px;
  --composer-width: min(770px, calc(100vw - var(--sidebar-width) - 96px));
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 54px rgba(34, 211, 238, 0.06);
  --shadow-md: 0 16px 46px rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --surface: #ffffff;
  --surface-strong: #f1f1f3;
  --surface-soft: rgba(15, 23, 42, 0.04);
  --surface-muted: rgba(15, 23, 42, 0.07);
  --surface-hover: rgba(15, 23, 42, 0.1);
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #111111;
  --text-soft: #3f3f46;
  --text-muted: #71717a;
  --accent: #111111;
  --accent-strong: #050505;
  --accent-deep: #e5e7eb;
  --accent-soft: rgba(15, 23, 42, 0.08);
  --gold: #111111;
  --gold-soft: rgba(15, 23, 42, 0.08);
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.12);
  --glow: rgba(15, 23, 42, 0.08);
  --glow-strong: rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

body::before,
.site-aura,
body::after {
  display: block;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(103, 232, 249, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.028) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 62% 32%, black, transparent 72%);
  opacity: 0.8;
}

body::after {
  background:
    radial-gradient(circle at 72% 18%, rgba(34, 211, 238, 0.14), transparent 30%),
    radial-gradient(circle at 18% 76%, rgba(59, 130, 246, 0.12), transparent 34%),
    radial-gradient(circle at center, transparent 42%, rgba(0, 0, 0, 0.52) 100%);
}

.site-aura {
  position: fixed;
  border-radius: 999px;
  filter: blur(92px);
  opacity: 0.58;
  pointer-events: none;
}

.aura-one {
  top: 42px;
  left: 230px;
  width: 380px;
  height: 380px;
  background: rgba(34, 211, 238, 0.24);
}

.aura-two {
  top: 26%;
  right: 7%;
  width: 360px;
  height: 360px;
  background: rgba(37, 99, 235, 0.2);
}

.aura-three {
  bottom: 2%;
  left: 48%;
  width: 420px;
  height: 420px;
  background: rgba(20, 184, 166, 0.16);
}

:root[data-theme="light"] body::before,
:root[data-theme="light"] .site-aura,
:root[data-theme="light"] body::after {
  display: none;
}

:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .workspace,
:root[data-theme="light"] .top-bar,
:root[data-theme="light"] .control-strip,
:root[data-theme="light"] .dropdown-panel,
:root[data-theme="light"] .composer,
:root[data-theme="light"] .settings-panel,
:root[data-theme="light"] .auth-panel,
:root[data-theme="light"] .account-panel,
:root[data-theme="light"] .message.assistant .bubble,
:root[data-theme="light"] .attachment-list article {
  background: var(--surface);
  box-shadow: none;
}

:root[data-theme="light"] .app-shell {
  gap: 0;
  padding: 0;
}

:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .workspace {
  border-radius: 0;
  backdrop-filter: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

input,
textarea {
  border: 0;
  outline: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  align-items: stretch;
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}

.app-shell.is-sidebar-collapsed {
  --sidebar-width: 78px;
}

.sidebar,
.workspace {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.sidebar {
  position: relative;
  top: 0;
  height: 100vh;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 8px 10px;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.18)),
    var(--bg-soft);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.62), transparent);
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.22), rgba(59, 130, 246, 0.08));
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.16);
}

.brand-copy {
  min-width: 0;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 0 22px rgba(103, 232, 249, 0.2);
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar-toggle {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.1);
  color: transparent;
  font-size: 0;
}

.sidebar-toggle span {
  width: 6px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.sidebar-toggle span + span {
  margin-left: -3px;
}

.sidebar-toggle:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.app-shell.is-sidebar-collapsed .sidebar-toggle span:first-child {
  transform: translateX(2px);
}

.app-shell.is-sidebar-collapsed .sidebar-toggle span:last-child {
  transform: translateX(-2px);
  background: var(--accent-soft);
}

.app-shell.is-sidebar-collapsed .sidebar {
  align-items: center;
  padding-inline: 8px;
}

.app-shell.is-sidebar-collapsed .brand {
  width: 100%;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
  padding-inline: 0;
}

.app-shell.is-sidebar-collapsed .brand-copy,
.app-shell.is-sidebar-collapsed .side-section p,
.app-shell.is-sidebar-collapsed .conversation-card,
.app-shell.is-sidebar-collapsed .account-panel {
  display: none;
}

.app-shell.is-sidebar-collapsed .primary-nav-button,
.app-shell.is-sidebar-collapsed .side-link {
  width: 46px;
  height: 46px;
  min-height: 46px;
  justify-content: center;
  margin-inline: 0;
  padding: 0;
  font-size: 0;
}

.app-shell.is-sidebar-collapsed .side-section {
  width: 100%;
  padding: 0;
  justify-items: center;
}

.app-shell.is-sidebar-collapsed .primary-nav-button svg,
.app-shell.is-sidebar-collapsed .side-link svg {
  width: 20px;
  height: 20px;
}

.primary-nav-button {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  margin: 0 6px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.2), rgba(59, 130, 246, 0.08)),
    var(--surface-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.1);
}

.primary-nav-button::after {
  display: none;
}

.primary-nav-button svg {
  width: 18px;
  height: 18px;
}

.side-section {
  display: grid;
  gap: 6px;
  padding: 0 10px;
}

.conversation-card {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.16);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  padding: 0 2px;
}

.side-section p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.section-heading span {
  min-width: 26px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.side-link,
.nav-item,
.conversation-row {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.side-link svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.side-link:hover,
.side-link.is-active,
.nav-item:hover,
.nav-item.is-active,
.conversation-row:hover,
.conversation-row.is-active {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
  transform: translateX(2px);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.08);
}

.conversation-list {
  display: grid;
  gap: 2px;
  max-height: 35vh;
  overflow-y: auto;
}

.conversation-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
}

.conversation-open {
  min-width: 0;
  display: block;
  color: inherit;
  text-align: left;
}

.conversation-open strong,
.conversation-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-open strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.conversation-open span {
  display: none;
}

.conversation-delete {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--text-muted);
  opacity: 0;
  transition:
    opacity 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.conversation-delete svg {
  width: 16px;
  height: 16px;
}

.conversation-row:hover .conversation-delete,
.conversation-row:focus-within .conversation-delete {
  opacity: 1;
}

.conversation-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (hover: none) {
  .conversation-delete {
    opacity: 1;
  }
}

.conversation-empty {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.nav-item span {
  margin-left: auto;
  opacity: 0.6;
}

.account-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto 6px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.18)),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.account-copy {
  min-width: 0;
  flex: 1;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.account-copy strong,
.account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
  font-weight: 800;
}

.account-copy small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.account-copy:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.account-title-line strong {
  min-width: 0;
  flex: 1;
}

.account-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.account-badge.is-member {
  background: #d9f99d;
  color: #1f2a05;
}

.account-badge.is-free {
  background: rgba(251, 146, 60, 0.18);
  color: #fed7aa;
}

.account-badge.is-signed-out {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.account-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
}

.account-popover header {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.account-popover header strong,
.account-popover header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover header strong {
  font-size: 14px;
}

.account-popover header span {
  color: var(--text-muted);
  font-size: 12px;
}

.account-popover dl {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.account-popover div {
  display: grid;
  gap: 4px;
}

.account-popover dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.account-popover dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.account-action {
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.workspace {
  position: relative;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.42), rgba(2, 6, 23, 0.74)),
    var(--bg);
}

.workspace:not(.has-messages) {
  grid-template-rows: auto minmax(0, 1fr);
}

.workspace.is-paper-mode:not(.has-messages) {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.workspace::before,
.workspace::after {
  display: block;
}

.workspace::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -90px;
  width: 430px;
  height: 430px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

.workspace::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 76px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.52), transparent);
  pointer-events: none;
}

:root[data-theme="light"] .workspace::before,
:root[data-theme="light"] .workspace::after {
  display: none;
}

.top-bar,
.conversation,
.composer-wrap {
  position: relative;
  z-index: 1;
}

.top-bar {
  position: relative;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 18px 52px 12px;
  background: transparent;
  background:
    linear-gradient(180deg, rgba(3, 7, 18, 0.78), rgba(3, 7, 18, 0.26));
  backdrop-filter: blur(18px);
}

.title-block {
  max-width: 520px;
}

.title-block span {
  display: none;
}

.title-block h1 {
  display: none;
}

.title-block p {
  display: none;
}

.top-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.signal-group {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.signal-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.signal-chip.is-live {
  border-color: rgba(140, 227, 209, 0.2);
  background: rgba(140, 227, 209, 0.1);
  color: #cffff3;
}

.control-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.26)),
    color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 34px rgba(34, 211, 238, 0.08);
}

.theme-toggle,
.voice-output-toggle {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover,
.voice-output-toggle:hover,
.model-toggle:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.theme-toggle span,
.voice-output-toggle svg {
  width: 18px;
  height: 18px;
  text-align: center;
}

.voice-output-toggle.is-active {
  border-color: color-mix(in srgb, #4ecab7 44%, transparent);
  background: linear-gradient(135deg, rgba(78, 202, 183, 0.22), var(--surface-strong));
}

.model-picker {
  position: relative;
}

.model-toggle,
.icon-button {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.model-toggle {
  min-width: 168px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 800;
}

.model-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.18s ease;
}

.model-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text-soft);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.dropdown-panel {
  position: absolute;
  top: 58px;
  right: 0;
  width: 400px;
  max-height: min(72vh, 580px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.09), rgba(15, 23, 42, 0.3)),
    var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px);
}

.dropdown-panel.is-collapsed {
  display: none;
}

.group-title {
  margin: 4px 8px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.model-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.model-item:hover,
.model-item.is-active {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.model-copy {
  display: grid;
  gap: 5px;
}

.model-copy strong {
  font-size: 15px;
  font-weight: 800;
}

.model-copy em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 500;
}

.model-copy small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
}

.model-item svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex: none;
}

.conversation {
  min-height: 0;
  overflow-y: auto;
  padding: 0 52px 32px;
  scroll-behavior: smooth;
}

.hero-card {
  position: relative;
  max-width: var(--composer-width);
  min-height: calc(100vh - 300px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto;
  padding: 0 0 126px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.08), transparent 34%),
    transparent;
  box-shadow: none;
  overflow: visible;
}

.hero-card::before,
.hero-card::after {
  display: none;
}

.hero-card::before {
  top: -10%;
  right: -6%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(140, 227, 209, 0.16), transparent 70%);
}

.hero-card::after {
  inset: 0;
  background: linear-gradient(120deg, transparent 14%, rgba(255, 255, 255, 0.035) 50%, transparent 74%);
  transform: translateX(-36%);
}

.hero-card.is-hidden {
  display: none;
}

.paper-workbench {
  width: min(980px, 100%);
  margin: 0 auto 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 14%, rgba(103, 232, 249, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(8, 13, 28, 0.62));
  box-shadow: var(--shadow-md), 0 0 54px rgba(34, 211, 238, 0.08);
}

.workspace.is-paper-mode .conversation {
  padding-bottom: 18px;
}

:root[data-theme="light"] .paper-workbench {
  background: linear-gradient(135deg, #ffffff, #f4f7fb);
  box-shadow: none;
}

.paper-workbench-copy {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.paper-workbench-copy p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.paper-workbench-copy h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.paper-workbench-copy span {
  max-width: 760px;
  color: var(--text-soft);
  line-height: 1.8;
}

.paper-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.paper-tool-card {
  min-height: 156px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.16)),
    var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.paper-skill-card {
  border-color: rgba(103, 232, 249, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(103, 232, 249, 0.07), rgba(15, 23, 42, 0.14)),
    var(--surface);
}

.paper-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.12);
}

.paper-tool-card small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.paper-tool-card strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.paper-tool-card span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.paper-upload-card {
  border-color: rgba(167, 243, 208, 0.28);
  background:
    radial-gradient(circle at 80% 0%, rgba(167, 243, 208, 0.16), transparent 38%),
    var(--surface-strong);
}

.paper-upload-card button {
  margin-top: auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.hero-copy-block,
.hero-prompts {
  position: relative;
  z-index: 1;
}

.hero-copy-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  min-height: 0;
}

.hero-badge-row {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-badge {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(140, 227, 209, 0.14);
  border-radius: 999px;
  background: rgba(140, 227, 209, 0.08);
  color: #d3fff6;
  font-size: 12px;
  font-weight: 700;
}

.hero-card h2 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 0 36px rgba(103, 232, 249, 0.2);
}

.hero-copy {
  display: none;
}

.hero-stats {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.hero-stats article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.hero-stats strong {
  font-size: 13px;
  font-weight: 800;
}

.hero-stats span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.66;
}

.hero-prompts {
  display: none;
}

.hero-prompts button {
  position: relative;
  min-height: 88px;
  display: grid;
  gap: 6px;
  padding: 16px 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025);
  text-align: left;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.hero-prompts button:hover {
  border-color: rgba(140, 227, 209, 0.18);
  background:
    linear-gradient(180deg, rgba(140, 227, 209, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.035);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.hero-prompts small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-prompts strong {
  font-size: 15px;
  font-weight: 800;
}

.hero-prompts span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.62;
}

.message-list {
  max-width: var(--composer-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 22px 0 150px;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.system {
  justify-content: flex-start;
}

.bubble {
  max-width: min(760px, 82%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: var(--shadow-sm);
}

.message.assistant .bubble {
  color: var(--text);
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.045), rgba(15, 23, 42, 0.08)),
    rgba(15, 23, 42, 0.16);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.045);
}

.message.user .bubble {
  max-width: min(520px, 76%);
  padding: 12px 16px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 22px;
  background: var(--surface-strong);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 82%, #4ecab7), var(--surface-strong));
  color: var(--text);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.08);
}

.message.system .bubble {
  max-width: min(760px, 82%);
  color: var(--text-soft);
  box-shadow: none;
}

.message-meta {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.message.user .message-meta {
  display: none;
}

.message.system .message-meta {
  color: var(--gold);
}

.message-content {
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.message-copy {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.08);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.message-copy:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.message-copy.is-copied {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.12);
  color: var(--gold);
}

.message-content code {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(103, 232, 249, 0.07);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.94em;
}

.message-content pre {
  margin: 12px 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.8), rgba(15, 23, 42, 0.72)),
    var(--surface-strong);
}

.message-content pre code {
  display: block;
  padding: 12px;
  border: 0;
  background: transparent;
  white-space: pre;
}

.message-content pre code span {
  display: block;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.message-image-preview,
.svg-preview-card img {
  display: block;
  width: min(100%, 760px);
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.svg-preview-card {
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.svg-preview-card img {
  width: 100%;
  border: 0;
  border-radius: 0;
}

.svg-preview-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.svg-preview-card button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.message.user .message-content code {
  border-color: rgba(6, 17, 24, 0.12);
  background: rgba(255, 255, 255, 0.28);
}

.typing-indicator::after {
  content: " ...";
  animation: pulse 1.1s infinite;
}

.composer-wrap {
  position: relative;
  bottom: 0;
  z-index: 6;
  padding: 0 52px 26px;
  background: var(--bg);
  background:
    linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.82) 28%, rgba(3, 7, 18, 0.96));
  backdrop-filter: blur(14px);
}

:root[data-theme="light"] .composer-wrap {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.88) 28%, #ffffff);
}

.attachment-list {
  max-width: var(--composer-width);
  margin: 0 auto 10px;
  display: grid;
  gap: 8px;
}

.attachment-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.06), rgba(15, 23, 42, 0.12)),
    var(--surface);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.04);
}

.attachment-list article.is-image {
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.attachment-list article.is-image img {
  grid-row: 1 / span 2;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(103, 232, 249, 0.24);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.14);
}

.attachment-list strong,
.attachment-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list strong {
  font-size: 13px;
}

.attachment-list span {
  color: var(--text-muted);
  font-size: 12px;
}

.attachment-list button {
  grid-row: 1 / span 2;
  grid-column: -2 / -1;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.workspace:not(.has-messages) .composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 76px);
  bottom: auto;
  padding-bottom: 0;
  background: transparent;
}

.workspace.is-paper-mode:not(.has-messages) .composer-wrap {
  position: relative;
  inset: auto;
  padding-bottom: 26px;
  background:
    linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.82) 28%, rgba(3, 7, 18, 0.96));
}

:root[data-theme="light"] .workspace.is-paper-mode:not(.has-messages) .composer-wrap {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.88) 28%, #ffffff);
}

.composer {
  max-width: var(--composer-width);
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  background: var(--surface-strong);
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.2)),
    var(--surface-strong);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  box-shadow:
    0 18px 60px color-mix(in srgb, var(--glow) 80%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 20px 70px color-mix(in srgb, var(--glow-strong) 90%, transparent),
    0 0 0 4px rgba(34, 211, 238, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.composer textarea {
  flex: 1;
  resize: none;
  max-height: 180px;
  padding: 8px 6px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: var(--text-muted);
}

.composer-tool {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.composer-tool:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.composer-tool svg {
  width: 20px;
  height: 20px;
}

.voice-input-button.is-listening {
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent);
  animation: voicePulse 1s ease-in-out infinite;
}

.voice-status {
  max-width: var(--composer-width);
  margin: 9px auto 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.voice-status.is-error {
  color: var(--danger);
}

.send-button,
.stop-button {
  height: 36px;
  min-width: 64px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
}

.send-button {
  background: linear-gradient(135deg, #67e8f9, #38bdf8 48%, #2563eb);
  color: #00111a;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.22);
}

.stop-button {
  background: var(--danger-soft);
  color: #ffd0d0;
}

.quick-actions {
  max-width: var(--composer-width);
  margin: 20px auto 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-actions button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.quick-actions button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.settings-sheet,
.auth-sheet,
.voice-permission-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.settings-backdrop,
.auth-backdrop,
.voice-permission-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, 0.56);
  backdrop-filter: blur(10px);
}

.settings-panel,
.auth-panel,
.voice-permission-panel {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(15, 23, 42, 0.24)),
    var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  backdrop-filter: blur(24px);
}

.voice-permission-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100vw - 28px));
  padding: 28px;
  border-radius: 28px;
  transform: translate(-50%, -50%);
}

.voice-permission-panel p {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.voice-permission-panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.voice-permission-panel > span,
.voice-permission-steps span {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.voice-permission-steps {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-muted);
}

.voice-permission-steps strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
}

.voice-permission-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-permission-primary,
.voice-permission-secondary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}

.voice-permission-primary {
  background: linear-gradient(135deg, #67e8f9, #38bdf8 48%, #2563eb);
  color: #00111a;
}

.voice-permission-secondary {
  border: 1px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--text);
}

.settings-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  width: min(470px, calc(100vw - 28px));
  height: calc(100% - 36px);
  padding: 28px;
  overflow: auto;
  border-radius: 28px;
}

.settings-header,
.auth-copy {
  margin-bottom: 22px;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.settings-header p,
.auth-copy p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-header h2,
.auth-copy h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.auth-copy span {
  display: block;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.close-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 24px;
}

.settings-form,
.auth-form,
.settings-copy-block {
  display: grid;
  gap: 16px;
}

.auth-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.auth-helper-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.auth-link {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.auth-link:hover {
  color: var(--accent-strong);
  text-shadow: 0 0 16px var(--glow-strong);
}

.settings-copy-block > p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.86;
}

.settings-note-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(103, 232, 249, 0.055);
}

.settings-note-card strong {
  font-size: 14px;
  font-weight: 800;
}

.settings-note-card span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.74;
}

.settings-form label,
.auth-form label {
  display: grid;
  gap: 8px;
}

.settings-form span,
.auth-form span {
  font-size: 13px;
  font-weight: 800;
}

.settings-form input,
.settings-form textarea,
.auth-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.24);
  color: var(--text);
  font-size: 14px;
}

.settings-form small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.64;
}

.settings-actions {
  display: flex;
  gap: 10px;
}

.primary-action,
.secondary-action,
.auth-submit {
  height: 46px;
  border-radius: 16px;
  font-weight: 800;
}

.primary-action,
.auth-submit {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, #9ce8d8, #4ecab7 60%, #2a8b7f 100%);
  color: #07131d;
}

.secondary-action {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text-soft);
}

.auth-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(540px, calc(100vw - 28px));
  padding: 30px;
  border-radius: 30px;
  transform: translate(-50%, -50%);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(103, 232, 249, 0.055);
}

.auth-tab {
  height: 42px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 800;
}

.auth-tab.is-active {
  background: var(--surface-muted);
  box-shadow: inset 0 1px 0 var(--line);
  color: var(--text);
}

.auth-error {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 155, 155, 0.18);
  border-radius: 14px;
  background: var(--danger-soft);
  color: #ffd5d5;
  font-size: 13px;
  line-height: 1.56;
}

.auth-error.is-success {
  border-color: rgba(103, 232, 249, 0.22);
  background: rgba(45, 212, 191, 0.12);
  color: #bffcf4;
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  background-clip: padding-box;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 1;
  }
}

@keyframes voicePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(78, 202, 183, 0.28);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(78, 202, 183, 0);
  }
}

@media (max-width: 1240px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .paper-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-items: stretch;
  }

  .signal-group,
  .control-strip {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  :root {
    --composer-width: min(100%, calc(100vw - 56px));
  }

  .app-shell.is-sidebar-collapsed {
    --sidebar-width: 260px;
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    align-items: stretch;
    padding: 16px 8px 10px;
  }

  .app-shell.is-sidebar-collapsed .brand {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
    gap: 10px;
    padding: 4px 10px 12px;
  }

  .app-shell.is-sidebar-collapsed .brand-copy,
  .app-shell.is-sidebar-collapsed .side-section p,
  .app-shell.is-sidebar-collapsed .conversation-card,
  .app-shell.is-sidebar-collapsed .account-panel {
    display: initial;
  }

  .app-shell.is-sidebar-collapsed .brand-copy,
  .app-shell.is-sidebar-collapsed .side-section p {
    display: block;
  }

  .app-shell.is-sidebar-collapsed .conversation-card {
    display: grid;
  }

  .app-shell.is-sidebar-collapsed .account-panel {
    display: flex;
  }

  .app-shell.is-sidebar-collapsed .primary-nav-button,
  .app-shell.is-sidebar-collapsed .side-link {
    width: 100%;
    height: auto;
    min-height: 40px;
    justify-content: flex-start;
    margin: 0 6px;
    padding: 0 12px;
    font-size: 14px;
  }

  .app-shell.is-sidebar-collapsed .side-section {
    width: auto;
    padding: 0 10px;
    justify-items: stretch;
  }

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100svh;
    padding: 10px;
    gap: 12px;
    overflow: visible;
  }

  .sidebar,
  .workspace {
    height: auto;
    min-height: auto;
    max-height: none;
    border-radius: 24px;
    overflow: visible;
  }

  body::before,
  body::after,
  .site-aura {
    display: none;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .workspace {
    min-height: calc(100svh - 20px);
    display: flex;
    flex-direction: column;
  }

  .workspace:not(.has-messages) {
    display: flex;
  }

  .conversation-card {
    display: none;
  }

  .top-bar,
  .conversation,
  .composer-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }

  .conversation {
    flex: 1;
    min-height: 44svh;
    overflow: visible;
    padding-bottom: 154px;
  }

  .message-list {
    padding-bottom: 32px;
  }

  .workspace:not(.has-messages) .composer-wrap {
    position: relative;
    inset: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    padding-bottom: 20px;
    background: transparent;
  }

  .title-block h1 {
    font-size: 30px;
  }

  .title-block p {
    font-size: 14px;
  }

  .control-strip {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .model-toggle {
    min-width: 0;
    flex: 1;
  }

  .model-picker {
    flex: 1 1 220px;
    min-width: 0;
  }

  .voice-output-toggle,
  .theme-toggle {
    flex: 0 0 auto;
  }

  .dropdown-panel {
    right: auto;
    left: 0;
    width: min(400px, calc(100vw - 52px));
  }

  .hero-card {
    padding: 24px;
  }

  .paper-workbench {
    padding: 16px;
    border-radius: 24px;
  }

  .paper-tool-grid {
    grid-template-columns: 1fr;
  }

  .paper-tool-card {
    min-height: 136px;
  }

  .hero-card h2 {
    font-size: 34px;
  }

  .composer {
    min-height: 70px;
  }

  .settings-panel {
    top: 14px;
    right: 14px;
    height: calc(100% - 28px);
    width: min(460px, calc(100vw - 28px));
    border-radius: 24px;
  }

  .voice-permission-panel {
    width: min(460px, calc(100vw - 28px));
    padding: 24px;
    border-radius: 24px;
  }

  .auth-panel {
    position: fixed;
    inset: 16px;
    width: auto;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    transform: none;
  }
}

@media (max-width: 640px) {
  :root {
    --composer-width: min(100%, calc(100vw - 32px));
  }

  .app-shell {
    padding: 8px;
    gap: 10px;
  }

  .sidebar {
    padding: 14px 12px 12px;
    border-radius: 20px;
  }

  .brand {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .signal-group {
    display: none;
  }

  .top-bar {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .top-actions {
    gap: 8px;
  }

  .control-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .model-picker {
    grid-column: 1 / -1;
    width: 100%;
  }

  .model-toggle {
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

  .title-block h1 {
    font-size: 28px;
  }

  .hero-card {
    min-height: 34svh;
    padding: 18px;
  }

  .paper-workbench {
    padding: 14px;
    border-radius: 20px;
  }

  .paper-workbench-copy h2 {
    font-size: 28px;
  }

  .paper-tool-card {
    min-height: 120px;
    padding: 14px;
  }

  .hero-card h2 {
    font-size: 30px;
  }

  .hero-prompts button {
    min-height: 78px;
  }

  .bubble {
    max-width: 100%;
  }

  .composer {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border-radius: 24px;
  }

  .composer textarea {
    order: -1;
    flex: 1 0 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  .voice-output-toggle span {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .conversation {
    min-height: 38svh;
    padding-bottom: 18px;
  }

  .composer-tool {
    width: 42px;
    height: 42px;
  }

  .send-button,
  .stop-button {
    flex: 1;
    min-width: 92px;
    padding: 0 16px;
  }

  .auth-panel,
  .settings-panel,
  .voice-permission-panel {
    padding: 22px;
  }

  .settings-panel {
    inset: 8px;
    width: auto;
    height: auto;
    max-height: calc(100dvh - 16px);
  }
}
