/*
 * Mockup 5, Season. Habits and the company challenge first.
 * One bold element: the day of the season. Everything else is quiet.
 * A season is ten weeks of seven days; rulers, ribbons and calendars all keep that grouping.
 */

:root {
  --kept: var(--status-good);
  --gutter: 16px;
  --header-h: 60px;
  --day-gap: 2px;
  --week-gap: 6px;
  --today-w: 32px;
  --cell-h: 32px;
}

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main.wrap {
  flex: 1;
  padding-block: 24px 56px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: calc(var(--switcher-h, 0px) + 8px);
  z-index: 60;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-weight: var(--weight-semibold);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 50;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  min-height: var(--header-h);
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-gradient);
}

.brand-mark svg {
  fill: var(--surface);
}

.site-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--wash);
}

.site-nav a[aria-current='page'] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: var(--weight-semibold);
}

@media (min-width: 720px) {
  .site-header {
    position: sticky;
    top: var(--switcher-h, 0px);
  }
}

@media (max-width: 719px) {
  .header-inner {
    padding-block: 6px 4px;
  }
  .site-nav {
    width: 100%;
    margin-left: -8px;
    justify-content: space-between;
  }
  .site-nav a {
    padding: 8px 9px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 16px;
}

.sample-line {
  font-size: var(--text-small);
  color: var(--caution-ink);
}

/* ---------- Shared type and controls ---------- */

.page-title {
  font-size: var(--text-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 1.04;
  text-wrap: balance;
}

.lead {
  max-width: 62ch;
  margin-top: 10px;
  font-size: var(--text-lead);
  color: var(--ink-2);
}

.page-head {
  margin-bottom: 24px;
}

.panel-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
  letter-spacing: -0.012em;
}

.panel-sub {
  margin-top: 2px;
  font-size: var(--text-control);
  color: var(--muted);
}

.section-title {
  margin: 32px 0 12px;
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
}

.mini-h {
  margin: 18px 0 6px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.side-h {
  margin: 18px 0 8px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.muted-s {
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--muted);
}

h1[tabindex],
h2[tabindex],
h3[tabindex] {
  outline-offset: 4px;
}

h1[tabindex]:focus:not(:focus-visible),
h2[tabindex]:focus:not(:focus-visible),
h3[tabindex]:focus:not(:focus-visible) {
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--axis);
  box-shadow: var(--shadow-soft);
}

.btn.primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--surface);
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--accent-strong) 86%, var(--ink));
}

.btn.sm {
  min-height: 36px;
  padding: 6px 14px;
}

.btn.wide {
  width: 100%;
  margin-top: 18px;
}

.btn:disabled {
  cursor: default;
  color: var(--muted);
  background: var(--wash);
  border-color: var(--line);
}

.ic {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link,
.link-btn {
  color: var(--accent-strong);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.link-btn {
  min-height: 40px;
  padding: 0 2px;
  border: 0;
  background: none;
  font-size: var(--text-control);
}

.link:hover,
.link-btn:hover {
  text-decoration-thickness: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tier-c) 16%, var(--surface));
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.tier::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tier-c);
}

.tier.try,
.tier-word.try {
  --tier-c: var(--status-good);
}

.tier.maybe,
.tier-word.maybe {
  --tier-c: var(--series-4);
}

.tier.skip,
.tier-word.skip {
  --tier-c: var(--status-critical);
}

.effort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
  white-space: nowrap;
}

.effort-dots {
  display: inline-flex;
  gap: 2px;
}

.effort-dots i {
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: var(--line-strong);
}

.effort-dots i.on {
  background: var(--ink-2);
}

.tag-pop {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--violet);
}

.tag-real,
.tag-sample,
.tag-new,
.tag-q {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.tag-real {
  margin-right: 8px;
  background: color-mix(in srgb, var(--status-good) 16%, var(--surface));
  color: var(--ink);
}

.tag-sample {
  background: color-mix(in srgb, var(--status-warning) 26%, var(--surface));
  color: var(--caution-ink);
}

.tag-new {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag-q {
  background: var(--wash);
  color: var(--ink-2);
}

.in-season {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kept) 14%, var(--surface));
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
}

.in-season .ic {
  stroke: var(--kept);
  stroke-width: 2.5;
}

/* Evidence ring: science, so accent blue */
.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
}

.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-val {
  fill: none;
  stroke-width: 4;
}

.ring-track {
  stroke: var(--accent-soft);
}

.ring-val {
  stroke: var(--accent);
  stroke-linecap: round;
}

.ring b {
  position: relative;
  font-size: calc(var(--size) * 0.32);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* People-say bar: positive, mixed, negative */
.pbar {
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
}

.pbar i {
  display: block;
  height: 100%;
}

.pbar .pos,
.k.pos::before,
.stance.positive::before {
  background: var(--status-good);
}

.pbar .mix,
.k.mix::before,
.stance.mixed::before {
  background: var(--series-4);
}

.pbar .neg,
.k.neg::before,
.stance.negative::before {
  background: var(--status-critical);
}

.pbar-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--ink-2);
}

.k,
.stance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.k::before,
.stance::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* ---------- #home: the season band ---------- */

.season-band {
  padding: clamp(20px, 3.2vw, 36px);
}

.band-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 48px;
}

.band-org {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.org-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: var(--weight-strong);
}

.band-season {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.day-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 14px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.day-num {
  font-size: calc(var(--text-display) * 1.45);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 0.92;
}

.day-of {
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--muted);
}

.band-sub {
  margin-top: 10px;
  color: var(--ink-2);
}

.band-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 0 clamp(20px, 3vw, 44px);
}

.stat {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.stat dt {
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.stat-num {
  font-size: var(--text-stat);
  font-weight: var(--weight-strong);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-sub {
  max-width: 17ch;
  font-size: var(--text-small);
  line-height: 1.35;
  color: var(--muted);
}

/* The ruler: 70 segments in ten weeks */
.ruler-wrap {
  margin-top: 30px;
}

.ruler {
  display: flex;
  align-items: flex-end;
  gap: var(--week-gap);
  height: 60px;
  padding-top: 24px;
}

.r-week {
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.r-day {
  position: relative;
  font-style: normal;
  flex: 1 1 0;
  min-width: 0;
  height: 16px;
  border-radius: 3px;
}

.r-day.past {
  background: var(--accent-gradient);
  background-size: 7000% 100%;
  background-position: calc(var(--i) * 100% / 69) 0;
  transform-origin: bottom;
  animation: grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 18ms);
}

.r-day.future {
  height: 8px;
  margin-bottom: 4px;
  background: color-mix(in srgb, var(--ink) 11%, transparent);
}

.r-day.today {
  height: 34px;
  overflow: visible;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.r-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 0;
  border-radius: 3px;
  background: var(--kept);
  transition: height 0.3s ease;
}

.r-day.d66 {
  height: 26px;
  margin-bottom: 0;
  background: var(--violet);
}

.r-label {
  position: absolute;
  bottom: calc(100% + 6px);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.r-today {
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent-strong);
}

.r-66 {
  right: -2px;
  color: var(--violet);
}

.ruler-dates {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: var(--text-small);
  color: var(--muted);
}

.season-band.is-perfect .r-day.today {
  box-shadow: inset 0 0 0 2px var(--kept);
}

@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

@media (max-width: 719px) {
  .ruler {
    --week-gap: 3px;
  }
  .r-week {
    gap: 1px;
  }
  .r-66-long {
    display: none;
  }
}

/* ---------- #home: board and side ---------- */

.home-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

/* Below 1080px the two columns dissolve into one list: board, challenge, why 70, rules. */
.home-main,
.home-side,
.home-lower {
  display: contents;
}

@media (max-width: 1079px) {
  .board {
    order: 1;
  }
  .challenge {
    order: 2;
  }
  .why70 {
    order: 3;
  }
  .rules {
    order: 4;
  }
}

@media (min-width: 1080px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) clamp(300px, 28%, 360px);
    align-items: start;
  }
  .home-main,
  .home-side {
    display: grid;
    gap: 20px;
    align-content: start;
  }
  .home-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .home-lower .why70 {
    grid-template-columns: 1fr;
  }
}

.board {
  padding: clamp(16px, 2.4vw, 28px);
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.board-title .panel-title {
  font-size: var(--text-title);
  letter-spacing: -0.02em;
}

.board-note {
  margin-top: 2px;
  color: var(--ink-2);
}

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

.view-toggle {
  display: none;
}

.habit-rows {
  display: grid;
  gap: 20px;
  margin-block: 6px 4px;
}

.habit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  margin-bottom: 6px;
}

.habit-name {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
}

.habit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.habit-meta b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.habit-why {
  margin-left: auto;
}

/* Ribbons. Weeks are flattened so every row's days line up in one flex line. */
.ribbon {
  display: flex;
  align-items: center;
}

.week {
  display: contents;
}

.day,
.ax {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin-left: var(--day-gap);
}

.week:first-child > :first-child {
  margin-left: 0;
}

.week + .week > :first-child {
  margin-left: var(--week-gap);
}

.day.is-today,
.ax.is-today {
  flex: 0 0 var(--today-w);
}

.day {
  height: var(--cell-h);
  border-radius: 3px;
}

.day.kept {
  background: var(--kept);
}

.day.missed {
  box-shadow: inset 0 0 0 1.5px var(--muted);
}

.day.before {
  height: 2px;
  background: var(--line-strong);
}

.day.future {
  height: 8px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.day.future.d66 {
  height: var(--cell-h);
  background: none;
}

.day.future.d66::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--violet);
}

.day.is-today {
  height: auto;
  display: grid;
}

.day.is-today::before {
  content: '';
  position: absolute;
  inset: -7px -4px;
  z-index: -1;
  border-radius: 9px;
  background: var(--accent-soft);
}

.tick {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 100%;
  height: calc(var(--cell-h) + 4px);
  margin: 0;
  border: 2px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.tick:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.tick::before {
  content: '';
  width: 7px;
  height: 13px;
  margin-top: -3px;
  border: solid var(--surface);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.tick:checked {
  border-color: var(--kept);
  background: var(--kept);
}

.tick:checked::before {
  transform: rotate(45deg) scale(1);
}

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

.day.pop .tick {
  animation: pop 0.32s ease;
}

@keyframes pop {
  50% {
    transform: scale(1.14);
  }
}

/* Axis rows above and below the ribbons */
.axis .ax {
  height: 18px;
}

.axis-top {
  margin-bottom: 2px;
}

.axis-bottom {
  margin-top: 10px;
}

.ax > span {
  position: absolute;
  bottom: 2px;
  left: 0;
  font-size: var(--text-small);
  color: var(--muted);
  white-space: nowrap;
}

.ax > .ax-mid {
  left: 50%;
  bottom: auto;
  top: 0;
  transform: translateX(-50%);
  font-weight: var(--weight-semibold);
}

.ax-today {
  color: var(--accent-strong) !important;
}

.ax-66 {
  color: var(--violet) !important;
}

.ax-start {
  display: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-small);
  color: var(--ink-2);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend .link {
  font-weight: var(--weight-medium);
}

.sw {
  display: inline-block;
  width: 9px;
  height: 16px;
  border-radius: 2px;
}

.sw.kept {
  background: var(--kept);
}

.sw.missed {
  box-shadow: inset 0 0 0 1.5px var(--muted);
}

.sw.today {
  width: 14px;
  border: 2px solid var(--accent);
  border-radius: 4px;
}

.sw.future {
  height: 6px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.sw.d66 {
  width: 3px;
  background: var(--violet);
}

/* Phones: last 14 days, or the whole season as a calendar */
@media (max-width: 719px) {
  :root {
    --today-w: 40px;
    --cell-h: 36px;
  }
  .view-toggle {
    display: inline-flex;
  }
  .board-actions {
    width: 100%;
  }
  .board-actions .btn {
    flex: 1 1 auto;
  }
  .habit-why {
    margin-left: 0;
  }
  .board:not(.show-all) .is-old,
  .board:not(.show-all) .is-ahead {
    display: none;
  }
  .board:not(.show-all) .ax-start {
    display: inline;
  }
  .board.show-all .axis {
    display: none;
  }
  .board.show-all .ribbon.days {
    display: grid;
    gap: 4px;
  }
  .board.show-all .week {
    display: grid;
    grid-template-columns: 4.6em repeat(7, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
  }
  .board.show-all .week::before {
    content: attr(data-label);
    font-size: var(--text-small);
    color: var(--muted);
  }
  .board.show-all .week > * {
    margin: 0 !important;
  }
  .board.show-all .day {
    height: 22px;
  }
  .board.show-all .day.future {
    height: 8px;
  }
  .board.show-all .day.future.d66 {
    height: 22px;
  }
  .board.show-all .day.is-today {
    height: auto;
  }
  .board.show-all .day.is-today::before {
    inset: -3px;
  }
  .board.show-all .tick {
    height: 40px;
  }
}

/* Company challenge */
.challenge {
  padding: clamp(18px, 2.2vw, 24px);
  border-radius: var(--radius-lg);
}

.teams {
  display: grid;
  gap: 4px;
}

.team {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  grid-template-areas:
    'rank name score'
    '. bar bar';
  align-items: center;
  gap: 4px 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.team.mine {
  background: var(--accent-soft);
}

.t-rank {
  grid-area: rank;
  font-weight: var(--weight-semibold);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.t-name {
  grid-area: name;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-weight: var(--weight-semibold);
}

.t-name a {
  text-decoration: none;
}

.t-name a:hover {
  text-decoration: underline;
}

.t-you {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--surface);
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
}

.t-score {
  grid-area: score;
  font-weight: var(--weight-strong);
}

.t-bar {
  grid-area: bar;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--wash);
  overflow: hidden;
}

.t-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.team.mine .t-bar i {
  background: var(--accent);
}

.t-people {
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--muted);
}

.leaders {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-control);
}

.leaders thead th {
  padding: 0 8px 6px;
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  color: var(--muted);
  text-align: left;
}

.leaders thead th.num {
  text-align: right;
}

.leaders td,
.leaders tbody th {
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-weight: var(--weight-medium);
}

.leaders td.num {
  text-align: right;
}

.leaders .l-rank {
  width: 2em;
  color: var(--muted);
  text-align: left !important;
}

.l-name {
  display: block;
  font-weight: var(--weight-semibold);
}

.l-team {
  display: block;
  font-size: var(--text-small);
  color: var(--muted);
  font-weight: var(--weight-medium);
}

.l-score {
  font-weight: var(--weight-strong) !important;
}

.leaders tr.me td,
.leaders tr.me th {
  background: var(--accent-soft);
}

.leaders tr.me .l-name {
  color: var(--accent-strong);
}

.leaders tr.me td:first-child {
  border-radius: 8px 0 0 8px;
}

.leaders tr.me td:last-child {
  border-radius: 0 8px 8px 0;
}

/* Why 70 days, rules */
.why70 {
  display: grid;
  gap: 22px 36px;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: var(--radius-lg);
  scroll-margin-top: calc(var(--switcher-h, 0px) + var(--header-h) + 16px);
}

@media (min-width: 760px) {
  .why70 {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
}

.why-fact {
  margin-top: 8px;
  font-size: var(--text-lead);
  line-height: 1.45;
  max-width: 54ch;
}

.why-round {
  margin-top: 8px;
  color: var(--ink-2);
}

.why-source {
  margin-top: 12px;
  font-size: var(--text-small);
  color: var(--muted);
}

.range {
  position: relative;
  padding-block: 26px 28px;
}

.range-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--wash);
}

.range-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

.range-median {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent-strong);
}

.range-season {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--kept);
}

.range-lbl {
  position: absolute;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.range-lbl.above {
  top: 2px;
  transform: translateX(-12px);
  color: var(--accent-strong);
}

.range-lbl.below {
  bottom: 2px;
  color: var(--ink-2);
}

.range-lbl.center {
  transform: translateX(-50%);
  color: var(--muted);
}

.range-lbl.season {
  transform: translateX(-2px);
}

.range-lbl.end {
  transform: translateX(-100%);
  color: var(--muted);
}

.rules {
  padding: 4px clamp(4px, 1.4vw, 12px);
}

.rules-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  counter-reset: rule;
}

.rules-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 12px;
  counter-increment: rule;
  font-weight: var(--weight-medium);
}

.rules-list li::before {
  content: counter(rule);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-2);
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
  color: var(--ink);
}

.rules-list li {
  padding-top: 4px;
}

.rules-more {
  margin-top: 16px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

/* ---------- Dialogs ---------- */

dialog {
  padding: 0;
  border: 0;
  max-width: none;
  max-height: none;
  background: transparent;
  color: var(--ink);
}

dialog::backdrop {
  top: var(--switcher-h, 44px);
  background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.dlg-body {
  overflow-y: auto;
  padding: 22px clamp(18px, 3vw, 28px) 26px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-pop);
}

.drawer {
  position: fixed;
  inset: var(--switcher-h, 44px) 0 0 auto;
  width: min(500px, 100%);
  height: auto;
  margin: 0;
}

.drawer[open] {
  animation: slide-in 0.24s ease;
}

.drawer .dlg-body {
  height: 100%;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.sheet {
  position: fixed;
  inset: var(--switcher-h, 44px) 0 0 0;
  width: min(560px, calc(100% - 32px));
  height: fit-content;
  margin: auto;
}

.sheet[open] {
  animation: rise 0.2s ease;
}

.sheet .dlg-body {
  max-height: calc(100dvh - var(--switcher-h, 44px) - 32px);
  border-radius: var(--radius-xl);
}

@keyframes slide-in {
  from {
    transform: translateX(32px);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

@media (max-width: 719px) {
  .drawer {
    inset: auto 0 0 0;
    width: 100%;
    height: min(88dvh, calc(100dvh - var(--switcher-h, 44px) - 12px));
  }
  .drawer .dlg-body {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .drawer[open] {
    animation: rise 0.24s ease;
  }
}

.dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dlg-head h2 {
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dlg-kicker {
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.dlg-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  margin: -6px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: var(--wash);
}

.dlg-close .ic {
  width: 16px;
  height: 16px;
}

.dlg-close:hover {
  background: var(--line-strong);
}

.dlg-lead {
  margin-top: 10px;
  color: var(--ink-2);
}

.dlg-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: var(--text-control);
  color: var(--ink);
}

.dlg-foot {
  margin-top: 18px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.dlg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.picks {
  display: grid;
  margin-top: 8px;
}

.pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.pick-name {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
}

.pick .tags {
  margin-top: 6px;
}

.pick-line {
  margin-top: 8px;
}

.pick-people {
  margin-top: 4px;
  font-size: var(--text-small);
  color: var(--muted);
}

.pick-actions,
.opt-actions,
.trick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 10px;
}

.why-facts {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--wash);
}

@media (min-width: 520px) {
  .why-facts {
    grid-template-columns: auto 1fr 1fr;
  }
}

.why-score {
  display: flex;
  align-items: center;
  gap: 10px;
}

.why-score p {
  max-width: 9ch;
  font-size: var(--text-small);
  color: var(--ink-2);
}

.why-facts p {
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--ink-2);
}

.why-score p {
  margin-top: 0;
}

.why-line {
  margin-top: 16px;
  font-size: var(--text-lead);
  line-height: 1.45;
}

.coming {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-control);
  color: var(--ink-2);
}

.swap fieldset {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.swap legend {
  margin-bottom: 8px;
  font-weight: var(--weight-semibold);
}

.swap-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.swap-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.swap-opt input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.swap-opt span {
  display: grid;
}

.swap-opt span span {
  font-size: var(--text-small);
  color: var(--muted);
}

/* ---------- #topic ---------- */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 14px;
  font-size: var(--text-control);
  color: var(--muted);
}

.crumbs li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--line-strong);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--accent-strong);
  font-weight: var(--weight-medium);
}

.topic-head {
  margin-bottom: 22px;
}

.decide {
  display: grid;
  gap: 24px 40px;
  padding: clamp(20px, 3vw, 34px);
}

@media (min-width: 900px) {
  .decide {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  }
}

.decide-ask {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.decide-answer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  font-size: calc(var(--text-display) * 0.82);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
}

.decide-answer::before {
  content: '';
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--tier-c);
}

.decide-plain {
  margin-top: 8px;
  color: var(--ink-2);
}

.bottom-line {
  max-width: 62ch;
  font-size: var(--text-lead);
  line-height: 1.5;
}

.what-it-is {
  max-width: 62ch;
  margin-top: 14px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.decide-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.decide-facts {
  display: grid;
  gap: 16px;
}

.fact {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.fact:first-child {
  padding-top: 0;
  border-top: 0;
}

.fact dt {
  margin-bottom: 8px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.fact-score dd {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.fact-plain {
  display: block;
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--muted);
}

.decide-add .btn {
  min-height: 44px;
  padding-inline: 20px;
  font-size: var(--text-body);
}

.fit {
  display: grid;
  gap: 10px 32px;
  margin-top: 20px;
  padding: 20px clamp(18px, 3vw, 28px);
  border-radius: var(--radius-lg);
  border: 1.5px dashed color-mix(in srgb, var(--kept) 55%, transparent);
  background: color-mix(in srgb, var(--kept) 6%, transparent);
}

@media (min-width: 900px) {
  .fit {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .fit-title,
  .fit-text {
    grid-column: 1;
  }
  .fit-list {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

.fit-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
}

.fit-text {
  max-width: 64ch;
  color: var(--ink-2);
}

.fit-list,
.related-list,
.popular-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fit-opt,
.rel-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.fit-opt:hover,
.rel-opt:hover {
  border-color: var(--accent);
}

.fit-name,
.rel-opt > span:last-child {
  display: grid;
  gap: 2px;
  font-size: var(--text-control);
}

.fit-name span {
  font-size: var(--text-small);
  color: var(--muted);
}

.rel-opt .tier {
  justify-self: start;
}

/* Lenses */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tab {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--glass-edge);
  border-top: 4px solid var(--lens);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  text-align: left;
}

.tab[aria-selected='true'] {
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tab-name {
  font-weight: var(--weight-semibold);
}

.tab-count {
  font-size: var(--text-small);
  color: var(--muted);
}

.lens-people {
  --lens: var(--series-2);
}

.lens-science {
  --lens: var(--accent);
}

.lens-society {
  --lens: var(--violet);
}

.panel {
  padding: clamp(18px, 3vw, 30px);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--glass-edge);
  border-top: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel:focus-visible {
  outline-offset: -2px;
}

.lens-intro {
  display: grid;
  gap: 12px;
  max-width: 68ch;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.verdict strong {
  font-weight: var(--weight-strong);
}

.claims,
.studies {
  display: grid;
}

.claim,
.study {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.claim:last-child,
.study:last-child {
  border-bottom: 0;
}

.claim-share {
  display: grid;
  align-content: start;
  gap: 2px;
}

.share-num {
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.share-of {
  font-size: var(--text-small);
  color: var(--muted);
}

.share-bar {
  display: block;
  height: 5px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--wash);
}

.share-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--series-2);
}

.claim blockquote {
  margin: 0;
  font-size: var(--text-lead);
  line-height: 1.4;
}

.claim blockquote p::before {
  content: '\201C';
}

.claim blockquote p::after {
  content: '\201D';
}

.claim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.claim-tags .stance {
  font-weight: var(--weight-semibold);
  color: var(--ink);
}

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

.tone.extreme {
  color: var(--status-critical);
  font-weight: var(--weight-semibold);
}

.noise-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--status-critical) 12%, var(--surface));
  color: var(--ink);
  font-weight: var(--weight-semibold);
}

.noise-flag .ic {
  stroke: var(--status-critical);
}

.claim-where {
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--muted);
}

.claim.is-noise blockquote {
  color: var(--ink-2);
}

.claim.is-noise .share-bar i {
  background: var(--line-strong);
}

.noise-h {
  margin-top: 26px;
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
}

.noise-sub {
  margin-top: 2px;
  font-size: var(--text-control);
  color: var(--muted);
}

.study-level {
  display: grid;
  align-content: start;
  gap: 6px;
}

.lvl-name {
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--accent-strong);
}

.pips {
  display: inline-flex;
  gap: 3px;
}

.pips i {
  width: 12px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-soft);
}

.pips i.on {
  background: var(--accent);
}

.study-title {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.study-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.study-tags:empty {
  display: none;
}

.study-finding {
  margin-top: 8px;
  max-width: 70ch;
}

.study-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  font-size: var(--text-control);
}

.study-facts dt {
  font-size: var(--text-small);
  color: var(--muted);
}

.study-facts dd {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--weight-medium);
}

.is-conflict dd {
  color: var(--caution-ink);
  font-weight: var(--weight-semibold);
}

.is-conflict .ic {
  stroke: var(--status-critical);
}

.lens-foot {
  margin-top: 14px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.beliefs {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.belief {
  display: grid;
  gap: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
}

@media (min-width: 760px) {
  .belief {
    grid-template-columns: 1fr 1fr;
  }
}

.b-says,
.b-facts {
  padding: 16px 18px;
}

.b-says {
  border-left: 4px solid var(--violet);
  background: color-mix(in srgb, var(--violet) 8%, var(--surface));
}

.b-k {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--muted);
}

.b-says .b-k {
  color: var(--violet);
}

.b-text {
  margin-top: 4px;
  font-size: var(--text-lead);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.b-origin {
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--ink-2);
}

.b-facts p:last-child {
  margin-top: 4px;
}

.topic-more {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

@media (min-width: 900px) {
  .topic-more {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.voices,
.books {
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius-lg);
}

.voice-list,
.book-list {
  display: grid;
  margin-top: 8px;
}

.voice,
.book {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.voice:last-child,
.book:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.v-who,
.bk-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.v-who span,
.bk-title span {
  font-size: var(--text-small);
  color: var(--muted);
}

.v-says {
  margin-top: 4px;
  font-style: italic;
}

.v-match {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
}

.v-match::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.v-match.good::before {
  background: var(--status-good);
}

.v-match.mixed::before {
  background: var(--series-4);
}

.v-match.bad::before {
  background: var(--status-critical);
}

.book p:last-child {
  margin-top: 4px;
  color: var(--ink-2);
}

.related .section-title {
  font-size: var(--text-heading);
}

@media (max-width: 719px) {
  .tabs {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .tab {
    min-height: 48px;
    border-top-width: 1px;
    border-left: 4px solid var(--lens);
    border-radius: var(--radius-sm);
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .panel {
    margin-top: 6px;
    border-top: 1px solid var(--glass-edge);
    border-radius: var(--radius-lg);
  }
  .claim,
  .study {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .claim-share {
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
  }
  .share-num {
    font-size: var(--text-heading);
  }
  .share-bar {
    margin-top: 0;
  }
  .study-level {
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: center;
    gap: 10px;
  }
}

/* ---------- #learn ---------- */

.learn-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  color: var(--ink-2);
}

.lp-bar {
  display: inline-flex;
  gap: 3px;
}

.lp-bar i {
  width: 22px;
  height: 8px;
  border-radius: 3px;
  background: var(--line-strong);
}

.lp-bar i.on {
  background: var(--kept);
}

.lesson-nav ol {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

@media (min-width: 760px) {
  .lesson-nav ol {
    grid-template-columns: repeat(3, 1fr);
  }
}

.lesson-nav a {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  text-decoration: none;
}

.lesson-nav a:hover {
  border-color: var(--accent);
}

.ln-n,
.lesson-n {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--accent-strong);
}

.ln-t {
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.ln-s {
  font-size: var(--text-small);
  color: var(--muted);
}

.lesson {
  margin-top: 20px;
  padding: clamp(20px, 3.4vw, 40px);
  scroll-margin-top: calc(var(--switcher-h, 0px) + var(--header-h) + 16px);
}

.lesson-title {
  max-width: 36ch;
  margin-top: 4px;
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lesson-lead {
  max-width: 62ch;
  margin-top: 10px;
  font-size: var(--text-lead);
  line-height: 1.5;
}

.lesson p {
  max-width: 68ch;
}

.lesson-cols {
  display: grid;
  gap: 18px 40px;
}

.lesson-text p + p {
  margin-top: 10px;
}

@media (min-width: 900px) {
  .lesson-cols {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
  }
}

.lesson-h {
  margin: 28px 0 10px;
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
}

.tricks {
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .tricks {
    grid-template-columns: repeat(3, 1fr);
  }
}

.trick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--wash);
}

.trick-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 4px;
}

.lesson-books {
  display: grid;
  gap: 8px;
}

.lesson-books li {
  max-width: 72ch;
  color: var(--ink-2);
}

.lesson-books b {
  color: var(--ink);
}

.questions {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  counter-reset: q;
}

.questions li {
  position: relative;
  padding: 14px 0 14px 52px;
  border-bottom: 1px solid var(--line);
  counter-increment: q;
}

.questions li::before {
  content: counter(q);
  position: absolute;
  left: 0;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: var(--weight-strong);
}

.q-ask {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
}

.questions li p:last-child {
  margin-top: 2px;
  color: var(--ink-2);
}

.ladder {
  display: grid;
  gap: 2px;
}

.ladder li {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: start;
  gap: 14px;
  padding: 10px 0;
}

.ladder .pips {
  margin-top: 7px;
}

.ladder li p:last-child {
  font-size: var(--text-control);
  color: var(--ink-2);
}

.traps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

@media (min-width: 760px) {
  .traps {
    grid-template-columns: 1fr 1fr;
  }
}

.trap {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.trap-text {
  font-size: var(--text-lead);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.trap-real {
  padding: 10px 12px;
  border-left: 3px solid var(--kept);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--kept) 9%, var(--surface));
}

.lesson-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.read-btn.is-read {
  border-color: var(--kept);
  background: color-mix(in srgb, var(--kept) 14%, var(--surface));
}

.read-btn.is-read .ic {
  stroke: var(--kept);
  stroke-width: 2.5;
}

/* ---------- #search ---------- */

.search-box {
  display: grid;
  gap: 8px;
  padding: 18px clamp(16px, 2.6vw, 24px);
  border-radius: var(--radius-lg);
}

.search-label {
  font-weight: var(--weight-semibold);
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: var(--text-lead);
}

.search-box input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}

.suggest-k {
  font-size: var(--text-control);
  color: var(--muted);
}

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

.chip {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.result-count {
  margin-top: 18px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.result-count:empty {
  display: none;
}

.results {
  margin-top: 18px;
}

.results > section:first-child .section-title {
  margin-top: 0;
}

.topic-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  text-decoration: none;
}

.topic-card:hover {
  box-shadow: var(--shadow-pop);
}

.tc-main {
  display: grid;
  gap: 4px;
}

.tc-kind {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--accent-strong);
}

.tc-title {
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tc-q {
  color: var(--ink-2);
}

.tc-main .tags {
  margin-top: 4px;
}

.tier-group {
  margin-top: 18px;
}

.tg-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  color: var(--ink-2);
}

.tg-title .tier {
  font-size: var(--text-control);
  padding: 4px 12px;
}

.opt-list {
  display: grid;
  gap: 10px;
}

@media (min-width: 900px) {
  .opt-list {
    grid-template-columns: 1fr 1fr;
  }
}

.opt-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.opt-name {
  font-size: var(--text-heading);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.012em;
}

.opt-card .tags {
  margin-top: 6px;
}

.opt-line {
  margin-top: 8px;
  color: var(--ink-2);
}

mark {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--status-warning) 38%, transparent);
  color: inherit;
}

.lesson-results {
  display: grid;
  gap: 10px;
}

.lesson-card {
  display: grid;
  gap: 4px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.lesson-card span {
  font-size: var(--text-control);
  color: var(--ink-2);
}

.empty {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.empty p {
  margin-top: 6px;
  color: var(--ink-2);
}

/* ---------- #habits: the whole season ---------- */

.season-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
}

.invite {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.invite-msg,
.form-msg {
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.invite-msg:empty,
.form-msg:empty {
  display: none;
}

.form-msg[data-tone='ok']::before,
.invite-msg::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--kept);
}

.form-msg[data-tone='error'] {
  color: var(--status-critical);
}

.season-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin-top: 26px;
}

.season-facts dt {
  font-size: var(--text-control);
  color: var(--muted);
}

.season-facts dd {
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.season-facts dd span {
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  color: var(--muted);
  letter-spacing: 0;
}

.ruler-wrap.compact {
  margin-top: 14px;
}

.ruler-wrap.compact .ruler {
  height: 50px;
}

.season-layout {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

@media (min-width: 1000px) {
  .season-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    align-items: start;
  }
}

.season-main {
  display: grid;
  gap: 20px;
}

.standings,
.everyone,
.side-block {
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius-lg);
}

.standings .teams {
  margin-top: 14px;
}

.standings .team {
  padding: 12px;
}

.standings .t-name {
  font-size: var(--text-heading);
}

.standings .t-bar {
  height: 10px;
  border-radius: 5px;
}

.team-page {
  padding: 22px clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  scroll-margin-top: calc(var(--switcher-h, 0px) + var(--header-h) + 16px);
}

.team-page.mine {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.tp-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-title {
  font-size: var(--text-title);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
}

.tp-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 12px;
}

.tp-facts dt {
  font-size: var(--text-small);
  color: var(--muted);
}

.tp-facts dd {
  font-size: var(--text-heading);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.tp-bar {
  display: block;
  height: 8px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--wash);
  overflow: hidden;
}

.tp-bar i {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.team-page.mine .tp-bar i {
  background: var(--accent);
}

.tp-members,
.mine-list {
  display: grid;
  gap: 6px;
}

.tp-members li,
.mine-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--wash);
}

.tp-members li span,
.mine-list li span {
  color: var(--ink-2);
  font-size: var(--text-control);
}

.tp-members li.me {
  background: var(--accent-soft);
}

.tp-members li.me b {
  color: var(--accent-strong);
}

.tp-more {
  margin-top: 8px;
  font-size: var(--text-control);
  color: var(--muted);
}

.tp-more:empty {
  display: none;
}

.tp-mine .link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 4px;
}

.season-side {
  display: grid;
  gap: 20px;
}

.side-block p {
  margin-top: 10px;
  font-size: var(--text-control);
  color: var(--ink-2);
}

.score-example {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink) !important;
}

.popular-list {
  margin-top: 12px;
  flex-direction: column;
  align-items: stretch;
}

.popular-list .rel-opt {
  width: 100%;
}

.add-slot:empty {
  display: none;
}

.side-block .rules-list {
  margin-top: 12px;
}

@media (max-width: 719px) {
  .invite {
    justify-items: start;
  }
}

/* ---------- #manage ---------- */

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

@media (min-width: 760px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stats > div {
  padding: 16px 18px;
  border-radius: var(--radius-md);
}

.stats dt {
  font-size: var(--text-control);
  color: var(--ink-2);
}

.stats dd {
  font-size: var(--text-stat);
  font-weight: var(--weight-strong);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stats .is-due dd {
  color: var(--accent-strong);
}

.manage-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

@media (min-width: 1000px) {
  .manage-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.queue,
.season-setup,
.editor {
  padding: clamp(18px, 2.6vw, 28px);
  border-radius: var(--radius-lg);
}

.queue-list {
  display: grid;
  margin-top: 10px;
}

.q-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.q-item:last-child {
  border-bottom: 0;
}

.q-what {
  font-weight: var(--weight-medium);
}

.q-topic {
  font-size: var(--text-small);
  color: var(--muted);
}

.editor {
  margin-top: 20px;
}

.editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.editor-head .panel-title {
  font-size: var(--text-title);
  letter-spacing: -0.02em;
}

form .field,
fieldset.field {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  min-width: 0;
}

fieldset {
  min-width: 0;
}

fieldset.field {
  padding: 0;
  border: 0;
}

.field label,
fieldset.field legend {
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
}

fieldset.field legend {
  margin-bottom: 6px;
  padding: 0;
}

.field input[type='text'],
.field input[type='number'],
.field input[type='date'],
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row {
  display: grid;
  gap: 0 16px;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
  .field-row.three {
    grid-template-columns: 1.2fr 1fr 1.2fr;
  }
}

.hint {
  margin-top: 6px;
  font-size: var(--text-small);
  color: var(--muted);
}

.seg,
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg label,
.checks label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.seg label:has(input:checked),
.checks label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.seg input,
.checks input,
.check-line input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-top: 12px;
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.ss-preview {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--wash);
  font-size: var(--text-control);
  font-weight: var(--weight-medium);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 18px;
}

.ed-block {
  margin: 24px 0 0;
  padding: 18px clamp(14px, 2.4vw, 22px) 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.ed-block legend {
  padding: 0 6px;
  font-weight: var(--weight-strong);
}

.ed-block > .field:first-of-type {
  margin-top: 4px;
}

.ed-studies {
  display: grid;
  gap: 6px;
}

.ed-studies li {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 0 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--wash);
  font-size: var(--text-control);
}

.es-title {
  font-weight: var(--weight-medium);
}

.es-meta {
  grid-column: 2;
  font-size: var(--text-small);
  color: var(--muted);
}

.ed-claims {
  display: grid;
  margin-top: 6px;
}

.ed-claim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ed-claim:last-child {
  border-bottom: 0;
}

.ec-text {
  display: grid;
  flex: 1 1 280px;
  font-weight: var(--weight-medium);
}

.ec-text span {
  font-size: var(--text-small);
  font-weight: var(--weight-regular, 400);
  color: var(--muted);
}

.ec-tone {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ec-tone select {
  min-height: 40px;
  padding: 6px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-control);
}

.ec-flag {
  min-width: 4.5em;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--status-critical);
}

@media (max-width: 559px) {
  .ed-studies li {
    grid-template-columns: 1fr;
  }
  .es-meta {
    grid-column: 1;
  }
}

.save-bar {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
