:root {
  --paper: #F6F6F1;
  --concrete: #E4E5DD;
  --line: #CDCFC4;
  --ink: #22291F;
  --ink-2: #545B4F;
  --od: #56622F;
  --od-soft: #E3E6D3;
  --blaze: #C4410C;      /* text and buttons, passes contrast */
  --blaze-hi: #E8591E;   /* marks on the range card */
  --white: #FFFFFF;

  --cond: "Archivo", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pad: clamp(18px, 5vw, 28px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--blaze); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-family: var(--cond); }
.display {
  font-stretch: 62%;
  font-weight: 850;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: .92;
  letter-spacing: -.01em;
}
h2 { font-stretch: 75%; font-weight: 800; font-size: 1.55rem; line-height: 1.05; }
h3 { font-stretch: 90%; font-weight: 700; font-size: 1.06rem; line-height: 1.25; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; line-height: 1.4; letter-spacing: .005em; }
p { margin: 0 0 .8em; max-width: 62ch; }

/* ---------- chrome ---------- */
.preview-bar {
  background: var(--od);
  color: var(--white);
  font-size: .8rem;
  padding: calc(6px + env(safe-area-inset-top, 0px)) var(--pad) 6px;
  text-align: center;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--pad);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
.wordmark {
  font-family: var(--cond); font-stretch: 62%; font-weight: 900;
  font-size: 1.7rem; letter-spacing: -.005em; text-decoration: none; line-height: 1;
}
.me-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--cond); font-stretch: 75%; font-weight: 800;
}
#view { padding: 8px var(--pad) 0; max-width: 720px; margin: 0 auto; outline: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 -1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-2); font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabbar svg .fill { fill: currentColor; }
.tabbar a[aria-current="page"] { color: var(--blaze); }
.tabbar a:active svg { transform: scale(.9); transition: transform 80ms ease-out; }
@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 16px; border-radius: 22px; height: var(--tab-h); padding: 0; box-shadow: 0 10px 30px rgba(34,41,31,.14), 0 0 0 1px rgba(34,41,31,.06); }
}

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  background: var(--ink); color: var(--paper);
  transition: transform 100ms ease-out, background-color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn.go { background: var(--blaze); color: var(--white); }
.btn.quiet { background: var(--concrete); color: var(--ink); }
.btn.line { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blaze); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad); scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; border: 0; cursor: pointer; white-space: nowrap;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--concrete); color: var(--ink); font-size: .9rem; font-weight: 600;
  transition: transform 100ms ease-out;
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--concrete); font-size: .78rem; font-weight: 600; }
.tag.od { background: var(--od-soft); color: #3D4720; }
.tag.hot { background: #F7DCCD; color: #8E2F08; }

.seg { display: inline-grid; grid-auto-flow: column; background: var(--concrete); border-radius: 999px; padding: 3px; }
.seg button { appearance: none; border: 0; background: none; border-radius: 999px; min-height: 36px; padding: 0 18px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(34,41,31,.15); }

label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-weight: 650; font-size: .92rem; margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--white); font-size: 1rem;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.hint { font-size: .84rem; color: var(--ink-2); margin-top: 6px; }

/* ---------- layout pieces ---------- */
.section { margin: 30px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-weight: 700; color: var(--blaze); text-decoration: none; font-size: .95rem; }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; gap: 14px; align-items: center; width: 100%;
  padding: 14px 0; border: 0; background: none; text-align: left; cursor: pointer;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.rows > li:last-child .row { border-bottom: 0; }
.row:active { background: color-mix(in srgb, var(--concrete) 60%, transparent); }
.row .grow { flex: 1; min-width: 0; }
.row .meta { color: var(--ink-2); font-size: .88rem; line-height: 1.35; margin-top: 2px; }
.row .end { text-align: right; color: var(--ink-2); font-size: .85rem; white-space: nowrap; }
.chev { width: 9px; height: 14px; stroke: var(--line); fill: none; stroke-width: 2; flex: none; }

.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--concrete); color: var(--ink);
  font-family: var(--cond); font-stretch: 70%; font-weight: 800; font-size: 1.05rem;
}
.avatar.teach { background: var(--ink); color: var(--paper); }

.datebox {
  flex: none; width: 52px; text-align: center; border-radius: var(--r-sm);
  background: var(--ink); color: var(--paper); padding: 6px 0 7px;
  font-family: var(--cond); line-height: 1;
}
.datebox b { display: block; font-stretch: 62%; font-weight: 850; font-size: 1.7rem; }
.datebox span { font-stretch: 85%; font-weight: 600; font-size: .78rem; }
.datebox.soft { background: var(--concrete); color: var(--ink); }

.panel { background: var(--white); border-radius: var(--r-md); padding: 18px; box-shadow: 0 0 0 1px rgba(34,41,31,.07); }
.panel + .panel { margin-top: 12px; }

/* ---------- home ---------- */
.hello { margin: 18px 0 6px; }
.hello p { font-size: 1.1rem; margin-top: 12px; color: var(--ink-2); }
.near-strip {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
  text-decoration: none; background: var(--ink); color: var(--paper);
  border-radius: var(--r-lg); padding: 16px 18px 16px 16px; margin-top: 22px;
  transition: transform 100ms ease-out;
}
.near-strip:active { transform: scale(.985); }
.near-strip svg { width: 92px; height: 92px; }
.near-strip h2 { font-size: 1.7rem; }
.near-strip .rc-ring, .near-strip .rc-ring.outer { stroke: #5C6656; }
.near-strip .rc-axis { stroke: #454E41; }
.near-strip .rc-dot circle.p { fill: var(--paper); stroke: var(--ink); }
.near-strip .rc-dot.teach circle.p { fill: #A9B67A; }
.near-strip .rc-dot rect { stroke: var(--ink); }
.near-strip p { margin: 4px 0 0; color: #C9CEC1; font-size: .95rem; }

.post { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post p { margin: 4px 0 0; }

.streak { display: flex; gap: 6px; margin-top: 10px; }
.streak i { flex: 1; height: 26px; border-radius: 5px; background: var(--concrete); }
.streak i.on { background: var(--od); }
.streak i.today { box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- train ---------- */
.track { margin: 28px 0; }
.track > p { color: var(--ink-2); margin: 6px 0 4px; }
.lesson-icon { flex: none; width: 46px; height: 46px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--concrete); }
.lesson-icon svg { width: 20px; height: 20px; fill: var(--ink); }
.lesson-icon.done { background: var(--od); }
.lesson-icon.done svg { fill: none; stroke: var(--white); stroke-width: 2.6; }
.rules { counter-reset: r; list-style: none; padding: 0; margin: 16px 0 0; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.rules li::before { content: counter(r); font-family: var(--cond); font-stretch: 62%; font-weight: 850; font-size: 1.9rem; line-height: 1; color: var(--blaze); }
.lesson-body p { font-size: 1.08rem; line-height: 1.6; }
.video-ph {
  aspect-ratio: 16/9; border-radius: var(--r-md); background: var(--ink); color: #C9CEC1;
  display: grid; place-items: center; text-align: center; padding: 20px; margin: 16px 0 22px; font-size: .92rem;
}
.video-ph svg { width: 46px; height: 46px; margin: 0 auto 8px; fill: var(--paper); }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--blaze); text-decoration: none; margin: 8px 0 12px; }

/* ---------- nearby: range card ---------- */
.rangecard { position: relative; margin: 8px auto 4px; max-width: 420px; }
.rangecard svg { width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.rc-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.rc-ring.outer { stroke: var(--ink); stroke-width: 1.5; }
.rc-axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 5; }
.rc-label { font: 600 11px var(--body); fill: var(--ink-2); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.rc-north { font: 800 13px var(--cond); font-stretch: 70%; fill: var(--ink); }
.rc-you { fill: var(--blaze-hi); }
.rc-you-ring { fill: none; stroke: var(--blaze-hi); stroke-width: 1.5; opacity: .45; }
.rc-dot { cursor: pointer; }
.rc-dot circle.hit { fill: transparent; }
.rc-dot circle.p { fill: var(--ink); stroke: var(--paper); stroke-width: 2; transition: r 150ms; }
.rc-dot.teach circle.p { fill: var(--od); }
.rc-dot rect { fill: var(--blaze-hi); stroke: var(--paper); stroke-width: 2; }
.rc-dot:focus-visible { outline: none; }
.rc-dot:focus-visible circle.p, .rc-dot:hover circle.p { r: 9; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: .82rem; color: var(--ink-2); margin-bottom: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.legend i.t { background: var(--od); }
.legend i.c { border-radius: 2px; background: var(--blaze-hi); }
.legend i.y { background: var(--blaze-hi); }
.controls { display: grid; gap: 12px; margin: 14px 0 6px; }

/* ---------- events ---------- */
.week { margin: 26px 0 4px; font-family: var(--cond); font-stretch: 80%; font-weight: 800; font-size: 1.05rem; color: var(--ink-2); }
.spots { display: flex; gap: 2px; margin-top: 8px; }
.spots i { width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.spots i.open { background: var(--concrete); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- log ---------- */
.timer { text-align: center; padding: 24px 18px 20px; border-radius: var(--r-lg); background: var(--ink); color: var(--paper); margin-top: 14px; }
.timer .read {
  font-family: var(--cond); font-stretch: 62%; font-weight: 850;
  font-size: clamp(4.5rem, 26vw, 7rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.timer .state { min-height: 1.5em; color: #C9CEC1; margin: 6px 0 16px; }
.timer.wait .read { color: #8C9484; }
.timer.live .read { color: #FFB089; }
.par-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; color: #C9CEC1; font-weight: 600; }
.timer .seg { background: rgba(255,255,255,.1); }
.timer .seg button { color: #C9CEC1; padding: 0 12px; }
.timer .seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.timer .btn { min-width: 160px; min-height: 56px; font-size: 1.1rem; }
.reps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.reps span { background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; font-size: .9rem; }
.reps span.best { background: var(--paper); color: var(--ink); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stats div { background: var(--white); border-radius: var(--r-md); padding: 12px 14px; box-shadow: 0 0 0 1px rgba(34,41,31,.07); }
.stats b { display: block; font-family: var(--cond); font-stretch: 62%; font-weight: 850; font-size: 2.2rem; line-height: 1; }
.stats span { font-size: .82rem; color: var(--ink-2); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(22,27,20,.42); opacity: 0; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 40px rgba(22,27,20,.22);
  transform: translateY(110%);
  padding-bottom: var(--safe-b);
}
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; width: 560px; margin-left: -280px; }
}
.grab { padding: 10px 0 6px; cursor: grab; touch-action: none; flex: none; }
.grab span { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px var(--pad) 26px; }
.sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; touch-action: none; }
.sheet-head .avatar { width: 58px; height: 58px; font-size: 1.3rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 14px 0 18px; font-size: .95rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 600; }
.actions { display: grid; gap: 10px; margin-top: 18px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.fineprint { font-size: .82rem; color: var(--ink-2); margin-top: 14px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; min-height: 120px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 18px; background: var(--concrete); align-self: flex-start; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--paper); }
.compose { display: flex; gap: 8px; }
.compose .input { border-radius: 999px; }

.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px;
  font-weight: 600; font-size: .92rem; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity 180ms, transform 260ms cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- onboarding ---------- */
#onboard {
  position: fixed; inset: 0; z-index: 80; background: var(--paper); overflow-y: auto;
  padding: max(28px, env(safe-area-inset-top)) var(--pad) 40px;
}
.ob { max-width: 520px; margin: 0 auto; }
.ob .wordmark { display: inline-flex; margin-bottom: 36px; }
.ob .display { font-size: clamp(3rem, 14vw, 4.4rem); }
.ob-lede { font-size: 1.12rem; color: var(--ink-2); margin: 16px 0 26px; }
.ob-list { list-style: none; padding: 0; margin: 0 0 30px; }
.ob-list li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-list svg { width: 24px; height: 24px; fill: none; stroke: var(--od); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.ob-step { font-size: .88rem; color: var(--ink-2); margin-bottom: 8px; }
.ob h2 { margin-bottom: 18px; }
.vis-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--white); box-shadow: 0 0 0 1.5px var(--line); margin-bottom: 10px; cursor: pointer; }
.vis-opt:has(input:checked) { box-shadow: 0 0 0 2px var(--ink); }
.vis-opt input { margin-top: 4px; accent-color: var(--ink); width: 18px; height: 18px; }
.vis-opt b { display: block; }
.vis-opt span { font-size: .9rem; color: var(--ink-2); }

/* ---------- motion & a11y prefs ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .tabbar { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: #8B8F84; --ink-2: #3A4036; }
}

/* ---------- profile, privacy, skills ---------- */
label.field > span em { font-style: normal; font-weight: 500; color: var(--ink-2); font-size: .84rem; margin-left: 4px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
fieldset.group { border: 0; padding: 0; margin: 4px 0 22px; min-width: 0; }
fieldset.group legend { font-weight: 700; font-size: .95rem; margin-bottom: 10px; padding: 0; }
.seen { margin: 12px 0 0; font-size: .95rem; color: var(--ink-2); }
.seen b { color: var(--ink); }

.tog { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tog:last-child { border-bottom: 0; }
.tog b { display: block; font-weight: 650; }
.tog small { display: block; color: var(--ink-2); font-size: .86rem; line-height: 1.35; margin-top: 2px; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog i { flex: none; position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--line); transition: background-color 200ms; }
.tog i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--white); box-shadow: 0 2px 4px rgba(22,27,20,.25); transition: transform 260ms cubic-bezier(.3,1.3,.5,1); }
.tog input:checked + i { background: var(--od); }
.tog input:checked + i::after { transform: translateX(20px); }
.tog input:focus-visible + i { outline: 3px solid var(--blaze); outline-offset: 2px; }
.tog:active i::after { width: 31px; }
.tog input:checked:active + i::after { transform: translateX(16px); }

.skills-ed { border-top: 1px solid var(--line); }
details.disc { border-bottom: 1px solid var(--line); }
details.disc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 0; cursor: pointer; font-family: var(--cond); font-stretch: 85%; font-weight: 750; font-size: 1.08rem; }
details.disc summary::-webkit-details-marker { display: none; }
details.disc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); margin: -4px 4px 0 12px; transition: transform 200ms; }
details.disc[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.disc summary small { margin-left: auto; font-family: var(--body); font-stretch: 100%; font-weight: 600; font-size: .82rem; color: var(--od); }
details.disc .chips { padding-bottom: 16px; }
.chip.skill { display: inline-flex; align-items: center; gap: 6px; }
.chip.skill small { font-size: .74rem; font-weight: 700; }
.chip.skill small:empty { display: none; }
.chip.skill[data-l="0"] { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip.skill[data-l="1"] { background: var(--od); color: var(--white); }
.chip.skill[data-l="2"] { background: var(--ink); color: var(--paper); }
.chip.skill[data-l="2"] small { color: #FFB089; }

.skillset { margin: 14px 0 6px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.skillset dt { font-weight: 700; font-size: .9rem; padding-top: 3px; }
.skillset dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag i { font-style: normal; font-weight: 500; opacity: .75; }
.tag.lv1 { background: var(--od-soft); color: #3D4720; }
.tag.lv2 { background: var(--ink); color: var(--paper); }

.pcard { position: relative; background: var(--white); border-radius: var(--r-md); padding: 16px; box-shadow: 0 0 0 1px rgba(34,41,31,.08), 0 8px 24px rgba(34,41,31,.06); margin-bottom: 8px; }
.pcard .sheet-head { margin-bottom: 10px; }
.pcard .sheet-head .avatar { width: 50px; height: 50px; font-size: 1.1rem; }
.pcard p { margin: 0 0 6px; }
.pcard.ghost > :not(.ghost-note) { opacity: .35; }
.ghost-note { font-weight: 700; margin-bottom: 10px; color: var(--blaze); }

.banner { display: block; text-decoration: none; background: #F7DCCD; color: #5E1F05; border-radius: var(--r-md); padding: 12px 14px; margin: 14px 0; font-size: .93rem; }

.bars { list-style: none; margin: 0; padding: 0; }
.bars button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 2em; align-items: center; gap: 12px; padding: 7px 0; }
.bars button:focus-visible { outline: 3px solid var(--blaze); outline-offset: 2px; border-radius: 4px; }
.bars span { font-weight: 600; font-size: .95rem; }
.bars i { height: 12px; border-radius: 3px; background: linear-gradient(var(--ink), var(--ink)) no-repeat left / var(--w) 100%, var(--concrete); }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- top bar extras ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
.bell:active { background: var(--concrete); }
.bell svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--blaze); color: var(--white); font-size: .7rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--paper); }
.admin-pill { text-decoration: none; font-weight: 800; font-size: .82rem; padding: 6px 11px; border-radius: 999px; background: var(--od); color: var(--white); }
.row.unread { font-weight: 650; }
.row.unread::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--blaze); }
body.ob-open .scrim { z-index: 85; }
body.ob-open .sheet { z-index: 90; }

/* ---------- progress, challenges, kit ---------- */
.prog { height: 6px; border-radius: 3px; background: var(--concrete); margin: 8px 0 4px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--od); border-radius: 3px; }
.daygrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.daygrid button { aspect-ratio: 1; border: 0; border-radius: 8px; background: var(--concrete); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform 100ms ease-out; }
.daygrid button:active { transform: scale(.93); }
.daygrid button.on { background: var(--od); color: var(--white); }
.checks { list-style: none; margin: 12px 0 0; padding: 0; }
.checks li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.checks label { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex: 1; cursor: pointer; }
.checks input { width: 22px; height: 22px; accent-color: var(--od); flex: none; }
.checks input:checked + span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--line); }

/* ---------- admin ---------- */
.stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quotes { margin: 6px 0; padding-left: 18px; color: var(--ink-2); }
.quotes li { margin-bottom: 4px; }
.panel h3 { margin-bottom: 4px; }
.linkbtn.small { font-size: .84rem; }

/* logo */
.logo-mark { width: 1.15em; height: 1.15em; flex: none; display: block; }
.mark, .wordmark { display: inline-flex; align-items: center; gap: .32em; }

.skill-key { background: var(--white); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 0 0 1px rgba(34,41,31,.08); }
.skill-key p { margin: 0 0 10px; font-weight: 600; }
.skill-key p.small { margin: 10px 0 0; font-weight: 400; }
.skill-key .chip { cursor: default; }

/* ======================================================================
   Desktop and laptop. Phones keep the layout above.
   ====================================================================== */
@media (hover: hover) and (pointer: fine) {
  .row { border-radius: 10px; transition: background-color 120ms; }
  .row:hover { background: color-mix(in srgb, var(--concrete) 70%, transparent); }
  .chip:hover { background: #D6D8CE; }
  .chip[aria-pressed="true"]:hover { background: var(--ink); }
  .btn:hover { filter: brightness(.94); }
  .tabbar a:hover { color: var(--ink); }
  .rc-dot:hover circle.p { r: 9; }
  .bell:hover { background: var(--concrete); }
  .me-btn:hover { box-shadow: 0 0 0 3px var(--concrete); }
}

@media (min-width: 1024px) {
  :root { --side: 232px; --tab-h: 0px; }
  body { padding-bottom: 48px; }


  /* top bar spans the page; nav moves to a left rail */
  .topbar { padding: 14px 32px; }
  .tabbar {
    left: 0; right: auto; top: 0; bottom: 0; transform: none;
    width: var(--side); height: auto; border-radius: 0;
    display: flex; flex-direction: column; gap: 4px;
    padding: 124px 16px 24px; box-shadow: 1px 0 0 color-mix(in srgb, var(--ink) 8%, transparent);
    background: var(--paper); z-index: 15;
  }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 11px 14px; border-radius: 12px; font-size: 1rem; }
  .tabbar a[aria-current="page"] { background: var(--concrete); color: var(--ink); }
  .tabbar a[aria-current="page"] svg { color: var(--blaze); }
  .tabbar a:active svg { transform: none; }
  .topbar, #view, .preview-bar { margin-left: var(--side); }
  .topbar { margin-left: 0; position: sticky; z-index: 20; }
  #view { max-width: none; padding: 8px clamp(32px, 4vw, 64px) 0; }

  /* filter chips wrap instead of getting cut off */
  .chips.scroll { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0; }

  /* home: two columns */
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .home-grid .near-strip { margin-top: 24px; grid-template-columns: 160px 1fr; padding: 22px 26px 22px 22px; }
  .home-grid .near-strip svg { width: 160px; height: 160px; }
  .home-grid .near-strip h2 { font-size: 2.2rem; }
  .v-home .col-b > .section:first-child { margin-top: 24px; }

  /* nearby: map stays put on the left, list scrolls on the right */

  /* train: tracks side by side */
  .tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
  #view.v-lesson, #view.v-rules { max-width: 900px; }

  /* events: two columns of rows */
  .ev-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .ev-rows > li .row { border-bottom: 1px solid var(--line); }
  .ev-rows > li:nth-last-child(2):nth-child(odd) .row { border-bottom: 0; }

  /* log: timer left, history right */
  .log-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .log-grid .log-recent { margin-top: 14px; }
  .card-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .card-rows > li .row { border-bottom: 1px solid var(--line); }

  /* profile: preview card stays visible while you change settings */
  #me-form { display: grid; grid-template-columns: 360px minmax(0, 1fr); column-gap: 64px; }
  #me-form > section { grid-column: 2; }
  #me-form > section:first-child { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 80px; align-self: start; margin-top: 30px; }
  .me-rest { margin-left: calc(360px + 64px); }
  .v-me .display { margin-bottom: 0; }

  /* admin */
  .panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
  .panel-grid .panel + .panel { margin-top: 0; }
  .stats.four { max-width: 900px; }

  /* sheets become centered dialogs */
  .sheet { left: 0; right: 0; margin: 0 auto; width: 600px; bottom: auto; top: 7vh; max-height: 86vh; border-radius: var(--r-lg); }
  .sheet .grab { display: none; }
  .sheet-body { padding-top: 26px; }
  .toast { left: calc(50% + var(--side) / 2); }
}

@media (min-width: 1440px) {
  #view { max-width: 1400px; }
}

@media (min-width: 1200px) {
  .nb { display: grid; grid-template-columns: minmax(400px, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .nb-map { position: sticky; top: 80px; }
  .nb .rangecard { max-width: 560px; margin: 12px 0 8px; }
  .nb .legend { justify-content: flex-start; }
  .nb-side { padding-top: 26px; }
  .nb-side .controls { margin-top: 0; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .nb .rangecard { max-width: 480px; }
}

/* ---------- messages ---------- */
.tabbar a { position: relative; }
.nbadge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--blaze); color: var(--white); font: 800 .66rem/17px var(--body); text-align: center; font-style: normal; }
.nbadge.inline { position: static; display: inline-block; margin-top: 4px; }
.chat-list .row.on { background: var(--concrete); border-radius: 10px; }
.chat-list .avatar.teach { font-size: .95rem; }
.msg-layout .msg-thread { display: none; }
.msg-layout.has-thread .msg-list { display: none; }
.msg-layout.has-thread .msg-thread { display: flex; }
.msg-thread { flex-direction: column; min-height: calc(100dvh - 170px - var(--tab-h) - var(--safe-b)); }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); position: sticky; top: 62px; background: var(--paper); z-index: 5; }
.thread-head h2 { font-size: 1.3rem; }
.thread-head .back { margin: 0; padding: 8px 6px 8px 0; }
.thread-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 0; }
.thread-hint { text-align: center; margin: 30px auto; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; margin-bottom: 8px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .bubble { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-who { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin: 0 0 3px 4px; }
.msg-meta { font-size: .75rem; color: var(--ink-2); margin: 3px 6px 0; font-variant-numeric: tabular-nums; }
.msg-meta .linkbtn { font-size: .75rem; margin-left: 6px; }
.composer { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px); display: flex; gap: 8px; align-items: flex-end; padding: 10px 0; background: var(--paper); }
.composer textarea { min-height: 48px; max-height: 160px; resize: none; border-radius: 22px; padding: 12px 16px; line-height: 1.35; }
.msg-empty { padding: 60px 0; text-align: center; }
blockquote.quoted { margin: 10px 0 14px; padding: 12px 14px; background: var(--concrete); border-radius: 12px; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .msg-meta .linkbtn { opacity: 0; transition: opacity 120ms; } .msg:hover .msg-meta .linkbtn, .msg-meta .linkbtn:focus-visible { opacity: 1; } }
@media (min-width: 1024px) {
  .tabbar a .nbadge { position: static; margin-left: auto; }
  .msg-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; height: calc(100dvh - 120px); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--white); margin-top: 18px; }
  .msg-layout .msg-list, .msg-layout.has-thread .msg-list { display: block; overflow-y: auto; padding: 0 18px 18px; border-right: 1px solid var(--line); background: var(--paper); }
  .msg-layout .msg-list .display { font-size: 2.4rem; }
  .msg-layout .msg-thread, .msg-layout.has-thread .msg-thread { display: flex; min-height: 0; padding: 0 28px; overflow: hidden; }
  .thread-back { display: none !important; }
  .thread-head { position: static; background: none; }
  .thread-body { overflow-y: auto; padding-right: 6px; }
  .composer { position: static; background: none; padding-bottom: 18px; }
  #view.v-messages { padding-bottom: 0; }
}

/* ---------- crews ---------- */
.crew-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; margin: 4px 0 18px; }
.crew-avatar { width: 64px; height: 64px; font-size: 1.4rem; border-radius: 18px; }
.crew-title { font-size: clamp(2.1rem, 8vw, 3rem); }
.crew-head p { margin: 6px 0 0; }
.crew-cta { grid-column: 1 / -1; }
.crew-cta .btn { width: 100%; }
.crew-tabs { display: flex; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.crew-tabs::-webkit-scrollbar { display: none; }
.crew-tabs button { white-space: nowrap; }
.crew-body { margin-top: 6px; }
.crew-about { font-size: 1.08rem; line-height: 1.6; margin-top: 16px; }
.invite { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.invite code { font: 800 1.4rem/1 var(--cond); font-stretch: 75%; letter-spacing: .06em; padding: 10px 14px; background: var(--white); border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.chip.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chip.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.chip.check:has(input:checked) { background: var(--ink); color: var(--paper); }
.bubble.announce { background: var(--od-soft); border: 1px solid #C9D0A8; }
.bubble.me.announce { background: var(--od); color: var(--white); border: 0; }
.ann-label { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .02em; margin-bottom: 3px; opacity: .8; }
.composer-note { text-align: center; padding: 14px 0 18px; }
.desk-only { }
@media (max-width: 1023px) { .tabbar a.desk-only { display: none; } .tabbar { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
  .crews-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
  .crew-head { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
  .crew-cta { grid-column: auto; }
  .crew-cta .btn { width: auto; }
  .v-crew .crew-body { max-width: 860px; }
}

/* ---------- live accounts ---------- */
.form-err { color: var(--blaze); font-weight: 600; font-size: .93rem; min-height: 1.2em; margin: 4px 0 10px; }
.form-err:empty { min-height: 0; margin: 0; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: var(--ink); margin-top: 18px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.preview-bar .linkbtn { color: inherit; text-decoration: underline; font: inherit; font-weight: 700; margin-left: 6px; }
button.avatar { border: 0; cursor: pointer; font: inherit; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.stat { text-align: left; background: var(--concrete); border: 0; border-radius: var(--r-md); padding: 14px; font: inherit; color: var(--ink); cursor: pointer; }
.stat b { display: block; font-size: 2rem; font-stretch: 80%; line-height: 1; }
.stat span { color: var(--ink-2); font-size: .88rem; }
.adm-row { align-items: flex-start; }
.adm-row .chips { margin-top: 10px; gap: 8px; }
.adm-body .controls { margin-top: 14px; }
select.input.sm { width: auto; padding: 6px 10px; min-height: 0; font-size: .88rem; }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(3, 1fr); } }
