:root {
  --text-muted: var(--muted);
}

:root[data-theme='light'] {
  color-scheme: light;
  --ai-violet: #6541ce;
  --ai-violet-hover: #5432b6;
  --ai-blue: #2859ad;
  --ai-cyan: #086773;
  --deep-space: #f3f6fb;
  --surface: #fff;
  --surface-raised: #eaf0f8;
  --border: #8392aa;
  --text: #172338;
  --muted: #47586f;
  --success: #096449;
  --warning: #805400;
  --error: #b32142;
  --gradient: linear-gradient(135deg, #6241d6, #315ec8);
  --shadow: 0 24px 80px rgb(25 45 80 / 10%);
  --canvas-rgb: 243 246 251;
  --surface-rgb: 255 255 255;
  --raised-rgb: 248 250 253;
  --line-rgb: 66 79 100;
  --overlay-rgb: 23 35 56;
  --app-background: #f3f6fb;
  --inset-background: #f6f8fc;
  --dialog-background: #fff;
  --preview-background: #e5eaf2;
  --toast-success: #e5f4ed;
  --toast-error: #fff0f2;
  --secondary-text: #263852;
  --subtle-text: #4b5c75;
  --accent-text: #4d3caf;
  --info-text: #2552a0;
  --positive-text: #096449;
  --warning-text: #805400;
  --negative-text: #b32142;
  --cyan-text: #086773;
}

.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.theme-switch button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.theme-switch button[aria-pressed='true'] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.theme-switch button:focus-visible {
  outline: 2px solid var(--ai-blue);
  outline-offset: 2px;
}

.auth-theme {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.topbar,
.topbar__actions,
.brief-topbar,
.brief-topbar__actions {
  flex-wrap: wrap;
  gap: 12px;
}

.topbar,
.brief-topbar {
  padding-block: 12px;
}

.main-area,
.sidebar,
.panel,
.topbar__project {
  min-width: 0;
}

[data-theme='light'] :is(.button, .icon-button, .nav-item, input, select, textarea):focus-visible {
  outline: 2px solid var(--ai-blue);
  outline-offset: 2px;
}

[data-theme='light'] .brief-category-grid button[aria-pressed='true'],
[data-theme='light'] .brief-chips label:has(input:checked),
[data-theme='light'] .brief-suggestion:hover,
[data-theme='light'] .form-back:hover,
[data-theme='light'] .nav-item--active,
[data-theme='light'] .table-link:hover,
[data-theme='light'] .table-action:hover {
  color: var(--text);
}

[data-theme='light'] .button:hover {
  filter: brightness(0.96);
}

[data-theme='light'] .yandex-auth img {
  border: 1px solid var(--border);
}

[data-theme='light'] :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}

@media (max-width: 640px) {
  .theme-switch button {
    min-height: 40px;
    padding-inline: 9px;
  }

  .brief-topbar__actions .theme-switch {
    width: auto;
  }
}
