/* Сайт ліцею, дизайн «Ніч». Выбор класса (.kp-*) и переключатель языка (.lang) — в конце файла. */
  :root {
    --bg: #0a0e1f; --bg2: #11173a; --card: rgba(255,255,255,.05); --line: rgba(255,255,255,.09);
    --text: #e8ebff; --muted: #9aa3d0; --cyan: #3ee6ff; --violet: #9b6bff; --pink: #ff5fa8; --amber: #ffc04d; --green: #4ee6a0;
    --grad: linear-gradient(135deg, var(--cyan), var(--violet));
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 76px; }
  body { margin: 0; font: 16px/1.55 Manrope, system-ui, sans-serif; color: var(--text);
         background: radial-gradient(1200px 600px at 80% -10%, #2a1d6b 0%, transparent 60%),
                     radial-gradient(900px 500px at -10% 30%, #0d3b5c 0%, transparent 55%), var(--bg); }
  a { color: inherit; text-decoration: none; }
  .wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
  h1, h2, h3 { font-family: Unbounded, sans-serif; line-height: 1.15; margin: 0; }
  h2 { font-size: clamp(22px, 4vw, 30px); display: flex; align-items: center; gap: 10px; }
  h2 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px var(--cyan); flex: none; }
  .sh { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
  .sh > a { color: var(--cyan); font-weight: 700; font-size: 15px; white-space: nowrap; }
  section { padding: 34px 0; }
  .muted { color: var(--muted); }

  /* Шапка */
  header { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: rgba(10,14,31,.75); border-bottom: 1px solid var(--line); }
  .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
  .logo { display: flex; align-items: center; gap: 10px; line-height: 1.15; }
  .logo img { width: 42px; height: 42px; border-radius: 11px; flex: none; box-shadow: 0 4px 18px rgba(110,80,255,.35); }
  .logo strong { font: 700 16px Unbounded; display: block; }
  .logo small { color: var(--muted); font-size: 12px; }
  nav.top { display: flex; gap: 20px; color: var(--muted); font-weight: 500; }
  nav.top a:hover { color: var(--cyan); }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 12px; border: 0; cursor: pointer;
         font: 700 15px Manrope; background: var(--grad); color: #0a0e1f; white-space: nowrap; }
  .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
  .burger { display: none; background: none; border: 1px solid var(--line); color: var(--text); width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
  .mnav { display: none; }

  /* Смуга безпеки */
  .alert { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 12px 16px; border-radius: 14px;
           background: rgba(255,192,77,.09); border: 1px solid rgba(255,192,77,.35); font-size: 15px; }
  .alert b { color: var(--amber); }
  .alert a { margin-left: auto; color: var(--amber); font-weight: 700; white-space: nowrap; }

  /* Перший екран */
  .hero { padding: 40px 0 10px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: center; }
  .tag { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
  .hero h1 { font-size: clamp(32px, 6.4vw, 60px); }
  .hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .hero p { color: var(--muted); font-size: 18px; max-width: 560px; }
  .hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
  .today { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 22px; position: relative; overflow: hidden; }
  .today::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; background: var(--violet); filter: blur(70px); opacity: .45; pointer-events: none; }
  .today .row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
  .today .row:last-child { border: 0; }
  .today .big { font: 700 26px Unbounded; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .live { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
  .live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

  /* Швидкий доступ */
  .quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .q { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); transition: .2s; min-height: 76px; }
  .q:hover { border-color: rgba(62,230,255,.45); transform: translateY(-2px); }
  .q i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 21px; flex: none; }
  .q b { display: block; }
  .q small { color: var(--muted); font-size: 13px; }

  /* Картки */
  .grid { display: grid; gap: 16px; }
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .g2 { grid-template-columns: 1fr 1fr; }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; transition: .2s; }
  a.card:hover { border-color: rgba(62,230,255,.4); transform: translateY(-2px); }
  .when { color: var(--cyan); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .card h3 { font-size: 17px; margin: 8px 0; }
  .card p { color: var(--muted); margin: 0; }
  .news .img { height: 150px; margin: -20px -20px 16px; border-radius: 20px 20px 0 0; }
  .meta { display: flex; gap: 14px; margin-top: 12px; color: var(--muted); font-size: 14px; }
  .pin { border-color: rgba(255,95,168,.5); background: linear-gradient(160deg, rgba(255,95,168,.12), transparent 60%); }
  .pin .when { color: var(--pink); }

  /* Розклад */
  .controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
  select { min-height: 44px; padding: 0 40px 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 700 15px Manrope;
           appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
           background-position: right 18px center, right 12px center; background-size: 6px 6px; background-repeat: no-repeat; }
  .tabs { display: flex; gap: 6px; overflow-x: auto; }
  .tabs button { min-height: 44px; min-width: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 700 15px Manrope; cursor: pointer; }
  .tabs button.on { background: var(--grad); color: #0a0e1f; border-color: transparent; }
  .lesson { display: grid; grid-template-columns: 34px 96px 1fr auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .lesson:last-child { border: 0; }
  .lesson .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(62,230,255,.1); color: var(--cyan); font-weight: 700; }
  .lesson .t, .lesson .r { color: var(--muted); font-size: 14px; }
  .bells .lesson { grid-template-columns: 34px 1fr auto; }

  /* Події */
  .ev { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .ev:last-child { border: 0; }
  .ev .d { width: 58px; height: 58px; border-radius: 14px; background: rgba(155,107,255,.14); display: grid; place-items: center; text-align: center; line-height: 1.05; flex: none; }
  .ev .d b { font: 700 20px Unbounded; color: var(--violet); display: block; }
  .ev .d small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
  .ev .who { font-size: 13px; color: var(--muted); }

  /* Опитування */
  .opt { position: relative; display: block; width: 100%; text-align: left; min-height: 52px; margin-bottom: 10px; padding: 0 16px; border-radius: 14px;
         border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font: 600 16px Manrope; cursor: pointer; overflow: hidden; }
  .opt:hover { border-color: rgba(62,230,255,.45); }
  .opt .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(62,230,255,.25), rgba(155,107,255,.25)); transition: width .6s; }
  .opt span { position: relative; display: flex; justify-content: space-between; line-height: 52px; }

  /* Про школу */
  .about { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .stats div { padding: 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
  .stats b { display: block; font: 700 32px Unbounded; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .director { display: flex; gap: 16px; align-items: flex-start; }
  .ava { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 700 20px Unbounded; background: var(--grad); color: #0a0e1f; flex: none; }
  .director blockquote { margin: 10px 0 0; color: #cfd4f5; font-size: 17px; }

  /* Гуртки */
  .clubs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .club { padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
  .club i { font-style: normal; font-size: 26px; }
  .club b { display: block; margin: 6px 0 2px; }
  .club small { color: var(--muted); }

  /* Галерея */
  .gal { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 150px; gap: 12px; }
  .ph { border-radius: 18px; display: flex; align-items: flex-end; padding: 12px; font-weight: 700; font-size: 14px; }
  .ph:nth-child(1) { grid-column: span 2; grid-row: span 2; background: linear-gradient(140deg, #3ee6ff55, #9b6bff88); }
  .ph:nth-child(2) { background: linear-gradient(140deg, #ff5fa855, #9b6bff66); }
  .ph:nth-child(3) { background: linear-gradient(140deg, #9b6bff55, #3ee6ff44); }
  .ph:nth-child(4) { grid-column: span 2; background: linear-gradient(140deg, #0d3b5c, #3ee6ff55); }

  /* Вступ */
  .admit { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; padding: 26px; border-radius: 24px;
           background: linear-gradient(135deg, rgba(62,230,255,.12), rgba(155,107,255,.18)); border: 1px solid rgba(62,230,255,.3); }
  .steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
  .steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 0; }
  .steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #0a0e1f; font-weight: 700; flex: none; }

  /* Прозорість */
  .docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .doc { display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
  .doc:hover { border-color: rgba(62,230,255,.45); }
  .doc::before { content: "PDF"; font: 700 10px Manrope; color: var(--pink); border: 1px solid rgba(255,95,168,.5); border-radius: 6px; padding: 4px 5px; flex: none; }

  /* Запитання */
  details { border-bottom: 1px solid var(--line); }
  summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
  summary::after { content: "+"; color: var(--cyan); font-size: 22px; line-height: 1; }
  details[open] summary::after { content: "−"; }
  details p { margin: 0 0 16px; color: var(--muted); }

  /* Контакти */
  .contacts { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
  .crow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .crow:last-child { border: 0; }
  .crow i { font-style: normal; width: 24px; }
  .map { border-radius: 20px; min-height: 260px; border: 1px solid var(--line); position: relative; overflow: hidden;
         background: linear-gradient(transparent 49%, rgba(62,230,255,.12) 50%, transparent 51%) 0 0/60px 60px,
                     linear-gradient(90deg, transparent 49%, rgba(62,230,255,.12) 50%, transparent 51%) 0 0/60px 60px, #0d1330; }
  .map::after { content: "📍"; position: absolute; left: 50%; top: 45%; font-size: 40px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 12px var(--pink)); }

  footer { margin-top: 30px; padding: 30px 0 40px; border-top: 1px solid var(--line); color: var(--muted); }
  footer .grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  footer h3 { font-size: 15px; color: var(--text); margin-bottom: 10px; }
  footer a { display: block; padding: 4px 0; }

  .tabbar { display: none; }
  @media (max-width: 960px) {
    nav.top, header .btn { display: none; }
    .burger { display: block; }
    .mnav.open { display: flex; flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); max-height: calc(100vh - 68px); overflow-y: auto; }
    .mnav a { padding: 12px 0; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--line); }
    .hero, .g2, .g3, .about, .admit, .contacts { grid-template-columns: 1fr; }
    .hero { padding-top: 26px; }
    .quick, .clubs { grid-template-columns: 1fr 1fr; }
    .docs { grid-template-columns: 1fr; }
    .gal { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; }
    footer .grid { grid-template-columns: 1fr 1fr; }
    body { padding-bottom: 72px; }
    .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20; height: 66px;
              background: rgba(10,14,31,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
    .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); }
    .tabbar svg { width: 22px; height: 22px; }
    .tabbar a.on { color: var(--cyan); }
  }
  @media (max-width: 560px) {
    .quick { grid-template-columns: 1fr; }
    .q { min-height: 64px; }
    .lesson { grid-template-columns: 34px 1fr auto; }
    .lesson .t { grid-column: 2; grid-row: 2; margin-top: -10px; }
    .alert { display: grid; grid-template-columns: auto 1fr; align-items: start; }
    .alert a { grid-column: 2; margin-left: 0; }
  }

/* Переключатель языка UA / EN */
.lang { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.lang a { min-width: 40px; height: 36px; display: grid; place-items: center; border-radius: 9px; font: 700 13px Manrope; color: var(--muted); }
.lang a.on { background: var(--grad); color: #0a0e1f; }
.bar-right { display: flex; align-items: center; gap: 10px; }

/* Выбор класса: кнопка + выпадающая панель (на телефоне — шторка снизу) */
.kp { position: relative; }
.kp-btn { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px 6px 6px; border-radius: 14px; cursor: pointer;
          border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; text-align: left; transition: .15s; }
.kp-btn:hover, .kp.open .kp-btn { border-color: rgba(62,230,255,.55); box-shadow: 0 0 0 3px rgba(62,230,255,.12); }
.kp-badge { display: grid; place-items: center; min-width: 52px; height: 40px; padding: 0 8px; border-radius: 10px; background: var(--grad); color: #0a0e1f; font: 700 16px Unbounded; }
.kp-btn small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.kp-btn b { display: block; line-height: 1.25; }
.kp-btn svg { margin-left: 4px; color: var(--cyan); transition: transform .2s; flex: none; }
.kp.open .kp-btn svg { transform: rotate(180deg); }
.kp-pop { display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: min(420px, calc(100vw - 32px)); padding: 14px;
          border-radius: 20px; background: #121845; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.kp.open .kp-pop { display: block; animation: kpIn .16s ease-out; }
@keyframes kpIn { from { opacity: 0; transform: translateY(-6px); } }
.kp-handle { display: none; }
.kp-search { position: relative; }
.kp-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.kp-search input { width: 100%; height: 48px; padding: 0 14px 0 44px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--text); font: 600 16px Manrope; }
.kp-search input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(62,230,255,.15); }
.kp-hint { color: var(--muted); font-size: 13px; margin: 8px 2px 10px; }
.kp-list { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.kp-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.kp-row > span { width: 64px; flex: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.kp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-chip { min-width: 58px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text);
           font: 700 15px Manrope; cursor: pointer; transition: .12s; }
.kp-chip:hover, .kp-chip.active { border-color: var(--cyan); background: rgba(62,230,255,.12); }
.kp-chip.sel { background: var(--grad); color: #0a0e1f; border-color: transparent; }
.kp-mine { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.kp-empty { padding: 26px 8px; text-align: center; color: var(--muted); }
.kp-scrim { display: none; }
@media (max-width: 640px) {
  .kp-btn { width: 100%; }
  .kp-pop { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; z-index: 60; border-radius: 24px 24px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
            max-height: 85vh; display: flex !important; flex-direction: column; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); visibility: hidden; animation: none; }
  .kp.open .kp-pop { transform: none; visibility: visible; }
  .kp-handle { display: block; width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.25); margin: 0 auto 12px; }
  .kp-title { display: flex !important; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .kp-list { max-height: none; flex: 1; }
  .kp-chip { min-width: 64px; height: 48px; font-size: 16px; }
  .kp-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .kp.open .kp-scrim { opacity: 1; pointer-events: auto; }
  body.kp-lock { overflow: hidden; }
}
.kp-title { display: none; }
.kp-title b { font: 700 18px Unbounded; }
.kp-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--text); font-size: 20px; cursor: pointer; }

/* Сторінка новини */
.article { max-width: 760px; margin: 0 auto; padding: 30px 0 20px; }
.article h1 { font-size: clamp(26px, 5vw, 42px); margin: 10px 0 16px; }
.article img { width: 100%; border-radius: 20px; margin-bottom: 20px; }
.article .text { font-size: 18px; color: #d5daf7; white-space: pre-line; }
.news .img { background-size: cover; background-position: center; }
.opt:disabled { cursor: default; }
.lesson-empty { padding: 20px 0; color: var(--muted); text-align: center; }

/* Плашка безпеки з живим статусом тривоги (data-state: A — тривога, P — часткова, N — немає, порожньо — невідомо) */
#air > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.air-ic { font-size: 20px; line-height: 1.3; }
.air-live { display: none; }
#air[data-state=A] .air-live, #air[data-state=P] .air-live, #air[data-state=N] .air-live { display: block; }
.air-title { font-size: 16px; }
.air-at { color: var(--muted); font-size: 13px; margin-left: 4px; white-space: nowrap; }
#air[data-state=A] { background: rgba(255,72,96,.16); border-color: rgba(255,72,96,.65); animation: airPulse 2s ease-in-out infinite; }
#air[data-state=A] .air-title, #air[data-state=A] a { color: #ff8c9c; }
#air[data-state=A] .air-text b { color: #ff8c9c; }
#air[data-state=N] { background: rgba(78,230,160,.07); border-color: rgba(78,230,160,.3); }
#air[data-state=N] .air-title { color: var(--green); }
#air[data-state=N] .air-text { color: var(--muted); }
@keyframes airPulse { 50% { box-shadow: 0 0 0 4px rgba(255,72,96,.18), 0 0 26px rgba(255,72,96,.25); } }
@media (prefers-reduced-motion: reduce) { #air[data-state=A] { animation: none; } }

