/* ==========================================================================
   Orbit design system — shared core

   This block is identical in Orbit AI (static/css/app.css) and Orbit Mission
   Control (static/css/auth.css). Each app appends its own components after
   it. Keep the two copies in sync.

   Direction
   ---------
   The brand mark is a navy planet, so the interface is built around that
   navy rather than denying it: it is the accent for primary actions, focus,
   selection and links. Neutrals are cool-tinted so the navy sits naturally
   on them. Everything else is quiet.

   Theming follows the operating system by default; the theme control sets
   `data-theme` on <html>:

     (no attribute)      -> follow the system
     data-theme="light"  -> force light
     data-theme="dark"   -> force dark

   Dark values are defined twice on purpose — once for the system preference
   and once for the explicit override — so the two can never drift apart.
   Every text token clears WCAG AA (4.5:1) on the surfaces it is used on.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens — light
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Surfaces, flattest to most raised. */
  --bg: #ffffff;
  --bg-subtle: #f6f8fb;
  --bg-raised: #ffffff;
  --bg-inset: #eef1f6;
  --bg-hover: #f1f4f9;
  --bg-active: #e5eaf2;
  --sidebar-bg: #f6f8fb;

  /* Hairlines. */
  --border: #e4e8ef;
  --border-strong: #d0d7e2;

  /* Text. */
  --text: #0f172a;
  --text-muted: #4a556a;   /* 7.2:1 on --bg */
  --text-faint: #657189;   /* 4.9:1 on --bg */

  /* Brand navy, sampled from the logo. */
  --brand: #0b2a5b;
  --brand-bright: #1a56c9;

  /* The accent is the brand. */
  --accent: #0b2a5b;
  --accent-hover: #143a7a;
  --accent-soft: #e8eefa;
  --accent-soft-text: #0b2a5b;
  --accent-text: #ffffff;
  --accent-ring: rgba(11, 42, 91, 0.22);
  --link: #1a56c9;

  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fef3f2;
  --danger-text: #ffffff;

  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;

  /* User message bubble (Orbit AI). */
  --bubble-user: #e8eefa;
  --bubble-user-text: #0f172a;

  --scrim: rgba(15, 23, 42, 0.45);

  /* Radii — generous, to match the friendly mark. */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  /* Elevation. Navy-tinted so shadows read as depth, not dirt. */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -12px rgba(11, 42, 91, 0.22);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, 0.05), 0 20px 48px -16px rgba(11, 42, 91, 0.28);

  --ring: 0 0 0 3px var(--accent-ring);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.2, 0, 0.13, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;
}

/* --------------------------------------------------------------------------
   Tokens — dark
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0b0e14;
    --bg-subtle: #0f131b;
    --bg-raised: #141a25;
    --bg-inset: #1a2130;
    --bg-hover: #1b2232;
    --bg-active: #242d40;
    --sidebar-bg: #0d1118;

    --border: #212938;
    --border-strong: #303a4f;

    --text: #eef2f8;
    --text-muted: #a4afc4;
    --text-faint: #8291ab;

    --brand: #7aa7ff;
    --brand-bright: #9bbcff;

    --accent: #6d9eff;
    --accent-hover: #86afff;
    --accent-soft: #172543;
    --accent-soft-text: #b6ccff;
    --accent-text: #061225;
    --accent-ring: rgba(109, 158, 255, 0.32);
    --link: #8fb3ff;

    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-soft: #2a1515;
    --danger-text: #1a0808;

    --success: #4ade80;
    --success-soft: #0f2a1c;
    --warning: #fbbf24;
    --warning-soft: #2b2110;

    --bubble-user: #1a2742;
    --bubble-user-text: #e8eefa;

    --scrim: rgba(0, 0, 0, 0.62);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 56px -16px rgba(0, 0, 0, 0.75);
  }
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b0e14;
  --bg-subtle: #0f131b;
  --bg-raised: #141a25;
  --bg-inset: #1a2130;
  --bg-hover: #1b2232;
  --bg-active: #242d40;
  --sidebar-bg: #0d1118;

  --border: #212938;
  --border-strong: #303a4f;

  --text: #eef2f8;
  --text-muted: #a4afc4;
  --text-faint: #8291ab;

  --brand: #7aa7ff;
  --brand-bright: #9bbcff;

  --accent: #6d9eff;
  --accent-hover: #86afff;
  --accent-soft: #172543;
  --accent-soft-text: #b6ccff;
  --accent-text: #061225;
  --accent-ring: rgba(109, 158, 255, 0.32);
  --link: #8fb3ff;

  --danger: #f87171;
  --danger-hover: #fca5a5;
  --danger-soft: #2a1515;
  --danger-text: #1a0808;

  --success: #4ade80;
  --success-soft: #0f2a1c;
  --warning: #fbbf24;
  --warning-soft: #2b2110;

  --bubble-user: #1a2742;
  --bubble-user-text: #e8eefa;

  --scrim: rgba(0, 0, 0, 0.62);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 56px -16px rgba(0, 0, 0, 0.75);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.prose a,
.message a,
.notice a,
.text-link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.prose a:hover,
.message a:hover,
.notice a:hover,
.text-link:hover { text-decoration-color: var(--link); }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

code, pre, kbd, samp {
  font-family: var(--mono);
  font-size: 0.875em;
}

code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.4em;
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.55;
}

pre code { background: none; border: none; padding: 0; font-size: 1em; }

kbd {
  display: inline-block;
  padding: 0.05em 0.45em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--bg-raised);
  font-size: 0.78em;
  line-height: 1.5;
}

blockquote {
  margin: 0 0 1em;
  padding-left: 14px;
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
}

ul, ol { margin: 0 0 1em; padding-left: 1.35em; }
li { margin: 0.2em 0; }

table { border-collapse: collapse; }

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

::selection { background: var(--accent-soft); color: var(--text); }
::-moz-focus-inner { border: 0; }

/* Icons inherit colour and sit on the text baseline. */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.18em;
}

/* --- Scrollbars --------------------------------------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active { background: var(--bg-active); transform: translateY(0.5px); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
}
.btn--primary:active { background: var(--accent); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); border-color: transparent; }

.btn--soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-soft-text);
  box-shadow: none;
}
.btn--soft:hover { background: var(--accent-soft); filter: brightness(0.97); }

.btn--danger {
  color: var(--danger);
  border-color: var(--border-strong);
}
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn--danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-text);
}
.btn--danger-solid:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--danger-text); }

.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 5px 11px; font-size: 0.8rem; gap: 6px; border-radius: var(--radius-xs); }
.btn--lg { min-height: 46px; padding: 11px 22px; font-size: 0.95rem; border-radius: var(--radius); }
.btn--pill { border-radius: var(--radius-pill); }

.btn .icon { margin: 0 -2px; }

/* Icon-only buttons. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
  padding: 0;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { background: var(--bg-active); }
.icon-btn[aria-expanded="true"] { background: var(--bg-active); color: var(--text); }
.icon-btn--bordered { border: 1px solid var(--border-strong); background: var(--bg-raised); box-shadow: var(--shadow-sm); }
.icon-btn--lg { width: 38px; height: 38px; }
.icon-btn.is-success { color: var(--success); }

/* Segmented control. */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.segmented .btn {
  min-height: 30px;
  padding: 4px 12px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-weight: 500;
}
.segmented .btn:hover { background: var(--bg-raised); color: var(--text); }
.segmented .btn.is-active {
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.segmented .btn .count {
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field__hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 6px 0 0;
  line-height: 1.5;
}

.field__hint a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

.field__error {
  font-size: 0.78rem;
  color: var(--danger);
  margin: 6px 0 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

select {
  cursor: pointer;
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23657189' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238291ab' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238291ab' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

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

input:disabled, select:disabled, textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-inset);
  box-shadow: none;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); opacity: 1; }

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
  box-shadow: none;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  margin-bottom: 12px;
  cursor: pointer;
  line-height: 1.45;
  color: var(--text);
}
.checkbox:last-child { margin-bottom: 0; }
.checkbox input { margin-top: 2px; }
.checkbox__hint { display: block; font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }

/* Input with a leading icon. */
.input-icon { position: relative; }
.input-icon > .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.input-icon > input { padding-left: 36px; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }

.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.card__title .icon { color: var(--text-faint); }

.card__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.card__subtitle:last-child { margin-bottom: 0; }

.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--bg-subtle); box-shadow: none; }
.card--accent { border-color: var(--accent); box-shadow: var(--shadow); }

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.card__header > div:first-child { min-width: 0; }
.card__header .card__subtitle { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  background: var(--bg-inset);
  color: var(--text-muted);
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; }

.badge--accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.badge--outline { background: transparent; border-color: var(--border-strong); color: var(--text-muted); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--premium { background: var(--accent-soft); color: var(--accent-soft-text); }
.badge--pro { background: var(--accent); color: var(--accent-text); }
.badge--free { background: var(--bg-inset); color: var(--text-muted); }
.badge--muted { background: var(--bg-inset); color: var(--text-muted); }
.badge--personal { background: var(--bg-inset); color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Flash messages (Django messages framework)
   -------------------------------------------------------------------------- */

.messages { list-style: none; margin: 0 0 18px; padding: 0; }

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.message:last-child { margin-bottom: 0; }
.message > .icon { margin-top: 2px; flex: 0 0 auto; }

.message--success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.message--success > .icon { color: var(--success); }
.message--info { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.message--info > .icon { color: var(--accent); }
.message--warning { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); }
.message--warning > .icon { color: var(--warning); }
.message--error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
  font-weight: 500;
}
.message--error > .icon { color: var(--danger); }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex: 0 0 auto;
  overflow: hidden;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--soft { background: var(--accent-soft); color: var(--accent-soft-text); }
.avatar--neutral { background: var(--bg-inset); color: var(--text-muted); }
.avatar--square { border-radius: var(--radius-sm); }
.avatar--sm { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar--lg { width: 40px; height: 40px; font-size: 0.85rem; border-radius: 12px; }
.avatar--xl { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 16px; }

/* --------------------------------------------------------------------------
   Dropdown menus
   -------------------------------------------------------------------------- */

.menu { position: relative; }

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  display: none;
  max-height: min(440px, 70vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu__panel.is-open { display: block; animation: menu-in var(--dur) var(--ease); }
.menu__panel--up { top: auto; bottom: calc(100% + 6px); }
.menu__panel--left { right: auto; left: 0; }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.menu__panel--up.is-open { animation-name: menu-in-up; }
@keyframes menu-in-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.menu__item .icon { color: var(--text-faint); }
.menu__item:hover { background: var(--bg-hover); }
.menu__item:hover .icon { color: var(--text); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger .icon { color: var(--danger); }
.menu__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu__item__value { margin-left: auto; color: var(--text-faint); font-weight: 500; font-size: 0.78rem; }
.menu__divider { height: 1px; background: var(--border); margin: 6px 4px; }
.menu__label {
  padding: 8px 10px 4px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Meter
   -------------------------------------------------------------------------- */

.meter {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-active);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease);
}
.meter__fill--warning { background: var(--warning); }
.meter__fill--danger { background: var(--danger); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 650;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tr:last-child td { border-bottom: none; }
.table td:last-child, .table th:last-child { text-align: right; }
.table--numeric td, .table--numeric th { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--bg-inset);
  color: var(--text-faint);
  margin-bottom: 14px;
}
.empty__title {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.empty__body { max-width: 44ch; margin: 0 auto; font-size: 0.9rem; }
.empty .btn { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Site chrome — marketing nav and footer
   -------------------------------------------------------------------------- */

.site {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.site__main { flex: 1 1 auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.nav__links {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
  font-size: 0.875rem;
}

.nav__link {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav__link:hover { background: var(--bg-hover); color: var(--text); }
.nav__link.is-active { color: var(--text); }

.nav__sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.02em;
  min-width: 0;
  text-decoration: none;
}

.brand__logo {
  height: 28px;
  width: auto;
  flex: 0 0 auto;
  display: block;
}

/* In dark mode the navy mark becomes white: the standard treatment for a
   single-colour mark on a dark surface. brightness(0) keeps the alpha channel
   intact so the edges stay crisp. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__logo { filter: brightness(0) invert(1); }
}
[data-theme="dark"] .brand__logo { filter: brightness(0) invert(1); }

.brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand__sub {
  display: block;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  margin-top: auto;
}
.footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 600; }
.footer__links { display: flex; gap: 4px; flex-wrap: wrap; }
.footer__links a {
  color: var(--text-faint);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
}
.footer__links a:hover { color: var(--text); background: var(--bg-hover); }

/* --------------------------------------------------------------------------
   Entrance — sign in, sign up, reset, and every other allauth screen
   -------------------------------------------------------------------------- */

.entrance {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 64px;
  position: relative;
}

.entrance__card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
}

.entrance__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  margin: 0 0 18px;
}
.entrance__mark img { height: 30px; width: auto; }

.entrance__title {
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.entrance__lede {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
  line-height: 1.5;
}
.entrance__card form { margin: 0; }
.entrance__card .field { margin-bottom: 14px; }
.entrance__card .stack > * + * { margin-top: 14px; }
.entrance__actions { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.entrance__actions .btn { width: 100%; min-height: 42px; }
.entrance__card h1 { font-size: 1.45rem; letter-spacing: -0.025em; margin-bottom: 6px; }
.entrance__card h2 { font-size: 0.95rem; margin: 0 0 10px; color: var(--text-muted); font-weight: 600; }
.entrance__card p { font-size: 0.9rem; color: var(--text-muted); }
.entrance__card hr { margin: 18px 0; }

.entrance__footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.entrance__meta {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.entrance__meta a { padding: 2px 6px; border-radius: var(--radius-xs); }
.entrance__meta a:hover { color: var(--text); background: var(--bg-hover); }

/* "or" divider between the password form and third-party providers. */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.providers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.providers .btn { width: 100%; justify-content: center; min-height: 42px; font-weight: 550; }
.providers .btn .icon { width: 18px; height: 18px; }

/* Decorative orbit rings behind an entrance card. Pure CSS, no images. */
.orbit-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orbit-bg::before,
.orbit-bg::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translate(-50%, -50%);
}
.orbit-bg::before { width: 680px; height: 680px; }
.orbit-bg::after { width: 1040px; height: 1040px; border-color: color-mix(in srgb, var(--accent) 8%, transparent); }
.orbit-bg__glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 720px;
  height: 520px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.entrance > *:not(.orbit-bg) { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Prose (legal and about pages)
   -------------------------------------------------------------------------- */

.prose { max-width: 68ch; }
.prose h1 { font-size: 2rem; margin-bottom: 8px; }
.prose h2 { font-size: 1.15rem; margin: 36px 0 10px; }
.prose h3 { font-size: 0.98rem; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }
.prose ul, .prose ol { padding-left: 20px; }
.prose .lede { font-size: 1.05rem; color: var(--text-muted); }
.prose__meta { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 28px; }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.stack > * + * { margin-top: 16px; }
.stack--sm > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.row--end { justify-content: flex-end; }
.row--center { justify-content: center; }
.row--tight { gap: 6px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions--end { justify-content: flex-end; }
.actions--center { justify-content: center; }
.actions--spaced { margin-top: 20px; }
.grow, .flex-1 { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.accent { color: var(--accent); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.74rem; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.tabular { font-variant-numeric: tabular-nums; }
.center, .text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.gap-3 { gap: 14px; }
.weight-normal { font-weight: 500; }
.entrance__mark--center { margin-left: auto; margin-right: auto; }
.entrance__mark--danger { background: var(--danger-soft); }
.grid-span { grid-column: 1 / -1; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-1 { padding-left: 8px; padding-right: 8px; }
.pt-2 { padding-top: 16px; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.shell { margin: 0 auto; width: 100%; }
.shell--xs { max-width: 420px; }
.shell--sm { max-width: 560px; }
.shell--md { max-width: 720px; }
.shell--lg { max-width: 960px; }

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

/* Eyebrow label above a heading. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Key/value definition rows. */
.kv { display: flex; flex-direction: column; gap: 0; }
.kv__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.kv__row:last-child { border-bottom: none; }
.kv__key { color: var(--text-muted); }
.kv__value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* --------------------------------------------------------------------------
   Motion, contrast and print
   -------------------------------------------------------------------------- */

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

@media (forced-colors: active) {
  .btn, .card, .badge, .menu__panel, .entrance__card, .avatar { border: 1px solid CanvasText; }
  .meter__fill { background: Highlight; }
  .icon-btn { border: 1px solid transparent; }
}

@media (max-width: 640px) {
  .nav { padding: 12px 16px; gap: 12px; }
  .nav__links { gap: 2px; }
  .nav__link { padding: 7px 8px; }
  .footer { padding: 22px 16px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .entrance { padding: 24px 16px 48px; }
  .entrance__card { padding: 24px 20px; border-radius: var(--radius-lg); }
}


/* ==========================================================================
   Orbit AI — application components
   ========================================================================== */

:root {
  --sidebar-width: 276px;
  --chat-width: 780px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell { height: 100vh; height: 100dvh; overflow: hidden; }

.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  transition: margin-left var(--dur-slow) var(--ease), visibility var(--dur-slow);
}

/* Desktop collapse. The sidebar slides under the left edge; the toggle in
   each page header brings it back. Persisted by app.js. */
@media (min-width: 861px) {
  .sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
    visibility: hidden;
  }
}

.sidebar__header {
  padding: 14px 12px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar__header .brand { gap: 9px; }
.sidebar__header .brand__logo { height: 26px; }

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 16px;
}

.sidebar__new { margin-bottom: 8px; }

.sidebar__section { margin-top: 18px; }

.sidebar__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 650;
  padding: 0 10px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sidebar__label a { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 0.74rem; }
.sidebar__label a:hover { color: var(--text); }

.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 10px;
  position: relative;
  z-index: 1;
}

.sidebar__empty {
  padding: 14px 10px;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.5;
}

/* Usage card in the footer. */
.usage {
  padding: 10px 12px 11px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.usage__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  margin-bottom: 7px;
}
.usage__plan { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.usage__amount { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.usage__note { font-size: 0.72rem; color: var(--text-faint); margin: 7px 0 0; line-height: 1.4; }

/* Account trigger. */
.account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.account-btn:hover,
.account-btn[aria-expanded="true"] { background: var(--bg-hover); border-color: var(--border); }
.account-btn__meta { flex: 1; min-width: 0; line-height: 1.2; }
.account-btn__name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn__sub { font-size: 0.72rem; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.account-btn > .icon { color: var(--text-faint); }

.sidebar__footer .menu__panel {
  left: 0;
  right: 0;
  min-width: 0;
}

/* --- Thread list items -------------------------------------------------- */

.thread-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.865rem;
  font-weight: 500;
  position: relative;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.thread-item:hover { background: var(--bg-hover); color: var(--text); }
.thread-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  font-weight: 600;
}
.thread-item__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-item__pin { color: var(--text-faint); display: inline-flex; }
.thread-item.is-active .thread-item__pin { color: var(--accent-soft-text); }
.thread-item .badge { margin-left: auto; }

.thread-item__menu {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-xs);
  flex: 0 0 auto;
  transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.thread-item__menu:hover { background: var(--bg-active); color: var(--text); }

/* --- Main column -------------------------------------------------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.main__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Generic page inside the shell (lists, settings, billing). */
.page {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 64px;
}
.page--wide { max-width: 1120px; }
.page--narrow { max-width: 680px; }

.page__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  min-height: 32px;
}
.page__top .sidebar-toggle { margin-left: -6px; }
.page__crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-faint);
  min-width: 0;
}
.page__crumbs a:hover { color: var(--text); }
.page__crumbs .icon { color: var(--border-strong); }

.page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page__header h1 { font-size: 1.6rem; margin: 0 0 4px; }
.page__header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.page__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page .messages { margin-bottom: 18px; }

.sidebar-toggle { display: inline-flex; }

/* --------------------------------------------------------------------------
   Chat
   -------------------------------------------------------------------------- */

.chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.chat__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  flex: 0 0 auto;
  min-height: 56px;
  position: relative;
  z-index: 5;
}

.chat__title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat__title .truncate { min-width: 0; }
.chat__title .badge { flex: 0 0 auto; }

.chat__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.chat__body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat__scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.chat__stream {
  max-width: var(--chat-width);
  margin: 0 auto;
  padding: 28px 28px 24px;
}

/* --- Empty state -------------------------------------------------------- */

.chat__greeting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52vh;
  text-align: center;
  padding: 24px 0;
}

.chat__greeting-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent-soft);
  margin-bottom: 8px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}
.chat__greeting-mark img { height: 32px; width: auto; }

.chat__greeting h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}
.chat__greeting-sub { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 14px; max-width: 42ch; }

.chat__suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 600px;
}

.chat__suggestion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.chat__suggestion:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.chat__suggestion .icon { color: var(--accent); margin-top: 2px; }
.chat__suggestion-body { min-width: 0; }
.chat__suggestion-title { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 2px; }
.chat__suggestion-sub { display: block; font-size: 0.78rem; color: var(--text-faint); line-height: 1.4; }

/* "Jump to latest" — appears when the reader scrolls up mid-stream. */
.chat__jump {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(6px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.chat__jump.is-visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

/* --- Turns -------------------------------------------------------------- */

.msg { margin-bottom: 26px; }

.msg--user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg--assistant {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}
.msg--assistant > :not(.msg__avatar) { grid-column: 2; }

.msg__avatar {
  grid-column: 1;
  grid-row: 1 / span 20;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e8eefa; /* the navy mark always sits on a light tile */
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(11, 42, 91, 0.08);
  position: sticky;
  top: 6px;
}
.msg__avatar img { width: 20px; height: auto; }

.msg__bubble {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-radius: var(--radius-xl);
  border-bottom-right-radius: 8px;
  padding: 11px 16px;
  max-width: min(80%, 48em);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.msg__content {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  white-space: normal;
  font-size: 0.95rem;
  line-height: 1.65;
  padding-top: 3px;
}
.msg__content > *:first-child { margin-top: 0; }
.msg__content > *:last-child { margin-bottom: 0; }

.msg__content h1, .msg__content h2, .msg__content h3,
.msg__content h4, .msg__content h5, .msg__content h6 { margin: 1.3em 0 0.5em; line-height: 1.3; }
.msg__content h1 { font-size: 1.3rem; }
.msg__content h2 { font-size: 1.15rem; }
.msg__content h3 { font-size: 1.02rem; }
.msg__content h4, .msg__content h5, .msg__content h6 { font-size: 0.95rem; }
.msg__content p { margin: 0 0 0.9em; }
.msg__content ul, .msg__content ol { margin: 0 0 0.9em; padding-left: 1.4em; }
.msg__content li { margin: 0.25em 0; }
.msg__content li::marker { color: var(--text-faint); }
.msg__content code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.4em;
  font-size: 0.84em;
}
.msg__content pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  overflow-x: auto;
  margin: 0 0 1em;
}
.msg__content pre code { background: none; border: none; padding: 0; font-size: 0.82rem; line-height: 1.6; }
.msg__content blockquote {
  margin: 0 0 1em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent-soft);
  color: var(--text-muted);
}
.msg__content table {
  width: 100%;
  font-size: 0.875rem;
  margin: 0 0 1em;
  display: block;
  overflow-x: auto;
  border-radius: var(--radius-sm);
}
.msg__content th, .msg__content td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.msg__content th { background: var(--bg-inset); font-weight: 650; }
.msg__content hr { margin: 1.2em 0; }
.msg__content a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.msg__content strong { font-weight: 650; }

.msg__error {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  max-width: 100%;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* --- Per-message actions ------------------------------------------------ */

.msg__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  opacity: 0.55;
  transition: opacity var(--dur-fast) var(--ease);
}
.msg--user .msg__actions { justify-content: flex-end; }
.msg__actions .icon-btn { width: 28px; height: 28px; }

@media (hover: hover) and (pointer: fine) {
  .msg__actions { opacity: 0; }
  .msg:hover .msg__actions,
  .msg:focus-within .msg__actions { opacity: 1; }
}

.msg__meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Reasoning ---------------------------------------------------------- */

.reasoning { margin: 4px 0 12px; max-width: 100%; }

.reasoning summary {
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  user-select: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.reasoning summary::-webkit-details-marker { display: none; }
.reasoning summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}
.reasoning[open] summary::before { animation: pulse 1.4s ease-in-out infinite; }
.reasoning summary:hover { background: var(--bg-hover); color: var(--text); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(0.6); opacity: 0.35; }
}

.reasoning__body {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 2px solid var(--accent-soft);
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(2, start) infinite;
  border-radius: 2px;
  margin-left: 2px;
}
@keyframes blink { to { visibility: hidden; } }

/* --- Composer ----------------------------------------------------------- */

.composer {
  flex: 0 0 auto;
  padding: 6px 28px 16px;
  background: linear-gradient(to bottom, transparent, var(--bg) 24%);
}

.composer__inner { max-width: var(--chat-width); margin: 0 auto; }

.composer__box {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  padding: 12px 12px 10px 16px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.composer__box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), var(--ring);
}

.composer__input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font: inherit;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--text);
  max-height: 240px;
  min-height: 26px;
  padding: 2px 0;
  display: block;
  box-shadow: none;
}
.composer__input:focus { outline: none; box-shadow: none; }
.composer__input::placeholder { color: var(--text-faint); }
.composer__input:disabled { background: transparent; opacity: 0.6; }

.composer__row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.composer__spacer { flex: 1; }

.composer__hint {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
  margin: 10px 0 0;
}
.composer__hint kbd { font-size: 0.68rem; padding: 0 0.4em; }

/* Selector pills in the composer. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  cursor: pointer;
  max-width: 240px;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.pill:hover { background: var(--bg-hover); color: var(--text); }
.pill[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-soft-text); }
.pill__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill__icon { display: inline-flex; color: var(--text-faint); }
.pill[aria-expanded="true"] .pill__icon { color: inherit; }
.pill__caret { display: inline-flex; opacity: 0.6; }

.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.send-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.send-btn:active { transform: none; }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; background: var(--accent); transform: none; }

.stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.stop-btn:hover { background: var(--bg-hover); }

/* --- Model / thinking dropdowns ----------------------------------------- */

.model-select,
.thinking-select { position: relative; min-width: 0; }

.model-select__panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: min(400px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
  display: none;
}
.model-select__panel.is-open { display: block; animation: menu-in-up var(--dur) var(--ease); }

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease);
}
.model-option:hover,
.model-option.is-active { background: var(--bg-hover); }
.model-option.is-selected { background: var(--accent-soft); color: var(--accent-soft-text); }
.model-option.is-selected .model-option__meta { color: var(--accent-soft-text); opacity: 0.75; }
.model-option__check { display: none; color: var(--accent-soft-text); }
.model-option.is-selected .model-option__check { display: inline-flex; }

.model-option__body { flex: 1; min-width: 0; }
.model-option__name {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-option__meta {
  display: block;
  font-size: 0.73rem;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.model-select__group {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 650;
  padding: 8px 10px 4px;
  position: sticky;
  top: -6px;
  background: var(--bg-raised);
  z-index: 1;
}
.model-select__empty { padding: 12px; margin: 0; }

/* --- Notice ------------------------------------------------------------- */

.notice {
  max-width: var(--chat-width);
  margin: 0 auto 8px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  border-radius: var(--radius);
  background: var(--warning-soft);
  font-size: 0.82rem;
  color: var(--text);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice > .icon { color: var(--warning); flex: 0 0 auto; margin-top: 2px; }

/* --------------------------------------------------------------------------
   Orbit list / search cards
   -------------------------------------------------------------------------- */

.orbit-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.orbit-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.orbit-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  flex: 0 0 auto;
}
.orbit-card__body { flex: 1; min-width: 0; }
.orbit-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.orbit-card__title { font-weight: 650; font-size: 0.95rem; letter-spacing: -0.01em; }
.orbit-card__title:hover { color: var(--accent); }
.orbit-card__preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orbit-card__preview--wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.orbit-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-faint);
}
.orbit-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.orbit-card .thread-item__menu { width: 30px; height: 30px; }

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filters .input-icon { flex: 1 1 220px; max-width: 320px; }

/* Section heading inside a page. */
.section-heading {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 650;
  margin: 28px 0 10px;
}
.section-heading:first-child { margin-top: 0; }

/* Settings form layout. */
.settings-section {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section__intro h2 { font-size: 1rem; margin-bottom: 4px; }
.settings-section__intro p { font-size: 0.82rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.settings-section__body .card { padding: 20px; }
.form-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

/* Plan summary strip on billing. */
.plan-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.plan-strip__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  flex: 0 0 auto;
}
.plan-strip__body { flex: 1; min-width: 0; }
.plan-strip__name { font-size: 1.05rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.plan-strip__sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.stat__label { font-size: 0.74rem; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat__value { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat__note { font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; }

/* --------------------------------------------------------------------------
   Marketing — landing, pricing, about
   -------------------------------------------------------------------------- */

.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.landing__glow {
  position: absolute;
  inset: 0 0 auto;
  height: 720px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(30% 40% at 85% 10%, color-mix(in srgb, var(--brand-bright) 10%, transparent), transparent 70%);
}
.landing > *:not(.landing__glow) { position: relative; z-index: 1; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; width: 100%; }

.hero {
  text-align: center;
  padding: 72px 0 40px;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 550;
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.hero__eyebrow .badge { padding: 1px 7px; }
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin: 0 auto 20px;
  max-width: 16ch;
  font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lede {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.6;
}
.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__note { font-size: 0.8rem; color: var(--text-faint); margin: 16px 0 0; }

/* Product preview: a static, illustrative render of the app. */
.preview {
  max-width: 980px;
  margin: 48px auto 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 420px;
}
.preview__side {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}
.preview__side .brand { font-size: 0.86rem; margin-bottom: 8px; padding-left: 4px; }
.preview__side .brand__logo { height: 20px; }
.preview__side .btn { min-height: 30px; font-size: 0.76rem; justify-content: flex-start; }
.preview__label { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 650; padding: 10px 8px 2px; }
.preview__item { padding: 6px 8px; border-radius: var(--radius-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__item.is-active { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 600; }
.preview__main { display: flex; flex-direction: column; min-width: 0; }
.preview__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
}
.preview__chat { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; gap: 18px; font-size: 0.84rem; }
.preview__chat .msg { margin: 0; }
.preview__chat .msg__bubble { font-size: 0.84rem; padding: 9px 13px; max-width: 70%; }
.preview__chat .msg__content { font-size: 0.84rem; line-height: 1.55; }
.preview__chat .msg__content p { margin: 0 0 0.6em; }
.preview__chat .msg__content ul { margin: 0; padding-left: 1.2em; }
.preview__composer {
  margin: 0 20px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 10px 10px 8px 14px;
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.preview__composer-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.preview__composer-row .pill { font-size: 0.72rem; padding: 4px 8px; }
.preview__composer-row .send-btn { width: 28px; height: 28px; margin-left: auto; }

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section__title { text-align: center; font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.03em; margin-bottom: 10px; }
.section__lede { text-align: center; color: var(--text-muted); margin: 0 auto 36px; max-width: 56ch; font-size: 1.02rem; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.feature {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .feature:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
}
.feature__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-soft-text);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: 0.88rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* Two-column feature spotlight. */
.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.spotlight h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); letter-spacing: -0.03em; }
.spotlight p { color: var(--text-muted); font-size: 1rem; }
.spotlight__list { list-style: none; padding: 0; margin: 20px 0 26px; display: grid; gap: 10px; }
.spotlight__list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--text); }
.spotlight__list .icon { color: var(--accent); margin-top: 3px; }

.spotlight__art {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}

/* Pricing */
.pricing {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
  max-width: 820px;
  margin: 0 auto;
}

.plan {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  background: var(--bg-raised);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.plan--featured { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.plan__name { font-size: 1.05rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.plan__price { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.04em; margin: 12px 0 2px; line-height: 1; }
.plan__period { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; letter-spacing: 0; margin-left: 2px; }
.plan__tagline { font-size: 0.9rem; color: var(--text-muted); margin: 8px 0 20px; }
.plan__features { list-style: none; padding: 0; margin: 0 0 24px; font-size: 0.9rem; flex: 1; display: grid; gap: 9px; }
.plan__features li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.plan__features .icon { color: var(--accent); margin-top: 3px; flex: 0 0 auto; }
.plan__ribbon {
  position: absolute;
  top: -12px;
  right: 22px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.plan .btn, .plan form { margin-top: auto; }
.plan form .btn { width: 100%; }

/* Final call to action band. */
.cta {
  text-align: center;
  padding: 48px 32px;
  border-radius: 24px;
  background: var(--accent);
  color: var(--accent-text);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cta h2 { color: inherit; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; }
.cta p { opacity: 0.8; max-width: 44ch; margin: 0 auto 22px; }
.cta .btn { background: var(--accent-text); color: var(--accent); border-color: transparent; }
.cta .btn:hover { filter: brightness(0.96); }

/* --------------------------------------------------------------------------
   Shared transcript (public, read-only)
   -------------------------------------------------------------------------- */

.transcript {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 8px 24px;
}
.turn {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.turn:last-child { border-bottom: none; }
.turn__avatar { flex: 0 0 auto; }
.turn__body { flex: 1; min-width: 0; }
.turn__meta { font-size: 0.74rem; font-weight: 650; color: var(--text-faint); margin-bottom: 4px; }
.turn__content {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.6;
}
.turn__content > *:first-child { margin-top: 0; }
.turn__content > *:last-child { margin-bottom: 0; }

/* Referenced by the allauth social-login provider icon. */
.provider-logo { max-height: 28px; width: auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease), visibility var(--dur-slow);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }

  .page { padding: 16px 16px 48px; }
  .page__header h1 { font-size: 1.4rem; }
  .chat__stream { padding: 20px 16px 12px; }
  .composer { padding: 6px 12px 12px; }
  .msg__bubble { max-width: 90%; }
  .msg--assistant { grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; }
  .msg__avatar { width: 26px; height: 26px; border-radius: 8px; }
  .msg__avatar img { width: 17px; }
  .chat__suggestions { grid-template-columns: 1fr; }
  .chat__greeting { min-height: 40vh; }
  .model-select__panel { width: min(360px, calc(100vw - 32px)); }
  .chat__header { padding: 8px 10px; gap: 6px; }
  .chat__actions .btn--responsive-hide { display: none; }
  .pill { max-width: 40vw; }

  .settings-section { grid-template-columns: 1fr; gap: 14px; padding: 22px 0; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 44px 0; }
  .preview { grid-template-columns: 1fr; min-height: 0; margin-top: 36px; }
  .preview__side { display: none; }
  .spotlight { grid-template-columns: 1fr; gap: 28px; }
  .pricing { grid-template-columns: 1fr; }
  .cta { padding: 36px 20px; border-radius: 18px; }
}

@media (max-width: 480px) {
  .hero__actions .btn { width: 100%; }
  .composer__hint { display: none; }
  .filters .input-icon { max-width: none; }
}

@media (forced-colors: active) {
  .composer__box, .model-select__panel, .orbit-card, .feature, .plan, .chat__suggestion { border: 1px solid CanvasText; }
  .msg__actions, .thread-item__menu { opacity: 1; }
  .msg--user .msg__bubble { border: 1px solid CanvasText; }
}

@media print {
  .sidebar, .composer, .chat__header, .msg__actions, .nav, .chat__jump { display: none !important; }
  body { background: #fff; color: #000; }
  .app, .chat { display: block; height: auto; }
  .chat__scroll { overflow: visible; }
}

/* --------------------------------------------------------------------------
   Small modifiers that replace one-off inline styles in templates
   -------------------------------------------------------------------------- */

.card--danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.card--narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.card--padded { padding: 40px 32px; }
.stat__value--text { font-size: 1.05rem; margin-top: 8px; }
.chat__greeting--compact { min-height: 0; padding: 24px 0 28px; }
.input--lg { min-height: 46px; font-size: 1rem; }
.input-icon > .input--lg { padding-left: 40px; }
.msg__avatar--static { position: static; }
.title--md { font-size: 1.7rem; }
.empty__icon--accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.empty__title--lg { font-size: 1.5rem; }
.footer__brand .brand__logo { height: 18px; }
.spotlight__art .msg { margin: 0; }
.spotlight__art .msg__content { font-size: 0.9rem; }
.transcript__empty { padding: 16px 0; }
