/* Fakarny — فَكَّرَنِي · soft pastel design system */

:root {
  --bg: #FBF7F3;
  --bg-tint: #F4EFFB;
  --surface: #FFFFFF;
  --surface-2: #F8F5FC;
  --ink: #2D2850;
  --ink-2: #625D80;
  --ink-3: #9A96B2;
  --line: #ECE6F4;
  --line-strong: #DDD5EA;

  --primary: #7C6CF2;
  --primary-ink: #5644D4;
  --primary-soft: #EEEBFF;
  --primary-grad: linear-gradient(135deg, #9D8CFF 0%, #C7A7FF 55%, #FFB3CB 100%);

  --exam: #E0517E;      --exam-soft: #FFE4EC;      --exam-mid: #FFB3C7;
  --quiz: #3D7FD9;      --quiz-soft: #E0EEFF;      --quiz-mid: #A7CDFF;
  --assignment: #22936A; --assignment-soft: #DAF4E8; --assignment-mid: #9FE0C2;
  --presentation: #C25E14; --presentation-soft: #FFE8D6; --presentation-mid: #FFC69C;
  --soon: #B7790A;      --soon-soft: #FFF3CF;
  --danger: #D9465F;    --danger-soft: #FFE5EA;

  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 26px;
  --shadow-s: 0 1px 2px rgba(61, 46, 120, .05), 0 2px 8px rgba(61, 46, 120, .05);
  --shadow: 0 2px 6px rgba(61, 46, 120, .05), 0 10px 30px rgba(61, 46, 120, .08);
  --shadow-l: 0 20px 60px rgba(45, 30, 110, .18);

  --font: "Nunito", "Baloo Bhaijaan 2", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Baloo Bhaijaan 2", "Nunito", system-ui, sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 10px; }

.icon { width: 22px; height: 22px; flex: none; }
.icon.sm { width: 17px; height: 17px; }
.icon.lg { width: 28px; height: 28px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.ar { font-family: "Baloo Bhaijaan 2", var(--font); direction: rtl; unicode-bidi: isolate; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app shell ---------- */

/* Phones: one column + bottom tab bar. Tablets: a centred, wider column.
   Computers (>=1080px): a sidebar plus a roomy main area (see "desktop" section at the end). */
#app {
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}
.shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; background: var(--bg); }
.sidebar { display: none; }
@media (min-width: 760px) {
  body { background: radial-gradient(1200px 600px at 10% -10%, #EDE7FF 0, transparent 60%), radial-gradient(900px 500px at 110% 10%, #FFE6EE 0, transparent 60%), #F6F2F8; }
  #app { background: transparent; }
  .shell { box-shadow: 0 0 0 1px var(--line), var(--shadow); }
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--safe-top) + 12px) 18px 10px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.brand .logo-mark { border-radius: 12px; box-shadow: var(--shadow-s); }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name b { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.brand-name .ar { font-size: 14px; color: var(--primary-ink); margin-top: 2px; text-align: left; direction: rtl; align-self: flex-start; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  display: grid; place-items: center; background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow-s); transition: transform .15s var(--ease), background .2s;
  flex: none; position: relative;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.plain { background: transparent; box-shadow: none; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none;
  background: var(--primary-grad); color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; box-shadow: var(--shadow-s); position: relative; text-decoration: none;
}
.dot-badge { position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--exam); border: 2px solid var(--bg); }

main.view { padding: 4px 18px calc(var(--nav-h) + var(--safe-bottom) + 36px); }
main.view.no-nav { padding-bottom: calc(var(--safe-bottom) + 32px); }
.view-enter { animation: viewIn .38s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- bottom navigation ---------- */

.tabbar {
  position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 760px;
  padding: 8px 22px calc(var(--safe-bottom) + 10px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(16px);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border: 0; background: none; color: var(--ink-3);
  font-size: 12.5px; font-weight: 700; text-decoration: none; border-radius: 14px;
  transition: color .2s;
}
.tab .tab-ic { width: 52px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .25s var(--ease); }
.tab[aria-current="page"] { color: var(--primary-ink); }
.tab[aria-current="page"] .tab-ic { background: var(--primary-soft); }
.fab {
  width: 60px; height: 60px; border-radius: 22px; border: 0;
  background: var(--primary-grad); color: #fff;
  display: grid; place-items: center; margin-top: -26px;
  box-shadow: 0 10px 24px rgba(124, 108, 242, .42), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .2s var(--spring);
}
.fab .icon { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: scale(.9) rotate(90deg); }

/* ---------- buttons & forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 16px; border: 0;
  font-weight: 800; font-size: 16px; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(124, 108, 242, .32); }
.btn-primary:hover { background: var(--primary-ink); }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn-ghost { background: var(--surface-2); color: var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; }
.link-btn { background: none; border: 0; color: var(--primary-ink); font-weight: 800; padding: 8px 4px; }
.row-buttons { display: flex; gap: 10px; margin-top: 22px; }
.row-buttons .btn { flex: 1; }

.field { display: block; margin-top: 16px; }
.field > .label, .label { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink-2); margin: 0 0 7px 2px; letter-spacing: .01em; }
.label .opt { font-weight: 600; color: var(--ink-3); }
.input {
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 15px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 16px; /* ≥16px prevents iOS zoom */ outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea.input { min-height: 88px; resize: vertical; }
.input[type="date"], .input[type="time"] { min-width: 0; }
.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; min-width: 0; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
.input-with-btn .btn { flex: none; min-height: 52px; padding: 0 16px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 6px 2px 0; }

/* segmented control */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: 16px; border: 1px solid var(--line);
}
.segmented button {
  border: 0; background: none; border-radius: 12px; min-height: 40px; padding: 0 8px;
  font-weight: 800; font-size: 14.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.segmented.types button[aria-pressed="true"][data-value="exam"] { background: var(--exam-soft); color: var(--exam); }
.segmented.types button[aria-pressed="true"][data-value="quiz"] { background: var(--quiz-soft); color: var(--quiz); }
.segmented.types button[aria-pressed="true"][data-value="assignment"] { background: var(--assignment-soft); color: var(--assignment); }
.segmented.types button[aria-pressed="true"][data-value="presentation"] { background: var(--presentation-soft); color: var(--presentation); }
/* four types: a 2×2 grid when a single row would squeeze the labels */
@media (max-width: 559px) { .segmented.types { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }
.segmented.types button { min-height: 48px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.h-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 18px 4px; margin: 0 -18px; scroll-snap-type: x proximity; }
.h-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font-weight: 700; font-size: 14.5px; color: var(--ink-2); white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
  scroll-snap-align: start;
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.chip .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip .count { font-size: 12px; background: var(--surface-2); padding: 1px 7px; border-radius: 999px; color: var(--ink-3); }
.chip[aria-pressed="true"] .count { background: #fff; color: var(--primary-ink); }
.chip.course-chip[aria-pressed="true"] { background: var(--c-bg); border-color: var(--c-solid); color: var(--c-ink); }
.chip-remove { border: 0; background: none; padding: 2px; margin-right: -6px; color: var(--ink-3); display: grid; place-items: center; border-radius: 50%; }

/* ---------- headings / sections ---------- */

.greeting { padding: 6px 2px 14px; }
.greeting h1 { font-size: 27px; }
.greeting p { margin-top: 4px; color: var(--ink-2); font-weight: 600; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 12px; }
.section-head h2 { font-size: 20px; }
.page-title { font-size: 28px; padding: 6px 2px 4px; }
.page-sub { color: var(--ink-2); font-weight: 600; padding: 0 2px 8px; }

/* ---------- next-up hero ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-l); padding: 18px 18px 18px;
  background: var(--hero-bg, var(--primary-soft)); color: var(--ink);
  box-shadow: var(--shadow);
  border: 0; width: 100%; text-align: left; display: block;
  transition: transform .2s var(--ease);
}
.hero:active { transform: scale(.985); }
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255,255,255,.45);
}
.hero.exam { --hero-bg: linear-gradient(140deg, #FFE1EA 0%, #FFD0DE 100%); --hero-ink: var(--exam); }
.hero.quiz { --hero-bg: linear-gradient(140deg, #E2EFFF 0%, #D2E5FF 100%); --hero-ink: var(--quiz); }
.hero.assignment { --hero-bg: linear-gradient(140deg, #DCF6EA 0%, #C9EFDD 100%); --hero-ink: var(--assignment); }
.hero.presentation { --hero-bg: linear-gradient(140deg, #FFEADB 0%, #FFDCC4 100%); --hero-ink: var(--presentation); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.hero-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-ink); }
.hero h3 { font-size: 24px; margin: 10px 0 4px; position: relative; z-index: 1; overflow-wrap: anywhere; }
.hero .meta { position: relative; z-index: 1; color: var(--ink-2); font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14.5px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-count {
  position: relative; z-index: 1; margin-top: 14px;
  display: inline-flex; align-items: baseline; gap: 6px;
  background: rgba(255,255,255,.75); padding: 8px 14px; border-radius: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--hero-ink);
}
.hero-count small { font-family: var(--font); font-size: 13px; color: var(--ink-2); font-weight: 700; }

/* ---------- week strip ---------- */

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 6px; }
.day-pill {
  border: 0; background: var(--surface); border-radius: 16px; padding: 8px 0 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: var(--shadow-s); color: var(--ink-2);
  transition: transform .15s var(--ease), background .2s;
}
.day-pill:active { transform: scale(.95); }
.day-pill .wd { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.day-pill .dn { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.day-pill .dots { display: flex; gap: 3px; height: 6px; }
.day-pill .dots i { width: 6px; height: 6px; border-radius: 50%; }
.day-pill.today { background: var(--primary); box-shadow: 0 6px 16px rgba(124,108,242,.35); }
.day-pill.today .wd, .day-pill.today .dn { color: #fff; }
.day-pill.today .dots i { box-shadow: 0 0 0 1.5px #fff; }
.dot-exam { background: var(--exam); } .dot-quiz { background: var(--quiz); } .dot-assignment { background: var(--assignment); } .dot-presentation { background: var(--presentation); }

/* ---------- toolbar (filters / search) ---------- */

.toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.toolbar .segmented { flex: 1; }
.search-box { position: relative; margin: 10px 0 4px; animation: viewIn .25s var(--ease); }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-box .input { padding-left: 44px; }
.filters { margin: 6px 0 4px; }

/* ---------- event cards ---------- */

.day-group { margin-top: 18px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.day-head h3 { font-size: 17px; }
.day-head .sub { color: var(--ink-3); font-weight: 700; font-size: 13.5px; }
.month-head { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); display: inline-block; padding: 4px 12px; border-radius: 999px; margin: 22px 0 2px; }
.list { display: flex; flex-direction: column; gap: 10px; }

.event-card {
  position: relative; display: flex; align-items: stretch; gap: 12px;
  background: var(--surface); border-radius: var(--radius); padding: 14px 12px 14px 16px;
  box-shadow: var(--shadow-s); border: 1px solid var(--line);
  text-align: left; width: 100%; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .2s, opacity .3s;
}
.event-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c-solid, var(--primary)); }
.event-card:active { transform: scale(.985); }
.event-card .main { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 5px; }
.event-card .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-card .title { font-weight: 800; font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.event-card .course-name { font-size: 13.5px; font-weight: 800; color: var(--c-ink, var(--ink-2)); display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.event-card .course-name .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--c-solid); flex: none; }
.event-card .info { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.event-card .info span { display: inline-flex; align-items: center; gap: 4px; }
.event-card .info .icon { width: 15px; height: 15px; color: var(--ink-3); }
.event-card.soon { border-color: #F7E2A6; background: linear-gradient(0deg, #FFFDF5, #FFFDF5); }
.event-card.is-done, .event-card.is-past { opacity: .62; }
.event-card.is-done .title { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.event-card.leaving { opacity: 0; transform: translateX(30px); }

.type-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 9px 3px 7px; border-radius: 999px; letter-spacing: .02em; }
.type-pill .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.type-pill.exam { background: var(--exam-soft); color: var(--exam); }
.type-pill.quiz { background: var(--quiz-soft); color: var(--quiz); }
.type-pill.assignment { background: var(--assignment-soft); color: var(--assignment); }
.type-pill.presentation { background: var(--presentation-soft); color: var(--presentation); }
.when-pill { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.when-pill.soon { background: var(--soon-soft); color: var(--soon); }
.when-pill.today { background: #FFE7DA; color: #C0562A; }
.when-pill.done { background: var(--assignment-soft); color: var(--assignment); }

.check {
  flex: none; align-self: center; width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: background .25s var(--ease), border-color .25s, color .2s, transform .2s var(--spring);
}
.check .icon { width: 20px; height: 20px; stroke-width: 3; }
.check:hover { border-color: var(--assignment-mid); }
.check[aria-pressed="true"] { background: var(--assignment); border-color: var(--assignment); color: #fff; }
.check.pop { animation: pop .35s var(--spring); }
@keyframes pop { 50% { transform: scale(1.18); } }

.stagger > * { animation: itemIn .42s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .03s; } .stagger > *:nth-child(3) { animation-delay: .06s; }
.stagger > *:nth-child(4) { animation-delay: .09s; } .stagger > *:nth-child(5) { animation-delay: .12s; }
.stagger > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes itemIn { from { opacity: 0; transform: translateY(10px) scale(.99); } }

/* ---------- empty states ---------- */

.empty { text-align: center; padding: 34px 20px 30px; background: var(--surface); border-radius: var(--radius-l); border: 1.5px dashed var(--line-strong); margin-top: 14px; }
.empty .art { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 28px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty .art .icon { width: 40px; height: 40px; stroke-width: 1.6; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--ink-2); margin: 6px auto 16px; max-width: 30ch; }
.mini-empty { color: var(--ink-3); font-weight: 700; font-size: 14.5px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line-strong); }

/* ---------- banners ---------- */

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: var(--radius); background: var(--soon-soft); color: #6B4D07; margin: 4px 0 6px; }
.banner.info { background: var(--primary-soft); color: var(--primary-ink); }
.banner .icon { margin-top: 2px; }
.banner .b-text { flex: 1; font-size: 14.5px; font-weight: 600; }
.banner .b-text b { display: block; font-weight: 800; margin-bottom: 2px; }
.banner .b-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- courses ---------- */

.course-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
@media (min-width: 460px) { .course-grid { grid-template-columns: 1fr 1fr; } }
.course-card {
  position: relative; overflow: hidden; text-align: left; border: 0; width: 100%;
  background: var(--surface); border-radius: var(--radius-l); padding: 16px;
  box-shadow: var(--shadow-s); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px; min-height: 132px;
  transition: transform .18s var(--ease), box-shadow .2s;
}
.course-card:active { transform: scale(.98); }
.course-card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 96px; height: 96px; border-radius: 50%; background: var(--c-bg); }
.course-card .c-icon { position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 14px; background: var(--c-bg); color: var(--c-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.course-card h3 { font-size: 18px; position: relative; z-index: 1; overflow-wrap: anywhere; }
.course-card .code { font-size: 13px; font-weight: 800; color: var(--c-ink); letter-spacing: .03em; }
.course-card .stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.course-card .next { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.stat { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.stat.exam { background: var(--exam-soft); color: var(--exam); }
.stat.quiz { background: var(--quiz-soft); color: var(--quiz); }
.stat.assignment { background: var(--assignment-soft); color: var(--assignment); }
.stat.presentation { background: var(--presentation-soft); color: var(--presentation); }
.stat.none { background: var(--surface-2); color: var(--ink-3); }

.course-hero { border-radius: var(--radius-l); padding: 20px 18px; background: var(--c-bg); position: relative; overflow: hidden; margin-top: 4px; }
.course-hero::after { content: ""; position: absolute; right: -50px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.5); }
.course-hero h1 { font-size: 26px; position: relative; z-index: 1; overflow-wrap: anywhere; }
.course-hero .code { color: var(--c-ink); font-weight: 800; letter-spacing: .04em; position: relative; z-index: 1; }
.course-hero .doc { color: var(--ink-2); font-weight: 700; margin-top: 6px; position: relative; z-index: 1; font-size: 14.5px; }
.course-hero .actions { display: flex; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.course-hero .actions .btn { background: rgba(255,255,255,.8); color: var(--ink); }
.back-row { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px -8px; }
.back-row a { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); font-weight: 800; text-decoration: none; padding: 8px; border-radius: 12px; }

.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.color-pick button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line-strong); background: var(--sw); display: grid; place-items: center; color: var(--ink); transition: transform .2s var(--spring), box-shadow .2s; }
.color-pick button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--sw-ink); transform: scale(1.08); color: var(--sw-ink); }
.color-pick .icon { width: 18px; height: 18px; stroke-width: 3; opacity: 0; }
.color-pick button[aria-pressed="true"] .icon { opacity: 1; }

/* ---------- sheets ---------- */

#sheets { position: relative; z-index: 60; }
.sheet-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(40, 30, 80, .32); opacity: 0; transition: opacity .28s var(--ease); }
.sheet {
  position: relative; width: 100%; max-width: 600px; max-height: calc(100dvh - var(--safe-top) - 24px);
  background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-l);
  transform: translateY(105%); transition: transform .34s var(--ease);
  display: flex; flex-direction: column; outline: none;
}
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet-layer.open .sheet { transform: translateY(0); }
.sheet-grip { width: 100%; height: 22px; flex: none; display: grid; place-items: center; touch-action: none; }
.sheet-grip::before { content: ""; width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px calc(var(--safe-bottom) + 22px); -webkit-overflow-scrolling: touch; }
.sheet-small .sheet-body { padding-bottom: calc(var(--safe-bottom) + 18px); }
.sheet-title { font-size: 23px; margin: 2px 0 6px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
@media (min-width: 640px) {
  .sheet-layer { align-items: center; }
  .sheet { border-radius: 28px; max-height: 88dvh; max-width: 520px; transform: translateY(30px) scale(.97); opacity: 0; transition: transform .3s var(--ease), opacity .25s; }
  .sheet-layer.open .sheet { transform: none; opacity: 1; }
}
.sheet-actions { position: sticky; bottom: calc(-1 * (var(--safe-bottom) + 22px)); margin: 22px -20px 0; padding: 12px 20px calc(var(--safe-bottom) + 22px); background: linear-gradient(to top, var(--bg) 75%, transparent); display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }

.details-toggle { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--ink-2); font-weight: 800; }
.details-toggle .icon { transition: transform .25s var(--ease); }
.details-toggle[aria-expanded="true"] .icon.chev { transform: rotate(90deg); }
.collapsible { animation: viewIn .3s var(--ease); }

/* event detail sheet */
.detail-head { padding: 4px 0 10px; }
.detail-head h2 { font-size: 26px; margin: 10px 0 4px; overflow-wrap: anywhere; }
.detail-course { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: var(--c-ink); text-decoration: none; background: var(--c-bg); padding: 5px 12px 5px 10px; border-radius: 999px; font-size: 14px; }
.detail-course .swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--c-solid); }
.detail-list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); margin-top: 14px; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; }
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-row .icon { color: var(--ink-3); margin-top: 1px; }
.detail-row .k { font-size: 12.5px; color: var(--ink-3); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.detail-row .v { font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-row .v.tba { color: var(--ink-3); font-style: italic; font-weight: 600; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- settings ---------- */

.card { background: var(--surface); border-radius: var(--radius-l); padding: 18px; box-shadow: var(--shadow-s); border: 1px solid var(--line); margin-top: 12px; }
.card h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.card h2 .icon { color: var(--primary); }
.card > p { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row .grow { flex: 1; min-width: 0; }
.setting-row .t { font-weight: 800; }
.setting-row .s { font-size: 13.5px; color: var(--ink-2); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.on { background: var(--assignment-soft); color: var(--assignment); }
.status-pill.off { background: var(--surface-2); color: var(--ink-2); }
.status-pill.warn { background: var(--soon-soft); color: var(--soon); }
.status-pill.bad { background: var(--danger-soft); color: var(--danger); }
.reminder-type { padding: 12px 0; }
.reminder-type + .reminder-type { border-top: 1px solid var(--line); }
.reminder-type .label { margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.offset-chips .chip { min-height: 36px; padding: 0 12px; font-size: 13.5px; }

.install-steps { counter-reset: step; list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.install-steps li { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); font-weight: 600; }
.install-steps li::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.install-steps .icon { color: var(--quiz); vertical-align: -5px; }

/* ---------- onboarding ---------- */

.onb { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 14px) 22px calc(var(--safe-bottom) + 22px); }
.onb-top { display: flex; align-items: center; gap: 10px; height: 44px; }
.onb-progress { flex: 1; display: flex; gap: 6px; }
.onb-progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.onb-progress i.done::after { content: ""; position: absolute; inset: 0; background: var(--primary-grad); border-radius: 3px; animation: grow .5s var(--ease) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.onb-body { flex: 1; display: flex; flex-direction: column; padding-top: 18px; }
.onb-body h1 { font-size: 30px; }
.onb-body .lead { color: var(--ink-2); font-size: 16.5px; margin-top: 8px; font-weight: 600; }
.onb-foot { padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.onb-welcome { text-align: center; justify-content: center; align-items: center; }
.onb-welcome .big-logo { width: 148px; height: 148px; border-radius: 40px; box-shadow: 0 24px 50px rgba(124,108,242,.28); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-2deg); } }
.onb-welcome .wordmark { margin-top: 26px; font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1; }
.onb-welcome .wordmark-ar { font-size: 34px; color: var(--primary-ink); margin-top: 6px; line-height: 1.5; }
.onb-welcome .lead { max-width: 30ch; margin: 10px auto 0; }
.uni-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-l); padding: 16px; margin-top: 12px; transition: border-color .2s, background .2s, transform .15s; }
.uni-card:active { transform: scale(.985); }
.uni-card[aria-pressed="true"] { border-color: var(--primary); background: #FBFAFF; box-shadow: 0 0 0 4px var(--primary-soft); }
.uni-card .u-badge { width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex: none; }
.uni-card .u-name { font-weight: 800; }
.uni-card .u-sub { font-size: 13.5px; color: var(--ink-2); }
.uni-card .u-ar { font-size: 14px; color: var(--ink-3); margin-top: 2px; text-align: left; }
.uni-card .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.uni-card[aria-pressed="true"] .tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.uni-card .tick .icon { width: 15px; height: 15px; stroke-width: 3; }
.course-entry-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.course-entry { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; border-radius: 16px; background: var(--c-bg); animation: itemIn .3s var(--ease); }
.course-entry .n { flex: 1; font-weight: 800; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.course-entry .icon-btn { width: 36px; height: 36px; border-radius: 12px; box-shadow: none; background: rgba(255,255,255,.7); }
.bell-art { width: 120px; height: 120px; margin: 10px auto 6px; border-radius: 36px; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); animation: ring 2.6s ease-in-out infinite; transform-origin: 50% 20%; }
.bell-art .icon { width: 58px; height: 58px; stroke-width: 1.6; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(9deg); } 72% { transform: rotate(-8deg); } 78% { transform: rotate(5deg); } 84% { transform: rotate(-3deg); } }
.preview-notif { margin: 18px auto 0; max-width: 360px; width: 100%; background: rgba(255,255,255,.9); border-radius: 20px; padding: 12px 14px; display: flex; gap: 12px; box-shadow: var(--shadow); text-align: left; }
.preview-notif img { border-radius: 10px; flex: none; }
.preview-notif .pn-t { font-weight: 800; font-size: 14.5px; }
.preview-notif .pn-b { font-size: 13.5px; color: var(--ink-2); }
.preview-notif .pn-app { font-size: 11.5px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- toast ---------- */

#toast { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px); z-index: 90; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 13px 14px 13px 18px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: var(--shadow-l); transform: translateY(20px); opacity: 0; transition: transform .3s var(--spring), opacity .2s; }
.toast.show { transform: none; opacity: 1; }
.toast-action { border: 0; background: rgba(255,255,255,.16); color: #fff; font-weight: 800; padding: 7px 12px; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   v2: accounts, timetable, import, desktop layout
   ===================================================================== */

.form-error { color: var(--danger); font-weight: 700; font-size: 14.5px; margin: 12px 2px 0; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.link-btn.center { display: block; margin: 10px auto 0; }
.link-btn.danger { color: var(--danger); margin-top: 14px; }
.banner.compact { padding: 10px 12px; margin: 0 0 10px; font-size: 14px; }
.banner.compact .icon { width: 18px; height: 18px; }
.select-sm { width: auto; min-height: 42px; padding: 8px 34px 8px 12px; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; box-shadow: none; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 16px 2px 4px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--primary); margin-top: 1px; flex: none; }
.loading-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-2); font-weight: 700; }
.loading-screen img { border-radius: 22px; animation: float 2.4s ease-in-out infinite; }

/* sync status */
#sync-slot:empty, #side-sync:empty { display: none; }
.sync-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 800; }
.sync-chip.offline { background: var(--soon-soft); color: var(--soon); }
.sync-line { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.sync-line.saved { color: var(--assignment); }
.sync-line.offline, .sync-line.error { color: var(--soon); }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.auth-brand { display: none; }
.auth-panel { display: flex; justify-content: center; align-items: flex-start; padding: calc(var(--safe-top) + 28px) 20px calc(var(--safe-bottom) + 28px); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 27px; margin-top: 22px; }
.auth-card > .muted { margin-top: 6px; }
.auth-mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-mobile-brand img { border-radius: 18px; box-shadow: var(--shadow); }
.auth-mobile-brand b { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1; }
.auth-mobile-brand .ar { color: var(--primary-ink); font-size: 18px; display: block; text-align: left; }
.auth-tabs { margin-top: 4px; }
.auth-card .btn-block { margin-top: 20px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); border-radius: 12px; display: grid; place-items: center; }
.fine-print { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 13px; font-weight: 600; margin-top: 18px; text-align: center; }
.ios-tip { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.ios-tip summary { cursor: pointer; font-weight: 800; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(380px, 1fr) minmax(460px, 1fr); }
  .auth-brand { display: flex; align-items: center; justify-content: center; padding: 48px; background: radial-gradient(800px 500px at 0% 0%, #E6DFFF 0, transparent 60%), radial-gradient(700px 500px at 100% 100%, #FFDDE8 0, transparent 60%), #F4EFFB; }
  .auth-brand-inner { max-width: 420px; }
  .auth-brand .big-logo { width: 132px; height: 132px; border-radius: 36px; box-shadow: 0 24px 50px rgba(124,108,242,.28); animation: float 4s ease-in-out infinite; }
  .auth-brand .wordmark { margin-top: 22px; font-family: var(--font-display); font-size: 48px; font-weight: 700; line-height: 1; }
  .auth-brand .wordmark-ar { font-size: 36px; color: var(--primary-ink); line-height: 1.5; text-align: left; }
  .auth-brand .lead { font-size: 18px; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
  .auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
  .auth-points li { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.7); border-radius: 16px; padding: 12px 14px; font-weight: 700; }
  .auth-points .icon { color: var(--primary); }
  .auth-panel { align-items: center; padding: 48px; background: var(--bg); }
  .auth-mobile-brand { display: none; }
}

/* ---------- onboarding (account version) ---------- */
.onb-brand img { display: block; border-radius: 10px; }
.onb { max-width: 560px; margin: 0 auto; }
.onb.onb-wide { max-width: 1100px; }

/* ---------- importer ---------- */
.imp-pick { max-width: 560px; margin: 0 auto; text-align: center; padding-top: 8px; }
.imp-hero { width: 84px; height: 84px; border-radius: 28px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.imp-pick h2 { font-size: 26px; }
.imp-pick > .muted { margin-top: 8px; }
.drop { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 18px; border-radius: var(--radius-l); border: 2px dashed var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.drop:hover, .drop.over { border-color: var(--primary); background: #FBFAFF; }
.drop:active { transform: scale(.99); }
.drop .icon { color: var(--primary); }
.drop b { font-size: 17px; }
.tips { list-style: none; padding: 0; margin: 18px auto 0; display: grid; gap: 8px; text-align: left; max-width: 420px; }
.tips li { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.tips .icon { color: var(--assignment); }
.imp-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 20px; }
.imp-working { max-width: 480px; margin: 20px auto; text-align: center; position: relative; }
.imp-thumb { width: 100%; max-height: 300px; object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.scan-line { position: absolute; left: 6%; right: 6%; top: 0; height: 3px; border-radius: 3px; background: var(--primary-grad); box-shadow: 0 0 18px rgba(124,108,242,.7); animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 4px; } 50% { top: calc(100% - 6px); } }
.imp-working h2 { font-size: 20px; margin-top: 20px; }
.progress { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 16px; }
.progress i { display: block; height: 100%; background: var(--primary-grad); border-radius: 5px; transition: width .4s var(--ease); }
.progress i.indeterminate { width: 40% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.imp-review { display: grid; gap: 18px; }
.imp-summary h2 { font-size: 24px; }
.imp-summary .muted { margin-top: 4px; }
.method-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 11px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 800; font-size: 13px; }
.imp-warnings { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.imp-photo-toggle { margin-bottom: 10px; }
.imp-photo-frame { display: none; border-radius: var(--radius); overflow: auto; background: var(--surface); border: 1px solid var(--line); max-height: 60vh; }
.imp-photo.open .imp-photo-frame { display: block; }
.imp-photo-frame img { display: block; width: 100%; min-width: 560px; }
.imp-courses { display: grid; gap: 12px; margin-top: 14px; }
.imp-course { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; box-shadow: var(--shadow-s); border-left: 6px solid var(--c-solid, var(--primary)); }
.imp-course header { display: grid; gap: 10px; }
.imp-course-fields { display: flex; gap: 10px; }
.imp-course-meta { display: flex; gap: 8px; align-items: flex-end; }
.imp-course-meta .mini-field { flex: 1; }
.mini-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.mini-field > span { font-size: 11.5px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding-left: 2px; }
.mini-field .input { min-height: 44px; padding: 9px 12px; border-radius: 12px; font-size: 16px; }
.mini-field select.input { padding-right: 30px; }
.mini-field.grow { flex: 1; }
.mini-field.code { width: 120px; flex: none; }
.mini-field.unsure .input { background-color: var(--soon-soft); border-color: #F2C760; }
.mini-field.unsure > span::after { content: " · check"; color: var(--soon); }
.imp-sessions { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.imp-session { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; padding: 10px; border-radius: 14px; background: var(--surface-2); position: relative; }
.imp-session [data-remove-session] { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; }
.imp-session .mini-field:nth-child(1) { grid-column: 1 / -1; padding-right: 36px; }
.imp-footer { display: flex; gap: 10px; justify-content: space-between; position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px); margin-top: 18px; padding: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: var(--radius); border: 1px solid var(--line); z-index: 5; }
.onb .imp-footer { bottom: calc(var(--safe-bottom) + 8px); }
.imp-footer .btn-primary { flex: 1; max-width: 320px; }
.imp-footer .btn { white-space: nowrap; padding: 0 16px; }
.imp-thumb-wrap { position: relative; display: inline-block; max-width: 100%; }
.imp-thumb-wrap .scan-line { left: 4%; right: 4%; }
@media (min-width: 640px) {
  .imp-course header { grid-template-columns: 1fr auto; align-items: end; }
  .imp-course-meta .mini-field { width: 220px; }
  .imp-session { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr 36px; padding: 8px 8px 8px 10px; }
  .imp-session .mini-field:nth-child(1) { grid-column: auto; padding-right: 0; }
  .imp-session [data-remove-session] { position: static; align-self: end; margin-bottom: 4px; }
}
@media (min-width: 1080px) {
  .imp-review.with-photo { grid-template-columns: minmax(320px, 0.9fr) 1.4fr; align-items: start; }
  .imp-photo { position: sticky; top: 24px; }
  .imp-photo-toggle { display: none; }
  .imp-photo-frame { display: block; max-height: calc(100dvh - 60px); }
  .imp-photo-frame img { min-width: 0; }
  .imp-footer { bottom: 12px; }
}

/* ---------- class picker in the event form ---------- */
.class-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.class-opt { text-align: left; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 9px 11px; display: grid; gap: 2px; transition: border-color .2s, background .2s, transform .15s; }
.class-opt:active { transform: scale(.98); }
.class-opt[aria-checked="true"] { border-color: var(--primary); background: #FBFAFF; box-shadow: 0 0 0 3px var(--primary-soft); }
.class-opt .d { font-weight: 800; }
.class-opt .t { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.k { justify-self: start; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.k.lecture { background: var(--primary-soft); color: var(--primary-ink); }
.k.section, .k.tutorial { background: var(--quiz-soft); color: var(--quiz); }
.k.lab { background: var(--assignment-soft); color: var(--assignment); }
.week-chips { margin-top: 10px; }
.week-chips .chip[disabled] { opacity: .45; pointer-events: none; }
.auto-when { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #F1EEFF, #FFF0F5); }
.auto-when .icon { color: var(--primary); }
.auto-when b { display: block; font-size: 16px; }
.auto-when span { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.use-class { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 6px; }
.day-chips .chip { min-width: 52px; justify-content: center; }

/* ---------- courses page / class times ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.page-head .page-title, .page-head .page-sub { padding-left: 0; padding-right: 0; }
.page-head .page-sub { padding-top: 2px; padding-bottom: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs-inline { margin: 4px 0 14px; max-width: 440px; }
.class-times { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--c-ink); position: relative; z-index: 1; }
.session-list { display: grid; gap: 8px; }
.session-row { display: grid; grid-template-columns: auto 1fr auto auto 18px; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 11px 12px; border-left: 4px solid var(--c-solid, var(--primary)); box-shadow: var(--shadow-s); transition: transform .15s; }
.session-row:active { transform: scale(.99); }
.session-row .d { font-weight: 800; }
.session-row .t { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.session-row .r { font-size: 13px; color: var(--ink-3); font-weight: 700; }
.session-row .icon { color: var(--ink-3); }
@media (max-width: 480px) {
  .session-row { grid-template-columns: auto 1fr 18px; }
  .session-row .t { grid-column: 2; grid-row: 2; }
  .session-row .r { grid-column: 2; grid-row: 3; }
  .session-row > .icon { grid-column: 3; grid-row: 1 / 3; }
}
.import-empty .art { background: var(--quiz-soft); color: var(--quiz); }

/* ---------- weekly timetable ---------- */
.tt-grid { display: none; }
.tt-agenda { display: grid; gap: 16px; }
.tt-agenda-day h3 { font-size: 17px; margin: 0 2px 8px; display: flex; align-items: center; gap: 8px; }
.session-row.agenda { grid-template-columns: 70px 1fr 18px; }
.session-row.agenda .t { display: flex; flex-direction: column; color: var(--ink); font-weight: 800; grid-row: auto; grid-column: auto; }
.session-row.agenda small { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.session-row.agenda .n { display: flex; flex-direction: column; min-width: 0; }
.session-row.agenda .n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-row.agenda > .icon { grid-column: auto; grid-row: auto; }
@media (min-width: 760px) {
  .tt-agenda { display: none; }
  .tt-grid {
    display: grid; grid-template-columns: 64px repeat(var(--tt-cols), minmax(0, 1fr)); grid-template-rows: auto var(--tt-h);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-s); overflow: hidden;
    padding-bottom: 8px;
  }
  .tt-corner { border-bottom: 1px solid var(--line); }
  .tt-day { text-align: center; padding: 10px 4px; font-weight: 800; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 14px; }
  .tt-day small { display: none; }
  .tt-day.today { color: var(--primary-ink); background: var(--primary-soft); }
  .tt-times { position: relative; }
  .tt-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
  .tt-times span:first-child { transform: none; }
  .tt-col { position: relative; border-left: 1px solid var(--line); }
  .tt-col.today { background: #FBFAFF; }
  .tt-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
  .tt-block {
    position: absolute; left: 4px; right: 4px; border: 0; text-align: left; padding: 6px 8px; border-radius: 10px; overflow: hidden;
    background: var(--c-bg); color: var(--ink); border-left: 4px solid var(--c-solid); display: flex; flex-direction: column; gap: 1px;
    transition: transform .15s, box-shadow .2s;
  }
  .tt-block:hover { box-shadow: var(--shadow); transform: translateY(-1px); z-index: 2; }
  .tt-block b { font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .tt-block span { font-size: 11.5px; color: var(--ink-2); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- settings ---------- */
.settings-grid { display: grid; gap: 12px; }
.settings-grid .card { margin-top: 0; }
.card.highlight { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* ---------- schedule layout ---------- */
.side-week { display: block; margin-top: 12px; }
.side-week-head { display: none; }
.all-clear { display: flex; align-items: center; gap: 8px; }

/* =====================================================================
   Desktop & laptop (>= 1080px): sidebar + roomy two-column pages
   ===================================================================== */
@media (min-width: 1080px) {
  body.has-sidebar { background: var(--bg); }
  body.has-sidebar #app { display: grid; grid-template-columns: 280px minmax(0, 1fr); }
  body.has-sidebar .shell { max-width: none; box-shadow: none; margin: 0; background: transparent; }
  body.has-sidebar .topbar, body.has-sidebar .tabbar { display: none; }
  body.has-sidebar main.view { max-width: 1180px; margin: 0 auto; padding: 32px 40px 60px; }
  body.has-sidebar #toast { bottom: 28px; }

  .sidebar {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh;
    padding: 24px 18px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { flex: none; }
  .sidebar .brand-name b { font-size: 23px; }
  .side-add { min-height: 48px; font-size: 15px; }
  .side-nav { display: grid; gap: 4px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--ink-2); font-weight: 800; text-decoration: none; transition: background .2s, color .2s; }
  .side-link:hover { background: var(--surface-2); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); }
  .side-foot { margin-top: auto; display: grid; gap: 10px; }
  .side-remind { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-radius: 14px; padding: 11px 12px; background: var(--soon-soft); color: #6B4D07; }
  .side-remind span { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; }
  .side-remind b { font-weight: 800; }
  .side-user { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; text-decoration: none; color: inherit; border: 1px solid var(--line); }
  .side-user:hover { background: var(--surface-2); }
  .side-user .who { display: flex; flex-direction: column; min-width: 0; }
  .side-user small { color: var(--ink-3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Schedule: summary column + list column */
  .sched-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .sched-side { position: sticky; top: 32px; display: grid; gap: 14px; }
  .sched-side .greeting { padding-top: 0; padding-bottom: 0; }
  .sched-side .greeting h1 { font-size: 30px; }
  .side-week { margin-top: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; box-shadow: var(--shadow-s); }
  .side-week-head { display: block; }
  .side-week-head h2 { font-size: 16px; margin: 0 2px 10px; }
  .side-week .week-strip { gap: 4px; margin: 0; }
  .side-week .day-pill { box-shadow: none; background: var(--surface-2); }
  .side-week .day-pill.today { background: var(--primary); }
  .sched-main .toolbar { margin-top: 0; }
  .sched-main .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

  .course-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .course-layout { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .course-side { position: sticky; top: 32px; }
  .course-main > .section-head:first-child, .course-main > .empty:first-child { margin-top: 4px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
  .page-title { font-size: 32px; }

  .sheet-layer .sheet { max-width: 560px; }
  .sheet-layer.sheet-wide .sheet { max-width: 640px; }
  .event-card:hover { box-shadow: var(--shadow); }
  .course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
}
@media (min-width: 760px) and (max-width: 1079px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1400px) {
  .sched-main .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =====================================================================
   v2.2: calmer schedule — course-first agenda rows
   ===================================================================== */

/* Activity row: [time] [course / type · title / place] [chip] [✓] */
.event-card {
  gap: 0; padding: 0; align-items: stretch; border-radius: 16px;
  border: 1px solid var(--line); box-shadow: none; background: var(--surface);
}
.event-card::before { width: 4px; }
.event-card .main {
  flex: 1; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 6px 12px 16px; flex-direction: row;
}
.event-card .check { width: 34px; height: 34px; margin: 0 12px 0 2px; border-width: 1.5px; }
.event-card .check .icon { width: 17px; height: 17px; }
.ev-time { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; color: var(--ink); }
.ev-time b { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.ev-time small { font-size: 11.5px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ev-time small.due { color: var(--assignment); }
.ev-time.tba b { font-size: 15px; color: var(--ink-3); }
.ev-date { font-size: 11.5px; font-weight: 800; color: var(--primary-ink); margin-bottom: 2px; white-space: nowrap; }
.ev-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev-course { font-family: var(--font-display); font-size: 17.5px; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.ev-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.ev-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev-where { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); font-weight: 600; min-width: 0; }
.ev-where .icon { width: 14px; height: 14px; flex: none; }
.ev-flag { margin-top: 5px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); white-space: nowrap; }
.ev-flag.today { color: #C0562A; }
.ev-flag.soon { color: var(--soon); }
.ev-flag.done { color: var(--assignment); }
.type-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12.5px; font-weight: 800; }
.type-tag .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.type-tag.exam { color: var(--exam); }
.type-tag.quiz { color: var(--quiz); }
.type-tag.assignment { color: var(--assignment); }
.type-tag.presentation { color: var(--presentation); }
.event-card.is-urgent { background: linear-gradient(90deg, #FFFBEF, var(--surface) 70%); border-color: #F5E3B0; }
.event-card.soon { background: var(--surface); }
.event-card.is-done .ev-course, .event-card.is-done .ev-title { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.event-card.is-done .title { text-decoration: none; }


/* Day groups: one clear header, quiet spacing between days */
.day-group { margin-top: 22px; }
.day-group:first-child { margin-top: 10px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 10px; }
.day-head h3 { font-size: 16.5px; }
.day-head .sub { color: var(--ink-3); font-weight: 700; font-size: 13.5px; }
.day-head .day-count { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--ink-3); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; align-self: center; }
.day-head.today h3 { color: var(--primary-ink); }
.day-head.today h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: 2px; }
.list { gap: 8px; }
.day-empty { color: var(--ink-3); font-weight: 600; font-size: 14.5px; margin: 0 2px; }
.day-group.quiet .day-head { margin-bottom: 4px; }
.later-link { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 18px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); background: transparent; color: var(--primary-ink); font-weight: 800; text-align: left; }
.later-link span { flex: 1; }
.month-head { margin: 26px 0 0; }

/* Next-up card: course as heading, countdown on the side */
.hero { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; box-shadow: var(--shadow-s); }
.hero::after { width: 120px; height: 120px; right: -30px; top: -40px; }
.hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero h3 { font-size: 21px; margin: 6px 0 2px; }
.hero-title { display: block; font-weight: 700; color: var(--ink-2); font-size: 14.5px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero .meta { font-size: 13.5px; gap: 2px 12px; }
.hero-count { margin: 0; flex: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-width: 78px; padding: 10px 10px; gap: 0; }
.hero-count b { font-size: 21px; line-height: 1.1; }
.hero-count small { font-size: 12px; }

/* Slim reminder notice instead of a big banner */
.notice-strip { display: flex; align-items: center; gap: 8px; padding: 7px 6px 7px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.notice-strip > span { flex: 1; min-width: 0; }
.notice-strip .link-btn { padding: 4px 6px; white-space: nowrap; }
.notice-x { width: 32px; height: 32px; }

/* Greeting + filters: less shouting */
.greeting { padding-bottom: 10px; }
.greeting h1 { font-size: 25px; }
.filters .chip { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.toolbar { margin-top: 14px; }

/* Event detail heading */
.detail-course-title { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; max-width: 100%; }
.detail-course-title h2 { font-size: 25px; margin: 6px 0 2px; overflow-wrap: anywhere; }
.detail-course-title .icon { color: var(--c-ink); flex: none; }
.detail-head { border-left: 4px solid var(--c-solid); padding-left: 12px; }
.detail-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; color: var(--ink-2); }

@media (min-width: 1080px) {
  .sched-main .list, .course-main .list { display: flex; flex-direction: column; gap: 8px; }
  .sched-main { max-width: 760px; }
  .event-card .main { grid-template-columns: 70px minmax(0, 1fr); padding: 14px 8px 14px 18px; }
  .event-card:hover { box-shadow: var(--shadow-s); border-color: var(--line-strong); }
  .sched-side .notice-strip { margin-bottom: 0; }
}
@media (min-width: 1400px) {
  .sched-main .list { display: flex; }
}

/* import review: per-course status, week preview, reassurance */
.imp-status { grid-column: 1 / -1; margin: 0; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; justify-self: start; }
.imp-status.new { background: var(--primary-soft); color: var(--primary-ink); }
.imp-status.update { background: var(--soon-soft); color: var(--soon); }
.imp-status.same { background: var(--assignment-soft); color: var(--assignment); }
.imp-week { margin-top: 12px; }
.imp-week-view { margin-top: 10px; }
.imp-safe { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; }
.imp-safe .icon { color: var(--assignment); flex: none; margin-top: 2px; }

/* Phones: a lighter top so the agenda starts sooner */
@media (max-width: 759px) {
  .greeting { padding: 2px 2px 8px; }
  .greeting h1 { font-size: 22px; }
  .greeting p { font-size: 14.5px; margin-top: 2px; }
  .notice-strip { font-size: 13.5px; padding: 5px 4px 5px 12px; margin-bottom: 10px; }
  .hero { padding: 12px 12px 12px 14px; border-radius: 20px; }
  .hero h3 { font-size: 18.5px; margin: 4px 0 0; }
  .hero-title { font-size: 13.5px; margin-bottom: 4px; }
  .hero .meta { font-size: 12.5px; }
  .hero .meta span:nth-child(2) { display: none; } /* the place is in the list below */
  .hero-count { min-width: 66px; padding: 8px; }
  .hero-count b { font-size: 18px; }
  .week-strip { margin-top: 10px; gap: 4px; }
  .day-pill { padding: 6px 0 7px; border-radius: 14px; }
  .day-pill .dn { font-size: 17px; }
  .toolbar { margin-top: 12px; }
  .segmented button { min-height: 36px; }
  .toolbar .icon-btn { width: 40px; height: 40px; }
}

/* five type filters: wrap instead of hiding the last one off-screen on wide layouts */
@media (min-width: 760px) {
  .filters.h-scroll { flex-wrap: wrap; overflow: visible; margin: 6px 0 4px; padding: 2px 0 4px; }
}

/* several screenshots (e.g. one per day from a student portal) */
.imp-count { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.imp-photo-label { margin: 10px 12px 4px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.imp-photo-frame img.left-out { opacity: .35; }
.imp-shots { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.imp-shots h3 { margin: 0; font-size: 16px; }
.imp-shots > .hint { margin: 4px 0 10px; }
.imp-shot { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.imp-shot img { width: 52px; height: 64px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); flex: none; background: var(--surface-2); }
.imp-shot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-shot-body .muted { font-size: 13px; }
.imp-shot-body .mini-field { margin-top: 6px; max-width: 260px; }
.imp-shot.off img, .imp-shot.off .imp-shot-body { opacity: .45; }
.imp-shot-use { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--ink-2); cursor: pointer; }
.imp-shot-use input { width: 20px; height: 20px; accent-color: var(--primary, #7B6CF6); }
.imp-from { align-self: end; font-size: 11.5px; font-weight: 800; color: var(--ink-3, #9a94b3); padding-bottom: 12px; }

/* timetables numbered by period: the student's period clock */
.imp-periods { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.imp-periods h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.imp-periods > .hint { margin: 4px 0 10px; }
.imp-periods-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.imp-periods-row .mini-field { width: 170px; }

/* ---- the film (welcome screen) ---- */
.film-btn { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 10px 16px 10px 10px; border: 1px solid var(--line, #E7E2F3); border-radius: 18px; background: rgba(255,255,255,.7); color: var(--ink, #1d1b2b); font: inherit; cursor: pointer; text-align: left; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.film-btn:hover { transform: translateY(-1px); }
.film-btn:focus-visible { outline: 3px solid var(--primary, #7C6CF2); outline-offset: 2px; }
.film-thumb { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #8F7CF7, #C77DBA); }
.film-text b { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.1; }
.film-text small { color: var(--ink-2, #6b6680); font-size: 13px; }
.film-btn-mobile { margin: 18px auto 0; }
@media (min-width: 900px) { .film-btn-mobile { display: none; } }
.film-modal { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: calc(var(--safe-top, 0px) + 16px) 16px calc(var(--safe-bottom, 0px) + 12px); background: rgba(10, 8, 18, .92); animation: film-in .2s ease; }
@keyframes film-in { from { opacity: 0; } }
.film-frame { position: relative; max-width: 100%; max-height: calc(100% - 48px); }
.film-modal video { display: block; max-width: 100%; max-height: calc(100dvh - 90px); border-radius: 18px; background: #07060b; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.film-wide video { width: min(1280px, 100%); aspect-ratio: 16 / 9; }
.film-vertical video { height: calc(100dvh - 90px); aspect-ratio: 9 / 16; width: auto; }
.film-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; cursor: pointer; }
.film-credits { max-width: 760px; margin: 0; color: rgba(255,255,255,.55); font-size: 11.5px; line-height: 1.4; text-align: center; }
body.film-open { overflow: hidden; }
