/* ===========================================================================
   Studee components.

   Built on the house classes, never beside them: the markup carries `yu-card`,
   `yu-btn`, `yu-label`, `yu-chip`, `yu-input`, `yu-empty`, and the Studee
   class next to it is a size or a state. Print headings (Unageo SemiBold,
   tracked tight), lavender hairlines, no doodles. Not one colour literal.
   =========================================================================== */

/* ------------------------------------------------------------- cards ---- */
.card { padding: clamp(18px, 2vw, 24px); position: relative; }
.stat-card { min-height: 150px; flex-direction: column; }
/* The first card of a row of figures leads: the palest lavender, the one
   tinted card on the screen (Prehľad, Dochádzka). */
.grid-stats > .card:first-child { background: var(--accent-card); }
.card.tint { background: var(--surface); border-color: transparent; box-shadow: none; }

.card-label { margin-bottom: 14px; }

/* why the schedule card is not showing today (weekend, day over, no teaching) */
.card-note {
  margin: -8px 0 14px;
  font-size: .8125rem;
  color: var(--muted);
}

/* "Zobraziť celý rozvrh →" closes every list panel: `.yu-more`, sentence case. */
.card-footer-link svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------- chips ---- */
/* `.yu-chip` is the pale pill. These are the tones Studee needs on top. */
.chip.mint, .chip.good { background: var(--mint-soft); color: var(--mint-ink); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.lav  { background: var(--lav-50); color: var(--purple-ink); }
.chip.now  { background: var(--purple-ink); color: var(--on-contrast); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.subst  { background: var(--subst-soft); color: var(--subst-ink); }
.chip.done-chip { background: var(--mint-soft); color: var(--mint-ink); gap: 4px; font-size: .6875rem; }
.chip.done-chip svg { width: 11px; height: 11px; }

/* the small squared subject tag: MAT / SJL / BIO (the house `.yu-tag`) */
.subject-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  border: var(--hairline);
  background: var(--lav-50);
  color: var(--purple-ink);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
  flex: none;
}
.subject-chip.alt { background: var(--mint-soft); color: var(--mint-ink); border-color: var(--mint); }

/* ----------------------------------------------------------- buttons ---- */
.btn { padding: 0 20px; min-height: 44px; }

.icon-btn {
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 auto;
  border-radius: 50%;
}
.icon-btn svg { max-width: 20px; max-height: 20px; }
.icon-btn:hover { color: var(--purple-ink); }
.icon-btn.on { background: var(--lav-50); color: var(--purple-ink); border-color: var(--lav-300); }

/* the small quiet pill that opens a detail */
.detail-btn {
  padding: 0 13px;
  min-height: 32px;
  font-size: .8125rem;
  color: var(--purple-ink);
  box-shadow: none;
}
.detail-btn:hover { background: var(--lav-50); color: var(--ink); box-shadow: none; }
.detail-btn.danger { color: var(--danger); }
.detail-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------ inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.field label:not(.yu-btn) {
  font-family: var(--font);
  font-size: .6875rem;
  font-weight: var(--w-ui);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--faint);
}
.field .hint { font-size: .75rem; color: var(--muted); }

/* --------------------------------------------------------- stat card ---- */
.stat-value {
  font-family: var(--head);
  font-weight: var(--w-head);
  font-size: clamp(1.9rem, 1.5rem + 1vw, 2.35rem);
  line-height: 1;
  letter-spacing: var(--track-display);
  font-variant-numeric: tabular-nums;
}
.stat-caption { font-size: .8125rem; color: var(--muted); margin-top: 8px; }
.stat-chip-row { margin-top: 14px; min-height: 26px; }
.stat-value.bad { color: var(--danger); }

.next-subject {
  font-family: var(--head);
  font-weight: var(--w-head);
  font-size: clamp(1.35rem, 1.15rem + .6vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: var(--track-head);
  color: var(--purple-ink);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.next-time { font-size: .8125rem; color: var(--ink); margin-top: 8px; }
.next-room { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------- next-lesson timer */
.lesson-timer {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: var(--hairline);
}
.lesson-timer[hidden] { display: none; }
.tm-label { display: block; font-size: .6875rem; font-weight: var(--w-ui); color: var(--muted); }
.tm-label b { font-family: var(--head); font-size: .9375rem; font-weight: var(--w-head); color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 4px; }
.tm-unit { font-size: .625rem; color: var(--faint); margin-left: 2px; }
.tm-bar {
  display: block;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  overflow: hidden;
  margin-top: 6px;
}
.tm-bar > span { display: block; height: 100%; background: var(--violet); border-radius: var(--r-pill); transition: width 0.9s linear; }

/* -------------------------------------------------------- lesson rows */
/* number · subject · time; the current one is pale lavender */
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  min-height: 50px;
  border-radius: var(--r-md);
  font-size: .875rem;
  width: 100%;
  text-align: left;
  transition: background var(--fast) var(--ease);
}
.lesson-row:hover { background: var(--lav-50); }
.lesson-row .num {
  order: 0;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  border: var(--hairline);
  background: var(--card);
  color: var(--purple-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: .875rem;
  font-weight: var(--w-head);
  font-variant-numeric: tabular-nums;
}
.lesson-row .time {
  order: 1;
  flex: 0 0 auto;
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 78px;
}
.lesson-row .lr-body { order: 2; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lesson-row .lr-meta { font-size: .6875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-row .lr-meta:empty { display: none; }
.grid-mid .lesson-row .lr-meta { display: none; }
.lesson-row .subj { font-family: var(--head); font-weight: var(--w-head); font-size: .9375rem; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-row .check { order: 3; color: var(--mint-ink); display: flex; }
.lesson-row .check svg { width: 22px; height: 22px; }
.lesson-row .chip { order: 3; }
.lesson-row.done .subj, .lesson-row.done .time { color: var(--muted); }
.lesson-row.now { background: var(--lav-50); box-shadow: inset 0 0 0 1px var(--line-card); }
.lesson-row.now .num { background: var(--purple-ink); color: var(--on-contrast); border-color: var(--purple-ink); }
.lesson-row.now .subj { color: var(--purple-ink); }
.lesson-row.cancelled { background: var(--danger-soft); }
.lesson-row.cancelled .subj { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--ink); }
.lesson-row.subst { background: var(--subst-soft); }
.lesson-row.subst .num { border-color: var(--subst); color: var(--subst-ink); }
.lesson-row.changed { background: var(--surface); }

/* --------------------------------------------------------- task rows */
.task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  min-height: 56px;
  width: 100%;
  text-align: left;
}
.task-row.clickable, .ann-row.clickable { border-radius: var(--r-sm); }
.task-row.clickable:hover, .ann-row.clickable:hover { background: var(--lav-50); }
.task-row + .task-row { border-top: var(--hairline); }
.task-row .t-title { flex: 1 1 0; font-family: var(--head); font-weight: var(--w-head); font-size: .9375rem; letter-spacing: -.01em; line-height: 1.35; min-width: 0; }
.task-row .t-due { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.task-row .t-due.past { color: var(--danger); font-weight: 600; }
.task-row.done { opacity: 0.7; }
.task-row.done .t-title { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.task-row.done .subject-chip { opacity: 0.7; }
.task-row.done .t-due { text-decoration: line-through; }
/* the house checkbox shape: a rounded box, mint with a tick when done */
.task-check {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  border: 1.5px solid var(--lav-300);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: var(--card);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.task-check:hover { border-color: var(--violet); }
.task-check.on { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-ink); }

/* ------------------------------------------------------ announcement */
.ann-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 4px;
  width: 100%;
  text-align: left;
}
.ann-row .dot {
  flex: 0 0 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, var(--violet));
  transform: translateY(-2px);
}
.ann-row .a-cancel { font-size: .625rem; padding: 3px 8px; align-self: center; }
.ann-row.is-cancelled .a-title { text-decoration: line-through; text-decoration-color: var(--danger); text-decoration-thickness: 1.5px; color: var(--ink); opacity: .8; }
.ann-row .a-title { flex: 1 1 0; font-family: var(--head); font-weight: var(--w-head); font-size: .9375rem; letter-spacing: -.01em; line-height: 1.35; min-width: 0; }
.ann-row .a-date { font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------- grade pills */
.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--r-md);
  border: var(--hairline);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-family: var(--head);
  font-weight: var(--w-head);
  font-size: .875rem;
  letter-spacing: -.01em;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  overflow-wrap: anywhere;
}
.grade-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: .9375rem;
  font-weight: var(--w-head);
  font-variant-numeric: tabular-nums;
  border: var(--hairline);
  background: var(--surface);
  color: var(--ink);
  flex: none;
}
.grade-badge.g1 { background: var(--mint-soft); border-color: var(--mint); color: var(--mint-ink); }
.grade-badge.g2 { background: var(--lav-50); border-color: var(--lav-300); color: var(--purple-ink); }
.grade-badge.g3 { background: var(--surface); }
.grade-badge.g4 { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-ink); }
.grade-badge.g5 { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.grade-pill-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 0; }

/* -------------------------------------------------------- alert box */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--danger-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 12px 0;
  color: var(--ink);
}
.alert-box .ab-icon {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 600;
}
.alert-box .ab-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-box b { font-size: .8125rem; font-weight: 600; color: var(--danger); }
.alert-box span { font-size: .75rem; color: var(--muted); }

.label-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--card);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: text-bottom;
  cursor: help;
}
/* A card the backend flagged (a weak average, unexcused hours): its hairline
   turns the danger colour. The label carries the "!" and the reason. */
.card.has-alert { border-color: var(--danger); }

/* ---------------------------------------------------- lesson detail */
.lesson-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lesson-detail-head .num {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 50%;
  border: var(--hairline);
  background: var(--lav-50);
  color: var(--purple-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: 1.125rem;
  font-weight: var(--w-head);
}
.lesson-detail-head.cancelled .num { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.lesson-detail-head.subst .num { background: var(--subst-soft); border-color: var(--subst); color: var(--subst-ink); }
.lesson-change {
  background: var(--subst-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: .8125rem;
}
.lesson-change.cancelled { background: var(--danger-soft); }
.lesson-change b { font-weight: 600; }
.lesson-change ul { margin: 5px 0 0; padding-left: 17px; }
.lesson-change li { margin-top: 2px; }
.lesson-change s { color: var(--muted); }

/* ------------------------------------------------------------- misc */
.empty-state { font-size: .875rem; }
.empty-state.is-mini { padding: 14px 10px; }
.empty-state.is-mini .yu-empty__title { font-size: 1.125rem; }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--surface) 40%, var(--lav-50) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  min-height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* A toast: paper, a hairline, a purple dot (the house `.yu-toast`), centred
   above the tab bar. */
.toast {
  position: fixed;
  bottom: calc(22px + var(--tabbar-space));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  max-width: min(calc(100% - 24px), 480px);
  padding: 12px 18px;
  background: var(--card);
  color: var(--ink);
  border: var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-hover);
  font-size: .875rem;
  line-height: 1.5;
  z-index: 100;
  animation: toast-in 0.2s var(--ease);
}
.toast::before { content: ''; flex: none; width: 9px; height: 9px; margin-top: .45em; border-radius: 50%; background: var(--violet); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ------------------------------------------------------------- modal */
/* The house `.yu-modal`: paper, a hairline, the lift shadow, a sticky head. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
  animation: fade-in 0.15s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } }
.modal-card {
  width: min(480px, 100%);
  max-height: min(82dvh, 680px);
  overflow-y: auto;
  background: var(--card);
  border: var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lift);
  padding: 0 24px 24px;
  animation: pop-in 0.18s var(--ease);
}
@keyframes pop-in { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
.modal-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -24px 16px;
  padding: 14px 18px 14px 24px;
  background: var(--card);
  border-bottom: var(--hairline);
}
/* Titles, links and file names from EduPage can be one long unbroken word;
   they wrap inside the card instead of making it scroll sideways. */
.modal-body { overflow-wrap: anywhere; }

.detail-row { display: flex; gap: 12px; padding: 9px 2px; border-top: var(--hairline); font-size: .875rem; }
.detail-row:first-of-type { border-top: 0; }
.detail-row .d-label { flex: 0 0 110px; color: var(--faint); font-size: .6875rem; text-transform: uppercase; letter-spacing: var(--track); font-weight: var(--w-ui); padding-top: 3px; }
.detail-row .d-value { flex: 1; min-width: 0; font-weight: var(--w-ui); }
.detail-note { margin-top: 12px; background: var(--lav-50); border-radius: var(--r-md); padding: 12px 14px; font-size: .9375rem; }
.detail-text { font-size: .875rem; white-space: pre-wrap; background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; overflow-wrap: anywhere; }
.detail-att {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: var(--hairline);
  border-radius: var(--r-md);
  background: var(--card);
  font-size: .8125rem;
  margin-top: 6px;
  color: var(--purple-ink);
}
.detail-att:hover { border-color: var(--lav-300); background: var(--lav-50); }
.detail-hint { font-size: .75rem; color: var(--muted); margin-top: 16px; }

.grade-detail-head, .task-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
:is(.grade-detail-head, .task-detail-head, .lesson-detail-head) > * { min-width: 0; }
.gd-title { font-family: var(--head); font-weight: var(--w-head); font-size: 1.25rem; line-height: 1.25; letter-spacing: var(--track-head); }
.gd-subject { font-size: .8125rem; color: var(--muted); }
.grade-badge.big { width: 48px; height: 48px; font-size: 1.375rem; flex: 0 0 48px; }

.grade-pill.clickable { cursor: pointer; transition: border-color var(--fast) var(--ease), box-shadow var(--slow) var(--ease); }
.grade-pill.clickable:hover { border-color: var(--lav-300); box-shadow: var(--shadow-hover); }
.g-chip.clickable { cursor: pointer; }
.g-chip.clickable:hover { border-color: var(--lav-300); background: var(--lav-50); }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sync-btn svg { transform-origin: 50% 50%; }
.sync-btn.busy { color: var(--purple-ink); }
.sync-btn.busy svg { animation: spin 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .sync-btn.busy svg { animation: none; opacity: 0.55; }
}

/* -------------------------------------------- filters and tabs ---- */
/* Every filter row (subjects, categories, school years) is the house
   tab: sentence case, a pill, the current one pale lavender with a hairline
   and purple text, a count in a small pill. */
.filter-chip, .year-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font-size: .875rem;
  font-weight: var(--w-ui);
  white-space: nowrap;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.filter-chip:hover, .year-chip:hover { background: var(--lav-50); color: var(--ink); }
.filter-chip.active, .year-chip.active { background: var(--lav-50); border-color: var(--line-card); color: var(--purple-ink); }

/* ---------------------------------------------- school-year switcher */
.year-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 0 2px 16px; }
.year-row-label { font-size: .6875rem; font-weight: var(--w-ui); letter-spacing: var(--track); text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.year-badge {
  font-size: .75rem;
  font-weight: var(--w-ui);
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  white-space: nowrap;
}

/* ------------------------------------------- previous-year archive */
.archive-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 4px 0;
  min-height: 38px;
  font-size: .8125rem;
  font-weight: var(--w-ui);
  color: var(--purple-ink);
}
.archive-toggle:hover { color: var(--ink); }
.task-group-label.past-year { color: var(--faint); }
.card.is-archive { background: var(--surface); border-color: transparent; box-shadow: none; }
.archive-empty { font-size: .8125rem; color: var(--muted); padding: 8px 2px; }

/* --------------------------------------------- dashboard arrangement */
.layout-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: var(--hairline); }
.layout-row:last-child { border-bottom: none; }
.lr-name { flex: 1 1 auto; font-size: .875rem; font-weight: var(--w-ui); }
.lr-name.muted { color: var(--muted); font-weight: 400; }
.layout-row .icon-btn { width: 32px; height: 32px; min-height: 32px; flex: 0 0 32px; box-shadow: none; }

/* ----------------------------------------------------- notifications */
.push-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-icon { color: var(--violet); display: flex; }
.push-state { flex: 1 1 160px; font-size: .8125rem; color: var(--muted); }
