:root {
  --bg: #f3f7ff;
  --panel: #ffffff;
  --ink: #11133b;
  --muted: #6d7490;
  --line: #dfe7f7;
  --shadow: 0 16px 45px rgba(39, 72, 142, .12);
  --blue: #2f7df5;
  --blue-soft: #eaf4ff;
  --purple: #7a50d8;
  --purple-soft: #f1e9ff;
  --green: #67a94f;
  --green-soft: #eff9ea;
  --sky: #4a9bed;
  --sky-soft: #eef7ff;
  --orange: #f28b25;
  --orange-soft: #fff4df;
  --red: #ef514b;
  --red-soft: #fff0ee;
  --gold: #e8a81f;
  --gold-soft: #fff7df;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --sidebar-width: 90px;
  --topbar-height: 76px;
  font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(75, 130, 255, .16), transparent 32rem),
    radial-gradient(circle at top right, rgba(255, 188, 53, .18), transparent 28rem),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 16px 10px;
  background: rgba(255, 255, 255, .92);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(54, 80, 135, .08);
  backdrop-filter: blur(16px);
}

.app-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(135deg, #1266db, #3292ff);
  box-shadow: 0 14px 25px rgba(18, 102, 219, .28);
  font-size: 24px;
}

.side-nav {
  width: 100%;
  display: grid;
  gap: 12px;
}

.side-nav__item {
  position: relative;
  min-height: 58px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 16px;
  color: #4f5d78;
  transition: .2s ease;
}

.side-nav__item span {
  font-size: 22px;
  line-height: 1;
}

.side-nav__item b {
  font-size: 11px;
  font-weight: 700;
}

.side-nav__item:hover,
.side-nav__item--active {
  color: #176fe4;
  background: #eef6ff;
}

.side-nav__item--active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 13px;
  width: 4px;
  height: 32px;
  border-radius: 0 8px 8px 0;
  background: #176fe4;
}

.help-link {
  margin-top: auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #8ba0c2;
  border-radius: 50%;
  color: #536883;
  font-weight: 800;
}

.workspace {
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px 0 28px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(60, 85, 132, .08);
  backdrop-filter: blur(16px);
}

.brand,
.topbar__actions,
.profile,
.avatars,
.desktop-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 240px;
  font-weight: 900;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #f4f8ff;
  border: 1px solid #dce9ff;
  font-size: 24px;
}

.brand__name {
  font-size: 18px;
}

.brand__chevron {
  color: #596a87;
}

.desktop-nav {
  gap: 22px;
  margin-right: auto;
  padding-left: 14px;
  color: #2d3557;
  font-weight: 800;
}

.desktop-nav a:first-child::after {
  content: "★";
  display: inline-block;
  margin-left: 8px;
  color: #276df4;
}

.topbar__actions {
  gap: 12px;
}

.avatars span,
.avatars b,
.profile > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -7px;
  border: 3px solid white;
  border-radius: 50%;
  background: #e9f1ff;
  box-shadow: 0 6px 15px rgba(40, 70, 125, .12);
}

.avatars span:first-child {
  margin-left: 0;
}

.avatars b {
  color: #1d5fcf;
  background: #e3eeff;
  font-size: 13px;
}

.invite-btn,
.btn,
.diagnostic-card__btn {
  border: 0;
  border-radius: 13px;
  color: white;
  background: linear-gradient(135deg, #176ee5, #0d79ff);
  box-shadow: 0 12px 28px rgba(22, 110, 229, .25);
  font-weight: 900;
}

.invite-btn {
  padding: 12px 22px;
}

.icon-btn,
.menu-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #29334d;
  background: #f7f9fe;
  font-size: 20px;
}

.profile {
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.profile b,
.profile small {
  display: block;
  white-space: nowrap;
}

.profile small {
  color: var(--muted);
}

.menu-btn {
  display: none;
}

.main-board {
  padding: 26px 18px 30px;
  overflow: hidden;
}

.hero-board {
  position: relative;
  min-height: 185px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle, rgba(41, 111, 238, .14) 1px, transparent 1px) 0 0 / 22px 22px,
    rgba(255, 255, 255, .58);
}

.hero-board__text {
  text-align: center;
}

.hero-board h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 78px);
  line-height: .98;
  letter-spacing: .01em;
}

.hero-board p {
  margin: 18px 0 0;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 700;
  color: #22294a;
}

.hero-board__decor {
  position: absolute;
  filter: drop-shadow(0 8px 12px rgba(40, 70, 120, .12));
  pointer-events: none;
  user-select: none;
}

.hero-board__decor--left {
  left: 72px;
  top: 34px;
  font-size: 52px;
}

.hero-board__decor--book {
  left: 190px;
  bottom: 35px;
  font-size: 56px;
}

.hero-board__decor--puzzle {
  right: 170px;
  top: 34px;
  font-size: 72px;
}

.hero-board__decor--plane {
  right: 52px;
  top: 42px;
  color: #176ee5;
  font-size: 44px;
  transform: rotate(-10deg);
}

.search-panel {
  max-width: 1120px;
  margin: 0 auto 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 10px 25px rgba(45, 75, 135, .06);
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.search-panel__row {
  display: flex;
  gap: 10px;
}

.search-panel input,
.quiz-modal select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9e5f7;
  border-radius: 13px;
  padding: 0 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.search-panel input:focus,
.quiz-modal select:focus {
  border-color: #3484f5;
  box-shadow: 0 0 0 4px rgba(52, 132, 245, .12);
}

.btn {
  min-height: 46px;
  padding: 0 18px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
}

.column {
  min-height: 600px;
  padding: 13px 10px 18px;
  border: 1px solid rgba(208, 220, 240, .95);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 34px rgba(41, 70, 130, .08);
}

.column__header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 7px 12px;
}

.column__number {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--blue);
  box-shadow: 0 8px 16px rgba(47, 125, 245, .22);
  font-weight: 900;
  font-size: 17px;
}

.column h2 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.22;
}

.card {
  width: 100%;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 8px 0;
  padding: 14px 13px;
  border: 1px solid rgba(87, 143, 233, .22);
  border-radius: 13px;
  text-align: left;
  color: #141a3f;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .52));
  box-shadow: 0 8px 18px rgba(35, 66, 124, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .18s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 125, 245, .42);
  box-shadow: 0 14px 26px rgba(35, 66, 124, .12);
  outline: none;
}

.card.is-active {
  outline: 3px solid rgba(47, 125, 245, .2);
  border-color: rgba(47, 125, 245, .7);
}

.card.is-hidden {
  display: none;
}


.card--link::after {
  content: "›";
  margin-left: auto;
  color: #176ee5;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.column.is-targeted,
.search-panel.is-targeted,
.info-box.is-targeted,
.bottom-zone.is-targeted {
  outline: 4px solid rgba(47, 125, 245, .24);
  outline-offset: 4px;
}

.card__icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
  font-size: 24px;
}

.card b {
  font-size: 15px;
  line-height: 1.3;
}

.column--blue .column__number,
.column--blue .card__icon { background-color: var(--blue); color: #fff; }
.column--purple .column__number,
.column--purple .card__icon { background-color: var(--purple); color: #fff; }
.column--green .column__number,
.column--green .card__icon { background-color: var(--green); color: #fff; }
.column--sky .column__number,
.column--sky .card__icon { background-color: var(--sky); color: #fff; }
.column--orange .column__number,
.column--orange .card__icon { background-color: var(--orange); color: #fff; }
.column--red .column__number,
.column--red .card__icon { background-color: var(--red); color: #fff; }
.column--gold .column__number,
.column--gold .card__icon { background-color: var(--gold); color: #fff; }

.column--blue .card { background: linear-gradient(180deg, var(--blue-soft), #f8fbff); border-color: #b9dcff; }
.column--purple .card { background: linear-gradient(180deg, var(--purple-soft), #fbf9ff); border-color: #dac7ff; }
.column--green .card { background: linear-gradient(180deg, var(--green-soft), #fbfff8); border-color: #c9e8bb; }
.column--sky .card { background: linear-gradient(180deg, var(--sky-soft), #f8fcff); border-color: #c8e4ff; }
.column--orange .card { background: linear-gradient(180deg, var(--orange-soft), #fffaf1); border-color: #ffddb0; }
.column--red .card { background: linear-gradient(180deg, var(--red-soft), #fff9f8); border-color: #ffc9c4; }
.column--gold .card { background: linear-gradient(180deg, var(--gold-soft), #fffaf0); border-color: #f8df9f; }

.bottom-zone {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(460px, 670px);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.info-box,
.diagnostic-card {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.info-box {
  min-height: 100px;
  padding: 20px 24px;
}

.info-box__icon,
.diagnostic-card__icon {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #eef6ff;
  color: #216fe5;
  font-size: 34px;
}

.info-box h2,
.diagnostic-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.info-box p,
.diagnostic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.diagnostic-card {
  position: relative;
  overflow: hidden;
  padding: 20px 28px;
}

.diagnostic-card::after {
  content: "↢";
  position: absolute;
  right: 24px;
  top: 18px;
  color: #73a9f6;
  font-size: 42px;
  opacity: .6;
  transform: rotate(-15deg);
}

.diagnostic-card__btn {
  margin-left: auto;
  min-width: 140px;
  padding: 16px 24px;
  font-size: 18px;
}

.quiz-modal {
  width: min(560px, calc(100% - 30px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 24px 90px rgba(13, 28, 70, .32);
}

.quiz-modal::backdrop {
  background: rgba(10, 22, 46, .42);
  backdrop-filter: blur(5px);
}

.quiz-modal__content {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 30px;
  background: white;
}

.quiz-modal__close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f0f4fb;
  font-size: 24px;
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: #2f7df5;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.quiz-modal h2 {
  margin: 0;
  font-size: 28px;
}

.quiz-modal label {
  color: var(--muted);
  font-weight: 800;
}

.quiz-result {
  min-height: 44px;
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  color: #1e365a;
  background: #eef6ff;
  font-weight: 800;
}

body.nav-open .desktop-nav {
  display: flex;
}

@media (max-width: 1680px) {
  .kanban {
    grid-template-columns: repeat(7, minmax(175px, 1fr));
    gap: 10px;
  }

  .card {
    min-height: 78px;
    padding: 12px 10px;
  }

  .card b {
    font-size: 14px;
  }
}

@media (max-width: 1380px) {
  .main-board {
    overflow-x: auto;
  }

  .kanban {
    width: 1320px;
  }

  .bottom-zone {
    width: 1320px;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 76px;
  }

  .desktop-nav,
  .avatars,
  .icon-btn,
  .profile {
    display: none;
  }

  .menu-btn {
    display: grid;
  }

  body.nav-open .desktop-nav {
    position: absolute;
    left: 90px;
    right: 16px;
    top: 78px;
    z-index: 22;
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow);
  }

  .brand {
    min-width: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 72px;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .app-button,
  .help-link {
    display: none;
  }

  .side-nav {
    display: flex;
    justify-content: space-around;
  }

  .side-nav__item {
    min-height: 54px;
    min-width: 54px;
    padding: 5px;
  }

  .side-nav__item b {
    display: none;
  }

  .side-nav__item--active::before {
    left: 50%;
    top: auto;
    bottom: -8px;
    width: 28px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 8px 8px 0 0;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand__name {
    font-size: 16px;
  }

  .invite-btn {
    display: none;
  }

  .main-board {
    padding: 14px 12px 96px;
  }

  .hero-board {
    min-height: 150px;
  }

  .hero-board h1 {
    font-size: 42px;
  }

  .hero-board p {
    font-size: 18px;
    max-width: 310px;
  }

  .hero-board__decor {
    opacity: .35;
  }

  .hero-board__decor--left { left: 18px; top: 18px; }
  .hero-board__decor--book { left: 46px; bottom: 14px; }
  .hero-board__decor--puzzle { right: 34px; top: 18px; }
  .hero-board__decor--plane { right: 16px; top: 88px; }

  .search-panel__row {
    display: grid;
  }

  .kanban,
  .bottom-zone {
    width: 1240px;
  }
}


/* === Отдельные страницы карточек === */
.card--link {
  position: relative;
}

.card__open {
  margin-left: auto;
  color: currentColor;
  opacity: .48;
  font-size: 24px;
  font-weight: 900;
  transition: .2s ease;
}

.card--link:hover .card__open {
  opacity: 1;
  transform: translateX(3px);
}

.detail-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 125, 245, .16), transparent 30rem),
    radial-gradient(circle at top right, rgba(232, 168, 31, .18), transparent 28rem),
    var(--bg);
}

.detail-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.detail-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.back-link,
.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #176ee5, #0d79ff);
  box-shadow: 0 12px 28px rgba(22, 110, 229, .2);
  font-weight: 900;
}

.back-link--ghost,
.detail-btn--light {
  color: #176ee5;
  background: white;
  border: 1px solid #dbe8ff;
  box-shadow: 0 10px 25px rgba(68, 90, 135, .09);
}

.detail-hero {
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.detail-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(47,125,245,.12);
}

.detail-hero--purple::after { background: rgba(122, 80, 216, .14); }
.detail-hero--green::after { background: rgba(103, 169, 79, .16); }
.detail-hero--sky::after { background: rgba(74, 155, 237, .16); }
.detail-hero--orange::after { background: rgba(242, 139, 37, .16); }
.detail-hero--red::after { background: rgba(239, 81, 75, .14); }
.detail-hero--gold::after { background: rgba(232, 168, 31, .18); }

.detail-hero__badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #176ee5;
  background: #edf5ff;
  font-weight: 900;
}

.detail-hero__main {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: center;
}

.detail-hero__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 26px;
  background: #f2f7ff;
  border: 1px solid #dce9ff;
  font-size: 44px;
  box-shadow: 0 16px 35px rgba(60, 88, 145, .12);
}

.detail-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -.04em;
}

.detail-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-card,
.related-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 35px rgba(52, 76, 130, .1);
}

.detail-card--large {
  grid-column: span 2;
}

.detail-card h2,
.related-section h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  color: #293155;
  line-height: 1.7;
  font-weight: 700;
}

.template-box {
  padding: 18px;
  border-radius: 18px;
  color: #293155;
  background: #f4f8ff;
  border: 1px dashed #bcd3ff;
  line-height: 1.65;
  font-weight: 700;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.related-section {
  margin-top: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f8fbff;
  font-weight: 900;
  transition: .2s ease;
}

.related-card span {
  font-size: 28px;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(50, 73, 130, .14);
}

.related-card--purple { background: var(--purple-soft); }
.related-card--green { background: var(--green-soft); }
.related-card--sky { background: var(--sky-soft); }
.related-card--orange { background: var(--orange-soft); }
.related-card--red { background: var(--red-soft); }
.related-card--gold { background: var(--gold-soft); }
.related-card--blue { background: var(--blue-soft); }

@media (max-width: 860px) {
  .detail-topline,
  .detail-hero__main {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .detail-card--large {
    grid-column: span 1;
  }
}
