/* Semester Companion. Hebrew, RTL, phone first. Logical properties only, so the layout mirrors by itself.
   Material: one fixed "sky" of soft light, tinted by the courses with the largest gap, and glass panels over it.
   Only panels blur. Anything inside a panel is a flat tint, because glass on glass loses legibility. */

@font-face {
  font-family: Rubik;
  src: url("/fonts/rubik-hebrew-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: Rubik;
  src: url("/fonts/rubik-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #dfecec;
  --ink: #10242b;
  --muted: #41555d;
  --line: rgb(16 36 43 / 0.11);
  --accent: #0b6e66;
  --accent-ink: #ffffff;
  --accent-soft: rgb(11 110 102 / 0.13);
  --fill: rgb(255 255 255 / 0.55);
  --glass: rgb(255 255 255 / 0.56);
  --glass-thick: rgb(255 255 255 / 0.66);
  --glass-solid: #f3f8f8;
  --glass-edge: rgb(255 255 255 / 0.8);
  --glass-blur: blur(22px) saturate(170%);
  --glass-shadow: 0 1px 2px rgb(16 50 56 / 0.06), 0 14px 34px -14px rgb(16 50 56 / 0.28);
  --sky-strength: 50%;
  --sky-1: #2fb5a6;
  --sky-2: #5a9be6;
  --sky-3: #8fd3c0;
  --warn: #7f4800;
  --warn-bg: rgb(240 170 50 / 0.24);
  --bad: #a3271c;
  --bad-bg: rgb(214 70 50 / 0.15);
  --ok: #166339;
  --ok-bg: rgb(30 150 90 / 0.16);
  --mark-closed: #0d7a70;
  --mark-gap: #c8402f;
  --mark-upcoming: rgb(16 36 43 / 0.14);
  --mix-0: #2a78d6;
  --mix-1: #eb6834;
  --mix-2: #1baf7a;
  --mix-3: #eda100;
  --mix-4: #e87ba4;
  --radius: 20px;
  --radius-small: 12px;
  --tabs-h: 3.75rem;
  --gutter: 16px;
}

:root:not([data-theme="light"]) {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c2a30;
    --ink: #eaf3f2;
    --muted: #a8bdc1;
    --line: rgb(255 255 255 / 0.11);
    --accent: #5fd0c3;
    --accent-ink: #052320;
    --accent-soft: rgb(95 208 195 / 0.15);
    --fill: rgb(255 255 255 / 0.08);
    --glass: rgb(20 50 57 / 0.55);
    --glass-thick: rgb(20 50 57 / 0.68);
    --glass-solid: #17333a;
    --glass-edge: rgb(255 255 255 / 0.16);
    --glass-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 36px -14px rgb(0 0 0 / 0.55);
    --sky-strength: 42%;
    --warn: #f3c06a;
    --warn-bg: rgb(240 185 90 / 0.15);
    --bad: #ffa597;
    --bad-bg: rgb(255 130 110 / 0.15);
    --ok: #86d9a9;
    --ok-bg: rgb(120 210 160 / 0.14);
    --mark-closed: #53c5b9;
    --mark-gap: #ff8f7e;
    --mark-upcoming: rgb(255 255 255 / 0.16);
    --mix-0: #3987e5;
    --mix-1: #d95926;
    --mix-2: #199e70;
    --mix-3: #c98500;
    --mix-4: #d55181;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c2a30;
  --ink: #eaf3f2;
  --muted: #a8bdc1;
  --line: rgb(255 255 255 / 0.11);
  --accent: #5fd0c3;
  --accent-ink: #052320;
  --accent-soft: rgb(95 208 195 / 0.15);
  --fill: rgb(255 255 255 / 0.08);
  --glass: rgb(20 50 57 / 0.55);
  --glass-thick: rgb(20 50 57 / 0.68);
  --glass-solid: #17333a;
  --glass-edge: rgb(255 255 255 / 0.16);
  --glass-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 36px -14px rgb(0 0 0 / 0.55);
  --sky-strength: 42%;
  --warn: #f3c06a;
  --warn-bg: rgb(240 185 90 / 0.15);
  --bad: #ffa597;
  --bad-bg: rgb(255 130 110 / 0.15);
  --ok: #86d9a9;
  --ok-bg: rgb(120 210 160 / 0.14);
  --mark-closed: #53c5b9;
  --mark-gap: #ff8f7e;
  --mark-upcoming: rgb(255 255 255 / 0.16);
  --mix-0: #3987e5;
  --mix-1: #d95926;
  --mix-2: #199e70;
  --mix-3: #c98500;
  --mix-4: #d55181;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-block-start: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Rubik, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

body:not(.bare) {
  padding-block-end: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 28px);
}

/* A fixed layer, still on purpose: nothing behind the content moves. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70vmax 56vmax at 92% -8%, color-mix(in oklab, var(--sky-1) var(--sky-strength), transparent), transparent 72%),
    radial-gradient(62vmax 52vmax at 2% 30%, color-mix(in oklab, var(--sky-2) var(--sky-strength), transparent), transparent 72%),
    radial-gradient(72vmax 56vmax at 70% 108%, color-mix(in oklab, var(--sky-3) var(--sky-strength), transparent), transparent 72%),
    var(--bg);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  flex: none;
  inline-size: 1.15em;
  block-size: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Material */

.panel,
.card,
.rows,
.group,
.tiles,
.hero,
.topbar,
.tabs,
.course-card,
.tip {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow);
}

.panel,
.card,
.rows,
.group,
.tiles,
.course-card {
  border-radius: var(--radius);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel,
  .card,
  .rows,
  .group,
  .tiles,
  .hero,
  .topbar,
  .tabs,
  .course-card,
  .tip {
    background: var(--glass-solid);
  }
}

/* Chrome */

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px var(--gutter);
  padding-block-start: calc(6px + env(safe-area-inset-top));
  box-shadow: inset 0 -1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand .icon {
  color: var(--accent);
  inline-size: 1.4em;
  block-size: 1.4em;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 8px;
  min-height: 44px;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.tabs {
  position: fixed;
  inset-inline: 10px;
  inset-block-end: calc(10px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  gap: 2px;
  block-size: var(--tabs-h);
  max-inline-size: 34rem;
  margin-inline: auto;
  padding: 5px;
  border-radius: 26px;
  background: var(--glass-thick);
}

.tabs a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-inline-size: 0;
  border-radius: 21px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.tabs a .icon {
  inline-size: 1.4rem;
  block-size: 1.4rem;
}

.tabs a:active {
  background: var(--accent-soft);
}

.tabs a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

main {
  max-width: 44rem;
  margin-inline: auto;
  padding: 18px var(--gutter) 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

/* From here the bottom bar gives way to a side rail, and the brand and sign-out sit in it. */
@media (min-width: 1024px) {
  body:not(.bare) {
    padding-block-end: 0;
    padding-inline-start: 15rem;
  }

  .topbar {
    position: fixed;
    inset-block: 16px;
    inset-inline: 16px auto;
    z-index: 11;
    inline-size: 13rem;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 16px 10px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    pointer-events: none;
  }

  .topbar > * {
    pointer-events: auto;
  }

  .tabs {
    inset-block: 16px;
    inset-inline: 16px auto;
    inline-size: 13rem;
    block-size: auto;
    margin: 0;
    flex-direction: column;
    gap: 4px;
    padding: 4.25rem 10px 10px;
    border-radius: 26px;
  }

  .tabs a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.7rem;
    min-block-size: 46px;
    padding-inline: 12px;
    border-radius: 14px;
    font-size: 1rem;
  }

  .tabs a .icon {
    inline-size: 1.25rem;
    block-size: 1.25rem;
  }

  main {
    max-width: 62rem;
    padding: 32px 28px;
  }

  .site-foot {
    max-width: 62rem;
    padding-inline: 28px;
  }
}

/* Shared pieces */

.muted {
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.dot {
  display: inline-block;
  inline-size: 0.7rem;
  block-size: 0.7rem;
  margin-inline-end: 0.5rem;
  border-radius: 50%;
  flex: none;
}

.dot-large {
  inline-size: 0.85rem;
  block-size: 0.85rem;
}

.badge {
  display: inline-block;
  min-inline-size: 1.6rem;
  padding: 0 0.5rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
}

.block > h2.sub {
  font-size: 0.95rem;
  color: var(--muted);
}

.with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.with-icon .icon {
  color: var(--accent);
}

.page-head {
  display: grid;
  gap: 4px;
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
}

.card-now {
  background: color-mix(in oklab, var(--accent) 16%, var(--glass));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 40px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flag {
  color: var(--warn);
  font-weight: 600;
}

.notice {
  display: grid;
  gap: 10px;
  padding-block: 24px;
}

.dash,
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dash:empty,
.stack:empty {
  display: none;
}

@media (min-width: 1024px) {
  .dash {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .dash + .dash {
    align-items: start;
  }

  .dash > :only-child {
    grid-column: 1 / -1;
  }
}

/* Install and notifications */

[hidden] {
  display: none !important;
}

.push-prompt {
  margin: 0;
  padding: 10px var(--gutter);
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 600;
  text-align: center;
}

.push-prompt a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
}

.site-foot {
  max-width: 44rem;
  margin-inline: auto;
  padding: 0 var(--gutter) 24px;
  font-size: 0.92rem;
}

.site-foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 10px;
  color: var(--muted);
}

.steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-inline-start: 1.4rem;
}

/* Buttons. Feedback lands on the press, not the release. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-block-size: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease-out;
}

.btn:active:not(:disabled),
.pill:active,
.chip:active {
  transform: scale(0.97);
  transition-duration: 0ms;
}

.btn-primary {
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
  color: var(--accent-ink);
}

.btn-quiet {
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-small {
  min-block-size: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Home: the gap */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: 28px;
  background: var(--glass-thick);
}

.hero-label {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 16px;
}

.hero-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  inline-size: 100%;
}

.ring-wrap {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: min(13.5rem, 64vw);
  aspect-ratio: 1;
}

.ring {
  grid-area: 1 / 1;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
  rotate: -90deg;
}

.ring circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.ring-track {
  stroke: var(--mark-upcoming);
  opacity: 0.45;
}

.ring-arc {
  animation: ring-in 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ring-closed {
  stroke: var(--mark-closed);
}

.ring-rest {
  stroke: var(--muted);
}

/* The one moment of motion nobody asked for: the ring draws itself in when home opens. */
@keyframes ring-in {
  from {
    stroke-dasharray: 0 var(--ring-length);
  }
}

.ring-center {
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.ring-center > .icon {
  inline-size: 4.5rem;
  block-size: 4.5rem;
  color: var(--mark-closed);
  stroke-width: 2.4;
}

.hero-count {
  max-inline-size: 8.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.25;
}

.num {
  color: var(--ink);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
}

.hero-hours {
  color: var(--ink);
  font-size: 1.1rem;
}

.hero-hours strong {
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-block-size: 40px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.chip b {
  margin-inline-start: 0.5rem;
  font-weight: 700;
}

.hero-oldest {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-oldest .icon {
  margin-inline-end: 0.3rem;
  vertical-align: -0.2em;
}

.hero-link {
  font-size: 0.92rem;
  font-weight: 500;
}

.hero-clear {
  background: color-mix(in oklab, var(--accent) 14%, var(--glass-thick));
}

.hero-clear .ring-wrap {
  inline-size: min(10rem, 50vw);
}

.hero-clear-text {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (min-width: 520px) and (max-width: 1023px) {
  .hero-main {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
  }
}

/* Charts. Thin marks, a 2px gap between fills, and text in text colors, never the series color. */

.chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend b {
  color: var(--ink);
  font-weight: 600;
}

.swatch {
  flex: none;
  inline-size: 0.7rem;
  block-size: 0.7rem;
  border-radius: 3px;
}

.seg {
  display: block;
  flex: 1 1 0;
  min-inline-size: 3px;
  min-block-size: 2px;
}

.seg-closed,
.swatch-closed {
  background: var(--mark-closed);
}

.seg-gap,
.swatch-gap {
  background: var(--mark-gap);
}

.seg-upcoming,
.swatch-upcoming {
  background: var(--mark-upcoming);
}

.seg-load {
  background: var(--accent);
}

.mix-0 { background: var(--mix-0); }
.mix-1 { background: var(--mix-1); }
.mix-2 { background: var(--mix-2); }
.mix-3 { background: var(--mix-3); }
.mix-4 { background: var(--mix-4); }

.plot {
  position: relative;
  border-block-end: 1px solid var(--line);
}

.plot-peak {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
}

.bars {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plot .bars {
  padding-inline-end: 1.1rem;
  margin-block-end: -1px;
}

.bar {
  flex: 1 1 0;
  min-inline-size: 0;
  border-radius: 6px;
}

.bar > a {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  block-size: 7.5rem;
}

.bars-days .bar-track {
  block-size: 5rem;
  border-block-end: 1px solid var(--line);
}

.bar-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  inline-size: min(100%, 1.5rem);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}

.bar-label {
  display: block;
  padding-block-start: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plot .bar-label {
  padding-block-end: 4px;
}

.bar-today .bar-label {
  color: var(--ink);
  font-weight: 700;
}

.bars-days .bar:not(.bar-today) .seg-load {
  background: color-mix(in oklab, var(--accent) 45%, transparent);
}

.meter {
  display: flex;
  gap: 2px;
  block-size: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.meter-mix {
  block-size: 12px;
  border-radius: 6px;
}

.hbars {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hbars a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name value" "track track";
  gap: 3px 12px;
  align-items: baseline;
  padding-block: 6px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}

.hbar-name {
  grid-area: name;
  font-weight: 500;
}

.hbar-value {
  grid-area: value;
  color: var(--muted);
  font-size: 0.92rem;
}

.hbar-track {
  grid-area: track;
  display: block;
}

.hbar-track i {
  display: block;
  min-inline-size: 6px;
  block-size: 8px;
  border-radius: 4px;
}

.trend {
  display: block;
  inline-size: 100%;
  max-inline-size: 30rem;
  block-size: auto;
  overflow: visible;
}

.grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.grid-label {
  fill: var(--muted);
  font-size: 11px;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: var(--accent);
  stroke: var(--glass-solid);
  stroke-width: 2;
}

.trend-hit {
  fill: transparent;
}

.as-table summary {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.as-table table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.as-table th,
.as-table td {
  padding: 4px 6px;
  border-block-end: 1px solid var(--line);
  font-weight: 400;
  text-align: start;
}

.as-table thead th {
  color: var(--muted);
}

.tip {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 20;
  max-inline-size: 16rem;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--glass-thick);
  font-size: 0.85rem;
  line-height: 1.35;
  pointer-events: none;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.tiles > div {
  display: grid;
  gap: 2px;
  padding: 14px 12px;
}

.tiles > div + div {
  border-inline-start: 1px solid var(--line);
}

.tiles dt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.tiles dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.tile-bad dt,
.tile-bad dd {
  color: var(--bad);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  block-size: 100%;
  align-content: start;
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 120ms ease-out;
}

.course-card:active {
  transform: scale(0.985);
  transition-duration: 0ms;
}

.course-stats {
  gap: 20px;
}

/* Lists: one sheet of glass per list, rows separated by a hairline. */

.rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
}

.row + .row {
  border-block-start: 1px solid var(--line);
}

.row-icon {
  display: inline-flex;
  flex: none;
  margin-block-start: 3px;
  color: var(--muted);
}

.row.status-awaiting_checkin .row-icon {
  color: var(--warn);
}

.row.status-open .row-icon {
  color: var(--bad);
}

.row-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  flex: 1;
  min-inline-size: 0;
}

.row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.row-title > .icon {
  margin-inline-end: 0.45rem;
  color: var(--muted);
}

.row-title a {
  color: inherit;
  text-decoration: none;
}

.row-title .muted {
  margin-inline-start: 0.5rem;
  font-weight: 400;
}

.question {
  margin-block-start: 4px;
  font-weight: 600;
}

.row .actions {
  margin-block-start: 4px;
}

.pick {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: 16px;
}

.select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  flex-basis: 100%;
}

.bulkbar .btn {
  flex: 1 1 8rem;
}

.select-all input {
  inline-size: 22px;
  block-size: 22px;
  accent-color: var(--accent);
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-head h2 {
  display: flex;
  align-items: center;
  gap: 0;
}

.group-head h2.with-icon {
  gap: 0.5rem;
}

.group-head .badge {
  margin-inline-start: 0.5rem;
}

/* Week */

.week-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-block-start: 8px;
}

.week-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-block-size: 44px;
  font-weight: 600;
  text-decoration: none;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 20px 16px;
  align-items: start;
}

.day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-content: start;
}

.day h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--muted);
}

.day-today h2 {
  color: var(--ink);
}

.empty {
  font-size: 0.92rem;
}

.marker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 8px 12px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--radius-small);
  font-size: 0.92rem;
}

.group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.slot {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "time tag" "body body";
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
}

.slot + .slot {
  border-block-start: 1px solid var(--line);
}

.slot:first-child {
  border-start-start-radius: var(--radius);
  border-start-end-radius: var(--radius);
}

.slot:last-child {
  border-end-start-radius: var(--radius);
  border-end-end-radius: var(--radius);
}

.slot:active {
  background: var(--accent-soft);
}

.slot-time {
  grid-area: time;
  font-weight: 700;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.slot-body {
  display: grid;
  grid-area: body;
  min-inline-size: 0;
}

.slot-body .row-title {
  font-size: 1rem;
}

.status-tag {
  grid-area: tag;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--fill);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-tag.status-awaiting_checkin {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-tag.status-open {
  background: var(--bad-bg);
  color: var(--bad);
}

.status-tag.status-closed {
  background: var(--ok-bg);
  color: var(--ok);
}

.slot.status-cancelled {
  opacity: 0.7;
}

.slot.status-cancelled .row-title {
  text-decoration: line-through;
}

/* Session page */

.details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.details > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 8px;
  align-items: baseline;
}

.details dt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.details dd {
  margin: 0;
}

/* Login */

.bare main {
  min-block-size: 100dvh;
  align-content: center;
}

.login {
  display: grid;
  justify-items: stretch;
  gap: 8px;
  max-inline-size: 26rem;
  inline-size: 100%;
  margin-inline: auto;
  padding: 28px 24px;
  border-radius: 28px;
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow);
}

.login-mark .icon {
  inline-size: 3rem;
  block-size: 3rem;
  color: var(--accent);
  stroke-width: 1.6;
}

.login-brand {
  font-size: 2rem;
}

.login-form {
  display: grid;
  gap: 8px;
  margin-block-start: 16px;
}

.login-form label {
  font-weight: 600;
}

.login-form input {
  min-block-size: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
}

.form-error {
  color: var(--bad);
  font-weight: 600;
}

bdi {
  white-space: nowrap;
}

/* Forms: reflection, follow-ups, assignments */

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.form-inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.field {
  display: grid;
  gap: 4px;
  font-weight: 500;
}

.field-grow {
  min-inline-size: 0;
}

.field input,
.field select,
.field textarea {
  inline-size: 100%;
  min-block-size: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.field textarea {
  resize: vertical;
}

@media (min-width: 720px) {
  .form-pairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}

.rating {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.rating legend {
  padding: 0;
  margin-block-end: 4px;
  font-weight: 500;
}

.rating-option input {
  position: absolute;
  opacity: 0;
}

.rating-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 48px;
  min-block-size: 48px;
  border-radius: 14px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700;
  cursor: pointer;
}

.rating-option input:checked + span {
  background: var(--accent);
  box-shadow: none;
  color: var(--accent-ink);
}

.rating-option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.followup,
.assignment {
  align-items: flex-start;
  justify-content: space-between;
}

.followup-done p,
.assignment-done .row-title {
  color: var(--muted);
  text-decoration: line-through;
}

.edit {
  margin-block-start: 4px;
}

.edit summary {
  min-block-size: 40px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.edit .form {
  padding-block: 8px;
}

/* Settings and sync health */

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  min-block-size: 44px;
  font-weight: 500;
  cursor: pointer;
}

.switch input {
  position: relative;
  flex: none;
  appearance: none;
  inline-size: 46px;
  block-size: 28px;
  margin: 0;
  border-radius: 99px;
  background: var(--mark-upcoming);
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.switch input::after {
  content: "";
  position: absolute;
  inset-block-start: 2px;
  inset-inline-start: 2px;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: inset-inline-start 160ms ease-out;
}

.switch input:checked {
  background: var(--mark-closed);
}

.switch input:checked::after {
  inset-inline-start: 20px;
}

.settings-note-bad {
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 600;
}

.sync-banner {
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 600;
}

.sync-banner a {
  color: inherit;
}

/* Page changes cross-fade and the bar stays put, so a tab reads as one place, not a reload. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-group(root) {
    animation-duration: 160ms;
  }

  .tabs {
    view-transition-name: tabs;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .panel,
  .card,
  .rows,
  .group,
  .tiles,
  .hero,
  .topbar,
  .tabs,
  .course-card,
  .tip,
  .login {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .sky {
    background: var(--bg);
  }

  @media (min-width: 1024px) {
    .topbar {
      background: none;
    }
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: currentColor;
    --muted: var(--ink);
  }

  .panel,
  .card,
  .rows,
  .group,
  .tiles,
  .hero,
  .tabs,
  .course-card,
  .tip,
  .login {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: inset 0 0 0 1px var(--ink);
  }
}

@media (forced-colors: active) {
  .seg,
  .swatch,
  .hbar-track i,
  .dot {
    forced-color-adjust: none;
  }

  .ring circle {
    stroke: CanvasText;
  }

  .tabs a[aria-current="page"] {
    outline: 2px solid Highlight;
  }
}
