:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  --canvas: #09090b;
  --sidebar: var(--canvas);
  --surface: #111113;
  --surface-elevated: #1e1e21;
  --surface-subtle: #18181b;
  --input-bg: #0d0d0f;
  --ink: #f4f4f5;
  --ink-secondary: #d4d4d8;
  --muted: #a1a1aa;
  --line: #2d2d31;
  --line-strong: #525259;
  --soft-line: #232326;
  --accent: #2563eb;
  --accent-bright: #91b6ff;
  --accent-hover: #1d4ed8;
  --accent-soft: #22375c;
  --accent-ring: rgba(59, 130, 246, 0.25);
  --selected: #252529;
  --selected-ink: #f4f4f5;
  --unread-bg: #161618;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --danger-line: rgba(239, 68, 68, 0.28);
  --danger-ink: #fca5a5;
  --good-bg: rgba(16, 185, 129, 0.12);
  --good-line: rgba(16, 185, 129, 0.26);
  --good-ink: #6ee7b7;
  --brand-box: var(--input-bg);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 2px 10px -2px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 60px -15px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f4f5f7;
  --sidebar: #f9fafb;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-subtle: #f5f6f8;
  --input-bg: #fcfcfd;
  --ink: #161c27;
  --ink-secondary: #3a4659;
  --muted: #546174;
  --line: #dce1e8;
  --line-strong: #b8c3d0;
  --soft-line: #e8ebf0;
  --accent: #2563eb;
  --accent-bright: #2457c0;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf1ff;
  --accent-ring: rgba(37, 99, 235, 0.18);
  --selected: #e8edf6;
  --selected-ink: #1d3a70;
  --unread-bg: #f3f5f9;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --danger-ink: #b91c1c;
  --good-bg: #ecfdf5;
  --good-line: #a7f3d0;
  --good-ink: #047857;
  --brand-box: #090a0e;
  --shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-sm: 0 1px 3px rgba(9, 9, 11, 0.06), 0 1px 2px -1px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 20px 48px -12px rgba(9, 9, 11, 0.12), 0 0 0 1px rgba(9, 9, 11, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 300px;
  font-size: 0.9375rem;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
strong { font-weight: 600; }
time { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.icon { width: 1.0625rem; height: 1.0625rem; flex: 0 0 auto; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Launch / Loading */
.launch {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.launch-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  padding: 6px;
  background: var(--brand-box);
  border: 1px solid var(--line-strong);
}

/* Brand */
.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 680;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-box);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 5px;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text { display: grid; }
.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Buttons */
.button {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.855rem;
  font-weight: 550;
  box-shadow: var(--shadow-xs);
  transition: background-color 130ms var(--ease), border-color 130ms var(--ease), color 130ms var(--ease), transform 90ms var(--ease);
}
.button:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--line-strong);
  color: var(--ink);
}
.button:active:not(:disabled) { transform: translateY(0.5px); }
.button .icon { width: 15px; height: 15px; opacity: 0.85; }
.button.primary {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.button.primary .icon { opacity: 1; }
.button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #fff;
}
.button.danger-quiet {
  color: var(--danger-ink);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.button.danger-quiet:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger-line);
}
.icon-button { width: 38px; min-width: 38px; padding: 0; }
.icon-button .icon { width: 16px; height: 16px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 560;
}
.pill.good {
  background: var(--good-bg);
  border-color: var(--good-line);
  color: var(--good-ink);
}

/* Sign-in and registration */
.auth {
  --auth-border: var(--line);
  --auth-field-border: var(--line-strong);
  --auth-muted: var(--muted);
  --auth-link: var(--accent-bright);
  --auth-shadow: 0 14px 42px #0004;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--canvas);
}
:root[data-theme="light"] .auth {
  --auth-border: #dce3ef;
  --auth-field-border: #abb6cb;
  --auth-muted: #525f74;
  --auth-link: #1d4ed8;
  --auth-shadow: 0 14px 42px rgba(33, 53, 95, 0.07);
}
.auth-topbar,
.auth-layout {
  width: min(1120px, calc(100% - clamp(32px, 8vw, 96px)));
  margin-inline: auto;
}
.auth-topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-topbar .theme-toggle {
  width: 44px;
  min-height: 44px;
  background: var(--surface);
  border-color: var(--auth-border);
  color: var(--auth-muted);
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.74fr);
  grid-template-areas: "hero card";
  align-items: center;
  gap: clamp(28px, 6.5vw, 94px);
  padding-block: 28px 64px;
}
.auth-hero { grid-area: hero; }
.auth-hero h1 {
  font-size: clamp(2rem, 3.7vw, 3.3rem);
  line-height: 1.07;
  letter-spacing: -0.045em;
  font-weight: 740;
  text-wrap: balance;
}
.auth-hero p {
  max-width: 36ch;
  margin-top: 16px;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--auth-muted);
}
.auth-art {
  display: block;
  width: min(100%, 520px);
  height: auto;
  margin-top: 18px;
}
.auth-card {
  grid-area: card;
  min-width: 0;
  padding: clamp(26px, 3.4vw, 42px);
  background: var(--surface);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  box-shadow: var(--auth-shadow);
}
.auth-card-head { margin-bottom: 26px; }
.auth-card-head h2 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -0.035em;
}
.auth-card-head p {
  margin-top: 8px;
  color: var(--auth-muted);
}
.auth-form {
  display: grid;
  gap: 16px;
}
.auth-form .field { gap: 7px; }
.field-hint { color: var(--auth-muted); font-size: 0.8rem; line-height: 1.4; }
.auth-form :is(.input-box, .joined) {
  min-height: 48px;
  border-color: var(--auth-field-border);
}
.auth-form :is(.input-box, .joined):focus-within { border-color: var(--accent-bright); }
.auth-form .field :is(.input-box, .joined) input {
  min-height: 46px;
  font-size: 1rem;
}
.auth-form .field input::placeholder {
  opacity: 1;
  color: var(--auth-muted);
}
.auth-form .input-box .input-eye {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
}
.auth-form .input-eye:focus-visible { outline-offset: -4px; }
.auth-form > .button {
  min-height: 48px;
  margin-top: 4px;
  padding-block: 8px;
  border-radius: 9px;
  font-weight: 650;
  font-size: 0.95rem;
  white-space: normal;
}
.auth-switch {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--auth-border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--auth-muted);
}
.auth-switch .text-link {
  min-height: 36px;
  padding-inline: 4px;
  color: var(--auth-link);
  text-underline-offset: 3px;
}
.text-link {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 2px;
  min-height: auto;
  color: var(--accent-bright);
  font-weight: 620;
  font-size: inherit;
}
.text-link:hover:not(:disabled) {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.setup-help { font-size: 0.82rem; margin-top: 16px; text-align: center; }

/* Workspace navigation */
.shell {
  --page-gutter: clamp(24px, 3vw, 48px);
  --bar-height: 56px;
  --sidebar-width: 16rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}
.shell[data-sidebar="collapsed"] { --sidebar-width: 3.75rem; }
.rail {
  position: sticky;
  top: 0;
  display: grid;
  min-width: 0;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 8;
}
.rail-head, .rail-bottom { display: flex; min-width: 0; align-items: center; padding: 10px; }
.rail-head { justify-content: space-between; min-height: var(--bar-height); border-bottom: 1px solid var(--soft-line); }
.rail-head .brand { padding-inline: 4px; }
.rail-head .brand-mark { flex-shrink: 0; }
.rail-bottom { border-top: 1px solid var(--soft-line); }
.rail-head .rail-close { display: none; }
.rail-nav { overflow: auto; padding: 10px 8px; overscroll-behavior-y: contain; }
.rail-group-label { margin: 9px 8px 5px; color: var(--muted); font-size: .75rem; font-weight: 620; }
.rail-nav > div { margin-top: 16px; }
.rail-menu, .rail-sub, .rail-projects { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.rail .rail-item {
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  gap: 9px;
  padding: 6px 8px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
  text-align: left;
  font-size: .88rem;
  font-weight: 540;
}
.rail .rail-item:hover, .rail .rail-group-toggle:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }
.rail .rail-item.active, .rail .folder-item.selected, .rail-project[aria-current="page"] {
  background: var(--selected); color: var(--selected-ink); font-weight: 630;
}
.rail .rail-item.active .icon, .rail .rail-item[aria-current="page"] .icon { color: var(--accent-bright); }
.rail .rail-item .icon { width: 17px; height: 17px; }
.rail-label { flex: 1; }
.rail-group-heading { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 2px; border-radius: 7px; }
.rail-group-heading:has(.active) { background: var(--selected); }
.rail .rail-group-toggle {
  width: 100%; min-height: 36px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted);
}
.rail-group-toggle .icon { width: 14px; height: 14px; }
.rail-group-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.rail .rail-ai-caret { width: 14px; height: 14px; color: var(--muted); }
.rail-ai-entry[aria-expanded="true"] .rail-ai-caret { transform: rotate(90deg); }
.rail-group:has(#mail-folders:not([hidden])) .rail-group-heading .nav-count { display: none; }
.rail-sub { margin: 4px 0 6px 16px; padding-left: 8px; border-left: 1px solid var(--line); }
.rail-ai-categories { margin-inline-start: 18px; padding-inline-start: 9px; }
.rail-ai-history {
  margin-block: 6px 9px;
  margin-inline-start: 22px;
  padding-inline-start: 11px;
  border-inline-start-color: var(--line-strong);
}
.rail .folder-item { min-height: 32px; gap: 7px; font-size: .82rem; font-weight: 490; }
.rail .folder-item .icon { width: 15px; height: 15px; }
.rail-project { display: block; overflow: hidden; text-overflow: ellipsis; }
.rail .rail-project .icon { margin-right: 6px; }
.rail-sub-label { margin: 8px 7px 3px; color: var(--muted); font-size: .73rem; font-weight: 600; }
.nav-count {
  margin-left: auto;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .71rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.rail .account-button { min-height: 48px; gap: 9px; padding: 5px 3px; }
.rail .account-button:hover { background: var(--surface-subtle); }
.avatar {
  display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-subtle);
  color: var(--ink-secondary); font-size: .82rem; font-weight: 680;
}
.rail .avatar { border-radius: 8px; }
.profile-text { min-width: 0; flex: 1; }
.profile-text strong, .profile-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text strong { color: var(--ink); font-size: .84rem; font-weight: 590; }
.profile-text small { color: var(--muted); font-size: .74rem; }
.workspace { min-width: 0; }
.topbar {
  position: sticky; z-index: 9; top: 0; border-bottom: 1px solid var(--soft-line); background: var(--surface);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px; min-height: calc(var(--bar-height) - 1px); padding-inline: 14px;
}
.topbar .theme-control { margin-inline-start: auto; }
.topbar .icon-button {
  width: 36px; min-height: 36px; flex-shrink: 0; border-color: transparent; background: transparent; box-shadow: none;
}
.topbar .icon-button:hover:not(:disabled) { background: var(--surface-subtle); }
.topbar-divider { width: 1px; height: 20px; flex-shrink: 0; background: var(--line); }
.workspace-crumbs { min-width: 0; flex: 1; color: var(--muted); font-size: .875rem; }
.workspace-crumbs > ol { display: flex; align-items: center; gap: 9px; margin: 0; padding: 0; list-style: none; }
.workspace-crumbs > ol > li { display: inline-flex; min-width: 0; align-items: center; }
.workspace-crumbs [data-slot="breadcrumb-link"] { display: inline-flex; min-width: 0; align-items: center; gap: 5px; text-decoration: none; }
.workspace-crumbs [data-slot="breadcrumb-link"]:is(:hover, :focus-visible) { color: var(--ink); }
.workspace-crumbs a span, .breadcrumb-current > span {
  display: block; max-width: clamp(60px, 16vw, 240px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.workspace-crumbs .breadcrumb-current > span { max-width: min(45vw, 560px); color: var(--ink); font-weight: 550; }
.workspace-crumbs :is(.breadcrumb-home, .breadcrumb-more, [data-slot="breadcrumb-separator"]) { flex: none; }
.breadcrumb-home a > .icon { display: none; }
.breadcrumb-arrow { width: 13px; height: 13px; }
.breadcrumb-overflow { position: relative; }
.breadcrumb-overflow summary {
  display: grid; width: 25px; height: 25px; place-items: center; border-radius: 5px; cursor: pointer; list-style: none;
}
.breadcrumb-overflow summary:hover { color: var(--ink); background: var(--surface-subtle); }
.breadcrumb-overflow ul {
  position: absolute; top: 100%; z-index: 1; display: grid; width: max-content; max-width: 220px;
  gap: 4px; margin: 6px 0 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-elevated); box-shadow: var(--shadow-sm); list-style: none;
}
.nav-shade { display: none; }

@media (min-width: 761px) {
  .shell[data-sidebar="collapsed"] :is(.brand-text, .rail-label, .rail-group-label, .rail-group-toggle, .rail-sub, .rail-ai-caret,
    .rail-group-heading .nav-count, .profile-text, .profile-chevron) { display: none; }
  .shell[data-sidebar="collapsed"] .rail-head .brand { padding: 0; }
  .shell[data-sidebar="collapsed"] .rail-head, .shell[data-sidebar="collapsed"] .rail-bottom { justify-content: center; padding-inline: 6px; }
  .shell[data-sidebar="collapsed"] .rail .rail-item { justify-content: center; padding-inline: 0; }
  .shell[data-sidebar="collapsed"] .rail-group-heading { grid-template-columns: minmax(0, 1fr); }
}


/* Main Content & Panels */
.main-content { width: min(100%, 1340px); margin-inline: auto; padding: 27px var(--page-gutter) 48px; }
.main-content:focus { outline: none; }
.section-head {
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h1 {
  min-width: 0;
  font-size: clamp(1.6rem, 2.35vw, 2.15rem);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.032em;
  overflow-wrap: anywhere;
}
.head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.head-actions .button { min-height: 42px; }
.head-actions .primary { padding-inline: 15px; }
.loading { color: var(--muted); padding-block: 16px; font-size: 0.88rem; }

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-bar {
  min-height: 64px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.panel-bar h2 { font-size: 1rem; font-weight: 670; letter-spacing: -0.015em; }
.api-console {
  container: api-console / inline-size;
  --api-surface: #101720;
  --api-inset: #0d131b;
  --api-border: #303c4c;
  --api-side: clamp(16px, 3.2vw, 32px);
  --api-mono: ui-monospace, Consolas, "Liberation Mono", monospace;
  max-width: 1160px;
  margin-inline: auto;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--api-border);
  border-radius: 16px;
  background: var(--api-surface);
}
:root[data-theme="light"] .api-console {
  --api-surface: #fff;
  --api-inset: #f5f7fb;
  --api-border: #dce2eb;
}
.api-console-head, .api-console-actions, .api-base, .api-balance {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.api-console-head { padding: 27px var(--api-side) 21px; }
.api-console-head h1 { font-size: clamp(1.6rem, 2.5vw, 2rem); line-height: 1.14; font-weight: 700; letter-spacing: -.036em; }
.api-console-head p, .api-view-head p { margin-top: 5px; color: var(--muted); font-size: .88rem; }
.api-console-actions { flex-shrink: 0; gap: 8px; }
.api-console-actions .button, .api-console .icon-button { min-height: 40px; }
.api-overview {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  margin-inline: var(--api-side); border: 1px solid var(--api-border); border-radius: 10px; background: var(--api-inset);
}
.api-base, .api-balance { padding: 13px 14px; min-width: 0; }
.api-base { border-inline-end: 1px solid var(--api-border); }
.api-metric { display: grid; gap: 4px; min-width: 0; }
.api-metric > span, .api-balance-note { color: var(--muted); font-size: .77rem; }
.api-metric code { font: .87rem/1.45 var(--api-mono); overflow-wrap: anywhere; }
.api-metric strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.api-balance-note { text-align: end; }
.api-credit-button { white-space: nowrap; }
.api-tabs { display: flex; gap: 18px; padding-inline: var(--api-side); margin-top: 15px; border-bottom: 1px solid var(--api-border); }
.api-tab.button {
  position: relative; justify-content: center; min-height: 44px; padding-inline: 8px; border: 0;
  border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font-weight: 590;
}
.api-tab.button:hover { background: transparent; color: var(--ink); }
.api-tab.button[aria-selected="true"] { color: var(--ink); }
.api-tab[aria-selected="true"]::after {
  content: ""; position: absolute; inset: auto 6px -1px; height: 2px; border-radius: 3px 3px 0 0; background: var(--accent-bright);
}
.api-tab:focus-visible { z-index: 1; outline-offset: -3px; }
.api-view { min-width: 0; padding: 23px var(--api-side) 28px; border-radius: 0 0 16px 16px; }
.api-view:focus-visible { outline-offset: -3px; }
.api-view-head { margin-bottom: 16px; }
.api-view-head h2 { font-size: 1.12rem; line-height: 1.3; font-weight: 660; }
.api-integration-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: clamp(18px, 3vw, 30px); align-items: start; }
.api-endpoints :is(h2, h3), .api-request h2 { font-size: .91rem; font-weight: 650; }
.api-endpoint-list { display: grid; gap: 8px; margin-top: 10px; }
.api-endpoint.button {
  width: 100%; min-width: 0; min-height: 67px; justify-content: space-between; padding: 10px 12px;
  text-align: start; border-color: var(--api-border); background: var(--api-inset); box-shadow: none;
}
.api-endpoint.button:hover { border-color: var(--line-strong); }
.api-endpoint.button[aria-pressed="true"] { border-color: var(--accent-bright); color: var(--ink); }
.api-endpoint-copy { display: grid; gap: 5px; min-width: 0; }
.api-endpoint-path { display: flex; align-items: baseline; gap: 10px; font: .81rem/1.45 var(--api-mono); }
.api-endpoint-path code { overflow-wrap: anywhere; }
.api-method { min-width: 4ch; color: var(--accent-bright); font-weight: 700; }
.api-method[data-method="GET"] { color: var(--good-ink); }
.api-endpoint-detail { color: var(--muted); font-size: .79rem; font-weight: 430; }
.api-endpoint > .icon { width: 14px; flex-shrink: 0; color: var(--muted); }
.api-authentication { display: flex; align-items: start; gap: 10px; margin-top: 18px; padding: 12px 4px 0; border-top: 1px solid var(--api-border); }
.api-auth-icon { display: grid; flex-shrink: 0; place-items: center; width: 30px; height: 30px; border: 1px solid var(--api-border); border-radius: 7px; color: var(--accent-bright); }
.api-auth-icon .icon { width: 16px; height: 16px; }
.api-authentication p { margin-top: 3px; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.api-authentication code { color: var(--ink-secondary); font: .79rem var(--api-mono); }
.api-request { min-width: 0; background: var(--api-inset); border: 1px solid var(--api-border); border-radius: 11px; }
.api-request-head, .api-example-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px;
}
.api-request-head { border-bottom: 1px solid var(--api-border); }
.api-copy-example.button { min-height: 36px; background: transparent; box-shadow: none; }
.api-example-controls { padding-block: 9px; }
.api-languages { display: flex; align-items: center; gap: 3px; border: 1px solid var(--api-border); border-radius: 8px; padding: 3px; }
.api-language.button {
  min-height: 32px; padding: 3px 9px; border: 0; border-radius: 5px;
  background: transparent; color: var(--muted); box-shadow: none; font-size: .76rem; font-weight: 580;
}
.api-language.button:is(:hover, [aria-pressed="true"]) { background: var(--surface-subtle); color: var(--ink); }
.api-example-model { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: .78rem; }
.api-example-model select {
  max-width: 100%; min-width: 0; min-height: 36px; padding: 4px 8px; border: 1px solid var(--api-border);
  border-radius: 7px; background: var(--api-surface); color: var(--ink); font-size: .78rem;
}
.api-request pre, .api-example-unavailable { margin: 0; padding: 14px; border-top: 1px solid var(--api-border); }
.api-request pre {
  min-height: 168px; max-height: 360px; overflow: auto; color: var(--ink-secondary);
  font: .8rem/1.55 var(--api-mono); tab-size: 2; border-radius: 0 0 11px 11px;
}
.api-request pre code { font: inherit; }
.api-request pre:focus-visible { outline-offset: -3px; }
.api-example-unavailable { color: var(--muted); }
.api-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.api-model-card { min-width: 0; border: 1px solid var(--api-border); border-radius: 10px; background: var(--api-inset); }
.api-model-head { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 8px 12px; padding: 14px; border-bottom: 1px solid var(--api-border); }
.api-model-title h3 { font-size: .96rem; font-weight: 650; }
.api-model-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font: .74rem var(--api-mono); }
.api-model-id .icon-button { width: 40px; min-height: 40px; background: transparent; border-color: transparent; box-shadow: none; }
.api-model-id .icon { width: 15px; }
.api-model-status { display: flex; align-items: center; gap: 6px; padding-top: 3px; color: var(--muted); font-size: .75rem; }
.api-model-status[data-ready="true"] { color: var(--good-ink); }
.api-model-prices { margin: 0; padding: 5px 14px; }
.api-model-prices > div { display: flex; align-items: baseline; justify-content: space-between; gap: 11px; padding-block: 9px; }
.api-model-prices > div + div { border-top: 1px solid var(--api-border); }
.api-model-prices dt { color: var(--muted); font-size: .82rem; }
.api-model-prices dd { margin: 0; color: var(--ink); font-size: .87rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.api-table { width: 100%; border: 1px solid var(--api-border); border-radius: 10px; border-spacing: 0; background: var(--api-inset); text-align: left; font-variant-numeric: tabular-nums; }
.api-table :is(td, th) { padding: 10px 14px; }
.api-table th { color: var(--muted); font-size: .78rem; font-weight: 600; }
.api-table td { border-top: 1px solid var(--api-border); font-size: .86rem; overflow-wrap: anywhere; }
.api-table-keys :is(td, th):last-child, .api-table-usage :is(td, th):not(:first-child) { text-align: end; }
.api-row-title { display: grid; gap: 3px; }
.api-row-title :is(code, time) { color: var(--muted); font-size: .77rem; }
.api-revoke.button { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.api-revoke.button:hover { color: var(--danger-ink); background: var(--danger-soft); }
.api-mobile-label { display: none; }
.api-empty { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--api-border); border-radius: 10px; background: var(--api-inset); }
.api-empty h3 { font-size: .91rem; }
.api-empty p { margin-top: 3px; font-size: .82rem; color: var(--muted); }
.api-empty-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border: 1px solid var(--api-border); border-radius: 9px; color: var(--accent-bright); }
.api-secret { font-family: ui-monospace, Consolas, monospace; }
@container api-console (max-width: 720px) {
  .api-integration-layout { grid-template-columns: minmax(0, 1fr); }
  .api-authentication { margin-top: 12px; }
}
@container api-console (max-width: 540px) {
  .api-console-head { align-items: start; flex-wrap: wrap; padding-block: 19px 16px; }
  .api-overview { grid-template-columns: minmax(0, 1fr); }
  .api-base { border-inline-end: 0; border-bottom: 1px solid var(--api-border); }
  .api-balance { flex-wrap: wrap; gap: 8px; }
  .api-balance .api-metric strong { font-size: 1.12rem; white-space: nowrap; }
  .api-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-top: 11px; padding-inline: 6px; }
  .api-tab.button { min-width: 0; padding-inline: 1px; font-size: .81rem; }
  .api-view { padding-block: 17px 21px; }
  .api-request pre { min-height: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
  .api-table, .api-table tbody { display: block; }
  .api-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .api-table tbody tr { display: grid; position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px; }
  .api-table tbody tr + tr { border-top: 1px solid var(--api-border); }
  .api-table tbody td { border: 0; padding: 0; text-align: start; }
  .api-table-usage tbody td:not(:first-child) { text-align: start; }
  .api-table tbody td:first-child, .api-table-usage tbody td:last-child { grid-column: 1 / -1; }
  .api-table-keys tbody td:first-child { padding-inline-end: 43px; }
  .api-table-keys tbody td:last-child { position: absolute; inset: 6px 6px auto auto; }
  .api-mobile-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: .73rem; }
  .api-table td:first-child > .api-mobile-label, .api-table-keys td:last-child > .api-mobile-label { display: none; }
}
.data-toolbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.data-toolbar .search-form { flex: 1 1 180px; max-width: 350px; width: auto; min-width: 0; }
.toolbar-icon-group, .toolbar-actions { display: flex; align-items: center; gap: 6px; }
.toolbar-icon-group { padding-left: 8px; border-left: 1px solid var(--line); flex-shrink: 0; }
.toolbar-actions { flex-wrap: wrap; }
.toolbar-icon-group .button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.toolbar-icon-group .button[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected); }
.toolbar-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.count { color: var(--muted); font-size: 0.81rem; font-weight: 580; padding-inline: 4px; }

/* Empty States */
.empty {
  min-height: clamp(228px, 35vh, 326px);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 36px 20px;
  text-align: center;
}
.empty-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.empty-mark .icon { width: 24px; height: 24px; stroke-width: 1.65; }
.empty h2 { font-size: 1.05rem; font-weight: 660; color: var(--ink); }
.empty p { margin-top: 5px; color: var(--muted); max-width: 42ch; font-size: 0.855rem; line-height: 1.5; }
.empty .button { margin-top: 14px; }
.empty-illustrated {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  min-height: clamp(250px, 38vh, 350px);
  gap: clamp(20px, 4vw, 48px);
  text-align: left;
}
.empty-art {
  display: block;
  width: clamp(110px, 13vw, 158px);
  height: auto;
  aspect-ratio: 1;
  flex: 0 0 auto;
  object-fit: contain;
}
.empty-illustrated h2 { font-size: 1.28rem; letter-spacing: -0.02em; }
.empty-illustrated p { margin-top: 8px; }

/* Search */
.search-form {
  display: flex;
  align-items: center;
  gap: 2px;
  width: min(360px, 100%);
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--muted);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.search-form:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 7px 10px 7px 0;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.855rem;
}
.search-form input:focus-visible { outline: none; }
.search-form input::placeholder { color: var(--muted); opacity: 1; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form .button { border: 0; background: transparent; box-shadow: none; min-height: 40px; color: var(--muted); }
.search-form .button:focus-visible { outline-offset: -4px; }
.search-submit { order: -1; }

/* Mail */
.main-content.mail-main {
  width: 100%;
  height: calc(100dvh - var(--bar-height));
  min-height: 260px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.mail-main > :is(.loading, .empty) { margin: 0 var(--page-gutter); }
.mail-main .mail-heading { gap: 8px; margin: 0; padding: 14px var(--page-gutter); }
.mail-heading h1 { font-size: clamp(1.28rem, 2.2vw, 1.75rem); }
.mail-layout { display: grid; flex: 1; min-width: 0; min-height: 0; }
.mail-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--canvas);
  box-shadow: none;
}
.mail-layout :is(.mail-bar, .message-toolbar, .mail-table-footer) { flex: none; }
.mail-layout :is(.mail-scroll, .message-body) { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.mail-panel { container-type: inline-size; }
.mail-bar { border-top: 1px solid var(--line); }
.mail-bar .search-form { flex-basis: 105px; }
.mail-table { width: 100%; table-layout: fixed; border-spacing: 0; }
.mail-table :is(th, td) { padding: 0 12px; text-align: start; vertical-align: middle; }
.mail-columns th {
  position: sticky; top: 0; z-index: 2; height: 42px;
  border-bottom: 1px solid var(--line); background: var(--surface-subtle);
  color: var(--ink-secondary); font-size: .8rem; font-weight: 590;
}
.mail-table td { border-bottom: 1px solid var(--soft-line); }
.mail-table :is(.mail-select-cell, .mail-star-cell, .mail-actions-cell) { width: 42px; padding: 0; text-align: center; }
.mail-table .mail-col-status { width: 98px; }
.mail-table .mail-col-sender { width: 22%; }
.mail-table .mail-col-date { width: 115px; text-align: end; white-space: nowrap; color: var(--muted); }
.mail-table input[type="checkbox"], .mail-toggle-column input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.mail-table input[type="checkbox"] { cursor: pointer; }
.mail-table .mail-sort {
  max-width: 100%; min-height: 32px; gap: 5px; padding: 0; border-color: transparent;
  background: transparent; color: inherit; box-shadow: none; font-size: inherit; font-weight: inherit;
}
.mail-sort.descending svg { transform: rotate(180deg); }
.mail-table .mail-sort:hover { color: var(--ink); background: transparent; border-color: transparent; }
.mail-panel[data-hide-status] .mail-col-status,
.mail-panel[data-hide-sender] :is(.mail-col-sender, .mail-mobile-origin) { display: none; }
.mail-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; font-size: .78rem; }
.mail-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.unread .mail-status { color: var(--ink-secondary); }
.unread .mail-status::before { background: var(--accent-bright); }
.mail-row { cursor: pointer; transition: background-color 120ms var(--ease); }
.mail-row.unread { background: var(--unread-bg); }
.mail-row:hover, .mail-row:focus-within { background: var(--surface-subtle); }
.mail-row[data-selected] { background: var(--selected); }
.mail-star-cell .button, .mail-row-menu summary { width: 34px; min-width: 34px; min-height: 34px; border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.mail-star-cell .button:hover, .mail-row-menu summary:hover, .mail-row-menu[open] summary { color: var(--ink); background: var(--surface-subtle); }
.starred .icon { color: #f59e0b; fill: rgba(245, 158, 11, 0.28); }
.message-row {
  display: flex; width: 100%; align-items: center; gap: 9px;
  min-height: 52px; padding: 6px 0; text-align: start; border: 0;
  background: transparent; color: var(--ink);
}
.message-row:hover { color: var(--accent-bright); }
.message-row:focus-visible { outline-offset: -3px; border-radius: 6px; }
.message-from { display: flex; align-items: center; min-width: 0; gap: 10px; }
.message-from .avatar { width: 29px; height: 29px; flex: none; border: 0; }
.message-summary { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.mail-mobile-origin { display: none; }
.mail-attachment-mark { display: inline-flex; flex: none; color: var(--muted); }
.message-summary strong { flex: 0 1 auto; }
.message-summary small { flex: 1 2 10ch; }
.message-sender, .message-summary strong, .message-summary small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.message-sender { font-size: 0.875rem; color: var(--ink-secondary); }
.message-summary strong { font-size: 0.9rem; font-weight: 560; }
.unread .message-sender { font-weight: 660; color: var(--ink); }
.unread .message-summary strong { font-weight: 660; color: var(--ink); }
.message-summary small { margin-top: 1px; color: var(--muted); font-size: 0.79rem; }
.mail-col-date time { font-size: .78rem; }
.mail-panel[data-density="compact"] .message-row { min-height: 40px; padding-block: 5px; }
.mail-panel[data-density="compact"] :is(.message-from .avatar, .message-summary small) { display: none; }
.mail-table-menu { position: relative; }
.mail-column-menu { margin-inline-start: auto; }
.mail-bar .toolbar-count + .mail-column-menu { margin-inline-start: 0; }
.mail-column-menu summary > .icon:last-child { width: 12px; height: 12px; }
.mail-row-menu .menu-popup { text-align: start; }
.mail-row:nth-last-child(-n + 4):nth-child(n + 5) .mail-row-menu .menu-popup { top: auto; bottom: calc(100% + 3px); }
.mail-toggle-column { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; font-size: .83rem; cursor: pointer; }
.mail-toggle-column:hover { background: var(--surface-subtle); }
.mail-table-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .79rem; }
.mail-table-paging, .mail-table-paging label, .mail-bulk { display: flex; align-items: center; gap: 6px; }
.mail-table-paging { margin-inline-start: auto; white-space: nowrap; }
.mail-table-paging select { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.mail-table-paging .icon-button { width: 32px; min-width: 32px; min-height: 32px; }
.mail-bulk .button { min-height: 32px; padding-inline: 8px; font-size: .79rem; }
.message-toolbar { position: relative; z-index: 1; justify-content: space-between; }
.message-toolbar .button { min-height: 38px; }
.message-toolbar .inline-actions { gap: 4px; }
.message-toolbar .icon-button { background: transparent; border-color: transparent; box-shadow: none; }
.message-options { position: relative; }
.message-options .menu-popup { min-width: 196px; max-width: calc(100vw - 66px); }
.message-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; justify-items: start; padding: clamp(16px, 3vw, 36px); }
.message-body h1 {
  font-size: clamp(1.34rem, 2.25vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.18;
  overflow-wrap: anywhere;
  scroll-margin-top: calc(var(--bar-height) + 14px);
}
.message-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.message-meta .avatar { width: 40px; height: 40px; border: 0; }
.message-people > span { display: block; }
.message-meta span:not(.avatar), .message-meta p, .message-meta time { color: var(--muted); font-size: 0.81rem; overflow-wrap: anywhere; }
.message-meta time { text-align: right; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; color: var(--ink-secondary); }
.mail-message-text { width: 100%; font-size: 0.95rem; line-height: 1.7; }
.delivery {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}
.delivery small { display: block; color: var(--muted); }
.attachment-list { display: flex; gap: 8px; flex-wrap: wrap; max-width: 100%; }
.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  text-decoration: none;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.attachment:hover { border-color: var(--line-strong); background: var(--surface-elevated); }
.attachment .icon { width: 15px; height: 15px; color: var(--accent-bright); }
.attachment small { color: var(--muted); white-space: nowrap; }
.attachment .button { margin-right: -8px; border: 0; background: transparent; box-shadow: none; }
.pagination { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-size: 0.82rem; }

/* Drive */
.drive-table { border-inline: 2px solid transparent; min-height: 110px; transition: background-color 140ms var(--ease), border-color 140ms var(--ease); }
.drive-table.drop-target { background: var(--accent-soft); border-color: var(--accent-bright); }
.drive-table[data-layout="grid"]:has(.file-row) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 175px), 1fr));
  gap: 12px;
  padding: 16px;
}
.drive-table[data-layout="grid"] .file-head { display: none; }
.file-head, .file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 0.24fr) minmax(96px, 0.25fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 4px 14px;
}
.file-head {
  font-size: 0.72rem;
  font-weight: 640;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 14px 10px 22px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
}
.file-row { min-height: 58px; font-size: 0.84rem; color: var(--muted); transition: background-color 120ms var(--ease); }
.file-row:hover { background: var(--surface-subtle); }
.file-row + .file-row { border-top: 1px solid var(--soft-line); }
.file-row .file-title {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 540;
}
.file-row .file-title:hover {
  background: var(--selected);
  border-color: transparent;
  color: var(--ink);
}
.file-mark {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
}
.file-mark.folder-mark { color: var(--accent-bright); background: var(--accent-soft); }
.file-row .file-title { min-width: 0; min-height: 44px; gap: 10px; padding-inline: 6px; }
.file-name { min-width: 0; }
.drive-table[data-layout="grid"] .file-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  min-height: 128px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  font-size: 0.76rem;
}
.drive-table[data-layout="grid"] .file-row:hover { border-color: var(--line-strong); }
.drive-table[data-layout="grid"] .file-title {
  grid-area: 1 / 1 / 2 / -1;
  flex-direction: column;
  align-items: flex-start;
  min-height: 84px;
  padding: 4px 6px;
  gap: 9px;
}
.drive-table[data-layout="grid"] .file-mark { width: 42px; height: 42px; border-radius: 10px; background: var(--surface); }
.drive-table[data-layout="grid"] .folder-mark { background: var(--accent-soft); }
.drive-table[data-layout="grid"] .file-mark .icon { width: 21px; height: 21px; }
.drive-table[data-layout="grid"] .file-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.drive-table[data-layout="grid"] .file-size { grid-area: 2 / 1; padding-left: 6px; }
.drive-table[data-layout="grid"] .file-row time { grid-area: 2 / 2; padding-right: 6px; }
.file-menu { position: relative; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.file-menu summary { border-color: transparent; background: transparent; box-shadow: none; }
.file-menu[open] summary { background: var(--selected); }
.drive-table[data-layout="grid"] .file-menu { position: static; grid-area: 1 / 2; justify-self: end; }
.menu-popup {
  position: absolute;
  right: 0;
  top: 42px;
  z-index: 5;
  min-width: 192px;
  padding: 5px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-elevated);
  box-shadow: var(--shadow-lg);
}
.menu-popup .button { justify-content: flex-start; border-color: transparent; background: transparent; box-shadow: none; min-height: 34px; font-size: 0.83rem; }
.menu-popup .button:hover { background: var(--surface-subtle); }
.drive-table[data-layout="grid"] .menu-popup { inset: 48px 7px auto; min-width: 0; }
.drive-table[data-layout="grid"] .menu-popup .button { text-align: left; white-space: normal; padding-block: 5px; }
.usage { width: min(290px, 100%); display: grid; gap: 7px; color: var(--muted); font-size: 0.81rem; }
.usage span { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.usage strong { color: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.usage progress {
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  accent-color: var(--accent-bright);
}
.usage progress::-webkit-progress-bar { background: var(--line); }
.usage progress::-webkit-progress-value { background: var(--accent-bright); }
.usage progress::-moz-progress-bar { background: var(--accent-bright); }
.upload-status { padding: 10px 16px; color: var(--accent-bright); font-weight: 540; font-size: 0.85rem; }
.share-result, .folder-picker { display: grid; gap: 8px; }
.folder-picker .picker-folder { justify-content: flex-start; white-space: normal; overflow-wrap: anywhere; text-align: left; }

/* Estúdio de sites */
.main-content.studio-main {
  width: 100%;
  height: calc(100dvh - var(--bar-height));
  min-height: 360px;
  padding: 0;
}
.studio-workspace {
  --studio-canvas: var(--canvas);
  --studio-rail: var(--sidebar);
  --studio-chat-width: 49rem;
  --studio-gutter: clamp(18px, 3.6vw, 52px);
  display: grid;
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--studio-canvas);
}
:root[data-theme="light"] .studio-workspace {
  --studio-canvas: #fbfcfe;
  --studio-rail: #f5f7fa;
}
.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
}
.studio-heading, .studio-header-actions, .studio-side-heading, .studio-preview-bar, .studio-preview-site-actions, .studio-preview-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.studio-heading-icon {
  display: grid;
  flex-shrink: 0;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-bright);
}
.studio-heading h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 660;
}
.studio-header-actions { flex-shrink: 0; gap: 7px; }
.studio-workspace .studio-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
}
.studio-workspace .studio-quiet:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }
.studio-results-toggle[aria-expanded="true"], .studio-preview-actions [aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--selected);
  color: var(--selected-ink);
}
.studio-body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
}
.studio-workspace[data-pane="results"] .studio-body {
  grid-template-columns: minmax(0, 1fr) clamp(258px, 24vw, 322px);
}
.studio-workspace[data-pane="preview"] .studio-body {
  grid-template-columns: minmax(255px, 0.8fr) minmax(440px, 1.25fr);
}
.studio-editor { display: grid; min-width: 0; min-height: 0; }
.studio-chat {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}
.studio-conversation { overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.studio-conversation:focus-visible { outline-offset: -3px; }
.studio-thread, .studio-composer {
  width: min(100%, var(--studio-chat-width));
  margin-inline: auto;
}
.studio-thread {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 23px;
  padding: 36px var(--studio-gutter) 30px;
}
.studio-entries { display: flex; flex: 1 0 auto; flex-direction: column; }
.studio-empty-chat {
  display: flex;
  min-height: 180px;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-bottom: clamp(0px, 8vh, 72px);
  text-align: center;
}
.studio-waiting .studio-empty-chat, .studio-waiting .studio-entries:has(.studio-empty-chat) { display: none; }
.studio-waiting .studio-entries { flex: 0 0 auto; }
.studio-empty-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 7px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  color: var(--accent-bright);
}
.studio-empty-mark .icon { width: 24px; height: 24px; }
.studio-empty-chat h2 { font-size: clamp(1.42rem, 2.6vw, 1.95rem); font-weight: 640; letter-spacing: -0.025em; }
.studio-empty-chat p { max-width: 37ch; color: var(--muted); }
.studio-turn {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}
.studio-entries .studio-turn + .studio-turn { margin-top: 23px; }
.studio-turn-copy { min-width: 0; color: var(--ink-secondary); }
.studio-turn-copy p { overflow-wrap: anywhere; white-space: pre-wrap; }
.studio-turn-copy strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 0.875rem; }
.studio-turn-copy small { display: block; margin-top: 4px; color: var(--muted); }
.studio-turn[data-author="user"] {
  align-self: flex-end;
  max-width: min(86%, 560px);
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 4px 14px;
  background: var(--surface-subtle);
}
.studio-turn[data-author="user"] .studio-turn-copy { color: var(--ink); }
.studio-assistant-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}
.studio-reply-pending { color: var(--muted); }
.studio-trace {
  --trace-line: var(--line-strong);
  width: min(100%, 31rem);
  margin: 9px 0 3px;
  color: var(--muted);
  font-size: .82rem;
}
.studio-trace > summary, .trace-step-trigger {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
.studio-trace > summary { padding: 3px 6px; }
.studio-trace summary:hover { color: var(--ink); }
.studio-trace summary::-webkit-details-marker, .breadcrumb-overflow summary::-webkit-details-marker { display: none; }
.trace-chevron, .trace-step-chevron { width: 13px; height: 13px; transition: transform 140ms ease-out; }
.studio-trace[open] > summary .trace-chevron, .trace-item[open] .trace-step-chevron { transform: rotate(90deg); }
.trace-label { min-width: 0; font-weight: 560; }
.trace-count { color: var(--muted); font-size: .73rem; }
.trace-count::before { content: '·'; margin-right: 7px; }
.trace-pixels { display: grid; grid-template-columns: repeat(3, 3px); gap: 1.5px; margin-left: 1px; color: var(--accent-bright); }
.trace-pixels i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .68; }
.trace-steps {
  display: grid; margin: 1px 0 7px 12px; padding: 0 0 0 17px;
  border-left: 1px solid var(--trace-line); list-style: none;
}
.trace-steps:empty { display: none; }
.trace-steps li { position: relative; min-width: 0; }
.trace-steps li::before {
  position: absolute; top: 8px; left: -18px; width: 13px; height: 8px;
  border-bottom: 1px solid var(--trace-line); border-left: 1px solid var(--trace-line); border-bottom-left-radius: 6px;
  pointer-events: none; content: '';
}
.trace-step-trigger { padding: 2px 5px 2px 0; }
.trace-step-trigger:hover .trace-step-label, .trace-item[open] .trace-step-label { background: var(--surface-subtle); }
.trace-step-label { min-width: 0; padding: 2px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.trace-step-icon, .trace-check { width: 14px; height: 14px; }
.trace-check { color: var(--good-ink); margin-left: auto; }
.trace-steps li[aria-current="step"] { color: var(--ink); }
.trace-steps li[aria-current="step"] .trace-step-icon { color: var(--accent-bright); }
.trace-steps li[aria-current="step"] .trace-check { opacity: 0; }
.studio-turn-copy .trace-step-detail { padding: 1px 8px 9px 27px; color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: no-preference) {
  .trace-pixels i { animation: trace-pixel 1.4s ease-in-out infinite; }
  .trace-pixels i:nth-child(3n + 1) { animation-delay: -.3s; }
  .trace-pixels i:nth-child(3n + 2) { animation-delay: -.65s; }
  .trace-pixels i:nth-child(4n) { animation-delay: -.9s; }
  @keyframes trace-pixel { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
}

.studio-partial-reply { margin-top: 9px; }
.studio-partial-reply p::after {
  display: inline-block;
  width: .38em;
  height: .85em;
  margin-left: .18em;
  border-radius: 2px;
  background: currentColor;
  opacity: .65;
  content: '';
}
.studio-turn-copy code { padding: 1px 4px; border-radius: 4px; background: var(--surface-subtle); }
.studio-inline-result { margin-top: 10px; box-shadow: none; }
.studio-composer-dock { position: relative; z-index: 2; min-width: 0; padding: 0 var(--studio-gutter) 22px; }
.studio-composer {
  --composer-base: var(--surface);
  --composer-focus: var(--surface-subtle);
  --composer-panel: var(--surface-elevated);
  --composer-hover: #ffffff0c;
  --composer-ring: #ffffff0f;
  --composer-submit: var(--ink);
  --composer-submit-ink: var(--canvas);
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 11px 12px 8px;
  border: 1px solid var(--composer-ring);
  border-radius: 17px;
  background: var(--composer-base);
  box-shadow: 0 9px 24px #0003;
  transition: background-color 130ms ease, border-color 130ms ease;
}
:root[data-theme="light"] .studio-composer {
  --composer-base: #fff;
  --composer-focus: #fff;
  --composer-panel: #fff;
  --composer-hover: #edf1f7;
  --composer-ring: #dbe2ec;
  --composer-submit: #20283a;
  --composer-submit-ink: #fff;
  box-shadow: 0 7px 22px #303a5210;
}
.studio-composer:focus-within { background: var(--composer-focus); border-color: color-mix(in srgb, var(--line-strong) 75%, transparent); }
.studio-composer.is-dragging { border-color: var(--accent-bright); background: var(--accent-soft); }
.studio-composer textarea {
  display: block;
  width: 100%;
  min-height: 32px;
  max-height: min(26dvh, 152px);
  padding: 3px 4px 4px;
  overflow-y: auto;
  field-sizing: content;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .975rem;
  line-height: 1.5;
}
.studio-composer textarea::placeholder { color: var(--muted); }
.studio-composer-bar, .studio-composer-settings, .studio-composer-actions {
  display: flex; min-width: 0; align-items: center; gap: 5px;
}
.studio-composer-bar { position: relative; justify-content: space-between; gap: 7px; }
.studio-composer-settings { flex-wrap: wrap; }
.studio-composer-actions { flex-shrink: 0; }
.studio-model-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.studio-control { display: flex; min-width: 0; }
.studio-composer .studio-control-button {
  gap: 5px; min-height: 32px; min-width: 0; padding: 4px 6px; border-color: transparent;
  background: transparent; color: var(--ink-secondary); font-size: .8rem; font-weight: 550; box-shadow: none;
}
.studio-control-button > .icon { width: 14px; height: 14px; color: var(--muted); }
.studio-control-button .studio-control-caret { width: 10px; height: 10px; }
.studio-composer .studio-control-button:hover:not(:disabled), .studio-composer .studio-control-button[aria-expanded="true"] {
  background: var(--composer-hover); color: var(--ink);
}
.studio-control-button[aria-expanded="true"] .studio-control-caret { transform: rotate(180deg); }
.studio-composer .studio-model-button { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.studio-model-logo { width: 15px; height: 20px; flex: none; overflow: hidden; border-radius: 6px; }
.studio-model-logo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left; }
:root:not([data-theme="light"]) .studio-model-logo:not(.studio-model-logo-openai) img { mix-blend-mode: screen; }
.studio-model-logo-openai { position: relative; }
.studio-model-logo-openai img {
  position: absolute; inset: 50% auto auto 50%; width: 27px; height: 27px;
  object-fit: contain; object-position: center; transform: translate(-50%, -50%);
}
:root[data-theme="light"] .studio-model-logo-dark,
:root:not([data-theme="light"]) .studio-model-logo-light { display: none; }
.studio-popover {
  position: absolute; inset: auto auto calc(100% + 9px) 0; z-index: 3;
  width: min(100%, 18.75rem); max-height: min(55dvh, 19rem); padding: 6px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px; background: var(--composer-panel); box-shadow: var(--shadow-lg);
}
.studio-model-picker {
  --model-card: var(--canvas);
  --model-divider: #27272a;
  --model-hover: #27272ad9;
  --model-caption: #a1a1aa;
  display: flex;
  width: min(100%, 17.5rem);
  max-height: min(62dvh, 27rem);
  padding: 4px;
  flex-direction: column;
  overflow: hidden;
  border-color: var(--model-divider);
  border-radius: 9px;
  background: var(--model-card);
}
:root[data-theme="light"] .studio-model-picker {
  --model-card: #fff;
  --model-divider: var(--line);
  --model-hover: var(--composer-hover);
  --model-caption: var(--muted);
}
.studio-model-search {
  display: flex;
  min-width: 0;
  min-height: 39px;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 6px;
  border-bottom: 1px solid var(--model-divider);
  color: var(--model-caption);
}
.studio-model-search .icon { width: 14px; height: 14px; }
.studio-model-search input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: .8125rem;
}
.studio-model-search input::placeholder { color: var(--model-caption); }
.studio-model-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-block: 4px; }
.studio-model-provider { padding: 4px 8px; color: var(--model-caption); font-size: .6875rem; font-weight: 550; }
.studio-model-group:not([hidden]) + .studio-model-group:not([hidden]) { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--model-divider); }
.studio-model-empty { padding: 14px 8px; color: var(--model-caption); font-size: .8125rem; text-align: center; }
.studio-composer .studio-model-item {
  display: flex;
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: .844rem;
  font-weight: 550;
  text-align: left;
  box-shadow: none;
}
.studio-composer .studio-model-item:not(:disabled):is(:hover, :focus-visible) { background: var(--model-hover); }
.studio-composer .studio-model-item:disabled { color: var(--model-caption); opacity: 1; }
.studio-model-unavailable {
  flex: none; margin-inline-start: auto; padding: 1px 5px; border: 1px solid var(--model-divider);
  border-radius: 5px; color: var(--model-caption); font-size: .66rem; font-weight: 500;
}
.studio-model-item .studio-model-check { width: 16px; height: 16px; margin-left: auto; }
.studio-effort-footer {
  flex: none;
  padding: 9px 8px 5px;
  border-top: 1px solid var(--model-divider);
}
.studio-effort-caption { display: flex; align-items: baseline; gap: 7px; margin-bottom: 4px; color: var(--model-caption); font-size: .77rem; }
.studio-effort-caption strong { color: var(--ink); font-size: .82rem; }
.studio-effort-track {
  --effort-fill: 13px;
  --effort-gradient: linear-gradient(90deg, #42bf86, #00b9b7 46%, #1584ff);
  --effort-inactive: color-mix(in srgb, var(--model-card) 72%, var(--model-caption));
  position: relative;
}
.studio-effort-track[data-level="balanced"] { --effort-fill: 50%; }
.studio-effort-track[data-level="deep"] { --effort-fill: 100%; }
.studio-effort-track::before {
  position: absolute;
  inset: 6px 0;
  border-radius: 999px;
  background: linear-gradient(to right, transparent var(--effort-fill), var(--effort-inactive) var(--effort-fill)), var(--effort-gradient);
  pointer-events: none;
  content: '';
}
.studio-effort-stops {
  position: absolute;
  inset: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.studio-effort-stops i { width: 4px; height: 4px; border-radius: 50%; background: #ffffff80; }
.studio-effort-slider {
  position: relative;
  display: block;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: transparent;
  cursor: grab;
}
.studio-effort-slider:active { cursor: grabbing; }
.studio-effort-slider::-webkit-slider-runnable-track { height: 24px; background: transparent; }
.studio-effort-slider::-webkit-slider-thumb {
  width: 28px; height: 28px; margin-top: -2px; border: 0; border-radius: 50%; appearance: none;
  background: #fff; box-shadow: 0 2px 5px #10151d50;
}
.studio-effort-slider::-moz-range-track { height: 24px; background: transparent; }
.studio-effort-slider::-moz-range-thumb {
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px #10151d50;
}
.studio-turn-result { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.studio-turn-result .button { min-height: 34px; font-size: .8rem; box-shadow: none; }

.studio-composer-status { margin: 0 4px; color: var(--muted); font-size: .8rem; }
.studio-composer .form-error { padding: 6px 8px; }
.studio-composer .studio-attach { min-width: 36px; min-height: 36px; border-radius: 50%; }
.studio-composer .studio-send {
  min-width: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 50%; box-shadow: none;
  background: var(--composer-submit); color: var(--composer-submit-ink);
}
.studio-composer .studio-send:hover:not(:disabled) { background: var(--accent-bright); color: var(--composer-submit-ink); }
.studio-composer .studio-send:disabled { background: var(--composer-hover); color: var(--muted); opacity: .68; }

.studio-source-chip {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  margin: 2px 0 3px 5px;
  padding-inline: 8px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-secondary);
  font-size: 0.8rem;
}
.studio-source-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-source-chip .icon-button { width: 30px; min-height: 30px; }
.studio-results, .studio-preview {
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--studio-rail);
}
.studio-results { overflow-y: auto; overscroll-behavior-y: contain; }
.studio-output, .studio-sources { padding: 15px 15px 18px; }
.studio-sources { border-top: 1px solid var(--line); }
.studio-side-heading { justify-content: space-between; margin-bottom: 8px; }
.studio-side-heading h2, .studio-preview-bar h2, .studio-manual-head h2 { font-size: 0.92rem; font-weight: 660; }
.studio-side-heading .icon-button { width: 34px; min-height: 34px; }
.studio-side-empty { color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; }
.studio-projects:empty { display: none; }
.studio-results input[type="search"] {
  width: 100%;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--studio-canvas);
  color: var(--ink);
  font-size: 0.85rem;
}
.studio-projects { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.studio-project-button.button {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 7px;
  text-align: left;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.studio-project-button.button:is(:hover, [aria-current="true"]) { background: var(--surface-subtle); }
.studio-project-copy { display: grid; flex: 1; min-width: 0; gap: 1px; }
.studio-project-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.studio-project-copy small { color: var(--muted); font-size: 0.75rem; font-weight: 450; white-space: normal; }
.studio-project-chevron { color: var(--muted); }
.studio-site-thumbnail {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-bright);
}
.studio-site-thumbnail[data-theme-name="clay"] { background: #ba684722; color: #c68369; }
.studio-site-thumbnail[data-theme-name="garden"] { background: #31835b22; color: #68a98b; }
.studio-site-thumbnail[data-theme-name="night"] { background: #8f81ac22; color: #a192c0; }
.studio-artifact { display: grid; gap: 12px; padding: 14px; }
.studio-live-artifacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-block: 10px; min-width: 0; }
.studio-live-note, .studio-live-file { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.studio-live-note { padding: 9px 11px; }
.studio-live-note p { margin-top: 4px; color: var(--muted); }
.studio-live-file summary { display: flex; align-items: center; gap: 8px; padding: 9px 11px; cursor: pointer; }
.studio-live-file summary .icon { width: 16px; height: 16px; }
.studio-live-file pre { max-height: 15rem; overflow: auto; padding: 9px 11px; margin: 0; border-top: 1px solid var(--line); font-size: .8rem; }
.studio-manual textarea.site-edit-source { min-height: 10rem; font: .82rem/1.55 "Cascadia Mono", Consolas, monospace; }
.studio-versions { margin: 0; padding: 0; list-style: none; }
.studio-versions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 4px; }
.studio-versions li + li { border-top: 1px solid var(--line); }
.studio-version-copy { display: grid; min-width: 0; overflow-wrap: anywhere; }
.studio-version-copy span, .studio-version-copy time { color: var(--muted); font-size: .82rem; }
.studio-version-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.studio-code-block { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.studio-code-header, .studio-code-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.studio-code-header { justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.studio-code-header > span { display: flex; align-items: center; gap: 7px; padding-inline: 4px; font-size: .82rem; font-weight: 600; }
.studio-code-header .code-action { min-height: 32px; gap: 5px; padding: 4px 6px; border-color: transparent; background: transparent; box-shadow: none; font-size: .78rem; }
.studio-code-header .code-action[aria-pressed="true"] { background: var(--selected); color: var(--selected-ink); }
.studio-code-scroll { display: flex; max-height: min(51dvh, 400px); padding: 12px; overflow: auto; background: var(--input-bg); }
.studio-code-scroll :is(pre, .code-line-numbers) { margin: 0; font: .8rem/1.55 "Cascadia Mono", Consolas, monospace; white-space: pre; }
.studio-code-scroll pre { flex: 1 0 auto; }
.studio-code-scroll .code-line-numbers { flex-shrink: 0; margin-right: 14px; color: var(--muted); text-align: right; user-select: none; }
.studio-code-scroll.wrap-lines pre { min-width: 0; flex-basis: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-code-scroll.wrap-lines .code-line-numbers { display: none; }
.studio-export-note { color: var(--muted); font-size: .82rem; }
.studio-preview { display: flex; flex-direction: column; overflow: hidden; container-type: inline-size; }
.studio-preview-bar { position: relative; flex-wrap: wrap; gap: 6px 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.studio-preview-bar h2 { white-space: nowrap; }
.studio-preview-site-actions { flex-wrap: wrap; gap: 3px; margin-inline-end: auto; }
.studio-preview-site-actions > button { min-height: 36px; gap: 5px; padding-inline: 9px; font-size: 0.8rem; }
.studio-preview-actions { gap: 3px; }
.studio-preview-bar .icon-button { width: 35px; min-width: 35px; min-height: 36px; }
.studio-site-options { position: relative; }
.studio-site-options[open] summary { background: var(--selected); color: var(--ink); }
.studio-site-menu { top: calc(100% + 6px); }
@container (max-width: 570px) {
  .studio-preview-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .studio-preview-site-actions { grid-row: 2; grid-column: 1 / -1; }
  .studio-preview-actions { grid-row: 1; grid-column: 2; }
  .studio-site-options { position: static; }
  .studio-site-menu { inset: calc(100% + 4px) auto auto 12px; }
}
@container (max-width: 390px) {
  .studio-preview-bar { column-gap: 4px; padding-inline: 8px; }
  .studio-preview-bar h2 { font-size: .84rem; }
  .studio-preview-secondary { width: 35px; }
  .studio-preview-secondary > span { display: none; }
}
.site-preview-status { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
.site-preview-canvas { min-height: 0; flex: 1; padding: 10px; background: var(--studio-canvas); }
.site-preview-canvas iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--studio-canvas);
}
.site-preview-canvas[data-device="phone"] iframe { width: min(100%, 390px); }
.studio-manual { overflow: auto; overscroll-behavior-y: contain; }
.studio-manual-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.studio-manual-head, .editor-form { width: min(100%, var(--studio-chat-width)); margin: 0 auto; padding: 16px var(--studio-gutter); }
.editor-form { display: grid; gap: 13px; padding-top: 4px; }
.editor-form > .button { justify-self: start; }
.edit-sections { display: grid; gap: 12px; }
.edit-sections:empty { display: none; }
.edit-section {
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.edit-section .button { justify-self: start; }

@media (max-width: 1110px) {
  .studio-workspace[data-pane="preview"] { --studio-gutter: 15px; }
  .studio-workspace[data-pane="preview"] .studio-body {
    grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1fr);
  }
}
@media (max-width: 930px) {
  .studio-workspace[data-pane] .studio-body { grid-template-columns: minmax(0, 1fr); }
  .studio-workspace:is([data-pane="preview"], [data-pane="results"]) .studio-body > :is(.studio-chat, .studio-editor) { display: none; }
  .studio-results, .studio-preview { border-left: 0; }
  .studio-results > section { padding-inline: var(--studio-gutter); }
}
@media (max-width: 760px) {
  .main-content.studio-main { min-height: 0; }
  .studio-workspace { --studio-gutter: 13px; }
  .studio-header { min-height: 52px; padding: 6px 9px 6px 12px; }
  .studio-header-actions { gap: 3px; }
  .studio-header-actions .button { gap: 5px; padding-inline: 7px; font-size: 0.78rem; }
  .studio-heading { gap: 6px; }
  .studio-heading-icon { display: none; }
  .studio-heading h1 { font-size: 0.88rem; }
  .studio-thread { padding-block: 20px; }
  .studio-composer-dock { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .studio-composer .studio-model-button { max-width: min(100%, 180px); }
  .studio-composer .studio-control-button { min-height: 40px; }
  .studio-composer :is(.studio-attach, .studio-send) { min-width: 40px; min-height: 40px; }
  .studio-empty-chat { min-height: 140px; padding-bottom: 0; }
  .site-preview-canvas { padding: 6px; }
}
@media (max-width: 390px) {
  .studio-header-actions .studio-new-thread { width: 38px; }
  .studio-new-thread > span { display: none; }
}



/* Leads */
.lead { padding: 16px 18px; display: grid; gap: 10px; justify-items: start; }
.lead + .lead { border-top: 1px solid var(--line); }
.lead header { display: flex; width: 100%; gap: 10px; align-items: center; flex-wrap: wrap; }
.lead header time { margin-left: auto; color: var(--muted); font-size: 0.81rem; }
.lead h3 { font-size: 0.98rem; font-weight: 620; }
.lead header p { font-size: 0.83rem; overflow-wrap: anywhere; }

/* Admin and account */
.admin-layout, .settings-layout { display: grid; align-items: start; gap: 18px; }
.admin-layout { grid-template-columns: minmax(0, 1.8fr) minmax(245px, 1fr); }
.settings-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); max-width: 1050px; }
.user-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; font-size: 0.84rem; }
.user-table :is(th, td) { padding: 12px 16px; border-bottom: 1px solid var(--soft-line); overflow-wrap: anywhere; }
.user-table th { background: var(--surface-subtle); color: var(--muted); font-size: 0.78rem; font-weight: 630; }
.user-table th:first-child { width: 52%; }
.user-table th:nth-child(2) { width: 25%; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table td:not(:first-child) { color: var(--ink-secondary); }
.user-identity { display: flex; align-items: center; gap: 9px; }
.user-identity > div { min-width: 0; }
.user-identity p { margin-top: 2px; color: var(--muted); font-size: 0.79rem; }
.service-list, .profile-details { margin: 0; }
.service-row, .settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--soft-line);
}
.service-row:first-child, .panel-bar + .settings-row { border-top: 0; }
.service-row dt { font-size: 0.86rem; }
.status-value { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--ink-secondary); font-size: 0.82rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot.good { background: var(--good-ink); }
.status-dot.warn { background: #d88f2d; }
.status-dot.off { background: var(--muted); }
.account-identity { display: flex; align-items: center; gap: 12px; padding: 18px; }
.account-identity h3 { min-width: 0; overflow-wrap: anywhere; font-size: 1.1rem; font-weight: 670; }
.account-identity .avatar { width: 46px; height: 46px; font-size: 1rem; }
.profile-details > div { padding: 12px 18px; border-top: 1px solid var(--soft-line); }
.profile-details dt { color: var(--muted); font-size: 0.78rem; }
.profile-details dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 0.87rem; }
.settings-row h3 { font-size: 0.89rem; font-weight: 620; }
.settings-row .button { min-height: 40px; }

/* Form Fields */
.field { display: grid; gap: 6px; min-width: 0; font-size: 0.84rem; }
.field > span, .field-label { font-weight: 590; color: var(--ink-secondary); }
.field input, .field textarea, .field select, .share-result input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: border-color 130ms var(--ease), box-shadow 130ms var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field textarea { resize: vertical; line-height: 1.5; }
.field :is(input, textarea, select):focus-visible, .share-result input:focus-visible {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input-box {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding-left: 12px;
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: border-color 130ms var(--ease), box-shadow 130ms var(--ease);
}
.input-box:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-ring);
  color: var(--accent-bright);
}
.input-box > .icon { width: 16px; height: 16px; flex: 0 0 auto; }
.field .input-box input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px;
}
.input-box .input-eye {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  width: 38px;
  min-width: 38px;
  min-height: 38px;
}
.input-box .input-eye:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
}
.joined {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  overflow: hidden;
  transition: border-color 130ms var(--ease), box-shadow 130ms var(--ease);
}
.joined:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.joined .joined-icon {
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: var(--muted);
}
.joined .joined-icon .icon { width: 16px; height: 16px; }
.field .joined input { min-width: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding-left: 10px; }
.joined .joined-domain,
.joined > span:last-child {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-inline: 11px;
  background: var(--surface-subtle);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 520;
}
.form-error {
  padding: 10px 12px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

/* Modals & Toast */
.modal {
  width: min(580px, calc(100% - 24px));
  max-height: 92dvh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.modal::backdrop {
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(4px);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.dialog-top h2 { font-size: 1rem; font-weight: 640; overflow-wrap: anywhere; }
.dialog-top .button { border-color: transparent; background: transparent; box-shadow: none; }
.dialog-form { padding: 18px 20px 20px; display: grid; gap: 14px; }
.dialog-form p { line-height: 1.5; color: var(--ink-secondary); }
.dialog-form .attachment-list:empty { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.compose-actions > .icon-button:first-child { margin-right: auto; }
.modal.mail-compose-dialog {
  --compose-offset: var(--sidebar-width);
  position: fixed;
  inset: var(--bar-height) 0 0 var(--compose-offset);
  width: auto;
  max-width: none;
  height: calc(100dvh - var(--bar-height));
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--canvas);
  box-shadow: none;
}
.mail-compose-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.mail-compose-dialog::backdrop { background: transparent; backdrop-filter: none; }
.mail-compose-dialog .compose-form { display: flex; min-height: 0; flex-direction: column; overflow-y: auto; padding-inline: var(--page-gutter); }
.mail-compose-dialog .compose-body { flex: 1 0 12rem; grid-template-rows: auto minmax(0, 1fr); }
.mail-compose-dialog .compose-body textarea { min-height: 0; resize: none; }
.notice {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 11px 15px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.855rem;
  font-weight: 520;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 1060px) {
  .shell[data-sidebar="expanded"] { --sidebar-width: 14rem; }
}
@media (max-width: 900px) {
  .admin-layout, .settings-layout { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 680px) {
  .mail-table :is(.mail-col-status, .mail-col-sender) { display: none; }
  .mail-table :is(th, td) { padding-inline: 5px; }
  .mail-table :is(.mail-select-cell, .mail-star-cell, .mail-actions-cell) { width: 34px; padding: 0; }
  .mail-table .mail-col-date { width: 88px; }
  .message-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px; row-gap: 1px; }
  .mail-mobile-origin { display: block; grid-column: 1; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
  .message-summary { display: block; grid-column: 1; }
  .message-summary small { display: none; }
  .mail-attachment-mark { grid-column: 2; grid-row: 1 / span 2; }
  .mail-table-paging { margin-inline-start: 0; }
}
@container (max-width: 390px) {
  .mail-bar .search-form { flex-basis: 100%; max-width: none; }
  .mail-bar .toolbar-icon-group { padding-inline-start: 0; border-inline-start: 0; }
  .mail-table .mail-col-date { width: 78px; }
  .mail-col-date time { font-size: .72rem; }
  .mail-column-menu summary { gap: 4px; padding-inline: 7px; }
  .mail-column-menu summary > .icon:first-child { display: none; }
  .mail-table-footer { gap: 6px 10px; padding-inline: 8px; }
}
@media (max-width: 760px) {
  .auth-topbar, .auth-layout { width: min(460px, calc(100% - 32px)); }
  .auth-topbar { min-height: 68px; }
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "card" "hero";
    align-content: start;
    gap: 36px;
    padding-block: 12px 32px;
  }
  .auth-hero { text-align: center; }
  .auth-hero h1 { font-size: 1.8rem; }
  .auth-hero p { margin: 10px auto 0; }
  .auth-art { width: min(100%, 380px); margin-inline: auto; }

  .shell { --page-gutter: 16px; --bar-height: 53px; display: block; }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 22; display: none; width: min(18rem, 88vw); height: auto;
    box-shadow: var(--shadow-lg);
  }
  .rail.mobile-open { display: grid; padding-bottom: env(safe-area-inset-bottom); }
  body:has(.rail.mobile-open) { overflow: hidden; }
  .rail-head .rail-close { display: inline-flex; }
  .rail .rail-item, .rail .rail-group-toggle { min-height: 42px; }
  .topbar-inner { gap: 8px; padding-inline: 8px; }
  .workspace-crumbs > ol { gap: 5px; }
  .breadcrumb-home a > .icon { display: inline-block; width: 16px; }
  .breadcrumb-home a > span { display: none; }
  .nav-shade.button {
    position: fixed; z-index: 21; inset: 0; display: block; width: 100%; border: 0; border-radius: 0;
    background: rgba(5, 6, 10, 0.6);
  }
  .nav-shade.button:hover:not(:disabled) { background: rgba(5, 6, 10, 0.6); }
  .main-content { padding-block: 24px calc(38px + env(safe-area-inset-bottom)); }
  .modal.mail-compose-dialog { --compose-offset: 0px; }
  .panel-bar { padding-inline: 14px; }
  body:has(.shell) .notice { bottom: calc(14px + env(safe-area-inset-bottom)); }
  body:has(.studio-workspace) .notice { top: 114px; bottom: auto; }
}
@media (max-width: 530px) {
  .auth-card { padding: 22px; }
  .auth-form .joined-domain { padding-inline: 8px; }
  .section-head { flex-wrap: wrap; gap: 12px; margin-bottom: 17px; }
  .head-actions { justify-content: flex-start; }
  .empty-illustrated { flex-direction: column; gap: 14px; text-align: center; }
  .message-meta { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .message-meta time { grid-column: 2; text-align: left; }
  .message-toolbar :is(.message-back, .message-reply) { width: 38px; padding: 0; }
  .message-toolbar :is(.message-back, .message-reply) > span { display: none; }
  .message-toolbar :is(.button, .icon-button) { min-width: 36px; width: 36px; }
  .search-form { width: 100%; }
  .file-head, .file-row { grid-template-columns: minmax(0, 1fr) 56px 44px; gap: 4px; padding-inline: 8px; }
  .file-head { padding-left: 14px; }
  .file-mark { width: 27px; height: 27px; }
  .file-head :nth-child(3), .file-row time { display: none; }
  .data-toolbar { padding-inline: 12px; gap: 8px; }
  .drive-bar .search-form { flex-basis: 140px; }
  .toolbar-actions .button { min-height: 40px; }
  .drive-table[data-layout="grid"]:has(.file-row) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 139px), 1fr)); padding: 12px; gap: 10px; }
  .user-table :is(th, td) { padding: 10px; }
  .user-table .user-created { display: none; }
  .user-table th:first-child { width: 66%; }
  .user-table th:nth-child(2) { width: 34%; }
  .user-identity .avatar { width: 27px; height: 27px; }
  .modal :is(input, textarea, select) { font-size: 1rem; }
}

/* Workspace wallpapers and their previews */
:root {
  --wallpaper-beach: url('/assets/ryvon-wallpaper-praia.webp');
  --wallpaper-aurora: radial-gradient(ellipse at 28% 36%, #3e9c84 0%, transparent 51%),
    radial-gradient(ellipse at 76% 28%, #434f87 0%, transparent 52%), linear-gradient(155deg, #102f3a, #0c142c 67%, #07171d);
  --wallpaper-dusk: url('/assets/ryvon-wallpaper-por-do-sol.webp');
}
:root[data-wallpaper="beach"] { --workspace-wallpaper: var(--wallpaper-beach); }
:root[data-wallpaper="aurora"] { --workspace-wallpaper: var(--wallpaper-aurora); }
:root[data-wallpaper="dusk"] { --workspace-wallpaper: var(--wallpaper-dusk); }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) {
  --wallpaper-pane: #0c1827db;
  --wallpaper-bar: #0b1825e8;
  --surface: #101e2d;
  --surface-elevated: #18283a;
  --surface-subtle: #192b3c;
  --sidebar: #0b1724db;
  --line: #3b4b5d;
  --soft-line: #2d3e50;
}
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) body { isolation: isolate; }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #102235;
  background-image: linear-gradient(165deg, #08182b39, #08182b64), var(--workspace-wallpaper);
  background-position: center;
  background-size: cover;
  pointer-events: none;
}
:root[data-wallpaper="dusk"] body::before {
  background-color: #151b28;
  background-image: linear-gradient(180deg, #08111d3b, #12152229 68%, #0b12215c), var(--workspace-wallpaper);
  background-position: 61% center;
}
@media (prefers-reduced-motion: no-preference) {
  :root[data-wallpaper="dusk"] body::before {
    animation: sunset-drift 36s ease-in-out infinite alternate;
  }
  @keyframes sunset-drift {
    from { transform: translate3d(-0.5%, 0, 0) scale(1.02); }
    to { transform: translate3d(1.05%, 0.55%, 0) scale(1.075); }
  }
}
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.auth, .studio-workspace, .mail-layout > .panel) {
  background: transparent;
}
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.topbar, .studio-header, .mail-heading, .mail-table-footer) {
  background: var(--wallpaper-bar);
}
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.rail, .topbar, .studio-header) { backdrop-filter: blur(14px); }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.mail-row, .message-body, .studio-manual) { background: var(--wallpaper-pane); }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) .mail-row.unread { background: #131f2ff2; }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) .mail-row:is(:hover, :focus-within, [data-selected]) { background: var(--selected); }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.auth-hero, .studio-empty-chat, .empty-copy, .section-head) { text-shadow: 0 1px 4px #000c; }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) :is(.auth-hero p, .studio-empty-chat p, .empty-copy p) { color: #f2f6fa; }
:root:is([data-wallpaper="beach"], [data-wallpaper="aurora"], [data-wallpaper="dusk"]) .studio-turn[data-author="assistant"] .studio-turn-copy {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px;
  background: var(--wallpaper-pane);
}

.theme-control { position: relative; }
.theme-picker {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  z-index: 10;
  width: min(21.5rem, calc(100vw - 20px));
  max-height: calc(100dvh - 84px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.theme-picker h2 { margin: 0 0 9px; font-size: .88rem; font-weight: 620; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme-option.button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border-color: var(--line);
  text-align: start;
}
.theme-option[aria-pressed="true"] { border-color: var(--accent-bright); color: var(--ink); }
.theme-swatch {
  display: block;
  aspect-ratio: 2 / 1;
  border-radius: 6px 6px 0 0;
  background-position: center;
  background-size: cover;
}
.theme-swatch[data-wallpaper-choice="beach"] { background-image: var(--wallpaper-beach); }
.theme-swatch[data-wallpaper-choice="aurora"] { background-image: var(--wallpaper-aurora); }
.theme-swatch[data-wallpaper-choice="dusk"] { background: #151b28 var(--wallpaper-dusk) 61% 67% / cover no-repeat; }
.theme-swatch[data-wallpaper-choice="dark"] { background-color: #09090b; }
.theme-swatch[data-wallpaper-choice="light"] { background-color: #f4f5f7; }
.theme-option-label { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 6px; padding-inline: 8px; font-size: .8rem; }
.theme-selected { color: var(--accent-bright); }
