/* Craft guidance: unslop by Damir Sokolovsky, https://heydamir.design/unslop, CC BY 4.0.
   References: shadcn/ui Calendar and Untitled UI Activity feeds. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f8f9,#111517);
  --surface: light-dark(#fff,#1a1f23);
  --raised: light-dark(#edf0f2,#252c31);
  --ink: light-dark(#20282e,#edf0f2);
  --secondary: light-dark(#53616b,#b2bdc5);
  --muted: light-dark(#677580,#95a2ac);
  --line: light-dark(#e2e7ea,#2b3339);
  --accent: light-dark(#42667d,#adc7d7);
  --accent-bg: light-dark(#e8eff3,#26323a);
  --on-accent: light-dark(#fff,#18232a);
  --lec: light-dark(#3c704b,#a4c99b);
  --lec-bg: light-dark(#f0f5ef,#232c25);
  --prac: light-dark(#8d601f,#dcb276);
  --prac-bg: light-dark(#fbf5ea,#302a23);
  --lab: light-dark(#79568b,#c6acd7);
  --lab-bg: light-dark(#f5f0f8,#2b2631);
  --blue: light-dark(#255e91,#a9d0f1);
  --blue-bg: light-dark(#eaf2fc,#263749);
  --gold: light-dark(#795411,#e9cd8b);
  --gold-bg: light-dark(#f7eed7,#3b3526);
  --red: light-dark(#ab3532,#f2b4ad);
  --red-bg: light-dark(#fcecea,#422b2b);
  --ease: cubic-bezier(.22,1,.36,1);
  --feedback: 140ms;
  --enter: 220ms;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif;
  font-size: 15px; line-height: 1.45;
}
* { box-sizing: border-box; }
[hidden] { display:none!important; }
html,body { height:100%; overflow:hidden; }
body { margin:0; color:var(--ink); background:var(--bg); }
button,input,select { font:inherit; color:inherit; }
button,summary,select,input[type="checkbox"],input[type="radio"] { cursor:pointer; -webkit-tap-highlight-color:transparent; }
button { border:0; background:transparent; text-align:left; }
button:disabled { opacity:.55; cursor:wait; }
button:hover,summary:hover { background-color:var(--raised); }
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:22px; line-height:1.3; font-weight:500; }
h2 { font-size:18px; line-height:1.3; font-weight:500; }
h3 { font-size:16px; line-height:1.4; font-weight:500; }
strong { font-weight:600; }
small,.meta { font-size:12px; line-height:1.5; color:var(--muted); }
a { color:var(--accent); }
.app { height:var(--app-height,100dvh); display:flex; flex-direction:column; overflow:hidden; }
.app[data-season="autumn"] { --accent:light-dark(#925737,#d4a27c); --accent-bg:light-dark(#f3eae3,#352e29); --on-accent:light-dark(#fffaf5,#2b211b); }
.app[data-season="winter"] { --accent:light-dark(#365e78,#aecde5); --accent-bg:light-dark(#e8eef4,#2a343d); --on-accent:light-dark(#fff,#1c2831); }
.app[data-season="spring"] { --accent:light-dark(#42652e,#bed5a4); --accent-bg:light-dark(#eaf0e3,#2f3828); --on-accent:light-dark(#fff,#222c1b); }
.app[data-season="summer"] { --accent:light-dark(#806019,#e2cd8a); --accent-bg:light-dark(#f4eddb,#3b3528); --on-accent:light-dark(#fff,#2c2619); }
main { width:100%; max-width:1120px; min-height:0; flex:1; margin:0 auto; padding:calc(8px + env(safe-area-inset-top)) 16px 20px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; }
.app.is-fixed-view main { display:flex; flex-direction:column; overflow:hidden; padding-bottom:0; }
.schedule-chrome,.changes-chrome { flex:none; min-width:0; position:relative; z-index:4; background:var(--bg); }
.icon { display:block; flex-shrink:0; }
.icon-previous { transform:rotate(180deg); }
.schedule-back-row { margin-bottom:4px; }
.schedule-back { display:inline-flex; align-items:center; gap:4px; padding:0 4px 0 0; min-height:36px; color:var(--secondary); font-size:12px; }
.schedule-toolbar { position:relative; display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; min-height:44px; }
.schedule-group-control { min-width:0; flex:1; }
.schedule-toolbar select { max-width:100%; min-height:40px; border:0; border-radius:8px; padding:4px 0; font-size:12px; background:transparent; }
.schedule-toolbar select option { background:var(--surface); }
.schedule-toolbar > select { flex:0 0 auto; max-width:84px; color:var(--secondary); }
.schedule-group-control select { width:100%; font-size:15px; font-weight:500; }
.schedule-toolbar .group-label { min-height:40px; font-size:15px; font-weight:500; line-height:20px; }
.schedule-person { display:flex; align-items:center; gap:8px; min-width:0; }
.schedule-person .avatar { width:28px; height:28px; font-size:11px; }
.schedule-person strong { font-size:13px; font-weight:500; overflow-wrap:anywhere; }
.schedule-period-row { display:flex; align-items:center; gap:0; min-width:0; flex:0 1 auto; }
.schedule-period-row .date-picker { position:static; flex:0 1 auto; }
.schedule-period-row .date-picker > summary { min-height:40px; justify-content:center; gap:4px; padding:0 4px; border-radius:8px; }
.schedule-period-row .date-picker .period-title { color:var(--secondary); font-size:12px; font-weight:400; line-height:16px; }
.schedule-period-row .date-picker .icon { width:12px; height:12px; color:var(--muted); }
.schedule-period-row .date-picker-popup { left:auto; right:0; width:min(280px,100%); }
.period-arrow { flex:0 0 28px; display:grid; place-items:center; min-height:40px; border-radius:8px; padding:0; color:var(--secondary); }
.schedule-chrome[data-view-mode="week"] .schedule-toolbar { flex-wrap:wrap; }
.schedule-chrome[data-view-mode="week"] .schedule-period-row { order:3; flex-basis:100%; justify-content:space-between; }
.schedule-chrome .day-controls { margin:0; }
.schedule-chrome .freshness { margin:4px 0 8px; gap:0 8px; font-size:11px; flex-wrap:nowrap; min-height:32px; }
.schedule-chrome .freshness-text { min-width:0; line-height:16px; font-variant-numeric:tabular-nums; }
.freshness-actions { display:flex; align-items:center; flex-shrink:0; gap:4px; }
.freshness-today { min-height:32px; padding:4px; border-radius:6px; color:var(--secondary); font-size:11px; }
.refresh-button { display:grid; place-items:center; width:32px; min-height:32px; padding:0; border-radius:8px; color:var(--muted); }
.refresh-button .icon { width:16px; height:16px; }
.schedule-scroll,.changes-scroll { flex:1; min-height:0; min-width:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; scrollbar-gutter:stable; padding-bottom:16px; scroll-padding-top:8px; }
.schedule-scroll .schedule-viewport,.schedule-scroll .schedule-content { min-height:100%; }
.schedule-scroll .schedule-content { padding-top:1px; }
.schedule-scroll .day-section:first-child > .heading { margin-top:8px; }
.changes-chrome .header { margin-bottom:8px; }
.changes-count { margin-bottom:8px; }
.changes-scroll .feed { margin-top:8px; }
.header { margin:8px 0 20px; }
.row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.quiet-button,.back,.action { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; font-size:13px; }
.back { color:var(--secondary); border:0; padding-left:0; margin-bottom:8px; }
.action { background:var(--surface); }
.primary { background:var(--accent); color:var(--on-accent); border-color:transparent; }
.primary:hover { background:var(--accent); filter:brightness(.96); }
.danger { color:var(--red); }
.block-button { width:100%; }
.field input,.field select { width:100%; min-width:0; min-height:44px; background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:8px 12px; font-size:16px; }
.group-label { min-width:0; display:flex; align-items:center; min-height:44px; font-size:17px; font-weight:500; overflow-wrap:anywhere; }
.date-picker { position:relative; min-width:0; }
.date-picker > summary { display:flex; align-items:center; gap:6px; list-style:none; min-height:44px; }
.date-picker > summary::-webkit-details-marker { display:none; }
.date-picker > summary > span { color:var(--muted); font-size:16px; }
.date-picker h1 { overflow-wrap:anywhere; }
.date-picker-popup { position:absolute; z-index:7; top:calc(100% + 4px); left:0; display:grid; gap:8px; width:min(280px,calc(100vw - 48px)); padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--secondary); font-size:13px; box-shadow:0 4px 16px #0002; }
.date-picker-popup input { width:100%; min-width:0; min-height:44px; border:1px solid var(--line); border-radius:8px; padding:8px; background:var(--bg); font-size:16px; }
.day-controls { display:grid; grid-template-columns:24px minmax(0,1fr) 24px; gap:4px; align-items:center; }
.day-arrow { display:grid; place-items:center; min-width:0; min-height:48px; padding:0; border-radius:8px; color:var(--secondary); }
.dates { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:2px; margin:0; }
.dates button { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; min-height:48px; padding:4px 0 8px; border-radius:8px; font-size:18px; line-height:20px; font-weight:500; font-variant-numeric:tabular-nums; }
.dates small { font-size:11px; line-height:16px; }
.dates small { color:var(--secondary); }
.dates button[aria-pressed="true"] { color:var(--ink); background:var(--raised); }
.dates button[aria-pressed="true"] small { color:var(--ink); }
.dates button[aria-pressed="true"]:after { content:''; position:absolute; height:2px; width:16px; bottom:4px; left:calc(50% - 8px); border-radius:1px; background:var(--accent); }
.freshness { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin:0 0 12px; }
.freshness.stale { color:var(--red); }
.text-action { min-height:44px; padding:4px 0; font-size:12px; color:var(--accent); }
.heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin:16px 0 8px; }
.heading h2 { font-size:16px; }
.day-heading { position:absolute; width:1px; height:1px; padding:0; margin:-1px!important; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.agenda { display:grid; gap:8px; }
[data-kind="lec"] { --kind:var(--lec); --kind-bg:var(--lec-bg); }
[data-kind="prac"] { --kind:var(--prac); --kind-bg:var(--prac-bg); }
[data-kind="lab"] { --kind:var(--lab); --kind-bg:var(--lab-bg); }
[data-kind="other"] { --kind:var(--secondary); --kind-bg:var(--raised); }
.lesson { width:100%; padding:12px; display:block; border:1px solid transparent; border-radius:12px; background:var(--surface); min-width:0; touch-action:manipulation; }
.app[data-card-style="stripe"] .lesson { border-color:var(--line); }
.app[data-card-style="fill"] .lesson { background:var(--kind-bg); border-color:transparent; }
.app[data-card-style="fill"] .lesson:hover { background:var(--kind-bg); }
.lesson-top { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:4px 8px; padding-bottom:8px; margin-bottom:8px; border-bottom:2px solid var(--kind); }
.lesson-time-row { display:flex; align-items:baseline; justify-content:space-between; flex:1 1 auto; flex-wrap:wrap; min-width:0; gap:0 8px; }
.time { font-size:14px; font-weight:500; font-variant-numeric:tabular-nums; }
.lesson-meta { color:var(--secondary); font-size:11px; }
.lesson-status { display:inline-flex; gap:4px; align-items:center; font-size:11px; line-height:1.4; color:var(--blue); background:var(--blue-bg); border-radius:4px; padding:3px 6px; font-weight:500; }
[data-status="added"] .lesson-status { color:var(--gold); background:var(--gold-bg); }
[data-status="removed"].lesson { background:var(--red-bg); border-color:transparent; }
.app[data-card-style] .lesson[data-status="removed"] { background:var(--red-bg); border-color:transparent; }
.app[data-card-style] .lesson[data-status="removed"]:hover { background:var(--red-bg); }
.lesson[data-status="removed"] .lesson-top { border-color:var(--red); }
[data-status="removed"] .lesson-status { color:var(--red); background:transparent; padding-right:0; }
.subject { display:block; font-size:15px; line-height:1.4; font-weight:500; overflow-wrap:anywhere; }
.lesson-bottom { display:flex; align-items:end; justify-content:space-between; gap:8px 12px; margin-top:8px; }
.teacher-name { min-width:0; font-size:12px; color:var(--secondary); overflow-wrap:anywhere; }
.room { flex-shrink:0; max-width:55%; font-size:18px; font-weight:600; line-height:1.2; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; text-align:right; }
[data-status="room"] .room { color:var(--blue); }
.window { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; padding:4px; }
.window:before,.window:after { content:''; background:var(--line); height:1px; flex:1; }
.military { width:100%; background:var(--lec-bg); color:var(--lec); border:0; border-radius:10px; padding:24px 12px; font-size:19px; font-weight:500; text-align:center; }
.military-list { margin-top:8px; }
.empty,.notice { padding:24px 16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--secondary); }
.empty { text-align:center; }
.empty p,.notice p { margin-top:8px; font-size:14px; }
.notice .action { margin-top:16px; }
.group-block { border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.group-block + .group-block { margin-top:12px; }
.group-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:64px; padding:12px; list-style:none; }
.group-summary::-webkit-details-marker { display:none; }
.group-summary strong { display:block; font-size:16px; font-weight:500; }
.group-summary small { display:block; margin-top:2px; }
.group-chevron { color:var(--muted); }
.group-block[open] > .group-summary { border-bottom:1px solid var(--line); }
.group-block[open] > .group-summary > .group-chevron { transform:rotate(180deg); }
.group-body { padding:8px 12px 12px; }
.group-body .lesson { border-color:transparent; padding-inline:0; }
.group-body .lesson + .lesson { border-top:1px solid var(--line); border-radius:12px; }
.group-body .lesson[data-status="removed"] { padding-inline:8px; border-radius:8px; }
.app[data-card-style="stripe"] .group-body .lesson { border:1px solid var(--line); padding:12px; border-radius:12px; }
.app[data-card-style="fill"] .group-body .lesson { padding:12px; border-color:transparent; border-radius:12px; }
.app[data-card-style] .group-body .lesson[data-status="removed"] { background:var(--red-bg); border-color:transparent; }
.week-days { display:grid; gap:12px; }
.day-section { min-width:0; }
.schedule-viewport { overflow:hidden; overflow:clip; min-width:0; }
.schedule-viewport[data-swipe-days] { touch-action:pan-y pinch-zoom; }
.schedule-content { min-width:0; }
.schedule-content.is-dragging { will-change:transform; user-select:none; }
.week-days .heading { margin-top:8px; }
.calendar { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; }
.calendar-label { text-align:center; font-size:12px; padding:4px 0; color:var(--muted); }
.calendar-cell { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:6px; min-height:82px; padding:6px 4px; border:1px solid var(--line); border-radius:8px; background:var(--surface); min-width:0; }
.calendar-cell[data-current="true"] { border-color:var(--accent); }
.calendar-cell[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-bg); box-shadow:inset 0 0 0 1px var(--accent); }
.month-cell-date { display:flex; align-items:center; justify-content:space-between; gap:2px; }
.calendar-cell time { display:block; font-weight:600; font-size:16px; line-height:1.2; }
.month-slot-count { display:block; font-size:11px; line-height:1.35; color:var(--secondary); }
.month-slot-count.month-military { font-weight:500; color:var(--lec); }
.month-markers { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:2px; min-height:5px; margin-top:auto; }
.month-slot { display:flex; min-width:0; height:5px; overflow:hidden; border-radius:2px; }
.month-slot > i { flex:1; min-width:0; background:var(--kind); }
.month-change-dot { width:5px; height:5px; background:var(--blue); border-radius:50%; flex-shrink:0; }
.month-legend { display:flex; flex-wrap:wrap; gap:6px 12px; margin:0 0 6px; color:var(--secondary); font-size:11px; }
.month-legend > span { display:inline-flex; align-items:center; gap:4px; }
.month-legend i { width:6px; height:6px; border-radius:2px; background:var(--kind); flex-shrink:0; }
.month-legend .month-change-key { background:var(--blue); border-radius:50%; }
.month-guide { color:var(--muted); font-size:11px; margin-bottom:8px; }
.calendar-gap { min-width:0; }
.month-day-detail { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.month-detail-heading { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:0 12px; }
.month-selected-title { min-width:0; font-size:17px; overflow-wrap:anywhere; }
.month-day-summary { font-size:12px; color:var(--muted); margin:0 0 12px; }
.month-detail-heading .text-action { min-height:36px; white-space:normal; }
.month-detail-actions { display:flex; flex-wrap:wrap; gap:4px 16px; }
.context { margin-bottom:16px; }
.context h1 { font-size:20px; }
.context p { margin-top:4px; color:var(--muted); font-size:13px; }
.detail .subject { font-size:18px; }
.detail .lesson { padding:16px; }
.detail-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
.detail-actions .action { text-align:center; }
.person { display:flex; align-items:center; gap:12px; width:100%; padding:12px; background:var(--surface); border:1px solid var(--line); border-radius:10px; margin-top:12px; }
.avatar { width:44px; height:44px; border-radius:50%; flex-shrink:0; display:grid; place-items:center; background:var(--raised); color:var(--secondary); overflow:hidden; font-size:15px; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.person-text { flex:1; min-width:0; }
.person-text strong { display:block; font-size:14px; font-weight:500; }
.person-text small { display:block; margin-top:2px; }
.person-arrow { color:var(--muted); }
.profile { display:flex; align-items:center; gap:12px; margin:8px 0 16px; }
.profile h1 { font-size:22px; }
.profile .avatar { width:56px; height:56px; }
.history { margin-top:20px; }
.feed { margin-top:16px; }
.event { position:relative; margin-left:4px; padding:0 0 20px 20px; border-left:1px solid var(--line); min-width:0; }
.event:last-child { border-left-color:transparent; padding-bottom:0; }
.event:before { content:''; width:8px; height:8px; position:absolute; top:6px; left:-4px; border-radius:50%; background:var(--muted); }
.event[data-event="room"]:before { background:var(--blue); }
.event[data-event="removed"]:before { background:var(--red); }
.event[data-event="added"]:before,.event[data-event="restored"]:before { background:var(--gold); }
.event strong { display:block; font-size:14px; font-weight:500; }
.event time { display:block; margin-top:2px; color:var(--muted); font-size:12px; }
.event p { margin-top:6px; font-size:13px; color:var(--secondary); overflow-wrap:anywhere; }
.diff-old { color:var(--muted); text-decoration:line-through; }
.diff-new { color:var(--blue); font-weight:500; }
.feed-link { display:block; width:100%; padding:0; text-align:left; }
.feed-link small { display:block; margin-top:4px; }
.teacher-group-label { margin:0 0 4px 4px; }
.setting-section { margin-top:20px; }
.setting-section > h2 { font-size:14px; color:var(--secondary); margin-bottom:8px; }
.settings-panel { padding:0 12px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.setting { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; min-height:64px; }
.setting + .setting { border-top:1px solid var(--line); }
.setting small { display:block; margin-top:4px; }
.setting input[type="checkbox"] { width:22px; height:22px; accent-color:var(--accent); flex-shrink:0; margin:0 8px; }
.setting select,.setting input[type="time"] { max-width:192px; min-width:0; min-height:44px; border:1px solid var(--line); border-radius:8px; padding:8px; font-size:16px; background:var(--bg); }
.setting-label { min-width:0; }
.setting small { font-size:12px; }
.settings-note { color:var(--muted); font-size:12px; margin:8px 4px 0; }
.settings-disclosure { margin-top:20px; }
.settings-disclosure > summary { padding:12px 0; font-size:14px; color:var(--secondary); min-height:44px; }
.field { display:block; min-width:0; }
.field > span { display:block; font-size:13px; margin-bottom:8px; color:var(--secondary); }
.field-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:end; margin-top:12px; }
.settings-groups { margin-top:12px; }
.settings-group { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-bottom:1px solid var(--line); }
.settings-group strong { font-size:14px; font-weight:500; }
.settings-group small { display:block; }
.settings-group button { font-size:12px; min-height:44px; padding:8px; }
.settings-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:4px; margin:0 0 20px; border-radius:10px; background:var(--raised); }
.settings-tabs button { min-height:44px; padding:8px; text-align:center; border-radius:7px; color:var(--secondary); font-size:14px; }
.settings-tabs button[aria-selected="true"] { color:var(--ink); background:var(--surface); box-shadow:0 1px 2px #0001; font-weight:500; }
.settings-tab-panel { min-width:0; }
.settings-block { margin-top:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.settings-block > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px; min-height:76px; list-style:none; border-radius:12px; }
.settings-block > summary::-webkit-details-marker { display:none; }
.settings-block > summary strong { display:block; font-weight:500; font-size:16px; }
.settings-block > summary small { display:block; margin-top:4px; overflow-wrap:anywhere; }
.settings-chevron { flex-shrink:0; color:var(--muted); font-size:18px; }
.settings-block[open] > summary { border-bottom:1px solid var(--line); border-radius:12px 12px 0 0; }
.settings-block[open] > summary > .settings-chevron { transform:rotate(180deg); }
.settings-block-body { padding:0 16px 16px; }
.settings-block-body > .setting:last-child { padding-bottom:0; }
.settings-block-body > .settings-block { background:var(--bg); }
.settings-block-body > .settings-block > summary { padding:12px; min-height:64px; }
.settings-block-body > .settings-block .settings-block-body { padding-inline:12px; }
.settings-block-body > .settings-groups { margin-top:0; }
.settings-block-body .field-row { margin-top:16px; }
.settings-divider { height:1px; margin-top:20px; background:var(--line); }
.appearance-section + .appearance-section { margin-top:24px; }
.appearance-section > h2 { margin-bottom:8px; font-size:15px; font-weight:500; }
.section-description { margin:0 0 12px; color:var(--muted); font-size:12px; }
.appearance-choices { display:grid; gap:12px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.appearance-choice { display:block; min-width:0; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); cursor:pointer; }
.appearance-choice:has(input:checked),.layout-choice:has(input:checked) { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.appearance-choice:has(input:disabled),.layout-choice:has(input:disabled) { opacity:.65; cursor:wait; }
.choice-heading { display:flex; align-items:start; justify-content:space-between; gap:12px; }
.choice-heading > span { min-width:0; }
.choice-heading strong { display:block; font-size:15px; font-weight:500; }
.choice-heading small { display:block; margin-top:4px; font-size:12px; }
.appearance-choice input[type="radio"],.layout-choice input[type="radio"] { margin:0; width:20px; height:20px; accent-color:var(--accent); flex:0 0 20px; }
.appearance-samples { display:grid; gap:6px; margin-top:12px; }
.appearance-sample { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; padding:8px; border-radius:6px; background:var(--bg); }
.appearance-sample > span { min-width:0; }
.appearance-sample small { display:block; padding-bottom:4px; margin-bottom:4px; border-bottom:2px solid var(--kind); color:var(--secondary); font-size:11px; }
.appearance-sample > span > span { display:block; margin-top:2px; font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
.appearance-sample > strong { font-size:13px; font-weight:500; }
[data-preview-style="stripe"] .appearance-sample { border:1px solid var(--line); }
[data-preview-style="fill"] .appearance-sample { background:var(--kind-bg); }
.layout-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.layout-choice { min-width:0; padding:10px 8px; border:1px solid var(--line); border-radius:10px; background:var(--surface); cursor:pointer; }
.layout-diagram { height:72px; display:grid; gap:4px; padding:6px; border:1px solid var(--line); border-radius:5px; background:var(--bg); }
.layout-diagram > span { min-width:0; display:block; border-radius:2px; background:var(--kind-bg); border-left:3px solid var(--kind); }
.layout-horizontal { grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); }
.layout-vertical { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); }
.layout-list { grid-template-columns:1fr; grid-template-rows:repeat(4,minmax(0,1fr)); }
.layout-choice-label { display:flex; align-items:start; justify-content:center; gap:6px; margin-top:10px; font-size:12px; line-height:1.5; }
.layout-choice-label > span { min-width:0; overflow-wrap:anywhere; }
.layout-choice input[type="radio"] { width:16px; height:16px; flex-basis:16px; margin-top:1px; }
.navigation { flex:none; width:100%; z-index:5; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:8px max(8px,env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--bg); }
.navigation button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:48px; padding:4px; border-radius:8px; font-size:11px; color:var(--muted); }
.nav-symbol { display:block; width:20px; height:20px; }
.nav-symbol svg { display:block; width:20px; height:20px; }
.navigation button[aria-current="page"] { color:var(--accent); }
.navigation button[aria-current="page"] { font-weight:500; }
.status-message { position:fixed; z-index:8; left:12px; right:12px; bottom:calc(80px + env(safe-area-inset-bottom)); max-width:520px; margin:auto; padding:12px 16px; border:1px solid var(--line); border-radius:10px; color:var(--ink); background:var(--surface); box-shadow:0 4px 20px #0002; font-size:13px; }
.busy { color:var(--secondary); font-size:13px; padding:12px 0; }
.muted { color:var(--muted); }
@media(max-width:440px) {
  .setting:has(select) { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; align-items:start; }
  .setting select { width:100%; max-width:none; }
  .setting > span,.profile h1 { min-width:0; overflow-wrap:anywhere; }
  .appearance-choices { grid-template-columns:minmax(0,1fr); }
  .settings-block > summary { padding:12px; }
  .settings-block-body { padding-inline:12px; }
  .layout-choices { grid-template-columns:minmax(0,1fr); }
  .layout-choice { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:12px; padding:10px 12px; }
  .layout-diagram { height:56px; }
  .layout-choice-label { flex-direction:row-reverse; justify-content:space-between; align-items:center; margin-top:0; font-size:14px; }
}
@media(min-width:760px) {
  main { padding-inline:24px; }
  .week-days { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .calendar-cell { min-height:84px; padding:8px; }
  .month-slot-count { font-size:12px; }
  .navigation { max-width:1120px; margin:0 auto; border:1px solid var(--line); border-bottom:0; border-radius:12px 12px 0 0; }
}
@media(max-width:360px) {
  main { padding-inline:12px; }
  h1 { font-size:22px; }
  .lesson { padding:12px; }
  .subject { font-size:15px; }
  .room { font-size:18px; }
  .calendar-cell { padding:6px 4px; }
  .setting { gap:8px; }
}
@media(prefers-reduced-motion:no-preference) {
  button,summary,select { transition:background-color var(--feedback) var(--ease),color var(--feedback) var(--ease),border-color var(--feedback) var(--ease); }
  button:active:not(:disabled) { opacity:.78; }
  .date-picker[open] .date-picker-popup { animation:popover-enter var(--enter) var(--ease) both; }
  .person-arrow,.settings-chevron,.group-chevron { transition:transform var(--feedback) var(--ease); }
}
@keyframes popover-enter { from { opacity:0; transform:translate3d(0,-4px,0); } to { opacity:1; transform:translate3d(0,0,0); } }
