/* True-black flat (tasteskill app style, seed 425136871): elevation by lightness alone,
   colour only on data, the primary control made primary by inversion.
   Owner's pins on top of it: a black or white ground and a soft dark-blue halo in the top-left corner,
   and a floating three-button tab bar built as slide tabs. */

:root,
:root[data-theme="dark"] {
  --ground: #000000;
  --surface: #111111;
  --raised: #2a2a2a;
  --press: #1c1c1c;
  --rule: #1a1a1a;
  --dash: #333333;
  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #949494;
  --accent: #4da3ff;          /* the one data hue: the sea off Sevastopol */
  --primary-bg: #ffffff;      /* inverted: white fill, black label */
  --primary-ink: #000000;
  --bar-past: #262626;
  --bar-next: #474747;
  --halo: rgba(32, 72, 190, 0.45);
  --hatch: rgba(255, 255, 255, 0.10);
  --st-border: rgba(214, 228, 255, 0.30);
  --st-bg: rgba(26, 28, 38, 0.78);
  --st-glow: 0 0 26px rgba(130, 170, 255, 0.32), 0 0 3px rgba(190, 215, 255, 0.45), 0 14px 34px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --st-cursor: #ffffff;
  --st-cursor-glow: 0 0 16px rgba(210, 225, 255, 0.35);
  /* subject colours: pure, bright hues */
  --hue-red: #ff3b30; --hue-green: #30d158; --hue-blue: #0a84ff; --hue-yellow: #ffd60a; --hue-orange: #ff9f0a;
  --hue-cyan: #32d4f5; --hue-teal: #2ee6c8; --hue-pink: #ff2d78; --hue-lime: #a3f53a;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ground: #ffffff;
  --surface: #f4f4f5;
  --raised: #e6e6e9;
  --press: #ececef;
  --rule: #ededf0;
  --dash: #d4d4d8;
  --text: #111111;
  --muted: #55595f;
  --faint: #6b6b6b;
  --accent: #1f6feb;
  --primary-bg: #111111;
  --primary-ink: #ffffff;
  --bar-past: #e6e6e9;
  --bar-next: #c4c4ca;
  --halo: rgba(29, 78, 216, 0.16);
  --hatch: rgba(17, 17, 17, 0.09);
  --st-border: rgba(17, 24, 39, 0.10);
  --st-bg: rgba(255, 255, 255, 0.80);
  --st-glow: 0 0 22px rgba(70, 120, 255, 0.18), 0 12px 30px rgba(17, 24, 39, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --st-cursor: #111111;
  --st-cursor-glow: 0 0 14px rgba(70, 120, 255, 0.22);
  /* the same bright hues, a step denser so they hold on white */
  --hue-red: #f2271d; --hue-green: #12b347; --hue-blue: #0a6cff; --hue-yellow: #f2b600; --hue-orange: #ff7a00;
  --hue-cyan: #00a8d6; --hue-teal: #00b39b; --hue-pink: #f2136b; --hue-lime: #5fb800;
  color-scheme: light;
}

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-card: 20px;
  --radius-small: 14px;
  --gap: 14px;
  --margin: 20px;
  --fs-title: 22px;
  --fs-kpi: 24px;
  --fs-body: 15px;
  --fs-small: 13px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Telegram's insets inside the Mini App; the phone's own on a home screen, where the page runs under the status bar */
  --top-inset: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --bottom-inset: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.45;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
body { min-height: 100vh; min-height: var(--tg-viewport-stable-height, 100vh); overscroll-behavior: none; overflow-x: clip; }

/* the owner's halo: a soft dark-blue light in the top-left corner, fixed behind everything */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(110vmax 80vmax at -18% -22%, var(--halo), transparent 55%); /* taste-skill-ignore: the owner asked for this corner halo */
}

::selection { background: var(--accent); color: #fff; }
input { caret-color: var(--accent); }
::-webkit-scrollbar { width: 0; height: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

#app {
  position: relative; z-index: 1;
  padding: calc(var(--top-inset) + 18px) var(--margin) calc(112px + var(--bottom-inset));
  max-width: 560px; margin: 0 auto;
}

/* ---------- title row ---------- */

.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.title-row h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.scope {
  flex: none; margin-top: 2px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--muted);
}

/* ---------- week ---------- */

.week { margin-top: 20px; }
.week-head { display: flex; align-items: center; justify-content: space-between; }
.week-head span { font-size: 13px; color: var(--faint); }
.week-arrows { display: flex; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: var(--muted);
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active:not(:disabled) { background: var(--press); transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.days { position: relative; display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 6px; margin-top: 8px; }
.day-cursor {
  position: absolute; top: 0; left: 0; width: 0; height: 64px; border-radius: var(--radius-small);
  background: var(--raised); will-change: transform, width;
}
.day {
  height: 64px; border-radius: var(--radius-small);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; color: var(--faint);
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.day b { font-size: 17px; font-weight: 600; color: var(--text); }
.day.today b { color: var(--accent); }
.day:active { transform: scale(0.96); }
.day { position: relative; z-index: 1; }
.day[aria-pressed="true"] { color: var(--muted); }
.dots { display: flex; gap: 3px; height: 4px; }
.dots i { width: 4px; height: 4px; border-radius: 2px; background: var(--bar-next); }

/* ---------- the day as a time strip: pairs at their real length, each in its subject's colour ---------- */

.strip { position: relative; height: 40px; margin-top: 34px; }
.bar { position: absolute; top: 0; height: 10px; border-radius: 3px; background: var(--c, var(--bar-next)); }
.bar.past { background: var(--bar-past); }
.bar.now { top: -2px; height: 14px; border-radius: 4px; }
.bar-label { position: absolute; top: 18px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.bar-label.now { color: var(--text); font-weight: 500; }
.now-line { position: absolute; top: -5px; width: 2px; height: 20px; margin-left: -1px; border-radius: 1px; background: var(--text); transition: left 1s linear; }
.now-label {
  position: absolute; top: -24px; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap;
  transition: left 1s linear;
}

.slide-next { animation: slide-next 300ms var(--ease) both; }
.slide-prev { animation: slide-prev 300ms var(--ease) both; }
@keyframes slide-next { from { opacity: 0; transform: translateX(28px); } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-28px); } }

/* ---------- subject marks: line drawings in the subject's colour ---------- */

.mark { display: block; flex: none; fill: none; stroke: var(--c); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- the pair that matters now ---------- */

.lead-card {
  position: relative; margin-top: 14px; padding: 22px; border-radius: var(--radius-card);
  background: var(--surface);
  border: 1.5px solid var(--c);
}
/* on white a light wash of the subject's colour reads clean; on black it turns muddy, so dark stays neutral */
:root[data-theme="light"] .pair:not(.past),
:root[data-theme="light"] .lead-card { background: color-mix(in srgb, var(--c) 7%, #ffffff); }
.lead-mark { position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; }
.lead-card h2 { padding-right: 46px; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.lead-card .who { margin-top: 4px; padding-right: 46px; font-size: 14px; color: var(--muted); }
.facts { display: flex; gap: 32px; margin-top: 18px; }
.facts dt { font-size: 13px; color: var(--faint); }
.facts dd { margin-top: 2px; font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.status { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--text); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.status .dot.later { background: var(--faint); }
.also { margin-top: 10px; font-size: 13px; color: var(--muted); }
.lead-progress { height: 4px; margin-top: 14px; border-radius: 2px; overflow: hidden; background: var(--raised); }
.lead-progress i { display: block; height: 100%; border-radius: 2px; background: var(--c, var(--accent)); transition: width 1s linear; }

/* ---------- list of pairs: one outlined card per pair ---------- */

.section-title { margin-top: 26px; font-size: 16px; font-weight: 600; }
.pairs { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.pair {
  display: grid; grid-template-columns: 44px 1fr 26px; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 16px;
  border: 1.5px solid var(--c);
  background: var(--surface);
}
.pair .t { font-size: 13px; line-height: 1.5; color: var(--muted); font-variant-numeric: tabular-nums; }
.pair h3 { font-size: 16px; font-weight: 500; line-height: 1.3; }
.pair p { margin-top: 3px; font-size: 13px; color: var(--faint); }
.pair p b { font-weight: 500; color: var(--muted); }
.pair .mark { width: 26px; height: 26px; }
.pair.past { border-color: var(--raised); background: transparent; }
.pair.past h3, .pair.past .t { color: var(--faint); }
.pair.past .mark { opacity: 0.45; }
.gap { padding: 2px 16px; font-size: 13px; color: var(--faint); }
.reminded { color: var(--c); font-weight: 500; }
.pressable { cursor: pointer; transition: transform 160ms var(--ease); -webkit-user-select: none; user-select: none; }
.pressable:active { transform: scale(0.985); }

.done { margin-top: 14px; padding: 20px 22px; border-radius: var(--radius-card); background: var(--surface); }
.done h2 { font-size: 17px; font-weight: 600; }
.done p { margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.5; }

.note {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  border: 1px dashed var(--dash); font-size: 14px; color: var(--muted); line-height: 1.5;
}
.note strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

.source { margin-top: 24px; font-size: 12px; color: var(--faint); }

/* ---------- slide tabs (owner's reference: a glass capsule with a cool glow; a white pill holds the
   active tab's icon and name and springs to a tab only when it is tapped).
   Tab content is white with mix-blend-mode: difference, so it inverts over the pill by itself. ---------- */

.slide-tabs {
  position: relative; isolation: isolate;
  display: flex; padding: 5px;
  border: 1px solid var(--st-border); border-radius: 999px;
  background: var(--st-bg);
  box-shadow: var(--st-glow); /* taste-skill-ignore: the owner's reference glows */
  -webkit-backdrop-filter: blur(20px) saturate(150%); /* taste-skill-ignore: glass is in the owner's reference */
  backdrop-filter: blur(20px) saturate(150%); /* taste-skill-ignore: glass is in the owner's reference */
}
.slide-tabs [role="tab"] {
  position: relative; z-index: 1; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; mix-blend-mode: difference;
}
.slide-tabs [role="tab"]:active .tab-inner { scale: 0.95; }
.tab-inner {
  display: flex; align-items: center;
  transform: translateX(var(--shift, 0px));
  transition: transform 420ms var(--ease), scale 150ms var(--ease);
}
.tab-label {
  display: block; overflow: hidden; white-space: nowrap;
  max-width: 0; margin-left: 0; opacity: 0;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  transition: max-width 380ms var(--ease), margin-left 380ms var(--ease), opacity 220ms var(--ease);
}
[aria-selected="true"] > .tab-inner > .tab-label { max-width: 140px; margin-left: 8px; opacity: 1; transition-delay: 0ms, 0ms, 90ms; }
.slide-cursor {
  position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 0; width: 0;
  border-radius: 999px; background: var(--st-cursor);
  box-shadow: var(--st-cursor-glow); /* taste-skill-ignore: the pill glows in the reference */
  will-change: transform, width;
}

/* the bottom bar */
.tabbar {
  position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(14px + var(--bottom-inset));
  max-width: 440px; margin: 0 auto;
}
.tabbar[hidden] { display: none; }
.tabbar { transition: translate 320ms var(--ease), opacity 240ms var(--ease); }
.tabbar.away { translate: 0 calc(100% + 24px + var(--bottom-inset)); opacity: 0; pointer-events: none; }
.tabbar [role="tab"] { height: 44px; }
.tabbar svg { flex: none; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the same control at the top of the profile */
.segmented [role="tab"] { height: 40px; font-size: 14px; font-weight: 600; }
#sched-body { margin-top: 20px; }

/* the bell next to the schedule switch, in the same glass; the red badge counts what is new */
.sched-top { display: flex; align-items: center; gap: 10px; }
.sched-top .sched-switch { flex: 1; min-width: 0; }
/* beside the bell there is less room: each tab is as wide as its name, so «Статистика» never spills out of its pill */
.sched-switch [role="tab"] { flex: 1 1 auto; padding: 0 10px; white-space: nowrap; }
.bell {
  position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--st-border); background: var(--st-bg); color: var(--text);
  box-shadow: var(--st-glow); /* taste-skill-ignore: matches the glass switch beside it */
  -webkit-backdrop-filter: blur(20px) saturate(150%); /* taste-skill-ignore: matches the glass switch beside it */
  backdrop-filter: blur(20px) saturate(150%); /* taste-skill-ignore: matches the glass switch beside it */
  transition: transform 150ms var(--ease);
}
.bell:active { transform: scale(0.94); }
.bell svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-badge {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: #ff3b30; color: #ffffff; border: 2px solid var(--ground);
  font-size: 11px; font-weight: 700; line-height: 1;
}
.bell-badge[hidden] { display: none; }

/* ---------- the privacy policy and the consent ---------- */
.doc { font-size: 15px; line-height: 1.6; color: var(--muted); }
.doc h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
.doc-date { margin-top: 6px; font-size: 13px; color: var(--faint); }
.doc .doc-lead { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-small); background: var(--surface); color: var(--text); }
.doc h2 { margin-top: 26px; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--text); }
.doc p, .doc ul, .doc dl { margin-top: 10px; }
.doc ul { padding-left: 20px; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--faint); }
.doc b { font-weight: 600; color: var(--text); }
.doc a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.doc-terms dt { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--text); }
.doc-terms dd { margin-top: 2px; }
.doc-page { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 40px var(--margin) 64px; }
.doc-sheet h1 { font-size: 20px; }
.doc-actions {
  position: sticky; bottom: 0; margin-top: 18px; padding-top: 10px; background: var(--ground);
  box-shadow: 0 calc(22px + var(--bottom-inset)) 0 var(--ground); /* taste-skill-ignore: fills the strip under the sticky buttons */
}

/* the tick under the name: a box, and words whose underlined parts open the documents */
.consent-check { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; }
.tick {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 7px;
  border: 1.5px solid var(--faint); color: transparent; transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}
.tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tick[aria-checked="true"] { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-ink); }
.consent-check p { font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.doc-link { display: inline; padding: 0; color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.consent-go { margin-top: 18px; }
.btn.danger { background: #e5484d; color: #ffffff; }
.options button.danger { color: #e5484d; }
.erase-list { margin-top: 14px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.erase-list li + li { margin-top: 4px; }
.erase-note { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--faint); }

/* the notifications sheet */
.ntf-list { list-style: none; margin-top: 10px; }
.ntf {
  display: flex; align-items: flex-start; gap: 12px; width: calc(100% + 16px); padding: 12px 8px; margin: 0 -8px; border-radius: 14px;
  text-align: left; transition: background-color 150ms var(--ease);
}
.ntf:active { background: var(--press); }
.ntf.unread { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.avatar.ntf-avatar { width: 40px; height: 40px; font-size: 14px; }
.ntf-main { flex: 1; min-width: 0; }
.ntf-text { display: block; font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.ntf-text b { color: var(--text); font-weight: 600; }
.ntf-main time { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
.ntf-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.club-request-hint { margin-top: 8px; text-align: center; }

/* ---------- week table: days down, pairs across ---------- */

.wk-scroll { margin: 16px calc(-1 * var(--margin)) 0; padding: 0 12px; overflow-x: auto; }
.wk-table {
  display: grid; grid-template-columns: 28px repeat(var(--cols), minmax(74px, 1fr)); gap: 4px;
  min-width: min-content;
}
.wk-corner { position: sticky; left: 0; }
.wk-h { display: flex; flex-direction: column; align-items: center; padding-bottom: 2px; }
.wk-h b { font-size: 14px; font-weight: 600; }
.wk-h span { font-size: 11px; color: var(--faint); }
.wk-day {
  position: sticky; left: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--ground); font-size: 12px; color: var(--faint);
}
.wk-day b { font-size: 14px; font-weight: 600; color: var(--text); }
.wk-day.today b, .wk-day.today span { color: var(--accent); }
.wk-cell {
  position: relative; min-height: 70px; padding: 8px 5px; border-radius: 12px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px; text-align: left;
  border: 1.5px solid var(--c, var(--dash)); background: var(--surface);
}
:root[data-theme="light"] .wk-cell:not(.past):not(.empty) { background: color-mix(in srgb, var(--c) 7%, #ffffff); }
.wk-name {
  font-size: 11.5px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: break-word; /* words wrap whole; only a word longer than the cell is ever split */
}
.wk-room { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-more { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 600; color: var(--muted); }
.wk-cell.past { border-color: var(--raised); }
.wk-cell.past .wk-name, .wk-cell.past .wk-room { color: var(--faint); }
.wk-cell.now { box-shadow: inset 0 0 0 1.5px var(--c); } /* taste-skill-ignore: a second ring marks the pair running now */
/* a free slot is a visible hole: dashed edge and a faint hatch, so it reads at a glance, not by the clock */
.wk-cell.empty, .wk-swatch {
  border: 1px dashed var(--dash); background-color: transparent;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7px); /* taste-skill-ignore: the hatch encodes "no pair" */
}
.wk-cell.empty.today { border-color: color-mix(in srgb, var(--accent) 45%, var(--dash)); }
.wk-key { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--faint); }
.wk-swatch { display: inline-block; width: 22px; height: 16px; border-radius: 5px; }

/* ---------- week statistics ---------- */

.title-row .week-arrows { flex: none; margin-top: -4px; }
.kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px;
  border-radius: var(--radius-card); background: var(--surface); overflow: hidden;
}
.kpis > div { padding: 16px 14px; }
.kpis > div + div { border-left: 1px solid var(--ground); }
.kpis dt { font-size: 12px; color: var(--faint); line-height: 1.3; }
.kpis dd { margin-top: 4px; font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -0.01em; }
.kpis small { display: block; font-size: 11px; color: var(--faint); }

.stat-card { margin-top: 14px; padding: 20px; border-radius: var(--radius-card); background: var(--surface); }
.stat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stat-head h2 { font-size: 16px; font-weight: 600; }
.stat-head p { font-size: 13px; color: var(--faint); }

/* the donut: segments sweep in once, a tapped segment takes the centre */
.donut { position: relative; margin: 18px auto 0; }
.donut-svg { display: block; overflow: visible; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--raised); opacity: 0.6; }
.seg {
  fill: none; stroke: var(--c); stroke-linecap: round; cursor: pointer; opacity: 0;
  transform-box: view-box; transform-origin: center;
  transition: stroke-dashoffset 1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d), opacity 300ms ease var(--d), transform 200ms var(--ease), filter 200ms var(--ease);
}
.seg.in { opacity: 1; }
/* the other subjects fade by mixing into the card, not by transparency, so the overlapping ends stay solid */
.donut.has-active .seg.in { stroke: color-mix(in srgb, var(--c) 28%, var(--surface)); transition-delay: 0ms; }
.donut.has-active .seg.in.active { stroke: var(--c); }
.donut.has-active .seg.active { opacity: 1; transform: scale(1.03); filter: drop-shadow(0 0 6px var(--c)) brightness(1.1); } /* taste-skill-ignore: the chart's highlight from the owner's component */
.donut-center { position: absolute; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-text span { display: block; max-width: 132px; margin: 0 auto; font-size: 13px; line-height: 1.3; color: var(--muted); }
.donut-text b { display: block; margin-top: 2px; font-size: 36px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.donut-text small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.donut-text.swap { animation: swap-in 200ms var(--ease) both; }
@keyframes swap-in { from { opacity: 0; transform: scale(0.92); } }

.legend { list-style: none; margin-top: 18px; display: grid; gap: 2px; }
.legend button {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; text-align: left; font-size: 14px;
  transition: background-color 150ms var(--ease);
}
.legend button.active { background: var(--raised); }
.legend i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.legend span { flex: 1; min-width: 0; line-height: 1.3; }
.legend b { font-weight: 600; color: var(--muted); }

.kind-bar { display: flex; gap: 3px; height: 12px; margin-top: 14px; border-radius: 6px; overflow: hidden; }
.kind-bar i { background: var(--c); }
.kind-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 14px; }
.kind-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kind-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.kind-legend b { font-weight: 600; }
.kind-legend small { font-size: 13px; color: var(--faint); }

.load { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 132px; margin-top: 14px; }
.load-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.load-col i { width: 100%; max-width: 34px; min-height: 3px; border-radius: 6px; background: var(--bar-next); }
.load-col.top i { background: var(--accent); }
.load-col .n { font-size: 13px; font-weight: 600; }
.load-col .d { font-size: 12px; color: var(--faint); }
.load-col.today .d { color: var(--accent); font-weight: 600; }

.week-progress { height: 8px; margin-top: 14px; border-radius: 4px; overflow: hidden; background: var(--raised); }
.week-progress i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.stat-card .facts-list { margin-top: 10px; background: transparent; border-radius: 0; }
.stat-card .facts-list li { padding: 12px 0; }
.stat-card .facts-list li + li { border-top: 1px solid var(--rule); }
.stat-card .facts-list span { flex: 0 1 auto; }
.segmented svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */

.btn {
  width: 100%; height: 52px; border-radius: 999px;
  background: var(--primary-bg); color: var(--primary-ink);
  font-size: 16px; font-weight: 600;
  transition: transform 150ms var(--ease), opacity 150ms var(--ease);
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--text); }
.btn.inline { width: auto; height: 40px; padding: 0 18px; font-size: 14px; }
a.btn { display: grid; place-items: center; text-decoration: none; }
a.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn-note { margin-top: 8px; font-size: 13px; color: var(--faint); text-align: center; }

/* ---------- clubs ---------- */

.clubs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clubs-head h1 { font-size: var(--fs-title); font-weight: 600; }
.clubs-sub { margin-top: 4px; font-size: 14px; color: var(--muted); max-width: 34ch; }

/* a club's own face: a rounded square, so it never reads as a person */
.avatar.club-avatar { border-radius: 30%; background: color-mix(in srgb, var(--c) 22%, var(--raised)); color: var(--c); }
.person[data-club], .person[data-member] { cursor: pointer; transition: background-color 150ms var(--ease); }
.person[data-club]:active, .person[data-member]:active { background: var(--press); }
.row-go svg, .person-actions .row-go svg { width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-go { flex: none; display: grid; place-items: center; }
.person-actions { align-items: center; }
/* an invitation: its two buttons go under the club's name instead of squeezing it */
.person.with-actions { flex-wrap: wrap; }
.person.with-actions .person-actions { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; padding-left: 56px; }
.role-tag { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-tag.owner { background: var(--primary-bg); color: var(--primary-ink); }
.club-filter { display: flex; gap: 6px; margin: 10px calc(-1 * var(--margin)) 0; padding: 0 var(--margin); overflow-x: auto; scrollbar-width: none; }
.club-filter::-webkit-scrollbar { display: none; }
.club-filter button { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; transition: transform 150ms var(--ease); }
.club-filter button:active { transform: scale(0.96); }
.club-filter button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-ink); }
#club-new-2 { margin-top: 16px; }

.club-hero { display: flex; flex-direction: column; align-items: center; margin-top: 18px; text-align: center; }
.avatar.club-avatar.big { width: 96px; height: 96px; font-size: 32px; }
.club-hero h1 { margin-top: 14px; font-size: var(--fs-title); font-weight: 600; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.club-hero p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.club-about { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-card); background: var(--surface); font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.club-action { margin-top: 16px; }
.club-owner { margin-top: 14px; font-size: 13px; color: var(--faint); text-align: center; }
.chat-btn { display: flex; align-items: center; justify-content: center; gap: 9px; }
.chat-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.club-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.club-tools .btn { height: 46px; font-size: 15px; }
.club-exit-note { margin-top: 18px; }
.invite-list { margin-bottom: 6px; }
.club-switch { margin-top: 20px; }
.clubs-switch { margin-top: 16px; }
.clubs-switch + #clubs-body > .clubs-sub { margin-top: 12px; }
.post-club { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.post-club .avatar.club-avatar { border-radius: 30%; }
.post-club .post-who b { font-size: 15px; }
.person-now.fresh { color: var(--accent); }

/* a club's feed */
.compose-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; margin-top: 14px; font-size: 15px; }
.compose-btn svg, .post-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feed { display: grid; gap: 10px; margin-top: 14px; }
.feed-empty { margin-top: 14px; }
.post { padding: 14px 16px 16px; border-radius: var(--radius-card); background: var(--surface); }
.post-head { display: flex; align-items: center; gap: 10px; }
.avatar.post-avatar { width: 36px; height: 36px; font-size: 13px; }
.post-who { flex: 1; min-width: 0; }
.post-who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 12px; color: var(--faint); }
.post-vis { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); }
.post-vis svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feed-visitor { margin-top: 14px; }
.post-del {
  flex: none; display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px;
  color: var(--faint); font-size: 13px; font-weight: 600; transition: background-color 150ms var(--ease);
}
.post-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.post-del.sure { color: #e5484d; background: color-mix(in srgb, #e5484d 14%, transparent); }
.post-body { margin-top: 10px; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.post-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.post-photo { display: block; width: 100%; margin-top: 12px; border-radius: var(--radius-small); overflow: hidden; background: var(--raised); }
.post-photo img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
#posts-more { margin-top: 8px; }
.post-form .field-hint { margin-bottom: 2px; }
.post-pick { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.post-pick img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.post-tools { margin-top: 12px; }
.post-tools .btn-sm { display: inline-flex; align-items: center; gap: 6px; }
.post-form .btn { margin-top: 14px; }
/* reactions and comments */
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.reaction {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px;
  background: var(--raised); font-size: 15px; transition: transform 150ms var(--ease), background-color 150ms var(--ease);
}
.reaction b { font-size: 13px; font-weight: 600; color: var(--muted); }
.reaction.mine { background: color-mix(in srgb, var(--accent) 24%, var(--raised)); box-shadow: inset 0 0 0 1.5px var(--accent); } /* taste-skill-ignore: your own reaction */
.reaction.mine b { color: var(--text); }
.reaction:active { transform: scale(0.94); }
.reaction.add { width: 32px; padding: 0; justify-content: center; color: var(--faint); }
.reaction.add svg, .comments-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reaction.pop { animation: pop 380ms cubic-bezier(0.2, 1.6, 0.3, 1); }
@keyframes pop { from { transform: scale(0.7); } }
.react-picker { display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; padding: 6px; border-radius: 999px; background: var(--raised); }
.react-picker[hidden] { display: none; }
.react-picker button { width: 40px; height: 40px; border-radius: 50%; font-size: 22px; transition: transform 150ms var(--ease); }
.react-picker button:active { transform: scale(1.25); }
.comments-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 600;
}
.comments-btn b { color: var(--text); }
.comments-off { flex: none; font-size: 12px; color: var(--faint); }
.post-options { margin-top: 12px; }
.comments { display: grid; gap: 14px; margin-top: 16px; }
.comment { display: flex; align-items: flex-start; gap: 10px; }
.avatar.comment-avatar { width: 32px; height: 32px; font-size: 12px; }
.comment-main { flex: 1; min-width: 0; }
.comment-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.comment-who b { font-size: 14px; font-weight: 600; }
.comment-who .group-tag { padding: 0 6px; font-size: 11px; }
.comment-who time { font-size: 12px; color: var(--faint); }
.comment-body { margin-top: 2px; font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.comment-body a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
/* the field stays at the bottom of the sheet and paints over the sheet's bottom padding, so nothing scrolls under it */
.comment-form {
  position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px;
  margin: 16px calc(-1 * var(--margin)) 0; padding: 10px var(--margin) 0;
  background: var(--ground); border-top: 1px solid var(--rule);
  box-shadow: 0 calc(22px + var(--bottom-inset)) 0 var(--ground); /* taste-skill-ignore: fills the strip under a sticky field */
}
.comment-form textarea {
  flex: 1; min-height: 44px; max-height: 120px; padding: 11px 16px; border: 0; border-radius: 22px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; resize: none;
  box-shadow: inset 0 0 0 1px var(--dash); /* taste-skill-ignore: a field border drawn inside */
}
.comment-form textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); } /* taste-skill-ignore: focus ring */
.comment-form textarea::placeholder { color: var(--faint); }
.comment-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-bg); color: var(--primary-ink); }
.comment-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.comment-send:disabled { opacity: 0.5; }

/* a group's own colour: the same bright tag next to everyone from that group */
.group-tag {
  flex: none; display: inline-block; padding: 1px 7px; border-radius: 6px;
  background: hsl(var(--gh) 80% 72%); color: hsl(var(--gh) 60% 16%);
  background: oklch(0.83 0.14 var(--gh)); color: oklch(0.28 0.08 var(--gh));
  font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: 0.01em; white-space: nowrap;
}
.person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.person-name b { min-width: 0; max-width: 100%; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.profile-name .group-tag { padding: 2px 8px; font-size: 13px; }

.photo-view {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: calc(var(--top-inset) + 16px) 12px calc(var(--bottom-inset) + 16px);
  background: rgba(0, 0, 0, 0.92); animation: fade-in 160ms var(--ease) both;
}
.photo-view img { max-width: 100%; max-height: 100%; border-radius: 8px; object-fit: contain; }

.club-form .field { margin-top: 22px; }
.field .label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.field textarea {
  display: block; width: 100%; min-height: 112px; padding: 14px 18px; border: 0; border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; line-height: 1.45; resize: vertical;
  box-shadow: inset 0 0 0 1px var(--dash); transition: box-shadow 150ms var(--ease); /* taste-skill-ignore: a field border drawn inside */
}
.field textarea:focus { box-shadow: inset 0 0 0 2px var(--accent); } /* taste-skill-ignore: focus ring */
.field textarea::placeholder { color: var(--faint); }
.field-hint { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--faint); }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chips button {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 14px; transition: transform 150ms var(--ease);
}
.cat-chips button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cat-chips button:active { transform: scale(0.96); }
.cat-chips button[aria-checked="true"] { background: var(--primary-bg); color: var(--primary-ink); }
.club-form .options { margin-top: 0; }
.club-form .options button { padding: 12px 18px; }
.club-photo { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.club-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.club-submit { margin-top: 26px; }

/* ---------- profile ---------- */

.profile-head { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--raised); color: var(--text);
  font-size: 22px; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.avatar-edit { position: relative; flex: none; border-radius: 50%; transition: transform 150ms var(--ease); }
.avatar-edit:active { transform: scale(0.95); }
.avatar-badge {
  position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; border: 3px solid var(--ground);
  background: var(--primary-bg); color: var(--primary-ink);
}
.avatar-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.avatar.big { width: 120px; height: 120px; font-size: 40px; }
.avatar-preview { display: grid; place-items: center; margin: 22px 0 4px; }
.avatar-err { text-align: center; }
.rows.account { margin-top: 22px; }
.rows.account + .search-hint { margin-top: 8px; }
.rows .tap { padding: 0; }
.rows .tap button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 14px 15px 18px;
  font-size: 15px; text-align: left; transition: background-color 150ms var(--ease);
}
.rows .tap button:active { background: var(--press); }
.rows .tap b, .rows .locked b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .locked { align-items: center; }
.rows b.unset { color: var(--faint); font-weight: 400; }
.rows li svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rows .locked svg { width: 16px; height: 16px; margin-left: -8px; }
.nick-form { margin-top: 18px; }
.nick-form .btn { margin-top: 14px; }
.profile-head p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.profile-bio {
  display: block; width: 100%; margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-small);
  background: var(--surface); font-size: 15px; line-height: 1.5; text-align: left; white-space: pre-line; overflow-wrap: anywhere;
  transition: background-color 150ms var(--ease);
}
.profile-bio:active { background: var(--press); }
.profile-bio.empty { background: none; border: 1px dashed var(--dash); color: var(--faint); font-size: 14px; }
.person-bio {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-small); background: var(--surface);
  font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
}
.member-rel { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; font-size: 15px; color: var(--muted); }
.member-rel svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* friends */
.friend-search { display: flex; gap: 8px; margin-top: 18px; }
.friend-search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--dash); /* taste-skill-ignore: a field border drawn inside */
}
.friend-search input:focus { box-shadow: inset 0 0 0 2px var(--accent); } /* taste-skill-ignore: focus ring */
.friend-search input::placeholder { color: var(--faint); }
.friend-search .btn { height: 44px; }
.search-hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--faint); }
.search-hint b { color: var(--muted); font-weight: 600; }
#friend-result .note { margin-top: 12px; }

.people { list-style: none; margin-top: 10px; border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.people.found { margin-top: 12px; }
.person { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px 14px 10px 12px; }
.person + .person { border-top: 1px solid var(--ground); }
.person[data-friend] { cursor: pointer; transition: background-color 150ms var(--ease); }
.person[data-friend]:active { background: var(--press); }
.person .avatar { width: 44px; height: 44px; font-size: 15px; }
.person-text { flex: 1; min-width: 0; }
.person-text b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the club a friend chose to show: a small tag in its category's colour */
.club-pill {
  max-width: 100%; display: inline-block; padding: 2px 8px 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, var(--raised)); color: var(--text);
  font-size: 12px; font-weight: 500; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.club-pill::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.person-club, .sheet-head .sheet-club { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.club-more { font-size: 12px; font-weight: 600; color: var(--faint); }
.person-text span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.person-now { display: block; margin-top: 3px; font-style: normal; color: var(--text); }
.person > svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.person-actions { flex: none; display: flex; gap: 6px; }
.person-state { font-size: 13px; color: var(--faint); white-space: nowrap; }
.now-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--c); vertical-align: 1px; }

.btn-sm {
  height: 34px; padding: 0 12px; border-radius: 999px; background: var(--raised); color: var(--text);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: transform 150ms var(--ease), opacity 150ms var(--ease);
}
.btn-sm.primary { background: var(--primary-bg); color: var(--primary-ink); }
.btn-sm:active { transform: scale(0.96); }
.btn-sm:disabled { opacity: 0.5; }
.btn-text { display: block; width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; font-weight: 500; text-align: center; }
.btn-text.danger { color: #e5484d; }

/* the pop-up when someone wants to add you: slides down from the top */
.notice {
  position: fixed; z-index: 45; left: 12px; right: 12px; top: calc(10px + var(--top-inset));
  max-width: 520px; margin: 0 auto; padding: 14px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--st-border);
  box-shadow: var(--st-glow); /* taste-skill-ignore: a floating notice */
  animation: notice-in 420ms cubic-bezier(0.2, 1.2, 0.3, 1) both;
}
.notice.out { animation: notice-out 240ms var(--ease) both; }
.notice-body { display: flex; align-items: center; gap: 12px; }
.notice-avatar { width: 52px; height: 52px; font-size: 18px; }
.notice-text { flex: 1; min-width: 0; }
.notice-text span { display: block; font-size: 13px; color: var(--muted); }
.notice-text b { display: block; margin-top: 1px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-text small { display: block; font-size: 13px; color: var(--faint); }
.notice-close { flex: none; align-self: flex-start; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; color: var(--faint); }
.notice-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.notice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.notice-actions .btn-sm { height: 40px; font-size: 14px; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-120%); } }
@keyframes notice-out { to { opacity: 0; transform: translateY(-120%); } }

/* the flame: lit when both pressed it today; its number is the streak */
.flame {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 42px; height: 38px; padding: 0 10px 0 8px; border-radius: 999px;
  background: var(--raised); color: var(--faint); font-size: 14px; font-weight: 700;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 150ms var(--ease);
}
.flame:active { transform: scale(0.92); }
.flame svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.flame b { font-variant-numeric: tabular-nums; color: var(--text); }
.flame.off b, .flame.alive b { color: var(--muted); }
.flame.mine, .flame.theirs { color: var(--hue-orange); }
.flame.theirs { box-shadow: inset 0 0 0 1.5px var(--hue-orange); animation: flame-call 1.8s ease-in-out infinite; } /* taste-skill-ignore: your turn, tied to live state */
.flame.lit { background: color-mix(in srgb, var(--hue-orange) 22%, var(--raised)); color: var(--hue-orange); }
.flame.lit .outer { fill: var(--hue-orange); }
.flame.lit .core { fill: var(--hue-yellow); stroke: var(--hue-yellow); }
.flame.big { height: 44px; min-width: 52px; margin-left: auto; font-size: 16px; }
.flame.big svg { width: 26px; height: 26px; }
.flame.ignite svg { animation: ignite 650ms cubic-bezier(0.2, 1.5, 0.3, 1); }
.flame.grew b { animation: grew 600ms cubic-bezier(0.2, 1.6, 0.3, 1); display: inline-block; }
@keyframes ignite { 0% { transform: scale(0.5); } 45% { transform: scale(1.4) rotate(-10deg); } 100% { transform: none; } }
@keyframes grew { 0% { transform: translateY(6px) scale(0.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes flame-call { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
.flame-line { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.friend-head { align-items: center; }
.friend-head > div { flex: 1; min-width: 0; }

/* a friend's week in the sheet */
.friend-head .avatar { width: 48px; height: 48px; font-size: 17px; }
.fdays { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; margin-top: 16px; }
.fday {
  height: 56px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--faint); transition: background-color 150ms var(--ease);
}
.fday b { font-size: 16px; font-weight: 600; color: var(--text); }
.fday.today b { color: var(--accent); }
.fday[aria-pressed="true"] { background: var(--raised); }
.sheet .pairs { margin-top: 14px; }
.pair.running { box-shadow: inset 0 0 0 1.5px var(--c); } /* taste-skill-ignore: the pair running now */

/* semester progress: one segment per week */
.sem-card { margin-top: 20px; padding: 18px 18px 16px; border-radius: var(--radius-card); background: var(--surface); }
.sem-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sem-head span { font-size: 14px; font-weight: 500; color: var(--muted); }
.sem-week {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--raised); color: var(--text); font-size: 12px; font-style: normal; font-weight: 600; vertical-align: 1px;
}
.sem-head b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; transition: color 300ms var(--ease); }
.sem-bar { display: flex; gap: 3px; margin-top: 12px; padding: 4px 0; }
.sem-bar i {
  flex: 1; height: 12px; border-radius: 4px; background: var(--raised); cursor: pointer; transform-origin: center;
  transition: background-color 500ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--d), transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sem-bar i.on { background: var(--seg); }
.sem-bar i.picked { box-shadow: 0 0 0 2px var(--ground), 0 0 0 3.5px var(--text); } /* taste-skill-ignore: a selection ring */
.sem-sub { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }

.view-title { margin-top: 26px; font-size: var(--fs-title); font-weight: 600; }

.rows { list-style: none; margin-top: 18px; border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 15px 18px; font-size: 15px; }
.rows li + li { border-top: 1px solid var(--ground); }
.rows span { color: var(--faint); flex: none; }
.rows b { font-weight: 500; text-align: right; }
.rows + .btn { margin-top: 14px; }

.options { list-style: none; margin-top: 12px; border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.options li + li { border-top: 1px solid var(--ground); }
.options button {
  width: 100%; min-height: 54px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 15px; text-align: left; transition: background-color 150ms var(--ease);
}
.options button:active { background: var(--press); }
.options .check { width: 20px; height: 20px; color: var(--text); opacity: 0; }
.options .check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.options button[aria-checked="true"] .check { opacity: 1; }
.options small { display: block; font-size: 13px; color: var(--faint); margin-top: 1px; }
.group-label { margin-top: 26px; font-size: 13px; color: var(--faint); }
.options button:disabled { cursor: default; }
.options .action-text { flex: none; font-size: 14px; font-weight: 500; color: var(--accent); }
.options > li > button > svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.options-note { padding: 16px 18px; font-size: 14px; color: var(--muted); }

/* a switch: the "on" state is the app's inversion, not a colour */
.switch { flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--raised); transition: background-color 200ms var(--ease); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text); transition: transform 220ms var(--ease), background-color 200ms var(--ease);
}
[aria-checked="true"] > .switch { background: var(--primary-bg); }
[aria-checked="true"] > .switch::after { transform: translateX(18px); background: var(--primary-ink); }

.chips-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 12px 18px 14px; }
.chips-row > span { font-size: 14px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.options .chips button {
  width: auto; min-height: 0; display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 13px; border-radius: 999px; background: var(--raised);
  font-size: 14px; font-weight: 500; transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.options .chips button:active { transform: scale(0.96); background: var(--raised); }
.options .chips button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-ink); }

.link-box {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
  font-size: 13px; color: var(--muted); word-break: break-all; -webkit-user-select: all; user-select: all;
}
.steps { margin: 14px 0 0 18px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.steps b { color: var(--text); font-weight: 600; }

/* ---------- onboarding ---------- */

.ob { min-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.ob-top { display: flex; align-items: center; gap: 12px; min-height: 36px; }
.ob-back { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 12px 0 4px; margin-left: -6px; border-radius: 999px; color: var(--muted); font-size: 15px; }
.ob-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ob-back:active { background: var(--press); }
.ob-progress { display: flex; gap: 6px; margin-left: auto; }
.ob-progress i { width: 24px; height: 4px; border-radius: 2px; background: var(--raised); transition: background-color 250ms var(--ease); }
.ob-progress i.on { background: var(--text); }
.ob h1 { margin-top: 28px; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.ob .lead { margin-top: 8px; font-size: 15px; color: var(--muted); line-height: 1.5; max-width: 36ch; }
.ob-body { margin-top: 24px; }

.choice { list-style: none; border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.choice li + li { border-top: 1px solid var(--ground); }
.choice button {
  width: 100%; min-height: 54px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 15px; line-height: 1.3; text-align: left; transition: background-color 150ms var(--ease);
}
.choice button:active { background: var(--press); }
.choice button svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice button[aria-pressed="true"] { background: var(--raised); }
.choice-label { margin: 22px 0 8px; font-size: 13px; color: var(--faint); }

.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.courses button {
  height: 72px; border-radius: var(--radius-small); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.courses b { font-size: 24px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.courses span { margin-top: 4px; font-size: 12px; color: var(--faint); }
.courses button:active { transform: scale(0.96); }
.courses button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-ink); }
.courses button[aria-pressed="true"] span { color: inherit; opacity: 0.7; }

.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.field input {
  width: 100%; height: 52px; padding: 0 18px; border: 0; border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--dash); transition: box-shadow 150ms var(--ease); /* taste-skill-ignore: a field border drawn inside */
}
.field input:focus { box-shadow: inset 0 0 0 2px var(--accent); } /* taste-skill-ignore: focus ring */
.field input::placeholder { color: var(--faint); }
.field .err { margin-top: 8px; font-size: 13px; color: #e5484d; }
.summary { margin-top: 18px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.summary b { color: var(--text); font-weight: 500; }
.grow { flex: 1; min-height: 24px; }

/* ---------- the app outside Telegram: sign-in, installing, no network ---------- */

.signin h1 { margin-top: 22px; }
.signin-mark { display: block; width: 76px; height: 76px; margin-top: 18vh; }   /* the app's icon, the emblem */
.signin .note { margin: 0 0 14px; }
.signin-install { margin-top: 6px; }
.signin-install .group-label { margin-top: 22px; }

/* the steps to the home screen, numbered */
.install-steps { list-style: none; counter-reset: step; margin: 14px 0 16px; display: grid; gap: 12px; }
.install-steps li { counter-increment: step; position: relative; padding-left: 36px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.install-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--raised); color: var(--text); font-size: 13px; font-weight: 600;
}
.install-steps b { color: var(--text); font-weight: 600; }

/* the arrow at the browser's own button, outside the page: Safari's «•••» below, Chrome's ⋮ above */
.install-pointer {
  position: fixed; z-index: 70; right: 14px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff; pointer-events: none;
}
.install-pointer svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* above Safari's floating bar on iOS 26, which covers the bottom of the page */
.install-pointer.down { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); animation: point-down 1.1s ease-in-out infinite; }
.install-pointer.up { top: calc(10px + env(safe-area-inset-top, 0px)); animation: point-up 1.1s ease-in-out infinite; }
.install-pointer.up svg { transform: rotate(180deg); }
.pointer-room { height: 64px; }   /* nothing to read under the arrow */
@keyframes point-down { 50% { translate: 0 8px; } }
@keyframes point-up { 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .install-pointer { animation: none; } }
.signin-foot { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--faint); text-align: center; }

/* with no network: the data on screen is the saved copy */
.offline-pill {
  position: fixed; z-index: 11; left: 50%; bottom: calc(76px + var(--bottom-inset)); translate: -50% 0;
  padding: 7px 14px; border-radius: 999px; background: var(--raised); color: var(--muted);
  font-size: 13px; font-weight: 500; white-space: nowrap; pointer-events: none;
}
.offline-pill[hidden] { display: none; }

.device-list { list-style: none; margin-top: 16px; border-radius: var(--radius-card); background: var(--surface); }
.device-list li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.device-list li + li { border-top: 1px solid var(--ground); }
.device-main { flex: 1; min-width: 0; }
.device-main b { font-weight: 600; }
.device-here { margin-left: 8px; font-style: normal; font-size: 12px; color: var(--accent); }
.device-main small { display: block; margin-top: 2px; font-size: 13px; color: var(--faint); }

/* ---------- states ---------- */

.skeleton i { display: block; border-radius: 6px; background: var(--surface); }
.center { min-height: 70vh; display: grid; place-content: center; gap: 16px; text-align: center; justify-items: center; }
.center p { max-width: 30ch; color: var(--muted); line-height: 1.5; }
.center strong { display: block; margin-bottom: 4px; font-size: 18px; color: var(--text); }

.empty-state {
  margin-top: 16px; padding: 26px 22px 24px; border-radius: var(--radius-card);
  border: 1px dashed var(--dash); text-align: center;
}
.art { display: block; width: 120px; height: 72px; margin: 0 auto 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.art .hi { stroke: var(--accent); }
.empty-state strong { display: block; font-size: 16px; font-weight: 600; }
.empty-state p { max-width: 32ch; margin: 4px auto 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); animation: fade-in 220ms var(--ease) both; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: 88vh; overflow-y: auto;
  padding: 10px var(--margin) calc(22px + var(--bottom-inset));
  border-radius: 24px 24px 0 0; background: var(--ground);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35); /* taste-skill-ignore: a sheet floats over the screen */
  animation: sheet-up 340ms var(--ease) both;
}
.sheet.closing .sheet-scrim { animation: fade-out 200ms var(--ease) both; }
.sheet.closing .sheet-panel { animation: sheet-down 200ms var(--ease) both; }
.grabber { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 2px; background: var(--raised); }
.sheet-head { display: flex; align-items: flex-start; gap: 14px; }
.sheet-mark { width: 36px; height: 36px; margin-top: 2px; }
.sheet-head h2 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.sheet-head p { margin-top: 3px; font-size: 14px; color: var(--muted); }
.sheet .rows { margin-top: 18px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 16px; }
.sheet .btn-note { min-height: 18px; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* theme switch: the new theme is revealed by a growing circle (see switchTheme) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
