/* Здесь задаются поверхности и размещение; оформление действий принадлежит controls.css. */
:root {
  --text: #edf0f2;
  --muted: #a5abb4;
  --accent: #00ffff;
  --accent-rgb: 0, 255, 255;
  --accent-soft: #00ffff17;
  --green: #00ffff;
  --amber: #e3bd79;
  --red: #ef9b9b;
  --display: var(--sans);
  --surface-highlight: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 45%, transparent), transparent 70%);
  --surface-shadow: none;
  --orbit-grain: none;
}
html[data-orbit-ambient="true"] {
  --orbit-grain: none;
}
html body.wave-shell:not(.reader-focus, .dialog-focus, .wave-focus) {
  width: 100%;
  max-width: none;
  height: var(--wave-viewport-height, 100dvh);
  margin: 0;
  border: 0;
  border-radius: 0;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
}
html body .workspace-sidebar {
  padding: 20px 12px 12px;
  background: var(--control-bg);
  border-right: 1px solid var(--line);
}
.workspace-sidebar > .brand {
  margin-bottom: 18px;
  padding: 0 8px;
}
.workspace-sidebar .brand-name {
  font-family: var(--sans);
  letter-spacing: 0.12em;
  font-size: 14px;
  font-weight: 600;
}
.workspace-sidebar .brand-mark {
  width: 34px;
  height: 34px;
}
.workspace-sidebar .brand-version {
  color: var(--muted);
  font-size: 10px;
}
.workspace-sidebar nav a {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
}
.workspace-sidebar a[aria-current] {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 var(--accent);
  color: var(--text);
}
.workspace-sidebar .workspace-nav-group {
  margin-top: 12px;
}
.workspace-sidebar nav a.workspace-group-title {
  font-size: 10px;
  letter-spacing: 1.3px;
  min-height: 27px;
  box-shadow: none;
  background: transparent;
}
.workspace-sidebar nav a.workspace-group-title[aria-current] {
  color: var(--accent);
}
html body.wave-shell > .workspace-header {
  height: 58px;
  min-height: 58px;
  padding: 0 22px;
  background: var(--control-bg);
  border-bottom: 1px solid var(--line);
}
html body .workspace-header a.workspace-section {
  gap: var(--space-3);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.workspace-section .workspace-crumb {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-section .workspace-crumb::before {
  content: "/";
  margin-right: 8px;
  color: var(--muted);
  font-weight: 400;
}
html.embedded-page:not(.chat-widget) body:not(:has(#chatPage)) {
  padding: 20px 24px;
}
html body .section-line {
  margin-bottom: 16px;
  gap: var(--space-4);
  align-items: center;
}
html body .section-line h1,
html body .settings-heading h1 {
  font-family: var(--sans);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 550;
  letter-spacing: -0.6px;
}
html body #homeDashboard .home-heading {
  margin-bottom: 18px;
  min-height: 0;
}
html body #homeDashboard .home-heading h1 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.6px;
  margin: 0 0 6px;
}
html body #homeDashboard .home-heading .core-emblem,
html body #homeDashboard .home-eyebrow {
  display: none;
}
html body #homeDashboard .home-heading :is(#homeDate, .section-description) {
  font-size: 13px;
  letter-spacing: 0;
}
html
  body
  :is(
    .home-card,
    .module-card,
    .vpn-card,
    .server-manager,
    .settings-card,
    .settings-sidebar,
    .article-card,
    .project-card,
    .activity-card,
    .rt-panel,
    .pulse-panel,
    .pulse-stat,
    .balance-panel,
    .signal-panel,
    .kb-column,
    .anime-panel,
    .trophy-panel,
    .security-panel,
    .chat-panel,
    .storage-folder-card,
    .storage-row
  ) {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: var(--surface-shadow);
}
html body #homeDashboard :is(.home-card, .module-card) {
  padding: 14px;
}
html body #homeDashboard :is(.home-card-title h2, .module-heading h2) {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}
html body #homeDashboard :is(.home-card-title, .module-heading) .ui-icon {
  color: var(--accent);
  width: 19px;
  height: 19px;
}
html body #homeDashboard [data-home-card="pulse"] {
  padding: 14px 0;
}
html body #homeDashboard .home-metric strong {
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}
html body #homeDashboard .home-metric-label {
  font-size: 11px;
  letter-spacing: 0.2px;
}
html
  body
  .page
  > main
  :is(
    .content-toolbar,
    .anime-toolbar,
    .trophy-toolbar,
    .reader-toolbar,
    .storage-toolbar,
    .kb-tools,
    .projects-toolbar,
    .rt-toolbar
  ) {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 0;
}
html body .page > main :is(.project-row, .storage-file-card, .wave-track, .balance-row) {
  box-shadow: none;
  border-color: var(--line-soft);
}
html body .page > main :is(.project-row, .wave-track, .balance-row):hover {
  background: var(--button-hover);
}
html body .page > main table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
html body .page > main :is(th, td) {
  border-color: var(--line-soft);
}
html body .page > main th {
  color: var(--muted);
  font-weight: 500;
}
html body .page > main tbody tr:hover {
  background: var(--button-hover);
}
html body .settings-layout {
  gap: 18px;
}
html body #settingsContent .settings-appearance .settings-card {
  padding: 16px;
}
html body .settings-heading {
  padding-bottom: 12px;
  margin-bottom: 16px;
}
html body .settings-nav a[aria-current] {
  box-shadow: inset 2px 0 var(--accent);
  border-radius: 4px;
}
html body .page > main :is(.chat-message) {
  border-color: var(--line-soft);
  box-shadow: none;
}
html body.wave-shell #wavePlayer:not(.expanded) {
  background: var(--control-bg);
  padding: 8px 18px;
  border-top-color: var(--line);
}
html body #workspaceCompanion {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  overflow: hidden;
  color: var(--text);
}
html body #workspaceCompanion[open] {
  display: flex;
  flex-direction: column;
  width: min(460px, calc(100vw - 16px));
  height: min(760px, calc(var(--wave-viewport-height, 100dvh) - 24px));
  top: calc(var(--wave-viewport-top, 0px) + 12px);
  bottom: auto;
  margin-block: 0;
  max-width: none;
  max-height: none;
}
.companion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.companion-heading h2 {
  font-size: 16px;
  margin: 0;
}

#companionFrame {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--surface);
}
html body:has(#chatPage) {
  padding: 0;
}
html.chat-widget #chatPage {
  background: var(--surface);
}
html.chat-companion body {
  padding: 0 !important;
  background: var(--surface);
}
html.chat-companion #chatPage {
  box-sizing: border-box;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.chat-companion #chatHistory {
  padding-right: 0;
  scrollbar-width: none;
}
html.chat-companion #chatHistory::-webkit-scrollbar {
  display: none;
}
html body.wave-shell:is(.reader-focus, .dialog-focus, .wave-focus) > #workspaceCompanion {
  display: none !important;
}
@media (min-width: 1180px) {
  html body.wave-shell.with-companion:not(.reader-focus, .dialog-focus, .wave-focus) {
    grid-template-columns: 216px minmax(0, 1fr) 360px;
  }
  html body.wave-shell.with-companion > .workspace-header {
    grid-column: 2/-1;
  }
  html body.wave-shell #workspaceCompanion[open] {
    position: static;
    grid-column: 3;
    grid-row: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    max-height: none;
  }
}
html body [data-servers="pulse"] .server-tabs {
  gap: var(--space-3);
  margin: 0;
  padding: 2px 0 8px;
}
html body [data-servers="pulse"] .server-link {
  font-size: 12px;
}
html body .page > main .pulse-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-highlight), var(--surface);
  margin-bottom: 12px;
  padding: 12px 0;
}
html body .page > main .pulse-stats .pulse-stat {
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html body .page > main .pulse-stats .pulse-stat:last-child {
  border-right: 0;
}
html body .pulse-stat h2 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--muted);
}
html body .pulse-stats .pulse-stat-reading {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  min-height: 30px;
}
html body .pulse-stats .pulse-stat-reading > strong {
  font-size: 25px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  padding: 0;
  flex-shrink: 0;
}
html body .pulse-stats .pulse-spark {
  display: block;
  flex: 1;
  min-width: 0;
  width: 0;
  height: 30px;
  overflow: hidden;
  color: var(--accent);
}
html body .pulse-stats .pulse-spark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
html body .pulse-stat > p {
  font-size: 11px;
  margin-top: 4px;
}
.console-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.console-tabs {
  display: flex;
  gap: var(--space-1);
}
html body #pulseJournal,
.console-services {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  margin: 0 0 12px;
  min-width: 0;
}
.console-journal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.console-journal-head h2,
.console-services > h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.console-journal-head .ui-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
#consoleJournalStatus {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
#consoleJournalStatus:empty {
  display: none;
}
#consoleEvents {
  padding: 0;
  margin: 0;
  list-style: none;
  max-height: 480px;
  overflow: auto;
}
.console-event {
  display: grid;
  grid-template-columns: 130px 90px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 4px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  align-items: start;
}
.console-event time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.console-event strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.console-event details {
  grid-column: 3;
  min-width: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.console-event details summary {
  cursor: pointer;
}
.console-event[data-level="warning"] {
  border-left: 2px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 5%, transparent);
  padding-left: 8px;
}
.console-event[data-level="critical"] {
  border-left: 2px solid var(--red);
  background: color-mix(in srgb, var(--red) 5%, transparent);
  padding-left: 8px;
}
.console-event[data-level="warning"] .console-level {
  color: var(--amber);
}
.console-event[data-level="critical"] .console-level {
  color: var(--red);
}
.console-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.console-service:last-child {
  border-bottom: 0;
}
.console-service strong {
  font-weight: 500;
  overflow-wrap: anywhere;
  min-width: 0;
}
.console-service span {
  flex: none;
  color: var(--muted);
}
.console-service[data-state="active"] span {
  color: var(--green);
}
.console-service[data-state="failed"] span {
  color: var(--red);
}
#consoleServices > p {
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.5;
}
@media (max-width: 800px) {
  html body.wave-shell:not(.reader-focus, .dialog-focus, .wave-focus) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58px minmax(0, 1fr) auto;
  }
  html body.wave-shell > .workspace-header {
    grid-column: 1;
    padding: 0 10px;
    gap: var(--space-3);
  }
  html body.wave-shell > .workspace-body {
    grid-column: 1;
  }
  html body.wave-shell > .workspace-sidebar {
    display: none;
  }
  .workspace-companion-open {
    display: none;
  }
  html.embedded-page:not(.chat-widget) body:not(:has(#chatPage)) {
    padding: 16px 12px;
  }
  html body .section-line h1,
  html body .settings-heading h1,
  html body #homeDashboard .home-heading h1 {
    font-size: 23px;
  }
  html body #homeDashboard :is(.home-card, .module-card) {
    padding: 12px;
  }
  html body #homeDashboard [data-home-card="pulse"] {
    padding: 12px 0;
  }
  html body .page > main .pulse-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 0;
  }
  html body .page > main .pulse-stats .pulse-stat {
    padding: 0 12px;
  }
  html body .page > main .pulse-stats .pulse-stat:nth-child(2) {
    border-right: 0;
  }
  html body .pulse-stats .pulse-stat-reading {
    gap: var(--space-3);
  }
  html body .pulse-stats .pulse-stat-reading > strong {
    font-size: 22px;
  }
  .console-event {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }
  .console-event > strong,
  .console-event details {
    grid-column: 1/-1;
  }
  html body #pulseJournal,
  .console-services {
    padding: 12px;
  }
  .console-toolbar > .ui-button {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .workspace-sidebar a,
  .settings-nav a {
    transition:
      background-color 0.16s,
      color 0.16s;
  }
}

html body:not(.wave-shell) > .page {
  max-width: none;
}
html
  body
  :is(
    .home-card,
    .module-card,
    .vpn-card,
    .server-manager,
    .settings-card,
    .article-card,
    .project-card,
    .activity-card,
    .rt-panel,
    .pulse-panel,
    .pulse-stat,
    .balance-panel,
    .signal-panel,
    .kb-column,
    .anime-panel,
    .trophy-panel,
    .security-panel,
    .storage-folder-card
  ) {
  background: var(--surface-highlight), var(--surface);
  box-shadow: var(--surface-shadow);
}
html body #homeDashboard[data-group] :is(.home-grid, .section-directory) > .home-card {
  background: var(--surface-highlight), var(--surface);
  border-color: var(--line);
  border-radius: 9px;
  box-shadow: var(--surface-shadow);
}
html body #homeDashboard[data-group]:not([data-layout="brief"]) .home-card-title {
  margin-bottom: 14px;
}
html body #homeDashboard[data-group]:not([data-layout="brief"]) .home-card-title h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.15px;
}
html body #homeDashboard[data-group] #homeMedia .home-media-progress {
  max-width: none;
  width: 100%;
}
html body #homeDashboard .home-weather-temperature {
  color: var(--text);
}
html body.wave-shell > .workspace-header {
  background: var(--header-bg);
}
html body .workspace-sidebar {
  background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom));
}
html body #pulseJournal,
html body .console-services {
  background: var(--surface-highlight), var(--surface);
  box-shadow: var(--surface-shadow);
}
/* Общий блик меняет только рисунок поверхности: цвет состояния и геометрия сохраняются. */
html body :is(
  .box,
  .watch-card,
  .server-report,
  .chat-panel,
  .project-panel,
  .cinema-player,
  .cinema-transfer,
  .mr-settings,
  .mr-card,
  .trophy-overview > div,
  .trophy-rare-column
),
html body #releaseList,
html body #statisticsPage .activity-card,
html body .storage-app .storage-folder-card {
  background-image: var(--surface-highlight);
}
@media (min-width: 801px) {
  html body #homeDashboard[data-group] :is(.home-grid, .section-directory) > .home-card {
    padding: 18px;
  }
  html
    body
    #homeDashboard[data-group]
    :is(.home-grid, .section-directory)
    > [data-home-card="pulse"] {
    padding: 18px 0;
  }
  html body #homeDashboard[data-group] .home-track {
    padding-block: 9px;
  }
  html body #homeDashboard[data-group] .home-track strong {
    font-size: 13px;
    line-height: 19px;
  }
  html body #homeDashboard[data-group] .home-track small,
  html body #homeDashboard[data-group] #homeMedia .home-media-item small {
    font-size: 11px;
    line-height: 17px;
  }
  html body #homeDashboard .home-metric strong {
    font-size: 25px;
  }
  html body #homeDashboard[data-group] .home-value {
    font-size: 26px;
  }
}
html body .page > main .workspace-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  min-width: 0;
}
html body .page > main .workspace-toolbar > label {
  margin-block: 0;
}
@media (min-width: 1000px) {
  html body .page > main .workspace-toolbar > input[type="search"] {
    flex: 1 1 220px;
    width: auto;
    min-width: 160px;
    max-width: 480px !important;
  }
  html body .page > main .workspace-toolbar > select {
    flex: 0 1 220px;
    width: auto;
    max-width: 260px;
    min-width: 120px;
  }
}
#kanban {
  container: kanban / inline-size;
}
html body #kanban .kb-header {
  display: grid;
  gap: var(--space-3);
  margin-bottom: 12px;
}
html body #kanban .kb-header > .kb-tools {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  gap: var(--space-3);
  min-width: 0;
  align-items: center;
}
html body #kanban .kb-header label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  margin: 0;
  flex: none;
}
@container kanban (min-width:1000px) {
  html body #kanban .kb-header {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
    align-items: center;
  }
  html body #kanban .kb-header > .kb-tools {
    flex-wrap: nowrap;
  }
  html body #kanban .kb-header #kbSearch {
    flex: 1 1 160px;
    width: 0;
    min-width: 0;
  }
  html body #kanban .kb-header #kbTag {
    flex: 0 1 120px;
    width: 120px;
    min-width: 80px;
  }
  html body #kanban .kb-header #kbPriority {
    flex: 0 0 154px;
    width: 154px;
    min-width: 0;
  }
}
html body .console-server-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-bottom: 12px;
}
html body .console-server-summary:has(> .pulse-about[open]) {
  align-items: stretch;
}
html body .console-server-summary .pulse-details > div {
  padding-block: 3px;
}
html body .console-server-summary .pulse-details > div:last-child {
  padding-bottom: 0;
}
html body .console-server-summary .pulse-about-heading {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  width: calc(100% - 1.2em);
  vertical-align: top;
}
html body .console-server-summary .pulse-about-heading > span:first-child {
  flex-shrink: 0;
}
html body .page > main .console-server-summary #pulseHost {
  margin: 0;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  color: var(--text);
}
html body .page > main .console-server-summary > .pulse-about,
html body .console-server-summary > .console-services {
  margin: 0;
  min-width: 0;
}
@media (min-width: 1000px) {
  html body .console-server-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
html body #pulseServerPanel:has(#pulseData[hidden]) .pulse-about {
  display: none;
}
html body #pulseServerPanel:has(#pulseData[hidden]) .console-server-summary {
  grid-template-columns: minmax(0, 1fr);
}
:root {
  --page-gutter: 24px;
  --card-gap: 12px;
}
html body :is(#helios, #hubSearch, #vpnDiagnostics) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}
html body .section-line {
  margin-bottom: 18px;
}
html body .section-line h1,
html body .settings-heading h1 {
  font-size: 28px;
}
html body #settingsContent {
  container: settings / inline-size;
}
html
  body
  #settingsContent
  :is(.settings-panels, .settings-appearance, #homeSettings, .data-backup, .hub-updates) {
  width: 100%;
  max-width: none;
}
html body #settingsContent[data-settings-section] .settings-panels {
  max-width: none;
}
html body #settingsContent .settings-appearance .settings-card {
  display: grid;
  gap: 0 24px;
}
html body #settingsContent .appearance-options {
  min-width: 0;
}
html body #settingsContent .appearance-options .settings-switch:first-child {
  margin-top: 0;
}
html body #settingsContent #homeSettingsList {
  display: grid;
  gap: 0 24px;
}
html body #settingsContent #dataBackupChoices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--space-4);
}
html body #settingsContent #dataBackupChoices > label {
  margin: 0;
  min-width: 0;
  height: 100%;
}
html body #statisticsPage .activity-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
html body #vpn .vpn-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
html body #settingsContent .appearance-layout {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}
html body #settingsContent .appearance-layout > * {
  min-width: 0;
  margin: 0;
}
html body #settingsContent .appearance-layout .settings-card {
  margin: 0;
}
html body #settingsContent .appearance-layout #homeSettings {
  margin: 0;
}
html body #settingsContent .appearance-layout .orbit-accents {
  margin: var(--space-4) 0;
}
@container settings (min-width:800px) {
  html body #settingsContent .appearance-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  :root {
    --page-gutter: 12px;
    --card-gap: 10px;
  }
  html body .section-line h1,
  html body .settings-heading h1 {
    font-size: 23px;
  }
}

/* Единый тёмный фон для всех акцентов, включая первый кадр до JavaScript. */
:root {
  --bg: #101113;
  --surface: #191b1e;
  --surface-solid: #202226;
  --surface-raised: #272a2f;
  --control-bg: #141619;
  --line: #303338;
  --line-soft: #282b30;
  --line-strong: #4a4f56;
  --button-bg: #202328;
  --button-hover: #2b2f35;
  --track: #34383f;
  --header-bg: #121416;
  --sidebar-top: #17191c;
  --sidebar-bottom: #131518;
}

html body #chatPage .chat-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, var(--ui-control-size));
  gap: var(--space-1);
  align-items: center;
}
html body #chatPage .chat-toolbar > #chatTopics {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-row: 1;
  text-overflow: ellipsis;
}
html body #chatPage .chat-toolbar > #chatTopics {
  grid-column: 1;
}
html body #chatPage .chat-toolbar > #chatNew {
  grid-column: 2;
  grid-row: 1;
}
html body #chatPage .chat-toolbar > #chatRename {
  grid-column: 3;
  grid-row: 1;
}
html body #chatPage .chat-toolbar > #chatDelete {
  grid-column: 4;
  grid-row: 1;
}
@media (max-width: 400px) {
  html.chat-companion body #chatPage {
    padding-inline: 8px;
  }
  html body #chatPage .chat-toolbar {
    gap: 3px;
  }
}

.console-server-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Общая плотность веба и нативного клиента: CLIENT-UI-CONTRACT.md. */
:root {
  --card-padding-x: 12px;
  --card-padding-y: 8px;
  --card-heading-gap: 6px;
}
html body :is(.settings-card, .rt-panel, .balance-panel, .signal-panel,
  .anime-panel, .trophy-panel, .security-panel, .project-panel,
  .he-card, .activity-card, .pulse-panel) {
  padding-block: var(--card-padding-y);
  min-height: 0;
}
html body #homeDashboard :is(.home-card, .module-card),
html body #homeDashboard[data-group] :is(.home-grid, .section-directory) > .home-card {
  padding: var(--card-padding-y) var(--card-padding-x);
  min-height: 0;
  height: auto;
}
html body #homeDashboard .home-card-title,
html body #homeDashboard[data-group]:not([data-layout="brief"]) .home-card-title {
  margin-bottom: var(--card-heading-gap);
}
html body #homeDashboard[data-group] .module-stat {
  padding-block: 2px;
  gap: 4px;
}
html body #homeDashboard[data-group] .home-task-empty {
  gap: 4px;
}
html body #homeDashboard[data-group] .home-weather-reading {
  margin-bottom: 6px;
}
html body #homeDashboard[data-group] .balance-overview {
  gap: 6px;
}
html body #homeDashboard:not([data-group]) :is(.home-task-empty, .home-resume-empty) {
  min-height: 0;
  padding-block: 8px;
}

/* Content height follows the title; short game names do not reserve two rows. */
html body #trophiesPage .trophy-card > strong { min-height: 0; }

/* Selection and its immediate actions stay together even on narrow phones. */
html body #helios .he-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 360px) auto;
  justify-content: start;
  align-items: end;
  gap: 6px;
}
html body #helios .he-toolbar label { min-width: 0; width: 100%; max-width: none; }
html body #helios .he-inline-actions { flex-wrap: nowrap; gap: 6px; }
html body #helios #hePrimary { grid-column: 1 / -1; justify-self: start; }
html body #rhythm > .workspace-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}
html body #rhythm #rtDate { flex: 1 1 0; width: 0; min-width: 0; max-width: 360px; }
html body #rhythm :is(#rtRefresh, #rtExport) { flex: 0 0 auto; }
