@layer reset, tokens, base, layout, components, utilities, responsive;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
  }

  @view-transition {
    navigation: auto;
  }

  body {
    min-width: 320px;
    min-height: 100%;
  }

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

  button,
  select {
    cursor: pointer;
  }

  img {
    display: block;
    max-width: 100%;
  }

  button {
    border: 0;
  }
}

@layer components {
  .profilePlanActions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
  }

  .profilePlanActions > button {
    flex: 1;
  }

  .dialog.plansDialog {
    width: min(96vw, 1040px);
    max-height: min(92vh, 860px);
  }

  .plansPanel {
    min-width: 0;
  }

  .plansContent {
    display: grid;
    gap: var(--space-5);
  }

  .billingStatusRow,
  .plansFooterActions,
  .starterPlanGrid article > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .billingStatusRow {
    min-height: 42px;
    padding: 0 var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 12px;
  }

  .testModePill,
  .popularPill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .starterPlanGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .starterPlanGrid article {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .starterPlanGrid strong {
    font-size: 18px;
  }

  .starterPlanGrid span {
    font-size: 12px;
    font-weight: 700;
  }

  .starterPlanGrid p {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
  }

  .paidPlanGrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .paidPlanCard {
    position: relative;
    display: grid;
    min-width: 0;
    gap: var(--space-4);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) + 2px);
    background: var(--surface-raised);
  }

  .paidPlanCard.featuredPlan {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 12%, transparent);
  }

  .paidPlanCard.currentPlan {
    outline: 2px solid var(--success);
    outline-offset: -2px;
  }

  .paidPlanCard .popularPill {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
  }

  .paidPlanCard .eyebrow {
    padding-right: 72px;
  }

  .paidPlanCard h3 {
    display: flex;
    align-items: baseline;
    gap: 4px;
  }

  .paidPlanCard h3 span {
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.05em;
  }

  .paidPlanCard h3 small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
  }

  .paidPlanCard ul {
    display: grid;
    gap: 8px;
    padding: 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
    list-style: none;
  }

  .paidPlanCard li::before {
    content: "✓";
    margin-right: 7px;
    color: var(--success);
    font-weight: 800;
  }

  .paidPlanCard .primaryBtn {
    align-self: end;
  }

  .paidPlanCard button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
  }

  .plansFooterActions {
    color: var(--muted);
    font-size: 10px;
  }
}

@layer responsive {
  @media (max-width: 800px) {
    .paidPlanGrid {
      grid-template-columns: 1fr;
    }

    .starterPlanGrid {
      grid-template-columns: 1fr;
    }

    .dialog.plansDialog {
      width: min(96vw, 620px);
    }
  }
}

@layer tokens {
  :root {
    --app-height: 100dvh;
    --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.375rem;
    --radius-full: 999px;
    --duration-fast: 140ms;
    --duration-normal: 220ms;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --accent: #ef4444;
    --red: var(--accent);
    --panel2: var(--surface-raised);
    --accent-hover: #dc3636;
    --accent-soft: rgb(239 68 68 / 0.12);
    --accent-border: rgb(239 68 68 / 0.28);
    --danger: #f05252;
    --success: #34c77b;
    --sidebar-width: 280px;
    --content-width: 840px;
  }

  :root,
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0b0c;
    --bg-elevated: #101012;
    --sidebar: #0f0f10;
    --surface: #151517;
    --surface-raised: #1a1a1d;
    --surface-hover: #202024;
    --surface-active: #252529;
    --border: #28282d;
    --border-strong: #38383f;
    --text: #f4f4f5;
    --text-secondary: #b1b1b8;
    --muted: #7e7e87;
    --code-bg: #111214;
    --overlay: rgb(0 0 0 / 0.66);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 12px 36px rgb(0 0 0 / 0.28);
    --shadow-lg: 0 24px 80px rgb(0 0 0 / 0.48);
    --focus-ring: 0 0 0 3px rgb(239 68 68 / 0.25);
  }

  :root[data-theme="light"] {
    color-scheme: light;
    --bg: #f8f8f9;
    --bg-elevated: #ffffff;
    --sidebar: #f1f1f3;
    --surface: #ffffff;
    --surface-raised: #f4f4f6;
    --surface-hover: #ebebee;
    --surface-active: #e4e4e8;
    --border: #ddddE2;
    --border-strong: #c8c8ce;
    --text: #1c1c1f;
    --text-secondary: #57575e;
    --muted: #7c7c84;
    --code-bg: #161719;
    --overlay: rgb(17 17 20 / 0.42);
    --shadow-sm: 0 1px 2px rgb(18 18 22 / 0.08);
    --shadow-md: 0 12px 38px rgb(23 23 28 / 0.11);
    --shadow-lg: 0 28px 90px rgb(23 23 28 / 0.2);
    --focus-ring: 0 0 0 3px rgb(239 68 68 / 0.18);
  }
}

@layer base {
  body {
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  ::selection {
    background: rgb(239 68 68 / 0.25);
  }

  :focus-visible {
    border-radius: var(--radius-sm);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  button:disabled,
  select:disabled {
    cursor: not-allowed;
    opacity: 0.48;
  }

  kbd {
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
  }

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

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

  ::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    background-clip: padding-box;
  }
}

@layer layout {
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    height: var(--app-height);
    overflow: hidden;
    transition: grid-template-columns var(--duration-normal) var(--ease-out);
  }

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

  .sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
    padding: var(--space-4);
    transition: opacity var(--duration-fast), transform var(--duration-normal) var(--ease-out);
  }

  .sidebarCollapsed .sidebar {
    pointer-events: none;
    opacity: 0;
    transform: translateX(-20px);
  }

  .main {
    position: relative;
    display: grid;
    height: 100%;
    min-height: 0;
    min-width: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--bg);
  }

  .chatViewport {
    position: relative;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
  }

  .chatArea {
    width: min(100%, calc(var(--content-width) + (var(--space-6) * 2)));
    min-height: 100%;
    margin-inline: auto;
    padding: var(--space-10) var(--space-6) 7rem;
  }

  .composerDock {
    position: relative;
    z-index: 10;
    align-self: end;
    min-width: 0;
    width: 100%;
    padding: 0 max(var(--space-4), env(safe-area-inset-right)) max(var(--space-3), env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
    background: linear-gradient(to top, var(--bg) 72%, transparent);
    transform: translate3d(0, 0, 0);
    transition: background var(--duration-normal), transform 420ms var(--ease-out);
    will-change: transform;
  }

  .app:not(.appReady) .composerDock {
    transition: none;
  }

  .app.isEmpty .chatViewport {
    overflow-y: hidden;
  }

  .app.isEmpty .chatArea {
    padding-bottom: var(--space-4);
  }

  .app.isEmpty .composerDock {
    background: transparent;
    transform: translate3d(0, clamp(-7.5rem, -12vh, -4rem), 0);
  }

  .composer,
  .composerHint,
  .offlineBanner {
    width: min(100%, var(--content-width));
    margin-inline: auto;
  }
}

@layer components {
  .skipLink {
    position: fixed;
    z-index: 9999;
    top: var(--space-3);
    left: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform var(--duration-fast);
  }

  .skipLink:focus {
    transform: translateY(0);
  }

  .brandRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 44px;
  }

  .brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
    color: var(--text);
    text-decoration: none;
  }

  .brandMark,
  .emptyBrand {
    display: grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    box-shadow: 0 6px 16px rgb(239 68 68 / 0.18);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .brand strong,
  .brand small {
    display: block;
  }

  .brand strong {
    font-size: 16px;
    letter-spacing: -0.015em;
  }

  .brand small {
    max-width: 180px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iconBtn {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
  }

  .iconBtn:hover {
    border-color: var(--border);
    background: var(--surface-hover);
    color: var(--text);
  }

  .iconBtn:active {
    transform: scale(0.96);
  }

  .sidebarCloseBtn {
    display: none;
  }

  .newChatBtn {
    position: relative;
    display: flex;
    width: 100%;
    align-items: center;
    gap: var(--space-3);
    overflow: hidden;
    margin-top: var(--space-5);
    padding: 11px 12px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--text);
    font-weight: 650;
    text-align: left;
    transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
  }

  .newChatBtn:hover {
    border-color: rgb(239 68 68 / 0.48);
    background: rgb(239 68 68 / 0.18);
  }

  .newChatBtn:active {
    transform: translateY(1px);
  }

  .newChatBtn > span:first-child {
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
  }

  .newChatBtn kbd {
    margin-left: auto;
  }

  .chatSearch {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--muted);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }

  .chatSearch:focus-within {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
  }

  .chatSearch input {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 13px;
  }

  .chatSearch input::placeholder {
    color: var(--muted);
  }

  .chatSearch input::-webkit-search-cancel-button {
    filter: grayscale(1);
  }

  .chatList {
    min-height: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    margin: var(--space-5) calc(var(--space-2) * -1) 0;
    padding: 0 var(--space-2);
  }

  .chatGroup + .chatGroup {
    margin-top: var(--space-6);
  }

  .chatGroupTitle {
    margin-bottom: var(--space-2);
    padding-inline: var(--space-2);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .chatItem {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px 34px;
    align-items: center;
    margin-bottom: 2px;
    border-radius: 10px;
    transition: background var(--duration-fast);
  }

  .chatItem:hover,
  .chatItem.active {
    background: var(--surface-hover);
  }

  .chatItem.active {
    box-shadow: inset 2px 0 0 var(--accent);
  }

  .chatSelectBtn {
    display: block;
    min-width: 0;
    padding: 9px 8px 9px 10px;
    overflow: hidden;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
  }

  .chatItem.active .chatSelectBtn {
    color: var(--text);
  }

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

  .chatSelectBtn span {
    font-size: 13px;
    font-weight: 550;
  }

  .chatSelectBtn small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
  }

  .chatIconBtn {
    display: grid;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    opacity: 0;
    transition: background var(--duration-fast), color var(--duration-fast), opacity var(--duration-fast);
  }

  .chatItem:hover .chatIconBtn,
  .chatItem:focus-within .chatIconBtn,
  .chatIconBtn.selected {
    opacity: 1;
  }

  .chatIconBtn:hover {
    background: var(--surface-active);
    color: var(--text);
  }

  .chatIconBtn.selected {
    color: #f2b84b;
  }

  .chatMenu {
    position: absolute;
    z-index: 20;
    top: calc(100% - 4px);
    right: 2px;
    width: 132px;
    padding: var(--space-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .chatMenu button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
  }

  .chatMenu button:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .chatMenu .dangerAction {
    color: var(--danger);
  }

  .chatListEmpty {
    padding: var(--space-8) var(--space-4);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
  }

  .chatListSentinel {
    height: 1px;
  }

  .sidebarBottom {
    display: grid;
    gap: 2px;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
  }

  .sidebarBottom > button,
  .sidebarBottom > a {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 8px 9px;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    transition: background var(--duration-fast), color var(--duration-fast);
  }

  .sidebarBottom > button:hover,
  .sidebarBottom > a:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .navHint {
    color: var(--muted);
    font-size: 10px;
  }

  .accountRow {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
  }

  .accountBtn {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: var(--space-3);
    padding: 5px;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
  }

  .accountBtn:hover {
    background: var(--surface-hover);
  }

  .avatar {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
  }

  .avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
  }

  .accountCopy {
    min-width: 0;
  }

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

  .accountCopy strong {
    font-size: 12px;
  }

  .accountCopy small {
    color: var(--muted);
    font-size: 10px;
  }

  .topBar {
    position: relative;
    z-index: 20;
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-5);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
  }

  .topBarStart,
  .topBarEnd,
  .conversationHeading,
  .visitorCounter,
  .statPill {
    display: flex;
    align-items: center;
  }

  .topBarStart,
  .topBarEnd {
    gap: var(--space-2);
  }

  .menuBtn {
    display: none;
  }

  .sidebarCollapseBtn {
    position: absolute;
    left: -1px;
    width: 24px;
    height: 32px;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg);
  }

  .conversationHeading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
    margin-left: var(--space-4);
  }

  .conversationHeading strong {
    max-width: min(38vw, 430px);
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .connectionStatus {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 10px;
  }

  .connectionStatus i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
  }

  .connectionStatus.offline i {
    background: var(--danger);
  }

  .visitorCounter,
  .statPill {
    height: 34px;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
  }

  .visitorCounter strong,
  .statPill b {
    color: var(--text-secondary);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }

  .messageCounter.nearLimit {
    border-color: #f59e0b;
    color: #f59e0b;
  }

  .messageCounter.atLimit {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
  }

  .visitorPulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: visitorPulse 2.2s infinite;
  }

  @keyframes visitorPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0); }
    45% { box-shadow: 0 0 0 5px rgb(239 68 68 / 0.13); }
  }

  .emptyState {
    display: flex;
    width: 100%;
    max-width: 760px;
    min-height: 100%;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    margin-inline: auto;
    padding: clamp(var(--space-6), 5vh, var(--space-10)) 0;
    text-align: center;
    animation: fadeUp 420ms var(--ease-out) both;
  }

  .emptyBrand {
    width: 50px;
    height: 50px;
    margin-bottom: var(--space-4);
    border-radius: 15px;
    font-size: 23px;
  }

  .eyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .emptyState h1 {
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 720;
    letter-spacing: -0.045em;
    line-height: 1.05;
  }

  .heroTagline {
    margin-top: var(--space-3);
    color: var(--text-secondary);
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 520;
    letter-spacing: -0.015em;
  }

  .heroTagline span {
    color: var(--accent);
  }

  .heroQuestion {
    margin-top: var(--space-6);
    color: var(--muted);
    font-size: 13px;
  }

  .suggestionGrid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-6);
  }

  .suggestionGrid button {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .suggestionGrid button:hover {
    border-color: var(--border-strong);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }

  .suggestionGrid button:active {
    transform: translateY(0) scale(0.99);
  }

  .suggestionGrid strong,
  .suggestionGrid span {
    display: block;
  }

  .suggestionGrid strong {
    font-size: 13px;
    font-weight: 650;
  }

  .suggestionGrid span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
  }

  .message {
    content-visibility: auto;
    contain-intrinsic-size: auto 180px;
    scroll-margin-block: var(--space-8);
  }

  .message + .message {
    margin-top: var(--space-8);
  }

  .messageEnter {
    animation: messageIn 300ms var(--ease-out) both;
  }

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

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

  .messageInner {
    width: 100%;
  }

  .userMessage .messageInner {
    width: min(86%, 660px);
    margin-left: auto;
  }

  .messageHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
  }

  .messageIdentity {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .messageIdentity strong {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
  }

  .comparisonBadge {
    padding: 3px 7px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.02em;
  }

  .messageAvatar {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
  }

  .assistantAvatar {
    background: var(--accent);
    color: #fff;
  }

  .userAvatar {
    border: 1px solid var(--border-strong);
    background: var(--surface-raised);
    color: var(--text-secondary);
  }

  .messageTime {
    color: var(--muted);
    font-size: 10px;
  }

  .userMessage .messageContent {
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) 6px var(--radius-lg) var(--radius-lg);
    background: var(--surface-raised);
    color: var(--text);
    line-height: 1.58;
    white-space: pre-wrap;
  }

  .assistantMessage .messageContent {
    color: var(--text);
    font-size: 15px;
    line-height: 1.72;
  }

  .messageContent > :first-child {
    margin-top: 0 !important;
  }

  .messageContent > :last-child {
    margin-bottom: 0 !important;
  }

  .messageContent p,
  .messageContent ul,
  .messageContent ol,
  .messageContent blockquote,
  .messageContent table,
  .messageContent .codeBlock,
  .messageContent .mathBlock {
    margin-block: 0 var(--space-4);
  }

  .messageContent h1,
  .messageContent h2,
  .messageContent h3,
  .messageContent h4 {
    margin: 1.6em 0 0.55em;
    font-weight: 680;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  .messageContent h1 { font-size: 1.55em; }
  .messageContent h2 { font-size: 1.35em; }
  .messageContent h3 { font-size: 1.16em; }

  .messageContent ul,
  .messageContent ol {
    padding-left: 1.4em;
  }

  .messageContent li {
    padding-left: 0.2em;
  }

  .messageContent li + li {
    margin-top: 0.34em;
  }

  .messageContent a {
    color: var(--accent);
    text-decoration-color: rgb(239 68 68 / 0.45);
    text-underline-offset: 3px;
  }

  .messageContent blockquote {
    padding: 2px 0 2px var(--space-4);
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
  }

  .messageContent hr {
    margin-block: var(--space-6);
    border: 0;
    border-top: 1px solid var(--border);
  }

  .messageContent code:not(pre code) {
    padding: 0.16em 0.38em;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-raised);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.86em;
  }

  .codeBlock {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--code-bg);
    box-shadow: var(--shadow-sm);
  }

  .codeHeader {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-3);
    border-bottom: 1px solid #2a2b2f;
    color: #93969d;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: lowercase;
  }

  .codeHeader button {
    padding: 5px 8px;
    border-radius: 6px;
    background: transparent;
    color: #afb2b9;
    font-family: var(--font-sans);
    font-size: 10px;
  }

  .codeHeader button:hover {
    background: #242529;
    color: #fff;
  }

  .codeHeader button[data-copied="true"] {
    background: rgb(52 199 123 / 0.14);
    color: #65d99a;
  }

  .codeBlock pre {
    max-width: 100%;
    overflow: auto;
    margin: 0;
    padding: var(--space-4);
    background: transparent !important;
    overscroll-behavior-x: contain;
  }

  .codeBlock code {
    padding: 0 !important;
    background: transparent !important;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.65;
  }

  .messageContent table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-spacing: 0;
    border-collapse: separate;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
  }

  .messageContent th,
  .messageContent td {
    min-width: 110px;
    padding: 9px 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  .messageContent th {
    background: var(--surface-raised);
    font-weight: 650;
  }

  .messageContent th:last-child,
  .messageContent td:last-child {
    border-right: 0;
  }

  .messageContent tr:last-child td {
    border-bottom: 0;
  }

  .mathBlock {
    overflow-x: auto;
    padding: var(--space-3);
    text-align: center;
  }

  .typingIndicator {
    display: flex;
    min-height: 28px;
    align-items: center;
    gap: 5px;
  }

  .typingIndicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing 1.1s infinite ease-in-out;
  }

  .typingIndicator span:nth-child(2) { animation-delay: 120ms; }
  .typingIndicator span:nth-child(3) { animation-delay: 240ms; }

  @keyframes typing {
    0%, 60%, 100% { opacity: 0.36; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
  }

  .messageFooter {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
  }

  .messageMetrics {
    color: var(--muted);
    font-size: 10px;
  }

  .messageActions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--duration-fast);
  }

  .message:hover .messageActions,
  .message:focus-within .messageActions,
  .message[data-status="streaming"] .messageActions {
    opacity: 1;
  }

  .messageAction {
    padding: 5px 7px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    transition: background var(--duration-fast), color var(--duration-fast);
  }

  .messageAction:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .modelName {
    margin-left: var(--space-1);
    padding-left: var(--space-3);
    border-left: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
  }

  .messageAttachments {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .messageAttachments img {
    width: min(180px, 36vw);
    height: 128px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    object-fit: cover;
  }

  .messageFile {
    display: flex;
    min-width: 180px;
    align-items: center;
    gap: var(--space-3);
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .messageFile > span {
    display: grid;
    width: 32px;
    height: 36px;
    place-items: center;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
  }

  .messageFile strong,
  .messageFile small {
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .messageFile strong {
    font-size: 11px;
  }

  .messageFile small {
    color: var(--muted);
    font-size: 9px;
  }

  .generatedImage {
    max-width: 620px;
    margin-top: var(--space-4);
  }

  .generatedImage img {
    max-height: 620px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    object-fit: contain;
  }

  .generatedImageActions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-2);
  }

  .generatedImageDownload {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
  }

  .generatedImageDownload:hover {
    border-color: var(--accent);
    color: var(--text);
  }

  .searchResults {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
    max-width: 620px;
  }

  .searchResultCard {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .searchResultCard:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
  }

  .searchResultUrl {
    font-size: 11px;
    color: var(--muted);
  }

  .searchResultTitle {
    font-size: 15px;
    color: var(--accent);
  }

  .searchResultSnippet {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .messageError {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgb(240 82 82 / 0.3);
    border-radius: var(--radius-md);
    background: rgb(240 82 82 / 0.08);
  }

  .messageError strong,
  .messageError span {
    display: block;
  }

  .messageError strong {
    color: var(--danger);
    font-size: 12px;
  }

  .messageError span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 11px;
  }

  .messageError button {
    padding: 7px 10px;
    border: 1px solid rgb(240 82 82 / 0.35);
    border-radius: 7px;
    background: transparent;
    color: var(--danger);
    font-size: 11px;
    font-weight: 650;
  }

  .stoppedNote {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 11px;
  }

  .messageEditor textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    padding: var(--space-3);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    outline: 0;
    background: var(--surface);
    color: var(--text);
    line-height: 1.55;
  }

  .messageEditor > div {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-2);
  }

  .scrollBottomBtn {
    position: sticky;
    z-index: 8;
    bottom: var(--space-4);
    left: 50%;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text-secondary);
    font-size: 11px;
    transform: translateX(-50%);
  }

  .scrollBottomBtn:not([hidden]) {
    display: inline-flex;
  }

  .offlineBanner {
    margin-bottom: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid rgb(240 82 82 / 0.3);
    border-radius: var(--radius-md);
    background: rgb(240 82 82 / 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
  }

  .composer {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: 0 8px 30px rgb(0 0 0 / 0.16), 0 1px 0 rgb(255 255 255 / 0.03) inset;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
  }

  .app.isEmpty .composer {
    box-shadow: 0 14px 46px rgb(0 0 0 / 0.2), 0 1px 0 rgb(255 255 255 / 0.04) inset;
  }

  .composer:focus-within {
    border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
    box-shadow: var(--focus-ring), 0 12px 34px rgb(0 0 0 / 0.18);
  }

  .composer.searchMode {
    border-color: #5f87f6;
    box-shadow: 0 0 0 3px rgb(95 135 246 / 0.15);
  }

  .composerInputRow {
    display: flex;
    align-items: flex-end;
    padding: 14px 15px 5px;
  }

  .compareBar {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    margin: 5px 10px 2px;
    padding: 5px 7px 5px 11px;
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--text-secondary);
  }

  .compareBarLabel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .compareBar > strong {
    max-width: 145px;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .compareVersus {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .compareModelSelectWrap {
    min-width: 0;
    flex: 1;
  }

  .compareModelSelectWrap select {
    width: 100%;
    max-width: 190px;
    border-color: var(--border);
    background: var(--surface);
  }

  .compareCloseBtn {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
  }

  .compareCloseBtn:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .composer.compareMode {
    border-color: var(--accent-border);
  }

  #messageInput {
    width: 100%;
    max-height: 192px;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
  }

  #messageInput::placeholder {
    color: var(--muted);
  }

  .composerToolbar {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 6px 8px 8px;
  }

  .composerTools,
  .composerActions {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
  }

  .toolBtn {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    transition: background var(--duration-fast), color var(--duration-fast), transform var(--duration-fast);
  }

  .toolBtn:hover,
  .toolBtn.active {
    background: var(--surface-hover);
    color: var(--text);
  }

  .toolBtn.active {
    color: #6e94ff;
  }

  .compareToggleBtn.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .imageGenerateBtn {
    color: #e9ad45;
  }

  .imageGenerateBtn:hover {
    background: rgb(233 173 69 / 0.12);
    color: #f4c467;
  }

  .toolBtn:active {
    transform: scale(0.95);
  }

  #voiceBtn {
    font-size: 8px;
  }

  #voiceBtn.recording {
    background: var(--accent-soft);
    color: var(--accent);
    animation: recordingPulse 1.5s infinite;
  }

  @keyframes recordingPulse {
    50% { box-shadow: 0 0 0 5px rgb(239 68 68 / 0.1); }
  }

  .charCount {
    min-width: 0;
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
  }

  .selectWrap {
    position: relative;
    display: inline-flex;
    min-width: 0;
  }

  .selectWrap::after {
    position: absolute;
    top: 50%;
    right: 7px;
    color: var(--muted);
    content: "⌄";
    font-size: 9px;
    pointer-events: none;
    transform: translateY(-58%);
  }

  .selectWrap select {
    min-width: 0;
    height: 32px;
    padding: 0 22px 0 9px;
    overflow: hidden;
    appearance: none;
    border: 1px solid transparent;
    border-radius: 9px;
    outline: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
  }

  .selectWrap select:hover {
    border-color: var(--border);
    background: var(--surface-raised);
    color: var(--text);
  }

  .modelSelectWrap select {
    max-width: 120px;
  }

  .sendBtn {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--accent);
    box-shadow: 0 4px 12px rgb(239 68 68 / 0.22);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    transition: background var(--duration-fast), transform var(--duration-fast), opacity var(--duration-fast);
  }

  .sendBtn:not(:disabled):hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
  }

  .sendBtn:disabled {
    background: var(--surface-active);
    box-shadow: none;
    color: var(--muted);
    opacity: 1;
  }

  .stopIcon {
    display: none;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: currentColor;
  }

  .sendBtn.isStopping .sendIcon {
    display: none;
  }

  .sendBtn.isStopping .stopIcon {
    display: block;
    animation: stopBreathe 1.2s ease-in-out infinite;
  }

  @keyframes stopBreathe {
    50% { opacity: 0.65; transform: scale(0.82); }
  }

  .composerHint {
    margin-top: 7px;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
  }

  .attachmentTray {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-3) var(--space-3) 0;
  }

  .attachmentPreview {
    position: relative;
    display: flex;
    min-width: 168px;
    max-width: 230px;
    height: 60px;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-2);
    overflow: hidden;
    padding: 7px 30px 7px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    animation: uploadIn 220ms var(--ease-out) both;
  }

  @keyframes uploadIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
  }

  .attachmentPreview.imagePreview {
    min-width: 150px;
  }

  .attachmentPreview img {
    width: 48px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 7px;
    object-fit: cover;
  }

  .fileIcon {
    display: grid;
    width: 38px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
  }

  .attachmentCopy {
    min-width: 0;
  }

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

  .attachmentCopy strong {
    color: var(--text-secondary);
    font-size: 10px;
  }

  .attachmentCopy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
  }

  .attachmentRemove {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-active);
    color: var(--muted);
    font-size: 14px;
  }

  .attachmentRemove:hover {
    background: var(--accent);
    color: #fff;
  }

  .uploadProgress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent) var(--progress), var(--border) var(--progress));
    transition: background 160ms;
  }

  .attachmentPreview:has(.uploadProgress)::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 0.05) 48%, transparent 75%);
    content: "";
    pointer-events: none;
    transform: translateX(-100%);
    animation: loadingShimmer 1.3s infinite;
  }

  @keyframes loadingShimmer {
    to { transform: translateX(100%); }
  }

  .dropOverlay {
    position: absolute;
    z-index: 20;
    inset: 4px;
    display: none;
    place-items: center;
    align-content: center;
    border: 1px dashed var(--accent);
    border-radius: calc(var(--radius-xl) - 4px);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    color: var(--text);
    text-align: center;
  }

  .dropOverlay strong,
  .dropOverlay span {
    display: block;
  }

  .dropOverlay strong {
    color: var(--accent);
  }

  .dropOverlay span {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: 11px;
  }

  .composer.isDragging .dropOverlay {
    display: grid;
  }

  .toolsPopover {
    display: none;
    width: 250px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    color: var(--text);
  }

  .toolsPopover:popover-open {
    display: block;
    position: fixed;
    inset: auto auto 112px max(calc((100vw - var(--content-width)) / 2 + 12px), 20px);
    animation: popoverIn 160ms var(--ease-out) both;
  }

  body.landingMode .toolsPopover:popover-open,
  body.landingMode .toolsPopover[data-fallback-open] {
    bottom: clamp(176px, calc(112px + 12vh), 232px);
  }

  .toolsPopover[data-fallback-open] {
    position: fixed;
    z-index: 100;
    inset: auto auto 112px max(calc((100vw - var(--content-width)) / 2 + 12px), 20px);
    display: block;
    animation: popoverIn 160ms var(--ease-out) both;
  }

  @keyframes popoverIn {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .toolsPopover button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: var(--space-3);
    padding: 9px;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
  }

  .toolsPopover button:hover {
    background: var(--surface-hover);
  }

  .toolsPopover button > span:first-child {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
  }

  .toolsPopover strong,
  .toolsPopover small {
    display: block;
  }

  .toolsPopover strong {
    font-size: 11px;
  }

  .toolsPopover small {
    color: var(--muted);
    font-size: 9px;
  }

  .dialog {
    width: min(94vw, 620px);
    max-height: min(86vh, 760px);
    overflow: hidden;
    padding: 0;
    margin: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    color: var(--text);
  }

  .dialog::backdrop {
    background: var(--overlay);
    backdrop-filter: blur(4px);
  }

  .dialog[open] {
    animation: dialogIn 200ms var(--ease-out) both;
  }

  @keyframes dialogIn {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .dialogPanel {
    display: flex;
    max-height: min(86vh, 760px);
    flex-direction: column;
  }

  .dialogPanel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
  }

  .dialogPanel h2 {
    margin-top: 2px;
    font-size: 21px;
    letter-spacing: -0.025em;
  }

  .settingsBody,
  .dialogContent,
  .dashboardGrid {
    overflow-y: auto;
    padding: var(--space-5);
  }

  .settingRow {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
  }

  .settingRow:last-child {
    border-bottom: 0;
  }

  .settingRow strong,
  .settingRow small {
    display: block;
  }

  .settingRow strong {
    font-size: 12px;
  }

  .settingRow small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
  }

  .settingRow select,
  .formStack input,
  .formStack select {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: 0;
    background: var(--surface-raised);
    color: var(--text);
    font-size: 11px;
  }

  .settingRow input[type="checkbox"] {
    position: relative;
    width: 36px;
    height: 20px;
    flex: 0 0 auto;
    appearance: none;
    border-radius: var(--radius-full);
    background: var(--surface-active);
    transition: background var(--duration-fast);
  }

  .settingRow input[type="checkbox"]::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
    content: "";
    transition: background var(--duration-fast), transform var(--duration-fast);
  }

  .settingRow input[type="checkbox"]:checked {
    background: var(--accent);
  }

  .settingRow input[type="checkbox"]:checked::after {
    background: #fff;
    transform: translateX(16px);
  }

  .rangeRow input {
    accent-color: var(--accent);
  }

  .dialogEmpty {
    display: flex;
    min-height: 180px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    color: var(--muted);
    text-align: center;
  }

  .dialogEmpty strong {
    color: var(--text);
  }

  .dialogEmpty span {
    margin-top: var(--space-1);
    font-size: 11px;
  }

  .memoryList {
    display: grid;
    gap: var(--space-3);
  }

  .memoryCard {
    position: relative;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
  }

  .memoryCard:hover .memoryDeleteBtn {
    opacity: 1;
  }

  .memoryDeleteBtn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
  }

  .memoryDeleteBtn:hover {
    color: var(--color-danger);
  }

  .memoryActions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    padding: 0 var(--space-1);
  }

  .memoryActions .memoryCount {
    color: var(--muted);
    font-size: 11px;
  }

  .memoryCardBody {
    padding-right: var(--space-6);
  }

  .memoryCard strong {
    display: block;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .memoryCard p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: 11px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .memoryCard time {
    display: block;
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: 9px;
  }

  .dashboardGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .dashboardGrid article {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
  }

  .dashboardGrid span,
  .dashboardGrid strong,
  .dashboardGrid small {
    display: block;
  }

  .dashboardGrid span {
    color: var(--muted);
    font-size: 10px;
  }

  .dashboardGrid strong {
    margin-top: var(--space-2);
    font-size: 24px;
    letter-spacing: -0.03em;
  }

  .dashboardGrid small {
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: 9px;
  }

  .compactDialog {
    max-width: 100%;
  }

  .formStack {
    display: grid;
    gap: var(--space-4);
  }

  .formIntro {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
  }

  .authModeTabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-raised);
  }

  .authModeTabs button {
    min-height: 36px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    transition:
      background var(--duration-fast),
      box-shadow var(--duration-fast),
      color var(--duration-fast);
  }

  .authModeTabs button:hover:not(:disabled) {
    color: var(--text);
  }

  .authModeTabs button[aria-pressed="true"] {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text);
  }

  .authModeTabs button:focus-visible {
    box-shadow: var(--focus-ring);
  }

  .authModeTabs button:disabled {
    cursor: wait;
    opacity: 0.6;
  }

  .authField[hidden],
  .authHelpRow[hidden] {
    display: none;
  }

  .profileDialog {
    width: min(94vw, 480px);
  }

  .profileSection .eyebrow {
    margin-bottom: var(--space-3);
  }

  .profileAvatarEditor {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
  }

  .profileAvatarPreview {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: 750;
  }

  .profileAvatarPreview img {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .profileAvatarPreview > span {
    grid-area: 1 / 1;
  }

  .profileAvatarCopy {
    min-width: 0;
  }

  .profileAvatarCopy > strong,
  .profileAvatarCopy > small {
    display: block;
  }

  .profileAvatarCopy > strong {
    font-size: 12px;
  }

  .profileAvatarCopy > small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
  }

  .profileAvatarActions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
  }

  .profileAvatarActions .secondaryBtn {
    min-height: 32px;
  }

  .dangerTextBtn,
  .dangerButton {
    color: var(--danger);
  }

  .dangerTextBtn:disabled {
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.55;
    text-decoration: none;
  }

  .profileActions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
  }

  .profileActions > button {
    flex: 1;
  }

  .formStack input[readonly] {
    cursor: default;
    color: var(--muted);
  }

  .authHelpRow {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
    margin-top: calc(var(--space-2) * -1);
  }

  .textActionBtn {
    padding: 3px 0;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    font-weight: 650;
  }

  .textActionBtn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .formStack label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
  }

  .formStack input {
    min-height: 42px;
    font-size: 13px;
  }

  .formStack input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
  }

  .formError {
    min-height: 18px;
    color: var(--danger);
    font-size: 11px;
  }

  .formError.success {
    color: var(--success);
  }

  .primaryBtn,
  .secondaryBtn {
    position: relative;
    min-height: 38px;
    overflow: hidden;
    padding: 0 var(--space-4);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 650;
  }

  .primaryBtn {
    background: var(--accent);
    color: #fff;
  }

  .primaryBtn:hover {
    background: var(--accent-hover);
  }

  .secondaryBtn {
    border: 1px solid var(--border);
    background: var(--surface-raised);
    color: var(--text-secondary);
  }

  .dangerBtn {
    background: #dc3545;
    color: #fff;
  }

  .dangerBtn:hover {
    background: #c82333;
  }

  .dangerTextBtn {
    background: none;
    border: none;
    padding: 0;
    color: #dc3545;
    cursor: pointer;
    font-size: inherit;
  }

  .dangerTextBtn:hover {
    color: #c82333;
  }

  .dialogActions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
  }

  .toastRegion {
    position: fixed;
    z-index: 10000;
    right: max(var(--space-4), env(safe-area-inset-right));
    bottom: max(var(--space-4), env(safe-area-inset-bottom));
    display: grid;
    gap: var(--space-2);
    pointer-events: none;
  }

  .toast {
    max-width: min(340px, calc(100vw - 2rem));
    padding: 10px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: 11px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--duration-fast), transform var(--duration-fast);
  }

  .toast.visible {
    opacity: 1;
    transform: translateY(0);
  }

  .toast.error {
    border-color: rgb(240 82 82 / 0.4);
  }

  /* ===== BETA PAGE ===== */

  .betaPage {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 78% 8%, rgb(239 68 68 / 0.13), transparent 28rem),
      linear-gradient(180deg, #0b0b0c 0%, #0d0d10 55%, #0b0b0c 100%);
    color: var(--text);
  }

  body:has(.betaPage) {
    overflow: auto;
  }

  .betaNav,
  .betaHero,
  .betaSection,
  .betaPromise,
  .betaCta,
  .betaFooter {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
  }

  .betaNav {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }

  .betaBrand,
  .betaNavActions,
  .betaActions,
  .betaFooter div {
    display: flex;
    align-items: center;
  }

  .betaBrand {
    gap: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
  }

  .betaBrandMark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    box-shadow: 0 8px 22px rgb(239 68 68 / 0.22);
    color: #fff;
  }

  .betaBrand small {
    padding: 3px 7px;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: #ff8b8b;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .betaNavActions {
    gap: 8px;
  }

  .betaNavActions a {
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
  }

  .betaNavActions a:hover {
    background: var(--surface-hover);
    color: var(--text);
  }

  .betaNavActions .betaNavPrimary {
    background: var(--text);
    color: var(--bg);
  }

  .betaHero {
    position: relative;
    display: grid;
    min-height: 650px;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    align-items: center;
    gap: clamp(40px, 8vw, 110px);
    padding-block: 90px;
    isolation: isolate;
  }

  .betaGlow {
    position: absolute;
    z-index: -1;
    top: 12%;
    left: -14%;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(239 68 68 / 0.12), transparent 66%);
    filter: blur(12px);
    pointer-events: none;
  }

  .betaStatus {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: rgb(255 255 255 / 0.025);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
  }

  .betaStatus > span,
  .betaSignalPulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgb(52 199 123 / 0.1);
  }

  .betaEyebrow {
    color: #ff7474;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }

  .betaHero h1 {
    max-width: 740px;
    margin-top: 15px;
    font-size: clamp(44px, 6.2vw, 82px);
    font-weight: 820;
    letter-spacing: -0.065em;
    line-height: 0.97;
  }

  .betaLead {
    max-width: 650px;
    margin-top: 27px;
    color: var(--text-secondary);
    font-size: clamp(15px, 1.8vw, 19px);
    line-height: 1.7;
  }

  .betaActions {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
  }

  .betaPrimaryBtn,
  .betaSecondaryBtn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 19px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    transition: transform var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast);
  }

  .betaPrimaryBtn {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 12px 34px rgb(239 68 68 / 0.2);
    color: #fff;
  }

  .betaSecondaryBtn {
    background: rgb(255 255 255 / 0.025);
  }

  .betaPrimaryBtn:hover,
  .betaSecondaryBtn:hover {
    transform: translateY(-2px);
  }

  .betaPrimaryBtn:hover {
    background: var(--accent-hover);
  }

  .betaSecondaryBtn:hover {
    border-color: var(--text-secondary);
    background: var(--surface-hover);
  }

  .betaFinePrint {
    margin-top: 14px;
    color: var(--muted);
    font-size: 9px;
  }

  .betaRequestForm {
    margin-top: 36px;
  }

  .betaRequestTiming {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: start;
    margin-top: 24px;
    padding: 16px 18px;
    border: 1px solid rgb(245 158 11 / 0.3);
    border-radius: 14px;
    background: rgb(245 158 11 / 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.55;
  }

  .betaRequestTiming strong {
    color: #fbbf24;
  }

  .betaRequestGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .betaRequestGrid label {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
  }

  .betaRequestGrid label small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.5;
  }

  .betaRequestReason {
    grid-column: 1 / -1;
  }

  .betaRequestGrid input,
  .betaRequestGrid select,
  .betaRequestGrid textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    outline: none;
    background: rgb(0 0 0 / 0.22);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  }

  .betaRequestGrid input,
  .betaRequestGrid select {
    min-height: 46px;
    padding: 0 14px;
  }

  .betaRequestGrid textarea {
    min-height: 120px;
    resize: vertical;
    padding: 13px 14px;
    line-height: 1.55;
  }

  .betaRequestGrid input:focus,
  .betaRequestGrid select:focus,
  .betaRequestGrid textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
  }

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

  .betaRequestGrid input[readonly] {
    color: var(--muted);
    cursor: not-allowed;
  }

  .betaRequestStatus {
    margin-top: 14px;
    color: var(--muted);
    font-size: 10px;
  }

  .betaRequestStatus.success {
    color: var(--success);
  }

  .betaRequestStatus.error {
    color: var(--danger);
  }

  .betaRequestSection {
    scroll-margin-top: 24px;
  }

  .betaRequestSection > p strong {
    color: var(--text);
  }

  .betaSignalCard {
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: linear-gradient(145deg, rgb(28 28 31 / 0.94), rgb(17 17 19 / 0.96));
    box-shadow: 0 32px 90px rgb(0 0 0 / 0.38);
    transform: rotate(1.5deg);
  }

  .betaSignalHeader,
  .betaSignal,
  .betaStats {
    padding: 20px;
  }

  .betaSignalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }

  .betaSignalHeader span,
  .betaSignal small,
  .betaStats dt {
    color: var(--muted);
    font-size: 9px;
  }

  .betaSignalHeader strong {
    color: #ff7f7f;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .betaSignal {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 108px;
  }

  .betaSignalPulse {
    flex: 0 0 auto;
    animation: betaPulse 2s ease-in-out infinite;
  }

  @keyframes betaPulse {
    50% { box-shadow: 0 0 0 9px rgb(52 199 123 / 0.04); }
  }

  .betaSignal strong,
  .betaSignal small {
    display: block;
  }

  .betaSignal small {
    margin-top: 4px;
  }

  .betaStats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    background: rgb(0 0 0 / 0.12);
  }

  .betaStats div + div {
    padding-left: 16px;
    border-left: 1px solid var(--border);
  }

  .betaStats dd {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 800;
  }

  .betaAccessPanel {
    display: grid;
    gap: 12px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--border);
  }

  .betaAccessPanel p {
    min-height: 34px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
  }

  .betaAccessPanel a {
    width: 100%;
  }

  .betaSignalCard.isApproved {
    border-color: rgb(52 199 123 / 0.5);
  }

  .betaSignalCard.isApproved .betaSignalHeader strong {
    color: #57d996;
  }

  .betaSection {
    padding-block: 110px;
    border-top: 1px solid var(--border);
  }

  .betaSection > h2,
  .betaPromise h2,
  .betaCta h2 {
    max-width: 700px;
    margin-top: 12px;
    font-size: clamp(34px, 4.6vw, 58px);
    letter-spacing: -0.055em;
    line-height: 1.02;
  }

  .betaFeatureGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 58px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--border);
  }

  .betaFeatureGrid article {
    min-height: 250px;
    padding: clamp(26px, 4vw, 44px);
    background: var(--bg-elevated);
  }

  .betaFeatureGrid article > span {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 10px;
  }

  .betaFeatureGrid h3 {
    margin-top: 42px;
    font-size: 20px;
    letter-spacing: -0.03em;
  }

  .betaFeatureGrid p {
    max-width: 440px;
    margin-top: 11px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
  }

  .betaPromise {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(50px, 10vw, 140px);
    padding-block: 110px;
    border-top: 1px solid var(--border);
  }

  .betaPromise ul {
    display: grid;
    gap: 0;
    padding: 0;
    list-style: none;
  }

  .betaPromise li {
    padding: 22px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.65;
  }

  .betaPromise li:first-child {
    border-top: 1px solid var(--border);
  }

  .betaPromise strong {
    color: var(--text);
  }

  .betaCta {
    margin-bottom: 80px;
    padding: clamp(40px, 7vw, 80px);
    overflow: hidden;
    border: 1px solid var(--accent-border);
    border-radius: 28px;
    background:
      radial-gradient(circle at 90% 10%, rgb(239 68 68 / 0.2), transparent 22rem),
      var(--surface);
  }

  .betaCta > p:not(.betaEyebrow) {
    max-width: 570px;
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 14px;
  }

  .betaFooter {
    display: flex;
    min-height: 90px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 10px;
  }

  .betaFooter div {
    gap: 18px;
  }

  .betaFooter a {
    color: var(--text-secondary);
    text-decoration: none;
  }

  .betaFooter a:hover {
    color: var(--text);
  }

  .betaMyRequests {
    padding-top: 80px;
  }

  .betaRequestHistory {
    display: grid;
    gap: 14px;
    margin-top: 38px;
  }

  .betaRequestHistoryCard {
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
  }

  .betaRequestHistoryCard header,
  .betaAdminRequestCard header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }

  .betaRequestHistoryCard h3,
  .betaAdminRequestCard h2 {
    margin-top: 5px;
    letter-spacing: -0.025em;
  }

  .betaRequestHistoryCard small,
  .betaAdminRequestCard small {
    color: var(--muted);
    font-size: 9px;
  }

  .betaRequestHistoryCard > p,
  .betaAdminRequestDetails {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
  }

  .betaRequestHistoryCard .betaRequestFulfillmentNote {
    padding: 10px 12px;
    border: 1px solid rgb(245 158 11 / 0.24);
    border-radius: 10px;
    background: rgb(245 158 11 / 0.07);
    color: #fcd34d;
  }

  .betaRequestHistoryCard .betaRequestAccessWindow {
    padding: 10px 12px;
    border: 1px solid rgb(52 199 123 / 0.24);
    border-radius: 10px;
    background: rgb(52 199 123 / 0.07);
    color: #57d996;
  }

  .betaRequestHistoryCard aside {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: var(--accent-soft);
    font-size: 11px;
  }

  .betaRequestBadge {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .betaRequestBadge.pending {
    background: rgb(245 158 11 / 0.12);
    color: #fbbf24;
  }

  .betaRequestBadge.approved {
    background: rgb(52 199 123 / 0.12);
    color: #57d996;
  }

  .betaRequestBadge.declined {
    background: rgb(239 68 68 / 0.12);
    color: #ff7f7f;
  }

  .betaRequestEmpty {
    padding: 28px;
    border: 1px dashed var(--border-strong);
    border-radius: 16px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .betaAdminPage {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
  }

  body:has(.betaAdminPage) {
    overflow: auto;
  }

  .betaAdminMain {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 64px 0 100px;
  }

  .betaAdminHero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 44px;
  }

  .betaAdminHero h1 {
    margin-top: 10px;
    font-size: clamp(40px, 7vw, 76px);
    letter-spacing: -0.06em;
    line-height: 0.96;
  }

  .betaAdminHero p:not(.betaEyebrow) {
    max-width: 620px;
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 14px;
  }

  .betaAdminGate {
    display: grid;
    max-width: 620px;
    gap: 14px;
    padding: 30px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: var(--surface);
  }

  .betaAdminGate[hidden] {
    display: none;
  }

  .betaAdminGate p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
  }

  .betaAdminGate a {
    width: max-content;
  }

  .betaAdminDashboard {
    display: grid;
    gap: 26px;
  }

  .betaAdminDashboard[hidden] {
    display: none;
  }

  .betaAdminStats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--border);
  }

  .betaAdminStats.pendingOnly {
    grid-template-columns: minmax(180px, 280px);
    width: fit-content;
  }

  .betaAdminStats article {
    display: grid;
    gap: 6px;
    padding: 22px;
    background: var(--surface);
  }

  .betaAdminStats span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .betaAdminStats strong {
    font-size: 28px;
  }

  .betaAdminToolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .betaAdminToolbar label,
  .betaAdminRequestCard label {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
  }

  .betaAdminToolbar input,
  .betaAdminToolbar select,
  .betaAdminDuration input,
  .betaAdminDuration select,
  .betaAdminNote {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: inherit;
  }

  .betaAdminToolbar input,
  .betaAdminToolbar select,
  .betaAdminDuration input,
  .betaAdminDuration select {
    min-height: 44px;
    padding: 0 13px;
  }

  .betaAdminDuration {
    padding: 16px;
    border: 1px solid rgb(52 199 123 / 0.22);
    border-radius: 13px;
    background: rgb(52 199 123 / 0.05);
  }

  .betaAdminDuration label > div {
    display: grid;
    grid-template-columns: minmax(90px, 140px) minmax(120px, 180px);
    gap: 10px;
  }

  .betaAdminDuration small {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.5;
  }

  .betaAdminNote {
    min-height: 88px;
    resize: vertical;
    padding: 12px;
    font-size: 11px;
    line-height: 1.5;
  }

  .betaAdminToolbar input:focus,
  .betaAdminToolbar select:focus,
  .betaAdminDuration input:focus,
  .betaAdminDuration select:focus,
  .betaAdminNote:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
  }

  .betaAdminStatus {
    min-height: 18px;
    color: var(--muted);
    font-size: 10px;
  }

  .betaAdminRequestList {
    display: grid;
    gap: 16px;
  }

  .betaReviewedArchive {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
  }

  .betaReviewedArchives {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
  }

  .betaReviewedArchive.approvedArchive {
    border-color: rgb(52 199 123 / 0.3);
  }

  .betaReviewedArchive.declinedArchive {
    border-color: rgb(239 68 68 / 0.3);
  }

  .approvedArchive .betaReviewedCount {
    background: rgb(52 199 123 / 0.1);
    color: #55db92;
  }

  .declinedArchive .betaReviewedCount {
    background: rgb(239 68 68 / 0.1);
    color: #ff8e8e;
  }

  .betaReviewedArchive > summary {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    list-style: none;
  }

  .betaReviewedArchive > summary::-webkit-details-marker {
    display: none;
  }

  .betaReviewedArchive > summary::before {
    color: var(--muted);
    content: "›";
    font-size: 20px;
    transition: transform var(--duration-fast);
  }

  .betaReviewedArchive[open] > summary::before {
    transform: rotate(90deg);
  }

  .betaReviewedArchive > summary > span:first-of-type {
    flex: 1;
  }

  .betaReviewedCount {
    display: grid;
    min-width: 28px;
    height: 28px;
    padding-inline: 8px;
    place-items: center;
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    color: var(--muted);
    font-size: 10px;
  }

  .betaReviewedList {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px;
    border-top: 1px solid var(--border);
  }

  .betaReviewedRequestCard {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
  }

  .betaReviewedRequestCard:first-child {
    margin-top: 14px;
  }

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

  .betaReviewedRequestCard header small,
  .betaReviewedRequestCard header p {
    color: var(--muted);
    font-size: 9px;
  }

  .betaReviewedRequestCard h3 {
    margin: 4px 0;
    font-size: 17px;
  }

  .betaReviewedRequestCard aside {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text-secondary);
    font-size: 10px;
  }

  .betaAdminRequestCard {
    display: grid;
    gap: 20px;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
  }

  .betaAdminRequestCard header p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
  }

  .betaAdminRequestActions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .betaAdminDecision {
    min-height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 800;
  }

  .betaAdminDecision.approve {
    background: #34c77b;
    color: #07150e;
  }

  .betaAdminDecision.decline {
    border: 1px solid rgb(239 68 68 / 0.45);
    background: rgb(239 68 68 / 0.1);
    color: #ff8e8e;
  }

  .betaAdminReviewed {
    color: var(--muted);
  }

  body.privateBrowsingBlocked {
    overflow: hidden;
    background: var(--bg);
  }

  .privateBrowsingBlocker {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    align-content: center;
    justify-items: center;
    gap: 16px;
    padding: 32px;
    background:
      radial-gradient(circle at 50% 40%, rgb(239 68 68 / 0.1), transparent 38%),
      var(--bg);
    color: var(--text);
    text-align: center;
  }

  .privateBrowsingBlocker h1 {
    max-width: 720px;
    font-size: clamp(36px, 7vw, 76px);
    letter-spacing: -0.055em;
    line-height: 0.98;
  }

  .privateBrowsingBlocker > p:last-child {
    max-width: 620px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
  }

  .privateBrowsingMark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 17px;
    background: var(--accent);
    color: #fff;
    font-size: 28px;
    font-weight: 850;
  }

  @media (max-width: 760px) {
    .betaAdminMain {
      width: min(100% - 28px, 1180px);
      padding-top: 38px;
    }

    .betaAdminHero {
      align-items: flex-start;
      flex-direction: column;
    }

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

    .betaAdminToolbar {
      grid-template-columns: 1fr;
    }

    .betaReviewedArchives {
      grid-template-columns: 1fr;
    }

    .betaAdminDuration label > div {
      grid-template-columns: 1fr;
    }

    .betaRequestHistoryCard header,
    .betaAdminRequestCard header {
      align-items: flex-start;
      flex-direction: column;
    }
  }

  /* ===== HOME / LANDING PAGE ===== */

  .home {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
  }

  body:has(.home) {
    overflow: auto;
  }

  /* --- Nav --- */

  .homeNav {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: rgb(11 11 12 / 0.8);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
  }

  .homeNavInner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1040px;
    margin-inline: auto;
    padding: 0 var(--space-6);
    height: 56px;
  }

  .homeLogo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
  }

  .homeLogoMark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    box-shadow: 0 2px 10px rgb(239 68 68 / 0.25);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .homeLogoText {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.02em;
  }

  .homeLaunch {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 620;
    text-decoration: none;
    transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .homeLaunch:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgb(239 68 68 / 0.3);
  }

  /* --- Hero --- */

  .homeHero {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(5rem, 14vh, 9rem) var(--space-6) clamp(3rem, 8vh, 5rem);
    text-align: center;
    overflow: hidden;
  }

  .homeHeroBg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .homeHeroGlowRed {
    position: absolute;
    top: -60%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgb(239 68 68 / 0.12) 0%, rgb(239 68 68 / 0.04) 40%, transparent 70%);
    filter: blur(40px);
  }

  .homeHeroGlowDark {
    position: absolute;
    top: -20%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgb(0 0 0 / 0.5) 0%, transparent 70%);
  }

  .homeHeroGrid {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgb(255 255 255 / 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgb(255 255 255 / 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 70%);
  }

  .homeHeroContent {
    position: relative;
    z-index: 1;
    max-width: 640px;
    animation: fadeUp 600ms var(--ease-out) both;
  }

  .homeBrandMark {
    display: inline-grid;
    width: 64px;
    height: 64px;
    place-items: center;
    margin-bottom: var(--space-6);
    border-radius: 18px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 0.08),
      0 8px 32px rgb(239 68 68 / 0.3),
      0 2px 8px rgb(0 0 0 / 0.3);
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out);
  }

  .homeBrandMark:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 0.12),
      0 12px 40px rgb(239 68 68 / 0.4),
      0 4px 12px rgb(0 0 0 / 0.3);
  }

  .homeHeadline {
    font-size: clamp(40px, 6.5vw, 62px);
    font-weight: 780;
    letter-spacing: -0.055em;
    line-height: 1.04;
    background: linear-gradient(180deg, var(--text) 0%, rgb(244 244 245 / 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .homeSubline {
    margin-top: var(--space-4);
    color: var(--text-secondary);
    font-size: clamp(16px, 2.2vw, 20px);
    font-weight: 480;
    letter-spacing: -0.01em;
    line-height: 1.5;
  }

  .homeModelPills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-6);
  }

  .homePill {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 580;
    letter-spacing: 0.01em;
    transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
  }

  .homePill:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-soft);
  }

  .homeActions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
  }

  .homeBtnPrimary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 26px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 640;
    text-decoration: none;
    box-shadow: 0 2px 12px rgb(239 68 68 / 0.25);
    transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .homeBtnPrimary:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgb(239 68 68 / 0.35);
  }

  .homeBtnPrimary:active {
    transform: translateY(0);
  }

  .homeBtnLarge {
    height: 50px;
    padding: 0 32px;
    font-size: 16px;
  }

  .homeBtnArrow {
    font-size: 16px;
    transition: transform var(--duration-fast);
  }

  .homeBtnPrimary:hover .homeBtnArrow {
    transform: translateX(3px);
  }

  .homeBtnSecondary {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 0 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .homeBtnSecondary:hover {
    border-color: var(--border-strong);
    background: var(--surface-raised);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  .homeBtnGhost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--duration-fast), background var(--duration-fast), transform var(--duration-fast);
  }

  .homeBtnGhost:hover {
    color: var(--text);
    background: var(--surface);
    transform: translateY(-1px);
  }

  .homeBtnGhost .homeBtnArrow {
    transition: transform var(--duration-fast);
  }

  .homeBtnGhost:hover .homeBtnArrow {
    transform: translateY(2px);
  }

  /* --- Features --- */

  .homeFeatures {
    position: relative;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 50%, var(--bg) 100%);
  }

  .homeFeaturesInner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1040px;
    margin-inline: auto;
  }

  .homeFeatureCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: var(--space-8) var(--space-5);
    border-right: 1px solid var(--border);
    text-align: center;
    transition: background var(--duration-normal);
  }

  .homeFeatureCard:last-child {
    border-right: none;
  }

  .homeFeatureCard:hover {
    background: rgb(239 68 68 / 0.03);
  }

  .homeFeatureIcon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgb(239 68 68 / 0.12) 0%, rgb(239 68 68 / 0.04) 100%);
    border: 1px solid rgb(239 68 68 / 0.15);
    color: var(--accent);
    font-size: 20px;
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .homeFeatureCard:hover .homeFeatureIcon {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(239 68 68 / 0.15);
  }

  .homeFeatureCard strong {
    font-size: 14px;
    font-weight: 660;
    letter-spacing: -0.01em;
  }

  .homeFeatureCard > span:last-child {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 200px;
  }

  /* --- About / Info --- */

  .homeAbout {
    border-top: 1px solid var(--border);
    background: var(--bg);
  }

  .homeAboutInner {
    max-width: 1040px;
    margin-inline: auto;
    padding: clamp(3rem, 8vh, 5rem) var(--space-6);
    text-align: center;
  }

  .homeSectionEyebrow {
    color: var(--accent);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .homeAboutHeadline {
    margin-top: var(--space-3);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 740;
    letter-spacing: -0.04em;
    line-height: 1.12;
  }

  .homeAboutText {
    max-width: 620px;
    margin: var(--space-4) auto 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.65;
  }

  .homeAboutGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-8);
    text-align: left;
  }

  .homeAboutCard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  }

  .homeAboutCard:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }

  .homeAboutCard strong {
    font-size: 14px;
    font-weight: 660;
    letter-spacing: -0.01em;
  }

  .homeAboutCard span {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
  }

  /* --- CTA --- */

  .homeCta {
    border-top: 1px solid var(--border);
    background: var(--bg);
  }

  .homeCtaInner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    max-width: 1040px;
    margin-inline: auto;
    padding: clamp(3rem, 8vh, 5rem) var(--space-6);
    text-align: center;
  }

  .homeCtaBrand {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 28px rgb(239 68 68 / 0.25);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .homeCtaHeadline {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 740;
    letter-spacing: -0.04em;
    line-height: 1.1;
  }

  .homeCtaSub {
    color: var(--text-secondary);
    font-size: 16px;
  }

  /* --- Footer --- */

  .homeFooter {
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: var(--bg);
  }

  .homeFooterInner {
    max-width: 1040px;
    margin-inline: auto;
    padding: var(--space-6);
  }

  .homeFooterTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .homeFooterBrand {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
  }

  .homeFooterLinks {
    display: flex;
    gap: var(--space-1);
  }

  .homeFooterLinks a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color var(--duration-fast), background var(--duration-fast);
  }

  .homeFooterLinks a:hover {
    color: var(--text);
    background: var(--surface-hover);
  }

  .homeFooterCopy {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .aboutPage {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg);
  }

  .aboutTopBar {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-6);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .aboutBrand {
    color: var(--accent);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
  }

  .aboutBackLink {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 11px;
    text-decoration: none;
    transition: border-color var(--duration-fast), color var(--duration-fast);
  }

  .aboutBackLink:hover {
    border-color: var(--accent-border);
    color: var(--text);
  }

  .aboutMain {
    display: grid;
    flex: 1;
    place-items: center;
    padding: var(--space-6);
  }

  .aboutCard {
    width: min(100%, 660px);
    padding: clamp(2rem, 7vw, 4rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
  }

  .aboutEyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.14em;
  }

  .aboutCard h1 {
    margin-top: var(--space-2);
    font-size: clamp(32px, 7vw, 46px);
    letter-spacing: -0.04em;
  }

  .aboutStatement {
    margin-top: var(--space-4);
    color: var(--text-secondary);
    font-size: clamp(15px, 3vw, 18px);
    line-height: 1.7;
  }

  .aboutStatement a {
    color: var(--accent);
    text-underline-offset: 3px;
  }

  .aboutVisitorCounter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-8);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    color: var(--muted);
    text-align: left;
  }

  .aboutVisitorCounter strong {
    color: var(--text);
  }

  .aboutVisitorCounter span {
    font-size: 11px;
  }

  .errorCard .brand {
    display: block;
  }

  .rippleEffect {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.25);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 520ms ease-out forwards;
  }

  @keyframes ripple {
    to { opacity: 0; transform: translate(-50%, -50%) scale(18); }
  }
}

@layer utilities {
  [hidden] {
    display: none !important;
  }

  .srOnly {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
  }
}

@layer components {
  .folderControls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px 30px;
    gap: 5px;
    margin-top: var(--space-3);
  }

  .folderControls label {
    min-width: 0;
  }

  .folderControls select,
  .folderControls button {
    width: 100%;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 11px;
  }

  .folderControls select {
    padding: 0 8px;
  }

  .folderControls button:hover:not(:disabled),
  .folderControls select:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    color: var(--text);
  }

  .chatList {
    margin-top: var(--space-3);
  }

  .featurePill {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
  }

  .featurePill:hover {
    border-color: var(--border-strong);
    color: var(--text);
  }

  .featurePill.active {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent);
  }

  .incognitoHeading .connectionStatus {
    color: var(--accent);
  }

  .incognitoHeading .connectionStatus i {
    background: var(--accent);
  }

  .composer.incognitoMode {
    border-color: var(--accent-border);
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      linear-gradient(135deg, var(--accent), #7d4cff) border-box;
  }

  .memoryActions > span:last-child {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }

  .voiceDialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #050506;
    box-shadow: none;
    color: #f7f7f8;
  }

  .voiceDialog::backdrop {
    background: #050506;
    backdrop-filter: none;
  }

  .voiceDialog[open] {
    animation: voiceStageIn 260ms var(--ease-out) both;
  }

  @keyframes voiceStageIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .voiceDialog .voicePanel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 48%, rgb(244 63 70 / 0.07), transparent 32%),
      linear-gradient(180deg, #09090a, #030304);
  }

  .voiceDialog .voiceHeader {
    min-height: 78px;
    padding: 18px clamp(20px, 3vw, 44px);
    border-bottom: 0;
    background: linear-gradient(180deg, rgb(5 5 6 / 0.95), transparent);
    z-index: 3;
  }

  .voiceDialog .voiceHeader h2 {
    margin-top: 3px;
    color: #f7f7f8;
    font-size: 20px;
  }

  .voiceHeaderMeta {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .voiceHeaderMeta > span {
    max-width: 220px;
    overflow: hidden;
    color: #8f8f96;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .voicePicker {
    display: block;
  }

  .voicePicker select {
    width: min(220px, 28vw);
    min-height: 38px;
    padding: 0 34px 0 13px;
    border: 1px solid #2c2c30;
    border-radius: 999px;
    outline: 0;
    background: #161619;
    color: #d7d7db;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
  }

  .voicePicker select:hover {
    border-color: #44444a;
    background: #1c1c20;
  }

  .voicePicker select:focus-visible {
    border-color: #fb7185;
    box-shadow: 0 0 0 3px rgb(251 113 133 / 16%);
  }

  .voicePicker select:disabled {
    color: #77777f;
    cursor: not-allowed;
  }

  .voiceHeader .iconBtn {
    width: 42px;
    height: 42px;
    border: 1px solid #2c2c30;
    border-radius: 50%;
    background: #161619;
    color: #f7f7f8;
    font-size: 21px;
  }

  .voiceDialog .voiceContent {
    position: relative;
    display: grid;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    padding: 0 clamp(18px, 4vw, 56px) 116px;
  }

  .voiceIntro {
    position: absolute;
    top: 4px;
    left: 50%;
    width: min(88vw, 580px);
    color: #77777f;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    transform: translateX(-50%);
  }

  .voiceStage {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 20px;
    min-height: 0;
    padding: 46px 0 24px;
  }

  .voiceOrb {
    position: relative;
    display: block;
    width: clamp(190px, 24vw, 300px);
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    outline: 0;
    background:
      radial-gradient(circle at 30% 28%, #fff 0 5%, transparent 28%),
      conic-gradient(from 205deg, #fff1f2, #fecdd3 14%, #fb7185 32%, #f43f46 50%, #991b1b 67%, #fb7185 82%, #fff 100%);
    box-shadow:
      0 34px 90px rgb(0 0 0 / 0.55),
      0 0 0 1px rgb(255 255 255 / 0.13),
      0 0 80px rgb(244 63 70 / 0.16);
    cursor: pointer;
    animation: voiceOrbIdle 5s ease-in-out infinite;
    transition: box-shadow 220ms ease, filter 220ms ease;
  }

  .voiceOrb:focus-visible {
    box-shadow:
      0 0 0 4px #050506,
      0 0 0 7px #fb7185,
      0 34px 90px rgb(0 0 0 / 0.55);
  }

  .voiceOrbSurface {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background:
      radial-gradient(circle at 72% 34%, rgb(255 255 255 / 0.92), transparent 24%),
      radial-gradient(circle at 30% 70%, rgb(127 29 29 / 0.48), transparent 44%),
      linear-gradient(135deg, rgb(255 255 255 / 0.4), transparent 55%);
    filter: blur(12px);
    opacity: 0.9;
    animation: voiceOrbSurface 6s ease-in-out infinite alternate;
  }

  .voiceOrb.listening {
    box-shadow:
      0 34px 90px rgb(0 0 0 / 0.55),
      0 0 0 1px rgb(255 255 255 / 0.18),
      0 0 110px rgb(244 63 70 / 0.42);
    animation: voiceOrbListen 1.35s ease-in-out infinite;
  }

  .voiceOrb.speaking {
    filter: saturate(1.25) hue-rotate(-12deg);
    box-shadow:
      0 34px 90px rgb(0 0 0 / 0.55),
      0 0 0 1px rgb(255 255 255 / 0.2),
      0 0 120px rgb(251 113 133 / 0.5);
    animation: voiceOrbSpeak 900ms ease-in-out infinite alternate;
  }

  @keyframes voiceOrbIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.015); }
  }

  @keyframes voiceOrbSurface {
    from { transform: translate3d(-5px, 5px, 0) scale(0.94) rotate(-8deg); }
    to { transform: translate3d(7px, -4px, 0) scale(1.07) rotate(12deg); }
  }

  @keyframes voiceOrbListen {
    0%, 100% { transform: scale(0.985); }
    50% { transform: scale(1.045); }
  }

  @keyframes voiceOrbSpeak {
    from { transform: scale(0.98) rotate(-1deg); }
    to { transform: scale(1.055) rotate(1deg); }
  }

  .voiceLiveIndicator {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid #2d2d31;
    border-radius: 999px;
    background: rgb(20 20 22 / 0.72);
    color: #9a9aa1;
    font-size: 11px;
    backdrop-filter: blur(12px);
  }

  .voiceLiveIndicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
  }

  .voiceLiveIndicator.active {
    border-color: rgb(251 113 133 / 0.42);
    color: #fda4af;
    background: rgb(244 63 70 / 0.09);
  }

  .voiceLiveIndicator.active span {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgb(239 68 68 / 0.12);
  }

  .voiceStatus {
    min-height: 22px;
    color: #c7c7cb;
    font-size: 15px;
    font-weight: 620;
    text-align: center;
  }

  .voiceStatus.error {
    color: var(--danger);
  }

  .voiceCaption {
    width: min(86vw, 620px);
    min-height: 44px;
    overflow: hidden;
    color: #85858c;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    text-overflow: ellipsis;
  }

  .voiceDetails {
    position: absolute;
    bottom: 94px;
    left: clamp(18px, 4vw, 56px);
    z-index: 4;
    width: min(360px, calc(100vw - 36px));
    color: #a8a8ae;
    font-size: 11px;
  }

  .voiceDetails > summary {
    width: max-content;
    padding: 8px 12px;
    border: 1px solid #2b2b2f;
    border-radius: 999px;
    background: rgb(18 18 20 / 0.86);
    cursor: pointer;
    list-style: none;
    backdrop-filter: blur(16px);
  }

  .voiceDetails > summary::-webkit-details-marker {
    display: none;
  }

  .voiceDetails[open] {
    padding: 12px;
    border: 1px solid #2b2b2f;
    border-radius: 18px;
    background: rgb(15 15 17 / 0.96);
    box-shadow: 0 18px 50px rgb(0 0 0 / 0.45);
  }

  .voiceDetails[open] > summary {
    padding: 0 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .voiceDetailsBody {
    display: grid;
    gap: 12px;
  }

  .voiceDetailsBody label {
    display: grid;
    gap: 6px;
  }

  #voiceTranscript {
    min-height: 104px;
    resize: vertical;
    padding: 10px;
    border: 1px solid #303034;
    border-radius: 9px;
    outline: 0;
    background: #09090a;
    color: #f7f7f8;
  }

  .voiceOptions {
    display: grid;
    gap: 7px;
    color: #a8a8ae;
    font-size: 11px;
  }

  .voiceOptions label {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .voiceOptions input {
    accent-color: var(--accent);
  }

  .voiceDock {
    position: absolute;
    right: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 5;
    display: flex;
    width: min(700px, calc(100vw - 36px));
    min-height: 68px;
    align-items: center;
    gap: 12px;
    padding: 9px 10px 9px 14px;
    border: 1px solid #2b2b2f;
    border-radius: 999px;
    background: rgb(27 27 30 / 0.92);
    box-shadow: 0 18px 56px rgb(0 0 0 / 0.55);
    transform: translateX(50%);
    backdrop-filter: blur(22px);
  }

  .voiceStartBtn {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: 999px;
    background: #f7f7f8;
    color: #111113;
    font-weight: 700;
  }

  .voicePermissionBtn {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgb(251 113 133 / 0.48);
    border-radius: 999px;
    background: rgb(244 63 70 / 0.13);
    color: #fda4af;
    font-weight: 700;
  }

  .voicePermissionBtn:hover:not(:disabled),
  .voicePermissionBtn:focus-visible:not(:disabled) {
    border-color: #fb7185;
    background: rgb(244 63 70 / 0.22);
  }

  .voicePermissionBtn.allowed {
    border-color: rgb(52 211 153 / 0.38);
    background: rgb(16 185 129 / 0.1);
    color: #6ee7b7;
  }

  .voiceStartBtn:disabled {
    border-color: #303034;
    background: #202024;
    color: #707078;
    cursor: not-allowed;
  }

  .voiceDialog.liveConversation .voiceStartBtn {
    border-color: rgb(251 113 133 / 0.5);
    background: rgb(244 63 70 / 0.15);
    color: #fda4af;
  }

  .voiceDockHint {
    min-width: 0;
    flex: 1;
    color: #898990;
    font-size: 12px;
    text-align: center;
  }

  .voiceDockHint strong {
    color: #d3d3d7;
  }

  .voiceEndBtn {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f7f7f8;
    color: #111113;
    font-size: 26px;
    line-height: 1;
  }

  .voiceEndBtn:hover,
  .voiceEndBtn:focus-visible {
    background: #fff;
    transform: scale(1.04);
  }

  @media (max-width: 700px) {
    .voiceDialog .voiceHeader {
      min-height: 66px;
      padding: 12px 16px;
    }

    .voiceHeaderMeta > span,
    .voiceIntro {
      display: none;
    }

    .voicePicker select {
      width: min(150px, 42vw);
    }

    .voiceDialog .voiceContent {
      padding: 0 16px 104px;
    }

    .voiceStage {
      gap: 16px;
      padding-top: 12px;
    }

    .voiceOrb {
      width: clamp(180px, 62vw, 248px);
    }

    .voiceDetails {
      bottom: 88px;
      left: 14px;
    }

    .voiceDock {
      bottom: max(14px, env(safe-area-inset-bottom));
      width: calc(100vw - 28px);
      min-height: 62px;
      padding: 7px;
    }

    .voicePermissionBtn,
    .voiceStartBtn {
      min-width: 0;
      flex: 1;
      min-height: 46px;
      padding-inline: 8px;
      font-size: 11px;
      white-space: nowrap;
    }

    .voiceDockHint {
      display: none;
    }
  }

}

@layer responsive {
  @media (max-width: 980px) {
    .betaHero {
      grid-template-columns: 1fr;
      gap: 60px;
      padding-block: 78px;
    }

    .betaSignalCard {
      width: min(100%, 560px);
      transform: none;
    }

    .betaPromise {
      grid-template-columns: 1fr;
      gap: 44px;
    }

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

    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      width: min(86vw, 300px);
      box-shadow: var(--shadow-lg);
      opacity: 0;
      pointer-events: none;
      transform: translateX(-105%);
    }

    .sidebar.mobileOpen {
      opacity: 1;
      pointer-events: auto;
      transform: translateX(0);
    }

    .sidebarCloseBtn,
    .menuBtn {
      display: inline-grid;
    }

    .sidebarCollapseBtn {
      display: none;
    }

    .conversationHeading {
      margin-left: 0;
    }

    .sidebarBackdrop {
      position: fixed;
      z-index: 25;
      inset: 0;
      background: var(--overlay);
      opacity: 0;
      transition: opacity var(--duration-fast);
    }

    .sidebarBackdrop.visible {
      opacity: 1;
    }
  }

  @media (max-width: 720px) {
    .featurePill {
      display: none;
    }

    .betaNav,
    .betaHero,
    .betaSection,
    .betaPromise,
    .betaCta,
    .betaFooter {
      width: min(100% - 28px, 1120px);
    }

    .betaHero {
      min-height: auto;
      padding-block: 64px 78px;
    }

    .betaHero h1 {
      font-size: clamp(42px, 12vw, 62px);
    }

    .betaSection,
    .betaPromise {
      padding-block: 78px;
    }

    .betaFeatureGrid {
      grid-template-columns: 1fr;
      margin-top: 40px;
    }

    .betaFeatureGrid article {
      min-height: 220px;
    }

    .betaCta {
      margin-bottom: 52px;
    }

    .betaRequestGrid {
      grid-template-columns: 1fr;
    }

    .betaRequestReason {
      grid-column: auto;
    }

    .topBar {
      min-height: 56px;
      padding: 0 var(--space-3);
    }

    .visitorCounter,
    .statPill {
      display: none;
    }

    .conversationHeading strong {
      max-width: 54vw;
    }

    .chatArea {
      padding: var(--space-6) var(--space-4) 5rem;
    }

    .app.isEmpty .chatArea {
      padding-bottom: var(--space-2);
    }

    .message + .message {
      margin-top: var(--space-6);
    }

    .userMessage .messageInner {
      width: min(94%, 620px);
    }

    .messageActions {
      opacity: 1;
    }

    .messageAction {
      padding-inline: 5px;
    }

    .messageMetrics {
      display: none;
    }

    .suggestionGrid {
      grid-template-columns: 1fr;
      margin-top: var(--space-6);
    }

    .suggestionGrid button:nth-child(n + 3) {
      display: none;
    }

    .composerDock {
      padding-inline: max(var(--space-2), env(safe-area-inset-left));
      padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
    }

    .app.isEmpty .composerDock {
      transform: translate3d(0, -3.5rem, 0);
    }

    .composer {
      border-radius: 18px;
    }

    .composerHint {
      display: none;
    }

    .composerInputRow {
      padding: 12px 12px 4px;
    }

    .composerToolbar {
      padding: 5px 6px 6px;
    }

    .compareBar {
      margin-inline: 7px;
    }

    .compareBar > strong {
      max-width: 110px;
    }

    #imageUploadBtn,
    #attachmentBtn {
      display: none;
    }

    .selectWrap select {
      max-width: 82px;
    }

    .modelSelectWrap select {
      max-width: 110px;
    }

    .voiceActions {
      align-items: stretch;
      flex-direction: column;
    }

    .voiceActions > button {
      width: 100%;
    }

    .toolsPopover:popover-open {
      right: 12px;
      bottom: 86px;
      left: 12px;
      width: auto;
    }

    body.landingMode .toolsPopover:popover-open,
    body.landingMode .toolsPopover[data-fallback-open] {
      bottom: 142px;
    }

    .messageContent table {
      margin-inline: calc(var(--space-4) * -1);
      width: calc(100% + (var(--space-4) * 2));
      border-right: 0;
      border-left: 0;
      border-radius: 0;
    }

    .homeFeaturesInner {
      grid-template-columns: 1fr 1fr;
    }

    .homeFeatureCard:nth-child(2) {
      border-right: none;
    }

    .homeFeatureCard {
      padding: var(--space-6) var(--space-4);
    }

    .homeAboutGrid {
      grid-template-columns: 1fr 1fr;
    }
  }

  @media (max-width: 480px) {
    .betaNav {
      min-height: 64px;
    }

    .betaNavActions > a:first-child {
      display: none;
    }

    .betaBrand {
      gap: 7px;
    }

    .betaBrandMark {
      width: 31px;
      height: 31px;
    }

    .betaActions {
      align-items: stretch;
      flex-direction: column;
    }

    .betaPrimaryBtn,
    .betaSecondaryBtn {
      width: 100%;
    }

    .betaStats {
      padding-inline: 14px;
    }

    .betaStats div + div {
      padding-left: 10px;
    }

    .betaCta {
      padding: 34px 24px;
      border-radius: 20px;
    }

    .betaFooter {
      align-items: flex-start;
      flex-direction: column;
      justify-content: center;
      gap: 12px;
    }

    .conversationHeading strong {
      max-width: 62vw;
    }

    .homeActions {
      flex-direction: column;
      align-items: center;
    }

    .homeBtnPrimary,
    .homeBtnSecondary {
      width: 100%;
      max-width: 280px;
      justify-content: center;
    }

    .homeFeaturesInner {
      grid-template-columns: 1fr;
    }

    .homeFeatureCard {
      border-right: none;
      border-bottom: 1px solid var(--border);
      padding: var(--space-5) var(--space-4);
    }

    .homeFeatureCard:last-child {
      border-bottom: none;
    }

    .homeAboutGrid {
      grid-template-columns: 1fr;
    }

    .homeFooterTop {
      flex-direction: column;
      gap: var(--space-3);
      text-align: center;
    }

    .clearBtn {
      display: none;
    }

    .emptyState {
      min-height: calc(100% - 1rem);
    }

    .emptyState h1 {
      font-size: 36px;
    }

    .heroTagline {
      font-size: 16px;
    }

    .heroQuestion {
      margin-top: var(--space-5);
      font-size: 12px;
    }

    .userMessage .messageInner {
      width: 96%;
    }

    .messageFooter {
      align-items: flex-start;
    }

    .messageActions {
      gap: 0;
    }

    .modelName {
      flex-basis: 100%;
      margin-top: 2px;
      margin-left: 0;
      padding-left: 5px;
      border-left: 0;
      text-align: right;
    }

    .charCount,
    #modeSelect {
      display: none;
    }

    .selectWrap:has(#modeSelect) {
      display: none;
    }

    .modelSelectWrap select {
      max-width: 108px;
    }

    .compareBarLabel {
      font-size: 0;
    }

    .compareBarLabel span {
      font-size: 15px;
    }

    .compareBar > strong {
      max-width: 88px;
      font-size: 10px;
    }

    .compareModelSelectWrap select {
      max-width: none;
    }

    .dashboardGrid {
      grid-template-columns: 1fr;
    }

    .dialogPanel > header,
    .settingsBody,
    .dialogContent,
    .dashboardGrid {
      padding: var(--space-4);
    }
  }

  @media (max-height: 560px) and (orientation: landscape) {
    .topBar {
      min-height: 48px;
    }

    .chatArea {
      padding-top: var(--space-4);
      padding-bottom: var(--space-8);
    }

    .composerInputRow {
      padding-top: 9px;
    }

    #messageInput {
      max-height: 84px;
    }

    .app.isEmpty .composerDock {
      transform: translate3d(0, -1rem, 0);
    }

    .app.isEmpty .emptyState {
      justify-content: center;
      padding-block: var(--space-2);
    }

    .app.isEmpty .emptyBrand {
      width: 38px;
      height: 38px;
      margin-bottom: var(--space-2);
      border-radius: 11px;
      font-size: 18px;
    }

    .app.isEmpty .emptyState h1 {
      font-size: 30px;
    }

    .app.isEmpty .heroTagline {
      margin-top: var(--space-1);
      font-size: 14px;
    }

    .app.isEmpty .heroQuestion {
      margin-top: var(--space-3);
    }

    .app.isEmpty .suggestionGrid {
      display: none;
    }
  }

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

  @media (prefers-contrast: more) {
    :root {
      --border: #6b6b73;
      --border-strong: #909099;
      --text-secondary: var(--text);
      --muted: #b1b1b8;
    }

    :focus-visible {
      outline-width: 3px;
    }
  }

  @media (forced-colors: active) {
    .brandMark,
    .assistantAvatar,
    .sendBtn {
      border: 1px solid ButtonText;
    }
  }
}
