:root {
  color-scheme: light;
  --forest: #173d2e;
  --forest-2: #24533d;
  --lime: #d8f27a;
  --lime-soft: #edf5d4;
  --ink: #17221c;
  --muted: #778179;
  --line: #e6eae4;
  --paper: #f5f7f2;
  --card: #ffffff;
  --tg-safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100dvh; max-width: 680px; margin: 0 auto; padding: 0 20px calc(112px + var(--tg-safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--forest); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--forest); color: #fff; }
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 12px; line-height: 1; letter-spacing: .1em; font-weight: 800; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .025em; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--card); cursor: pointer; transition: transform .18s ease, background .18s ease; }
.icon-button:active, .nav-item:active { transform: scale(.96); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: var(--forest); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 18px 0 20px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 7vw, 34px); line-height: 1.08; letter-spacing: -.055em; font-weight: 700; }
.group-pill { max-width: 54%; min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 11px; overflow: hidden; border: 1px solid #dce4d8; border-radius: 999px; background: #fff; color: var(--forest); font-size: 10px; font-weight: 700; cursor: pointer; }
.group-pill #group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #83ad49; }
.chevron { margin-left: 1px; color: var(--muted); font-size: 16px; line-height: .7; }
.hero-card { position: relative; min-height: 194px; overflow: hidden; padding: 21px 20px 16px; border-radius: 19px; color: #fff; background: #173d2e; box-shadow: 0 16px 32px rgba(23,61,46,.13); }
.hero-content { position: relative; z-index: 1; max-width: 75%; }
.hero-label { display: inline-flex; align-items: center; min-height: 23px; padding: 0 9px; border: 1px solid rgba(216,242,122,.34); border-radius: 999px; color: var(--lime); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.hero-card h2 { margin: 15px 0 5px; font-size: clamp(23px, 6vw, 29px); line-height: 1.1; letter-spacing: -.045em; }
.hero-card p { max-width: 270px; margin-bottom: 0; color: rgba(255,255,255,.73); font-size: 12px; line-height: 1.55; }
.hero-icon { position: absolute; top: 37px; right: 18px; z-index: 1; width: 72px; height: 72px; display: grid; place-items: center; color: rgba(255,255,255,.92); }
.hero-icon svg { width: 100%; height: 100%; }
.hero-orbit { display:none; }
.hero-footer { position: absolute; left: 20px; right: 20px; bottom: 15px; display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.72); font-size: 9px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(216,242,122,.13); }
.hero-week { margin-left: auto; color: var(--lime); font-weight: 700; }
.schedule-section { padding-top: 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.04em; }
.text-button { padding: 8px 12px; border: 0; border-radius: 999px; background: var(--lime-soft); color: var(--forest); font-size: 10px; font-weight: 700; cursor: pointer; }
.day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin-bottom: 15px; }
.day-chip { min-height: 58px; display: grid; align-content: center; justify-items: center; gap: 4px; border: 1px solid transparent; border-radius: 17px; background: transparent; color: var(--muted); cursor: pointer; }
.day-chip span:first-child { font-size: 9px; font-weight: 600; }
.day-chip span:last-child { font-size: 13px; font-weight: 700; }
.day-chip.selected { background: var(--forest); color: #fff; box-shadow: 0 7px 14px rgba(23,61,46,.16); }
.day-chip.today:not(.selected) { border-color: #d8e3ce; background: #fff; color: var(--forest); }
.schedule-list { display: grid; gap: 10px; }
.lesson-card { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 14px 14px 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); animation: card-in .2s ease both; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.lesson-time { padding-top: 2px; color: var(--forest); font-size: 11px; line-height: 1.5; font-weight: 800; font-variant-numeric: tabular-nums; }
.lesson-time small { display: block; color: #98a198; font-size: 9px; font-weight: 600; }
.lesson-main { min-width: 0; }
.lesson-title { margin: 0 0 8px; font-size: 13px; line-height: 1.4; font-weight: 700; letter-spacing: -.02em; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }
.meta-icon { color: #91a277; font-size: 11px; }
.week-badge { position: absolute; top: 10px; right: 10px; padding: 4px 6px; border-radius: 999px; background: #f0f3ed; color: #69756a; font-size: 8px; font-weight: 700; }
.lesson-card.is-current { border-color: #b9d47e; background: #fbfdf5; box-shadow: 0 5px 16px rgba(103,133,61,.08); }
.lesson-card.is-current::before { position: absolute; top: 15px; bottom: 15px; left: -1px; width: 3px; border-radius: 0 4px 4px 0; background: #9dc64c; content: ""; }
.current-tag { display: inline-flex; margin: 0 0 7px; color: #638c2b; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.empty-card { display: grid; justify-items: center; padding: 27px 18px 25px; border: 1px dashed #d6dfd1; border-radius: 20px; background: rgba(255,255,255,.55); text-align: center; }
.empty-illustration { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 11px; border-radius: 16px; background: var(--lime-soft); color: var(--forest); font-size: 22px; }
.empty-card strong { margin-bottom: 5px; font-size: 13px; }
.empty-card p { max-width: 260px; margin-bottom: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.updated-note { margin: 13px 4px 0; color: #99a199; font-size: 9px; text-align: center; }
.week-controls { display: flex; gap: 6px; }
.icon-button.small { width: 34px; height: 34px; border-radius: 12px; font-size: 20px; }
.week-range { margin: -5px 0 14px; color: var(--muted); font-size: 10px; }
.week-list { display: grid; gap: 11px; }
.week-day { padding: 13px; border: 1px solid var(--line); border-radius: 19px; background: var(--card); }
.week-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.week-day-title { font-size: 11px; font-weight: 800; }
.week-day-title small { margin-left: 5px; color: var(--muted); font-size: 9px; font-weight: 500; }
.week-day-count { color: var(--muted); font-size: 9px; }
.week-lesson { width:100%; display: grid; grid-template-columns: 44px 1fr; gap: 9px; padding: 9px 0; border:0; border-top: 1px solid #f0f2ee; background:transparent; text-align:left; font:inherit; cursor:pointer; }
.week-lesson-time { color: var(--forest); font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; }
.week-lesson-title { margin-bottom: 3px; font-size: 10px; line-height: 1.4; font-weight: 700; }
.week-lesson-meta { color: var(--muted); font-size: 8px; }
.week-empty { padding: 8px 0 2px; color: #9ba39b; font-size: 9px; }
.source-note { display: flex; gap: 9px; margin-top: 22px; padding: 12px; border-radius: 16px; background: #edf1e9; }
.source-icon { flex: 0 0 auto; width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid #91a27f; border-radius: 50%; color: #607450; font-family: Georgia, serif; font-size: 11px; font-weight: 700; }
.source-note p { margin: 0; color: #687368; font-size: 9px; line-height: 1.55; }
.source-note a { color: var(--forest); font-weight: 700; }
.bottom-nav { position: fixed; z-index: 4; right: 50%; bottom: calc(10px + var(--tg-safe-bottom)); width: min(440px, calc(100% - 28px)); display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px; border: 1px solid rgba(225,231,222,.88); border-radius: 17px; background: rgba(255,255,255,.97); box-shadow: 0 5px 18px rgba(31,52,36,.09);  transform: translateX(50%); }
.nav-item { min-height: 48px; display: grid; align-content: center; justify-items: center; gap: 3px; border: 0; border-radius: 11px; background: transparent; color: #7c867d; font-size: 9px; font-weight: 700; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.nav-item.active { background: var(--forest); color: #fff; }
.nav-icon { font-size: 17px; line-height: 1; }
.hidden { display: none !important; }
.group-dialog { width: min(100% - 24px, 460px); max-height: min(78dvh, 680px); padding: 18px; overflow: hidden; border: 0; border-radius: 18px; background: var(--paper); box-shadow: 0 25px 80px rgba(9,30,19,.24); }
.group-dialog::backdrop { background: rgba(15,32,23,.45);  }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dialog-head .eyebrow { margin-bottom: 5px; }
.dialog-head h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.search-box { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: #8b958c; }
.search-box span { font-size: 20px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.group-results { display: grid; gap: 6px; max-height: 48dvh; margin-top: 12px; overflow: auto; }
.group-option { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border: 0; border-radius: 13px; background: #fff; text-align: left; font-size: 11px; font-weight: 700; cursor: pointer; }
.group-option.selected { background: var(--lime-soft); color: var(--forest); }
.group-option small { color: var(--muted); font-size: 9px; font-weight: 500; }
  .dialog-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 12px 2px 0; color: var(--muted); font-size: 9px; }
  .dialog-foot p { margin: 0; }
  .dialog-foot .text-button { padding: 0; }
.toast { position: fixed; z-index: 8; left: 50%; bottom: calc(83px + var(--tg-safe-bottom)); max-width: calc(100% - 36px); padding: 10px 14px; border-radius: 13px; background: #1d3226; color: #fff; font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { color: var(--muted); }
@media (min-width: 700px) { body { padding: 24px 0; } .app-shell { border: 1px solid #e8ece5; border-radius: 28px; background: #fbfcf9; box-shadow: 0 18px 70px rgba(23,61,46,.08); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* SPBFTUIT visual refresh */
.brand-copy strong { letter-spacing: .14em; }


/* Search and lesson details */
.schedule-search { margin:0 0 9px; }
.search-hint { margin:0 0 13px; color:var(--muted); font-size:10px; line-height:1.5; }
.search-results { display:grid; gap:9px; }
.search-result { width:100%; display:grid; grid-template-columns:56px 1fr; gap:10px; padding:13px; border:1px solid var(--line); border-radius:17px; background:#fff; text-align:left; cursor:pointer; }
.search-result:active { transform:scale(.99); }
.search-result:focus-visible,.week-lesson:focus-visible,.lesson-card:focus-visible { outline:2px solid #78994e; outline-offset:2px; }
.search-result-time { color:var(--forest); font-size:10px; font-weight:800; line-height:1.5; }
.search-result-day { display:block; color:var(--muted); font-size:8px; font-weight:600; }
.search-result-title { margin:0 0 5px; font-size:12px; font-weight:750; line-height:1.4; }
.search-result-meta { color:var(--muted); font-size:9px; line-height:1.5; }
.lesson-dialog { max-height:min(82dvh,620px); }
.lesson-details { display:grid; gap:0; padding:0 18px 18px; }
.lesson-details p { display:grid; gap:5px; margin:0; padding:12px 0; border-bottom:1px solid var(--line); }
.lesson-details p:last-child { border-bottom:0; }
.lesson-details span { color:var(--muted); font-size:9px; font-weight:700; }
.lesson-details strong { color:var(--ink); font-size:12px; line-height:1.5; font-weight:650; }
.lesson-card,.week-lesson { cursor:pointer; }
.lesson-card:active,.week-lesson:active { opacity:.8; }

.search-week-controls { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:4px 0 10px; }
.search-week-controls span { color:var(--muted); font-size:10px; font-weight:700; font-variant-numeric:tabular-nums; }

/* Original full-schedule tools in the compact Mini App visual language */
.filter-bar { display:flex; align-items:center; gap:5px; width:100%; padding:4px; margin:0 0 15px; overflow-x:auto; border:1px solid #e5eae1; border-radius:16px; background:#edf1e9; scrollbar-width:none; }
.filter-bar::-webkit-scrollbar { display:none; }
.filter-chip { flex:1 0 auto; min-width:0; min-height:36px; padding:0 10px; border:1px solid transparent; border-radius:12px; background:transparent; color:#778179; font-size:10px; line-height:1; font-weight:750; white-space:nowrap; cursor:pointer; transition:background .18s ease,color .18s ease,box-shadow .18s ease; }
.filter-chip.active { border-color:#173d2e; background:#173d2e; color:#fff; box-shadow:0 3px 9px rgba(23,61,46,.14); }
.week-section .section-heading { align-items:center; margin-bottom:8px; }
.week-section .week-controls { padding:3px; border:1px solid #e5eae1; border-radius:14px; background:#edf1e9; }
.week-section .week-controls .icon-button { width:36px; height:36px; border:0; border-radius:11px; background:#fff; color:var(--forest); font-size:22px; }
.week-range { display:flex; align-items:center; gap:7px; margin:0 0 14px; padding:9px 12px; border:1px solid #e7ece4; border-radius:12px; background:#fff; color:var(--forest); font-size:10px; font-weight:750; font-variant-numeric:tabular-nums; }
.week-day { padding:14px; border:1px solid #e7ece4; border-radius:17px; background:#fff; box-shadow:0 3px 12px rgba(23,61,46,.035); }
.week-day-head { min-height:28px; }
.week-day-title { display:flex; align-items:center; gap:7px; font-size:12px; }
.week-day-title small { margin:0; padding:4px 7px; border-radius:8px; background:#f1f4ed; font-size:9px; }
.week-day-count { padding:5px 8px; border-radius:999px; background:#f1f4ed; color:#657365; font-size:9px; font-weight:700; }
.week-lesson { grid-template-columns:52px minmax(0,1fr); gap:10px; padding:11px 2px; border-top:1px solid #eef1eb; }
.week-lesson-time { display:grid; align-content:center; font-size:10px; line-height:1.55; }
.week-lesson-title { margin-bottom:4px; font-size:11px; line-height:1.45; }
.week-lesson-meta { font-size:9px; line-height:1.4; }
@media(max-width:380px) { .filter-chip { padding:0 8px; font-size:9px; } }
.quick-actions { position:fixed; z-index:12; right:max(18px,calc((100vw - 680px)/2 + 18px)); bottom:calc(22px + var(--tg-safe-bottom)); display:flex; flex-direction:column; align-items:center; gap:10px; }
.quick-main { width:48px; height:48px; display:grid; place-items:center; border:0; border-radius:50%; background:var(--forest); color:#fff; box-shadow:0 5px 18px rgba(23,61,46,.23); font-size:25px; cursor:pointer; transition:transform .2s; }
.quick-main.active { transform:rotate(45deg); }
.quick-menu { display:flex; flex-direction:column; gap:9px; opacity:0; pointer-events:none; transform:translateY(10px) scale(.94); transition:.18s ease; }
.quick-menu.open { opacity:1; pointer-events:auto; transform:none; }
.quick-action { width:40px; height:40px; display:grid; place-items:center; border:1px solid var(--line); border-radius:50%; background:#fff; color:var(--forest); box-shadow:0 3px 12px rgba(23,61,46,.12); font-size:17px; cursor:pointer; }
.utility-dialog { max-height:min(84dvh,720px); }
.calendar-controls { display:flex; align-items:center; justify-content:space-between; margin:4px 0 12px; }
.calendar-controls strong { font-size:13px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; }
.calendar-day-head { padding:5px 0; color:var(--muted); font-size:9px; text-align:center; }
.calendar-day { min-height:36px; border:1px solid transparent; border-radius:10px; background:#f0f3ed; font-size:10px; cursor:pointer; }
.calendar-day.odd-week { background:#edf5d4; color:#24533d; }
.calendar-day.even-week { background:#e8eee8; color:#526454; }
.calendar-day.today { border-color:var(--forest); font-weight:850; }
.calendar-day.empty { background:transparent; }
.calendar-details { margin-top:13px; padding-top:12px; border-top:1px solid var(--line); color:var(--muted); font-size:10px; line-height:1.5; }
.calendar-lesson-list p { margin:8px 0; color:var(--ink); }
.calendar-lesson-list small { display:block; color:var(--muted); }
.map-frame { height:min(55dvh,440px); overflow:hidden; border-radius:14px; }
.map-frame iframe { width:100%; height:100%; border:0; }
.weather-current { display:grid; gap:5px; padding:16px; border-radius:16px; background:var(--lime-soft); color:var(--forest); }
.weather-current strong { font-size:36px; line-height:1; }
.weather-current span { font-size:12px; font-weight:750; }
.weather-current small { color:var(--muted); font-size:9px; line-height:1.5; }
.weather-days { display:grid; gap:7px; margin-top:12px; }
.weather-days div { display:grid; grid-template-columns:44px 1fr auto; align-items:center; gap:8px; padding:9px 10px; border:1px solid var(--line); border-radius:12px; font-size:9px; }
.weather-days span { color:var(--muted); }
.teacher-profile { color:var(--forest); font-weight:700; text-decoration:none; }
.lesson-details a { text-decoration:underline; text-underline-offset:2px; }
@media(max-width:420px) { .quick-actions { right:14px; bottom:calc(90px + var(--tg-safe-bottom)); } }


/* Normalize controls across mobile browsers and Telegram WebView. */
button, input, select, textarea { -webkit-appearance: none; appearance: none; }
button { font-family: inherit; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 4px; width: 100%; padding: 4px; margin: 0 0 15px; border: 1px solid #e5eae1; border-radius: 16px; background: #edf1e9; }
.filter-chip { width: 100%; min-width: 0; min-height: 38px; padding: 0 5px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #68766b; font-size: clamp(9px, 2.7vw, 11px); line-height: 1.15; font-weight: 750; white-space: nowrap; cursor: pointer; }
.filter-chip.active { border-color: #173d2e; background: #173d2e; color: #fff; box-shadow: 0 3px 9px rgba(23,61,46,.14); }
.filter-chip:focus-visible, .icon-button:focus-visible, .text-button:focus-visible, .nav-item:focus-visible, .group-pill:focus-visible { outline: 2px solid #86a957; outline-offset: 2px; }
@media (max-width: 360px) { .filter-bar { gap: 2px; padding: 3px; } .filter-chip { font-size: 9px; } }

.online-indicator { display:inline-flex; align-items:center; gap:5px; margin-top:4px; color:#6e8d4c; font-size:9px; font-weight:700; letter-spacing:0; }
.online-indicator[hidden] { display:none !important; }
.online-indicator::before { width:6px; height:6px; border-radius:50%; background:#83ad49; content:""; box-shadow:0 0 0 3px rgba(131,173,73,.12); }


/* Unified schedule navigation: one screen, two time ranges. */
.schedule-toolbar { display:grid; gap:10px; margin-top:25px; }
.schedule-mode { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:4px; border:1px solid var(--line); border-radius:15px; background:#edf1e9; }
.mode-button { min-height:39px; display:flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:11px; background:transparent; color:var(--muted); font-size:11px; font-weight:750; cursor:pointer; }
.mode-button svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.mode-button.active { background:var(--forest); color:#fff; box-shadow:0 3px 9px rgba(23,61,46,.14); }
.schedule-toolbar .filter-bar { margin:0; grid-template-columns:repeat(4,minmax(0,1fr)); }
.schedule-section { padding-top:20px; }
.quick-action svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.lesson-card { cursor:pointer; }
.lesson-card:focus-visible, .week-lesson:focus-visible { outline:2px solid #86a957; outline-offset:2px; }
.lesson-details p { display:grid; grid-template-columns:110px 1fr; gap:10px; align-items:start; }
.teacher-profile { color:var(--forest); text-decoration:underline; text-decoration-color:#b7c9a9; text-underline-offset:3px; }

.meta-svg { width:13px; height:13px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.empty-illustration svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

.chevron-icon { width:14px; height:14px; flex:0 0 auto; fill:none; stroke:var(--muted); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.quick-main svg, .icon-button.small svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }


/* Smooth, touch-friendly day carousel and restored live timetable status. */
.day-strip { display:flex; gap:9px; overflow-x:auto; overscroll-behavior-x:contain; scroll-snap-type:x mandatory; scroll-behavior:smooth; touch-action:pan-x pan-y; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding:3px 2px 10px; cursor:grab; }
.day-strip::-webkit-scrollbar { display:none; }
.day-chip { flex:0 0 clamp(58px, 15vw, 76px); min-height:68px; scroll-snap-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; border-radius:17px; transition:transform .22s ease, background .22s ease, box-shadow .22s ease; }
.day-chip:active { transform:scale(.94); }
.day-chip.selected { transform:translateY(-2px); box-shadow:0 7px 17px rgba(23,61,46,.13); }
.hero-next { grid-column:1/-1; margin:9px 0 0; padding:9px 11px; border:1px solid rgba(255,255,255,.18); border-radius:12px; background:rgba(255,255,255,.09); color:rgba(255,255,255,.94); font-size:11px; line-height:1.45; overflow-wrap:anywhere; }
.week-section .filter-bar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0 0 12px; }
@media (prefers-reduced-motion: reduce) { .day-strip { scroll-behavior:auto; } .day-chip { transition:none; } }


/* Compact counters, explicit current-week shortcut, and uncluttered status card. */
.schedule-count { margin:5px 0 0; color:var(--muted); font-size:10px; line-height:1.3; font-weight:700; font-variant-numeric:tabular-nums; }
.week-current-button { flex:0 0 auto; }
.week-current-button.active { background:var(--forest); color:#fff; }
.hero-card { min-height:205px; padding:19px 18px 15px; }
.hero-content { max-width:calc(100% - 68px); }
.hero-card h2 { margin:11px 0 4px; font-size:clamp(20px,5.3vw,25px); line-height:1.12; }
.hero-card p { font-size:11px; line-height:1.45; }
.hero-icon { top:35px; right:13px; width:58px; height:58px; }
.hero-next { margin-top:7px; padding:7px 8px; font-size:10px; line-height:1.35; }
.hero-footer { left:18px; right:18px; bottom:11px; gap:6px; font-size:8px; }
@media(max-width:380px) { .hero-card { min-height:212px; } .hero-content { max-width:calc(100% - 58px); } .hero-card h2 { font-size:20px; } .hero-next { font-size:9px; } }

.quick-action.quick-bot { text-decoration:none; }


/* Clearer timetable: one card per actual lesson time slot. */
.lesson-card.has-variants { align-items:start; }
.lesson-variants { display:grid; gap:8px; min-width:0; }
.lesson-variant { min-width:0; }
.lesson-variant + .lesson-variant { padding-top:7px; border-top:1px solid #edf1eb; }
.lesson-variant-type { display:block; margin:0 0 4px; color:var(--forest); font-size:9px; font-weight:800; }
.lesson-variant .lesson-meta { display:grid; gap:4px; }
.lesson-card.has-variants .lesson-title { margin-bottom:7px; }
.hero-next[hidden] { display:none !important; }
.hero-card.summary-only { min-height:174px; }
.hero-card.summary-only .hero-content { max-width:calc(100% - 68px); }
.hero-card.summary-only .hero-footer { bottom:13px; }
.detail-variant { margin:4px 0; }
.detail-variant + .detail-variant { margin-top:9px; padding-top:9px; border-top:1px solid var(--line); }
.detail-variant b { color:var(--forest); font-size:10px; }
@media(max-width:380px) {
  .lesson-card { grid-template-columns:52px minmax(0,1fr); gap:9px; padding:12px; }
  .lesson-card.has-variants .lesson-meta { font-size:8px; }
}

/* Dedicated weekly timetable opened from the calendar. */
.calendar-actions { display:flex; gap:8px; margin-top:12px; }
.calendar-actions .text-button { flex:1; }
.week-page .hero-card,
.week-page #today-view,
.week-page .schedule-toolbar,
.week-page .source-note,
.week-page .quick-actions { display:none !important; }
.week-page .welcome-row { padding-bottom:10px; }
.week-page .week-section { display:block !important; padding-top:12px; }
.week-page-top { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:8px 0 18px; }
.week-back { color:var(--forest); text-decoration:none; font-size:12px; font-weight:750; }
.week-current-label { padding:7px 10px; border-radius:999px; background:var(--lime-soft); color:var(--forest); font-size:10px; font-weight:750; }
.week-navigation { display:grid; grid-template-columns:38px minmax(0,1fr) 38px; align-items:center; gap:8px; margin:0 0 14px; }
.week-navigation .icon-button { width:36px; height:36px; border-radius:12px; background:#fff; color:var(--forest); font-size:23px; }
.week-navigation .week-range { justify-content:center; margin:0; padding:10px 6px; text-align:center; font-size:10px; line-height:1.4; }
.week-page .week-list { gap:12px; }
.week-page .week-day { padding:15px; border-radius:17px; }
.week-page .week-day-title { font-size:13px; }
.week-page .week-lesson { grid-template-columns:60px minmax(0,1fr); gap:12px; padding:12px 2px; }
.week-page .week-lesson-time { font-size:11px; }
.week-page .week-lesson-title { font-size:12px; }
.week-page .week-lesson-meta { font-size:10px; line-height:1.45; }
@media (min-width:700px) {
  .week-page .week-list { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
}

/* Calendar dialog stays scrollable even when a selected day has many lessons. */
.utility-dialog { overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.utility-dialog > .dialog-head { position:sticky; top:-18px; z-index:3; padding:5px 0 10px; background:var(--paper); }
.calendar-details { max-height:42dvh; overflow-y:auto; overscroll-behavior:contain; padding-bottom:8px; scrollbar-width:thin; }
.calendar-actions { position:sticky; bottom:-8px; display:flex; gap:8px; padding:10px 0 8px; background:var(--paper); }
.calendar-actions .text-button { flex:1; min-height:40px; }
.theme-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* Emerald dark palette, shared by the site and Telegram Mini App. */
:root[data-theme="dark"] {
  color-scheme:dark;
  --forest:#2d7958;
  --forest-2:#3b8b68;
  --lime:#c6e98b;
  --lime-soft:#263d30;
  --ink:#e8f0e9;
  --muted:#a3b3a8;
  --line:#2b4035;
  --paper:#101b16;
  --card:#192820;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] html { background:var(--paper); color:var(--ink); }
:root[data-theme="dark"] .group-pill,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .quick-action,
:root[data-theme="dark"] .week-day,
:root[data-theme="dark"] .lesson-card,
:root[data-theme="dark"] .calendar-day,
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .group-option,
:root[data-theme="dark"] .week-range { background:var(--card); color:var(--ink); border-color:var(--line); }
:root[data-theme="dark"] .calendar-day.odd-week { background:#294532; color:#d2edaa; }
:root[data-theme="dark"] .calendar-day.even-week { background:#24342b; color:#c1d0c5; }
:root[data-theme="dark"] .calendar-day.today { border-color:#9fca78; }
:root[data-theme="dark"] .calendar-day.empty { background:transparent; }
:root[data-theme="dark"] .calendar-details,
:root[data-theme="dark"] .calendar-lesson-list p { color:var(--ink); }
:root[data-theme="dark"] .calendar-lesson-list small,
:root[data-theme="dark"] .week-lesson-meta { color:var(--muted); }
:root[data-theme="dark"] .day-chip { color:var(--muted); }
:root[data-theme="dark"] .day-chip.selected,
:root[data-theme="dark"] .filter-chip.active { background:var(--forest); color:#fff; }
:root[data-theme="dark"] .day-chip.today:not(.selected),
:root[data-theme="dark"] .filter-bar { background:#1b2c22; border-color:var(--line); }
:root[data-theme="dark"] .filter-chip { color:var(--muted); }
:root[data-theme="dark"] .week-day-count,
:root[data-theme="dark"] .week-day-title small { background:#263a2e; color:#c0d0c4; }
:root[data-theme="dark"] .group-dialog,
:root[data-theme="dark"] .utility-dialog { background:var(--paper); color:var(--ink); }
:root[data-theme="dark"] .search-box input { color:var(--ink); }
:root[data-theme="dark"] .weather-days div { border-color:var(--line); }
:root[data-theme="dark"] .source-note { background:#1b2c22; }
:root[data-theme="dark"] .source-note p { color:var(--muted); }
:root[data-theme="dark"] .calendar-actions { background:var(--paper); }
:root[data-theme="dark"] .calendar-actions .text-button { background:#294532; color:#d2edaa; }
@media (prefers-reduced-motion:no-preference) {
  .utility-dialog { scroll-behavior:smooth; }
}

/* Campus directory stays available from the local data cache. */
.campus-plan-note { margin:8px 3px 12px; color:var(--muted); font-size:10px; line-height:1.55; }
.campus-plan-note a { color:var(--forest); font-weight:800; }
.campus-search-box { margin-bottom:10px; }
.campus-buildings { display:grid; gap:9px; }
.campus-building-card { padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--surface,#fff); cursor:pointer; transition:border-color .2s,transform .2s; }
.campus-building-card.selected { border-color:var(--forest); box-shadow:0 0 0 2px color-mix(in srgb,var(--forest) 16%,transparent); transform:translateY(-1px); }
.campus-building-head { display:grid; grid-template-columns:36px 1fr; gap:9px; align-items:start; margin-bottom:8px; }
.campus-building-number { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--lime-soft); color:var(--forest); font-size:15px; font-weight:900; }
.campus-building-head h3 { margin:0; color:var(--ink); font-size:12px; line-height:1.35; }
.campus-building-head p { margin:4px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }
.campus-building-card ul { display:grid; gap:0; padding:0; margin:0; list-style:none; }
.campus-building-card li { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid var(--line); color:var(--ink); font-size:9px; line-height:1.35; }
.campus-building-card li strong { flex:0 0 auto; color:var(--forest); text-align:right; }
.campus-building-card li.campus-no-match,.campus-empty { color:var(--muted); }
.campus-empty { padding:12px; font-size:10px; line-height:1.5; }
/* Connection state remains visible without obscuring the timetable. */
.connectivity-note {
  margin: 0 18px 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.45;
}
.connectivity-note[hidden] { display: none !important; }

/* Campus map with an honest offline directory fallback. */
.map-dialog { width:min(760px,calc(100vw - 22px)); max-height:calc(100dvh - 28px); padding:16px; }
.campus-explorer { margin:0 0 12px; }
.campus-offline-panel { display:grid; gap:9px; padding:18px; border:1px solid var(--line); border-radius:18px; background:var(--surface,#fff); }
.campus-offline-panel[hidden] { display:none !important; }
.campus-offline-kicker { color:var(--forest); font-size:9px; font-weight:850; letter-spacing:.12em; }
.campus-offline-panel h3 { margin:0; color:var(--ink); font-size:18px; }
.campus-offline-panel p { margin:0; color:var(--muted); font-size:11px; line-height:1.55; }
.campus-offline-panel button,.campus-map-footer button { justify-self:start; min-height:38px; border:0; border-radius:11px; padding:0 14px; background:var(--forest); color:#fff; font-size:11px; font-weight:800; }
.campus-offline-panel button:disabled,.campus-map-footer button:disabled { opacity:.55; cursor:wait; }
.campus-official-link { color:var(--forest); font-size:10px; font-weight:800; text-decoration:none; }
.campus-official-link:hover { text-decoration:underline; }
.campus-online-panel { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface,#fff); }
.campus-online-panel[hidden] { display:none !important; }
.campus-online-head { padding:11px 13px; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.08em; }
.campus-map-switch { display:flex; gap:7px; padding:0 12px 9px; }
.campus-map-switch button { min-height:34px; border:1px solid var(--line); border-radius:10px; padding:0 12px; background:var(--surface,#fff); color:var(--ink); font-size:10px; font-weight:800; cursor:pointer; }
.campus-map-switch button[aria-pressed="true"] { border-color:var(--forest); background:var(--forest); color:#fff; }
.campus-map-switch button:focus-visible { outline:3px solid #b8d77f; outline-offset:2px; }
.campus-online-map { height:clamp(360px,56vh,580px); background:#dbe5d9; }
.campus-online-map[hidden] { display:none !important; }
.campus-yandex-map { background:#e8e8e4; }
.campus-map-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; }
.campus-online-status { margin:0; color:var(--muted); font-size:10px; line-height:1.45; }
.campus-map-footer button { flex:0 0 auto; }
.campus-map-marker { display:grid; place-items:center; width:34px; height:34px; padding:0; appearance:none; border:2px solid #f2f7ed; border-radius:50% 50% 50% 4px; transform:rotate(-45deg); background:#246a48; color:#fff; box-shadow:0 2px 9px rgba(0,0,0,.35); font:800 12px/1 system-ui,sans-serif; cursor:pointer; }
.campus-map-marker span { transform:rotate(45deg); }
.campus-map-marker:focus-visible { outline:3px solid #d9f5a3; outline-offset:3px; }
.campus-map-area-label { max-width:130px; color:#3e6950; font:italic 700 10px/1.25 system-ui,sans-serif; text-align:center; text-shadow:0 1px 0 #f4f0dc,1px 0 0 #f4f0dc,-1px 0 0 #f4f0dc,0 -1px 0 #f4f0dc; pointer-events:none; }
.campus-map-popup-facts { margin-top:4px; color:#5b665d; font-size:12px; line-height:1.4; }
.maplibregl-popup-content { color:#183b29; font:12px/1.45 system-ui,sans-serif; }
.campus-map-building-popup { display:grid; gap:7px; width:min(285px,65vw); color:#183b29; }
.campus-map-building-photo { display:grid; gap:5px; margin:0; }
.campus-map-building-photo img { display:block; width:100%; max-height:155px; border-radius:9px; object-fit:cover; }
.campus-map-building-photo figcaption { color:#66736a; font-size:9px; line-height:1.35; }
.campus-map-building-photo figcaption a,.campus-map-building-links a { color:#246a48; font-weight:750; text-decoration:none; }
.campus-map-building-photo figcaption a:hover,.campus-map-building-links a:hover { text-decoration:underline; }
.campus-map-building-title { color:#173d2e; font-size:14px; line-height:1.25; }
.campus-map-building-address { color:#58675c; font-size:10px; }
.campus-map-building-description { margin:0; color:#3e5044; font-size:10px; line-height:1.4; }
.campus-map-building-facts { margin:0; color:#59685c; font-size:10px; line-height:1.45; }
.campus-map-building-history { display:grid; gap:4px; padding:8px; border-radius:9px; background:#f0f5e8; color:#314c37; font-size:10px; line-height:1.4; }
.campus-map-building-history > strong { font-size:10px; }
.campus-map-building-history p { margin:0; }
.campus-map-building-links { display:flex; flex-wrap:wrap; gap:5px 11px; font-size:10px; }
@media(max-width:520px) {
 .map-dialog { padding:12px; }
 .campus-online-map { height:clamp(340px,56vh,520px); }
 .campus-map-footer { align-items:stretch; flex-direction:column; }
 .campus-map-footer button { justify-self:stretch; width:100%; }
 .campus-map-switch button { flex:1; padding:0 7px; }
}
@media(prefers-reduced-motion:reduce) { .campus-building-card { transition:none; } }


/* Campus map provider controls, Cesium and 2GIS styles from the current map build. */
/* Campus directory stays available from the local data cache. */
.campus-plan-note { margin:8px 3px 12px; color:var(--muted); font-size:10px; line-height:1.55; }
.campus-plan-note a { color:var(--forest); font-weight:800; }
.campus-search-box { margin-bottom:10px; }
.campus-buildings { display:grid; gap:9px; }
.campus-building-card { padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--surface,#fff); cursor:pointer; transition:border-color .2s,transform .2s; }
.campus-building-card.selected { border-color:var(--forest); box-shadow:0 0 0 2px color-mix(in srgb,var(--forest) 16%,transparent); transform:translateY(-1px); }
.campus-building-head { display:grid; grid-template-columns:36px 1fr; gap:9px; align-items:start; margin-bottom:8px; }
.campus-building-number { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--lime-soft); color:var(--forest); font-size:15px; font-weight:900; }
.campus-building-head h3 { margin:0; color:var(--ink); font-size:12px; line-height:1.35; }
.campus-building-head p { margin:4px 0 0; color:var(--muted); font-size:9px; line-height:1.4; }
.campus-building-card ul { display:grid; gap:0; padding:0; margin:0; list-style:none; }
.campus-building-card li { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid var(--line); color:var(--ink); font-size:9px; line-height:1.35; }
.campus-building-card li strong { flex:0 0 auto; color:var(--forest); text-align:right; }
.campus-building-card li.campus-no-match,.campus-empty { color:var(--muted); }
.campus-empty { padding:12px; font-size:10px; line-height:1.5; }
.campus-explorer { margin:0 0 12px; }
.campus-offline-panel { display:grid; gap:9px; padding:18px; border:1px solid var(--line); border-radius:18px; background:var(--surface,#fff); }
.campus-offline-panel[hidden] { display:none !important; }
.campus-offline-kicker { color:var(--forest); font-size:9px; font-weight:850; letter-spacing:.12em; }
.campus-offline-panel h3 { margin:0; color:var(--ink); font-size:18px; }
.campus-offline-panel p { margin:0; color:var(--muted); font-size:11px; line-height:1.55; }
.campus-offline-panel button,.campus-map-footer button { justify-self:start; min-height:38px; border:0; border-radius:11px; padding:0 14px; background:var(--forest); color:#fff; font-size:11px; font-weight:800; }
.campus-offline-panel button:disabled,.campus-map-footer button:disabled { opacity:.55; cursor:wait; }
.campus-official-link { color:var(--forest); font-size:10px; font-weight:800; text-decoration:none; }
.campus-official-link:hover { text-decoration:underline; }
.campus-online-panel { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface,#fff); }
.campus-online-panel[hidden] { display:none !important; }
.campus-online-head { padding:11px 13px; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.08em; }
.campus-map-switch { display:flex; gap:7px; padding:0 12px 9px; }
.campus-map-switch button { min-height:34px; border:1px solid #b8c5bd; border-radius:10px; padding:0 12px; background:#fff; color:#173d2e; font-size:10px; font-weight:800; cursor:pointer; opacity:1; }
.campus-map-switch button[aria-pressed="true"] { border-color:#246a48; background:#246a48; color:#fff; }
.campus-map-switch button:disabled { opacity:1; color:#173d2e; cursor:pointer; }
.campus-map-switch button:focus-visible { outline:3px solid #b8d77f; outline-offset:2px; }
.campus-online-map { height:clamp(360px,56vh,580px); background:#dbe5d9; }
.campus-online-map[hidden] { display:none !important; }
.campus-yandex-map { background:#e8e8e4; }
.campus-map-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 12px; }
.campus-online-status { margin:0; color:var(--muted); font-size:10px; line-height:1.45; }
.campus-map-footer button { flex:0 0 auto; }
.campus-map-marker { display:grid; place-items:center; width:34px; height:34px; padding:0; appearance:none; border:2px solid #f2f7ed; border-radius:50% 50% 50% 4px; transform:rotate(-45deg); background:#246a48; color:#fff; box-shadow:0 2px 9px rgba(0,0,0,.35); font:800 12px/1 system-ui,sans-serif; cursor:pointer; }
.campus-map-marker span { transform:rotate(45deg); }
.campus-map-marker:focus-visible { outline:3px solid #d9f5a3; outline-offset:3px; }
.campus-map-area-label { max-width:130px; color:#3e6950; font:italic 700 10px/1.25 system-ui,sans-serif; text-align:center; text-shadow:0 1px 0 #f4f0dc,1px 0 0 #f4f0dc,-1px 0 0 #f4f0dc,0 -1px 0 #f4f0dc; pointer-events:none; }
.campus-map-popup-facts { margin-top:4px; color:#5b665d; font-size:12px; line-height:1.4; }
.campus-map-building-popup { display:grid; gap:7px; width:min(285px,65vw); color:#183b29; }
.campus-map-building-photo { display:grid; gap:5px; margin:0; }
.campus-map-building-photo img { display:block; width:100%; max-height:155px; border-radius:9px; object-fit:cover; }
.campus-map-building-photo figcaption { color:#66736a; font-size:9px; line-height:1.35; }
.campus-map-building-photo figcaption a,.campus-map-building-links a { color:#246a48; font-weight:750; text-decoration:none; }
.campus-map-building-photo figcaption a:hover,.campus-map-building-links a:hover { text-decoration:underline; }
.campus-map-building-title { color:#173d2e; font-size:14px; line-height:1.25; }
.campus-map-building-address { color:#58675c; font-size:10px; }
.campus-map-building-description { margin:0; color:#3e5044; font-size:10px; line-height:1.4; }
.campus-map-building-facts { margin:0; color:#59685c; font-size:10px; line-height:1.45; }
.campus-map-building-history { display:grid; gap:4px; padding:8px; border-radius:9px; background:#f0f5e8; color:#314c37; font-size:10px; line-height:1.4; }
.campus-map-building-history > strong { font-size:10px; }
.campus-map-building-history p { margin:0; }
.campus-map-building-links { display:flex; flex-wrap:wrap; gap:5px 11px; font-size:10px; }
.campus-online-map { height:clamp(340px,56vh,520px); }
.campus-map-footer { align-items:stretch; flex-direction:column; }
.campus-map-footer button { justify-self:stretch; width:100%; }
.campus-map-switch button { flex:1; padding:0 7px; }
.campus-building-card { transition:none; }
.map-dialog > .campus-explorer {
  flex: 0 0 auto;
  min-height: 0;
}
.map-dialog > .campus-plan-note {
  flex: 0 0 auto;
  max-height: 9dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.map-dialog > .campus-search-box { flex: 0 0 auto; }
.map-dialog > .campus-buildings {
  flex: 1 1 0;
  min-height: 90px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}
.campus-explorer { min-height: 0; }
.campus-online-panel { overflow: hidden; }
.campus-online-map {
  height: clamp(270px, 42dvh, 450px);
  min-height: 250px;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.campus-map-switch + .campus-basemap-switch { padding-top: 0; }
.campus-basemap-switch button { min-height: 30px; font-size: 9px; }
.campus-map-footer { flex-wrap: wrap; }
.campus-map-building-popup { max-height: inherit; }
.map-dialog > .campus-plan-note { max-height: 8dvh; margin-bottom: 7px; }
.map-dialog > .campus-buildings { min-height: 72px; }
.campus-online-map { height: clamp(280px, 42dvh, 460px); min-height: 260px; }
.campus-map-building-photo img { max-height: 112px; }
.campus-cesium-map { height: clamp(300px, 48dvh, 520px); min-height: 260px; background:#dce6dc; touch-action:none; }
.campus-cesium-map[hidden] { display:none !important; }
.campus-cesium-credits { min-height:0; max-height:52px; overflow:auto; padding:0 10px 5px; font-size:9px; color:var(--muted); }
.campus-cesium-credits:empty { display:none; }
.campus-cesium-map { height:clamp(260px, 44dvh, 420px); min-height:240px; }
.campus-online-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.campus-cesium-expand, #campus-cesium-expand { border:1px solid var(--line); border-radius:8px; padding:6px 9px; background:var(--surface,#fff); color:var(--ink); font-size:10px; font-weight:750; }
#campus-cesium-expand[hidden] { display:none; }
.map-dialog.campus-map-expanded {
  position:fixed;
  inset:0;
  margin:0;
  width:100vw;
  height:100dvh;
  max-width:none;
  max-height:100dvh;
  border-radius:0;
  padding:10px;
}
.map-dialog.campus-map-expanded .campus-cesium-map {
  height:calc(100dvh - 245px);
  min-height:320px;
}
.map-dialog.campus-map-expanded { padding:8px; }
.map-dialog.campus-map-expanded .campus-cesium-map { height:calc(100dvh - 230px); min-height:260px; }
.campus-cesium-attribution { padding:0 10px 7px; color:var(--muted); font-size:9px; line-height:1.35; }
.campus-cesium-attribution a { color:var(--forest); font-weight:750; text-decoration:underline; }
.campus-2gis-map { width: 100%; height: 100%; min-height: 440px; overflow: hidden; }
/* Campus photorealism pass: tree canopies in the Cesium scene */
.campus-cesium-map .cesium-widget,
.campus-cesium-map .cesium-widget canvas { width:100%; height:100%; }
.campus-cesium-map .cesium-viewer { overflow:hidden; }
.campus-cesium-map .cesium-viewer-toolbar { top:8px; right:8px; }
.campus-cesium-map .cesium-viewer-bottom { bottom:4px !important; left:8px !important; }
.campus-cesium-map .cesium-widget-credits { font-size:8px !important; }
.campus-map-switch { flex-wrap:wrap; }
.campus-map-switch button { min-height:36px; }
.campus-map-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.campus-map-switch button { min-width:0; padding:0 6px; font-size:9px; }
.campus-map-building-popup {
  box-sizing: border-box;
  width: min(300px, calc(100vw - 56px));
  min-width: 0;
  max-height: none;
  overflow: visible;
}
.campus-map-building-photo img {
  width: 100%;
  max-height: min(24dvh, 190px);
  object-fit: cover;
}
.campus-map-building-photo figcaption,
.campus-map-building-history,
.campus-map-building-links {
  overflow-wrap: anywhere;
  word-break: normal;
}
.campus-map-building-popup {
    width: min(300px, calc(100vw - 48px));
  }
.campus-map-building-photo img {
    max-height: min(20dvh, 150px);
  }

/* Unified procedural 3D campus map embedded as the only map experience. */
.map-dialog { width:min(1200px,calc(100vw - 12px)); height:min(96dvh,1000px); max-height:calc(100dvh - 12px); padding:10px; }
.map-dialog > .campus-map-frame { display:block; flex:1 1 auto; width:100%; min-height:0; border:0; border-radius:14px; background:#dfe6d3; }
@media(max-width:520px) { .map-dialog { width:calc(100vw - 8px); height:calc(100dvh - 8px); max-height:calc(100dvh - 8px); padding:6px; } .map-dialog > .campus-map-frame { border-radius:10px; } }


/* Keep the host schedule out of the map layer in Android WebView and mobile browsers. */
html.campus-map-open,
html.campus-map-open body {
  overflow: hidden !important;
}
html.campus-map-open .app-shell {
  visibility: hidden !important;
  pointer-events: none !important;
}
.map-dialog[open] {
  background: #dfe6d3 !important;
  isolation: isolate;
  opacity: 1;
}
.map-dialog > .campus-map-frame {
  position: relative;
  z-index: 1;
  background: #dfe6d3 !important;
  opacity: 1;
}

/* Map dialog must be a flex column so the embedded unified map fills the available viewport. */
.map-dialog:not([open]) { display: none !important; }
.map-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow: hidden;
}
.map-dialog > .dialog-head { flex: 0 0 auto; }
.map-dialog > .campus-map-frame {
  display: block;
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 14px;
  background: #dfe6d3;
}
@media (max-width: 600px) {
  .map-dialog {
    position: fixed;
    inset: max(4px, env(safe-area-inset-top)) 4px max(4px, env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 8px;
    gap: 6px;
    border-radius: 18px;
  }
  .map-dialog > .dialog-head { min-height: 48px; }
  .map-dialog > .campus-map-frame { min-height: 0; border-radius: 12px; }
}


/* Mini App home and personal settings */
.home-view,.miniapp-settings-view{max-width:680px;margin:0 auto;padding:24px 0 42px}
.home-intro{padding:28px 4px 26px}
.home-intro h1{max-width:430px;margin:0 0 11px;font-size:clamp(31px,8vw,42px);line-height:1.04;letter-spacing:-.06em}
.home-intro>p:last-child{max-width:330px;margin:0;color:var(--muted);font-size:13px;line-height:1.6}
.home-actions{display:grid;gap:14px}
.home-action-card{position:relative;display:flex;align-items:center;gap:16px;min-height:118px;width:100%;padding:20px;border:1px solid var(--line);border-radius:23px;background:var(--card);text-align:left;cursor:pointer;box-shadow:0 12px 30px rgba(23,61,46,.06);transition:transform .18s ease,box-shadow .18s ease}
.home-action-card:active{transform:scale(.985)}
.home-action-card.schedule-action{background:linear-gradient(130deg,#173d2e,#24533d);color:#fff;border-color:transparent}
.home-action-card.settings-action{background:linear-gradient(130deg,#fff,#edf4e8);color:var(--forest)}
.home-action-icon{flex:0 0 54px;width:54px;height:54px;display:grid;place-items:center;border-radius:18px;background:rgba(216,242,122,.19);color:var(--lime);font-size:27px;font-weight:700}
.settings-action .home-action-icon{background:var(--lime-soft);color:var(--forest)}
.home-action-card strong{display:block;margin-bottom:5px;font-size:17px;font-weight:800;letter-spacing:-.025em}
.home-action-card small{display:block;color:inherit;opacity:.72;font-size:11px;line-height:1.4}
.home-action-arrow{margin-left:auto;font-size:25px;opacity:.7}
.home-account-note{min-height:25px;margin:18px 4px 0;color:var(--muted);font-size:10px;line-height:1.5}
.settings-view-header{padding:12px 2px 20px}
.back-link{display:inline-flex;align-items:center;gap:6px;margin:0 0 22px;padding:8px 0;border:0;background:transparent;color:var(--forest);font-size:12px;font-weight:800;cursor:pointer}
.settings-view-header h1{margin:0 0 9px}
.settings-view-header>p:last-child{max-width:400px;margin:0;color:var(--muted);font-size:11px;line-height:1.6}
.settings-card{padding:19px;border:1px solid var(--line);border-radius:21px;background:var(--card);box-shadow:0 12px 30px rgba(23,61,46,.05)}
.settings-group-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.settings-group-row strong{font-size:14px}
.settings-divider{height:1px;margin:18px 0;border:0;background:var(--line)}
.settings-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:64px;border-bottom:1px solid #eef0eb;cursor:pointer}
.settings-toggle-row:last-of-type{border-bottom:0}
.settings-toggle-row strong{display:block;margin-bottom:4px;font-size:12px}
.settings-toggle-row small{display:block;color:var(--muted);font-size:10px;line-height:1.35}
.settings-toggle-row input{width:42px;height:24px;flex:0 0 auto;accent-color:var(--forest)}
.settings-actions{padding-top:17px}
.primary-button{width:100%;min-height:47px;border:0;border-radius:14px;background:var(--forest);color:#fff;font-size:12px;font-weight:800;cursor:pointer}
.primary-button:disabled{opacity:.42;cursor:not-allowed}
.settings-actions p{margin:10px 0 0;color:var(--muted);font-size:10px;line-height:1.5}
.schedule-view-back{padding-top:14px}
.schedule-view-back .back-link{margin:0}
#refresh-button.hidden,#quick-actions.hidden{display:none!important}


/* Mini App: complete bot control center */
.control-center-status {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.control-center-status[data-state="ok"] { display:none; border-color: #b7d4be; color: #285d3b; background: #f0f7ef; }
.control-center-status[data-state="error"] { border-color: #e8c1b6; color: #8d3c2c; background: #fff5f1; }
.control-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 7px;
  margin: 0 -2px 15px;
  padding: 8px 2px;
  overflow-x: auto;
  background: var(--background, var(--surface));
  scrollbar-width: none;
}
.control-tabs::-webkit-scrollbar { display:none; }
.control-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: 750 11px/1 system-ui,sans-serif;
}
.control-tabs button.active { border-color: var(--forest); background: var(--forest); color: #fff; }
.control-pane { display:grid; gap:13px; }
.control-pane.hidden { display:none !important; }
.control-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.control-inline-actions { display:flex; flex-wrap:wrap; gap:9px; }
.control-section-title { margin-bottom:13px; }
.control-section-title h2 { margin:2px 0 0; font-size:18px; letter-spacing:-.035em; }
.control-description { margin:8px 0 13px; color:var(--muted); font-size:11px; line-height:1.55; }
.control-divider { height:1px; margin:13px 0; background:var(--line); }
.control-field { display:grid; gap:7px; margin:13px 0; color:var(--ink); font-size:11px; font-weight:750; }
.control-field input,.control-field select,.assistant-form input {
  width:100%;
  min-width:0;
  min-height:44px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
  background:var(--surface);
  color:var(--ink);
  font:600 12px/1.3 system-ui,sans-serif;
}
.control-field input:focus,.control-field select:focus,.assistant-form input:focus { border-color:var(--forest); box-shadow:0 0 0 3px rgba(37,94,64,.1); }
.control-field input:disabled,.control-field select:disabled { opacity:.55; }
.control-hint { margin:7px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.control-group-picker { display:grid; gap:2px; }
.secondary-button {
  display:block;
  width:100%;
  min-height:42px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  color:var(--forest);
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.secondary-button:disabled { opacity:.45; cursor:not-allowed; }
.consent-row { display:flex; align-items:flex-start; gap:10px; margin:13px 0; color:var(--muted); font-size:10px; line-height:1.5; }
.consent-row input { flex:0 0 auto; width:17px; height:17px; accent-color:var(--forest); }
.control-empty { padding:14px; border-radius:12px; background:var(--surface); color:var(--muted); font-size:11px; line-height:1.55; }
.command-shortcuts,.assistant-quick-prompts { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; }
.command-shortcuts button,.assistant-quick-prompts button {
  min-height:36px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  color:var(--forest);
  font-size:10px;
  font-weight:750;
  cursor:pointer;
}
.command-category-label {
  flex:0 0 100%;
  margin:7px 0 0;
  color:var(--muted);
  font-size:9px;
  font-weight:850;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.command-shortcuts { display:grid; grid-template-columns:1fr; gap:8px; margin:12px 0; }
.command-group {
  width:100%;
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
.command-group summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:28px;
  color:var(--forest);
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  list-style:none;
}
.command-group summary::-webkit-details-marker { display:none; }
.command-group summary::after {
  content:"+";
  flex:0 0 auto;
  color:var(--muted);
  font-size:18px;
  font-weight:500;
}
.command-group[open] summary::after { content:"−"; }
.command-group summary small {
  margin-left:auto;
  color:var(--muted);
  font-size:9px;
  font-weight:650;
  white-space:nowrap;
}
.command-group-items { display:flex; flex-wrap:wrap; gap:7px; padding-top:10px; }
.command-argument-fields {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 10px;
}
.command-argument-fields:empty { display:none; }
.command-parameter-field { min-width:0; }
.command-parameter-field:has(textarea) { grid-column:1 / -1; }
.command-parameter-field input,.command-parameter-field select,.command-parameter-field textarea {
  width:100%;
  min-width:0;
  min-height:42px;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--surface);
  color:var(--ink);
  font:inherit;
  font-size:11px;
}
.command-parameter-field textarea { min-height:64px; resize:vertical; }
.control-command-form { display:grid; gap:2px; padding-top:5px; }
.control-command-form .primary-button { margin-top:7px; }
.control-result {
  max-height:330px;
  min-height:54px;
  margin:14px 0 0;
  padding:13px;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface);
  color:var(--ink);
  font:500 11px/1.55 system-ui,sans-serif;
}
.assistant-messages {
  display:flex;
  flex-direction:column;
  gap:9px;
  min-height:135px;
  max-height:42dvh;
  margin:14px 0;
  padding:12px;
  overflow-y:auto;
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--surface);
}
.assistant-message {
  max-width:92%;
  padding:10px 12px;
  border-radius:13px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:11px;
  line-height:1.55;
}
.assistant-message-bot { align-self:flex-start; background:var(--card); border:1px solid var(--line); }
.assistant-message-user { align-self:flex-end; background:#e9f2df; color:#183e2a; }
.assistant-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
.assistant-form .primary-button { width:auto; min-width:98px; padding:0 16px; }
.diagnostic-status {
  margin:12px 0;
  padding:13px;
  border:1px solid var(--line);
  border-radius:13px;
  background:var(--surface);
  color:var(--muted);
  font-size:11px;
  line-height:1.55;
}
.diagnostic-status[data-state="ok"] { border-color:#b7d4be; background:#f0f7ef; color:#285d3b; }
.diagnostic-status[data-state="error"] { border-color:#e8c1b6; background:#fff5f1; color:#8d3c2c; }
.notification-deliveries { display:grid; gap:8px; margin-top:10px; }
.notification-delivery-item { padding:10px 11px; border:1px solid var(--line); border-radius:11px; background:var(--surface); }
.notification-delivery-item strong { display:block; font-size:10px; }
.notification-delivery-item small { display:block; margin-top:4px; color:var(--muted); font-size:9px; line-height:1.4; }
.notification-delivery-item[data-status="failed"] { border-color:#e8c1b6; }
.control-field + .settings-toggle-row { margin-top:6px; }
@media(min-width:700px) {
  .miniapp-settings-view { max-width:760px; }
  .control-pane[data-control-pane="personal"] .settings-card,
  .control-pane[data-control-pane="groups"] .settings-card,
  .control-pane[data-control-pane="tools"] .settings-card,
  .control-pane[data-control-pane="assistant"] .settings-card,
  .control-pane[data-control-pane="diagnostics"] .settings-card { padding:24px; }
  .control-group-picker { grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px; }
  .control-group-picker .secondary-button { width:auto; min-width:190px; }
}


/* Compact, practical settings layout. */
.miniapp-settings-view { padding-top: 12px; }
.settings-view-header { padding-bottom: 12px; }
.settings-view-header > p:last-child { max-width: 520px; font-size: 12px; line-height: 1.45; }
.control-tabs { margin: 8px 0 14px; }
.control-pane { gap: 10px; }
.control-pane .settings-card { padding: 15px; border-radius: 17px; box-shadow: none; }
.control-section-title { margin-bottom: 8px; }
.control-section-title h2 { font-size: 16px; }
.control-description { margin: 5px 0 9px; font-size: 11px; line-height: 1.4; }
.control-field { gap: 5px; margin: 9px 0; }
.settings-toggle-row { min-height: 52px; gap: 10px; }
.settings-toggle-row strong { margin-bottom: 0; font-size: 12px; }
.settings-toggle-row small { display: none; }
.settings-actions { padding-top: 11px; }
.settings-actions p, .settings-inline-status { margin: 7px 0 0; font-size: 10px; line-height: 1.4; color: var(--muted); }
.compact-settings-card .primary-button { width: 100%; margin-top: 5px; }
.control-divider { margin: 9px 0; }
.control-empty { padding: 11px; font-size: 11px; }
.control-group-picker { gap: 0; }
.control-pane[data-control-pane="groups"] .eyebrow { margin-bottom: 5px; }
.control-pane[data-control-pane="groups"] .control-hint { margin-top: 3px; }
#managed-chats-refresh { margin: 0 0 8px auto; }
#personal-group-select { min-height: 44px; }
@media (min-width: 600px) {
  .control-pane .settings-card { padding: 19px; }
}


/* Compact visual hierarchy for chat management; existing controls remain intact. */
.chat-management-card { overflow:hidden; }
.control-chat-toolbar { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.control-chat-toolbar .control-section-title { margin-bottom:8px; }
.control-refresh-button {
  flex:0 0 42px; width:42px; height:42px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:14px; background:var(--surface);
  color:var(--forest); font-size:25px; line-height:1; font-weight:650;
  cursor:pointer; transition:transform .18s ease, background .18s ease;
}
.control-refresh-button:active { transform:rotate(35deg) scale(.96); }
.control-refresh-button:disabled { opacity:.45; cursor:wait; }
.control-chat-summary {
  display:inline-flex; align-items:center; gap:8px; min-height:30px;
  margin:0 0 13px; padding:5px 10px; border:1px solid var(--line);
  border-radius:999px; background:var(--surface); color:var(--muted);
  font-size:10px; font-weight:650;
}
.control-chat-summary[hidden] { display:none !important; }
.control-chat-summary strong { color:var(--ink); font-size:12px; }
.control-chat-live-dot { width:7px; height:7px; border-radius:50%; background:#3a9a69; box-shadow:0 0 0 3px rgba(58,154,105,.12); }
.chat-management-card #managed-chat-select { min-height:48px; }
.chat-management-card #managed-chat-empty { margin-top:12px; }
.chat-management-card #managed-chat-readonly { margin-top:12px; }
.chat-management-card #managed-chat-editor { margin-top:16px; }
.chat-management-card #managed-chat-editor > .eyebrow { margin-top:18px; }
.chat-management-card .settings-toggle-row { min-height:62px; }
.chat-management-card .control-divider { margin:15px 0; }

.chat-settings-section {
  margin:16px 0 0; padding:15px 13px 10px;
  border:1px solid var(--line); border-radius:17px;
  background:color-mix(in srgb, var(--surface) 72%, transparent);
}
.chat-settings-heading { display:flex; align-items:center; gap:11px; margin:0 0 8px; }
.chat-settings-icon {
  width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center;
  border-radius:11px; background:var(--forest); color:#fff;
  font-size:17px; font-weight:800;
}
.chat-settings-heading .eyebrow { margin:0 0 2px; }
.chat-settings-heading h3 { margin:0; color:var(--ink); font-size:13px; letter-spacing:-.02em; }
.chat-settings-section .control-divider { display:none; }
.chat-settings-section > .eyebrow { margin:12px 0 4px; }
.chat-settings-section .settings-toggle-row { min-height:59px; }
.chat-settings-section .settings-toggle-row strong { font-size:12px; }
.chat-settings-section .settings-toggle-row small { max-width:42ch; font-size:10px; }
.chat-settings-section .control-field { margin-top:9px; }
.chat-settings-section .control-field > span { font-size:11px; }
.chat-settings-section .control-hint { margin:8px 0; }
.chat-management-card .settings-actions { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }


/* Compact three-section Mini App and a real personal account page. */
.app-shell { padding-bottom: calc(112px + var(--tg-safe-bottom)); }
.miniapp-settings-view,.profile-view {
  max-width:680px;
  margin:0 auto;
  padding:12px 0 calc(112px + var(--tg-safe-bottom));
}
.settings-view-header { padding:8px 2px 12px; }
.settings-view-header h1,.profile-header h1 { font-size:clamp(25px,7vw,32px); }
.settings-view-header > p:last-child { display:none; }
.settings-view-header .eyebrow,.profile-header .eyebrow { margin-bottom:5px; }
.control-center-status { margin-bottom:9px; }
.control-tabs { margin:4px 0 11px; }
.control-tabs button { min-height:34px; padding:0 12px; font-size:10px; }
.control-pane { gap:9px; }
.control-pane .settings-card { padding:14px; border-radius:16px; }
.control-description { margin:5px 0 9px; font-size:10px; line-height:1.4; }
.control-field { gap:5px; margin:9px 0; }
.settings-toggle-row { min-height:48px; }
.settings-toggle-row strong { font-size:11px; }
.settings-toggle-row small { font-size:9px; }

.miniapp-bottom-nav {
  position:fixed;
  z-index:20;
  left:50%;
  bottom:calc(9px + var(--tg-safe-bottom));
  width:min(440px,calc(100% - 24px));
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:4px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:18px;
  background:color-mix(in srgb,var(--card) 93%,transparent);
  box-shadow:0 9px 28px rgba(0,0,0,.13);
  backdrop-filter:blur(16px);
  transform:translateX(-50%);
}
.miniapp-bottom-nav[hidden] { display:none !important; }
.miniapp-bottom-nav .nav-item {
  min-width:0;
  min-height:54px;
  padding:5px 2px;
  color:var(--muted);
  font-size:9px;
  line-height:1.15;
  text-align:center;
  white-space:normal;
  border-radius:13px;
}
.miniapp-bottom-nav .nav-item.active { background:var(--forest); color:#fff; }
.miniapp-bottom-nav .nav-icon { font-size:17px; }
.quick-actions { bottom:calc(82px + var(--tg-safe-bottom)); }
@media(max-width:420px) {
  .quick-actions { bottom:calc(88px + var(--tg-safe-bottom)); }
}

.profile-header { padding:8px 2px 13px; }
.profile-identity { display:flex; align-items:center; gap:12px; padding:16px; }
.profile-avatar {
  flex:0 0 52px;
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:17px;
  background:var(--lime-soft);
  color:var(--forest);
  font-size:17px;
  font-weight:850;
  letter-spacing:-.04em;
}
.profile-identity-copy { min-width:0; flex:1; }
.profile-identity-copy h2 { margin:0 0 4px; font-size:16px; line-height:1.2; overflow-wrap:anywhere; }
.profile-identity-copy p { margin:0; color:var(--muted); font-size:10px; }
.profile-live {
  flex:0 0 auto;
  padding:6px 8px;
  border-radius:999px;
  background:var(--lime-soft);
  color:var(--forest);
  font-size:9px;
  font-weight:800;
}
.profile-live[data-state="pending"] { background:var(--surface,var(--paper)); color:var(--muted); }
.profile-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; margin-top:10px; padding:10px 15px; }
.profile-facts>div { min-width:0; padding:10px 0; border-bottom:1px solid var(--line); }
.profile-facts>div:nth-last-child(-n+2) { border-bottom:0; }
.profile-facts span { display:block; margin-bottom:4px; color:var(--muted); font-size:9px; }
.profile-facts strong { display:block; color:var(--ink); font-size:10px; line-height:1.35; overflow-wrap:anywhere; }
.profile-group-card { margin-top:10px; }
.profile-group-card .control-section-title { margin-bottom:7px; }
.profile-providers { margin-top:10px; }
.provider-entry {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:58px;
  padding:9px 0;
  border-top:1px solid var(--line);
}
.provider-entry>div { display:grid; gap:4px; }
.provider-entry strong { font-size:12px; }
.provider-entry span { color:var(--muted); font-size:10px; }
.provider-entry span[data-state="linked"] { color:#398a62; font-weight:800; }
:root[data-theme="dark"] .provider-entry span[data-state="linked"] { color:#91d6ad; }
.provider-entry .secondary-button { width:auto; min-width:128px; min-height:38px; padding:0 12px; font-size:10px; }
.profile-logout { margin-top:10px; }
.profile-logout[hidden] { display:none !important; }
.profile-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:10px; }
.profile-actions .secondary-button { min-height:42px; }
.telegram-code-panel {
  margin-top:12px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
.telegram-code-panel>p { margin:0 0 10px; color:var(--muted); font-size:11px; line-height:1.55; }
.telegram-code-panel a { color:var(--forest); font-weight:800; }
.telegram-code-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; }
.telegram-code-row input {
  min-width:0;
  min-height:42px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--card);
  color:var(--ink);
  font:700 14px/1 inherit;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.telegram-code-row .primary-button { width:auto; min-height:42px; padding:0 13px; font-size:10px; }
.telegram-code-panel .settings-inline-status { margin:8px 0 0; }
.profile-view .home-account-note { min-height:0; margin:10px 4px; }
[hidden] { display:none !important; }
@media(max-width:420px) {
  .command-argument-fields { grid-template-columns:1fr; }
  .command-parameter-field:has(textarea) { grid-column:auto; }
}
@media(max-width:370px) {
  .profile-facts { gap:0 9px; }
  .provider-entry .secondary-button { min-width:112px; }
  .miniapp-bottom-nav .nav-item { font-size:9px; }
}


/* BARNEY member profile editor */
.profile-community-card { margin-top:10px; }
.community-profile-photo-row {
  display:flex;
  align-items:center;
  gap:13px;
  margin:12px 0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
#community-profile-photo,
.community-profile-photo-placeholder {
  width:76px;
  height:76px;
  flex:0 0 76px;
  border-radius:20px;
  object-fit:cover;
  background:var(--lime-soft);
}
.community-profile-photo-placeholder {
  display:grid;
  place-items:center;
  color:var(--forest);
  font-size:30px;
}
.community-profile-photo-actions { display:grid; justify-items:start; gap:5px; min-width:0; }
.community-profile-photo-actions strong { font-size:12px; }
.community-profile-photo-actions span { color:var(--muted); font-size:10px; }
.community-photo-picker {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--forest);
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.profile-privacy-toggle {
  display:flex;
  align-items:flex-start;
  gap:9px;
  margin:10px 0 14px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.profile-privacy-toggle input { margin-top:1px; accent-color:var(--forest); }
.community-profile-stats {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.community-profile-stat {
  padding:10px;
  border-radius:12px;
  background:var(--surface);
}
.community-profile-stat span { display:block; color:var(--muted); font-size:9px; }
.community-profile-stat strong { display:block; margin-top:4px; font-size:12px; }
.community-profile-card textarea { min-height:96px; resize:vertical; }
.community-profile-card .text-button { padding:0; min-height:28px; color:var(--muted); font-size:10px; }

.community-profile-awards {
  display:grid;
  gap:7px;
  margin-top:13px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.community-profile-awards>strong { font-size:12px; }
.community-profile-award {
  display:grid;
  gap:3px;
  padding:9px 10px;
  border-radius:11px;
  background:var(--surface);
}
.community-profile-award strong { font-size:11px; }
.community-profile-award span { color:var(--muted); font-size:10px; line-height:1.4; }


/* MAX community shortcut beside the Telegram bot link. */
.quick-action.quick-max { text-decoration:none; font-size:10px; font-weight:900; letter-spacing:-.06em; color:#1769e0; }
.quick-action.quick-max span { display:block; line-height:1; }


/* Academic plan viewer */
.academic-plan-dialog { width:min(94vw,680px); }
.academic-plan-content { padding:2px 0 10px; }
.academic-plan-muted,.academic-plan-footnote { color:var(--muted); font-size:12px; line-height:1.55; }
.academic-plan-context,.academic-plan-hero { padding:15px; border:1px solid var(--line); border-radius:17px; background:var(--surface,rgba(120,140,120,.06)); margin:0 0 12px; }
.academic-plan-kicker { display:block; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.academic-plan-context strong { display:block; margin-top:5px; font-size:16px; }
.academic-plan-context small { display:block; margin-top:5px; color:var(--muted); font-size:11px; }
.academic-plan-list { display:grid; gap:8px; }
.academic-plan-option { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:13px; border:1px solid var(--line); border-radius:14px; background:var(--paper); color:var(--ink); text-align:left; cursor:pointer; }
.academic-plan-option-main { min-width:0; display:grid; gap:4px; }
.academic-plan-option-main strong { font-size:13px; }
.academic-plan-option-main small { color:var(--muted); font-size:11px; line-height:1.35; }
.academic-plan-score { flex:none; color:var(--forest); font-size:10px; font-weight:700; }
.academic-plan-score b { font-size:18px; margin-left:3px; }
.academic-plan-hero h3 { margin:7px 0 5px; font-size:19px; line-height:1.25; }
.academic-plan-hero p { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.academic-plan-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.academic-plan-stats span { display:grid; gap:2px; padding:9px; border-radius:11px; background:var(--paper); text-align:center; }
.academic-plan-stats b { font-size:18px; }
.academic-plan-stats small { color:var(--muted); font-size:10px; }
.academic-plan-back { border:0; background:none; color:var(--forest); font-size:12px; font-weight:700; padding:8px 0 13px; cursor:pointer; }
.academic-plan-filters { display:flex; gap:7px; margin:10px 0 15px; }
.academic-plan-filters button { border:1px solid var(--line); border-radius:999px; padding:8px 13px; background:var(--paper); color:var(--ink); font-size:11px; cursor:pointer; }
.academic-plan-filters button.active { background:var(--forest); border-color:var(--forest); color:#fff; }
.academic-plan-semester { margin:15px 0; }
.academic-plan-semester h4 { display:flex; justify-content:space-between; align-items:center; margin:0 0 8px; font-size:13px; }
.academic-plan-semester h4 span { color:var(--muted); font-size:11px; }
.academic-plan-subject { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); }
.academic-plan-subject div { min-width:0; display:grid; gap:4px; }
.academic-plan-subject strong { font-size:12px; line-height:1.35; }
.academic-plan-subject small { color:var(--muted); font-size:10px; }
.academic-plan-control { flex:none; border-radius:999px; padding:5px 8px; background:rgba(120,140,120,.12); font-size:10px; font-weight:700; }
.academic-plan-control.exam { color:#a14d37; background:rgba(190,92,60,.12); }
.academic-plan-control.credit { color:#386a50; background:rgba(56,130,86,.12); }
.academic-plan-source { display:inline-block; margin-top:8px; color:var(--forest); font-size:11px; font-weight:700; }
.academic-plan-empty { padding:18px 12px; border:1px dashed var(--line); border-radius:15px; }
.academic-plan-empty strong { font-size:14px; }
.academic-plan-empty p { color:var(--muted); font-size:12px; line-height:1.5; }
.academic-plan-empty a { color:var(--forest); font-size:12px; font-weight:700; }
:root[data-theme="dark"] .academic-plan-option,:root[data-theme="dark"] .academic-plan-stats span { background:#1b2b22; }
:root[data-theme="dark"] .academic-plan-score,:root[data-theme="dark"] .academic-plan-back,:root[data-theme="dark"] .academic-plan-source { color:#b8d89a; }

.academic-plan-search-label { display:block; margin:10px 0 6px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.04em; }
.academic-plan-search { width:100%; box-sizing:border-box; border:1px solid var(--line); border-radius:12px; padding:11px 12px; margin-bottom:10px; background:var(--paper); color:var(--ink); font:inherit; font-size:12px; outline:none; }
.academic-plan-search:focus { border-color:var(--forest); box-shadow:0 0 0 3px rgba(48,100,70,.10); }

/* Multiplayer games */
.games-view{padding:10px 0 28px}.games-header h1{margin:4px 0 6px;font-size:30px}.games-header>p:last-child{color:var(--muted);margin:0 0 18px}.games-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.games-feature{min-height:166px;border:0;border-radius:20px;padding:17px;text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:7px;cursor:pointer;color:#fff}.games-uno{background:linear-gradient(145deg,#b73d42,#6d263d)}.games-mafia{background:linear-gradient(145deg,#26394a,#171e2b)}.games-feature>span{font-size:27px}.games-feature strong{font-size:21px}.games-feature small{font-size:11px;opacity:.82}.games-feature em{font-size:12px;font-style:normal;font-weight:700;margin-top:auto}.games-join-card,.games-room-panel{margin-top:16px;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px}.games-join-card h2,.games-section-heading h2{font-size:17px;margin:0 0 12px}.games-join-row{display:flex;gap:8px}.games-join-row input{min-width:0;flex:1;border:1px solid var(--line);border-radius:11px;padding:12px;font-weight:800;letter-spacing:.15em;text-transform:uppercase;background:var(--paper)}#games-status{font-size:12px;color:var(--muted);margin:9px 0 0}.games-lobby{margin-top:22px}.games-section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.games-section-heading h2{margin:0}.games-room-list{display:grid;gap:9px}.games-room-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px;border:1px solid var(--line);border-radius:14px;background:var(--card)}.games-room-card strong{display:block;font-size:14px}.games-room-card small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.games-room-card button,.games-action{border:0;border-radius:10px;padding:10px 13px;background:var(--forest);color:#fff;font-weight:700}.games-empty{padding:18px;text-align:center;color:var(--muted);font-size:13px;background:var(--card);border:1px dashed var(--line);border-radius:14px}.games-room-top{display:flex;justify-content:space-between;align-items:center;gap:10px}.games-room-top h2{margin:0;font-size:19px}.games-code{font-size:12px;font-weight:800;letter-spacing:.14em;padding:8px 11px;border-radius:9px;background:var(--paper)}.games-player-list{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0}.games-player{font-size:12px;padding:7px 10px;border-radius:20px;background:var(--paper)}.games-cards{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0}.uno-card{width:53px;height:78px;border:3px solid #fff;border-radius:10px;color:#fff;font-weight:900;font-size:18px;box-shadow:0 2px 6px #0002;cursor:pointer}.uno-red{background:#d94343}.uno-yellow{background:#e2b82e;color:#29220d}.uno-green{background:#26985b}.uno-blue{background:#326fc0}.uno-wild{background:linear-gradient(135deg,#d94343 0 25%,#e2b82e 25% 50%,#26985b 50% 75%,#326fc0 75%)}.games-game-status{font-size:13px;color:var(--muted);margin:12px 0}.games-vote-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.games-vote-list button{border:1px solid var(--line);background:var(--paper);border-radius:10px;padding:11px}.games-room-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.games-room-actions button{flex:1}.games-hidden{display:none!important}@media(max-width:390px){.games-feature-grid{grid-template-columns:1fr}.games-feature{min-height:135px}.games-room-card{align-items:flex-start}}

/* Accessible inline game controls */
.games-color-picker{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
.games-color-picker strong{width:100%;font-size:12px}
.games-color-picker button{border:2px solid #fff;border-radius:9px;padding:9px 12px;font-weight:800;cursor:pointer;box-shadow:0 1px 4px #0002}
.games-color-picker .uno-red{background:#d94343;color:#fff}
.games-color-picker .uno-yellow{background:#e2b82e;color:#29220d}
.games-color-picker .uno-green{background:#26985b;color:#fff}
.games-color-picker .uno-blue{background:#326fc0;color:#fff}
.games-action:disabled,.games-room-card button:disabled,.games-feature:disabled,.uno-card:disabled{opacity:.42;cursor:not-allowed}
.games-feature:disabled{filter:grayscale(.4)}

/* Per-room game chat */
.games-chat{display:grid;gap:10px;margin:16px 0;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface,#fff)}
.games-chat-head{display:flex;align-items:center;justify-content:space-between;color:var(--ink);font-size:12px}
.games-chat-head span{color:var(--muted);font-size:10px}
.games-chat-messages{display:flex;flex-direction:column;gap:8px;max-height:260px;min-height:80px;overflow:auto;padding:2px;overscroll-behavior:contain}
.games-chat-message{align-self:flex-start;max-width:88%;padding:8px 11px;border:1px solid var(--line);border-radius:13px 13px 13px 4px;background:var(--soft,#f3f5f0);overflow-wrap:anywhere}
.games-chat-message.is-mine{align-self:flex-end;border-radius:13px 13px 4px 13px;background:#e4f2e9}
.games-chat-message b{font-size:10px;color:var(--forest)}
.games-chat-message p{margin:3px 0;font-size:12px;line-height:1.4;color:var(--ink)}
.games-chat-message time{display:block;text-align:right;font-size:9px;color:var(--muted)}
.games-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
.games-chat-compose input{min-width:0;width:100%;padding:11px;border:1px solid var(--line);border-radius:12px;background:var(--bg,#fff);color:var(--ink);font:inherit;font-size:12px}
.games-chat-compose button{padding:0 12px;font-size:11px}

.games-spyfall{background:linear-gradient(145deg,#283f5b,#536c82)!important;color:#fff!important}
.games-control-field{display:grid;gap:6px;margin:9px 0;color:var(--muted);font-size:11px}
.games-control-field select,.games-join-card select,.games-join-card input{width:100%;min-height:40px;padding:9px 11px;border:1px solid var(--line);border-radius:11px;background:var(--card);color:var(--ink);font:inherit;font-size:12px}
.games-join-card>label{display:flex;align-items:center;gap:8px;margin:8px 0;color:var(--muted);font-size:11px}
.games-join-card{display:grid;gap:8px}

.games-system-message{padding:9px 12px;border-radius:12px;background:#edf3e6;color:var(--forest);font-size:11px}


/* Anonymous one-to-one chat */
.anonymous-chat-card{margin-top:20px;padding:17px;border:1px solid var(--line);border-radius:20px;background:var(--card)}
.anonymous-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.anonymous-chat-heading h2{margin:2px 0 0;font-size:19px}
.anonymous-chat-lock{width:38px;height:38px;display:grid;place-items:center;border-radius:13px;background:var(--paper);color:var(--forest);font-size:22px}
.anonymous-chat-copy,.anonymous-chat-footnote{color:var(--muted);font-size:11px;line-height:1.55}
.anonymous-chat-state{margin:13px 0;padding:10px 12px;border-radius:11px;background:var(--paper);color:var(--forest);font-size:12px;line-height:1.5}
.anonymous-chat-messages{display:flex;flex-direction:column;gap:8px;min-height:84px;max-height:260px;overflow:auto;padding:10px 2px;overscroll-behavior:contain}
.anonymous-chat-empty{align-self:center;margin:auto;color:var(--muted);font-size:11px;text-align:center}
.anonymous-chat-message{max-width:88%;padding:9px 12px;border:1px solid var(--line);border-radius:13px 13px 13px 4px;background:var(--paper);overflow-wrap:anywhere}
.anonymous-chat-message.is-mine{align-self:flex-end;border-radius:13px 13px 4px 13px;background:var(--forest);color:#fff}
.anonymous-chat-message small{display:block;margin-bottom:3px;font-size:9px;opacity:.7}
.anonymous-chat-message p{margin:0;font-size:12px;line-height:1.5;white-space:pre-wrap}
.anonymous-chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:8px;margin-top:8px;width:100%;min-width:0}
.anonymous-chat-compose input{display:block;width:100%;min-width:0;flex:1 1 0;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--paper);color:var(--ink)}
.anonymous-chat-compose button{width:auto!important;min-width:104px;max-width:42%;flex:0 0 auto;justify-self:end;padding:10px 12px;white-space:nowrap}
.anonymous-chat-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.anonymous-chat-actions button{min-height:38px;padding:8px 11px;font-size:11px}
.anonymous-chat-actions .text-button{color:var(--muted)}
.anonymous-chat-actions button[hidden]{display:none}
.anonymous-chat-footnote{margin:12px 0 0;font-size:10px}
.anonymous-chat-actions button:disabled,.anonymous-chat-compose button:disabled{opacity:.45;cursor:not-allowed}

.anonymous-chat-actions select{max-width:100%;min-height:38px;padding:8px 9px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font-size:10px}.anonymous-chat-actions select:disabled{opacity:.45}

/* Game lobby controls and UNO discard visualization */
.games-room-create-options .games-check-field{display:flex;align-items:center;gap:10px;color:var(--ink);font-size:13px}
.games-room-create-options .games-check-field input{width:18px;height:18px;flex:0 0 auto}
.games-lobby-settings{display:grid;gap:9px;margin:14px 0;padding:13px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
.games-lobby-settings h3{margin:0 0 2px;font-size:15px;color:var(--ink)}
.games-lobby-settings .games-control-field{min-width:0;font-size:12px}
.games-lobby-settings select{min-width:0;width:100%;max-width:100%;white-space:normal;overflow:hidden;text-overflow:ellipsis}
.uno-table{display:flex;flex-direction:column;align-items:center;gap:7px;margin:14px 0 18px;padding:13px;border:1px solid var(--line);border-radius:15px;background:var(--paper)}
.uno-table-caption{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.uno-table-card{position:relative;display:grid;place-items:center;width:104px;height:148px;border:5px solid #fff;border-radius:17px;color:#fff;box-shadow:0 5px 14px #0003;transform:rotate(-3deg);font-weight:900}
.uno-table-card>strong{font-size:40px;text-shadow:0 1px 3px #0004}
.uno-table-card .uno-card-corner{position:absolute;top:7px;left:9px;font-size:15px}
.uno-table-card .uno-card-corner-bottom{top:auto;left:auto;right:9px;bottom:7px;transform:rotate(180deg)}
.uno-table-card.uno-yellow{color:#29220d}
.uno-table-meta{margin:0;text-align:center;font-size:12px;color:var(--muted)}
@media(max-width:390px){.games-room-panel{padding:12px}.games-lobby-settings{padding:10px}.uno-table-card{width:92px;height:132px}}
