:root{--bg:#f6f9f8;--paper:#fff;--ink:#26383a;--muted:#748486;--teal:#008b91;--teal-dark:#08777d;--teal-pale:#e5f2f1;--line:#e3ecea;--shadow:0 8px 24px rgba(0,91,94,.07);--danger:#c34d4d}
*{box-sizing:border-box}html{background:#e9eeee}body{margin:0;color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#e9eeee}.app-shell{max-width:430px;min-height:100dvh;margin:0 auto;background:var(--bg);padding-bottom:94px;box-shadow:0 0 50px #173c3c12}.topbar{height:76px;padding:14px 21px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:5;background:#f6f9f8ed;backdrop-filter:blur(14px)}.topbar-actions{display:flex;align-items:center;gap:9px}.brand{display:flex;gap:10px;align-items:center;text-decoration:none;color:var(--ink)}.brand-mark{width:39px;height:39px;border:1.5px solid var(--teal);border-radius:12px;display:grid;place-items:center;color:var(--teal);font:700 21px Georgia,serif}.brand-name{font-weight:800;letter-spacing:.03em;font-size:15px}.brand-name small{display:block;font-size:9px;letter-spacing:.1em;color:var(--muted);margin-top:3px}.icon-button{width:42px;height:42px;border:0;border-radius:14px;background:white;box-shadow:var(--shadow);display:grid;place-items:center;color:var(--ink);position:relative;cursor:pointer}.icon-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.notification-dot{display:none;position:absolute;right:9px;top:8px;width:8px;height:8px;background:var(--danger);border:1.5px solid white;border-radius:50%}.notification-dot.visible{display:block}main{padding:10px 20px 26px}.view{display:none;animation:appear .18s ease}.view.active{display:block}@keyframes appear{from{opacity:.45;transform:translateY(4px)}to{opacity:1;transform:none}}.eyebrow,.section-kicker{font-size:10px;font-weight:800;letter-spacing:.14em;color:var(--muted);margin:12px 0 10px}.section-kicker{margin-top:22px}h1{font-size:30px;line-height:1.12;letter-spacing:-.045em;margin:5px 0 9px;font-weight:780}.lead{font-size:13px;line-height:1.55;color:var(--muted);margin:0 0 23px}.featured-notice{padding:19px 18px 18px;border-radius:20px;color:white;background:linear-gradient(145deg,var(--teal),var(--teal-dark));box-shadow:var(--shadow);position:relative;overflow:hidden}.featured-notice:after{content:"";position:absolute;width:140px;height:140px;border:1px solid #ffffff20;border-radius:50%;right:-48px;top:-55px;box-shadow:0 0 0 18px #ffffff09,0 0 0 38px #ffffff08;pointer-events:none}.notice-label{font-size:9px;font-weight:800;letter-spacing:.13em;color:#e2f3f2;display:flex;align-items:center;gap:7px}.notice-label span{width:6px;height:6px;background:#f1c77d;border-radius:50%}.featured-notice h2{font-size:18px;line-height:1.3;margin:13px 0 7px;max-width:290px}.featured-notice p{font-size:12px;line-height:1.55;color:#e4f0ef;margin:0;max-width:300px}.light-link{border:0;background:none;color:white;padding:14px 0 0;font-size:11px;font-weight:800;cursor:pointer}.section-heading{display:flex;justify-content:space-between;align-items:center;margin:25px 0 12px}.section-heading h2{font-size:17px;margin:0;letter-spacing:-.02em}.inline-link{border:0;background:none;color:var(--teal-dark);font-size:11px;font-weight:800;cursor:pointer}.event-card{display:flex;align-items:center;gap:13px;padding:13px;background:var(--paper);border:1px solid var(--line);border-radius:16px;margin-bottom:9px}.event-date{width:51px;height:53px;flex:0 0 51px;border-radius:12px;background:var(--teal-pale);display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--teal-dark)}.event-date b{font-size:20px;line-height:1}.event-date span{font-size:8px;font-weight:800;letter-spacing:.1em;margin-top:4px}.event-card h3{font-size:13px;margin:0 0 4px}.event-card p{font-size:10px;color:var(--muted);margin:0}.service-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}.service-card{position:relative;text-align:left;border:1px solid var(--line);background:white;border-radius:18px;padding:16px 14px;min-height:145px;color:var(--ink);cursor:pointer}.service-card.wide{grid-column:1/-1;min-height:112px}.service-icon{width:36px;height:36px;border-radius:11px;background:var(--teal-pale);display:grid;place-items:center;color:var(--teal-dark);font-size:20px;margin-bottom:13px}.service-card strong{display:block;font-size:13px;line-height:1.3}.service-card small{display:block;color:var(--muted);font-size:10px;line-height:1.4;margin-top:5px;max-width:90%}.card-arrow{position:absolute;right:14px;top:17px;color:var(--muted)}.plain-card{background:white;border:1px solid var(--line);border-radius:18px;padding:18px;margin:12px 0}.plain-card h2{font-size:16px;line-height:1.4;margin:0 0 8px}.plain-card p{font-size:12px;color:var(--muted);line-height:1.55;margin:0}.primary-button{margin-top:17px;border:0;border-radius:12px;background:var(--teal);color:white;padding:12px 15px;font-size:12px;font-weight:750;cursor:pointer}.contact-row{width:100%;display:flex;justify-content:space-between;align-items:center;text-align:left;padding:15px 16px;border:1px solid var(--line);border-radius:15px;background:white;color:var(--ink);margin:9px 0;text-decoration:none;cursor:pointer}.contact-row b{font-size:13px}.contact-row small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.contact-row i{font-style:normal;font-size:22px;color:var(--muted)}.contact-details{margin-top:17px}.empty-state{background:white;border:1px dashed #cbdad7;border-radius:16px;padding:20px;color:var(--muted);font-size:12px;line-height:1.5}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(430px,100%);height:83px;padding:9px 7px calc(9px + env(safe-area-inset-bottom));background:#ffffffed;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);z-index:10;backdrop-filter:blur(15px)}.nav-item{border:0;background:none;color:#879495;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:9px;font-weight:750;cursor:pointer}.nav-item svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.nav-item.active{color:var(--teal-dark)}.nav-item.active svg{stroke-width:2.1}.modal-backdrop{position:fixed;inset:0;background:#172b2b55;z-index:20;display:none;align-items:flex-end;justify-content:center}.modal-backdrop.open{display:flex}.modal{width:min(430px,100%);background:var(--bg);border-radius:23px 23px 0 0;padding:21px 20px 35px;max-height:78vh;overflow:auto}.modal-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.modal-heading h2{font-size:20px;margin:0}.close-button{width:34px;height:34px;border:0;border-radius:50%;background:white;font-size:21px;cursor:pointer}.notice-entry{background:white;border:1px solid var(--line);border-radius:14px;padding:14px;margin:9px 0}.notice-entry b{font-size:12px}.notice-entry p{font-size:11px;line-height:1.45;color:var(--muted);margin:5px 0 0}.toast{position:fixed;bottom:100px;left:50%;transform:translate(-50%,12px);opacity:0;pointer-events:none;background:#26383a;color:white;padding:11px 15px;border-radius:12px;font-size:12px;z-index:30;transition:.2s;max-width:calc(100% - 32px);text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}button:focus-visible,a:focus-visible{outline:3px solid #65c3c4;outline-offset:3px}@media(min-width:600px){.app-shell{margin:24px auto;min-height:calc(100dvh - 48px);border-radius:28px;overflow:hidden}.bottom-nav{bottom:24px;border-radius:0 0 28px 28px}}

.brand-logo{width:43px;height:43px;object-fit:contain;border-radius:50%;background:#fff;border:1px solid var(--line);padding:2px;flex:0 0 43px}

/* WordPress-connected content */
.notice-entry{padding:16px 0;border-bottom:1px solid rgba(20,40,45,.10)}.notice-entry:last-child{border-bottom:0}.notice-entry .notice-label{margin-bottom:9px}.notice-entry small{display:block;margin-top:10px;color:#718084;font-size:12px}.event-card.is-cancelled{opacity:.58}.event-card a.inline-link{display:inline-block;margin-top:8px;text-decoration:none}

/* Timetable screen navigation */
.schedule-toolbar{margin:0 0 15px}
.schedule-back{border:0;background:transparent;color:var(--teal-dark);font:700 12px inherit;font-family:inherit;padding:8px 0;cursor:pointer}


/* Embedded electronic library */
.library-view{padding-bottom:0!important}
.library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.library-toolbar .eyebrow{margin-top:4px}
.library-toolbar h1{margin-bottom:0}
.library-open-link{width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--line);border-radius:13px;color:var(--teal-dark);text-decoration:none;font-size:22px;background:#fff;flex:0 0 40px}
.library-frame-wrap{width:100%;height:calc(100dvh - 235px);min-height:560px;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--shadow)}
.library-frame{display:block;width:100%;height:100%;border:0;background:#fff}
@media(max-width:480px){.library-frame-wrap{height:calc(100dvh - 220px);min-height:520px;border-radius:14px}}


/* Contact details and trust mailbox */
.contact-details h2{margin-bottom:18px}
.contact-detail{display:flex;align-items:flex-start;gap:13px;padding:13px 0;border-top:1px solid var(--line)}
.contact-symbol{width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;border-radius:11px;background:var(--teal-pale);color:var(--teal-dark);font-size:19px;font-weight:700}
.contact-detail b{display:block;font-size:12px}
.contact-detail p{margin:5px 0 0;color:var(--ink);font-size:12px;line-height:1.5}
.contact-detail a{color:var(--teal-dark);text-decoration:none;font-weight:650}
.contact-action{display:inline-block;margin-top:7px;font-size:11px}
.contact-site-link{display:block;margin-top:9px;padding-top:14px;border-top:1px solid var(--line);color:var(--teal-dark);font-size:12px;font-weight:800;text-decoration:none}
.trust-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}



/* Native Trust Mailbox */
.trust-view{padding-bottom:12px}
.trust-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.trust-info-card{display:flex;gap:12px;padding:16px;margin:18px 0 20px;border:1px solid #d9e9e7;border-left:4px solid var(--teal);border-radius:15px;background:#eef6f5}
.trust-info-icon{width:28px;height:28px;flex:0 0 28px;display:grid;place-items:center;border-radius:50%;background:#d8ebea;color:var(--teal-dark);font-weight:800}
.trust-info-card b{font-size:13px}
.trust-info-card p{margin:6px 0 0;font-size:11px;line-height:1.65;color:#405557}
.trust-form{padding:18px 0 0}
.trust-form-heading h2{margin:0 0 6px;font-size:19px;letter-spacing:-.02em}
.trust-form-heading p{margin:0 0 15px;color:var(--muted);font-size:12px;line-height:1.5}
.trust-form-panel{padding:17px 15px;border:1px solid var(--line);border-radius:17px;background:#fff;box-shadow:var(--shadow)}
.trust-field{margin:0 0 17px;min-width:0}
.trust-field label,.trust-field legend{display:block;margin:0 0 7px;color:var(--ink);font-size:12px;font-weight:750}
.trust-field label span,.trust-field legend span{color:var(--danger)}
.trust-field select,.trust-field input,.trust-field textarea{display:block;width:100%;min-height:44px;padding:11px 12px;border:1px solid #dce7e5;border-radius:11px;background:#fbfdfc;color:var(--ink);font:13px inherit;font-family:inherit;outline:none}
.trust-field textarea{min-height:125px;resize:vertical;line-height:1.5}
.trust-field select:focus,.trust-field input:focus,.trust-field textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px #008b9118}
.trust-mode-field{padding:0;border:0}
.trust-radio{display:flex!important;align-items:flex-start;gap:9px;margin:10px 0!important;font-size:12px!important;font-weight:550!important;line-height:1.45}
.trust-radio input,.trust-consent input{width:17px;height:17px;min-height:17px;flex:0 0 17px;margin:0;accent-color:var(--teal)}
.trust-name-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.trust-consent{display:flex;align-items:flex-start;gap:9px;margin:4px 0 17px;color:#4c5d5f;font-size:10px;line-height:1.55}
.trust-consent input{margin-top:1px}
.trust-honeypot{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.trust-submit{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:47px;padding:12px 16px;border:0;border-radius:12px;background:var(--teal);color:#fff;font:700 13px inherit;font-family:inherit;cursor:pointer;transition:background .2s,opacity .2s}
.trust-submit:hover{background:var(--teal-dark)}
.trust-submit:disabled{opacity:.65;cursor:wait}
.trust-submit-spinner{display:none;width:15px;height:15px;border:2px solid #ffffff66;border-top-color:#fff;border-radius:50%;animation:trustspin .7s linear infinite}
.trust-submit.is-loading .trust-submit-spinner{display:block}
@keyframes trustspin{to{transform:rotate(360deg)}}
.trust-form-feedback{margin:0 0 14px;padding:12px;border-radius:11px;font-size:12px;line-height:1.5}
.trust-form-feedback.is-success{background:#e8f5ee;color:#236344;border:1px solid #cce8d7}
.trust-form-feedback.is-error{background:#fff0ef;color:#9c3934;border:1px solid #f0d2cf}
.trust-privacy-note{margin:13px 0 0;color:var(--muted);font-size:10px;line-height:1.5;text-align:center}
@media(max-width:360px){.trust-form-panel{padding:14px 12px}.trust-name-grid{grid-template-columns:1fr;gap:0}}


/* Interactive event cards and event detail */
.event-card-button{width:100%;font:inherit;text-align:left;color:inherit;cursor:pointer;appearance:none;position:relative;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.event-card-button:hover,.event-card-button:focus-visible{border-color:var(--teal);box-shadow:0 5px 18px #163f4210;outline:none}
.event-card-button:active{transform:scale(.99)}
.event-card-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.event-card-copy strong{font-size:13px;line-height:1.35;font-weight:750}
.event-card-copy>span{font-size:10px;line-height:1.45;color:var(--muted)}
.event-card-arrow{color:var(--teal-dark);font-size:22px;font-weight:500;margin-left:auto;padding:0 3px}
.event-card.is-cancelled{opacity:.62}
.event-detail-backdrop{position:fixed;inset:0;z-index:1200;display:none;align-items:flex-end;justify-content:center;padding:14px;background:#101c20a8;backdrop-filter:blur(5px)}
.event-detail-backdrop.open{display:flex}
.event-detail-dialog{width:min(100%,560px);max-height:min(92dvh,900px);overflow:auto;background:var(--paper);border-radius:22px 22px 16px 16px;padding:19px;box-shadow:0 18px 60px #0003;animation:appear .2s ease}
.event-detail-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.event-detail-heading .eyebrow{margin:0}
.event-detail-dialog h2{font-size:22px;line-height:1.25;letter-spacing:-.03em;margin:4px 0 15px}
.event-detail-poster{display:block;width:100%;max-height:68dvh;object-fit:contain;border-radius:13px;background:#eef1f0}
.event-poster-open{display:block;width:100%;padding:0;margin:0 0 15px;border:0;background:transparent;cursor:zoom-in}
.event-detail-meta{display:grid;gap:0;margin:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.event-detail-meta p{display:grid;grid-template-columns:112px 1fr;gap:10px;margin:0;padding:11px 0;border-bottom:1px solid var(--line);font-size:12px;line-height:1.45}
.event-detail-meta p:last-child{border-bottom:0}
.event-detail-meta p span{color:var(--muted)}
.event-detail-meta p b{font-weight:700}
.event-detail-description{font-size:13px;line-height:1.65;color:var(--ink);overflow-wrap:anywhere}
.event-detail-description p{margin:0 0 12px}
.event-detail-description img{max-width:100%;height:auto;border-radius:10px}
.event-detail-description a{color:var(--teal-dark);text-decoration:underline}
.event-detail-empty,.event-poster-hint{font-size:11px;color:var(--muted);line-height:1.5}
.event-registration-link{display:inline-flex;margin-top:14px;padding:12px 15px;border-radius:11px;background:var(--teal);color:#fff;text-decoration:none;font-size:12px;font-weight:750}
.event-cancelled-label{display:inline-block;margin:0 0 12px;padding:5px 9px;border-radius:7px;background:#fff0ed;color:#a43e35;font-size:11px;font-weight:750}
.event-poster-hint{text-align:center;margin:9px 0 0}
.event-poster-full{display:block;width:100%;max-height:78dvh;object-fit:contain}
.poster-back{margin:0 0 12px;padding:8px 0;border:0;background:none;color:var(--teal-dark);font:700 12px inherit;font-family:inherit;cursor:pointer}
body.event-modal-open{overflow:hidden}
@media(min-width:700px){.event-detail-backdrop{align-items:center}.event-detail-dialog{border-radius:22px}}

/* Примусове оновлення застосунку */
.refresh-button{color:var(--teal-dark)}
.refresh-button svg{width:19px;height:19px}
.refresh-button.is-loading svg{animation:kfmk-refresh-spin .8s linear infinite}
.refresh-button:disabled{opacity:.65;cursor:wait}
@keyframes kfmk-refresh-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.refresh-button.is-loading svg{animation:none}}


/* Верхні дії: єдиний мінімалістичний стиль іконок */
.topbar-actions{gap:5px}
.topbar-actions .icon-button{
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  background:transparent;
  box-shadow:none;
  color:var(--ink);
  transition:background .18s ease,color .18s ease;
}
.topbar-actions .icon-button svg{
  width:20px;
  height:20px;
  stroke:currentColor;
  stroke-width:1.7;
}
.topbar-actions .icon-button:hover,
.topbar-actions .icon-button:focus-visible{
  background:rgba(53,87,90,.07);
  outline:none;
}
.topbar-actions .icon-button:active{background:rgba(53,87,90,.12)}
.topbar-actions .refresh-button{color:var(--ink)}
.topbar-actions .refresh-button.is-loading svg{
  animation:kfmk-refresh-spin .9s linear infinite;
}
.topbar-actions .refresh-button:disabled{opacity:.55}
.topbar-actions .notification-dot{right:7px;top:6px}
@media(prefers-reduced-motion:reduce){
  .topbar-actions .icon-button{transition:none}
  .topbar-actions .refresh-button.is-loading svg{animation:none}
}

/* Повідомлення адміністрації: пріоритети та горизонтальна стрічка */
.home-notices[hidden]{display:none!important}
.notice-carousel{overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;border-radius:18px}
.notice-carousel::-webkit-scrollbar{display:none}
.notice-carousel-track{display:flex;gap:10px;align-items:stretch}
.notice-carousel-track .featured-notice{flex:0 0 100%;scroll-snap-align:start;min-width:0}
.notice-carousel-track .featured-notice.notice-urgent{background:linear-gradient(145deg,#b94343,#922f35)}
.notice-carousel-track .featured-notice.notice-important{background:linear-gradient(145deg,#b98220,#936312)}
.notice-carousel-footer{display:flex;align-items:center;justify-content:space-between;min-height:28px;padding:3px 2px 0;color:var(--muted);font-size:10px}
.notice-carousel-footer .inline-link{padding:5px 0}
.notice-entry{border:1px solid var(--line);border-left:4px solid var(--teal);border-radius:13px;padding:14px;margin:9px 0;background:var(--paper)}
.notice-entry.notice-urgent{border-left-color:#c94d4d;background:#fff6f5}
.notice-entry.notice-important{border-left-color:#d59a2b;background:#fffaf0}
.notice-entry.notice-normal{border-left-color:var(--teal);background:#f3f9f7}
.notice-entry.notice-urgent .notice-label{color:#b53d3d}
.notice-entry.notice-important .notice-label{color:#966615}
.notice-entry.notice-normal .notice-label{color:var(--teal-dark)}
.notice-entry .notice-label span{background:currentColor}
.notice-entry b{display:block;color:var(--ink);font-size:13px;line-height:1.4}

/* Центроване вікно сповіщень */
#notificationsModal{align-items:center;padding:20px}
#notificationsModal .modal{width:min(430px,100%);max-height:min(78vh,720px);border-radius:22px;padding:21px 20px 24px;box-shadow:0 20px 70px #101c2040}

/* Перемикач теми */
.theme-button{color:var(--ink)}
.theme-button svg{width:19px;height:19px}

/* Темна тема застосунку */
html[data-theme="dark"]{color-scheme:dark;--bg:#172326;--paper:#202e31;--ink:#e8eeee;--muted:#a0b0b1;--teal:#62aeb0;--teal-dark:#8bc5c4;--teal-pale:#294345;--line:#354649;--shadow:0 8px 24px rgba(0,0,0,.22);--danger:#ef7777;--dark:#e8eeee;--text:#e8eeee}
html[data-theme="dark"] body,html[data-theme="dark"]{background:#111b1e;color:var(--ink)}
html[data-theme="dark"] .app-shell{background:var(--bg);box-shadow:0 0 50px #0005}
html[data-theme="dark"] .topbar{background:#172326ed}
html[data-theme="dark"] .bottom-nav{background:#202e31ed;border-color:var(--line)}
html[data-theme="dark"] .service-card,html[data-theme="dark"] .plain-card,html[data-theme="dark"] .contact-row,html[data-theme="dark"] .empty-state,html[data-theme="dark"] .modal,html[data-theme="dark"] .close-button,html[data-theme="dark"] .trust-form-panel,html[data-theme="dark"] .library-frame-wrap{background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .event-card{background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .notice-entry{background:#202e31;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .notice-entry.notice-urgent{background:#382729;border-left-color:#e16c6c}
html[data-theme="dark"] .notice-entry.notice-important{background:#393222;border-left-color:#d9aa51}
html[data-theme="dark"] .notice-entry.notice-normal{background:#203536;border-left-color:#62aeb0}
html[data-theme="dark"] .notice-entry.notice-urgent .notice-label{color:#ff9999}
html[data-theme="dark"] .notice-entry.notice-important .notice-label{color:#f0c777}
html[data-theme="dark"] .notice-entry.notice-normal .notice-label{color:#8bc5c4}
html[data-theme="dark"] .notice-entry b,html[data-theme="dark"] .notice-entry p{color:var(--ink)}
html[data-theme="dark"] .notice-entry small{color:var(--muted)}
html[data-theme="dark"] .event-detail-dialog{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .event-detail-poster{background:#172326}
html[data-theme="dark"] .event-detail-meta{border-color:var(--line)}
html[data-theme="dark"] .event-detail-meta p{border-color:var(--line)}
html[data-theme="dark"] .trust-info-card{background:#203536;border-color:#355456}
html[data-theme="dark"] .trust-info-card p{color:#c4d1d1}
html[data-theme="dark"] .trust-field select,html[data-theme="dark"] .trust-field input,html[data-theme="dark"] .trust-field textarea{background:#172326;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .trust-consent{color:#c4d1d1}
html[data-theme="dark"] .trust-form-heading p,html[data-theme="dark"] .trust-privacy-note{color:var(--muted)}
html[data-theme="dark"] .contact-detail{border-color:var(--line)}
html[data-theme="dark"] .contact-detail p{color:var(--ink)}
html[data-theme="dark"] .library-open-link{background:var(--paper);border-color:var(--line);color:var(--teal-dark)}
html[data-theme="dark"] .tt-panel,html[data-theme="dark"] .tt-week-day,html[data-theme="dark"] .tt-lesson,html[data-theme="dark"] .tt-week-lesson,html[data-theme="dark"] .tt-mobile-row,html[data-theme="dark"] .tt-program,html[data-theme="dark"] .tt-group,html[data-theme="dark"] .tt-day{background:var(--paper)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .tt-subject,html[data-theme="dark"] .tt-shared-cell,html[data-theme="dark"] .tt-mobile-group{background:#294345!important;color:#d7e7e6!important}
html[data-theme="dark"] .tt-info{background:#203536!important;color:#c4d1d1!important}
html[data-theme="dark"] .ranking-app,html[data-theme="dark"] .electives-app{color:var(--ink)}
html[data-theme="dark"] .ranking-app [style*="background:#fff"],html[data-theme="dark"] .electives-app [style*="background:#fff"]{background:var(--paper)!important;color:var(--ink)!important}
html[data-theme="dark"] .ranking-app input,html[data-theme="dark"] .ranking-app select,html[data-theme="dark"] .electives-app input,html[data-theme="dark"] .electives-app select{background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .toast{background:#e8eeee;color:#172326}
html[data-theme="dark"] .notification-dot{border-color:var(--bg)}
@media(prefers-reduced-motion:reduce){.notice-carousel{scroll-behavior:auto}}

/* Додаткові темні стилі навчальних модулів */
html[data-theme="dark"] .ranking-app{background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .ranking-field label,html[data-theme="dark"] .ranking-note,html[data-theme="dark"] .ranking-loading{color:var(--muted)}
html[data-theme="dark"] .ranking-select,html[data-theme="dark"] .ranking-search,html[data-theme="dark"] .electives-search{background:#172326;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .ranking-summary strong,html[data-theme="dark"] .ranking-person-name,html[data-theme="dark"] .ranking-person-score,html[data-theme="dark"] .ranking-table td{color:var(--ink)}
html[data-theme="dark"] .ranking-count,html[data-theme="dark"] .ranking-place{background:#294345;color:#d7e7e6}
html[data-theme="dark"] .ranking-table-wrap{border-color:var(--line)}
html[data-theme="dark"] .ranking-table th{background:#294345;color:#d7e7e6}
html[data-theme="dark"] .ranking-table td,html[data-theme="dark"] .ranking-person{border-color:var(--line)}
html[data-theme="dark"] .ranking-error{background:#3a3022;border-color:#665331;color:#f0d6a5}
html[data-theme="dark"] .ranking-error button{background:var(--teal);color:#102326}
html[data-theme="dark"] .electives-search,html[data-theme="dark"] .electives-action,html[data-theme="dark"] .elective-card{background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .elective-card summary,html[data-theme="dark"] .elective-meta-value,html[data-theme="dark"] .elective-description-label{color:var(--ink)}
html[data-theme="dark"] .elective-meta-item,html[data-theme="dark"] .electives-empty,html[data-theme="dark"] .electives-note,html[data-theme="dark"] .elective-chevron{background:#294345;color:#d7e7e6}
html[data-theme="dark"] .elective-details{border-color:var(--line)}
html[data-theme="dark"] .elective-description{color:#c5d2d2}
html[data-theme="dark"] .elective-meta-label,html[data-theme="dark"] .electives-count{color:var(--muted)}
html[data-theme="dark"] #kfmk-timetable .tt-program-select,html[data-theme="dark"] #kfmk-timetable .tt-custom-select-trigger,html[data-theme="dark"] #kfmk-timetable .tt-custom-select-menu,html[data-theme="dark"] #kfmk-timetable .tt-day-arrow{background:var(--paper)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] #kfmk-timetable .tt-custom-select-option{color:var(--ink)}
html[data-theme="dark"] #kfmk-timetable .tt-custom-select-option:hover,html[data-theme="dark"] #kfmk-timetable .tt-custom-select-option.is-selected{background:#294345;color:#e8eeee}
html[data-theme="dark"] #kfmk-timetable .tt-shared-scroll{background:var(--paper);border-color:var(--line)}
html[data-theme="dark"] #kfmk-timetable .tt-shared-grid th{background:#294345;color:#e8eeee;border-color:var(--line)}
html[data-theme="dark"] #kfmk-timetable .tt-shared-grid td:first-child{background:#202e31;color:var(--ink)}
html[data-theme="dark"] #kfmk-timetable .tt-shared-blank{background:#202e31}
html[data-theme="dark"] #kfmk-timetable .tt-label{color:#b4c4c4}


/* 1.8.6 — узгоджені піктограми верхньої панелі */
.topbar-actions{gap:7px}
.topbar .icon-button{
  width:36px;height:36px;min-width:36px;border:0;border-radius:10px;
  background:transparent;box-shadow:none;color:var(--ink);
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
.topbar .icon-button svg{width:20px;height:20px;stroke-width:1.8}
.topbar .icon-button:hover{background:var(--teal-pale);color:var(--teal-dark)}
.topbar .icon-button:active{transform:scale(.94)}
.topbar .icon-button:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.topbar .notification-dot{right:5px;top:5px}

/* 1.8.6 — темна тема: надійне покриття елементів інтерфейсу */
html[data-theme="dark"] body{background:#111b1e!important;color:var(--ink)!important}
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] #mainContent{background:var(--bg)!important;color:var(--ink)!important}
html[data-theme="dark"] .topbar{background:rgba(23,35,38,.94)!important}
html[data-theme="dark"] .brand,
html[data-theme="dark"] h1,html[data-theme="dark"] h2,
html[data-theme="dark"] h3,html[data-theme="dark"] p,
html[data-theme="dark"] .section-heading h2{color:var(--ink)}
html[data-theme="dark"] .lead,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .section-kicker{color:var(--muted)}
html[data-theme="dark"] .icon-button{color:var(--ink)!important}
html[data-theme="dark"] .icon-button:hover{background:#294345!important}
html[data-theme="dark"] .event-card,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .plain-card,
html[data-theme="dark"] .contact-row,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .trust-form-panel,
html[data-theme="dark"] .empty-state{background:var(--paper)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .event-card strong,
html[data-theme="dark"] .event-card span,
html[data-theme="dark"] .service-card *,
html[data-theme="dark"] .plain-card *{color:inherit}
html[data-theme="dark"] .bottom-nav{background:rgba(32,46,49,.97)!important;border-color:var(--line)!important}
html[data-theme="dark"] .bottom-nav .nav-item{color:var(--muted)}
html[data-theme="dark"] .bottom-nav .nav-item.active{color:var(--teal-dark)}
html[data-theme="dark"] .modal-backdrop{background:rgba(0,0,0,.62)}
html[data-theme="dark"] .close-button{background:#294345!important;color:var(--ink)!important}
html[data-theme="dark"] .trust-field input,
html[data-theme="dark"] .trust-field select,
html[data-theme="dark"] .trust-field textarea{background:#172326!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .notice-entry.notice-urgent{background:#382729!important}
html[data-theme="dark"] .notice-entry.notice-important{background:#393222!important}
html[data-theme="dark"] .notice-entry.notice-normal{background:#203536!important}

/* Home screen: administration notices are the primary content */
.home-notices{margin-top:22px}
.home-notices-heading .section-kicker{margin:0 0 8px}
.home-notices-heading p{font-size:12px;line-height:1.55;color:var(--muted);margin:0 0 15px}
.home-notice-list{display:grid;gap:9px}
.home-notice-list .notice-entry{margin:0}
.home-notice-list .notice-entry:last-child{margin-bottom:0}

/* Settings menu: compact centered dialog */
.settings-backdrop{position:fixed;inset:0;z-index:25;background:rgba(12,28,30,.48);display:none;align-items:center;justify-content:center;padding:22px;backdrop-filter:blur(3px)}
.settings-backdrop.open{display:flex}
.settings-dialog{width:min(390px,100%);background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:22px;padding:20px;box-shadow:0 22px 70px rgba(0,0,0,.22)}
.settings-dialog .modal-heading{margin-bottom:12px}
.settings-dialog .modal-heading h2{font-size:19px}
.settings-row{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 2px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);text-align:left}
.settings-row-copy{display:flex;align-items:center;gap:12px;min-width:0}
.settings-row-copy b{display:block;font-size:13px}
.settings-row-copy small{display:block;color:var(--muted);font-size:10px;line-height:1.4;margin-top:4px}
.settings-row-icon{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;border-radius:11px;background:var(--teal-pale);color:var(--teal-dark)}
.settings-row-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.settings-choice{border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--teal-dark);font:700 11px inherit;font-family:inherit;padding:8px 12px;cursor:pointer}
.settings-refresh-row{cursor:pointer;font-family:inherit}
.settings-refresh-row:disabled{opacity:.55;cursor:wait}
.settings-chevron{font-size:25px;color:var(--muted);line-height:1}
.settings-refresh-row.is-loading .settings-row-icon svg{animation:kfmk-refresh-spin .9s linear infinite}
html[data-theme="dark"] .settings-dialog{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .settings-choice{background:#172326;color:#9acbc4;border-color:var(--line)}
@media(prefers-reduced-motion:reduce){.settings-refresh-row.is-loading .settings-row-icon svg{animation:none}}

/* Keep settings and notification icons optically balanced in the top bar */
.topbar .icon-button svg{width:22px;height:22px;stroke-width:1.7}
.topbar .settings-button svg{width:22px;height:22px;stroke-width:1.7}


/* 1.9.2 — optical balance for settings and notification icons */
.topbar .settings-button svg{width:23px!important;height:23px!important;stroke-width:1.65!important;overflow:visible}
.topbar .notification-button svg{width:21px!important;height:21px!important;stroke-width:1.7!important}
.settings-dialog .push-setting-row{border-top:1px solid var(--line)}
.settings-dialog .push-setting-row .settings-choice:disabled{opacity:.55;cursor:wait}


/* 1.9.4 — native-style push toggle */
.settings-dialog .push-switch{appearance:none;-webkit-appearance:none;position:relative;display:inline-flex;align-items:center;flex:0 0 48px;width:48px;height:28px;padding:3px;border:0;border-radius:999px;background:#a8adb5;cursor:pointer;transition:background .2s ease,opacity .2s ease}
.settings-dialog .push-switch[aria-checked="true"]{background:var(--accent,#27865b)}
.settings-dialog .push-switch-thumb{display:block;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transform:translateX(0);transition:transform .2s ease}
.settings-dialog .push-switch[aria-checked="true"] .push-switch-thumb{transform:translateX(20px)}
.settings-dialog .push-switch:focus-visible{outline:3px solid color-mix(in srgb,var(--accent,#27865b) 35%,transparent);outline-offset:3px}
.settings-dialog .push-switch:disabled{opacity:.55;cursor:wait}
@media(prefers-reduced-motion:reduce){.settings-dialog .push-switch,.settings-dialog .push-switch-thumb{transition:none}}

/* Тимчасове виділення повідомлення, відкритого з push */
.notice-push-highlight { outline: 2px solid var(--accent, #27865b); outline-offset: 4px; transition: outline-color .25s ease; }


/* KFMK 1.9.8 — виразніша контрастна палітра, без зміни структури та логіки */
:root{
  --bg:#fbfdfc;
  --paper:#ffffff;
  --ink:#203638;
  --muted:#53696b;
  --teal:#007f83;
  --teal-dark:#00676c;
  --teal-pale:#dff1ef;
  --line:#cbdedb;
  --shadow:0 7px 20px rgba(12,63,65,.09);
  --danger:#bd343c;
}
html,body{background:#e7eeed;color:#203638}
.app-shell{background:#fbfdfc;color:#203638}
.topbar{background:rgba(251,253,252,.98);border-bottom:1px solid #e2ece9}
.brand{color:#203638}
.brand-name{color:#173638;font-size:16px}
.brand-name small{color:#52696b}
.brand-mark,.brand-logo{border-color:#b9d4d0}
.icon-button{background:#fff;color:#173638;box-shadow:0 2px 9px rgba(13,61,63,.12);border:1px solid #d5e5e1}
.icon-button svg{stroke-width:1.9}
main{color:#203638}
.eyebrow,.section-kicker{color:#496467}
h1{color:#173638;font-weight:850}
.lead{color:#53696b}
.section-heading h2{color:#203638;font-weight:820}
.inline-link{color:#00676c}
.featured-notice{background:linear-gradient(135deg,#007f83 0%,#005f65 100%);box-shadow:0 8px 20px rgba(0,95,101,.2)}
.event-card,.service-card,.plain-card,.contact-row{
  background:#fff;border:1px solid #cfdfdc;
  box-shadow:0 3px 12px rgba(19,64,65,.055);
}
.event-card h3,.service-card strong,.plain-card h2,.contact-row b{color:#203638}
.event-card p,.service-card small,.plain-card p,.contact-row small{color:#53696b}
.event-date,.service-icon{background:#dff1ef;color:#00676c}
.event-card-arrow,.card-arrow{color:#00676c}
.empty-state{background:#f0f8f7;border:1px dashed #a9c9c4;color:#496164}
.notice-entry{background:#fff;border-color:#d2e1de}
.notice-entry.notice-urgent{background:#fff1f0;border-left:4px solid #c43d43}
.notice-entry.notice-important{background:#fff8e8;border-left:4px solid #c18a19}
.notice-entry.notice-normal{background:#edf7f5;border-left:4px solid #008087}
.notice-entry b{color:#203638}
.notice-entry p{color:#455d60}
.notice-entry small{color:#607477}
.bottom-nav{background:rgba(255,255,255,.99);border-top:1px solid #cbdedb;box-shadow:0 -4px 14px rgba(20,66,67,.045)}
.nav-item{color:#617477;font-weight:800}
.nav-item.active{color:#fff;background:#00777b;border-radius:14px}
.nav-item.active svg{stroke-width:2.2}
.primary-button{background:#00777b;box-shadow:0 4px 10px rgba(0,119,123,.18)}
.modal{background:#fbfdfc;color:#203638}
.modal-heading h2{color:#173638}
.close-button{background:#e4f1ef;color:#173638}
.settings-dialog{background:#fbfdfc;border:1px solid #cbdedb}
.settings-row,.settings-row-copy b{color:#203638}
.settings-row-copy small{color:#53696b}
.settings-row-icon{background:#dff1ef;color:#00676c}
.settings-choice{border-color:#b8d3cf;color:#00676c}
.contact-detail,.contact-detail p{color:#344c4e}
.contact-detail a,.contact-site-link{color:#00676c}
.trust-info-card{background:#e8f4f2;border-color:#c5ddda;border-left-color:#007f83}
.trust-info-card p{color:#344f51}
.trust-field label,.trust-field legend{color:#203638}
.trust-field select,.trust-field input,.trust-field textarea{background:#fff;border-color:#bcd2ce;color:#203638}
.trust-consent{color:#40595b}
.library-open-link{background:#fff;border-color:#cbdedb;color:#00676c}
/* У навчальних компонентах посилюємо контраст, не торкаючись iframe бібліотеки */
#kfmk-timetable .tt-panel,#kfmk-timetable .tt-week-day,#kfmk-timetable .tt-lesson,
#kfmk-timetable .tt-week-lesson,#kfmk-timetable .tt-mobile-row,#kfmk-timetable .tt-program,
#kfmk-timetable .tt-group,#kfmk-timetable .tt-day{border-color:#cbdedb}
#kfmk-timetable .tt-program-select,#kfmk-timetable .tt-custom-select-trigger{border-color:#b7d0cc;color:#203638}
.ranking-app,.electives-app{color:#203638}
.ranking-app .ranking-select,.ranking-app .ranking-search,.electives-app .electives-search{border-color:#b9d1cd;color:#203638}
.ranking-app .ranking-table th{background:#dff1ef;color:#17494c}
.ranking-app .ranking-table td{color:#203638}
.electives-app .elective-card{border-color:#cbdedb}


/* Medical certificate submission */
.medical-info-card{display:flex;gap:11px;padding:14px;border:1px solid #c8e2df;border-left:4px solid var(--teal);border-radius:14px;background:#eaf5f3;margin:16px 0 18px}
.medical-info-icon{width:25px;height:25px;flex:0 0 25px;border-radius:50%;display:grid;place-items:center;background:#d2e9e5;color:var(--teal-dark);font-weight:800}
.medical-info-card p{margin:0;color:#29494a;font-size:11px;line-height:1.55}
.medical-form{padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--paper);box-shadow:var(--shadow)}
.medical-field{margin:0 0 15px;min-width:0}
.medical-field label{display:block;margin:0 0 7px;color:var(--ink);font-size:12px;font-weight:750}
.medical-field label>span{color:var(--danger)}
.medical-field label small,.medical-field>small{color:var(--muted);font-weight:500;font-size:10px}
.medical-field input,.medical-field textarea{display:block;width:100%;min-height:44px;padding:11px 12px;border:1px solid #cbdad7;border-radius:11px;background:#fff;color:#203537;font:13px inherit;font-family:inherit;outline:none}
.medical-field input[type=file]{padding:9px;font-size:11px}
.medical-field textarea{min-height:84px;resize:vertical;line-height:1.5}
.medical-field input:focus,.medical-field textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px #008b9120}
.medical-field>small{display:block;margin-top:6px;line-height:1.45}
.medical-date-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.medical-consent{display:flex;align-items:flex-start;gap:9px;color:var(--muted);font-size:10px;line-height:1.5;margin:4px 0 15px}
.medical-consent input{flex:0 0 auto;margin:2px 0 0;accent-color:var(--teal)}
.medical-honeypot{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important}
.medical-submit{width:100%;min-height:46px;border:0;border-radius:12px;background:var(--teal-dark);color:white;font-size:13px;font-weight:800;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:9px}
.medical-submit:disabled{opacity:.65;cursor:wait}
.medical-submit i{display:none;width:15px;height:15px;border:2px solid #ffffff66;border-top-color:#fff;border-radius:50%;animation:medical-spin .7s linear infinite}
.medical-submit.is-loading i{display:block}
@keyframes medical-spin{to{transform:rotate(360deg)}}
.medical-feedback{margin:0 0 13px;padding:11px 12px;border-radius:10px;font-size:11px;line-height:1.5}
.medical-feedback.is-success{background:#e6f4ec;color:#1e6840}
.medical-feedback.is-error{background:#fff0ef;color:#a53232}
.medical-privacy-note{margin:11px 2px 0;color:var(--muted);font-size:9px;line-height:1.45;text-align:center}
html[data-theme="dark"] .medical-info-card{background:#203b3c;border-color:#315e5e}
html[data-theme="dark"] .medical-info-card p{color:#d8e8e6}
html[data-theme="dark"] .medical-info-icon{background:#315e5e;color:#d8f2ef}
html[data-theme="dark"] .medical-form{background:var(--paper);border-color:var(--line)}
html[data-theme="dark"] .medical-field input,html[data-theme="dark"] .medical-field textarea{background:#172326;color:#edf5f4;border-color:#3b5052}
html[data-theme="dark"] .medical-consent{color:var(--muted)}

/* Start time on event cards */
.event-card-time{display:inline;font-weight:800;color:var(--teal-dark);font-variant-numeric:tabular-nums}
.event-card-separator{color:var(--muted)}
html[data-theme="dark"] .event-card-time{color:var(--teal)}
