﻿:root {
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.72);
  --accent: #8be9fd;
  --accent2: #bd93f9;
  --ok: #50fa7b;
  --warn: #ffb86c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --max: 1100px;
  --surface: rgba(0, 0, 0, 0.18);
  --surface2: rgba(255, 255, 255, 0.04);
}

body[data-theme="light"] {
  --bg: #f3f6fb;
  --card: rgba(255, 255, 255, 0.98);
  --border: rgba(15, 23, 42, 0.18);
  --text: rgba(15, 23, 42, 0.95);
  --muted: rgba(15, 23, 42, 0.66);
  --accent: #0ea5e9;
  --accent2: #2563eb;
  --ok: #16a34a;
  --warn: #b45309;
  --shadow: 0 10px 24px rgba(2, 8, 23, 0.12);
  --surface: rgba(15, 23, 42, 0.04);
  --surface2: rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(189, 147, 249, 0.16), transparent 55%),
    radial-gradient(1000px 500px at 80% 10%, rgba(139, 233, 253, 0.16), transparent 60%),
    linear-gradient(180deg, #060a14, var(--bg));
  background-attachment: fixed;
  line-height: 1.55;
}

body[data-theme="light"] {
  background: radial-gradient(1200px 600px at 20% 0%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(1000px 500px at 80% 10%, rgba(37, 99, 235, 0.1), transparent 60%),
    linear-gradient(180deg, #f9fbff, var(--bg));
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 12px;
  background: #111a33;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 9999;
}

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139, 233, 253, 0.9), rgba(189, 147, 249, 0.9));
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
}

.btn:hover,
.btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="light"] .btn {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.22);
}

body[data-theme="light"] .btn:hover,
body[data-theme="light"] .btn:focus-visible {
  background: rgba(248, 250, 252, 1);
}

.btn.primary {
  border-color: rgba(139, 233, 253, 0.35);
  background: linear-gradient(135deg, rgba(139, 233, 253, 0.22), rgba(189, 147, 249, 0.18));
}

body[data-theme="light"] .btn.primary {
  color: #0b1220;
  border-color: rgba(14, 165, 233, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.16));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.muted {
  color: var(--muted);
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
}

.chip.ok {
  border-color: rgba(80, 250, 123, 0.25);
  color: rgba(80, 250, 123, 0.92);
}

.chip.warn {
  border-color: rgba(255, 184, 108, 0.25);
  color: rgba(255, 184, 108, 0.92);
}

/* --- App layout --- */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(6, 10, 20, 0.65);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  width: min(100% - 24px, var(--max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 16px;
}

body[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.14);
}

.app-header__left,
.app-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header__left {
  min-width: 0;
}

.app-header__right {
  justify-content: flex-end;
  flex-wrap: wrap;
  row-gap: 6px;
}

.header-identity {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .header-identity {
  color: rgba(15, 23, 42, 0.9);
  border-color: rgba(14, 165, 233, 0.3);
  background: rgba(239, 248, 255, 0.95);
}

.app-header__right .btn {
  padding: 8px 10px;
  font-size: 14px;
}

.brand-title {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 560px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.15px;
}

.app-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 0 22px;
  width: min(100% - 24px, var(--max));
  margin-inline: auto;
  align-items: start;
}

.app-nav {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  position: sticky;
  top: 68px;
  height: fit-content;
  display: block;
}

body[data-theme="light"] .app-nav {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.14);
}

.app-nav__section + .app-nav__section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-nav__title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.nav-item {
  display: block;
  text-decoration: none;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(139, 233, 253, 0.22);
}

.nav-action {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

.nav-action:hover,
.nav-action:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.14);
}

.stat__k {
  color: var(--muted);
  font-size: 13px;
}

.stat__v {
  font-weight: 700;
  font-size: 13px;
}

.app-main {
  min-width: 0;
}

.app-search {
  display: none;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  outline: none;
}

body[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.2);
  color: var(--text);
}

.input[type="select"],
select.input {
  appearance: none;
}

select.input option {
  color: #101426;
  background: #ffffff;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

body[data-theme="light"] .input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

.input:focus {
  border-color: rgba(139, 233, 253, 0.35);
  box-shadow: 0 0 0 3px rgba(139, 233, 253, 0.12);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.row--stats {
  grid-template-columns: 1fr;
}

.label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.value {
  font-weight: 800;
  font-size: 16px;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 14px 0;
}

.dice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.statbox {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 12px;
}

.statbox__k {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.statbox__v {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.statbox__hint {
  margin-top: 2px;
  font-size: 13px;
}

.statbox__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.mini-btn:hover,
.mini-btn:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.09);
}

.campaign__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.campaign__name {
  font-weight: 900;
  letter-spacing: -0.01em;
}

.campaign__desc {
  font-size: 14px;
  margin-top: 4px;
}

.campaign__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.mini {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
}

body[data-theme="light"] .mini {
  border-color: rgba(14, 165, 233, 0.22);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .campaign__meta .mini:nth-child(2) {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(240, 253, 250, 0.95);
}

.mini__k {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.mini__v {
  margin-top: 2px;
  font-weight: 900;
}

.campaign__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  font-weight: 800;
}

.pill--soft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.log {
  height: 320px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 10px;
}

.log__line {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
}

.log__line:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04);
}

.log__line--local {
  border: 1px dashed rgba(139, 233, 253, 0.45);
  background: rgba(139, 233, 253, 0.12) !important;
}

.log__time {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.chatbar,
.assistbar,
.rulesbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.assist-answer {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.14);
  border-radius: 14px;
  padding: 12px;
}

.assist-answer__q {
  font-weight: 800;
}

.assist-answer__a {
  margin-top: 8px;
}

.assistant-chat {
  height: 360px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 10px;
}

body[data-theme="light"] .assistant-chat {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

.msg {
  display: flex;
  margin: 10px 0;
}

.msg--user {
  justify-content: flex-end;
}

.msg__bubble {
  max-width: 78ch;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .msg__bubble {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.98);
}

.msg--bot .msg__bubble {
  border-color: rgba(139, 233, 253, 0.22);
  background: rgba(139, 233, 253, 0.08);
}

body[data-theme="light"] .msg--bot .msg__bubble {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(239, 248, 255, 0.95);
}

body[data-theme="light"] .msg--user .msg__bubble {
  border-color: rgba(16, 185, 129, 0.24);
  background: rgba(240, 253, 250, 0.95);
}

.chip-btn {
  cursor: pointer;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
}

.chip-btn:hover,
.chip-btn:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.rules-results .rule + .rule {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rule__title {
  font-weight: 900;
}

.rule__tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule__body {
  margin-top: 8px;
}

.rules-block + .rules-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-import-list {
  display: grid;
  gap: 10px;
}

.rule--import {
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 165, 233, 0.06);
}

body[data-theme="light"] .rules-block + .rules-block {
  border-top-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .rule--import {
  border-color: rgba(14, 165, 233, 0.24);
  background: rgba(239, 248, 255, 0.94);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.check input {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(6, 10, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  max-width: min(520px, calc(100% - 24px));
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
}

body[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.2);
  color: rgba(15, 23, 42, 0.95);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

body.app-locked .app {
  display: none;
}
body:not(.app-locked) .auth-shell {
  display: none;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(520px, 100%);
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.auth-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.auth-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-hint a {
  color: var(--accent);
}

.role-master-only-inline {
  display: none;
}

body[data-role="Мастер"] .role-master-only-inline {
  display: inline-flex;
}

.role-master-only-block {
  display: none;
  margin-bottom: 12px;
}

body[data-role="Мастер"] .role-master-only-block {
  display: block;
}
.app-nav__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 10px;
}

.profile-form {
  margin-top: 4px;
}

.profile-textarea {
  min-height: 88px;
  resize: vertical;
}

.theme-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.theme-select {
  max-width: 240px;
}

body[data-theme="light"] .theme-box {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.03);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(560px, 100%);
  background: #121a2f;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

body[data-theme="light"] .modal {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.16);
}

.session-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.session-list {
  display: grid;
  gap: 10px;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  padding: 10px;
}

.news-item__title {
  font-weight: 800;
  text-decoration: none;
}

.news-item__title:hover,
.news-item__title:focus-visible {
  text-decoration: underline;
}

.news-item__meta {
  margin-top: 6px;
}

.session-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.session-item__title {
  font-weight: 800;
}

body[data-theme="light"] .session-item {
  border-color: rgba(14, 165, 233, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .session-item .muted {
  color: rgba(15, 23, 42, 0.62);
}

.session-character-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.session-settings {
  margin-bottom: 12px;
}

.session-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.session-chat-observers .h2 {
  margin-bottom: 8px;
}

.session-chat-main {
  border: 1px solid rgba(139, 233, 253, 0.28);
  border-radius: 14px;
  padding: 10px;
  background: rgba(139, 233, 253, 0.06);
  min-width: 0;
}

.session-chat-main .log {
  border-color: rgba(139, 233, 253, 0.35);
  background: rgba(0, 0, 0, 0.2);
}

.session-chat-observers {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.session-chat-observers .h2 {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
}

.session-chat-observers .log {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.session-stage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.session-users {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
  padding: 10px;
  width: 100%;
  max-width: 220px;
  align-self: stretch;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.session-users .h2 {
  margin-bottom: 8px;
}

.session-user-section + .session-user-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.session-user-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.session-user-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body[data-theme="light"] .session-chat-main {
  border-color: rgba(14, 165, 233, 0.32);
  background: rgba(239, 248, 255, 0.96);
}

body[data-theme="light"] .session-chat-main .log {
  border-color: rgba(14, 165, 233, 0.22);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .session-chat-observers {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(240, 253, 250, 0.96);
}

body[data-theme="light"] .session-chat-observers .h2 {
  color: rgba(15, 23, 42, 0.88);
}

body[data-theme="light"] .session-chat-observers .log {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .session-users {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.95);
}

body[data-theme="light"] .session-user-section + .session-user-section {
  border-top-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .session-user-item {
  border-color: rgba(15, 23, 42, 0.15);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .news-item {
  border-color: rgba(14, 165, 233, 0.22);
  background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .log {
  border-color: rgba(15, 23, 42, 0.14);
}

body[data-theme="light"] .log__line:nth-child(odd) {
  background: rgba(15, 23, 42, 0.03);
}

@media (min-width: 860px) {
  .app-body {
    grid-template-columns: 220px 1fr;
    gap: 14px;
    padding: 14px 0 26px;
  }

  .app-nav { display: block; }

  .app-search {
    display: block;
    width: min(420px, 40vw);
  }

  .page-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
  }

  .grid2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-box {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .grid3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .row {
    grid-template-columns: repeat(3, 1fr);
  }

  .row--stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .chatbar,
  .assistbar,
  .rulesbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .session-character-picker {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .session-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: stretch;
  }

  .session-chat-main {
    grid-column: 1;
    grid-row: 1;
  }

  .session-chat-observers {
    grid-column: 1;
    grid-row: 2;
  }

  .session-users {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .session-chat-main .log,
  .session-chat-observers .log {
    height: 360px;
  }
}


