/* iSpring Learn–inspired shell: светлая панель, синий акцент, плоские карточки */
:root {
  --bg: #f4f6f9;
  --bg-deep: #1a2332;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #6b7785;
  --line: #e3e8ef;
  --accent: #2f6fed;
  --accent-hover: #1f5ad1;
  --accent-soft: #eaf1ff;
  --accent-2: #0f9d8a;
  --good: #1f9d57;
  --bad: #e04b4b;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.06), 0 8px 24px rgba(28, 36, 48, 0.06);
  --radius: 12px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Manrope", "Source Sans 3", sans-serif;
  --sidebar: #1b2433;
  --sidebar-text: #d7deea;
  --reader-max: 760px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

#app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100%;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid #121821;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 8px 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
}
.brand-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
}
.brand-sub { font-size: 0.75rem; opacity: 0.55; margin-top: 2px; }

.side-nav { display: grid; gap: 4px; }
.nav-btn {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.nav-btn:hover { background: rgba(255,255,255,0.06); }
.nav-btn.active {
  background: rgba(47, 111, 237, 0.22);
  color: #fff;
}

.side-folders { flex: 1; display: grid; gap: 2px; align-content: start; }
.folder-chip {
  border: 0;
  background: transparent;
  color: #9aa8bc;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.84rem;
}
.folder-chip:hover, .folder-chip.active {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.side-user { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 14px; }
.user-name { font-weight: 600; margin-bottom: 4px; color: #fff; }
.user-meta { font-size: 0.8rem; opacity: 0.65; }

.main { min-width: 0; background: var(--bg); }
.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.search-wrap { flex: 1; max-width: 560px; }
.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.view { padding: 24px 28px 56px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  min-height: min(52vh, 420px);
  background:
    linear-gradient(120deg, rgba(15,42,36,0.88), rgba(31,111,91,0.55)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath fill='%23ffffff10' d='M0 80h160v2H0zm80 0v80h2V80z'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #1a4a3d, #2d6b4f 45%, #8b4a28);
  color: #f4faf7;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow);
  animation: rise 0.7s ease both;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0 0 12px;
  max-width: 12ch;
  line-height: 1.05;
}
.hero p {
  margin: 0 0 22px;
  max-width: 38ch;
  font-size: 1.05rem;
  opacity: 0.9;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero-stats div {
  min-width: 88px;
}
.hero-stats b {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
}
.hero-stats span { font-size: 0.82rem; opacity: 0.75; }

.section-title {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 8px 0 8px;
  color: var(--bg-deep);
}
.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}
.stat-card b {
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--bg-deep);
}
.stat-card span { color: var(--muted); font-size: 0.88rem; }
.muted { color: var(--muted); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.course-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  animation: rise 0.45s ease both;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  box-shadow: var(--shadow);
}
.course-card:hover {
  transform: translateY(-2px);
  border-color: #c9d6ef;
  box-shadow: 0 10px 28px rgba(47, 111, 237, 0.12);
}
.course-cover {
  height: 110px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
}
.course-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.28));
  pointer-events: none;
}
.course-cover .folder {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.course-cover .cover-count {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  opacity: 0.9;
}
.course-card-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 10px;
  flex: 1;
}
.course-card h3 {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--bg-deep);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.pill {
  background: var(--accent-soft);
  color: #2556c2;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.card-progress {
  display: grid;
  gap: 6px;
}
.card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.card-progress-label b { color: var(--ink); font-weight: 600; }

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn.primary {
  background: var(--accent);
  color: white;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.btn.secondary:hover { border-color: #c5d0e0; background: #f8fafc; }
.btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.2);
  color: inherit;
}
.side-user .btn.ghost { width: 100%; justify-content: center; }
.btn.warn { background: var(--accent-2); color: #fff; }

/* Курс как в iSpring: оглавление слева + плеер справа */
.course-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) 1fr;
  gap: 0;
  align-items: stretch;
  min-height: calc(100vh - 100px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.outline {
  padding: 0;
  background: #f7f9fc;
  border-right: 1px solid var(--line);
  max-height: calc(100vh - 100px);
  overflow: auto;
  position: sticky;
  top: 72px;
}
.outline-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.outline-head .folder {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.outline h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 6px 0 8px;
  line-height: 1.25;
}
.outline-section {
  padding: 10px 12px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.outline-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 12px 9px 14px;
  cursor: pointer;
  font: inherit;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  border-left: 3px solid transparent;
}
.outline-item:hover { background: #eef3fb; }
.outline-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.outline-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8eef8;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  margin-top: 1px;
}
.outline-text { display: grid; gap: 2px; min-width: 0; }
.outline-title {
  font-size: 0.9rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--ink);
}
.outline-item .k {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.outline-item.done .k { color: var(--good); }
.outline-item.done .outline-ico {
  background: #e5f8ec;
  color: var(--good);
}
.outline-item.done .outline-ico::before { content: none; }

.player {
  padding: 0;
  min-height: 420px;
  animation: fade 0.3s ease;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.player-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.player-scroll {
  padding: 22px 28px 36px;
  flex: 1;
}
.player-kicker { margin: 0 0 8px; }
.kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.player-title, .player h1 {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 750;
  margin: 0 0 18px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--bg-deep);
  max-width: var(--reader-max);
}
.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  max-width: var(--reader-max);
}
.player-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.reader-shell {
  max-width: var(--reader-max);
}

.q-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 14px 0;
  background: #fff;
}
.q-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  margin-bottom: 6px;
  cursor: pointer;
}
.choice:hover { background: #f1f7f3; }
.choice.selected { background: #e4f0ea; border-color: #b7d2c6; }
.choice.good { background: #e5f6ea; border-color: #9dceb0; }
.choice.bad { background: #fdecec; border-color: #efb4b4; }

.article-card {
  display: grid;
  gap: 20px;
  max-width: var(--reader-max);
}
.article-prose, .content-body.article-prose {
  white-space: normal;
  line-height: 1.7;
  font-size: 1.08rem;
  max-width: var(--reader-max);
  color: #243040;
}
.article-prose h2 {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 700;
  margin: 1.5em 0 0.5em;
  line-height: 1.25;
  color: var(--bg-deep);
}
.article-prose h3 {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.25em 0 0.4em;
  line-height: 1.3;
  color: var(--bg-deep);
}
.article-prose h2:first-child,
.article-prose h3:first-child { margin-top: 0; }
.article-prose p {
  margin: 0 0 0.95em;
}
.article-prose ul {
  margin: 0 0 1.1em;
  padding-left: 1.15em;
  list-style: disc;
}
.article-prose li {
  margin: 0.4em 0;
  padding-left: 0.15em;
}
.article-prose .empty { color: var(--muted); }
.content-images {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.content-images.multi {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.content-figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f3f8;
  border: 1px solid var(--line);
}
.content-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: #fff;
}

.video-stage {
  background: #0b1a16;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 42, 36, 0.22);
}
.video-stage.wide { margin-bottom: 8px; }
.video-player {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.video-caption {
  padding: 10px 14px 12px;
  color: #c9ddd4;
  font-size: 0.82rem;
}

.file-stage { display: grid; gap: 12px; }
.file-meta { display: flex; gap: 10px; align-items: center; }
.file-badge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--bg-deep);
  color: #e7f2ec;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.file-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.file-image {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.result-banner {
  padding: 16px 18px;
  border-radius: 16px;
  margin: 12px 0 18px;
  font-weight: 600;
}
.result-banner.pass { background: #e5f6ea; color: var(--good); }
.result-banner.fail { background: #fdecec; color: var(--bad); }

dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: var(--shadow);
  width: min(420px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(10, 24, 20, 0.45); }
.dialog-card { padding: 22px; display: grid; gap: 12px; }
.dialog-card h2 { font-family: var(--display); margin: 0; }
.dialog-card label { display: grid; gap: 6px; font-size: 0.9rem; }
.dialog-card input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}
.dialog-actions { display: flex; gap: 8px; }

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--accent); cursor: pointer; text-decoration: none; }

.hidden { display: none !important; }
.form-error { color: var(--bad); font-size: 0.9rem; margin: 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  background: #eef5f1;
  font-weight: 600;
  position: sticky;
  top: 0;
}
table.data tr:hover td { background: #f7fbf8; }
table.data tr.clickable { cursor: pointer; }

.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status.completed { background: #e5f6ea; color: var(--good); }
.status.in_progress { background: #fff3e6; color: #a85a12; }
.status.not_started { background: #eef1ef; color: var(--muted); }

.progress-bar {
  height: 6px;
  background: #e6ebf2;
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.progress-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.create-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}
.create-box label { display: grid; gap: 4px; font-size: 0.88rem; }
.create-box input, .create-box select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.item-check {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}
.item-check .ok { color: var(--good); }
.item-check .no { color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 960px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    width: min(300px, 86vw);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .course-layout { grid-template-columns: 1fr; min-height: auto; }
  .outline { position: static; max-height: min(42vh, 360px); top: auto; }
  .player-toolbar { flex-wrap: wrap; }
  .view { padding: 16px; }
}

/* ——— Gate / onboarding / hub ——— */
#app.gate-mode {
  grid-template-columns: 1fr;
}
#app.gate-mode .sidebar,
#app.gate-mode .learn-only {
  display: none;
}
#app.gate-mode .main {
  min-height: 100vh;
}
#app.gate-mode .view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.gate {
  animation: rise 0.45s ease both;
}
.gate-top {
  margin-bottom: 28px;
}
.gate-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.gate h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  text-transform: uppercase;
}
.gate-top p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0;
  font-size: 1.05rem;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.brand-tile {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 18px 16px 20px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
  color: inherit;
  font: inherit;
}
.brand-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.brand-code {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  color: #e7f2ec;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
}
.brand-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.auth-choice {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin: 8px 0 24px;
}
.onboard-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.onboard-form .btn.ghost {
  justify-self: start;
}
.onboard-form label,
.ask-form label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ask-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ask-hint {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  text-transform: none;
}
.onboard-form input,
.onboard-form select,
.ask-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  font-weight: 500;
  background: #fff;
}
.btn.big {
  padding: 16px 22px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: 14px;
}
.text-back,
.gate-admin-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  margin-bottom: 12px;
}
.gate-admin-link {
  margin-top: 28px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.hub-tile {
  border: 0;
  border-radius: 28px;
  min-height: 280px;
  padding: 28px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  color: #f4faf7;
  text-align: left;
  font: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.hub-tile:hover {
  transform: translateY(-4px) scale(1.01);
  filter: brightness(1.05);
}
.hub-tile.ask {
  background: linear-gradient(160deg, #1a5c4e 0%, #0f2a24 70%);
}
.hub-tile.learn {
  background: linear-gradient(160deg, #c45c26 0%, #7a3414 75%);
}
.hub-ico {
  margin-bottom: auto;
  opacity: 0.95;
}
.hub-label {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}
.hub-hint {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 16rem;
}

.ask-form {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-bottom: 24px;
}
.ask-answer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  max-width: 720px;
  animation: rise 0.35s ease both;
}
.ask-answer h2 {
  font-family: var(--display);
  margin: 6px 0 10px;
}
.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.feedback-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.btn.feedback {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.feedback.ok:hover { border-color: var(--good); color: var(--good); }
.btn.feedback.bad:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn.feedback.false:hover { border-color: var(--bad); color: var(--bad); }
.feedback-done {
  margin: 8px 0 0;
  color: var(--good);
}
.feedback-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.feedback-filters .chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
  cursor: pointer;
}
.feedback-filters .chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.feedback-list {
  display: grid;
  gap: 12px;
  max-width: 920px;
}
.feedback-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
}
.feedback-card.ok { border-left: 4px solid var(--good); }
.feedback-card.bad { border-left: 4px solid var(--accent-2); }
.feedback-card.false { border-left: 4px solid var(--bad); }
.feedback-card-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font: inherit;
}
.feedback-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feedback-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f0f0f0;
}
.feedback-badge.ok { background: #e7f6ea; color: var(--good); }
.feedback-badge.bad { background: #fff1e8; color: var(--accent-2); }
.feedback-badge.false { background: #fdeaea; color: var(--bad); }
.feedback-card-preview {
  margin-top: 10px;
}
.feedback-card-body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}
.fb-block .fb-label,
.fb-q .fb-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.fb-q {
  font-size: 0.98rem;
  line-height: 1.45;
}
.btn.ghost.small {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.faq-mini {
  display: grid;
  gap: 10px;
  max-width: 720px;
}
.faq-chip {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.faq-chip:hover {
  border-color: var(--accent);
}
.answer-body {
  white-space: normal;
  line-height: 1.55;
  font-size: 1.05rem;
}
.sources ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}
.sources li {
  margin: 4px 0;
}

@media (max-width: 720px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-tile { min-height: 220px; }
}
