/* =====================================================================================================================
   BetaKai mobile-first design system (SPEC.md Section 7).
   Phone first (360-430 px), then tablet (>= 768 px) and desktop (>= 1024 px, sidebar layout).
   - 100dvh sizing, safe-area insets, zero horizontal overflow
   - 48x48 px minimum tap targets, 16 px inputs (no iOS zoom), thumb-zone bottom sheets
   - card-based lists instead of wide tables below 768 px
   - persistent 5-icon #mobile-bottom-nav (< 768 px), desktop sidebar (>= 768 px)
   ===================================================================================================================== */

:root {
  --bk-green: #119043;
  --bk-green-dark: #0c6e33;
  --bk-green-soft: rgba(17, 144, 67, 0.12);
  --bk-indigo: #4f46e5;
  --bk-indigo-dark: #4338ca;
  --bk-indigo-soft: rgba(79, 70, 229, 0.12);
  --bk-bg: #f6f7f9;
  --bk-surface: #ffffff;
  --bk-surface-2: #f1f3f6;
  --bk-surface-3: #e8ebf0;
  --bk-text: #111827;
  --bk-text-2: #4b5563;
  --bk-text-3: #6b7280;
  --bk-border: #e5e7eb;
  --bk-danger: #dc2626;
  --bk-danger-soft: rgba(220, 38, 38, 0.1);
  --bk-warning: #d97706;
  --bk-warning-soft: rgba(217, 119, 6, 0.12);
  --bk-success: #15803d;
  --bk-success-soft: rgba(21, 128, 61, 0.12);
  --bk-info: #0369a1;
  --bk-info-soft: rgba(3, 105, 161, 0.1);
  /* Stressor colours (calendar borders, chips) */
  --bk-stressor-nhi: #dc2626;
  --bk-stressor-mhi: #ea580c;
  --bk-stressor-aer: #0284c7;
  --bk-stressor-skl: #7c3aed;
  --bk-stressor-flx: #0d9488;
  --bk-stressor-rec: #16a34a;
  --bk-stressor-ns: #6b7280;
  --bk-radius: 16px;
  --bk-radius-sm: 10px;
  --bk-radius-xs: 6px;
  --bk-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 8px 24px rgba(17, 24, 39, 0.08);
  --bk-shadow-lg: 0 -4px 24px rgba(17, 24, 39, 0.18);
  --bk-nav-height: 64px;
  --bk-sidebar-width: 248px;
  --bk-safe-bottom: env(safe-area-inset-bottom, 0px);
  --bk-safe-top: env(safe-area-inset-top, 0px);
  --bk-safe-left: env(safe-area-inset-left, 0px);
  --bk-safe-right: env(safe-area-inset-right, 0px);
  --bk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bk-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --bk-tap: 48px;
  --bk-field-bg: #ffffff;
  --bk-field-border: #cfd5de;
  --bk-placeholder: #9ca3af;
  --bk-nav-bg: rgba(255, 255, 255, 0.86);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bk-bg: #0b1220;
    --bk-surface: #121a2b;
    --bk-surface-2: #182236;
    --bk-surface-3: #1f2b44;
    --bk-text: #f3f4f6;
    --bk-text-2: #c7cdd8;
    --bk-text-3: #9aa3b2;
    --bk-border: #263147;
    --bk-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --bk-shadow-lg: 0 -4px 24px rgba(0, 0, 0, 0.5);
    --bk-field-bg: #22304d;
    --bk-field-border: #3f5072;
    --bk-placeholder: #75819a;
    --bk-nav-bg: rgba(18, 26, 43, 0.86);
    --bk-green-soft: rgba(17, 144, 67, 0.22);
    --bk-indigo-soft: rgba(99, 102, 241, 0.22);
  }
}
:root[data-theme="dark"] {
  --bk-bg: #0b1220;
  --bk-surface: #121a2b;
  --bk-surface-2: #182236;
  --bk-surface-3: #1f2b44;
  --bk-text: #f3f4f6;
  --bk-text-2: #c7cdd8;
  --bk-text-3: #9aa3b2;
  --bk-border: #263147;
  --bk-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --bk-shadow-lg: 0 -4px 24px rgba(0, 0, 0, 0.5);
  --bk-field-bg: #22304d;
  --bk-field-border: #3f5072;
  --bk-placeholder: #75819a;
  --bk-nav-bg: rgba(18, 26, 43, 0.86);
  --bk-green-soft: rgba(17, 144, 67, 0.22);
  --bk-indigo-soft: rgba(99, 102, 241, 0.22);
}

/* ---------------------------------------------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: visible !important;
}

body {
  margin: 0;
  min-height: 100vh;
  height: auto !important;
  background: var(--bk-bg);
  color: var(--bk-text);
  font-family: var(--bk-font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  overflow-y: visible !important;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(5rem + var(--bk-safe-bottom));
}

body.bk-no-nav {
  padding-bottom: var(--bk-safe-bottom);
}

body.bk-sheet-open {
  overflow: hidden !important;
}

/* Full-screen flows (wizards, workout session): the bottom nav never covers the sticky footer. */
body.bk-flow #mobile-bottom-nav {
  display: none !important;
}
body.bk-flow {
  padding-bottom: calc(1rem + var(--bk-safe-bottom));
}
body.bk-flow .bk-wizard-actions,
body.bk-flow .bk-action-bar,
body.bk-flow .ws-thumb {
  bottom: 0 !important;
  padding-bottom: calc(12px + var(--bk-safe-bottom));
}


a {
  color: var(--bk-indigo);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

img,
svg,
video {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1.02rem;
}
h4 {
  font-size: 0.92rem;
  color: var(--bk-text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p {
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}

ul,
ol {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

code,
.bk-mono {
  font-family: var(--bk-mono);
}

:focus-visible {
  outline: 3px solid var(--bk-indigo);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--bk-indigo-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------------------------------- layout */
.bk-app {
  display: block;
  min-height: 100dvh;
}

.bk-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + var(--bk-safe-top)) max(16px, var(--bk-safe-right)) 16px max(16px, var(--bk-safe-left));
}

.bk-container-wide {
  max-width: 560px;
}

/* Compact sticky page header */
.bk-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bk-border);
  padding-top: var(--bk-safe-top);
}

.bk-topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}

.bk-topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bk-topbar-title small {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--bk-text-3);
}

.bk-icon-btn {
  width: max(44px, var(--bk-tap));
  height: max(44px, var(--bk-tap));
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--bk-text);
  cursor: pointer;
  position: relative;
}

.bk-icon-btn:hover {
  background: var(--bk-surface-2);
}

.bk-icon-btn svg {
  width: 24px;
  height: 24px;
}

.bk-page-title {
  margin: 8px 0 14px;
}

.bk-page-title p {
  color: var(--bk-text-3);
  font-size: 0.92rem;
  margin: 2px 0 0;
}

/* Page sections */
.bk-section {
  margin: 0 0 20px;
}

.bk-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bk-section-head h2 {
  margin: 0;
}

.bk-section-head a,
.bk-section-head .bk-link {
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

/* ---------------------------------------------------------------------------------------------------- cards */
.bk-card {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  min-width: 0;
}

.bk-card-flat {
  box-shadow: none;
}

.bk-card-tight {
  padding: 14px;
}

.bk-card-clickable {
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.bk-card-clickable:active {
  transform: scale(0.99);
}

.bk-card-hero {
  /* v3.9: solid brand green instead of the green-to-indigo gradient */
  background: var(--bk-green-dark);
  color: #fff;
  border: 0;
}

.bk-card-hero .bk-muted,
.bk-card-hero .bk-small {
  color: rgba(255, 255, 255, 0.82);
}

.bk-card-hero h2,
.bk-card-hero h1 {
  color: #fff;
}

.bk-card-hero .bk-btn-outline {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.bk-card-hero .bk-btn-primary {
  background: #fff;
  color: var(--bk-green-dark);
}

/* Left stressor border on list cards (calendar / sessions) */
.bk-card[data-stressor],
.bk-list-item[data-stressor] {
  border-left: 5px solid var(--bk-stressor-ns);
}
[data-stressor="NHI"] {
  border-left-color: var(--bk-stressor-nhi) !important;
}
[data-stressor="MHI"] {
  border-left-color: var(--bk-stressor-mhi) !important;
}
[data-stressor="AER"] {
  border-left-color: var(--bk-stressor-aer) !important;
}
[data-stressor="SKL"] {
  border-left-color: var(--bk-stressor-skl) !important;
}
[data-stressor="FLX"] {
  border-left-color: var(--bk-stressor-flx) !important;
}
[data-stressor="REC"] {
  border-left-color: var(--bk-stressor-rec) !important;
}
[data-stressor="NS"] {
  border-left-color: var(--bk-stressor-ns) !important;
}

/* Stressor chip */
.bk-stressor {
  /* v3.9: quiet tinted chip with a coloured dot instead of a solid block with an emoji */
  --bk-s-color: var(--bk-stressor-ns);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bk-text-2);
  background: var(--bk-surface-2);
  white-space: nowrap;
}
.bk-stressor::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bk-s-color);
  flex: 0 0 auto;
}
.bk-stressor[data-s="NHI"] {
  --bk-s-color: var(--bk-stressor-nhi);
}
.bk-stressor[data-s="MHI"] {
  --bk-s-color: var(--bk-stressor-mhi);
}
.bk-stressor[data-s="AER"] {
  --bk-s-color: var(--bk-stressor-aer);
}
.bk-stressor[data-s="SKL"] {
  --bk-s-color: var(--bk-stressor-skl);
}
.bk-stressor[data-s="FLX"] {
  --bk-s-color: var(--bk-stressor-flx);
}
.bk-stressor[data-s="REC"] {
  --bk-s-color: var(--bk-stressor-rec);
}
.bk-card-hero .bk-stressor {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Mobile list (cards instead of tables) */
.bk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-sm);
  text-align: left;
  width: 100%;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}

.bk-list-item:active {
  background: var(--bk-surface-2);
}

.bk-list-item.is-static {
  cursor: default;
}

.bk-list-item .bk-list-body {
  flex: 1;
  min-width: 0;
}

.bk-list-item .bk-list-title {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-list-item .bk-list-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--bk-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-list-item .bk-list-trail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--bk-text-3);
}

.bk-list-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bk-surface-2);
  font-size: 1.2rem;
}

.bk-chevron {
  width: 20px;
  height: 20px;
  color: var(--bk-text-3);
}

/* Key-value rows (mobile-card version of a table) */
.bk-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 0.9rem;
}

.bk-kv dt {
  color: var(--bk-text-3);
}

.bk-kv dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

/* Stat / KPI tiles */
.bk-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.bk-kpi {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-sm);
  padding: 12px 14px;
  min-width: 0;
}

.bk-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--bk-mono);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.bk-kpi-label {
  font-size: 0.78rem;
  color: var(--bk-text-3);
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------------------------------- typography utils */
.bk-muted {
  color: var(--bk-text-3);
  font-size: 0.9rem;
}
.bk-small {
  font-size: 0.85rem;
}
.bk-tiny {
  font-size: 0.75rem;
}
.bk-center {
  text-align: center;
}
.bk-right {
  text-align: right;
}
.bk-bold {
  font-weight: 700;
}
.bk-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-green {
  color: var(--bk-green);
}
.bk-indigo {
  color: var(--bk-indigo);
}
.bk-danger {
  color: var(--bk-danger);
}
.bk-warning {
  color: var(--bk-warning);
}

.bk-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bk-stack-sm {
  gap: 8px;
}
.bk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bk-row-sm {
  gap: 8px;
}
.bk-row-between {
  justify-content: space-between;
}
.bk-row-wrap {
  flex-wrap: wrap;
}
.bk-grow {
  flex: 1;
  min-width: 0;
}
.bk-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.bk-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bk-mt-0 {
  margin-top: 0 !important;
}
.bk-mt-1 {
  margin-top: 8px;
}
.bk-mt-2 {
  margin-top: 16px;
}
.bk-mb-0 {
  margin-bottom: 0 !important;
}
.bk-mb-1 {
  margin-bottom: 8px;
}
.bk-mb-2 {
  margin-bottom: 16px;
}
.bk-hidden {
  display: none !important;
}
.bk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------------------------------------------------------------------------------------------------- buttons */
.bk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: max(44px, var(--bk-tap));
  padding: 0 18px;
  line-height: 1.2;
  max-width: 100%;
  width: 100%;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-align: center;
  white-space: nowrap;
}

.bk-btn:active {
  transform: scale(0.98);
}

.bk-btn:disabled,
.bk-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.bk-btn-primary {
  background: var(--bk-green);
  color: #fff;
}
.bk-btn-primary:hover:not(:disabled) {
  background: var(--bk-green-dark);
}

.bk-btn-indigo {
  background: var(--bk-indigo);
  color: #fff;
}
.bk-btn-indigo:hover:not(:disabled) {
  background: var(--bk-indigo-dark);
}

.bk-btn-outline {
  background: var(--bk-surface);
  color: var(--bk-text);
  border-color: var(--bk-border);
}
.bk-btn-outline:hover:not(:disabled) {
  background: var(--bk-surface-2);
}

.bk-btn-soft {
  background: var(--bk-indigo-soft);
  color: var(--bk-indigo);
}

.bk-btn-ghost {
  background: transparent;
  color: var(--bk-indigo);
  width: auto;
  min-height: 44px;
  padding: 0 10px;
}

.bk-btn-danger {
  background: var(--bk-danger);
  color: #fff;
}

.bk-btn-danger-soft {
  background: var(--bk-danger-soft);
  color: var(--bk-danger);
}

.bk-btn-warning {
  background: var(--bk-warning);
  color: #fff;
}

.bk-btn-lg {
  min-height: 56px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.bk-btn-sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
  width: auto;
}

.bk-btn-block {
  width: 100%;
}

.bk-btn-auto {
  width: auto;
}

.bk-btn-row {
  display: flex;
  gap: 10px;
}

.bk-btn-row .bk-btn {
  flex: 1;
}

/* Icon-only square action (48x48) */
.bk-btn-square {
  width: var(--bk-tap);
  min-width: var(--bk-tap);
  height: var(--bk-tap);
  padding: 0;
  border-radius: 12px;
}

/* Stepper (+/-) */
.bk-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--bk-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bk-surface);
}

.bk-stepper button {
  width: 52px;
  height: 52px;
  border: 0;
  background: var(--bk-surface-2);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--bk-text);
}

.bk-stepper button:active {
  background: var(--bk-surface-3);
}

.bk-stepper output,
.bk-stepper .bk-stepper-value {
  min-width: 72px;
  text-align: center;
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.15rem;
}

/* Toggle switch */
.bk-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 32px;
  flex: 0 0 auto;
}

.bk-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.bk-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--bk-surface-3);
  transition: background 0.15s ease;
}

.bk-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.bk-switch input:checked + .bk-switch-track {
  background: var(--bk-green);
}

.bk-switch input:checked + .bk-switch-track::after {
  transform: translateX(20px);
}

.bk-switch input:disabled + .bk-switch-track {
  opacity: 0.5;
}

/* Segmented control (V1 / V2 toggle, week / month) */
.bk-segment {
  display: inline-flex;
  width: 100%;
  background: var(--bk-surface-2);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.bk-segment button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--bk-text-2);
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
  white-space: nowrap;
}

.bk-segment button[aria-pressed="true"],
.bk-segment button[aria-selected="true"] {
  background: var(--bk-surface);
  color: var(--bk-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ---------------------------------------------------------------------------------------------------- forms */
.bk-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bk-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bk-text-2);
  margin-bottom: 6px;
}

.bk-field .bk-label {
  margin-bottom: 0;
}

.bk-hint {
  font-size: 0.78rem;
  color: var(--bk-text-3);
}

.bk-input,
.bk-select,
.bk-textarea {
  width: 100%;
  min-height: var(--bk-tap);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--bk-field-border);
  background: var(--bk-field-bg);
  color: var(--bk-text);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bk-textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

.bk-select {
  background-image: linear-gradient(45deg, transparent 50%, var(--bk-text-3) 50%), linear-gradient(135deg, var(--bk-text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.bk-input::placeholder,
.bk-textarea::placeholder {
  color: var(--bk-placeholder);
  font-style: italic;
  opacity: 1;
}

.bk-input:focus,
.bk-select:focus,
.bk-textarea:focus {
  border-color: var(--bk-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.bk-input[aria-invalid="true"],
.bk-select[aria-invalid="true"] {
  border-color: var(--bk-danger);
}

.bk-input-mono {
  font-family: var(--bk-mono);
}

input[type="range"].bk-range {
  width: 100%;
  height: 44px;
  accent-color: var(--bk-indigo);
  margin: 0;
}

/* Checkbox / radio rows (48px tall tap target) */
.bk-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bk-tap);
  padding: 4px 2px;
  cursor: pointer;
}

.bk-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--bk-green);
  flex: 0 0 auto;
}

/* Choice tiles (big tappable options in wizards) */
.bk-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.bk-choices-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bk-choices-1 {
  grid-template-columns: 1fr;
}

.bk-choice {
  min-height: 64px;
  padding: 12px;
  border-radius: var(--bk-radius-sm);
  border: 2px solid var(--bk-border);
  background: var(--bk-surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  color: inherit;
  min-width: 0;
}

.bk-choice-center {
  align-items: center;
  text-align: center;
}

.bk-choice .bk-choice-emoji {
  font-size: 1.5rem;
  line-height: 1.1;
}

.bk-choice .bk-choice-title {
  font-weight: 700;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.bk-choice .bk-choice-sub {
  font-size: 0.78rem;
  color: var(--bk-text-3);
}

.bk-choice[aria-pressed="true"],
.bk-choice[aria-checked="true"],
.bk-choice.is-selected {
  border-color: var(--bk-indigo);
  background: var(--bk-indigo-soft);
}

.bk-choice:disabled,
.bk-choice.is-locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.bk-choice .bk-lock {
  position: absolute;
  top: 8px;
  right: 8px;
}

.bk-choice {
  position: relative;
}

/* Day-of-week picker */
.bk-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.bk-day {
  min-height: var(--bk-tap);
  border-radius: 12px;
  border: 2px solid var(--bk-border);
  background: var(--bk-surface);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--bk-text-2);
  padding: 0;
}

.bk-day[aria-pressed="true"] {
  background: var(--bk-green);
  border-color: var(--bk-green);
  color: #fff;
}

/* 6-digit OTP boxes */
.bk-otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.bk-otp input {
  width: 100%;
  min-height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 12px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  outline: none;
  caret-color: var(--bk-green);
}

.bk-otp input:focus {
  border-color: var(--bk-green);
  box-shadow: 0 0 0 3px rgba(17, 144, 67, 0.2);
}

/* ---------------------------------------------------------------------------------------------------- feedback */
.bk-alert {
  padding: 12px 14px;
  border-radius: var(--bk-radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
}

.bk-alert > .bk-alert-body {
  flex: 1;
  min-width: 0;
}

.bk-alert-info {
  background: var(--bk-indigo-soft);
  border-color: rgba(79, 70, 229, 0.3);
  color: var(--bk-text);
}
.bk-alert-success {
  background: var(--bk-success-soft);
  border-color: rgba(21, 128, 61, 0.35);
  color: var(--bk-text);
}
.bk-alert-error {
  background: var(--bk-danger-soft);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--bk-text);
}
.bk-alert-warning {
  background: var(--bk-warning-soft);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--bk-text);
}

/* Trial / plan banner */
.bk-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--bk-radius-sm);
  background: var(--bk-indigo-soft);
  border: 1px solid rgba(79, 70, 229, 0.3);
  margin-bottom: 14px;
  min-width: 0;
}

.bk-banner-warning {
  background: var(--bk-warning-soft);
  border-color: rgba(217, 119, 6, 0.35);
}

.bk-banner-danger {
  background: var(--bk-danger-soft);
  border-color: rgba(220, 38, 38, 0.35);
}

.bk-banner-success {
  background: var(--bk-success-soft);
  border-color: rgba(21, 128, 61, 0.35);
}

.bk-banner .bk-banner-body {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
}

.bk-banner .bk-banner-body strong {
  display: block;
}

.bk-banner .bk-btn {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.bk-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bk-text-3);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 0;
}

.bk-divider::before,
.bk-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bk-border);
}

.bk-hr {
  border: 0;
  border-top: 1px solid var(--bk-border);
  margin: 12px 0;
}

.bk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bk-surface-2);
  color: var(--bk-text-2);
  white-space: nowrap;
}

.bk-badge-admin {
  background: var(--bk-green-soft);
  color: var(--bk-green);
}
.bk-badge-indigo {
  background: var(--bk-indigo-soft);
  color: var(--bk-indigo);
}
.bk-badge-success {
  background: var(--bk-success-soft);
  color: var(--bk-success);
}
.bk-badge-warning {
  background: var(--bk-warning-soft);
  color: var(--bk-warning);
}
.bk-badge-danger {
  background: var(--bk-danger-soft);
  color: var(--bk-danger);
}
.bk-badge-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Admin Mode badge (fixed, top-right) */
#bk-admin-badge {
  position: fixed;
  top: calc(8px + var(--bk-safe-top));
  right: calc(8px + var(--bk-safe-right));
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bk-green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--bk-shadow);
  text-decoration: none;
}

.bk-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: bk-spin 0.8s linear infinite;
  display: inline-block;
  flex: 0 0 auto;
}

.bk-btn-outline .bk-spinner,
.bk-spinner-dark {
  border-color: var(--bk-border);
  border-top-color: var(--bk-indigo);
}

.bk-spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes bk-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton loaders */
.bk-skeleton {
  background: linear-gradient(90deg, var(--bk-surface-2) 25%, var(--bk-surface-3) 37%, var(--bk-surface-2) 63%);
  background-size: 400% 100%;
  animation: bk-shimmer 1.4s ease infinite;
  border-radius: 8px;
  min-height: 16px;
}

@keyframes bk-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Empty states */
.bk-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--bk-text-3);
}

.bk-empty .bk-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

/* Progress bar */
.bk-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bk-surface-3);
  overflow: hidden;
}

.bk-progress > span {
  display: block;
  height: 100%;
  background: var(--bk-green);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bk-progress-indigo > span {
  background: var(--bk-indigo);
}

/* Toasts */
#bk-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bk-nav-height) + var(--bk-safe-bottom) + 12px);
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.bk-toast {
  pointer-events: auto;
  background: var(--bk-text);
  color: var(--bk-bg);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: var(--bk-shadow);
  animation: bk-slide-up 0.2s ease;
  display: flex;
  gap: 10px;
  align-items: center;
}

.bk-toast-success {
  background: var(--bk-success);
  color: #fff;
}
.bk-toast-error {
  background: var(--bk-danger);
  color: #fff;
}
.bk-toast-warning {
  background: var(--bk-warning);
  color: #fff;
}

/* ---------------------------------------------------------------------------------------------------- pills / tabs */
.bk-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  scroll-snap-type: x proximity;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.bk-pills::-webkit-scrollbar {
  display: none;
}

/* Wrapped variant: every pill visible and clickable (sport selection), no horizontal scrolling. */
.bk-pills.bk-pills-wrap {
  flex-wrap: wrap;
  overflow: visible;
  margin: 0;
  padding: 2px 0 6px;
  scroll-snap-type: none;
}

.bk-pill {
  flex: 0 0 auto;
  min-height: 44px;
  line-height: 1.2;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  scroll-snap-align: start;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bk-pill[aria-selected="true"],
.bk-pill[aria-pressed="true"] {
  background: var(--bk-indigo);
  border-color: var(--bk-indigo);
  color: #fff;
}

.bk-pill-green[aria-selected="true"],
.bk-pill-green[aria-pressed="true"] {
  background: var(--bk-green);
  border-color: var(--bk-green);
}

.bk-pill.is-locked {
  opacity: 0.6;
}

/* Underline tabs */
.bk-tabs {
  display: flex;
  border-bottom: 1px solid var(--bk-border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bk-tabs::-webkit-scrollbar {
  display: none;
}

.bk-tab {
  flex: 1 0 auto;
  min-height: var(--bk-tap);
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--bk-text-3);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.bk-tab[aria-selected="true"] {
  color: var(--bk-indigo);
  border-bottom-color: var(--bk-indigo);
}

/* Wizard stepper */
.bk-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.bk-step {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--bk-surface-3);
}

.bk-step.is-done {
  background: var(--bk-green);
}

.bk-step.is-current {
  background: var(--bk-indigo);
}

.bk-step-label {
  font-size: 0.78rem;
  color: var(--bk-text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------------------------------------------- bottom sheets */
.bk-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  animation: bk-fade 0.15s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.bk-sheet-backdrop.is-closing {
  animation: bk-fade-out 0.15s ease forwards;
}

.bk-sheet-backdrop.is-closing .bk-sheet {
  animation: bk-slide-down 0.18s ease forwards;
}

.bk-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--bk-surface);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(20px + var(--bk-safe-bottom));
  box-shadow: var(--bk-shadow-lg);
  animation: bk-slide-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 88vh;
  max-height: 88dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  touch-action: pan-y;
}

.bk-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--bk-border);
  margin: 0 auto 6px;
  flex: 0 0 auto;
}

.bk-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.bk-sheet-head h2 {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.bk-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Footer is a normal flex child below the scrolling body: it can never float over set rows or pain buttons. */
.bk-sheet-actions {
  position: static;
  flex: 0 0 auto;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--bk-border);
  background: var(--bk-surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bk-sheet-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--bk-green);
  font-family: var(--bk-mono);
  letter-spacing: -0.02em;
}

.bk-sheet-price small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bk-text-3);
  font-family: var(--bk-font);
}

@keyframes bk-slide-up {
  from {
    transform: translateY(32px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bk-slide-down {
  to {
    transform: translateY(40px);
    opacity: 0;
  }
}

@keyframes bk-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bk-fade-out {
  to {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------------------------------------- sticky action bar */
.bk-action-bar {
  position: sticky;
  bottom: calc(var(--bk-nav-height) + var(--bk-safe-bottom));
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--bk-border);
  padding: 12px 16px;
  margin: 0 -16px;
  z-index: 20;
  display: flex;
  gap: 10px;
}

.bk-action-bar .bk-btn {
  flex: 1;
}

body.bk-no-nav .bk-action-bar {
  bottom: var(--bk-safe-bottom);
}

/* Floating action button */
.bk-fab {
  position: fixed;
  right: calc(16px + var(--bk-safe-right));
  bottom: calc(var(--bk-nav-height) + var(--bk-safe-bottom) + 16px);
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 0;
  background: var(--bk-indigo);
  color: #fff;
  font-size: 1.6rem;
  box-shadow: var(--bk-shadow);
  z-index: 60;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------------------------------------------------- mobile bottom nav */
#mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bk-nav-height) + var(--bk-safe-bottom));
  padding-bottom: var(--bk-safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--bk-border);
  z-index: 900;
}

#mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--bk-tap);
  color: var(--bk-text-3);
  font-size: 0.68rem;
  font-weight: 600;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

#mobile-bottom-nav a[aria-current="page"] {
  color: var(--bk-indigo);
}

#mobile-bottom-nav a svg {
  width: 24px;
  height: 24px;
}

/* Elevated center "Train" action */
#mobile-bottom-nav a.bk-nav-center {
  color: #fff;
}

#mobile-bottom-nav a.bk-nav-center .bk-nav-center-btn {
  width: 56px;
  height: 56px;
  margin-top: -26px;
  border-radius: 50%;
  background: var(--bk-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(17, 144, 67, 0.45);
  border: 4px solid var(--bk-bg);
}

#mobile-bottom-nav a.bk-nav-center[aria-current="page"] .bk-nav-center-btn {
  background: var(--bk-indigo);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

#mobile-bottom-nav a.bk-nav-center span {
  color: var(--bk-text-3);
}

#mobile-bottom-nav a.bk-nav-center[aria-current="page"] span {
  color: var(--bk-indigo);
}

/* Trial dot / badge on a nav item */
.bk-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bk-warning);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------------------------------------------------------------------------------------------------- desktop sidebar */
#bk-sidebar {
  display: none;
}

/* ---------------------------------------------------------------------------------------------------- calendar */
.bk-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bk-text-3);
  text-align: center;
  margin-bottom: 4px;
}

.bk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.bk-cal-day {
  min-height: 52px;
  padding: 4px 2px;
  border-radius: 10px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: inherit;
  min-width: 0;
  position: relative;
}

.bk-cal-day.is-outside {
  opacity: 0.45;
}

.bk-cal-day.is-today {
  border-color: var(--bk-indigo);
  box-shadow: inset 0 0 0 1px var(--bk-indigo);
}

.bk-cal-day[aria-selected="true"] {
  background: var(--bk-indigo-soft);
}

.bk-cal-day .bk-cal-num {
  font-size: 0.85rem;
  font-weight: 700;
}

.bk-cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.bk-cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bk-stressor-ns);
}

.bk-cal-dot[data-s="NHI"] {
  background: var(--bk-stressor-nhi);
}
.bk-cal-dot[data-s="MHI"] {
  background: var(--bk-stressor-mhi);
}
.bk-cal-dot[data-s="AER"] {
  background: var(--bk-stressor-aer);
}
.bk-cal-dot[data-s="SKL"] {
  background: var(--bk-stressor-skl);
}
.bk-cal-dot[data-s="FLX"] {
  background: var(--bk-stressor-flx);
}
.bk-cal-dot[data-s="REC"] {
  background: var(--bk-stressor-rec);
}

.bk-cal-day.is-done::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bk-success);
}

/* Weekly strip (7 columns with stressor borders) */
.bk-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.bk-week-day {
  min-height: 96px;
  border-radius: 12px;
  border: 1px solid var(--bk-border);
  border-top: 4px solid var(--bk-stressor-ns);
  background: var(--bk-surface);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}

.bk-week-day[data-s="NHI"] {
  border-top-color: var(--bk-stressor-nhi);
}
.bk-week-day[data-s="MHI"] {
  border-top-color: var(--bk-stressor-mhi);
}
.bk-week-day[data-s="AER"] {
  border-top-color: var(--bk-stressor-aer);
}
.bk-week-day[data-s="SKL"] {
  border-top-color: var(--bk-stressor-skl);
}
.bk-week-day[data-s="FLX"] {
  border-top-color: var(--bk-stressor-flx);
}
.bk-week-day[data-s="REC"] {
  border-top-color: var(--bk-stressor-rec);
}

.bk-week-day.is-today {
  box-shadow: inset 0 0 0 2px var(--bk-indigo);
}

.bk-week-day[aria-selected="true"] {
  background: var(--bk-indigo-soft);
}

.bk-week-day .bk-week-dow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bk-text-3);
}

.bk-week-day .bk-week-num {
  font-size: 1rem;
  font-weight: 800;
}

.bk-week-day .bk-week-count {
  font-size: 0.66rem;
  color: var(--bk-text-3);
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.15;
  max-width: 100%;
}

/* Legend */
.bk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.75rem;
  color: var(--bk-text-3);
}

.bk-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Week/day session row inside a card */
.bk-session {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--bk-border);
}

.bk-session:last-child {
  border-bottom: 0;
}

.bk-session .bk-session-time {
  font-family: var(--bk-mono);
  font-size: 0.78rem;
  color: var(--bk-text-3);
  min-width: 42px;
}

/* ---------------------------------------------------------------------------------------------------- pricing */
.bk-price-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bk-price-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bk-price-head .bk-price-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bk-indigo-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex: 0 0 auto;
}

.bk-price-amount {
  font-family: var(--bk-mono);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.bk-price-amount small {
  font-family: var(--bk-font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bk-text-3);
}

.bk-price-free {
  color: var(--bk-green);
}

/* ---------------------------------------------------------------------------------------------------- readiness widget */
.bk-readiness-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bk-readiness-q {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.bk-readiness-q .bk-readiness-label {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bk-text-2);
}

.bk-readiness-opt {
  min-height: 52px;
  border-radius: 12px;
  border: 2px solid var(--bk-border);
  background: var(--bk-surface);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: inherit;
  padding: 4px;
}

.bk-readiness-opt small {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--bk-text-3);
}

.bk-readiness-opt[aria-pressed="true"] {
  border-color: var(--bk-green);
  background: var(--bk-green-soft);
}

.bk-readiness-score {
  font-family: var(--bk-mono);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.bk-traffic {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bk-text-3);
  flex: 0 0 auto;
}

.bk-traffic[data-light="GREEN"] {
  background: var(--bk-success);
}
.bk-traffic[data-light="YELLOW"] {
  background: var(--bk-warning);
}
.bk-traffic[data-light="RED"] {
  background: var(--bk-danger);
}

/* ---------------------------------------------------------------------------------------------------- exercise picker rows */
.bk-ex-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: var(--bk-radius-sm);
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: inherit;
  min-width: 0;
}

.bk-ex-row[aria-pressed="true"] {
  border-color: var(--bk-indigo);
  background: var(--bk-indigo-soft);
}

.bk-ex-row .bk-ex-name {
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-ex-row .bk-ex-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--bk-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Kernel selector sheet rows */
.bk-kernel-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--bk-radius-sm);
  border: 2px solid var(--bk-border);
  background: var(--bk-surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  min-width: 0;
}

.bk-kernel-row[aria-pressed="true"] {
  border-color: var(--bk-indigo);
  background: var(--bk-indigo-soft);
}

.bk-kernel-row .bk-kernel-name {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bk-kernel-row .bk-kernel-desc {
  font-size: 0.8rem;
  color: var(--bk-text-3);
}

/* Plan colour swatch */
.bk-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  flex: 0 0 auto;
}

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

.bk-swatches button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
}

.bk-swatches button[aria-pressed="true"] {
  border-color: var(--bk-text);
}

/* Timeline (periodization) */
.bk-timeline {
  display: flex;
  gap: 3px;
  width: 100%;
}

.bk-timeline > span {
  flex: 1;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  background: var(--bk-stressor-ns);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.bk-timeline > span.is-deload {
  background: var(--bk-stressor-rec);
}

.bk-timeline > span[data-s="NHI"] {
  background: var(--bk-stressor-nhi);
}
.bk-timeline > span[data-s="MHI"] {
  background: var(--bk-stressor-mhi);
}
.bk-timeline > span[data-s="AER"] {
  background: var(--bk-stressor-aer);
}
.bk-timeline > span[data-s="SKL"] {
  background: var(--bk-stressor-skl);
}
.bk-timeline > span[data-s="FLX"] {
  background: var(--bk-stressor-flx);
}
.bk-timeline > span[data-s="REC"] {
  background: var(--bk-stressor-rec);
}

/* Responsive table -> cards below 768 px */
.bk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.bk-table th,
.bk-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--bk-border);
  vertical-align: top;
}

@media (max-width: 767.98px) {
  .bk-table,
  .bk-table thead,
  .bk-table tbody,
  .bk-table tr,
  .bk-table td {
    display: block;
    width: 100%;
  }
  .bk-table thead {
    display: none;
  }
  .bk-table tr {
    background: var(--bk-surface);
    border: 1px solid var(--bk-border);
    border-radius: var(--bk-radius-sm);
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  .bk-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed var(--bk-border);
    padding: 8px 0;
  }
  .bk-table td:last-child {
    border-bottom: 0;
  }
  .bk-table td::before {
    content: attr(data-label);
    color: var(--bk-text-3);
    font-weight: 600;
    flex: 0 0 40%;
  }
}

/* ---------------------------------------------------------------------------------------------------- tablet (>= 768 px) */
@media (min-width: 768px) {
  body {
    padding-bottom: 24px;
    padding-left: var(--bk-sidebar-width);
  }
  body.bk-no-nav {
    padding-left: 0;
  }
  #mobile-bottom-nav {
    display: none;
  }
  #bk-toasts {
    bottom: 24px;
    left: calc(50% + var(--bk-sidebar-width) / 2);
  }
  body.bk-no-nav #bk-toasts {
    left: 50%;
  }
  .bk-container {
    max-width: 760px;
    padding: 28px 28px 32px;
  }
  .bk-container-wide {
    max-width: 960px;
  }
  .bk-topbar-inner {
    max-width: 760px;
    padding: 8px 28px;
  }
  .bk-btn {
    width: auto;
    min-width: 140px;
  }
  .bk-btn-block {
    width: 100%;
  }
  .bk-btn-row .bk-btn {
    width: auto;
  }
  .bk-sheet-backdrop {
    align-items: center;
    padding: 24px;
  }
  .bk-sheet {
    border-radius: 20px;
    padding-bottom: 20px;
    max-height: 86vh;
    animation: bk-fade 0.18s ease;
  }
  .bk-sheet-backdrop.is-closing .bk-sheet {
    animation: bk-fade-out 0.15s ease forwards;
  }
  .bk-sheet-handle {
    display: none;
  }
  .bk-sheet-actions {
    position: static;
    margin: 0;
    padding-top: 12px;
    flex-direction: row;
    justify-content: flex-end;
  }
  .bk-sheet-actions .bk-btn {
    width: auto;
  }
  .bk-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
  .bk-action-bar {
    bottom: 0;
    margin: 0 -28px;
    padding: 12px 28px;
  }
  .bk-fab {
    bottom: 24px;
  }
  .bk-pills {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: wrap;
    overflow: visible;
  }
  .bk-tabs {
    flex-wrap: wrap;
  }
  .bk-readiness-row {
    grid-template-columns: repeat(3, 1fr);
  }
  #bk-admin-badge {
    top: 16px;
    right: 24px;
  }

  /* Desktop sidebar */
  #bk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--bk-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--bk-surface);
    border-right: 1px solid var(--bk-border);
    padding: 20px 14px calc(16px + var(--bk-safe-bottom));
    overflow-y: auto;
    z-index: 800;
  }
  .bk-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--bk-text);
  }
  .bk-sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--bk-green), var(--bk-indigo));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
  }
  .bk-sidebar-group {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bk-text-3);
    padding: 14px 10px 6px;
  }
  #bk-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    color: var(--bk-text-2);
    font-weight: 600;
    font-size: 0.93rem;
  }
  #bk-sidebar nav a:hover {
    background: var(--bk-surface-2);
  }
  #bk-sidebar nav a[aria-current="page"] {
    background: var(--bk-indigo-soft);
    color: var(--bk-indigo);
  }
  #bk-sidebar nav a svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }
  .bk-sidebar-foot {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--bk-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
  }
  .bk-sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bk-indigo-soft);
    color: var(--bk-indigo);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 auto;
    overflow: hidden;
  }
  .bk-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .bk-sidebar-foot .bk-grow {
    min-width: 0;
  }
  .bk-sidebar-foot .bk-grow span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------------------------------------------- desktop (>= 1024 px) */
@media (min-width: 1024px) {
  .bk-container {
    max-width: 880px;
  }
  .bk-container-wide {
    max-width: 1120px;
  }
  .bk-topbar-inner {
    max-width: 880px;
  }
  .bk-desktop-2col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .bk-choices {
    grid-template-columns: repeat(3, 1fr);
  }
  .bk-choices-1 {
    grid-template-columns: 1fr;
  }
  .bk-cal-day {
    min-height: 72px;
  }
  .bk-week-day {
    min-height: 120px;
  }
}

/* Print: hide chrome */
@media print {
  #mobile-bottom-nav,
  #bk-sidebar,
  #bk-admin-badge,
  .bk-topbar,
  .bk-action-bar,
  .bk-fab {
    display: none !important;
  }
  body {
    padding: 0;
  }
}

/* ==================================================================================================================== */
/* Prompt 4: workout session (one-handed thumb-zone execution), progress charts, profile, catalog managers              */
/* ==================================================================================================================== */

/* ---- Workout session: sticky top bar ---- */
.ws-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bk-border);
  margin: 0 -16px 12px;
  padding: calc(8px + var(--bk-safe-top)) 16px 8px;
}
.ws-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-top-row .ws-elapsed {
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 64px;
  letter-spacing: 0.02em;
}
.ws-top-row .bk-btn {
  width: auto;
  min-height: 40px;
  min-width: 0;
  padding: 0 14px;
}
.ws-top .bk-progress {
  margin-top: 8px;
}
.ws-top-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-top-title small {
  display: block;
  font-weight: 500;
  color: var(--bk-text-3);
  font-size: 0.74rem;
}

/* ---- Focus card ---- */
.ws-focus {
  text-align: center;
  padding: 18px 16px 16px;
}
.ws-focus h2 {
  margin: 4px 0 2px;
  font-size: 1.3rem;
  line-height: 1.2;
}
.ws-focus .ws-presc {
  font-size: 0.95rem;
  color: var(--bk-text-2);
  margin: 2px 0 8px;
}
.ws-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 10px;
}
.ws-badges .bk-badge {
  font-size: 0.72rem;
}
/* v3.8: hangboard-readable digits (2-3 m away). */
.ws-timer {
  font-family: var(--bk-mono);
  font-size: clamp(4.6rem, 19vw, 7.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 4px;
}
.ws-timer-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bk-border);
  overflow: hidden;
  margin: 8px auto 4px;
  max-width: 420px;
}
.ws-timer-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bk-green), var(--bk-indigo));
  transition: width 0.1s linear;
}
.ws-timer-progress[hidden] {
  display: none;
}
@media (max-height: 760px) {
  .ws-timer {
    font-size: clamp(3.8rem, 12vh, 5.2rem);
  }
  .ws-timer.is-prep {
    font-size: clamp(3.8rem, 13vh, 5.6rem);
  }
  /* Short laptop viewports: the decorative breathing bubble shrinks so the digits never overlap the thumb zone. */
  .ws-bubble-wrap {
    height: 64px;
    margin: 0 auto 2px;
  }
  .ws-bubble {
    width: 56px;
    height: 56px;
    font-size: 0.9rem;
  }
}
.ws-timer.is-rest {
  color: var(--bk-indigo);
}
.ws-timer.is-work {
  color: var(--bk-green);
}
.ws-timer.is-warning {
  color: var(--bk-warning);
}
.ws-timer.is-prep {
  color: #92400e;
  font-size: clamp(5rem, 22vw, 8rem);
}
.ws-prep-banner {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef3c7;
  border: 2px solid #f59e0b;
  color: #92400e;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}
.ws-prep-banner[hidden] {
  display: none;
}
.ws-timer-label {
  font-size: 1.15rem; /* v3.8: the phase cue (GET IN POSITION / HANG / REST / MAX HOLD) reads from the hangboard */
  color: var(--bk-text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  min-height: 1.2em;
}
.ws-lookahead {
  font-size: 0.86rem;
  color: var(--bk-text-2);
  margin-top: 6px;
  min-height: 1.2em;
}

/* Breathing bubble (rep pacer visual metronome) */
.ws-bubble-wrap {
  position: relative;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto 6px;
}
.ws-bubble {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55), transparent 55%), linear-gradient(135deg, var(--bk-green), var(--bk-indigo));
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
  transform: scale(var(--ws-bubble-scale, 0.6));
  transition: transform 0.15s linear;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.6rem;
}
.ws-bubble-wrap[hidden] {
  display: none;
}
.ws-phase {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bk-indigo);
  min-height: 1.3em;
}

/* Set progress dots */
.ws-sets-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 2px;
  flex-wrap: wrap;
}
.ws-sets-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bk-border);
  background: var(--bk-surface);
}
.ws-sets-dots span.is-done {
  background: var(--bk-green);
  border-color: var(--bk-green);
}
.ws-sets-dots span.is-active {
  border-color: var(--bk-indigo);
  box-shadow: 0 0 0 3px var(--bk-indigo-soft);
}
.ws-sets-dots span.is-amrap {
  border-radius: 4px;
}

/* Pass criteria card */
.ws-pass {
  border-radius: var(--bk-radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface-2);
  margin-top: 10px;
}
.ws-pass strong {
  display: block;
}
.ws-pass[data-state="pass"] {
  background: var(--bk-success-soft);
  border-color: var(--bk-success);
  color: var(--bk-success);
}
.ws-pass[data-state="hold"] {
  background: var(--bk-warning-soft);
  border-color: var(--bk-warning);
  color: var(--bk-warning);
}
.ws-pass[data-state="miss"] {
  background: var(--bk-danger-soft);
  border-color: var(--bk-danger);
  color: var(--bk-danger);
}
.ws-pass .ws-pass-sf {
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.1rem;
  margin-left: auto;
}

/* ---- Plain-English jargon labels (v3.4 Section 4.8) ---- */
.bk-jargon {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

/* ---- Gym cards & the Gym Detail / Reviews sheet (v3.4 Section 6) ---- */
.gym-card {
  cursor: pointer;
}
.gym-card:focus-visible {
  outline: 2px solid var(--bk-indigo);
  outline-offset: 2px;
}
.gym-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  flex: 0 0 72px;
  background: var(--bk-surface-2, var(--bk-border));
}
.gym-hero {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bk-surface-2, var(--bk-border));
}
.gym-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.gym-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}
.gym-links .bk-btn {
  min-height: 36px;
  padding: 0 10px;
  width: auto;
}
.gym-hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.gym-hours td {
  padding: 3px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.gym-hours td:last-child {
  text-align: right;
  color: var(--bk-text-3);
}
.gym-stars {
  display: flex;
  gap: 4px;
  margin: 6px 0;
}
.gym-stars button {
  font-size: 1.8rem;
  line-height: 1;
  background: none;
  border: 0;
  color: #f59e0b;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}
.gym-review {
  padding: 8px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.gym-review:last-child {
  border-bottom: 0;
}
.gym-review-stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

/* ---- Thumb zone (bottom 40 %) ---- */
.ws-thumb {
  position: sticky;
  bottom: calc(var(--bk-nav-height) + var(--bk-safe-bottom));
  z-index: 25;
  margin: 12px -16px 0;
  padding: 10px 16px 12px;
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--bk-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.ws-executing #mobile-bottom-nav {
  display: none;
}
body.ws-executing .ws-thumb {
  bottom: 0;
  padding-bottom: calc(12px + var(--bk-safe-bottom));
}
body.ws-executing {
  padding-bottom: 0;
}
.ws-dim {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 6px;
}
.ws-dim.ws-dim-2 {
  grid-template-columns: 64px 1fr 64px;
}
.ws-dim button {
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ws-dim button:active {
  background: var(--bk-surface-3);
  transform: scale(0.97);
}
.ws-dim button.ws-big {
  font-size: 1.3rem;
}
.ws-dim .ws-dim-value {
  text-align: center;
  line-height: 1.05;
}
.ws-dim .ws-dim-value output {
  display: block;
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}
.ws-dim .ws-dim-out {
  cursor: text;
  border-bottom: 1px dashed var(--bk-border);
}
.ws-dim .ws-dim-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  text-align: center;
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.4rem;
  border: 2px solid var(--bk-indigo);
  border-radius: 12px;
  background: var(--bk-surface);
  color: var(--bk-text);
}
.ws-dim.ws-dim-2 button {
  height: 60px;
  font-size: 1.8rem;
  line-height: 1;
}
.ws-dim .ws-dim-value small {
  color: var(--bk-text-3);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ws-rpe {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* v3.7.4: Easy · Moderate · Challenging · Hard · Very hard · Max */
  gap: 6px;
}
/* v3.7.4: "Effort (RPE)" header with the "?" help button and the live plain-English subtitle. */
.ws-rpe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 2px;
}
.ws-rpe-head .bk-label {
  margin: 0;
}
.ws-rpe-help {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text-2);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}
.ws-rpe-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--bk-text-2);
  min-height: 1.3em;
}
.ws-rpe-scale .ws-rpe-avatar {
  font-weight: 800;
  font-size: 0.85rem;
}
.ws-mod-toggle {
  margin-top: 8px;
  flex-wrap: wrap;
}
.ws-banner-compact {
  margin: 6px 0 0;
  padding: 8px 10px;
}
.ws-banner-compact .bk-banner-body strong {
  font-size: 0.85rem;
}
.ws-rpe button {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text-2);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ws-rpe button[aria-pressed="true"] {
  background: var(--bk-indigo);
  border-color: var(--bk-indigo);
  color: #fff;
}
.ws-rpe button small {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-main-btn {
  min-height: 56px;
  font-size: 1.08rem;
  border-radius: 16px;
}
/* v3.8.2: the edge stepper is the same single centered line as ADDED KG / S HOLD:  [ − ]   12 mm / EDGE MM   [ + ] */
.ws-dim.ws-dim-2.ws-dim-edge {
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
}
.ws-dim.ws-dim-2.ws-dim-edge .ws-dim-value {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.ws-dim.ws-dim-2.ws-dim-edge .ws-dim-value output {
  white-space: nowrap;
}
/* v3.7.3: labelled multi-step buttons (−2 −1 value +1 +2) stay one row in the thumb zone. */
.ws-dim .ws-big.ws-big-sm {
  min-width: 44px;
  padding-left: 6px;
  padding-right: 6px;
  font-size: 1rem;
}
.ws-sub-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 6px;
}
.ws-sub-row .bk-btn {
  width: 100%;
  min-height: 44px;
  font-size: 0.8rem;
  line-height: 1.15;
  padding: 4px 6px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---- Preparation list ---- */
.ws-ex-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.ws-ex-row:last-child {
  border-bottom: 0;
}
.ws-ex-row .ws-ex-idx {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bk-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
  margin-top: 2px;
}
.ws-ex-row .bk-grow {
  min-width: 0;
}
.ws-ex-row .ws-ex-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ws-ex-row .ws-ex-line {
  font-size: 0.84rem;
  color: var(--bk-text-2);
}
.ws-ex-row .ws-ex-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ws-ex-row .ws-ex-hints .bk-badge {
  font-size: 0.68rem;
}
.ws-ex-row.is-done {
  opacity: 0.6;
}
.ws-ex-row.is-active {
  background: var(--bk-indigo-soft);
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: var(--bk-radius-sm);
}
.ws-ex-row .bk-icon-btn {
  flex: 0 0 auto;
}
.ws-phase-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bk-text-3);
  margin: 12px 0 2px;
}

/* ---- Logger sheet: VSA set rows ---- */
.ws-set-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.ws-set-row:last-child {
  border-bottom: 0;
}
.ws-set-row .ws-set-n {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bk-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}
.ws-set-row.is-done .ws-set-n {
  background: var(--bk-green);
  color: #fff;
}
.ws-set-row .ws-set-target {
  font-size: 0.82rem;
  color: var(--bk-text-3);
}
.ws-set-row .ws-set-logged {
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 0.95rem;
}
.ws-set-row .bk-btn {
  width: auto;
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  font-size: 0.82rem;
}
.ws-honesty {
  display: grid;
  gap: 8px;
}
.ws-honesty .bk-check {
  min-height: 48px;
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-sm);
  padding: 8px 12px;
}
.ws-vas {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 3px;
}
.ws-vas button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.ws-vas button[aria-pressed="true"][data-light="GREEN"] {
  background: var(--bk-success);
  color: #fff;
  border-color: var(--bk-success);
}
.ws-vas button[aria-pressed="true"][data-light="YELLOW"] {
  background: var(--bk-warning);
  color: #fff;
  border-color: var(--bk-warning);
}
.ws-vas button[aria-pressed="true"][data-light="RED"] {
  background: var(--bk-danger);
  color: #fff;
  border-color: var(--bk-danger);
}
.ws-override-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ws-override-grid button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  font-weight: 700;
  cursor: pointer;
}
.ws-override-grid button[aria-pressed="true"] {
  background: var(--bk-indigo);
  border-color: var(--bk-indigo);
  color: #fff;
}
.ws-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---- Builder ---- */
.ws-search-results {
  /* page-level list: never traps the mouse wheel */
}

/* ---- Progress: charts ---- */
.pg-chart {
  position: relative;
  height: 240px;
  width: 100%;
}
.pg-chart.pg-chart-tall {
  height: 300px;
}
.pg-chart canvas {
  width: 100% !important;
  height: 100% !important;
}
.pg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8rem;
  color: var(--bk-text-2);
  margin: 6px 0;
}
.pg-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c, var(--bk-text-3));
  margin-right: 6px;
  vertical-align: -1px;
}
.pg-pyramid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pg-pyramid-row {
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.pg-pyramid-row .pg-bar {
  height: 18px;
  display: flex;
  justify-content: center;
  gap: 2px;
}
.pg-pyramid-row .pg-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--bk-green);
  min-width: 4px;
}
.pg-pyramid-row .pg-bar span.is-flash {
  background: var(--bk-indigo);
}
.pg-stale {
  border-left: 4px solid var(--bk-warning);
}
.pg-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pg-ledger-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bk-border);
  font-size: 0.86rem;
}
.pg-ledger-row:last-child {
  border-bottom: 0;
}
.pg-dag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pg-dag-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--bk-border);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bk-surface);
}
.pg-dag-node.is-done {
  background: var(--bk-success-soft);
  border-color: var(--bk-success);
  color: var(--bk-success);
}
.pg-dag-node.is-current {
  background: var(--bk-indigo-soft);
  border-color: var(--bk-indigo);
  color: var(--bk-indigo);
}
.pg-gate {
  text-align: center;
  padding: 28px 16px;
}
.pg-gate .pg-gate-icon {
  font-size: 2.6rem;
}
.pg-percentile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  font-size: 0.86rem;
  padding: 6px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.pg-percentile:last-child {
  border-bottom: 0;
}
.pg-percentile .bk-progress {
  grid-column: 1 / -1;
  margin: 0;
}
.pg-report {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---- Profile / settings ---- */
.pf-secret {
  font-family: var(--bk-mono);
  font-size: 0.86rem;
  background: var(--bk-surface-2);
  border-radius: var(--bk-radius-xs);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.pf-code {
  font-family: var(--bk-mono);
  font-size: 0.78rem;
  background: var(--bk-surface-2);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius-sm);
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  max-height: 220px;
  overflow: auto;
}
.pf-link-code {
  font-family: var(--bk-mono);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 10px 0;
}
.pf-injury {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bk-border);
  font-size: 0.88rem;
}
.pf-injury:last-child {
  border-bottom: 0;
}
.pf-injury .bk-btn {
  width: auto;
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
}
.pf-sport-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pf-sport-grid .bk-choice {
  min-height: 72px;
}
.pf-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---- Catalog managers (cards) ---- */
.cm-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.cm-toolbar .bk-input {
  flex: 1;
}
.cm-toolbar .bk-btn {
  width: auto;
  min-width: 0;
}
.cm-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cm-card .cm-body {
  flex: 1;
  min-width: 0;
}
.cm-card .cm-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cm-card .cm-sub {
  font-size: 0.82rem;
  color: var(--bk-text-3);
  margin-top: 2px;
}
.cm-card .cm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.cm-card .cm-tags .bk-badge {
  font-size: 0.68rem;
}
.cm-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.cm-actions .bk-btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.82rem;
}
.cm-upvote[aria-pressed="true"] {
  background: var(--bk-indigo-soft);
  color: var(--bk-indigo);
  border-color: var(--bk-indigo);
}
.cm-count {
  font-size: 0.82rem;
  color: var(--bk-text-3);
  margin: 0 0 10px;
}
.cm-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cm-hub-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: var(--bk-radius);
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  color: inherit;
  min-height: 96px;
  box-shadow: var(--bk-shadow);
}
.cm-hub-tile .cm-hub-icon {
  font-size: 1.6rem;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--bk-green-soft);
  color: var(--bk-green-dark);
}
.cm-hub-tile .cm-hub-icon svg {
  width: 21px;
  height: 21px;
}
.cm-hub-tile strong {
  font-size: 0.95rem;
}
.cm-hub-tile small {
  color: var(--bk-text-3);
  font-size: 0.76rem;
}
.cm-hub-tile.is-admin {
  border-color: var(--bk-indigo);
}
.cm-meso-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.cm-meso-head h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.cm-meso-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.8rem;
  color: var(--bk-text-3);
  margin: 4px 0 8px;
}
.cm-kernel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.st-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.st-row:last-child {
  border-bottom: 0;
}
.st-row .bk-btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
}
.st-price-row {
  display: grid;
  grid-template-columns: 1fr 96px 96px;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.st-price-row:last-child {
  border-bottom: 0;
}
.st-price-row .st-price-name {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 0;
}
.st-price-row .st-price-name small {
  display: block;
  color: var(--bk-text-3);
  font-weight: 500;
  font-size: 0.74rem;
}
.st-user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--bk-border);
}
.st-user-row:last-child {
  border-bottom: 0;
}
.st-user-row .bk-grow {
  min-width: 0;
}
.st-user-row .bk-btn {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.82rem;
}

@media (min-width: 768px) {
  .ws-top {
    margin: 0 -28px 16px;
    padding: 10px 28px;
  }
  .ws-thumb {
    margin: 16px -28px 0;
    padding: 12px 28px;
    bottom: 0;
  }
  .ws-timer {
    font-size: 4.2rem;
  }
}

/* S-10: laptop viewports (short screens): compact thumb zone + smaller timer so the sticky controls never cover the digits or bubble. */
@media (max-height: 800px) and (min-width: 600px) {
  .ws-thumb {
    padding: 6px 16px 8px;
    gap: 4px;
  }
  .ws-thumb .ws-dim {
    grid-template-columns: 52px 1fr 52px;
  }
  .ws-thumb .ws-big {
    min-height: 40px;
  }
  .ws-thumb .ws-main-btn {
    min-height: 48px;
  }
  .ws-thumb .ws-sub-row .bk-btn {
    min-height: 36px;
  }
  .ws-timer {
    font-size: 3rem;
    margin: 4px 0 2px;
  }
  .ws-bubble-wrap {
    max-height: 120px;
  }
  .ws-bubble {
    width: 96px;
    height: 96px;
  }
  .ws-presc {
    margin: 4px 0;
  }
  body.ws-executing #screen-exec {
    padding-bottom: 220px;
  }
  .pg-kpi-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .pf-sport-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .cm-hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pg-chart {
    height: 300px;
  }
}


/* ---- catalog thumbnails (equipment, grips, exercises, workout focus) ---- */
.bk-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--bk-surface-2);
  border: 1px solid var(--bk-border);
  aspect-ratio: 1 / 1;
}
.bk-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.bk-thumb-sm {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.bk-thumb-lg {
  width: 72px;
  height: 72px;
}
.bk-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

/* ---------------------------------------------------------------------------------------------------- v3.3.0 touch targets + fixed wizard footer */
button,
.bk-btn,
.bk-btn-sm,
.bk-pill,
.bk-icon-btn,
.bk-segment button,
.cm-actions .bk-btn,
.cm-title button,
.pf-nav a,
.ws-vas button,
label:has(> input[type="checkbox"]),
select {
  min-height: 44px;
  min-width: 44px;
}

.bk-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  z-index: 950;
  padding-bottom: calc(12px + var(--bk-safe-bottom));
}
@media (min-width: 768px) {
  .bk-action-bar {
    left: var(--bk-sidebar-width);
    margin: 0;
  }
  body.bk-no-nav.bk-flow {
    padding-left: var(--bk-sidebar-width);
  }
}
body:has(.bk-action-bar) #mobile-bottom-nav {
  display: none !important;
}
main.bk-container {
  padding-bottom: 96px;
}

/* v3.5 (V34-034): laptop viewports up to 760 px tall (1054 x 701): compact timer, bubble and thumb zone so the sticky bottom
   bar never covers the countdown digits or the tempo phase cues. */
@media (max-height: 760px) {
  .ws-timer {
    font-size: 2.4rem !important;
    margin: 2px 0;
  }
  .ws-bubble-wrap {
    height: 56px;
    max-height: 56px;
  }
  .ws-bubble {
    width: 48px;
    height: 48px;
  }
  .ws-focus {
    padding: 2px 0;
    margin: 2px 0;
  }
  .ws-focus h2 {
    margin: 2px 0;
    font-size: 1.05rem;
  }
  .ws-focus .ws-presc {
    margin: 2px 0;
  }
  .ws-badges {
    margin: 2px 0 4px;
  }
  .ws-thumb,
  body.ws-executing .ws-thumb {
    padding: 4px 10px;
    gap: 4px;
  }
  .ws-dim button,
  .ws-dim.ws-dim-2 button,
  .ws-dim .ws-dim-input {
    height: 44px !important;
    min-height: 44px !important;
  }
  .ws-thumb .ws-main-btn {
    min-height: 44px;
  }
  body.ws-executing #screen-exec {
    padding-bottom: 180px;
  }
}

/* v3.5 (V34-050): the calendar tool buttons wrap instead of clipping at 1054 px. */
.cal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cal-tools .bk-btn {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  padding: 0 12px;
}
.cal-trim .bk-btn {
  white-space: nowrap;
}

/* v3.5 (V34-054): every control is at least 44 px tall (Settings, Calendar, My Profile, Progress, Gyms, Exercises, Equipment, admin badge). */
button, .bk-btn, .bk-btn-sm, .bk-pill, .bk-icon-btn, .bk-tab, #bk-admin-badge,
.pf-nav a, .cm-actions .bk-btn, .ws-vas button, .bk-segment button,
a.bk-btn, a.bk-pill, select, input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 44px !important;
  min-width: 44px !important;
}

/* v3.6 (R01): every remaining tappable control on Settings, Dashboard, Planner, Community, Profile and Pricing meets the 44 px target. */
.bk-btn-sm,
.bk-btn-ghost,
.bk-pill,
.bk-segment button,
.bk-choice,
.pg-dag-node,
.goal-row,
.bk-ex-row,
.st-backup-row button,
.st-table button,
.st-kpi button,
.pf-injury button,
.pf-metrics .bk-input,
.pf-metrics .bk-select,
.gym-stars button,
.cm-tags button,
.bk-check,
.bk-tabs button,
.bk-tab,
[data-star],
[data-rpe],
[data-level],
[data-mode],
[data-disc],
[data-g],
[data-pick],
[data-edit],
[data-new],
[data-vas],
[data-del],
[data-remove],
[data-status],
[data-move],
[data-delete],
#an-refresh,
.pricing-card .bk-btn,
.bk-sheet-actions .bk-btn,
.bk-btn-row .bk-btn,
.wk-actions .bk-btn {
  min-height: 44px !important;
  min-width: 44px !important;
}

/* ---------------------------------------------------------------------------------------------------- v3.8.4 supersets & circuits */
/* Superset Switcher Bar: one line above the prescription, "Superset A · Round 1/4: [A1 Pull-Up ✓] → [A2 Pistol Squat ●]". */
.ws-ss-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 2px 0;
  overflow-x: auto;
  white-space: nowrap;
  justify-content: center;
  scrollbar-width: none;
}
.ws-ss-bar::-webkit-scrollbar {
  display: none;
}
.ws-ss-title {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bk-indigo);
}
.ws-ss-arrow {
  flex: 0 0 auto;
  color: var(--bk-text-3);
  font-size: 0.8rem;
}
.ws-ss-pill {
  flex: 0 0 auto;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface-2);
  color: var(--bk-text-2);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.ws-ss-pill.is-active {
  border-color: var(--bk-indigo);
  background: var(--bk-indigo-soft);
  color: var(--bk-indigo);
  font-weight: 600;
}
.ws-ss-pill.is-done {
  border-color: var(--bk-success);
  background: var(--bk-success-soft);
  color: var(--bk-success);
}
/* Superset with next: compact pill between two adjacent exercises on Session Prep and the Builder. */
.ws-ss-link-row {
  display: flex;
  justify-content: center;
  margin: -6px 0;
  position: relative;
  z-index: 1;
}
.ws-ss-link {
  padding: 0 12px;
  border-radius: 999px;
  border: 1px dashed var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text-3);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}
.ws-ss-link.is-linked {
  border-style: solid;
  border-color: var(--bk-indigo);
  background: var(--bk-indigo-soft);
  color: var(--bk-indigo);
  font-weight: 600;
}

/* ==================================================================================================================== */
/* v3.9 Workout execution redesign (timer first, BetaKai-inspired). Scoped to #screen-exec.wx so the v3.5-v3.8 thumb-zone   */
/* rules above (sticky bottom panel, compact laptop overrides) no longer apply to the execution screen.                   */
/* ==================================================================================================================== */
body.ws-executing .bk-topbar {
  display: none;
}
body.ws-executing #screen-exec.wx,
#screen-exec.wx {
  padding-bottom: calc(24px + var(--bk-safe-bottom)) !important;
}
body.ws-executing main.bk-container {
  padding-top: 0;
}

/* ---- header: one row + progress hairline + one readiness line ---- */
.wx-top {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -16px 8px;
  padding: calc(6px + var(--bk-safe-top)) 12px 6px;
  background: var(--bk-nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bk-border);
}
.wx-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-icon {
  flex: 0 0 auto;
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--bk-text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}
a.wx-icon {
  font-size: 1.9rem;
  font-weight: 300;
  padding-bottom: 4px;
}
.wx-icon-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bk-indigo);
  padding: 0 6px;
}
.wx-top-title {
  flex: 1;
  min-width: 0;
  line-height: 1.15;
}
.wx-top-title .ws-elapsed {
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.wx-top-title small {
  display: block;
  font-size: 0.72rem;
  color: var(--bk-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-finish {
  width: auto !important;
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 0 14px !important;
}
.wx-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--bk-surface-3);
  margin: 6px 4px 0;
  overflow: hidden;
}
.wx-progress > span {
  display: block;
  height: 100%;
  background: var(--bk-green);
  transition: width 0.3s ease;
}
.wx-ready {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 3px 8px;
  min-height: 26px;
  border: 0;
  border-radius: 8px;
  background: var(--bk-surface-2);
  color: var(--bk-text-2);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}
.wx-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bk-success);
  flex: 0 0 auto;
}
.wx-ready[data-light="YELLOW"] .wx-ready-dot {
  background: var(--bk-warning);
}
.wx-ready[data-light="RED"] .wx-ready-dot {
  background: var(--bk-danger);
}
.wx-ready-text {
  flex: 1;
  min-width: 0;
}
.wx-ready-chev {
  color: var(--bk-text-3);
}
.wx-ready-panel {
  margin-top: 6px;
}
.wx-ready-panel .bk-banner {
  margin: 0;
}

/* ---- exercise header ---- */
.wx-focus {
  text-align: left;
}
.wx-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.wx-thumb-btn {
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 12px;
}
.wx-thumb-btn .bk-thumb {
  width: 52px;
  height: 52px;
}
.wx-play {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bk-danger);
  color: #fff;
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.wx-head-text {
  flex: 1;
  min-width: 0;
}
.wx-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bk-text-3);
}
.wx-name {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
  font-weight: 750;
}
.wx-presc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--bk-text-2);
  line-height: 1.3;
}
.wx-hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--bk-success);
  font-weight: 600;
}
.wx-head-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.wx-chip {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
#exec-video {
  border-color: transparent;
  background: var(--bk-danger-soft);
  color: var(--bk-danger);
}
.wx-chip-icon {
  width: 32px;
  padding: 0;
  font-size: 0.95rem;
  color: var(--bk-text-3);
}
#screen-exec.wx .ws-ss-bar {
  justify-content: flex-start;
  margin: 8px 0 0;
}
#screen-exec.wx .ws-ss-pill {
  min-height: 30px;
  max-width: 62vw;
}

/* ---- stat strip (tap to adjust the set) ---- */
.wx-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin: 10px 0 0;
  padding: 8px 18px 8px 4px;
  border: 1px solid var(--bk-border);
  border-radius: 14px;
  background: var(--bk-surface);
  color: var(--bk-text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.wx-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  border-right: 1px solid var(--bk-border);
}
.wx-stat:last-of-type {
  border-right: 0;
}
.wx-stat b {
  font-size: 1.02rem;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wx-stat small {
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bk-text-3);
  white-space: nowrap;
}
.wx-stats-edit {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bk-text-3);
  font-size: 0.85rem;
}

/* ---- ring timer ---- */
.wx-ring {
  --wx-ring-color: var(--bk-indigo);
  position: relative;
  /* the ring takes what the viewport leaves after the header, exercise, stats and buttons (~450 px), so the
     Start / Pause button is always on screen without scrolling, also in Safari with both toolbars visible */
  width: clamp(150px, min(66vw, 38vh), 320px);
  width: clamp(150px, min(66vw, calc(100svh - 450px)), 320px);
  aspect-ratio: 1 / 1;
  margin: 12px auto 0;
  container-type: inline-size;
}
.wx-ring[data-tone="work"] {
  --wx-ring-color: var(--bk-green);
}
.wx-ring[data-tone="rest"] {
  --wx-ring-color: var(--bk-indigo);
}
.wx-ring[data-tone="prep"] {
  --wx-ring-color: var(--bk-warning);
}
.wx-ring[data-tone="warning"] {
  --wx-ring-color: var(--bk-danger);
}
.wx-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.wx-ring-track {
  fill: none;
  stroke: var(--bk-surface-3);
  stroke-width: 12;
}
.wx-ring-bar {
  fill: none;
  stroke: var(--wx-ring-color);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke 0.2s ease;
}
.wx-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}
.wx-ring-state {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--wx-ring-color);
  text-transform: uppercase;
  max-width: 78%;
  line-height: 1.2;
}
#screen-exec.wx .ws-timer {
  font-family: var(--bk-mono);
  font-size: clamp(3rem, 15vw, 4.6rem) !important;
  font-size: 23cqw !important;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 4px 0 2px;
  color: var(--bk-text);
  font-variant-numeric: tabular-nums;
}
#screen-exec.wx .ws-timer.is-warning {
  color: var(--bk-danger);
}
#screen-exec.wx .ws-timer.is-prep {
  color: var(--bk-warning);
}
.wx-ring-sub {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bk-text-3);
}
/* Tempo pacer: the breathing bubble grows and shrinks behind the digits. */
#screen-exec.wx .wx-bubble-wrap {
  position: absolute;
  inset: 12%;
  height: auto;
  max-height: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#screen-exec.wx .wx-bubble-wrap[hidden] {
  display: none;
}
#screen-exec.wx .wx-bubble {
  width: 100%;
  height: 100%;
  opacity: 0.16;
  box-shadow: none;
}
.wx-label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin-top: 6px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--bk-text-2);
  min-height: 1.2em;
}
#screen-exec.wx .wx-phase {
  text-align: center;
  font-size: 0.9rem;
  min-height: 0;
}
#screen-exec.wx .wx-lookahead {
  text-align: center;
  font-size: 0.84rem;
  color: var(--bk-indigo);
  font-weight: 600;
  min-height: 0;
  margin: 2px 0 0;
}
#screen-exec.wx .wx-lookahead:empty,
#screen-exec.wx .wx-phase:empty {
  display: none;
}

/* ---- thumb controls: [secondary] [MAIN] [tertiary] in the normal flow ---- */
.wx-controls {
  margin: 12px 0 14px;
}
.wx-controls-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  align-items: stretch;
}
#screen-exec.wx .wx-controls .bk-btn {
  width: 100%;
  min-width: 0;
  min-height: 60px;
  margin: 0;
  padding: 6px 6px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}
#screen-exec.wx .wx-side {
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  color: var(--bk-text);
}
#screen-exec.wx .wx-main {
  min-height: 64px;
  box-shadow: 0 6px 18px rgba(17, 144, 67, 0.28);
}
#screen-exec.wx .wx-main.bk-btn-indigo {
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
}
#screen-exec.wx .wx-main.bk-btn-warning {
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.28);
}
#screen-exec.wx .wx-main-wide {
  width: 100%;
}
.wx-btn-main {
  font-weight: 750;
  font-size: 0.92rem;
}
.wx-main .wx-btn-main {
  font-size: 1.12rem;
}
.wx-btn-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.8;
}

/* ---- cards under the stage: set log + session ---- */
.wx-card {
  padding: 14px 14px 8px;
}
.wx-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wx-card-head h3 {
  margin: 0;
  font-size: 1rem;
}
.wx-card-head .bk-btn {
  width: auto;
  min-width: 0;
}
#exec-sets .ws-pass {
  margin: 0 0 6px;
  font-size: 0.82rem;
}
#exec-sets .ws-pass .ws-pass-sf {
  font-size: 0.78rem;
  white-space: nowrap;
  align-self: flex-start;
}
.wx-set {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bk-border);
}
.wx-set:last-child {
  border-bottom: 0;
}
.wx-set-n {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: var(--bk-surface-2);
  color: var(--bk-text-3);
}
.wx-set-n.is-amrap {
  box-shadow: inset 0 0 0 2px var(--bk-warning);
}
.wx-set.is-done .wx-set-n {
  background: var(--bk-green);
  color: #fff;
}
.wx-set.is-active .wx-set-n {
  background: var(--bk-indigo);
  color: #fff;
}
.wx-set-body {
  flex: 1;
  min-width: 0;
}
.wx-set-main {
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.3;
}
.wx-set:not(.is-done):not(.is-active) .wx-set-main {
  color: var(--bk-text-3);
  font-weight: 500;
}
.wx-set-sub {
  font-size: 0.78rem;
  color: var(--bk-text-3);
}
.wx-set-btn {
  flex: 0 0 auto;
  min-height: 40px;
  min-width: 64px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--bk-border);
  background: var(--bk-surface);
  color: var(--bk-text);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.wx-set-btn.is-primary {
  background: var(--bk-indigo);
  border-color: var(--bk-indigo);
  color: #fff;
}
.wx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--bk-border);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wx-row:last-child {
  border-bottom: 0;
}
.wx-row.is-linked {
  border-bottom: 2px solid var(--bk-indigo-soft);
}
.wx-row-idx {
  flex: 0 0 auto;
  min-width: 34px;
  height: 34px;
  padding: 0 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.86rem;
  background: var(--bk-surface-2);
  color: var(--bk-text-2);
}
.wx-row.is-active .wx-row-idx {
  background: var(--bk-indigo);
  color: #fff;
}
.wx-row.is-done .wx-row-idx {
  background: var(--bk-green-soft);
  color: var(--bk-green);
}
.wx-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.wx-row-name {
  font-weight: 650;
  font-size: 0.98rem;
}
.wx-row.is-done .wx-row-name {
  color: var(--bk-text-3);
}
.wx-row-line {
  font-size: 0.8rem;
  color: var(--bk-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wx-row-count {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--bk-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--bk-text-2);
}
.wx-row-count small {
  font-family: var(--bk-font);
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--bk-indigo);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- demo video sheet ---- */
.wx-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.wx-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.wx-video-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--bk-text-2);
}

/* ---- short phones (iPhone SE / mini, Safari with both bars): shrink the ring first, never the buttons ---- */
@media (max-height: 700px) {
  .wx-ring {
    margin-top: 6px;
  }
  .wx-hint,
  .wx-kicker {
    display: none;
  }
  .wx-presc {
    -webkit-line-clamp: 1;
  }
  .wx-label {
    margin-top: 2px;
    font-size: 0.8rem;
  }
  .wx-controls {
    margin-top: 8px;
  }
  .wx-stats {
    margin-top: 8px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}
@media (min-width: 768px) {
  .wx-top {
    margin: 0 -28px 12px;
    padding: 8px 28px;
  }
}

/* ---- v3.9 Session Prep: one-line notices that expand on tap ---- */
#prep-banners {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.wx-note {
  display: block;
  border-radius: 12px;
  background: var(--bk-surface);
  border: 1px solid var(--bk-border);
  color: var(--bk-text);
  text-decoration: none;
  overflow: hidden;
}
.wx-note > summary,
.wx-note.wx-note-static {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.wx-note > summary::-webkit-details-marker {
  display: none;
}
.wx-note-icon {
  flex: 0 0 auto;
  width: 20px;
  display: inline-flex;
  justify-content: center;
}
.wx-note-title {
  flex: 1;
  min-width: 0;
}
.wx-note-chev {
  color: var(--bk-text-3);
  transition: transform 0.15s ease;
}
.wx-note[open] .wx-note-chev {
  transform: rotate(180deg);
}
.wx-note-body {
  padding: 0 12px 10px;
  font-size: 0.86rem;
  color: var(--bk-text-2);
}
.wx-note-body p {
  margin: 0 0 8px;
}
.wx-note-body .bk-banner {
  margin: 0;
}
.wx-note[data-tone="warning"] {
  border-left: 4px solid var(--bk-warning);
}
.wx-note[data-tone="danger"] {
  border-left: 4px solid var(--bk-danger);
}
.wx-note[data-tone="success"] {
  border-left: 4px solid var(--bk-success);
}
.wx-note[data-tone="warning"] .wx-ready-dot {
  background: var(--bk-warning);
}
.wx-note[data-tone="danger"] .wx-ready-dot {
  background: var(--bk-danger);
}
.wx-hint-inline {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--bk-success);
}

/* ---- v3.9 superset / circuit picker ---- */
.wx-pick-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bk-border);
  border-radius: 12px;
  max-height: 46vh;
  overflow-y: auto;
}
.wx-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bk-border);
  cursor: pointer;
}
.wx-pick:last-child {
  border-bottom: 0;
}
.wx-pick input {
  width: 22px;
  height: 22px;
  accent-color: var(--bk-indigo);
  flex: 0 0 auto;
}
.wx-pick-name {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.95rem;
}
.wx-pick-name small {
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--bk-text-3);
}

/* ---- v3.9 admin chip and trial lines (quiet chrome) ---- */
[data-bk-admin-slot] #bk-admin-badge {
  margin-left: 8px;
  vertical-align: 1px;
}
#bk-admin-badge.is-inline {
  position: static;
  box-shadow: none;
  padding: 3px 8px;
  font-size: 0.66rem;
  background: var(--bk-green-soft);
  color: var(--bk-green-dark);
}
#bk-admin-badge.is-corner {
  padding: 0;
  width: 30px;
  height: 30px;
  justify-content: center;
  opacity: 0.85;
}
#bk-admin-badge.is-corner span {
  display: none;
}
body.ws-executing #bk-admin-badge {
  display: none !important;
}
.bk-trial-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px;
  margin: 0 0 10px;
  border-radius: 10px;
  background: var(--bk-surface-2);
  color: var(--bk-text-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.bk-trial-line.is-ended {
  background: var(--bk-warning-soft);
  color: var(--bk-warning);
}
.bk-trial-cta {
  color: var(--bk-indigo);
  white-space: nowrap;
}

/* ---- v3.9 line icons in the workout controls ---- */
.wx-svg {
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  vertical-align: -0.15em;
}
.wx-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wx-icon .wx-svg {
  width: 20px;
  height: 20px;
}
.wx-icon-text {
  gap: 4px;
}
.wx-icon-text .wx-svg {
  width: 17px;
  height: 17px;
}
#exec-video {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#exec-video .wx-svg {
  width: 12px;
  height: 12px;
}

/* ==================================================================================================== v3.9.1
 * My Profile: readable fields with a Done / To fill tag, completion card, one sticky save bar.
 * Settings (connections.html): one tile per connection, one focused screen per tile.
 */
.pf-page { padding-bottom: calc(9rem + var(--bk-safe-bottom)); }
.pf-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.pf-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--bk-indigo-soft); color: var(--bk-indigo); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; overflow: hidden; flex: 0 0 auto; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-hero h1 { margin: 0; font-size: 1.3rem; }
.pf-hero p { margin: 2px 0 0; overflow-wrap: anywhere; }
.pf-gear { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bk-border); background: var(--bk-surface); color: var(--bk-text-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pf-gear svg { width: 22px; height: 22px; }

.pf-progress { background: var(--bk-surface); border: 1px solid var(--bk-border); border-radius: var(--bk-radius, 16px); padding: 14px 16px; margin-bottom: 14px; }
.pf-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pf-progress-top span { font-size: 0.82rem; color: var(--bk-text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-bar { height: 8px; border-radius: 999px; background: var(--bk-surface-3); overflow: hidden; margin: 10px 0 8px; }
.pf-bar span { display: block; height: 100%; border-radius: 999px; background: var(--bk-green); transition: width 0.25s ease; }
.pf-progress p { margin: 0 0 8px; }
.pf-missing { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-missing button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--bk-warning); background: var(--bk-warning-soft); color: var(--bk-text); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }

.pf-sec { scroll-margin-top: 72px; }
.pf-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pf-sec-head h2 { margin: 0; font-size: 1.05rem; }
.pf-sec-sub { margin: -4px 0 10px; }
.pf-count { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bk-warning-soft); color: var(--bk-warning); font-variant-numeric: tabular-nums; }
.pf-count.is-done { background: var(--bk-green-soft); color: var(--bk-green); }
.pf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.pf-grid2.is-3 { grid-template-columns: repeat(3, 1fr); }
.pf-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; border-radius: 12px; transition: box-shadow 0.3s ease; }
.pf-f.is-wide { grid-column: 1 / -1; }
.pf-f + .pf-grid2, .pf-f.is-wide + .pf-grid2 { margin-top: 12px; }
.pf-f-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.pf-f-label { font-size: 0.84rem; font-weight: 700; color: var(--bk-text); }
.pf-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.pf-tag.is-done { color: var(--bk-green); }
.pf-tag.is-missing { color: var(--bk-warning); }
.pf-grid2.is-3 .pf-tag-t { display: none; }
.pf-grid2.is-3 .pf-tag.is-missing::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bk-warning); }
.pf-missing button.is-extra { display: none; }
.pf-missing.is-all button.is-extra { display: inline-block; }
.pf-missing button.is-more { border-style: solid; border-color: var(--bk-border); background: var(--bk-surface-2); color: var(--bk-text-2); }
.pf-f.is-empty .bk-input, .pf-f.is-empty .bk-select { border-style: dashed; border-color: var(--bk-warning); background: var(--bk-warning-soft); }
.pf-f.is-flash { box-shadow: 0 0 0 3px var(--bk-warning); }
.pf-unit { position: relative; }
.pf-unit .bk-input { padding-right: 64px; }
.pf-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; color: var(--bk-text-3); pointer-events: none; }
.pf-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.pf-days button { min-width: 0; padding: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--bk-field-border); background: var(--bk-field-bg); color: var(--bk-text); font: inherit; font-weight: 700; cursor: pointer; }
.pf-f.is-empty .pf-days button { border-style: dashed; border-color: var(--bk-warning); }
.pf-days button[aria-pressed="true"] { background: var(--bk-green); border-color: var(--bk-green); color: #fff; }
.pf-switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pf-switch-row small, .pf-sport-row small, .pf-settings-link small { display: block; font-size: 0.8rem; color: var(--bk-text-3); margin-top: 2px; }
.pf-sport-row { display: flex; align-items: center; gap: 12px; }
.pf-sport-emoji { font-size: 1.8rem; width: 48px; height: 48px; border-radius: 14px; background: var(--bk-surface-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pf-none { margin: 0; }
.pf-settings-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--bk-radius, 16px); border: 1px solid var(--bk-border); background: var(--bk-surface); color: var(--bk-text); text-decoration: none; }
.pf-settings-link > span:first-child { width: 40px; height: 40px; border-radius: 12px; background: var(--bk-indigo-soft); color: var(--bk-indigo); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pf-settings-link svg { width: 22px; height: 22px; }
.pf-savebar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bk-nav-height) + var(--bk-safe-bottom) + 10px); z-index: 900; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--bk-surface); border: 1px solid var(--bk-green); box-shadow: var(--bk-shadow-lg); font-weight: 700; max-width: 640px; margin: 0 auto; }
.pf-savebar[hidden] { display: none; }
.pf-savebar .bk-btn { min-height: 44px; }
.pf-sub-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--bk-border); }
.pf-sub-row:last-child { border-bottom: 0; }
.pf-sub-row .bk-grow { min-width: 0; }
.pf-sub-row .bk-btn { width: auto; min-width: 0; min-height: 40px; padding: 0 12px; font-size: 0.82rem; }
.pf-scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-scope { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; border-radius: var(--bk-radius-sm); border: 1px solid var(--bk-border); background: var(--bk-surface); min-width: 0; }
.pf-scope .bk-grow { min-width: 0; }
.pf-scope strong { display: block; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-scope small { color: var(--bk-text-3); font-size: 0.7rem; }
.pf-scope.is-primary { border-color: var(--bk-green); background: var(--bk-green-soft); }
@media (min-width: 1024px) { .pf-savebar { bottom: 20px; } }

.cx-head h1, .cx-view-head h1 { margin: 0; font-size: 1.4rem; }
.cx-head { margin: 4px 0 14px; }
.cx-head p { margin: 2px 0 0; }
.cx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cx-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 14px 14px; min-height: 158px; border-radius: 18px; border: 1px solid var(--bk-border); background: var(--bk-surface); color: var(--bk-text); text-decoration: none; box-shadow: var(--bk-shadow); }
.cx-tile:active { transform: scale(0.98); }
.cx-tile strong { font-size: 1rem; margin-top: 8px; }
.cx-tile small { font-size: 0.78rem; color: var(--bk-text-3); line-height: 1.3; }
.cx-status { margin-top: auto; padding-top: 8px; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.cx-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--bk-text-3); }
.cx-dot.is-good { background: var(--bk-green); }
.cx-dot.is-todo { background: var(--bk-warning); }
.cx-icon { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.cx-icon svg { width: 26px; height: 26px; }
.cx-icon-telegram { background: #229ed9; }
.cx-icon-claude { background: #d97757; }
.cx-icon-key { background: var(--bk-indigo); }
.cx-icon-billing { background: var(--bk-green); }
.cx-list { border: 1px solid var(--bk-border); border-radius: 16px; background: var(--bk-surface); overflow: hidden; }
.cx-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--bk-border); background: transparent; color: var(--bk-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.cx-row:last-child { border-bottom: 0; }
.cx-row.is-static { cursor: default; }
.cx-row .bk-grow { min-width: 0; }
.cx-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-row small { display: block; font-size: 0.78rem; color: var(--bk-text-3); overflow-wrap: anywhere; }
.cx-row-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--bk-surface-2); color: var(--bk-text-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cx-row-icon svg, .cx-row > [data-icon="chevron"] svg { width: 20px; height: 20px; }
.cx-row > [data-icon="chevron"] { color: var(--bk-text-3); display: inline-flex; }
.cx-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 6px; margin: 0 0 6px -6px; border: 0; border-radius: 999px; background: transparent; color: var(--bk-indigo); font: inherit; font-weight: 700; cursor: pointer; }
.cx-back::before { content: "‹"; font-size: 1.5rem; line-height: 1; margin-top: -2px; }
.cx-view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cx-view-head p { margin: 2px 0 0; }
.cx-view > * + * { margin-top: 12px; }
.cx-view .cx-view-head + * { margin-top: 0; }
.cx-view [id$="-body"] > * + *, #tg-pair > * + * { margin-top: 12px; }
.cx-view [id$="-body"] > .cx-h2 { margin-top: 20px; }
.cx-state { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--bk-border); border-left: 6px solid var(--bk-text-3); background: var(--bk-surface); }
.cx-state strong { font-size: 1rem; }
.cx-state span { font-size: 0.86rem; color: var(--bk-text-2); }
.cx-state.is-good { border-left-color: var(--bk-green); }
.cx-state.is-todo { border-left-color: var(--bk-warning); }
.cx-state.is-bad { border-left-color: var(--bk-danger); }
.cx-state .pf-secret { margin-top: 4px; }
.cx-step { display: flex; gap: 12px; padding: 4px 0 14px; }
.cx-step + .cx-step { border-top: 1px solid var(--bk-border); padding-top: 14px; padding-bottom: 4px; }
.cx-step p { margin: 4px 0 10px; }
.cx-step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--bk-indigo); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cx-step.is-done .cx-step-n { background: var(--bk-green); }
.cx-link { font-size: 0.8rem; }
.cx-h2 { font-size: 0.95rem; margin: 18px 0 8px; }
.bk-section-head .cx-h2 { margin: 0; }
.cx-what { margin: 14px 0 0; padding: 0 0 0 20px; color: var(--bk-text-2); font-size: 0.88rem; display: grid; gap: 4px; }
.cx-big { min-height: 56px; font-size: 1.05rem; }
.cx-wait { display: flex; align-items: center; gap: 10px; padding: 12px 4px; font-size: 0.9rem; color: var(--bk-text-2); }
.cx-qr { display: flex; align-items: center; gap: 14px; }
.cx-qr-img { width: 150px; flex: 0 0 auto; background: #fff; padding: 6px; border-radius: 10px; }
.cx-more { border: 1px solid var(--bk-border); border-radius: 14px; padding: 0 14px; background: var(--bk-surface); }
.cx-more > summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; font-size: 0.9rem; cursor: pointer; list-style: none; }
.cx-more > summary::-webkit-details-marker { display: none; }
.cx-more > summary::after { content: "▾"; margin-left: auto; color: var(--bk-text-3); }
.cx-more[open] > summary::after { content: "▴"; }
.cx-more[open] { padding-bottom: 14px; }
.cx-more .bk-field + .bk-field { margin-top: 10px; }
.cx-more .bk-label { display: block; margin-top: 12px; }
.bk-card .cx-more { border: 0; padding: 0; background: transparent; }
@media (min-width: 700px) { .cx-grid { grid-template-columns: repeat(4, 1fr); } }

/* ==================================================================================================== v3.10.0
 * Admin: give free access (complimentary grant) form.
 */
.gr-form { display: flex; flex-direction: column; gap: 10px; }
.gr-form > p { margin: 0; }
.gr-form .bk-label { margin-top: 6px; }
.gr-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gr-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 76px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--bk-field-border); background: var(--bk-field-bg); color: var(--bk-text); font: inherit; text-align: left; cursor: pointer; }
.gr-opt small { font-size: 0.74rem; color: var(--bk-text-3); line-height: 1.3; }
.gr-opt[aria-pressed="true"] { border: 2px solid var(--bk-green); background: var(--bk-green-soft); }
.gr-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gr-feats[hidden] { display: none; }
.gr-feat { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--bk-border); cursor: pointer; }
.gr-feat input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--bk-green); flex: 0 0 auto; }
.gr-feat strong { display: block; font-size: 0.86rem; }
.gr-feat small { display: block; font-size: 0.72rem; color: var(--bk-text-3); }
.gr-lens { display: flex; flex-wrap: wrap; gap: 6px; }
.gr-lens button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--bk-field-border); background: var(--bk-field-bg); color: var(--bk-text); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.gr-lens button[aria-pressed="true"] { background: var(--bk-green); border-color: var(--bk-green); color: #fff; }
.gr-form #gr-date[hidden] { display: none; }
.gr-summary { padding: 12px 14px; border-radius: 12px; background: var(--bk-surface-2); font-size: 0.9rem; }
@media (max-width: 560px) { .gr-opts, .gr-feats { grid-template-columns: 1fr; } .gr-opt { min-height: 0; } }


/* ------------------------------------------------------------------------------------------------------------------
   Bottom bar with six entries (Calories added). Labels shrink a little on narrow phones.
   ------------------------------------------------------------------------------------------------------------------ */
#mobile-bottom-nav { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 400px) { #mobile-bottom-nav a { font-size: 0.62rem; } #mobile-bottom-nav a svg { width: 22px; height: 22px; } }

/* ------------------------------------------------------------------------------------------------------------------
   Home-screen style settings: a grid of app icons, one tap opens one screen (Settings and the admin Control Center).
   ------------------------------------------------------------------------------------------------------------------ */
.cx-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 6px; padding: 6px 0 4px; }
.cx-app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--bk-text); font: inherit; text-align: center; text-decoration: none; cursor: pointer; min-width: 0; -webkit-tap-highlight-color: transparent; }
.cx-app .cx-icon { width: 60px; height: 60px; border-radius: 16px; background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0)); box-shadow: 0 4px 10px rgba(17, 24, 39, 0.16); transition: transform 0.12s ease; }
.cx-app .cx-icon svg { width: 30px; height: 30px; }
.cx-app:active .cx-icon { transform: scale(0.92); }
.cx-app:focus-visible { outline: none; }
.cx-app:focus-visible .cx-icon { outline: 3px solid var(--bk-indigo); outline-offset: 3px; }
.cx-app strong { font-size: 0.76rem; font-weight: 600; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-app .cx-status { margin: 0; padding: 0; font-size: 0.66rem; font-weight: 600; color: var(--bk-text-3); gap: 4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; justify-content: center; }
.cx-app .cx-status .cx-dot { width: 7px; height: 7px; }
.cx-app[hidden] { display: none; }
.cx-apps-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bk-text-3); margin: 22px 0 10px; }
.cx-apps-title:first-child { margin-top: 4px; }
.cx-icon-green { background-color: var(--bk-green); }
.cx-icon-indigo { background-color: var(--bk-indigo); }
.cx-icon-blue { background-color: #229ed9; }
.cx-icon-orange { background-color: #f08a24; }
.cx-icon-red { background-color: #e5484d; }
.cx-icon-purple { background-color: #8e4ec6; }
.cx-icon-teal { background-color: #0d9488; }
.cx-icon-pink { background-color: #d6409f; }
.cx-icon-slate { background-color: #5b6578; }
.cx-icon-stripe { background-color: #635bff; }
.cx-dot.is-bad { background: var(--bk-danger); }
.st-view > .bk-section-head { margin-bottom: 12px; }
.st-view > .bk-section-head h2 { font-size: 1.25rem; }
@media (min-width: 560px) { .cx-apps { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cx-apps { grid-template-columns: repeat(6, minmax(0, 104px)); gap: 26px 18px; } }

/* ------------------------------------------------------------------------------------------------------------------
   Calories page
   ------------------------------------------------------------------------------------------------------------------ */
.kc-daybar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.kc-day { flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--bk-text); font: inherit; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.kc-daybar .bk-icon-btn:disabled { opacity: 0.3; }
.kc-hero { transition: opacity 0.15s ease; }
.kc-hero.is-loading { opacity: 0.5; }
.kc-balance { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 12px; text-align: center; }
.kc-balance-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bk-text-3); }
.kc-balance strong { font-size: 2.9rem; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; }
.kc-balance strong small { font-size: 1rem; font-weight: 700; }
.kc-balance.is-deficit strong { color: var(--bk-green); }
.kc-balance.is-surplus strong { color: var(--bk-danger); }
.kc-balance-sub { font-size: 0.8rem; color: var(--bk-text-3); }
.kc-bars { display: grid; gap: 8px; margin: 4px 0 12px; }
.kc-bar-row { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--bk-text-2); }
.kc-bar-row b { text-align: right; font-variant-numeric: tabular-nums; color: var(--bk-text); }
.kc-track { display: flex; height: 14px; border-radius: 999px; background: var(--bk-surface-2); overflow: hidden; }
.kc-fill { display: block; height: 100%; }
.kc-fill-eaten, .kc-dot-eaten { background: #f08a24; }
.kc-fill-base, .kc-dot-base { background: var(--bk-indigo); }
.kc-fill-train, .kc-dot-train { background: var(--bk-green); }
.kc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kc-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--bk-border); border-radius: 14px; background: var(--bk-surface); color: var(--bk-text-2); font: inherit; font-size: 0.74rem; font-weight: 600; text-align: left; min-width: 0; }
button.kc-stat { cursor: pointer; }
.kc-stat strong { font-size: 1.2rem; color: var(--bk-text); font-variant-numeric: tabular-nums; }
.kc-dot { width: 9px; height: 9px; border-radius: 50%; }
.kc-target { margin: 12px 0 0; font-size: 0.88rem; text-align: center; color: var(--bk-text-2); }
.kc-nudge { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--bk-border); border-radius: 12px; background: transparent; color: var(--bk-text-2); font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; }
.kc-nudge > span:first-child { flex: 1; }
.kc-nudge svg { width: 18px; height: 18px; }
.kc-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.kc-add .bk-btn { width: 100%; }
.kc-add-main { grid-column: 1 / -1; min-height: 56px; font-size: 1.05rem; gap: 10px; }
.kc-add-main [data-icon] { display: inline-flex; }
.kc-add-main svg { width: 24px; height: 24px; }
.kc-tip { margin: 8px 2px 18px; }
.kc-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.kc-list { border: 1px solid var(--bk-border); border-radius: 16px; background: var(--bk-surface); overflow: hidden; }
.kc-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--bk-border); background: transparent; color: var(--bk-text); font: inherit; text-align: left; cursor: pointer; }
.kc-row:last-child { border-bottom: 0; }
.kc-row .bk-grow { min-width: 0; }
.kc-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-row small { display: block; font-size: 0.74rem; color: var(--bk-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-thumb { width: 48px; height: 48px; border-radius: 12px; background: var(--bk-surface-2) center / cover no-repeat; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--bk-text-3); }
.kc-thumb svg { width: 22px; height: 22px; }
.kc-kcal { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kc-kcal small { display: block; font-size: 0.66rem; font-weight: 600; color: var(--bk-text-3); }
.kc-photo img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; }
.kc-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kc-items { display: grid; gap: 2px; }
.kc-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--bk-border); font-size: 0.88rem; }
.kc-item:last-child { border-bottom: 0; }
.kc-item > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--bk-text-2); }
.kc-session { padding-bottom: 8px; }
.kc-session + .kc-session { margin-top: 10px; }
.kc-session-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.kc-session-head small { display: block; font-size: 0.78rem; }
.kc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; }
.kc-week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; border-radius: 10px; background: transparent; color: var(--bk-text-3); font: inherit; cursor: pointer; min-width: 0; }
.kc-week-day.is-current { background: var(--bk-surface-2); color: var(--bk-text); }
.kc-week-val { font-size: 0.62rem; font-weight: 700; min-height: 1em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kc-week-bar { display: flex; align-items: flex-end; width: 60%; max-width: 26px; height: 72px; border-radius: 6px; background: var(--bk-surface-2); overflow: hidden; }
.kc-week-bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; }
.kc-week-day.is-deficit .kc-week-bar i { background: var(--bk-green); }
.kc-week-day.is-surplus .kc-week-bar i { background: var(--bk-danger); }
.kc-week-label { font-size: 0.7rem; font-weight: 600; }
.kc-week-sum { margin: 12px 0 0; }
.kc-foot { margin: 18px 2px 8px; }
.kc-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kc-choice-col { grid-template-columns: 1fr; }
.kc-choice button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 48px; justify-content: center; padding: 8px 14px; border: 1.5px solid var(--bk-border); border-radius: 12px; background: var(--bk-surface); color: var(--bk-text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.kc-choice button small { font-weight: 500; font-size: 0.78rem; color: var(--bk-text-3); }
.kc-choice button[aria-pressed="true"] { border-color: var(--bk-green); background: var(--bk-green-soft); }

/* ==================================================================================================== v3.11 one icon family
   Every icon is a line icon from BetaKai.ui.ICONS (24 px grid, 2 px round stroke) drawn in ONE colour: --bk-icon.
   Icons mark a state or a section; a button carries either a label or a single icon, never both. */
:root { --bk-icon: #1f2a37; --bk-icon-bg: #eef0f3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bk-icon: #e6e9ef; --bk-icon-bg: #1f2b44; } }
:root[data-theme="dark"] { --bk-icon: #e6e9ef; --bk-icon-bg: #1f2b44; }

.bk-ic { display: inline-flex; width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -0.2em; font-style: normal; }
.bk-ic svg { width: 100%; height: 100%; display: block; }
:where([data-icon]) > svg { width: 100%; height: 100%; display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
[data-icon]:not([class]) { width: 1.15em; height: 1.15em; }
[data-icon][hidden] { display: none; }

/* Monogram used where a pictogram would need its own drawing (sports, countries). */
.bk-code { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 12px; background: var(--bk-icon-bg); color: var(--bk-icon); font-family: var(--bk-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; flex: 0 0 auto; }
.bk-choice .bk-choice-emoji.bk-code { font-size: 0.72rem; margin: 0 auto 4px; }
.pf-sport-emoji.bk-code { width: 48px; height: 48px; font-size: 0.78rem; }

/* Icon holders: neutral tile, single ink colour. */
.bk-list-avatar, .bk-price-head .bk-price-icon, .cm-hub-tile .cm-hub-icon, .cx-row-icon, .mode-icon, .cx-icon, .cx-app .cx-icon,
.cx-icon-telegram, .cx-icon-claude, .cx-icon-key, .cx-icon-billing, .cx-icon-green, .cx-icon-indigo, .cx-icon-blue, .cx-icon-orange,
.cx-icon-red, .cx-icon-purple, .cx-icon-teal, .cx-icon-pink, .cx-icon-slate, .cx-icon-stripe {
  background: var(--bk-icon-bg);
  background-image: none;
  color: var(--bk-icon);
  box-shadow: none;
}
.bk-list-avatar > svg, .bk-list-avatar .bk-ic, .bk-price-icon > svg, .cm-hub-icon > svg, .mode-icon > svg { width: 22px; height: 22px; }
.bk-list-avatar[data-icon] > svg, .bk-price-icon[data-icon] > svg { width: 22px; height: 22px; }
.bk-empty .bk-empty-icon, .pg-gate .pg-gate-icon, .ws-done-banner .ws-done-icon, .bk-thumb-fallback, .bk-choice .bk-choice-emoji,
.bk-banner > span:first-child, .bk-alert > span:first-child, .pg-ledger-row > span:first-child, .ws-pass > span:first-child,
.gate-note > span:first-child, .wx-note-icon, .details-menu [role="menuitem"] > span:first-child { color: var(--bk-icon); }
.bk-empty .bk-empty-icon, .pg-gate .pg-gate-icon, .ws-done-banner .ws-done-icon { font-size: 2rem; opacity: 0.85; }
.bk-choice .bk-choice-emoji[data-icon] { width: 26px; height: 26px; }
.bk-thumb-fallback { background: var(--bk-icon-bg); }
.bk-card-hero .bk-ic, .bk-btn-primary .bk-ic, .bk-btn-indigo .bk-ic { color: inherit; }
.wx-stats-edit[data-icon] { width: 14px; height: 14px; }
.cm-upvote { gap: 6px; }

/* Readiness: three plain answers per row. */
.bk-readiness-opt { font-size: 0.9rem; font-weight: 600; min-height: 48px; padding: 6px 4px; text-align: center; line-height: 1.15; }

/* ---------------------------------------------------------------------------------------------------- v3.11 buttons fit their text
   A label never spills out of its button: it wraps onto a second line, and a row of buttons folds when it runs out of room. */
.bk-btn { white-space: normal !important; overflow-wrap: break-word; text-wrap: balance; padding-top: 8px; padding-bottom: 8px; height: auto; }
/* Compact buttons keep their words whole: the text beside them wraps instead. */
.bk-btn-sm, .bk-btn-auto, .bk-banner .bk-btn, .pf-sub-row .bk-btn { padding-top: 6px; padding-bottom: 6px; flex-shrink: 0; }
.bk-btn-row { flex-wrap: wrap; }
.bk-btn-row .bk-btn { flex: 1 1 132px; }
.bk-banner { flex-wrap: wrap; }
.bk-banner .bk-banner-body { flex: 1 1 180px; min-width: 0; }
.bk-banner .bk-btn { flex: 0 1 auto; max-width: 100%; }
.bk-tab, .bk-segment button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ws-main-btn, .wx-btn-main, .wx-btn-sub { min-width: 0; overflow-wrap: break-word; }
.kc-add-main { grid-column: 1 / -1; }

/* ---------------------------------------------------------------------------------------------------- v3.11 describe a meal by voice */
.kc-voice { position: relative; }
.kc-voice .bk-textarea { padding-right: 64px; min-height: 112px; }
.kc-mic { position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--bk-icon); color: var(--bk-surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.kc-mic svg { width: 22px; height: 22px; }
.kc-mic[aria-pressed="true"] { background: var(--bk-danger); color: #fff; animation: kc-pulse 1.4s ease-in-out infinite; }
@keyframes kc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); } 50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } }

/* ---------------------------------------------------------------------------------------------------- v3.11 first connection (home page)
   Two cards at most: Telegram, then the AI assistant. Each has one obvious button. */
.ob-card { background: var(--bk-surface); border: 1px solid var(--bk-border); border-radius: var(--bk-radius); box-shadow: var(--bk-shadow); padding: 16px; margin: 0 0 12px; display: grid; gap: 12px; }
.ob-card.is-done { border-color: var(--bk-green); }
.ob-head { display: flex; align-items: center; gap: 12px; }
.ob-head h2 { margin: 0; font-size: 1.08rem; line-height: 1.25; }
.ob-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--bk-icon-bg); color: var(--bk-icon); flex: 0 0 auto; }
.ob-icon > svg { width: 24px; height: 24px; }
.ob-step { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bk-text-3); }
.ob-text { margin: 0; color: var(--bk-text-2); font-size: 0.92rem; line-height: 1.45; }
.ob-hint { margin: 0; color: var(--bk-text-3); font-size: 0.8rem; line-height: 1.45; }
.ob-hint .bk-spinner { vertical-align: -3px; margin-right: 6px; }
.ob-hint b { color: var(--bk-text-2); }
.ob-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ob-link { background: none; border: 0; padding: 0; min-height: 0 !important; min-width: 0 !important; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--bk-text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ob-card .bk-btn[aria-busy="true"] { opacity: 0.75; }

.ob-wizard { display: grid; gap: 14px; }
.ob-dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ob-dots li { flex: 1; height: 4px; border-radius: 2px; background: var(--bk-surface-3); }
.ob-dots li.is-past { background: var(--bk-text-3); }
.ob-dots li.is-now { background: var(--bk-green); }
.ob-q { margin: 0; font-size: 1.15rem; }
.ob-choices { display: grid; gap: 8px; }
.ob-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; min-height: 56px; border: 1.5px solid var(--bk-border); border-radius: 14px; background: var(--bk-surface); color: var(--bk-text); font: inherit; text-align: left; cursor: pointer; }
.ob-choice small { color: var(--bk-text-3); font-size: 0.8rem; }
.ob-choice[aria-pressed="true"] { border-color: var(--bk-green); background: var(--bk-green-soft); }
.ob-steps { margin: 0; padding: 0; list-style: none; counter-reset: ob; display: grid; gap: 10px; }
.ob-steps li { counter-increment: ob; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 0.94rem; line-height: 1.4; color: var(--bk-text-2); }
.ob-steps li::before { content: counter(ob); width: 28px; height: 28px; border-radius: 50%; background: var(--bk-icon-bg); color: var(--bk-icon); font-weight: 700; font-size: 0.84rem; display: inline-flex; align-items: center; justify-content: center; }
.ob-steps b { color: var(--bk-text); }
.ob-linkbox { overflow-wrap: anywhere; font-size: 0.78rem; }
.ob-asks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ob-asks li { padding: 10px 12px; border-radius: 12px; background: var(--bk-surface-2); font-size: 0.92rem; }
.ob-status { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--bk-text-2); }
.ob-status.is-good { color: var(--bk-success); font-weight: 600; }
.ob-status [data-icon] { width: 20px; height: 20px; }
.ob-nav { margin-top: 4px; }

/* v3.11: trial / lock badge on a menu entry: small, neutral, same ink as the icons. */
.bk-nav-badge, #mobile-bottom-nav .bk-nav-badge { background: var(--bk-icon) !important; color: var(--bk-surface); }
#mobile-bottom-nav .bk-nav-badge svg, #bk-sidebar .bk-badge svg { width: 10px; height: 10px; flex: 0 0 auto; }

/* ---------------------------------------------------------------------------------------------------- v3.12 store: pay monthly or yearly, All options */
.store-interval { margin: 0 0 12px; max-width: 360px; }
.bk-price-card.is-bundle { border: 2px solid var(--bk-green); }
.bk-price-amount { display: flex; flex-direction: column; align-items: flex-end; }
.bk-price-compare { font-size: 0.72rem; font-weight: 500; color: var(--bk-text-3); text-decoration: line-through; white-space: nowrap; }

/* ---------------------------------------------------------------------------------------------------- v3.13 calories: macro ring, diet scores, scanning, AI Dietician */
.kc-add { grid-template-columns: 1fr 1fr; }
.kc-insight { display: grid; gap: 10px; }
.kc-ring-wrap { display: grid; grid-template-columns: minmax(120px, 44%) 1fr; gap: 14px; align-items: center; }
.kc-ring { width: 100%; max-width: 190px; height: auto; justify-self: center; filter: drop-shadow(0 6px 14px rgba(17, 24, 39, 0.12)); }
.kc-ring-track { fill: none; stroke: var(--bk-surface-3); stroke-width: 5.2; }
.kc-ring-arc { fill: none; stroke-width: 5.2; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.kc-ring-arc.is-protein, .kc-legend .is-protein .kc-dot { stroke: var(--bk-green); background: var(--bk-green); }
.kc-ring-arc.is-carbs, .kc-legend .is-carbs .kc-dot { stroke: var(--bk-indigo); background: var(--bk-indigo); }
.kc-ring-arc.is-fat, .kc-legend .is-fat .kc-dot { stroke: #0d9488; background: #0d9488; }
.kc-ring-num { font-size: 19px; font-weight: 800; fill: var(--bk-text); font-family: var(--bk-mono); }
.kc-ring-sub { font-size: 8.5px; fill: var(--bk-text-3); }
.kc-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kc-legend li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 8px; align-items: center; font-size: 0.9rem; }
.kc-legend .kc-dot { width: 12px; height: 12px; border-radius: 4px; }
.kc-legend strong { font-family: var(--bk-mono); font-size: 1rem; }
.kc-legend small { grid-column: 2 / -1; color: var(--bk-text-3); font-size: 0.76rem; }
.kc-scores { display: grid; gap: 8px; margin-top: 10px; }
.kc-score { background: var(--bk-surface); border: 1px solid var(--bk-border); border-radius: var(--bk-radius); padding: 12px 14px; }
.kc-score > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: baseline; }
.kc-score > summary::-webkit-details-marker { display: none; }
.kc-score-name { font-weight: 700; }
.kc-score-num { font-family: var(--bk-mono); font-weight: 800; font-size: 1.35rem; }
.kc-score-num small { font-size: 0.7rem; font-weight: 500; color: var(--bk-text-3); }
.kc-score-bar { grid-column: 1 / -1; display: block; height: 8px; border-radius: 4px; background: var(--bk-surface-3); overflow: hidden; }
.kc-score-bar i { display: block; height: 100%; border-radius: 4px; background: var(--bk-text-3); transition: width 0.6s ease; }
.kc-score.is-good .kc-score-bar i { background: var(--bk-green); }
.kc-score.is-fair .kc-score-bar i { background: var(--bk-indigo); }
.kc-score.is-low .kc-score-bar i { background: var(--bk-danger); }
.kc-score-advice { grid-column: 1 / -1; font-size: 0.84rem; color: var(--bk-text-2); }
.kc-score-lines { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--bk-border); display: grid; gap: 8px; }
.kc-score-lines li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; color: var(--bk-text-2); }
.kc-score-lines strong { display: block; color: var(--bk-text); }
.kc-score-lines b { font-family: var(--bk-mono); white-space: nowrap; }
.kc-empty .kc-score-bar { margin-top: 8px; }
.kc-empty .kc-score-bar i { background: var(--bk-green); }
.kc-per100 > div, .kd-macros { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 0.88rem; color: var(--bk-text-2); }
.kc-per100 b, .kd-macros b { font-family: var(--bk-mono); font-size: 1.05rem; color: var(--bk-text); }
.kc-portion { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: 14px; background: var(--bk-surface-2); }
.kc-portion strong { font-family: var(--bk-mono); font-size: 1.7rem; }
.kc-portion strong small { font-size: 0.8rem; font-weight: 500; }
.kc-portion span { font-size: 0.84rem; color: var(--bk-text-2); }
.kc-scan { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.kc-scan[hidden] { display: none; }
.kc-scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kc-scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.18); border-radius: 2px; }
.kd-plan { display: grid; gap: 12px; }
.kd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kd-summary { margin: 0; font-size: 0.94rem; line-height: 1.45; }
.kd-today { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--bk-green-soft); }
.kd-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.kd-week span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--bk-surface-2); font-size: 0.72rem; }
.kd-week span b { font-size: 0.74rem; }
.kd-week .is-high { background: var(--bk-green); color: #fff; }
.kd-week .is-medium { background: var(--bk-green-soft); }
.kd-meals { display: grid; gap: 10px; margin-top: 8px; }
.kd-meal-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: 0.86rem; }
.kd-meal-head span { color: var(--bk-text-3); font-size: 0.78rem; }
.kd-meal ul { margin: 4px 0 0; padding-left: 1.1rem; font-size: 0.86rem; color: var(--bk-text-2); }
.kd-steps { margin: 8px 0 0; padding-left: 1.2rem; display: grid; gap: 8px; font-size: 0.86rem; }
.kd-steps span { display: block; color: var(--bk-text-2); }
.kd-swaps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 0.86rem; }
.kd-swaps li { display: grid; gap: 1px; }
.kd-swaps span { color: var(--bk-text-3); text-decoration: line-through; }
.kd-swaps small { color: var(--bk-text-3); }
.kd-cautions { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; font-size: 0.78rem; color: var(--bk-text-3); }
.kd-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kd-check { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1.5px solid var(--bk-border); border-radius: 12px; font-size: 0.9rem; cursor: pointer; }
.kd-check input { width: 20px; height: 20px; min-width: 20px !important; min-height: 20px !important; accent-color: var(--bk-green); }

/* ---------------------------------------------------------------------------------------------------- v3.13 store: the whole app first */
.store-hero-card { display: grid; gap: 10px; padding: 20px 18px; }
.store-hero-kicker { margin: 0; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bk-text-3); }
.store-hero-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.store-hero-price strong { font-family: var(--bk-mono); font-size: 2.1rem; font-weight: 800; line-height: 1; }
.store-hero-sub { margin: 0; font-size: 0.88rem; color: var(--bk-text-2); }
.store-hero-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 0.88rem; }
.store-hero-list li { display: flex; align-items: center; gap: 6px; }
.store-hero-list [data-icon] { width: 16px; height: 16px; color: var(--bk-green); flex: 0 0 auto; }
.store-details { margin-bottom: 16px; }
.store-details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 16px; border: 1px solid var(--bk-border); border-radius: var(--bk-radius); background: var(--bk-surface); font-weight: 700; }
.store-details > summary::-webkit-details-marker { display: none; }
.store-details > summary::after { content: "▾"; color: var(--bk-text-3); }
.store-details[open] > summary { margin-bottom: 14px; }
.store-details[open] > summary::after { content: "▴"; }
