/* === КАСТОМНИЙ ШРИФТ ДЛЯ ІМЕНІ НА СЕРТИФІКАТІ === */
@font-face {
  font-family: "Shelley Script LT CYR W05 Rg";
  src: url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.eot");
  src:
    url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.eot?#iefix") format("embedded-opentype"),
    url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.woff2") format("woff2"),
    url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.woff") format("woff"),
    url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.ttf") format("truetype"),
    url("https://db.onlinewebfonts.com/t/11581ba8da211da3d91d267948d6cf62.svg#Shelley Script LT CYR W05 Rg") format("svg");
}


:root {
  /* Кольори */
  --bg: #f2f3f8;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #707791;
  --primary: #5a35ff;
  --primary-weak: rgba(90,53,255,.08);
  --primary-soft: rgba(90,53,255,.07);
  --primary-grad: linear-gradient(120deg, #5a35ff 0%, #b666ff 100%);
  --danger: #ff5271;
  --line: rgba(25, 33, 68, 0.06);

  /* Тіні */
  --shadow-sm: 0 10px 30px rgba(14, 26, 45, 0.04);
  --shadow-card: 0 16px 40px rgba(14, 26, 45, 0.03);

  /* Типографіка: базово ≥ 16px на десктопі */
  --fs-base: clamp(1rem, 1.05vw, 1.0625rem); /* 16..17 */
  --fs-sm: clamp(0.9rem, 0.9vw, 0.95rem);
  --fs-xs: clamp(0.8rem, 0.8vw, 0.9rem);
  --fs-h1: clamp(1.6rem, 2.2vw, 2rem);
  --fs-h2: clamp(1.4rem, 1.8vw, 1.6rem);
  --fs-h3: clamp(1.1rem, 1.4vw, 1.25rem);

  /* Розміри, відступи */
  --pad-page: clamp(1rem, 3vw, 1.8rem);
  --sidebar-w: clamp(210px, 18vw, 240px);

  /* Уніфіковані відступи */
  --space-1: clamp(0.35rem, 0.9vw, 0.5rem);
  --space-2: clamp(0.5rem, 1.2vw, 0.75rem);
  --space-3: clamp(0.75rem, 1.6vw, 1rem);
  --space-4: clamp(1rem, 2vw, 1.3rem);
  --space-5: clamp(1.2rem, 2.4vw, 1.6rem);

  /* Радіуси */
  --radius-sm: clamp(0.5rem, 1vw, 0.7rem);
  --radius: clamp(0.75rem, 1.4vw, 1rem);
  --radius-lg: clamp(1rem, 2vw, 1.5rem);
  --radius-pill: 999px;

  /* Кнопки/іконки */
  --icon: clamp(1.1rem, 1.5vw, 1.25rem);
  --ctrl: clamp(32px, 3.4vw, 36px);

  /* Висоти */
  --topbar-h: clamp(56px, 6.2vw, 62px);
}

@media (max-width: 1024px) {
  :root {
    --fs-base: clamp(0.97rem, 2.5vw, 1rem);
  }
  .topbar {
    justify-content: space-between;
  }
}

@media (max-width: 767px) {
  :root {
    --fs-base: clamp(0.95rem, 3.8vw, 1rem);
  }
}

/* ================== RESETS ================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Commissioner", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ================== LAYOUT ================== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* --------- Sidebar --------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid rgba(25, 33, 68, 0.05);
  padding: var(--space-4) clamp(0.7rem, 1.6vw, 0.9rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.sidebar__brand {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.sidebar__img {
  width: clamp(36px, 3vw, 40px);
  height: clamp(36px, 3vw, 40px);
  object-fit: contain;
}
.sidebar__brand-text h1 {
  margin: 0;
  font-size: var(--fs-h3);
}
.sidebar__brand-text p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.sidebar__title {
  font-size: clamp(0.72rem, 0.8vw, 0.78rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(0,0,0,.45);
  margin: var(--space-2) 0 var(--space-1) calc(var(--space-2) + .2rem);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: clamp(0.3rem, .8vw, .45rem);
}

.nav-link {
  background: transparent;
  border: none;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: clamp(0.5rem, 1.2vw, 0.65rem) clamp(0.6rem, 1.4vw, 0.8rem);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-size: clamp(0.95rem, 1vw, 1rem);
  transition: background .12s ease, transform .12s ease;
}
.nav-link i { font-size: clamp(1.2rem, 1.6vw, 1.35rem); }
.nav-link:hover,
.nav-link.active {
  background: var(--primary-weak);
}

.sidebar__footer {
  margin-top: auto;
}

.sidebar-upgrade {
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.sidebar-upgrade h4 {
  margin: 0 0 .2rem;
  font-size: clamp(0.9rem, 1vw, 1rem);
}
.sidebar-upgrade p {
  margin: 0 0 .5rem;
  font-size: var(--fs-sm);
  color: #4a4f5f;
}
.sidebar-upgrade .btn { width: 100%; }

/* “Запроси вчителя / викладача” */
.sidebar .teacher-requests {
  background: #f0ebff;
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-top: var(--space-3);
}
.teacher-requests h4 {
  margin: 0 0 .3rem;
  font-size: clamp(0.92rem, 1vw, 1rem);
}
.teacher-requests p {
  margin: 0 0 .5rem;
  font-size: var(--fs-sm);
  color: #4a4f5f;
}
.teacher-requests .btn {
  width: 100%;
  background: #fff;
  color: var(--primary);
}

/* --------- Main --------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;          /* ДАЄМО стискатись усередині layout */
}

/* ================== TOPBAR ================== */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid rgba(25,33,68,.05);
  display: flex;
  justify-content: flex-end;
  gap: clamp(0.6rem, 1.2vw, 0.8rem);
  align-items: center;
  padding: 0 var(--pad-page);
  position: sticky;
  top: 0;
  z-index: 25;
}
.btn-icon {
  width: var(--ctrl);
  height: var(--ctrl);
  border-radius: var(--radius-pill);
  border: none;
  background: #f5f6fe;
  display: grid;
  place-items: center;
  font-size: var(--icon);
  color: var(--text);
  cursor: pointer;
}
.mobile-toggle { display: none; }

.topbar__right {
  display: flex;
  gap: clamp(0.5rem, 1.1vw, 0.75rem);
  align-items: center;
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: clamp(0.15rem, .6vw, .25rem) clamp(0.8rem, 1.6vw, 1rem);
  box-shadow: 0 12px 30px rgba(0,0,0,.04);
  position: relative;
}
.topbar__info h4 {
  margin: 0;
  font-size: clamp(0.98rem, 1.1vw, 1.05rem);
  font-weight: 700;
}
.topbar__info p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.user-menu__toggle { display: none; }
.user-caret { cursor: pointer; }
.user-menu {
  position: absolute;
  right: 0;
  top: 120%;
  background: #fff;
  border-radius: var(--radius);
  min-width: 160px;
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
  display: none;
  padding: .35rem;
}
.user-menu__item {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: .5rem .6rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: clamp(0.95rem, 1vw, 1rem);
  cursor: pointer;
}
.user-menu__item:hover { background: var(--primary-weak); }
.user-menu__toggle:checked ~ .user-menu { display: block; }

/* ================== CONTENT ================== */
.content {
  padding: var(--space-4) var(--pad-page) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;          /* щоб і контент не розтягував main */
}
.view { display: none; }
.view.active { display: block; }

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-h2);
  font-weight: 800;
  margin: 0;
}

/* ================== CARDS & BUTTONS ================== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1rem, 2vw, 1.2rem) clamp(1rem, 2vw, 1.25rem);
  margin-top: 2rem;
}
.btn {
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  font-size: clamp(0.95rem, 1vw, 1rem);
  padding: clamp(0.45rem, 1.2vw, 0.55rem) clamp(1rem, 2.2vw, 1.25rem);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-dark { background: #1f2430; color: #fff; }
.btn-light { background: var(--primary-soft); color: var(--text); }
.text-muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* ================== ОЛІМПІАДА / учнівська частина ================== */
.olymp-head-row {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
  margin: var(--space-3) 0;
}
.rosdilyau {
  display: flex;
  flex-direction: row;
  background: var(--primary-grad);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  width: 100%;
  gap: var(--space-3);
}
.olymp-main-card {
  background: linear-gradient(-120deg, #5a35ff 0%, #b666ff 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  width: 70%;
}
.olymp-main-card h3 {
  margin: 0 0 .25rem;
  font-size: var(--fs-h3);
}
.olymp-main-card p {
  margin: 0;
  font-size: clamp(0.98rem, 1.05vw, 1.05rem);
}
.ref-inline { display: flex; flex-direction: column; gap: .4rem; }
.ref-label { font-size: clamp(0.82rem, .95vw, .9rem); opacity: .9; }
.ref-inline-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.ref-inline-code {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: clamp(0.45rem, 1.2vw, 0.55rem) clamp(1rem, 2.2vw, 1.25rem);
  letter-spacing: .12em;
  font-weight: 800;
  font-size: clamp(0.95rem, 1vw, 1.05rem);
}
.olymp-stats {
  width: 30%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  align-content: flex-start;
}
.olymp-stat-tile:nth-child(3) {
  grid-column: 1 / -1;   /* третя картка розтягується на дві колонки */
}
.olymp-stat-tile {
  background: #fff;
  border-radius: var(--radius);
  padding: clamp(0.7rem, 1.6vw, 0.9rem);
  box-shadow: var(--shadow-sm);
}
.olymp-stat-tile p {
  margin: 0;
  font-size: var(--fs-sm);
  color: #5b6274;
}
.olymp-stat-tile h2 {
  margin: .2rem 0 0;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
}

/* Таблиці */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: clamp(520px, 60vw, 740px);
}
.table th, .table td {
  text-align: left;
  padding: clamp(0.55rem, 1.3vw, 0.7rem) clamp(0.35rem, 1vw, 0.5rem);
  font-size: clamp(0.95rem, 1vw, 1rem);
}
.table thead th {
  background: #f1f3ff;
  color: #7b8294;
  font-weight: 700;
}
.table tbody tr:nth-child(even) td { background: #f9f9ff; }

/* ================== ПРОФІЛЬ ================== */
.profile-shell {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.profile-col-left--white,
.profile-col-right--white {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1rem, 2vw, 1.2rem);
}
.profile-col-left--white { width: 50%; }
.profile-col-right--white { flex: 1; }

.profile-box {
  background: #f7f7fe;
  border-radius: var(--radius);
  padding: clamp(0.75rem, 1.6vw, 0.9rem);
  margin-bottom: clamp(0.6rem, 1.2vw, 0.8rem);
}
.profile-box h3 {
  margin: 0 0 .5rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: clamp(0.98rem, 1vw, 1.05rem);
  margin-bottom: .35rem;
}
.profile-row span:first-child { color: #596074; }

/* Форми */
.auth-form,
.edit-form {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.2vw, 0.65rem);
}
.edit-form label {
  font-size: clamp(0.85rem, 0.95vw, 0.9rem);
  font-weight: 600;
}
.edit-form input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(25,33,68,.08);
  padding: clamp(0.45rem, 1.2vw, 0.55rem) clamp(0.6rem, 1.6vw, 0.8rem);
  font-family: inherit;
  background: #fff;
  font-size: clamp(0.98rem, 1vw, 1.05rem);
  outline: none;
  transition: .12s;
}
.edit-form input:focus {
  border-color: rgba(90,53,255,.55);
  box-shadow: 0 0 0 3px rgba(90,53,255,.08);
}
.class-input {
  flex: 1;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(90, 53, 255, 0.21);
  padding: clamp(0.45rem, 1.2vw, 0.55rem) clamp(0.7rem, 1.8vw, 0.9rem);
  font-size: clamp(0.98rem, 1vw, 1.05rem);
  background: #fff;
}
.two-cols {
  display: flex;
  gap: var(--space-2);
  flex-direction: row !important;
}
.two-cols div {
  display: flex;
  flex-direction: column;
  width: 30%;
}
.two-cols input { width: 100%; }
#stuUpdateStatus { font-size: var(--fs-xs); margin-top: .3rem; }

/* ================== AUTH PAGE (вхід і учня, і вчителя) ================== */
.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #f1eaff 0%, #eef0ff 45%, #eaedf4 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 2.5rem);
}
.auth-shell {
  width: min(1100px, 100%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border-radius: clamp(1.1rem, 2vw, 1.6rem);
  box-shadow: 0 18px 50px rgba(35, 43, 76, 0.12);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(350px, 0.7fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  overflow: hidden;
}
.auth-left {
  background: radial-gradient(circle at top, rgba(84, 40, 255, 0.07), rgba(84, 40, 255, 0)) #fff;
  padding: clamp(1.2rem, 3vw, 2.1rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.9rem, 2.4vw, 1.25rem);
  border-right: 1px solid rgba(0,0,0,0.03);
}
.auth-brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.auth-logo {
  width: clamp(40px, 5vw, 50px);
  height: auto;
}
.auth-tag {
  font-size: clamp(0.65rem, 1.1vw, 0.75rem);
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 .25rem;
  letter-spacing: .12em;
}
.auth-left h1 {
  font-size: var(--fs-h1);
  margin: 0;
  color: var(--text);
}
.auth-lead {
  color: #475066;
  max-width: 32rem;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
}
.auth-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .5rem;
  font-size: clamp(0.95rem, 1.1vw, 1rem);
  color: var(--text);
}
.auth-mini-stats { display: flex; gap: .6rem; flex-wrap: wrap; }
.auth-stat {
  background: var(--primary-soft);
  border: 1px solid rgba(90, 53, 255, 0.16);
  border-radius: var(--radius);
  padding: .5rem .9rem;
}
.auth-stat span {
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  font-weight: 700;
  display: block;
}
.auth-stat p { font-size: var(--fs-sm); margin: 0; color: #5f6676; }

.auth-right {
  background: #fff;
  padding: clamp(1.2rem, 2.3vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card {
  background: #fff;
  border-radius: clamp(1rem, 1.5vw, 1.2rem);
  border: 1px solid rgba(25, 32, 56, 0.02);
  box-shadow: 0 12px 30px rgba(48, 44, 88, 0.03);
}
.auth-card h2 {
  font-size: clamp(1.3rem, 1.6vw, 1.5rem);
  margin-bottom: .35rem;
}
.auth-sub {
  color: #6c7383;
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  margin-bottom: 1.05rem;
}
.input-shell {
  display: flex;
  align-items: center;
  background: #f5f6fe;
  border-radius: var(--radius);
  border: 1px solid transparent;
  gap: .4rem;
  padding: .45rem .55rem .45rem .65rem;
}
.input-shell:focus-within {
  border-color: rgba(90, 53, 255, 0.4);
  background: #fff;
}
.input-icon {
  color: var(--primary);
  display: grid;
  place-items: center;
}
.input-shell input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: clamp(0.98rem, 1vw, 1.05rem);
  padding: .35rem .2rem;
}
.password-shell { position: relative; }
.pass-toggle {
  border: none;
  background: none;
  font-size: clamp(0.78rem, .9vw, .85rem);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: .25rem .35rem;
}
.auth-btn {
  margin-top: .4rem;
  width: 100%;
  background: var(--primary-grad);
  color: #fff;
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.auth-btn:hover { opacity: .98; }
.auth-message {
  min-height: 1.2rem;
  font-size: var(--fs-xs);
  margin-top: .25rem;
  color: var(--muted);
}
.auth-footer {
  margin-top: .9rem;
  font-size: var(--fs-xs);
  color: #7b8394;
}
.auth-footer a { color: var(--primary); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-bottom-note { margin-top: 1rem; font-size: .72rem; color: rgba(0,0,0,.35); }

/* ================== COMPONENTS / MISC ================== */
.resource-card__thumb {
  background:
    radial-gradient(circle at 2px 2px, rgba(90,53,255,.12) 2px, transparent 2px) 0 0/18px 18px,
    linear-gradient(135deg, #f7f7ff, #eef0ff 60%, #eaefff);
}

/* ===== Notice card над лідербордом (в обох кабінетах) ===== */
.notice-card {
  display: flex;
  gap: clamp(0.7rem, 1.6vw, 0.9rem);
  align-items: flex-start;
  background: var(--primary-soft);
  border-radius: var(--radius);
  padding: clamp(0.85rem, 1.8vw, 1rem) clamp(1rem, 2.2vw, 1.2rem);
  border: 1px solid rgba(90,53,255,0.15);
  box-shadow: var(--shadow-sm);
  margin-bottom: .8rem;
}
.notice-card__icon {
  flex: 0 0 clamp(32px, 3.2vw, 36px);
  width: clamp(32px, 3.2vw, 36px);
  height: clamp(32px, 3.2vw, 36px);
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 6px 18px rgba(90,53,255,0.15);
}
.notice-card__icon i { font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
.notice-card__body h4 {
  margin: 0 0 .2rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
}
.notice-card__body p { margin: .15rem 0 0; }

/* ================== TEACHER DASHBOARD ADDITIONS ==================
   ці класи взяті з розмітки кабінету викладача (index.html)
   щоб обидві сторінки мали один стиль
   ================================================================ */

/* Верхня зона з hero та картками */
.dashboard-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr);
  gap: var(--space-3);
  align-items: stretch;
  margin-top: var(--space-3);
}

.teacher-hero {
  background: radial-gradient(circle at top, rgba(90,53,255,0.07), rgba(90,53,255,0)) #fff;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: clamp(210px, 22vw, 260px);
}
.teacher-hero__content h3 {
  font-size: clamp(1.2rem, 1.7vw, 1.4rem);
  margin-top: 0;
  margin-bottom: .4rem;
}
.teacher-hero__content p {
  margin: 0 0 .75rem;
  color: #4c5263;
}
.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.hero-pill {
  background: #fff;
  border: 1px solid rgba(90,53,255,.12);
  border-radius: clamp(1.4rem, 2.8vw, 1.8rem);
  padding: .4rem .9rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  box-shadow: 0 10px 24px rgba(44, 34, 96, 0.03);
}
.hero-pill__title {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* Соцмережі / мінікартки праворуч */
.social-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.social-links {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.social-links a .btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* Корисне: грід з ресурсами (вчитель) */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 2vw, 1.3rem);
  margin-top: var(--space-3);
}
.resource-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}
.resource-card__thumb {
  position: relative;
  min-height: 128px;
  border-bottom: 1px solid rgba(25,33,68,.03);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.resource-card__thumb .badge {
  position: absolute;
  top: .7rem;
  right: .7rem;
}
.resource-card__body {
  padding: clamp(.7rem, 1.6vw, .95rem) clamp(.75rem, 1.6vw, 1rem);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.resource-card__body h4 {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.05rem);
}
.resource-card__body p {
  margin: 0;
  color: #5f6676;
  font-size: var(--fs-sm);
}
.resource-card__actions {
  margin-top: .5rem;
  display: flex;
  gap: .4rem;
}
.badge {
  display: inline-flex;
  padding: .15rem .6rem;
  background: #fff;
  border-radius: 999px;
  font-size: .625rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  border: 1px solid rgba(90,53,255,.12);
}

/* Заголовок картки */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .65rem;
}
.card-head h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
}
.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Вкладки класів у викладача */
.class-tabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.class-tabs button,
.class-tabs .tab {
  border: none;
  background: rgba(90,53,255,.04);
  color: #3f4554;
  border-radius: 999px;
  padding: .35rem .85rem;
  font-weight: 600;
  cursor: pointer;
  font-size: .78rem;
  transition: .12s;
}
.class-tabs button.active,
.class-tabs .tab.active {
  background: #fff;
  border: 1px solid rgba(90,53,255,.18);
  box-shadow: 0 10px 22px rgba(87, 58, 255, 0.06);
  color: #1f2430;
}

/* ================== RESPONSIVE ================== */

/* ----- Desktop wide to tablet (≤1180px): дробимо верхній ряд ----- */
@media (max-width: 767px) {
  .olymp-stats {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .olymp-stat-tile:nth-child(3) {
    grid-column: auto;
  }
}

/* ----- Tablet (768–1024): фіксимо меню, сітки, падинги ----- */
@media (max-width: 1024px) {
  .layout { flex-direction: column; }

  .topbar {
    justify-content: space-between;
  }
  .sidebar {
    position: fixed;
    left: calc(var(--sidebar-w) * -1);
    transition: left .25s ease;
    height: 100vh;
    top: 0;
  }
  .sidebar.sidebar--open { left: 0; }
  .mobile-toggle { display: inline-grid; }

  .content { padding-inline: clamp(0.8rem, 3vw, 1.2rem); }

  .profile-shell { flex-direction: column; }
  .profile-col-left--white,
  .profile-col-right--white { width: 100%; }

  .table { min-width: clamp(480px, 85vw, 620px); }

  .card { padding: clamp(0.9rem, 2.2vw, 1.1rem); }
}

/* ----- Mobile (≤767): вертикальне вирівнювання всього ----- */
@media (max-width: 767px) {
  .topbar__info p { display: none; }
  .topbar { justify-content: space-between; }

  .rosdilyau {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: clamp(0.9rem, 4vw, 1.1rem);
    gap: clamp(0.5rem, 3vw, 0.7rem);
  }

  .ref-inline-row {
    flex-direction: row;
    align-items: flex-start;
    gap: .5rem;
  }
  .olymp-stat-tile { align-items: flex-start; }

  /* таблиці у викладача та учня — без скролу */
  #view-leaderboard .table-wrapper,
  #view-dashboard .table-wrapper {
    overflow-x: visible;
  }
  #view-leaderboard .table,
  #view-dashboard .table {
    min-width: 0;
    table-layout: fixed;
  }
  #view-leaderboard .table th,
  #view-leaderboard .table td,
  #view-dashboard .table th,
  #view-dashboard .table td {
    white-space: normal;
    word-wrap: break-word;
    vertical-align: middle;
    text-align: center;
    padding: clamp(0.45rem, 3.5vw, 0.6rem);
  }
  #view-leaderboard .table th:nth-child(1),
  #view-leaderboard .table td:nth-child(1),
  #view-dashboard .table th:nth-child(1),
  #view-dashboard .table td:nth-child(1) { width: 48px; }

  .auth-left,
  .auth-right {
    padding-inline: clamp(0.8rem, 4vw, 1.2rem);
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Auth simplify (≤880) ----- */
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.03); }
  .auth-right { padding-top: 1rem; }
  .auth-body { padding: 0; }
}

/* ----- Extra-narrow auth (≤540) ----- */
@media (max-width: 540px) {
  .auth-list,
  .auth-mini-stats { display: none; }
  .auth-body { padding: 1rem clamp(0.75rem, 4vw, 1.2rem); }
  .auth-shell { width: 100%; border-radius: var(--radius); }
  .auth-card { box-shadow: none; border: none; padding: 0; }
}

/* ================== OVERLAY (для мобільного меню) ================== */
#sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 14;
  display: none;
}

/* ================== FINER TWEAKS ================== */
.olymp-stats > .olymp-stat-tile { margin-bottom: .6rem; }
.olymp-stats > .olymp-stat-tile:last-child { margin-bottom: 0; }

.partners {
  display: flex;
  gap: clamp(0.8rem, 2vw, 1rem);
  align-items: center;
  margin-bottom: var(--space-4);
  flex-direction: row;
}
.partners img {
  width: clamp(120px, 15vw, 150px);
  object-fit: contain;
}
.partners p {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  font-weight: 600;
}

/* Combo (географія) */
.combo {
  position: relative;
}
.combo[aria-disabled="true"] {
  opacity: .55;
  pointer-events: none;
}
.combo__button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
}
.combo__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 21, 32, .12);
  padding: 8px;
  z-index: 50;
  display: none;
  max-height: 320px;
}
.combo.open .combo__menu { display: block; }
.combo__search {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 6px;
}
.combo__list {
  max-height: 230px;
  overflow-y: auto;
}
.combo__item {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.combo__item:hover,
.combo__item.is-highlighted {
  background: #f3f4f6;
}
/* =============== NOTIFICATIONS (clean) =============== */
.topbar__notif {
  position: relative;
}

/* кнопка-дзвоник */
.notif-toggle {
  display: none;
}
.notif-btn {
  position: relative;
  cursor: pointer;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4d6a;
  color: #fff;
  font-size: 0.65rem;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: flex;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  align-items: center;
}

/* панель */
.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  width: min(440px, 96vw);
  background: #fff;
  border-radius: 1.4rem;
  box-shadow: 0 20px 50px rgba(23, 26, 43, 0.14);
  border: 1px solid rgba(23, 24, 39, 0.03);
  padding: 1rem 1rem 0.85rem;
  display: none;
  z-index: 999;
}
.notif-toggle:checked ~ .notif-panel {
  display: block;
}

.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .7rem;
}
.notif-head h4 {
  margin: 0;
  font-size: 1.05rem;  /* ~16-17 */
  font-weight: 700;
  color: #151824;
}
.notif-clear {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: #9499aa;
  cursor: pointer;
  font-weight: 600;
}

/* список */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 330px;
  overflow-y: auto;
}
.notif-list::-webkit-scrollbar {
  width: 6px;
}
.notif-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
}

/* картка */
.notif-item {
  background: #ffffff;
  border-radius: 1.05rem;
  border: 1px solid rgba(11, 16, 38, 0.025);
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem 0.7rem;
  align-items: flex-start;
}
.notif-item--task {
  border-left: 3px solid #5a35ff;
  padding-left: calc(0.75rem - 3px);
}

/* іконка */
.notif-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(90, 53, 255, 0.08);
  display: grid;
  place-items: center;
  color: #5a35ff;
  font-size: 1.25rem;
}
.notif-item:not(.notif-item--task) .notif-icon {
  background: rgba(20, 22, 29, 0.045);
  color: #2d3141;
}

/* контент */
.notif-body h5 {
  margin: 0;
  font-size: 1rem; /* 16px */
  line-height: 1.28;
  color: #12141d;
  font-weight: 700;
}
.notif-body p {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9rem; /* ~14-15 */
  color: #5f6472;
  line-height: 1.4;
}

/* кнопки усередині */
.notif-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.btn-sm {
  padding: 0.28rem 1rem 0.4rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

/* низ картки: час, дедлайн, таймер */
.notif-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: #959aab;
}
.notif-time {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.notif-deadline {
  color: #243cff;
  font-weight: 600;
}
.notif-countdown {
  color: #ff4d6a;
  font-weight: 600;
}

/* кнопка закриття */
.notif-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  margin-top: 0.1rem;
}
.notif-close:hover {
  color: rgba(0, 0, 0, 0.55);
}

/* мобіла */
@media (max-width: 540px) {
  .notif-panel {
    right: -0.4rem;
    width: min(440px, 100vw - 0.8rem);
  }
  .notif-item {
    grid-template-columns: 46px 1fr;
  }
  .notif-close {
    grid-column: 2 / 3;
    justify-self: flex-end;
  }
  .notif-meta {
    flex-direction: column;
  }
}
/* ================== ANTI GAMES (view-antigames) ================== */
#view-antigames {
  display: block;
}

.ag-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* лівий стовпець з фільтрами */
.ag-side {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  align-self: flex-start;
}
.ag-side__title {
  margin: 0 0 .9rem;
  font-size: clamp(1rem, 1.15vw, 1.05rem);
  font-weight: 700;
}
.ag-side__label {
  margin: .3rem 0 .4rem;
  font-weight: 600;
  font-size: clamp(.78rem, .95vw, .85rem);
  color: #4f5463;
}
.ag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.ag-chip {
  background: #fff;
  border: 1px solid rgba(18, 26, 54, .07);
  border-radius: 999px;
  padding: .40rem .65rem .40rem;
  font-size: clamp(.7rem, .85vw, .8rem);
  cursor: pointer;
  transition: .12s;
  color: #2f3442;
}
.ag-chip:hover {
  border-color: rgba(90,53,255,.22);
  background: rgba(90,53,255,.04);
}
.ag-chip.active,
.ag-chip.is-active {
  background: rgba(90,53,255,.09);
  border-color: rgba(90,53,255,.35);
  color: #1b1d26;
  font-weight: 600;
}

/* правий блок */
.ag-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* кнопки категорій зверху */
.ag-filters {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.ag-filter-btn {
  border: none;
  background: rgba(90,53,255,.04);
  border-radius: 999px;
  padding: .35rem .8rem .45rem;
  font-weight: 600;
  font-size: clamp(.73rem, .9vw, .82rem);
  color: #3e4454;
  cursor: pointer;
  transition: .12s;
}
.ag-filter-btn:hover {
  background: rgba(90,53,255,.14);
}
.ag-filter-btn--active,
.ag-filter-btn.active {
  background: #fff;
  border: 1px solid rgba(90,53,255,.2);
  box-shadow: 0 12px 25px rgba(90,53,255,.05);
  color: #171b26;
}

/* пошук гри */
.ag-toolbar {
  display: flex;
  gap: .6rem;
}
.ag-search {
  position: relative;
  max-width: clamp(240px, 24vw, 320px);
  width: 100%;
}
.ag-search input {
  width: 100%;
  border: 1px solid rgba(25,33,68,.08);
  background: #fff;
  border-radius: var(--radius);
  padding: .4rem .75rem .4rem 2.3rem;
  outline: none;
  transition: .12s;
  font-size: clamp(.87rem, 1vw, .95rem);
}
.ag-search input:focus {
  border-color: rgba(90,53,255,.55);
  box-shadow: 0 0 0 3px rgba(90,53,255,.05);
}
.ag-search i {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #9fa4b5;
}

/* картки з іграми (якщо малюватимеш) */
.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: clamp(.75rem, 1.6vw, 1rem);
}
.ag-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: .8rem .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.ag-card__title {
  font-weight: 700;
  font-size: clamp(.9rem, 1.05vw, 1rem);
  margin: 0;
}
.ag-card__meta {
  font-size: .7rem;
  color: #777d91;
}
.ag-card__btn {
  margin-top: .4rem;
  align-self: flex-start;
}

/* адаптив для антигеймів */
@media (max-width: 960px) {
  .ag-shell {
    grid-template-columns: 1fr;
  }
  .ag-side {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .ag-side__label {
    flex: 0 0 100%;
  }
}
@media (max-width: 560px) {
  .ag-search {
    max-width: 100%;
  }
}

/* ================== ІСТОРІЯ ІГОР (view-games-history) ================== */
.gh-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* лівий список ігор */
.gh-sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  align-self: flex-start;
}
.gh-sidebar__title {
  margin: 0 0 .6rem;
  font-size: clamp(.9rem, 1.05vw, 1rem);
  font-weight: 700;
}
.gh-game-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.gh-game-list li {
  padding: .35rem .55rem .45rem;
  border-radius: var(--radius);
  background: rgba(90,53,255,.02);
  font-size: clamp(.78rem, .9vw, .85rem);
  cursor: pointer;
  transition: .12s;
}
.gh-game-list li:hover {
  background: rgba(90,53,255,.08);
}
.gh-game-list li.active {
  background: #fff;
  border: 1px solid rgba(90,53,255,.2);
  box-shadow: 0 8px 24px rgba(90,53,255,.06);
}

/* права таблиця */
.gh-table-wrap {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  overflow-x: auto;
}
.gh-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.gh-table thead th {
  background: #f2f3ff;
  text-align: left;
  padding: .55rem .45rem;
  font-size: clamp(.73rem, .85vw, .8rem);
  color: #666d7f;
  font-weight: 700;
}
.gh-table tbody td {
  padding: .55rem .45rem;
  font-size: clamp(.75rem, .9vw, .85rem);
  border-bottom: 1px solid rgba(25,33,68,.02);
}
.gh-table tbody tr:nth-child(even) td {
  background: rgba(90,53,255,.018);
}
.gh-table .share-btn {
  background: rgba(90,53,255,.12);
  border: none;
  border-radius: 999px;
  padding: .25rem 1.05rem .35rem;
  font-weight: 700;
  font-size: clamp(.63rem, .75vw, .73rem);
  color: #252938;
  cursor: pointer;
  transition: .12s;
}
.gh-table .share-btn:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(90,53,255,.2);
}

.gh-empty {
  margin-top: .4rem;
  font-size: .75rem;
}

/* адаптив history */
@media (max-width: 960px) {
  .gh-layout {
    grid-template-columns: 1fr;
  }
  .gh-table {
    min-width: 0;
  }
}
@media (max-width: 620px) {
  .gh-table thead { display: none; }
  .gh-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .2rem .5rem;
    margin-bottom: .55rem;
    background: #fff;
    border: 1px solid rgba(25,33,68,.03);
    border-radius: var(--radius);
    padding: .5rem .5rem .6rem;
  }
  .gh-table tbody td {
    border: none;
    padding: 0;
    font-size: .75rem;
  }
  .gh-table tbody td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #53596a;
  }
  .gh-table .share-btn {
    justify-self: flex-start;
    margin-top: .2rem;
  }
}
/* === AntiGames: фіксований розмір карток === */
.ag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(.75rem, 1.6vw, 1rem);
  justify-content: flex-start;
  align-items: stretch;
}

.ag-card {
  flex: 0 0 260px;   /* фіксована ширина колонки */
  max-width: 260px;
}

/* На мобілках — все ж по ширині екрана */
@media (max-width: 640px) {
  .ag-grid {
    justify-content: stretch;
  }
  .ag-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
/* === Notifications: компактніший та легший стиль === */

/* панель */
.notif-panel {
  border-radius: 1.1rem;
  box-shadow: 0 16px 36px rgba(23, 26, 43, 0.12);
  padding: 0.85rem 0.9rem 0.75rem;
}

/* бейдж на дзвонику */
.notif-badge {
  min-width: 17px;
  height: 17px;
  font-size: 0.62rem;
}

/* картка */
.notif-item {
  border-radius: 0.9rem;
  padding: 0.55rem 0.7rem 0.6rem;
  gap: 0.6rem;
  grid-template-columns: 40px 1fr auto;
}

/* завдання від вчителя – трохи виділяємо, але не агресивно */
.notif-item--task {
  border-left: 3px solid var(--primary);
  padding-left: calc(0.7rem - 3px);
  background: rgba(90, 53, 255, 0.02);
}

/* іконка */
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.1rem;
}

/* текст */
.notif-body h5 {
  font-size: 0.95rem;
}
.notif-body p {
  font-size: 0.86rem;
  margin-top: 0.18rem;
  margin-bottom: 0.3rem;
}

/* низ картки */
.notif-meta {
  font-size: 0.76rem;
}

/* кнопка "очистити" — менш нав'язлива */
.notif-clear {
  font-size: 0.76rem;
  color: #a0a4b4;
}
/* ================== ПОВІДОМЛЕННЯ (view-messages) ================== */

#view-messages .page-title {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.msg-layout {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Фільтри-«чіпи» зверху */

.msg-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem .6rem;
}

.msg-filter-label {
  font-size: .78rem;
  font-weight: 600;
  color: #747a90;
}

.msg-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.msg-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem .3rem;
  border-radius: 999px;
  border: 1px solid rgba(90,53,255,.25);
  background: #fff;
  font-size: .7rem;
  cursor: pointer;
  transition: .12s;
  box-shadow: 0 4px 12px rgba(0,0,0,.03);
}

.msg-chip__icon {
  font-size: 1rem;
}

.msg-chip.is-active {
  background: linear-gradient(135deg, #5a35ff, #ff6fd8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(90,53,255,.35);
}

.msg-chip:is(:hover,:focus-visible) {
  transform: translateY(-1px);
}

/* Порожній стан */

.msg-list-wrapper {
  margin-top: .3rem;
}

.msg-empty {
  text-align: center;
  padding: 1.4rem 1rem 1.6rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(90,53,255,.09), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255,111,216,.1), transparent 55%),
              #fff;
  box-shadow: var(--shadow-card);
}

.msg-empty-emoji {
  font-size: 2.1rem;
  margin-bottom: .4rem;
}

.msg-empty p {
  margin: 0;
  font-size: .8rem;
  color: #5b6175;
}

/* Картки повідомлень */

.msg-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .6rem;
}

.msg-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  padding: .8rem .9rem .85rem 1rem;
  border-radius: 1.1rem;
  background: #fff;
  box-shadow: 0 14px 32px rgba(25,33,68,.12);
  overflow: hidden;
}

.msg-card__line {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #5a35ff, #ff6fd8);
}

.msg-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 1rem;
  background: rgba(90,53,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.msg-card__main {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.msg-card__header {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: flex-start;
}

.msg-card__title-row {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.msg-card__title {
  margin: 0;
  font-size: .9rem;
  font-weight: 700;
}

.msg-card__meta {
  font-size: .7rem;
  color: #888fa4;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.msg-card__text {
  margin: .2rem 0 .1rem;
  font-size: .78rem;
  color: #51566a;
}

.msg-card__tag {
  align-self: flex-start;
  padding: .12rem .5rem .18rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  background: rgba(90,53,255,.07);
  color: #4d3fd6;
}

/* Кольори під типи */

.msg-card--system .msg-card__line {
  background: linear-gradient(180deg, #0ea5e9, #38bdf8);
}
.msg-card--system .msg-card__icon {
  background: rgba(14,165,233,.16);
}
.msg-card--system .msg-card__tag {
  background: rgba(14,165,233,.12);
  color: #0369a1;
}

.msg-card--task .msg-card__line {
  background: linear-gradient(180deg, #22c55e, #a3e635);
}
.msg-card--task .msg-card__icon {
  background: rgba(34,197,94,.16);
}
.msg-card--task .msg-card__tag {
  background: rgba(34,197,94,.14);
  color: #166534;
}

.msg-card--info .msg-card__line {
  background: linear-gradient(180deg, #f97316, #fb923c);
}
.msg-card--info .msg-card__icon {
  background: rgba(249,115,22,.16);
}
.msg-card--info .msg-card__tag {
  background: rgba(249,115,22,.14);
  color: #9a3412;
}

/* запасний варіант */
.msg-card--other .msg-card__line {
  background: linear-gradient(180deg, #64748b, #94a3b8);
}
.msg-card--other .msg-card__icon {
  background: rgba(148,163,184,.18);
}
.msg-card--other .msg-card__tag {
  background: rgba(148,163,184,.18);
  color: #334155;
}

/* мобілка */

@media (max-width: 640px) {
  .msg-card {
    grid-template-columns: 1fr;
    padding-left: .85rem;
  }
  .msg-card__icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}
.msg-card__actions {
  margin-top: .4rem;
}

.msg-card__actions .btn {
  width: auto;
  white-space: nowrap;
}
/* ===== LOCKED SECTIONS (Coming Soon overlay) ===== */

.locked-section {
  position: relative;
}

/* Весь контент секції блюримо та відключаємо кліки */
.locked-section__content {
  filter: blur(3px);
  pointer-events: none;
}

/* Оверлей поверх секції */
.locked-section__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

/* Напівпрозорий фон + легкий blur фону */
.locked-section__overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(242, 243, 248, 0.8); /* базовий bg у тебе */
  backdrop-filter: blur(4px);
}

/* Блок із замком і текстом */
.locked-section__overlay-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.locked-section__overlay-inner i {
  font-size: clamp(2.2rem, 3vw, 2.6rem);
  color: var(--primary);
}

.locked-section__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: var(--text);
}
/* ===== LOCKED SECTIONS (Coming Soon overlay) ===== */

.locked-section {
  position: relative;
}

/* сам контент секції – заблюрений і неклікабельний */
.locked-section__content {
  filter: blur(3px);
  pointer-events: none;
}

/* оверлей поверх усієї секції */
.locked-section__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40; /* більше за інші елементи всередині */
}

/* напівпрозорий фон + ще трохи блюру фону */
.locked-section__overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(242, 243, 248, 0.85); /* близько до твого bg */
  backdrop-filter: blur(4px);
}

/* картка з замком і текстом */
.locked-section__overlay-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.locked-section__overlay-inner i {
  font-size: clamp(2.2rem, 3vw, 2.6rem);
  color: var(--primary);
}

.locked-section__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: var(--text);
}
.btn-cta {
  background: #ffffff;
  color: var(--primary);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(90, 53, 255, 0.26);
  font-weight: 800;
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  padding: clamp(0.55rem, 1.4vw, 0.7rem) clamp(1.4rem, 2.6vw, 1.8rem);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-cta i {
  font-size: 1.25em;
}

.btn-cta:hover {
  transform: translateY(-1px);
}

/* широка версія всередині фіолетової картки */
.btn-cta--wide {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-2);
}

/* рядок заголовка з кнопкою */
.page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

/* на мобілках кнопка стає на всю ширину */
@media (max-width: 767px) {
  .page-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .page-title-cta {
    margin-top: 16px;
    margin-bottom: 16px;
    width: 100%;
    justify-content: center;
  }
}
/* ================== ДОСЯГНЕННЯ (view-achievements) ================== */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, min(360px, 100%)));
  gap: var(--space-3);
  margin-top: var(--space-3);
  align-items: stretch;
}

.achievement-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.achievement-card__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: rgba(90,53,255,.06);
  font-size: .8rem;
  font-weight: 600;
  color: #4b3fd1;
  align-self: flex-start;
}

.achievement-card__emoji {
  font-size: 1.2rem;
}

.achievement-card__title {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  font-weight: 700;
}

.achievement-card__text {
  margin: 0;
  font-size: .88rem;
  color: #4b5563;
}

.achievement-card__student {
  margin: .25rem 0 0;
  font-size: .85rem;
  color: #374151;
}

.achievement-card__student span {
  font-weight: 600;
}

.achievement-card__actions {
  margin-top: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.ach-btn {
  min-width: 140px;
}

.achievement-card__hint {
  margin-top: .5rem;
  font-size: .75rem;
  color: #6b7280;
}

.ach-status-pill {
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  background: #ecfdf5;
  color: #15803d;
  font-weight: 600;
}

.ach-status-pill i {
  font-size: .9rem;
}

.achievement-card.is-locked {
  opacity: .9;
  border: 1px dashed rgba(148,163,184,0.9);
  box-shadow: none;
  background: linear-gradient(135deg, #f9fafb, #f3f4ff);
}

.achievement-card__lock-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .8rem;
  color: #6b7280;
}

.achievement-card__lock-row i {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .achievements-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== Хованка для шаблону сертифіката ===== */

#certificate-container {
  position: absolute;
  left: -99999px;
  top: -99999px;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
}

#certificate {
  position: relative;
  width: 2480px;
  height: 3508px;
  background-image: url("certificate-template.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* ================== ДОСЯГНЕННЯ ================== */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, min(360px, 100%)));
  gap: var(--space-3);
  margin-top: var(--space-3);
  align-items: stretch;
}

.achievement-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow-card, 0 18px 45px rgba(15, 23, 42, 0.08));
  padding: var(--space-4, 24px);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.achievement-card__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  background: rgba(90, 53, 255, .06);
  font-size: .8rem;
  font-weight: 600;
  color: #4b3fd1;
  align-self: flex-start;
}

.achievement-card__emoji {
  font-size: 1.2rem;
}

.achievement-card__title {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  font-weight: 700;
}

.achievement-card__text {
  margin: 0;
  font-size: .88rem;
  color: #4b5563;
}

.achievement-card__student {
  margin: .25rem 0 0;
  font-size: .85rem;
  color: #374151;
}

.achievement-card__student span {
  font-weight: 600;
}

.achievement-card__actions {
  margin-top: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.ach-btn {
  min-width: 140px;
}

.ach-btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

.achievement-card__hint {
  margin-top: .5rem;
  font-size: .75rem;
  color: #6b7280;
}

.ach-status-pill {
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 600;
}

.achievement-card.is-locked {
  opacity: .7;
  filter: grayscale(0.4);
}

.achievement-card__lock-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: .8rem;
  color: #6b7280;
}

.achievement-card__lock-row i {
  font-size: 1rem;
}

/* прогресбар */

.ach-progress {
  margin-top: .75rem;
  font-size: .8rem;
  color: #4b5563;
}

/* коли сховано через hidden — точно не показуємо */
.ach-progress[hidden] {
  display: none !important;
}

/* коли НЕ сховано — показуємо як flex */
.ach-progress:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.ach-progress-bar {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ach-progress-bar::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, #4b3fd1, #facc15);
  animation: ach-progress-indeterminate 1.2s infinite;
}

@keyframes ach-progress-indeterminate {
  0% { left: -40%; }
  50% { left: 30%; }
  100% { left: 100%; }
}

@media (max-width: 768px) {
  .achievements-grid {
    grid-template-columns: 1fr;
  }
}
/* ===== ШАБЛОН СЕРТИФІКАТА (ховаємо за екраном) ===== */

#certificate-container {
  position: absolute;
  left: -99999px;
  top: -99999px;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
}

#certificate {
  position: relative;
  width: 2480px;
  height: 3508px;
  background-image: url("certificate-template.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

#cert-name {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
  font-size: 200px;
  font-weight: 400;
  font-family: "Shelley Script LT CYR W05 Rg", "Commissioner", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #05035b;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  /* оце забрати: */
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
}

#cert-id {
  position: absolute;
  right: 10%;
  bottom: 4%;
  font-size: 54px;
  font-family: "Commissioner", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
  color: #111827;
}

/* коли сховано через hidden — точно не показуємо оверлей */
.cert-preview[hidden] {
  display: none !important;
}

/* коли НЕ сховано — показуємо як flex */
.cert-preview:not([hidden]) {
  display: flex;
}

.cert-preview {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.cert-preview-inner {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  padding: 12px;
  box-sizing: border-box;
}

.cert-preview-inner img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
}

.cert-preview-close {
  position: absolute;
  top: 0;
  right: 0;
  margin: 4px;
  border: none;
  background: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cert-preview-hint {
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
  font-size: 14px;
}
/* AntiGames: mobile-підтягування розмірів і радіусів */
@media (max-width: 560px) {
  .ag-shell {
    gap: 0.9rem;
  }

  .ag-side {
    padding: 0.9rem 0.85rem 1rem;
    border-radius: var(--radius);          /* менш кругле */
    box-shadow: 0 8px 22px rgba(23, 26, 43, 0.08);
  }

  .ag-side__title {
    font-size: 1.05rem;                   /* ~16–17px */
  }

  .ag-side__label {
    font-size: 0.9rem;
  }

  .ag-chip-row {
    gap: 0.35rem;
  }

  .ag-chip {
    padding: 0.35rem 0.8rem 0.4rem;
    font-size: 0.85rem;
    border-radius: 0.6rem;                /* вже не “таблетка” */
  }

  .ag-main {
    gap: 0.9rem;
  }

  .ag-filter-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.95rem 0.45rem;
    border-radius: 0.75rem;
  }

  .ag-search input {
    font-size: 0.9rem;
    padding: 0.45rem 0.7rem 0.5rem;
  }

  .ag-card {
    border-radius: var(--radius);         /* менший радіус для карток */
    padding: 0.75rem 0.8rem 0.9rem;
  }

  .ag-card__title {
    font-size: 0.95rem;
  }

  .ag-card__meta {
    font-size: 0.8rem;
  }
}
.ag-side,
.ag-card,
.gh-sidebar,
.gh-table-wrap {
  border-radius: var(--radius);
}
/* Історія ігор: оформлення пунктів списку + бейдж-лічильник */
.gh-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.gh-game-item__title {
  flex: 1;
  min-width: 0;
}

.gh-game-item__count {
  min-width: 1.6rem;
  padding: 0.1rem 0.55rem 0.18rem;
  border-radius: 999px;
  background: rgba(90, 53, 255, 0.12);
  font-size: 0.7rem;
  font-weight: 600;
  color: #4d3fd6;
  text-align: center;
}

/* трохи більший текст і менші радіуси на мобілці */
@media (max-width: 560px) {
  .gh-sidebar {
    padding: 0.9rem 0.85rem;
    border-radius: var(--radius);
  }

  .gh-game-list li {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem 0.5rem;
  }

  .gh-game-item__count {
    font-size: 0.75rem;
  }
}
/* AntiGames – піджати вертикальні відступи + розмір тексту на мобілці */
@media (max-width: 560px) {
  #view-antigames .ag-side__label {
    margin: .1rem 0 .2rem;   /* було .3 / .4 */
    font-size: 0.9rem;
  }

  /* другий лейбл "Категорія" – трохи менший відступ зверху */
  #agSide .ag-side__label:nth-of-type(2) {
    margin-top: .5rem !important;
  }

  .ag-chip-row {
    gap: 0.3rem;
  }

  .ag-chip {
    padding: .36rem .7rem .4rem;
    font-size: 0.85rem;
    border-radius: .7rem;    /* менше "таблеток" */
  }
}
@media (max-width: 560px) {
  #view-antigames .ag-search input {
    padding: .55rem .8rem .55rem 2.4rem;  /* було .4rem */
    font-size: 0.9rem;
  }

  #view-antigames .ag-toolbar {
    margin-top: .6rem;
  }
}
/* базовий вигляд фільтра */
.ag-filter-btn {
  border: none;
  background: rgba(90,53,255,.04);
  border-radius: 999px;
  padding: .35rem .8rem .45rem;
  font-weight: 600;
  font-size: clamp(.73rem, .9vw, .82rem);
  color: #3e4454;
  cursor: pointer;
  transition: .12s;
}

/* активний фільтр – помітний бейдж */
.ag-filter-btn--active,
.ag-filter-btn.active {
  background: rgba(90,53,255,.15);
  border: 1px solid rgba(90,53,255,.5);
  box-shadow: 0 8px 20px rgba(90,53,255,.18);
  color: #20164f;
}

/* + трохи адекватніший розмір і форма на мобілці */
@media (max-width: 560px) {
  .ag-filter-btn {
    border-radius: .75rem;
    padding: .42rem 1rem .46rem;
    font-size: 0.85rem;
  }
}

/* ===== ЦІКАВЕ ВІД АШ: 2-РЯДКОВИЙ GRID-СЛАЙДЕР ===== */

.ash-slider {
  margin-top: 2rem;
  position: relative;
  margin-top: .5rem;
}

/* тільки горизонтальний скрол усередині секції */
.ash-slider__viewport {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: .4rem .6rem;
  scroll-behavior: smooth;
  scrollbar-width: none;            /* Firefox */
}
.ash-slider__viewport::-webkit-scrollbar {
  display: none;                    /* Chrome / Edge */
}

/* 2 рядки, колонки тягнуться вправо */
.ash-slider__track {
  display: grid;
  grid-auto-flow: column;                               /* спочатку заповнює колонку вниз */
  grid-auto-columns: minmax(240px, 280px);              /* ширина однієї картки */
  grid-template-rows: repeat(2, minmax(0, 1fr));        /* рівно 2 рядки */
  column-gap: clamp(.9rem, 2vw, 1.1rem);
  row-gap: clamp(.9rem, 2vw, 1.1rem);
}

/* картка тягнеться на всю колонку */
.ash-card {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.ash-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.ash-card__thumb {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: #151827;
}

.ash-card__thumb img {
  width: 110%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .35s ease, opacity .35s ease;
}

.ash-card__label {
  position: absolute;
  bottom: .65rem;
  left: .75rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ash-card__body {
  padding: .8rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.ash-card__title {
  margin: 0;
  font-size: clamp(.98rem, 1.08vw, 1.05rem);
  font-weight: 700;
}

.ash-card__desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: #5c6376;
  max-height: 4.4em;
  overflow: hidden;
}

.ash-card__more {
  margin-top: .35rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--primary);
}

.ash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.08);
}

.ash-card:hover .ash-card__thumb img {
  transform: scale(1.08);
  opacity: .8;
}

/* Кнопки навігації */
.ash-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15,23,42,.35);
  z-index: 2;
}

.ash-slider__btn i {
  font-size: 18px;
}

.ash-slider__btn--prev { left: .2rem; }
.ash-slider__btn--next { right: .2rem; }

.ash-slider__btn[disabled] {
  opacity: .35;
  cursor: default;
  box-shadow: none;
}

/* На вузьких екранах – трохи нижче */
@media (max-width: 600px) {
  .ash-slider__btn {
    top: auto;
    bottom: .4rem;
    transform: none;
  }
}

/* ==== ЦІКАВЕ ВІД АШ: 2-РЯДКОВИЙ GRID-СЛАЙДЕР (override) ==== */

.ash-slider {
  position: relative;
  margin-top: .5rem;
}

/* тільки горизонтальний скрол усередині */
.ash-slider__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: .4rem .6rem;
  scroll-behavior: smooth;
  scrollbar-width: none;        /* Firefox */
}
.ash-slider__viewport::-webkit-scrollbar {
  display: none;                /* Chrome / Edge */
}

/* 2 рядки, колонки йдуть вправо */
.ash-slider__track {
  display: grid;
  grid-auto-flow: column;                               /* спочатку заповнює колонку вниз */
  grid-auto-columns: minmax(240px, 280px);              /* ширина однієї картки */
  grid-template-rows: repeat(2, minmax(0, 1fr));        /* РІВНО 2 рядки */
  column-gap: clamp(.9rem, 2vw, 1.1rem);
  row-gap: clamp(.9rem, 2vw, 1.1rem);
}

/* картка тягнеться на всю колонку */
.ash-card {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* невеличкий косметичний фікс: тіні й фон кнопок були з помилкою у rgba */
.ash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.08);
}

.ash-slider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15,23,42,.35);
  z-index: 2;
}

.ash-slider__btn--prev { left: .2rem; }
.ash-slider__btn--next { right: .2rem; }

.ash-slider__btn[disabled] {
  opacity: .35;
  cursor: default;
  box-shadow: none;
}

@media (max-width: 600px) {
  .ash-slider__btn {
    top: auto;
    bottom: .4rem;
    transform: none;
  }
}