/* ===============================
   Registration Wizard — Desktop CSS (v5, optimized, 1-prop-per-line)
   - Duplicates merged, conflicts resolved
   - Stable tokens & structure preserved
   =============================== */

/* --------- Design Tokens --------- */
:root{
  --bg-overlay: rgba(10, 16, 25, 0.6);
  --bg-panel: #ffffff;
  --bg-elev: #f7f8fb;
  --text: #0f1520;
  --muted: #5b6270;
  --primary: #2563eb;
  --primary-600: #1e4fd6;
  --success: #F6B801;
  --success-600: #12853d;
  --danger: #dc2626;
  --warning: #f59e0b;
  --orange: #ff6a00;
  --ring: rgba(37, 99, 235, .45);
  --ring-strong: rgba(37, 99, 235, .7);
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 21, 32, .15);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

/* --------- Base Typography --------- */
.h1{
  font-size: 32px;
  line-height: 1.25;
  margin: 0 0 var(--space-2);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.h2{
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}
.ordinary_text{
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}
.orange-hilight{
  color: var(--orange);
  font-weight: 700;
}

/* --------- Modal Shell --------- */
.modal{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
/* Support multiple "open" mechanisms */
.modal[aria-hidden="false"],
.modal.is-open,
.modal.open,
.modal[open],
.modal[data-open="1"]{
  display: flex;
}

.modal__backdrop{
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__panel{
  position: relative;
  z-index: 1;
  width: calc(80% - 80px);
  max-width: calc(80% - 80px);
  height: calc(90vh - 80px);
  max-height: calc(90vh - 80px);
  background: var(--bg-panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  /* keep rounded corners */
  display: grid;
  grid-template-rows: auto 1fr;
  /* header + content */
}

/* --------- Modal Header --------- */
.modal__header{
  padding: 32px;
  border-bottom: 1px solid #eef2f6;
  /* softer divider */
  background: linear-gradient(180deg, #fbfdff, #fff);
  display: grid;
  grid-template-rows: auto auto auto;
  row-gap: var(--space-4);
}
.modal__header > .h2{
  margin: 0;
}
.modal__header .stack{
  margin: 32px 0 0;
}
.modal__header .h1{
  margin: 0;
}
.modal__header .ordinary_text{
  margin: 0;
}

/* Progress */
.modal__progress{
  margin-top: 4px;
  display: grid;
  gap: 32px;
}
.modal__progress .stack{
  margin: 0;
  align-items: center;
  text-align: center;
}
.progressbar{
  width: 100%;
  height: 8px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.progressbar__fill{
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(0deg, #F6B801 0%, #F18700 100%);
  border-radius: 999px;
  transition: width .35s ease;
}
.progressbar__fill.p1{
  width: 20%;
}
.progressbar__fill.p2{
  width: 40%;
}
.progressbar__fill.p3{
  width: 60%;
}
.progressbar__fill.p4{
  width: 80%;
}
.progressbar__fill.p5{
  width: 100%;
}

/* --------- Wizard Container --------- */
.wizard{
  padding: var(--space-8);
  padding-top: 28px;
  overflow: visible;
  min-height: 420px;
  gap: 16px;
}
.step{
  display: none;
}
.step.is-active{
  display: block;
}

/* Safety for teacher wizard fixed steps */
.wizard .step{
  min-height: var(--step-h);
  max-height: var(--step-h);
  height: var(--step-h);
}
.wizard .step.is-active{
  display: flex;
  flex-direction: column;
}
.wizard .step .grid,
.wizard .step .step-body{
  flex: 1 1 auto;
}

/* --------- Grid Layouts --------- */
.grid{
  display: grid;
}
.grid-2{
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
}
.gap-lg{
  gap: var(--space-6);
  row-gap: 18px;
}

/* --------- Form Controls --------- */
.fld{
  display: grid;
  gap: 8px;
}
.fld > span,
.fld > label:not(.checkbox){
  font-size: 13px;
  color: #606a77;
  font-weight: 600;
  letter-spacing: .02em;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="search"]{
  appearance: none;
  width: 100%;
  font-size: 15px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder{
  color: #322e46;
}
input:hover{
  border-color: #cbd5e1;
}
input:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
input:focus-visible{
  outline: none;
}

/* Checkboxes */
.checkbox{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.checkbox input[type="checkbox"]{
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* --------- Buttons --------- */
.actions{
  margin-top: var(--space-8);
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.btn{
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .02s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  min-width: 160px;
}
.btn:active{
  transform: translateY(1px);
}

.btn-primary{
  background: #1D19B4;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}
.btn-primary:hover{
  background: var(--primary-600);
}
.btn-primary:focus-visible{
  outline: 3px solid var(--ring-strong);
  outline-offset: 2px;
}

.btn-success{
  background: #1D19B4;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}
.btn-success:hover{
  background: var(--primary-600);
}
.btn-success:focus-visible{
  outline: 3px solid #1D19B4;
  outline-offset: 2px;
}

.btn-ghost{
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover{
  background: var(--bg-elev);
}
.btn-ghost:focus-visible{
  outline: 3px solid var(--ring-strong);
  outline-offset: 2px;
}

/* --------- Toast (status) --------- */
.toast{
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: none;
}
.toast.is-visible{
  display: block;
}

/* --------- Combo (custom select) --------- */
.combo{
  position: relative;
}
.combo[aria-disabled="true"]{
  opacity: .6;
  pointer-events: none;
}
.combo__button{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.combo__button:hover{
  border-color: #cbd5e1;
}
.combo__button:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
.combo__label{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.combo__caret{
  opacity: .7;
}
.combo__menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: var(--space-3);
  display: none;
  z-index: 20;
  max-height: min(60vh, 480px);
}
.combo[aria-expanded="true"] .combo__menu,
.combo.open .combo__menu,
.combo[data-open="1"] .combo__menu{
  display: block;
}
.combo__search{
  margin-bottom: var(--space-3);
  border-radius: 8px;
}
.combo__list{
  max-height: calc(60vh - 72px);
  overflow: auto;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
}
.combo__item{
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease;
}
.combo__item[aria-selected="true"]{
  background: #eef2ff;
}
.combo__item:hover,
.combo__item:focus{
  background: #f3f4f6;
  outline: none;
}

/* --------- Validation Helpers --------- */
input[aria-invalid="true"],
.combo[aria-invalid="true"] .combo__button{
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .15);
}
.help-error{
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
}

/* --------- Misc --------- */
label[for]{
  cursor: pointer;
}
hr{
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

/* --------- Teacher Modal Patch --------- */
#teacherModal .modal__header{
  row-gap: 18px;
}
#teacherModal .modal__progress{
  gap: 14px;
}
#teacherModal .modal__header .stack{
  display: grid;
  gap: 8px;
  align-items: center;
  text-align: center;
}
#teacherModal .modal__header .h1{
  margin: 0;
  line-height: 1.25;
}
#teacherModal .modal__header .lead{
  margin-top: 2px;
}
#teacherModal .modal__header .btn{
  margin-top: 8px;
}
#teacherModal .intro{
  display: grid;
  gap: 8px;
  align-items: center;
  text-align: center;
}
#teacherModal .intro .lead{
  color: var(--muted);
}

.lead{
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.muted{
  color: #6b7280;
  font-size: 14px;
}
.req{
  color: var(--danger);
}

.gap{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.t-subj{
  border-color: var(--border);
  min-width: auto;
  padding: 16px 32px;
  border-radius: 16px;
  font-weight: 600;
}
.t-subj:hover{
  background: var(--bg-elev);
}
.t-subj:focus-visible{
  outline: 3px solid var(--ring-strong);
  outline-offset: 2px;
}
.t-subj.is-active,
.t-subj[aria-pressed="true"],
.t-subj[data-selected="1"]{
  background: #F6B801;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

#t_classes_tiles{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#t_classes_tiles > *{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #F6B801 !important;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}
#t_classes_tiles > * .remove,
#t_classes_tiles > button{
  cursor: pointer;
  border: 0;
  background: transparent;
}
#t_classes_tiles > * .remove:hover{
  opacity: .8;
}

#t_add_class{
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 18px;
  line-height: 1;
}

#t_schoolManualRow[hidden]{
  display: none !important;
}
#t_schoolManualRow{
  margin-top: 8px;
}

#teacherWizard .actions{
  margin-top: 24px;
}

.grid-left {
  gap: 16px 32px;
}

.grid-left input,  .grid-left .fld{
  margin-top: 16px;
  margin-bottom: 16px;
} 

.grid-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, #1D19B4 0%, #07053D 100%);
  border-radius: 32px;
  padding: 32px;
}

.right-mini .fld{
  margin-bottom: 16px;
}

.right-mini {
  width: 100% !important;
  background-color: #F6F7FC;
  padding: 32px 64px;
  border-radius: 16px;
}

.right-mini input{
  margin-top: 16px;
}

.right-mini input[type="checkbox"]{
  margin: 0 !important;
}

.grid-two input {
  width: 32%;
  margin-right: 16px;
}

.stack {
  margin-top: 32px;
}

#t_ref_code {
  background: linear-gradient(0deg, #F6B801 0%, #F18700 100%);
  text-align: center;
  font-weight: 700;
  font-size: 24px;
}

#t_copy_link {
  background-color: #1D19B4;
  color: #fff;
}

/* ==========================================================================
   Responsive Add-On for Teacher/Student Registration (keeps desktop as is)
   Safe to load AFTER form1.css
   ========================================================================== */

/* ---------- Fluid tokens (clamp for text, spacing, radii) ---------- */
:root{
  /* type */
  --fs-h1: clamp(22px, 4.2vw, 32px);
  --fs-h2: clamp(18px, 2.4vw, 22px);
  --fs-body: clamp(14px, 1.4vw, 16px);
  --fs-small: clamp(12px, 1.2vw, 14px);

  /* spacing */
  --sp-1: clamp(4px, 0.6vw, 8px);
  --sp-2: clamp(8px, 1.0vw, 12px);
  --sp-3: clamp(12px, 1.4vw, 16px);
  --sp-4: clamp(16px, 1.8vw, 24px);
  --sp-5: clamp(20px, 2.4vw, 32px);
  --sp-6: clamp(24px, 3.0vw, 40px);
  --sp-8: clamp(32px, 4.0vw, 56px);

  /* radii */
  --rad-xs: clamp(8px, 1vw, 10px);
  --rad-sm: clamp(10px, 1.2vw, 12px);
  --rad:    clamp(12px, 1.6vw, 16px);

  /* responsive container width */
  --panel-w: clamp(320px, 92vw, 1200px);
  --panel-h: calc(min(90vh, 100 * var(--vh, 1vh)) - clamp(24px, 2vw, 40px));
}

/* ---------- Global type + controls scale ---------- */
body, .ordinary_text{
  font-size: var(--fs-body);
}
.h1{ font-size: var(--fs-h1); }
.h2{ font-size: var(--fs-h2); }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="search"]{
  padding: clamp(10px, 1.4vw, 14px) clamp(12px, 1.6vw, 16px);
  border-radius: var(--rad-xs);
  font-size: var(--fs-body);
}
.combo__button{
  padding: clamp(10px, 1.4vw, 14px) clamp(12px, 1.6vw, 16px);
  border-radius: var(--rad-xs);
  font-size: var(--fs-body);
}
.btn{
  padding: clamp(10px, 1.2vw, 12px) clamp(14px, 1.8vw, 18px);
  border-radius: var(--rad-sm);
  min-width: clamp(140px, 18vw, 180px);
  font-size: clamp(14px, 1.6vw, 16px);
}

/* ---------- Modal panel becomes fluid but preserves desktop baseline ---------- */
.modal__panel{
  width: var(--panel-w);
  max-width: var(--panel-w);
  height: var(--panel-h);
  max-height: var(--panel-h);
  border-radius: var(--rad);
}

/* ---------- Column-first flow (all blocks stacked on narrow screens) ---------- */
.wizard{ gap: var(--sp-4); padding: var(--sp-6); }
.fld{ gap: var(--sp-2); }

.grid{ gap: var(--sp-3); }
.grid-2{ column-gap: var(--sp-4); }

/* phones & tall/narrow: force single-column everywhere inside steps */
@media (max-width: 960px), (max-aspect-ratio: 4/5){
  .wizard{ padding: var(--sp-4); }
  .grid-2{ grid-template-columns: 1fr; row-gap: var(--sp-3); }
  .actions{
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
    width: 100%;
  }
  .btn{ width: 100%; }
  .combo__menu{ max-height: min(60vh, 420px); }
}

/* large desktops: keep two columns but breathe a bit more */
@media (min-width: 1440px){
  .grid-2{ column-gap: clamp(24px, 2vw, 40px); }
  .wizard{ gap: clamp(16px, 1.6vw, 28px); }
}

/* ---------- Sticky headers + “first screen only” on phones ---------- */
/* 1) Teacher modal: “Вітаємо колего…” у шапці модалки */
#teacherModal .modal__header{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: clamp(16px, 2.4vw, 32px);
  background: linear-gradient(180deg,#fbfdff,#fff);
}

/* 2) Student modal (за потреби однаково) */
#regModal .modal__header{
  position: sticky;
  top: 0;
  z-index: 5;
  padding: clamp(16px, 2.4vw, 32px);
  background: linear-gradient(180deg,#fbfdff,#fff);
}

/* 3) Герой сторінки: заголовок “Всеукраїнська олімпіада 2025…” */
.hero .event-info h1{
  font-size: var(--fs-h1);
  line-height: 1.15;
  margin-bottom: var(--sp-2);
  border-radius: var(--rad-xs);
}

/* — На телефонах показуємо ці заголовки лише на першому екрані:
      без JS через CSS Scroll-driven Animations (прогресивне покращення).
      Якщо браузер не підтримує — шапка просто лишається sticky. */
@media (max-width: 600px){
  @supports (animation-timeline: scroll()){
    /* fade out header area в межах першого в’юпорту */
    #teacherModal .modal__header,
    #regModal .modal__header,
    .hero .event-info{
      animation: fadeOutHeader linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90vh;
    }
    @keyframes fadeOutHeader{
      to{ opacity: 0; visibility: hidden; }
    }
  }
}

/* ---------- Touch targets, inputs and combos on phones ---------- */
@media (max-width: 600px){
  input, .combo__button{
    min-height: 44px;
  }
  .combo__menu{
    border-radius: var(--rad);
    padding: var(--sp-2);
  }
  .combo__item{ padding: var(--sp-2) var(--sp-3); }
}

/* ---------- Safer scroll areas inside steps ---------- */
.wizard .step{
  min-height: auto;           /* unlock strict fixed height from desktop */
  max-height: none;
  height: auto;
}
.wizard .step.is-active{
  display: flex;
  flex-direction: column;     /* “згору-вниз” */
}
.wizard .step .step-body{
  display: grid;
  gap: var(--sp-3);
}

/* ---------- Modal header/hero paddings scale ---------- */
.modal__header{
  padding: clamp(16px, 2.4vw, 32px);
}
.hero .event-info{
  padding: clamp(12px, 2vw, 24px);
  border-radius: var(--rad);
}

/* ---------- Minor polish ---------- */
.progressbar{ height: clamp(6px, 1vw, 8px); }
.combo__list{ border-radius: var(--rad-xs); }
.toast{ border-radius: var(--rad-sm); padding: var(--sp-2) var(--sp-3); }
/* ===========================
   FIX: Mobile scroll + right-mini
   =========================== */

/* 1) Дозволяємо скрол всередині панелі модалки */
.modal__panel{
  overflow: auto;                     /* замість hidden */
  -webkit-overflow-scrolling: touch;  /* плавний скрол на iOS */
  overscroll-behavior: contain;       /* не “пробиваємо” фон */
}

/* 2) Прибираємо “жорстку” висоту кроків (дозволяє контенту рости і скролитись) */
.wizard .step{
  min-height: auto !important;
  max-height: none !important;
  height: auto !important;
}

/* 3) Заголовок у модалках — sticky, щоб лишався вгорі під час скролу */
#teacherModal .modal__header,
#regModal .modal__header{
  position: relative;
  top: 0;
  z-index: 5;
}

/* 4) Мобільний стікінг/скриття заголовків після першого екрану (якщо підтримується) */
@media (max-width: 600px){
  @supports (animation-timeline: scroll()){
    #teacherModal .modal__header,
    #regModal .modal__header{
      animation: fadeOutHeader linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90vh;
    }
    @keyframes fadeOutHeader{ to{ opacity:0; visibility:hidden; } }
  }
}

/* 5) Виправляємо right-mini на телефонах (повна ширина, менші відступи) */
@media (max-width: 760px){
  .grid-2{ grid-template-columns: 1fr !important; row-gap: 20px; }

  .grid-right{
    padding: clamp(16px, 4vw, 24px);
    border-radius: clamp(16px, 4vw, 24px);
  }

  .right-mini{
    width: 100% !important;                 /* замість 80% */
    padding: clamp(16px, 4vw, 24px) !important;  /* замість 32px 64px */
    border-radius: clamp(12px, 3vw, 16px);
    margin: 0;                               /* прибираємо зайві “ріви” */
  }

  /* Поля в “З якого ти класу?” стають на всю ширину */
  .grid-two input{
    width: 100% !important;
    margin-right: 0 !important;
  }

  /* Кнопки — у колонку, повна ширина */
  .actions{
    flex-direction: column;
    gap: 16px;
  }
  .actions .btn{ width: 100%; }
}

/* 6) Невелике підсилення доступності на мобільному */
@media (max-width: 600px){
  input, .btn{ min-height: 44px; }
}
/* =========================================
   MOBILE TWEAKS: compact spacing & layouts
   ========================================= */

/* 0) Безпечний відступ унизу + “подушка” для кнопок */
.wizard{
  padding-bottom: clamp(20px, 4vh, 48px);
}
.actions{
  margin-top: 16px;              /* трохи раніше було 32px */
  margin-bottom: clamp(16px, 3vh, 32px);
}

/* 1) Компактні проміжки між інпутами на телефонах */
@media (max-width: 720px){
  .fld{ gap: 6px; }
  .grid-left input,
  .grid-left .fld{
    margin-top: 8px !important;   /* було 16px */
    margin-bottom: 8px !important;
  }
  
}

/* 2) “Школа” (комбобокс) — повна ширина, навіть у right-mini */
.right-mini .combo,
.right-mini .combo__button{
  width: 100% !important;
}
.right-mini .combo__menu{
  left: 0; right: 0;              /* дропдаун рівно під кнопкою */
  max-width: none;
}

/* 3) Предмети — завжди плиткою (не стовпцем) */
.gap .t-subj{
  flex: 1 1 160px;                /* авто-тайл, 2–3 в ряд залежно від ширини */
  min-width: 150px;
  white-space: normal;            /* переносимо довгі назви */
}
@media (max-width: 600px){
  .gap .t-subj{ min-width: 140px; padding: 14px 18px; }
}

/* 4) “Клас” + “+” в один рядок (прогресивне покращення) */
@supports selector(:has(*)){
  /* знаходимо батька, що містить кнопку #t_add_class, і робимо з нього ряд */
  .grid-left:has(#t_add_class){
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .grid-left:has(#t_add_class) .gap{
    display: flex;
    flex-direction: row;
    gap: 12px;
  }
  .grid-left:has(#t_add_class) .gap .fld{
    max-width: 80%;
  }
  /* робимо саму кнопку компактною та стабільною */
  #t_add_class{
    min-width: 44px; min-height: 44px; /* tap-size */
    max-width: 44px; max-height: 44px;
    padding: 0 14px;
  }

  .grid-two:has(#class_num) div{
    display: flex;
    flex-direction: row;
    gap: 12px;
  }
}

/* 5) Кнопка внизу не прилипла до краю на телефонах з жестами */
@supports (padding: max(0px)){
  .wizard{ padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .actions{ margin-bottom: max(16px, env(safe-area-inset-bottom)); }
}

/* 6) Дрібні покращення у правій колонці на телефонах */
@media (max-width: 760px){
  .right-mini{
    width: 100% !important;
    padding: clamp(16px, 4vw, 24px) !important;
    margin: 0;
  }
}
/* ===== School combo: lock button height & ellipsis ===== */
#t_school_combo .combo__button{
  min-height: 44px;              /* стабільний tap-size */
  max-height: 48px;              /* не росте від довгих назв */
  align-items: center;
}
#t_school_combo .combo__label{
  flex: 1 1 auto;                /* займає решту ширини */
  min-width: 0;                  /* дозволяє обрізати у flex-контейнері */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;           /* завжди в один рядок */
}
/* щоб меню накладалося поверх, а не “розштовхувало” блок */
#t_school_combo .combo__menu{
  position: absolute;
  left: 0; right: 0; top: calc(100% + 8px);
}
/* ── Switch buttons in modal headers ─────────────────────────────────── */
.modal__header { display: flex; flex-direction: column; gap: 12px; }
.modal__switch { display: flex; align-items: center; gap: 32px; }

.btn-switch{
  background: #F6F7FC;
  color: #2F333F;
  padding: 16px 32px;
  border-radius: 32px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, box-shadow .18s ease, transform .18s ease;
}
.btn-switch:hover{ box-shadow: 0 6px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.btn-switch:active{ transform: translateY(0); }
.btn-switch:focus-visible{ outline: 2px solid var(--brand-primary, #1D19B4); outline-offset: 2px; }

@media (max-width: 600px){
  .modal__switch{ flex-wrap: wrap; gap: 8px; flex-direction: column;}
  .btn-switch{ font-size: 13px; padding: 8px 12px; }
}

/* ── Smooth cross-fade/slide when switching modals ───────────────────── */
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); }
                      to   { opacity: 1; transform: none; } }
@keyframes modal-out{ from { opacity: 1; transform: none; }
                      to   { opacity: 0; transform: translateY(6px) scale(.985); } }

.modal__panel.is-anim-in  { animation: modal-in  .28s ease both; }
.modal__panel.is-anim-out { animation: modal-out .22s ease both; }

/* поважаємо reduce-motion: у твоєму CSS це вже налаштовано */
/* Close (X) button for modals */
.modal__panel { position: relative; }

.modal__close{
  position: absolute;
  top: 8px; right: 8px;              /* безпечне положення всередині панелі */
  width: 36px; height: 36px;         /* зручна «тап»-зона на мобільних */
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  color: #5a6578;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
  z-index: 2;                        /* над контентом модалки */
}

.modal__panel { position: relative; } /* лишаємо як є */

.modal__close{
  position: absolute;
  top: 8px; right: 8px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,.06);   /* було rgba(0,0,0,06) */
  color: #5a6578;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); /* було rgba(0,0,0,08) */
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
  z-index: 10;                   /* > header (який має z-index:5) */
}
.modal__close:hover{ transform: scale(1.05); background: rgba(0,0,0,.09); }
.modal__close:active{ transform: scale(.98); }
@media (min-width: 768px){ .modal__close{ top:10px; right:10px; width:40px; height:40px; } }
