/* The mobile app's UI kit (mobile/src/components/ui) for the web views.
   Same tokens, type sizes and spacing as the app; see spec 2026-10-24
   web-app-match-mobile §3. */
:root {
  --k-bg: #0B0A08; --k-surface: #15130F; --k-line: #2A261F; --k-text: #F4F1EA; --k-mute: #9C968A;
  --k-gold: #EAB308; --k-gold-pressed: #CA8A04; --k-burn: #F97316; --k-good: #86B36B; --k-bad: #E5484D;
  --k-faint: #4a453c; --k-placeholder: #6b665c;
  --k-num: "Barlow Condensed", "Arial Narrow", sans-serif; --k-body: "Barlow", -apple-system, BlinkMacSystemFont, sans-serif;
}
html { background: var(--k-bg); }
body { background: var(--k-bg); color: var(--k-text); font-family: var(--k-body); }

/* layout */
.k-col { max-width: 640px; margin: 0 auto; padding: 22px 20px 40px; }
.k-wide { max-width: 1100px; }
.k-title { font-family: var(--k-num); font-weight: 700; font-size: 30px; line-height: 1.2; text-transform: uppercase; color: var(--k-text); margin: 0 0 4px; }
.k-back { display: inline-block; color: var(--k-mute); font-size: 13px; margin-bottom: 10px; text-decoration: none; }
.k-back:hover { color: var(--k-text); }

/* type */
.k-label { font-family: var(--k-num); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--k-mute); }
.k-heading { font-family: var(--k-num); font-weight: 700; font-size: 15px; line-height: 18px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--k-gold); }
.k-heading.quiet { color: var(--k-mute); margin-bottom: 4px; }
.k-num { font-family: var(--k-num); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--k-text); }
.k-num.n15 { font-size: 15px; } .k-num.n20 { font-size: 20px; } .k-num.n22 { font-size: 22px; }
.k-num.n28 { font-size: 28px; line-height: 1.2; } .k-num.n30 { font-size: 30px; line-height: 1.2; } .k-num.n44 { font-size: 44px; line-height: 1.1; }
.k-num small { font-size: 15px; color: var(--k-mute); }
.k-mute { color: var(--k-mute); }
.k-gold { color: var(--k-gold) !important; } .k-burn { color: var(--k-burn) !important; } .k-bad { color: var(--k-bad) !important; } .k-good { color: var(--k-good) !important; }
.k-text { font-size: 15px; line-height: 1.45; }

/* Section: gold title, hairline, optional sm button */
.k-sec { margin-top: 32px; }
.k-sechead { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; border-bottom: 1px solid var(--k-line); padding-bottom: 10px; }
.k-sechead .k-heading { flex-shrink: 1; }

/* Row */
.k-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--k-line); color: var(--k-text); text-decoration: none; }
a.k-row:hover, button.k-row:hover { opacity: .75; }
.k-row-text { flex: 1; min-width: 0; font-size: 17px; }
.k-rowsub { color: var(--k-mute); font-size: 14px; line-height: 19px; margin-top: 3px; }
.k-row-right { display: flex; align-items: center; gap: 8px; }
.k-chev { color: var(--k-mute); display: inline-flex; }

/* Hero: the one box on a screen */
.k-hero { background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 6px; padding: 16px; margin-top: 16px; }

/* Scoreboard */
.k-score { display: flex; }
.k-score > div { flex: 1; padding: 10px 0; min-width: 0; }
.k-score > div.wide { flex: 1.3; }
.k-score > div + div { border-left: 1px solid var(--k-line); padding-left: 12px; }
.k-score .k-num { font-size: 28px; line-height: 1.2; }
.k-score .k-label { margin-top: 4px; }

/* Buttons */
.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--k-num); font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; border-radius: 4px; white-space: nowrap; text-decoration: none; cursor: pointer; border: 0; background: var(--k-gold); color: var(--k-bg); padding: 13px 18px; font-size: 17px; }
.k-btn:hover { background: var(--k-gold-pressed); }
.k-btn.sm { min-height: 36px; padding: 0 14px; font-size: 15px; }
.k-btn.secondary { background: transparent; border: 1px solid var(--k-line); color: var(--k-text); }
.k-btn.secondary:hover { opacity: .7; background: transparent; }
.k-btn.full { width: 100%; }
.k-btn:disabled { opacity: .45; cursor: default; }
.k-link { color: var(--k-gold); font-weight: 600; text-decoration: none; }

/* Pills */
.k-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.k-pill { border: 1px solid var(--k-line); border-radius: 4px; padding: 7px 10px; font-family: var(--k-num); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--k-mute); background: none; cursor: pointer; }
.k-pill.on { border-color: var(--k-gold); color: var(--k-gold); }

/* Checkbox (set and exercise check-off) */
.k-check { width: 24px; height: 24px; flex: none; border: 1.5px solid #3A342A; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: var(--k-bg); background: none; cursor: pointer; }
.k-check.small { width: 20px; height: 20px; }
.k-check.on { background: var(--k-gold); border-color: var(--k-gold); }

/* Progress bar, avatar, field */
.k-bar { height: 6px; background: var(--k-line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.k-bar > i { display: block; height: 100%; background: var(--k-gold); border-radius: 3px; }
.k-av { width: 34px; height: 34px; border-radius: 50%; background: #13110e; border: 1px solid var(--k-line); display: inline-flex; align-items: center; justify-content: center; font-family: var(--k-num); font-weight: 700; color: var(--k-mute); flex: none; overflow: hidden; }
.k-av img { width: 100%; height: 100%; object-fit: cover; }
.k-field { width: 100%; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 4px; color: var(--k-text); font-family: var(--k-body); font-size: 17px; padding: 11px 12px; }
.k-field:focus { outline: none; border-color: var(--k-gold); }
select.k-field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--k-mute) 50%), linear-gradient(135deg, var(--k-mute) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; cursor: pointer; }

/* Bottom sheet and toast */
.k-sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; }
.k-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 640px; margin: 0 auto; background: rgba(26,23,18,.98); border-top: 1px solid rgba(234,179,8,.35); border-radius: 16px 16px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); }
.k-sheet .k-handle { width: 38px; height: 5px; border-radius: 3px; background: var(--k-faint); margin: 0 auto 12px; }
.k-toast { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; max-width: 616px; margin: 0 auto; z-index: 70; background: var(--k-gold); color: var(--k-bg); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; font-size: 14px; }

/* App navigation */
.k-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--k-line); background: var(--k-bg); display: flex; justify-content: space-around; align-items: center; }
.k-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--k-mute); font-family: var(--k-num); font-weight: 600; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; text-decoration: none; padding: 6px 0; }
.k-tabs a.on { color: var(--k-gold); }
body.has-bottom-tabs .k-col { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.k-topbar { display: none; }
@media (min-width: 641px) {
  .k-tabs { display: none; }
  body.has-bottom-tabs .k-col { padding-bottom: 40px; }
  .k-topbar { display: block; position: sticky; top: 0; z-index: 40; background: rgba(11,10,8,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--k-line); }
  .k-topbar-row { max-width: 1100px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
  .k-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--k-text); font-family: var(--k-num); font-weight: 700; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
  .k-brand img { width: 40px; height: 40px; border-radius: 50%; }
  .k-toptabs { display: flex; gap: 24px; flex: 1; }
  .k-toptabs a { font-family: var(--k-num); font-weight: 600; font-size: 15px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--k-mute); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
  .k-toptabs a:hover { color: var(--k-text); }
  .k-toptabs a.on { color: var(--k-gold); border-bottom-color: var(--k-gold); }
  .k-phone-only { display: none !important; }
}
/* Bell: the app's gold ring with a red count */
.k-bell { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--k-gold); color: var(--k-gold); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.k-iconbtn { position: relative; color: var(--k-mute); display: inline-flex; padding: 6px; text-decoration: none; }
.k-iconbtn:hover { color: var(--k-text); }
.k-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--k-bad); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.k-count.hidden { display: none; }

/* Phones: no top bar, so the page itself clears the status bar / notch when
   saved to the home screen (viewport-fit=cover + black-translucent). */
@media (max-width: 640px) {
  .k-col { padding-top: calc(22px + env(safe-area-inset-top)); }
}

/* Sheets as overlays: the backdrop is the modal (click it to close), the
   sheet sits at the bottom like the app's BottomSheet. */
.k-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: none; align-items: flex-end; justify-content: center; }
.k-modal:not(.hidden) { display: flex; }
.k-modal > .k-sheet { position: relative; left: auto; right: auto; bottom: auto; width: 100%; max-height: 92vh; overflow-y: auto; }
.k-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.k-sheet-title { font-family: var(--k-num); font-weight: 700; font-size: 22px; line-height: 1.2; text-transform: uppercase; color: var(--k-text); }
.k-sheet-cancel { color: var(--k-mute); font-size: 14px; background: none; border: 0; cursor: pointer; }
.k-sheet-sub { color: var(--k-mute); font-size: 13px; margin-bottom: 4px; }
.k-sheet-body { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.k-sheet-buttons { display: flex; gap: 10px; margin-top: 8px; }
.k-sheet-buttons > * { flex: 1; }
.k-flabel { display: flex; align-items: center; gap: 4px; font-family: var(--k-num); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--k-mute); margin-bottom: 4px; }
.k-field.sm { font-size: 15px; padding: 10px 12px; }
.k-error { color: var(--k-bad); font-size: 14px; }
.k-error.hidden { display: none; }
.k-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.k-chip { padding: 7px 12px; border-radius: 4px; border: 1px solid var(--k-line); background: none; color: var(--k-mute); font-size: 13px; font-weight: 600; cursor: pointer; }
.k-chip.on { border-color: var(--k-gold); color: var(--k-gold); }

/* Workout day card (mobile workout-day-card.tsx) */
.k-daycard-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--k-line); margin-top: 8px; }
.k-daycard-head .k-label { font-size: 11.5px; margin-top: 3px; }
.k-complete { padding: 10px; border-bottom: 1px solid var(--k-line); background: rgba(234,179,8,.08); color: var(--k-gold); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.k-complete.hidden { display: none; }
.k-ex { padding: 14px 0; }
.k-ex + .k-ex { border-top: 1px solid var(--k-line); }
.k-ex-head { display: flex; align-items: flex-start; gap: 12px; }
.k-ex-head > .k-check { margin-top: 2px; }
.k-ex-name { font-size: 16px; font-weight: 700; color: var(--k-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; }
.k-small { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--k-mute); }
.k-tag { background: var(--k-line); border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--k-mute); flex: none; }
.k-coachtag { align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(234,179,8,.3); background: rgba(234,179,8,.08); color: var(--k-gold); font-size: 12px; font-weight: 700; cursor: pointer; }
.k-sets { margin: 10px 0 0 36px; display: flex; flex-direction: column; gap: 8px; }
.k-setline { display: flex; align-items: center; gap: 10px; }
.k-setline.todo { opacity: .75; }
.k-setline > button.k-setbody { flex: 1; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--k-text); }
.k-setlabel { font-size: 12px; color: var(--k-mute); width: 38px; flex: none; }
.k-setactions { display: flex; gap: 18px; padding-top: 4px; }
.k-textbtn { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; color: var(--k-mute); }
.k-textbtn.gold { color: var(--k-gold); font-weight: 600; }
.k-footbtn { display: block; width: 100%; border: 0; border-top: 1px solid var(--k-line); background: none; padding: 14px 0; text-align: center; color: var(--k-gold); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }

/* Rest timer: a bar along the bottom with a gold top edge (above the tab bar on phones) */
.k-restbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--k-surface); border-top: 1px solid var(--k-gold); }
.k-restbar.hidden { display: none; }
.k-restbar-in { max-width: 640px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 8px; }
body.has-bottom-tabs .k-restbar { bottom: calc(66px + env(safe-area-inset-bottom)); }
body.resting .k-col { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
@media (min-width: 641px) { body.has-bottom-tabs .k-restbar { bottom: 0; } body.resting .k-col { padding-bottom: 110px; } }

/* Celebrations (mobile celebration.tsx): the PR card and confetti */
.k-celebrate { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; cursor: pointer; }
.k-celebrate-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--k-surface); border: 2px solid var(--k-gold); border-radius: 20px; padding: 28px 20px; animation: k-pop .45s cubic-bezier(.3,1.6,.5,1); }
.k-celebrate-kicker { color: var(--k-gold); font-weight: 800; letter-spacing: 2px; font-size: 14px; }
.k-celebrate-title { font-size: 24px; line-height: 30px; font-weight: 800; text-align: center; }
.k-celebrate-detail { font-size: 15px; color: var(--k-mute); text-align: center; }
.k-compare { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.k-compare > div { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--k-line); border-radius: 10px; padding: 8px 12px; }
.k-compare small { font-size: 11px; color: var(--k-mute); }
.k-compare b { font-size: 18px; font-weight: 700; }
.k-confetti { position: absolute; top: 0; left: 0; border-radius: 1px; pointer-events: none; animation: k-fall var(--d) cubic-bezier(.25,.46,.45,.94) var(--delay) forwards; }
@keyframes k-pop { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes k-fall { from { transform: translate(var(--x), -20px) rotate(0); opacity: 1; } to { transform: translate(calc(var(--x) + var(--drift)), calc(100vh + 20px)) rotate(var(--spin)); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .k-confetti { display: none; } .k-celebrate-card { animation: none; } }
.k-toast.k-toast-in { animation: k-slide .35s ease-out; }
@keyframes k-slide { from { transform: translateY(-120%); } to { transform: none; } }
.k-check:not(.on) svg { visibility: hidden; }

/* Exercise picker dropdown, error box */
.k-dropdown { background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 6px; margin-top: 4px; max-height: 16rem; overflow-y: auto; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.k-opt { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--k-text); list-style: none; }
.k-opt:hover { background: var(--k-line); }
.k-opt-region { font-weight: 700; padding: 8px; }
.k-opt-tier { font-family: var(--k-num); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--k-mute); }
.k-opt-indent { padding-left: 12px; border-left: 1px solid var(--k-line); margin-left: 8px; }
.k-errorbox { padding: 8px; background: rgba(229,72,77,.08); border: 1px solid var(--k-bad); border-radius: 4px; color: var(--k-bad); font-size: 12px; }
.k-errorbox.hidden { display: none; }
.k-fieldrow { display: flex; gap: 10px; }
.k-fieldrow.hidden { display: none; }

/* Training · 12 wk (mobile training-heatmap.tsx): square cells, gold for trained, today outlined */
.k-heatmap { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 4px; }
.k-heat { display: block; aspect-ratio: 1; background: var(--k-line); }
.k-heat.on { background: var(--k-gold); }
.k-heat.future { background: transparent; }
.k-heat.today { box-shadow: inset 0 0 0 1.5px var(--k-text); }

/* Workout day picker (mobile workout-day-picker.tsx) */
.k-daypick { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 4px; padding: 10px 12px; color: var(--k-text); cursor: pointer; }
.k-daypick.on { border-color: var(--k-gold); background: rgba(234,179,8,.08); }
.k-daypick.hidden { display: none; }
.k-goal { padding: 12px 0; }
.k-goal + .k-goal { border-top: 1px solid var(--k-line); }

/* Cardio sheet activity chips (mobile CardioSheet) */
.k-actchips { display: flex; flex-wrap: wrap; gap: 6px; }
.k-actchip { padding: 6px 10px; border-radius: 14px; border: 0; background: var(--k-line); color: var(--k-text); font-size: 13px; cursor: pointer; }
.k-actchip.on { background: var(--k-gold); color: var(--k-bg); }
/* Hidden wrappers that use the kit's flex rows */
#cardio-distance-wrap.hidden, #cardio-hr-wrap.hidden, #cardio-activity-wrap.hidden, #cardio-date-wrap.hidden { display: none; }

/* Nutrition (mobile nutrition.tsx and the food sheets) */
.k-foodrow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--k-line); }
.k-foodrow.todo { opacity: .8; }
.k-foodbody { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; background: none; border: 0; padding: 0; color: var(--k-text); cursor: pointer; }
.k-stepbtn { width: 48px; height: 48px; border-radius: 4px; border: 1px solid var(--k-line); background: var(--k-surface); color: var(--k-text); font-size: 24px; cursor: pointer; flex: none; }
.k-stepbtn:disabled { opacity: .4; cursor: default; }
.k-preview { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--k-bg); border: 1px solid var(--k-line); border-radius: 4px; padding: 8px 4px; }
#goal-rate-wrap.hidden, #goal-target-weight-wrap.hidden { display: none; }
.k-reciperow { padding: 12px 0; border-bottom: 1px solid var(--k-line); }

/* Meet Prep (mobile meet-prep.tsx): fold rows, day pills, template cards */
.k-fold > summary { list-style: none; }
.k-fold > summary::-webkit-details-marker { display: none; }
.k-foldrow { display: flex; align-items: center; gap: 10px; padding: 11px 2px 11px 0; border-bottom: 1px solid var(--k-line); cursor: pointer; }
.k-foldtitle { font-size: 17px; font-weight: 500; color: var(--k-text); }
.k-foldsub { display: block; font-size: 15px; color: var(--k-mute); margin-top: 2px; }
.k-caret { color: var(--k-mute); display: inline-flex; transition: transform .15s; }
.k-fold[open] > summary .k-caret { transform: rotate(180deg); }
.k-daypills { display: flex; flex-wrap: wrap; gap: 8px; }
.k-daypill { padding: 7px 12px; border-radius: 4px; border: 1px solid var(--k-line); font-family: var(--k-num); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--k-mute); cursor: pointer; }
.k-daypill input { position: absolute; opacity: 0; width: 0; height: 0; }
.k-daypill:has(input:checked) { border-color: var(--k-gold); color: var(--k-gold); }
.k-daypill:has(input:focus-visible), .k-tplcard:has(input:focus-visible) { outline: 2px solid var(--k-gold); outline-offset: 2px; }
.k-tplcard { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--k-line); border-radius: 6px; cursor: pointer; }
.k-tplcard input { accent-color: var(--k-gold); margin-top: 4px; }
.k-tplcard:has(input:checked) { border-color: var(--k-gold); }
#template-ohp-field.hidden, .plan-tab-content.hidden { display: none; }

/* Friends (mobile friends.tsx, leaderboard-strip.tsx, activity-feed.tsx) */
.k-boardrow { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--k-line); }
.k-boardrow.me { background: rgba(234,179,8,.08); }
.k-feedrow { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--k-line); }
.k-respect { border: 1px solid var(--k-gold); background: none; color: var(--k-gold); border-radius: 4px; padding: 5px 9px; font-family: var(--k-num); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; flex: none; }
.k-respect.on { background: var(--k-gold); color: var(--k-bg); }
.k-textact { background: none; border: 0; padding: 0 4px; color: var(--k-mute); font-size: 15px; cursor: pointer; }
.k-textact:hover { color: var(--k-text); }
.k-radiolist { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.k-radiolist label, .k-radiolist-one { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.k-radiolist input, .k-radiolist-one input { accent-color: var(--k-gold); width: 18px; height: 18px; }
#invite-qr svg { width: 100%; height: 100%; }
#invite-qr svg rect[fill="#ffffff"], #invite-qr svg rect[fill="white"] { fill: transparent; }
#invite-qr svg path, #invite-qr svg rect[fill="#000000"] { fill: var(--k-text); }
.k-badgerow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--k-line); }
.k-notifrow { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--k-line); cursor: pointer; }
.k-notifdot { width: 6px; height: 6px; border-radius: 3px; margin-top: 8px; flex: none; background: transparent; }
.k-notifdot.on { background: var(--k-gold); }
#mark-all.hidden { display: none; }

/* Message thread (mobile message-thread.tsx, ui/bubble.tsx, ui/compose-bar.tsx) */
.k-thread { display: flex; flex-direction: column; gap: 10px; padding: 12px; max-height: 28rem; min-height: 14rem; overflow-y: auto; }
/* Newest at the bottom when the thread is short, without flex-end (which makes overflow unscrollable). */
.k-thread > :first-child { margin-top: auto; }
.k-thread-empty { font-size: 15px; text-align: center; padding: 24px 0; margin: auto 0; }
.k-bubblewrap { display: flex; flex-direction: column; gap: 3px; max-width: 80%; align-self: flex-start; }
.k-bubblewrap.mine { align-self: flex-end; align-items: flex-end; }
.k-bubble { background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 6px; padding: 8px 12px; color: var(--k-text); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.k-bubble.mine { background: var(--k-gold); border-color: var(--k-gold); color: var(--k-bg); }
.k-bubbletime { font-size: 10.5px; }
.k-compose { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; background: var(--k-surface); border-top: 1px solid var(--k-line); }
.k-compose-input { flex: 1; min-width: 0; max-height: 120px; resize: none; background: var(--k-bg); border: 1px solid var(--k-line); border-radius: 4px; color: var(--k-text); font-family: var(--k-body); font-size: 15px; padding: 8px 10px; }
.k-compose-input:focus { outline: none; border-color: var(--k-gold); }

/* Check-ins (mobile check-in.tsx, components/check-ins.tsx) */
.k-tag2 { display: inline-block; border: 1px solid var(--k-line); border-radius: 4px; padding: 2px 6px; font-family: var(--k-num); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--k-mute); }
.k-tag2.gold { border-color: var(--k-gold); color: var(--k-gold); }
.k-tag2.green { border-color: var(--k-good); color: var(--k-good); }
.k-tag2.red { border-color: var(--k-bad); color: var(--k-bad); }
.k-rate { flex: 1; padding: 9px 0; border-radius: 4px; border: 1px solid var(--k-line); background: none; color: var(--k-mute); font-family: var(--k-num); font-weight: 700; font-size: 18px; cursor: pointer; }
.k-rate.on { border-color: var(--k-gold); color: var(--k-gold); }

/* Switch (the app's Switch) and a visually hidden file input */
.k-switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--k-line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.k-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--k-text); transition: transform .15s; }
.k-switch:checked { background: var(--k-gold); }
.k-switch:checked::after { transform: translateX(20px); }
.k-switch:focus-visible { outline: 2px solid var(--k-gold); outline-offset: 2px; }
.k-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.k-custom-empty { font-size: 15px; padding: 10px 0; }
#delete-account-form.hidden, #delete-account-open.hidden { display: none !important; }
/* The full-size screenshot view (/help, Admin → Tickets) has an inline display:flex. */
#shot-zoom.hidden { display: none !important; }

/* Sign in / sign up / password pages (mobile styles/auth.ts) */
.k-auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom)); }
.k-auth-logo { width: 160px; height: 160px; border-radius: 50%; display: block; margin: 0 auto 12px; }
.k-auth-logo.sm { width: 96px; height: 96px; }
.k-auth-title { font-family: var(--k-num); font-weight: 700; font-size: 26px; text-transform: uppercase; text-align: center; margin-bottom: 6px; color: var(--k-text); }
.k-auth-sub { color: var(--k-mute); font-size: 14px; text-align: center; margin-bottom: 8px; }
.k-auth form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.k-auth-error { color: var(--k-bad); text-align: center; font-size: 15px; margin-top: 12px; }
.k-auth-link { display: block; text-align: center; margin-top: 16px; color: var(--k-mute); font-size: 14px; text-decoration: none; }
.k-auth-link b { color: var(--k-gold); font-weight: 500; }
.k-pwwrap { position: relative; }
.k-pwwrap .k-field { padding-right: 44px; }
.k-pweye { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--k-mute); cursor: pointer; }
.k-pweye .hidden { display: none; }


/* Public documents (support, privacy) */
.k-doc { color: #d8d3c9; font-size: 16px; line-height: 1.6; }
.k-doc-col { max-width: 720px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top)) 20px 48px; display: flex; flex-direction: column; gap: 22px; }
.k-doc-h { margin-top: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--k-line); }
.k-doc-sec { display: flex; flex-direction: column; gap: 12px; }
.k-doc-q { color: var(--k-text); font-weight: 600; }
.k-doc-strong { color: var(--k-text); }
.k-doc-p { margin-top: 4px; }
.k-doc-list { list-style: disc; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.k-doc a.k-link { font-weight: 500; }
.k-ob { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.k-flabel-wrap { display: block; font-family: var(--k-num); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--k-mute); flex: 1; }
.k-flabel-wrap > .k-field { margin-top: 4px; letter-spacing: 0; text-transform: none; font-family: var(--k-body); font-weight: 400; color: var(--k-text); }

/* Billing */
.k-billing { display: flex; flex-direction: column; gap: 16px; }
.k-stack { display: flex; flex-direction: column; gap: 12px; }
.k-okbox { border: 1px solid var(--k-good); background: rgba(134,179,107,.08); border-radius: 4px; padding: 12px; }
.k-checklist { text-align: left; display: flex; flex-direction: column; gap: 10px; font-size: 15px; margin-bottom: 20px; }
.k-checkitem { display: flex; align-items: center; gap: 8px; }
.k-planbox { background: var(--k-bg); border: 1px solid var(--k-line); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }

/* Pages without Tailwind (auth-head) get its base reset too: border-box sizing, no default margins. */
*, *::before, *::after { box-sizing: border-box; }
:where(body.k-plain) { margin: 0; }
:where(.k-plain) :where(h1, h2, h3, p, ul, form) { margin: 0; }
:where(.k-plain) :where(button, input, select, textarea) { font-family: inherit; font-size: inherit; }
:where(.k-plain) :where(img) { display: block; }

/* Admin (round 6): cards, tabs, tints. The app's admin screens are ports of these pages. */
.k-card { background: var(--k-surface); border: 1px solid var(--k-line); border-radius: 6px; }
.k-card-gold { border-color: var(--k-gold); }
.k-tint-gold { background: rgba(234,179,8,.12); color: var(--k-gold); }
.k-tint-gold:hover { background: rgba(234,179,8,.2); }
.k-b-gold { border-color: rgba(234,179,8,.5); }
.k-admintab { flex: 1; white-space: nowrap; padding: 12px 14px; background: none; border: 0; border-bottom: 2px solid transparent; font-family: var(--k-num); font-weight: 600; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--k-mute); cursor: pointer; }
.k-admintab:hover { color: var(--k-text); }
.k-admintab.on { color: var(--k-gold); border-bottom-color: var(--k-gold); }
.k-dangerbox { border: 1px solid var(--k-bad); border-radius: 6px; padding: 16px; background: rgba(229,72,77,.06); }

/* Inside an admin card the surface is plate (#15130F), so plate lines, chips, tracks
   and hovers would vanish into it: use the line color there instead. */
.k-card .border-plate { border-color: var(--k-line); }
.k-card .divide-plate > :not([hidden]) ~ :not([hidden]) { border-color: var(--k-line); }
.k-card .bg-plate { background-color: var(--k-line); }
.k-card .hover\:bg-plate:hover { background-color: var(--k-line); }
/* A field that sits inline with text or buttons (selects in a sentence). */
.k-field.inline { width: auto; display: inline-block; }

/* Readable placeholder text in kit fields, and the unchecked ring of a check-off circle. */
.k-field::placeholder { color: var(--k-placeholder); opacity: 1; }
.k-ring-off { border-color: var(--k-placeholder); }
/* A gold button whose label may wrap on a phone (long admin labels). */
.k-btn.wrap { white-space: normal; text-align: center; line-height: 1.2; padding-top: 8px; padding-bottom: 8px; height: auto; }

/* Last in the file, so no kit class that sets display can show a .hidden element
   (pages without Tailwind, and header pages before the Tailwind CDN script runs). */
.hidden { display: none; }
