/* Tabbed routine builder (/routine/). Tokens only; layout follows docs/DESIGN-BRIEF.md. */
.kb-routine {
  box-sizing: border-box;
  color: var(--kb-ink);
  font: var(--kb-fs-body)/var(--kb-lh-body) var(--kb-font-body);
  margin: 0 auto;
  max-width: var(--kb-maxw);
  padding: calc(var(--kb-space) * 4) var(--kb-page-gutter) calc(var(--kb-space) * 12);
}
.kb-routine *, .kb-routine *::before, .kb-routine *::after { box-sizing: border-box; }
.kb-routine h1, .kb-routine h2, .kb-routine h3, .kb-routine p { margin-top: 0; }
.kb-routine [hidden] { display: none !important; }
.kb-routine button { font-family: inherit; }
.kb-routine .kb-icon { flex: none; height: var(--kb-icon-sm); width: var(--kb-icon-sm); }

.kb-routine__eyebrow {
  color: var(--kb-accent);
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 var(--kb-space);
  text-transform: uppercase;
}

/* Intro + quick start */
.kb-routine__intro { margin: 0 auto calc(var(--kb-space) * 3); max-width: 760px; text-align: center; }
.kb-routine__intro h1 { font-size: var(--kb-fs-h1); letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 calc(var(--kb-space) * 1.5); }
.kb-routine__intro p { color: var(--kb-ink-soft); font-size: var(--kb-fs-lead); margin: 0 auto; max-width: 620px; }

.kb-routine__presets { margin: 0 auto calc(var(--kb-space) * 4); max-width: 980px; }
.kb-routine__presets-title { color: var(--kb-ink-soft); font-size: var(--kb-fs-meta); font-weight: 700; margin: 0 0 var(--kb-space); text-align: center; }
.kb-routine__preset-grid { display: grid; gap: calc(var(--kb-space) * 1.5); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kb-routine__preset {
  align-items: center;
  background: var(--kb-surface);
  border: 1px solid var(--kb-line);
  border-radius: var(--kb-radius);
  color: var(--kb-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-height: 72px;
  padding: calc(var(--kb-space) * 1.5) calc(var(--kb-space) * 2);
  text-align: center;
  transition: border-color var(--kb-motion-fast) var(--kb-ease), background-color var(--kb-motion-fast) var(--kb-ease);
}
.kb-routine__preset strong { font-size: var(--kb-fs-card); font-weight: 700; }
.kb-routine__preset span { color: var(--kb-ink-soft); font-size: var(--kb-fs-meta); }
.kb-routine__preset:hover { background: var(--kb-blush-tint); border-color: var(--kb-accent); }

/* Shell */
.kb-routine__shell { align-items: start; display: grid; gap: calc(var(--kb-space) * 4); grid-template-columns: minmax(0, 1fr) 340px; }
.kb-routine__content { min-width: 0; scroll-margin-top: calc(var(--kb-space) * 2); }

/* Step tabs */
.kb-routine__steps { display: grid; gap: var(--kb-space); grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: calc(var(--kb-space) * 2); }
.kb-routine__steps:has(.kb-routine__tab[hidden]) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kb-routine__tab {
  align-items: center;
  background: var(--kb-surface);
  border: 1px solid var(--kb-line);
  border-radius: var(--kb-radius);
  color: var(--kb-ink);
  cursor: pointer;
  display: flex;
  gap: var(--kb-space);
  min-height: 60px;
  min-width: 0;
  padding: var(--kb-space) calc(var(--kb-space) * 1.5);
  text-align: left;
  transition: border-color var(--kb-motion-fast) var(--kb-ease), background-color var(--kb-motion-fast) var(--kb-ease);
}
.kb-routine__tab:hover { border-color: var(--kb-accent); }
.kb-routine__tab.is-active { background: var(--kb-blush-tint); border-color: var(--kb-accent); box-shadow: inset 0 0 0 1px var(--kb-accent); }
.kb-routine__tab-num {
  align-items: center;
  background: var(--kb-blush-tint);
  border-radius: 50%;
  color: var(--kb-accent);
  display: inline-flex;
  flex: none;
  font-size: var(--kb-fs-meta);
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}
.kb-routine__tab.is-active .kb-routine__tab-num { background: var(--kb-surface); }
.kb-routine__tab-num .kb-icon { display: none; }
.kb-routine__tab.is-done .kb-routine__tab-num { background: var(--kb-accent); color: var(--kb-accent-ink); }
.kb-routine__tab.is-done .kb-routine__tab-num > span { display: none; }
.kb-routine__tab.is-done .kb-routine__tab-num .kb-icon { display: block; }
.kb-routine__tab-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.kb-routine__tab-label { font-size: 0.9375rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-routine__tab-copy small { color: var(--kb-ink-soft); font-size: 0.75rem; }
.kb-routine__tab.is-done .kb-routine__tab-copy small { color: var(--kb-accent); font-weight: 700; }

/* Toolbar */
.kb-routine__toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: var(--kb-space); margin-bottom: calc(var(--kb-space) * 3); }
.kb-routine__time { background: var(--kb-surface-alt); border: 1px solid var(--kb-line); border-radius: var(--kb-radius-control); display: inline-flex; padding: 3px; }
.kb-routine__time button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--kb-radius-control);
  color: var(--kb-ink-soft);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--kb-fs-meta);
  font-weight: 700;
  gap: 6px;
  min-height: 38px;
  padding: 0 calc(var(--kb-space) * 2);
}
.kb-routine__time button.is-active { background: var(--kb-surface); box-shadow: 0 1px 4px var(--kb-line); color: var(--kb-ink); }
.kb-routine__filter { margin-left: auto; }
.kb-routine__filter + .kb-routine__filter { margin-left: 0; }
.kb-routine select {
  background-color: var(--kb-surface);
  border: 1px solid var(--kb-line);
  border-radius: var(--kb-radius-control);
  color: var(--kb-ink);
  font: inherit;
  font-size: var(--kb-fs-meta);
  min-height: 44px;
  padding: 0 calc(var(--kb-space) * 4) 0 calc(var(--kb-space) * 2);
}

/* Step panel */
.kb-routine__panel-head { margin-bottom: calc(var(--kb-space) * 2); }
.kb-routine__panel-head h2 { align-items: baseline; display: flex; flex-wrap: wrap; font-size: var(--kb-fs-h3); gap: var(--kb-space); line-height: 1.2; margin: 0 0 6px; }
.kb-routine__panel-head h2 span { color: var(--kb-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.kb-routine__panel-head p { color: var(--kb-ink-soft); font-size: 0.9375rem; margin: 0; max-width: 680px; }
.kb-routine__grid { display: grid; gap: calc(var(--kb-space) * 2); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kb-routine__none { background: var(--kb-surface-alt); border-radius: var(--kb-radius); color: var(--kb-ink-soft); margin: 0; padding: calc(var(--kb-space) * 3); text-align: center; }

/* Product card */
.kb-routine-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-line);
  border-radius: var(--kb-radius-card);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: border-color var(--kb-motion-fast) var(--kb-ease), box-shadow var(--kb-motion-base) var(--kb-ease);
}
.kb-routine-card:hover { border-color: var(--kb-accent-tint); box-shadow: 0 10px 26px -18px var(--kb-ink-faint); }
.kb-routine-card.is-selected { border-color: var(--kb-accent); box-shadow: inset 0 0 0 1px var(--kb-accent); }
.kb-routine-card__media { aspect-ratio: 1; background: var(--kb-surface-alt); display: block; overflow: hidden; position: relative; }
.kb-routine-card__media img { display: block; height: 100%; object-fit: contain; width: 100%; }
.kb-routine-card__sale { background: var(--kb-sale-red); border-radius: var(--kb-radius-control); color: var(--kb-accent-ink); font-size: 0.75rem; font-weight: 700; left: 10px; padding: 2px 10px; position: absolute; top: 10px; z-index: 1; }
.kb-routine-card__body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: calc(var(--kb-space) * 1.5); }
.kb-routine-card__brand { color: var(--kb-accent); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.kb-routine-card h3 { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; margin: 0; }
.kb-routine-card h3 a { color: var(--kb-ink); text-decoration: none; }
.kb-routine-card h3 a:hover { color: var(--kb-accent); }
.kb-routine-card__actives { color: var(--kb-ink-soft); font-size: 0.8125rem; line-height: 1.4; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-routine-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-routine-card__tags span { background: var(--kb-blush-tint); border-radius: var(--kb-radius-control); color: var(--kb-ink); font-size: 0.75rem; padding: 1px 8px; }
.kb-routine-card__tags span:nth-child(n+2) { display: none; }
.kb-routine-card__rating { color: var(--kb-star); font-size: 0.8125rem; margin: 0; }
.kb-routine-card__rating span { color: var(--kb-ink-soft); }
.kb-routine-card__bottom { align-items: center; display: flex; flex-wrap: wrap; gap: 6px var(--kb-space); justify-content: space-between; margin-top: auto; padding-top: var(--kb-space); }
.kb-routine-card__price { font-size: var(--kb-fs-card); font-weight: 800; }
.kb-routine-card__price del { color: var(--kb-ink-faint); font-size: 0.8125rem; font-weight: 500; }
.kb-routine-card__price ins { color: var(--kb-sale-red); text-decoration: none; }
.kb-routine-card__unit { color: var(--kb-ink-faint); flex-basis: 100%; font-size: 0.75rem; order: 3; }
.kb-routine-card__add {
  align-items: center;
  background: var(--kb-surface);
  border: 1px solid var(--kb-ink);
  border-radius: var(--kb-radius-control);
  color: var(--kb-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 700;
  gap: 4px;
  min-height: 40px;
  padding: 0 calc(var(--kb-space) * 1.75) 0 calc(var(--kb-space) * 1.25);
  transition: background-color var(--kb-motion-fast) var(--kb-ease), color var(--kb-motion-fast) var(--kb-ease), border-color var(--kb-motion-fast) var(--kb-ease);
}
.kb-routine-card__add:hover, .kb-routine-card__add:focus { background: var(--kb-surface); border-color: var(--kb-accent); color: var(--kb-accent); }
.kb-routine-card__add[aria-pressed="true"]:hover, .kb-routine-card__add[aria-pressed="true"]:focus { background: var(--kb-button-hover); border-color: var(--kb-button-hover); color: var(--kb-accent-ink); }
.kb-routine-card__add-icon { display: inline-flex; }
.kb-routine-card__add-icon .kb-icon:last-child { display: none; }
.kb-routine-card__add[aria-pressed="true"] { background: var(--kb-accent); border-color: var(--kb-accent); color: var(--kb-accent-ink); }
.kb-routine-card__add[aria-pressed="true"] .kb-routine-card__add-icon .kb-icon:first-child { display: none; }
.kb-routine-card__add[aria-pressed="true"] .kb-routine-card__add-icon .kb-icon:last-child { display: block; }

/* Pager */
.kb-routine__pager { align-items: center; display: flex; gap: var(--kb-space); justify-content: space-between; margin-top: calc(var(--kb-space) * 3); }
.kb-routine__pager button {
  align-items: center;
  background: var(--kb-surface);
  border: 1px solid var(--kb-line);
  border-radius: var(--kb-radius-control);
  color: var(--kb-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--kb-fs-meta);
  font-weight: 700;
  gap: 6px;
  min-height: 44px;
  padding: 0 calc(var(--kb-space) * 2);
}
.kb-routine__pager-next { background: var(--kb-ink) !important; border-color: var(--kb-ink) !important; color: var(--kb-surface) !important; margin-left: auto; }
.kb-routine__pager button:hover, .kb-routine__pager button:focus { background: var(--kb-surface); border-color: var(--kb-accent); color: var(--kb-ink); }
.kb-routine__pager-next:hover, .kb-routine__pager-next:focus { background: var(--kb-accent) !important; border-color: var(--kb-accent) !important; }
.kb-routine__tab:focus, .kb-routine__time button:focus { color: var(--kb-ink); }
.kb-routine__time button:hover { background: var(--kb-surface); color: var(--kb-ink); }
.kb-routine__preset:focus { background: var(--kb-blush-tint); color: var(--kb-ink); }
.kb-routine__share:hover, .kb-routine__share:focus { background: transparent; color: var(--kb-button-hover); text-decoration: underline; text-underline-offset: 0.22em; }
.kb-routine__share:disabled:hover { color: var(--kb-ink-faint); text-decoration: none; }

/* Summary panel */
.kb-routine__builder { position: sticky; top: calc(var(--kb-space) * 2); }
.kb-routine__builder-inner { background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: calc(var(--kb-radius-card) + 2px); box-shadow: 0 18px 40px -30px var(--kb-ink-faint); padding: calc(var(--kb-space) * 2.75); }
.kb-routine__close { display: none; }
.kb-routine__builder-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: calc(var(--kb-space) * 1.25); }
.kb-routine__builder-head h2 { font-size: var(--kb-fs-h3); margin: 0; }
.kb-routine__count { background: var(--kb-ink); border-radius: var(--kb-radius-control); color: var(--kb-surface); font-size: var(--kb-fs-meta); font-weight: 800; min-width: 44px; padding: 2px 10px; text-align: center; }
.kb-routine__meter, .kb-routine__progress { background: var(--kb-line); border-radius: var(--kb-radius-control); height: 6px; overflow: hidden; }
.kb-routine__meter span, .kb-routine__progress span { background: var(--kb-accent); border-radius: inherit; display: block; height: 100%; transition: width var(--kb-motion-base) var(--kb-ease); width: 0; }
.kb-routine__slots { display: grid; gap: var(--kb-space); grid-template-columns: minmax(0, 1fr); list-style: none; margin: calc(var(--kb-space) * 2) 0; padding: 0; }
.kb-routine__slot { margin: 0; min-width: 0; }
.kb-routine__slot-empty {
  align-items: center;
  background: var(--kb-surface-alt);
  border: 1px dashed var(--kb-line);
  border-radius: var(--kb-radius);
  color: var(--kb-ink-soft);
  cursor: pointer;
  display: flex;
  gap: calc(var(--kb-space) * 1.25);
  min-height: 60px;
  padding: var(--kb-space) calc(var(--kb-space) * 1.5);
  text-align: left;
  width: 100%;
}
.kb-routine__slot-empty:hover, .kb-routine__slot-empty:focus { background: var(--kb-blush-tint); border-color: var(--kb-accent); color: var(--kb-accent); }
.kb-routine__slot-num { align-items: center; background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: 50%; color: var(--kb-accent); display: inline-flex; flex: none; font-size: var(--kb-fs-meta); font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.kb-routine__slot-copy { background: none; border: 0; color: inherit; cursor: pointer; display: flex; flex: 1; flex-direction: column; line-height: 1.3; min-width: 0; padding: 0; text-align: left; }
.kb-routine__slot-copy small { color: var(--kb-ink-soft); font-size: 0.75rem; }
.kb-routine__slot-copy strong { color: var(--kb-ink); font-size: var(--kb-fs-meta); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-routine__slot-empty strong { color: inherit; font-weight: 600; }
.kb-routine__slot-copy > span { color: var(--kb-ink); font-size: var(--kb-fs-meta); font-weight: 800; }
.kb-routine__slot-filled { min-width: 0; overflow: hidden; align-items: center; border: 1px solid var(--kb-line); border-radius: var(--kb-radius); display: flex; gap: calc(var(--kb-space) * 1.25); min-height: 60px; padding: 6px var(--kb-space); }
.kb-routine__slot-filled img { background: var(--kb-surface-alt); border-radius: 10px; flex: none; height: 52px; object-fit: contain; width: 52px; }
.kb-routine__slot-remove { align-items: center; background: transparent; border: 0; border-radius: 50%; color: var(--kb-ink-soft); cursor: pointer; display: inline-flex; flex: none; font-size: 1.25rem; height: 44px; justify-content: center; width: 44px; }
.kb-routine__slot-remove:hover { background: var(--kb-blush-tint); color: var(--kb-accent); }
.kb-routine__subtotal { align-items: baseline; border-top: 1px solid var(--kb-line); display: flex; justify-content: space-between; padding-top: calc(var(--kb-space) * 1.5); }
.kb-routine__subtotal strong { font-size: 1.25rem; }
.kb-routine__shipping { color: var(--kb-ink-soft); font-size: 0.8125rem; margin: 6px 0; }
.kb-routine__checkout { align-items: center; display: flex !important; gap: var(--kb-space); justify-content: center; margin-top: calc(var(--kb-space) * 2); min-height: 52px; width: 100%; }
.kb-routine__checkout:disabled { cursor: not-allowed; opacity: 0.45; }
.kb-routine__shipping-note { color: var(--kb-ink-faint); font-size: 0.75rem; line-height: 1.45; margin: var(--kb-space) 0 0; text-align: center; }
.kb-routine__share { align-items: center; background: transparent; border: 0; color: var(--kb-accent); cursor: pointer; display: flex; font-size: var(--kb-fs-meta); font-weight: 700; gap: 6px; justify-content: center; margin: var(--kb-space) auto 0; min-height: 44px; }
.kb-routine__share:disabled { color: var(--kb-ink-faint); cursor: not-allowed; }
.kb-routine__status { color: var(--kb-accent); font-size: var(--kb-fs-meta); margin: 0; min-height: 0; text-align: center; }
.kb-routine__mobile-bar, .kb-routine__backdrop { display: none; }

/* Below the builder */
.kb-routine__below { display: grid; gap: calc(var(--kb-space) * 3); margin-top: calc(var(--kb-space) * 8); }
.kb-routine__extra { background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: calc(var(--kb-radius-card) + 6px); padding: calc(var(--kb-space) * 4); }
.kb-routine__extra h2 { font-size: var(--kb-fs-h2); line-height: 1.2; margin: 0 0 var(--kb-space); }
.kb-routine__extra > p, .kb-routine__quiz > div > p:last-child { color: var(--kb-ink-soft); }
.kb-routine__quiz { align-items: center; background: var(--kb-surface-alt); display: grid; gap: calc(var(--kb-space) * 4); grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.kb-routine__quiz form { background: var(--kb-surface); border: 1px solid var(--kb-line); border-radius: var(--kb-radius-card); display: grid; gap: calc(var(--kb-space) * 2); grid-template-columns: repeat(2, minmax(0, 1fr)); padding: calc(var(--kb-space) * 3); }
.kb-routine__quiz label { display: grid; font-size: 0.75rem; font-weight: 700; gap: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.kb-routine__quiz select { border-radius: var(--kb-radius); font-size: var(--kb-fs-meta); letter-spacing: 0; text-transform: none; width: 100%; }
.kb-routine__quiz button, .kb-routine__quiz .kb-routine__status { grid-column: 1 / -1; }
.kb-routine__quiz button { min-height: 52px; }
.kb-routine__review-grid { display: grid; gap: calc(var(--kb-space) * 2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kb-routine__review-grid blockquote { background: var(--kb-surface-alt); border-radius: var(--kb-radius); margin: 0; padding: calc(var(--kb-space) * 2.5); }
.kb-routine__review-grid blockquote > span { color: var(--kb-star); }
.kb-routine__glossary-grid { display: grid; gap: var(--kb-space) calc(var(--kb-space) * 2); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: calc(var(--kb-space) * 2); }
.kb-routine__glossary { border-bottom: 1px solid var(--kb-line); }
.kb-routine__glossary summary { cursor: pointer; font-weight: 700; min-height: 48px; padding: calc(var(--kb-space) * 1.5) 0; }
.kb-routine__glossary p { color: var(--kb-ink-soft); font-size: 0.9375rem; }
.kb-routine__glossary a { color: var(--kb-accent); display: inline-block; font-size: var(--kb-fs-meta); font-weight: 700; margin-bottom: calc(var(--kb-space) * 1.5); }
.kb-routine__trust { color: var(--kb-ink-soft); display: flex; flex-wrap: wrap; font-size: var(--kb-fs-meta); gap: calc(var(--kb-space) * 3); justify-content: center; }
.kb-routine__trust span { align-items: center; display: inline-flex; gap: 6px; }

.kb-routine :is(button, a, select):focus-visible { outline: 2px solid var(--kb-accent); outline-offset: 2px; }

/* Tablet + phone: tabs scroll, summary becomes a bottom sheet behind a sticky bar. */
@media (max-width: 1023px) {
  .kb-routine { padding: calc(var(--kb-space) * 3) calc(var(--kb-space) * 2) calc(var(--kb-space) * 14); }
  .kb-routine__intro { text-align: left; }
  .kb-routine__intro h1 { font-size: var(--kb-fs-pdp-title-mobile); }
  .kb-routine__intro p { font-size: 1rem; margin: 0; }
  .kb-routine__presets { margin-inline: calc(var(--kb-space) * -2); }
  .kb-routine__presets-title { padding-inline: calc(var(--kb-space) * 2); text-align: left; }
  .kb-routine__preset-grid { display: flex; overflow-x: auto; padding: 0 calc(var(--kb-space) * 2) 4px; scrollbar-width: none; }
  .kb-routine__preset-grid::-webkit-scrollbar { display: none; }
  .kb-routine__preset { align-items: flex-start; flex: 0 0 auto; min-height: 60px; text-align: left; }
  .kb-routine__shell { display: block; }
  .kb-routine__steps { display: flex !important; margin-inline: calc(var(--kb-space) * -2); overflow-x: auto; padding: 0 calc(var(--kb-space) * 2) 4px; scroll-padding-inline: calc(var(--kb-space) * 2); scrollbar-width: none; }
  .kb-routine__steps::-webkit-scrollbar { display: none; }
  .kb-routine__tab { flex: 0 0 auto; min-height: 56px; }
  .kb-routine__toolbar { gap: var(--kb-space); }
  .kb-routine__time { width: 100%; }
  .kb-routine__time button { flex: 1; justify-content: center; min-height: 40px; }
  .kb-routine__filter, .kb-routine__filter + .kb-routine__filter { flex: 1 1 0; margin: 0; min-width: 0; }
  .kb-routine__filter select { width: 100%; }
  .kb-routine__grid { gap: calc(var(--kb-space) * 1.5); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .kb-routine__builder { inset: auto 0 0; max-height: 86vh; position: fixed; top: auto; transform: translateY(105%); transition: transform var(--kb-motion-base) var(--kb-ease); z-index: 100002; }
  .kb-routine__builder.is-open { transform: translateY(0); }
  .kb-routine__builder-inner { border-radius: var(--kb-radius-card) var(--kb-radius-card) 0 0; max-height: 86vh; overflow-y: auto; padding: calc(var(--kb-space) * 2.5) calc(var(--kb-space) * 2) calc(var(--kb-space) * 3); position: relative; }
  .kb-routine__builder-head { padding-right: 52px; }
  .kb-routine__close { align-items: center; background: var(--kb-surface-alt); border: 0; border-radius: 50%; color: var(--kb-ink); cursor: pointer; display: inline-flex; height: 44px; justify-content: center; position: absolute; right: calc(var(--kb-space) * 1.5); top: calc(var(--kb-space) * 1.5); width: 44px; }
  .kb-routine__backdrop { background: var(--kb-ink); display: block; inset: 0; opacity: 0.35; position: fixed; z-index: 100001; }
  .kb-routine__backdrop[hidden] { display: none !important; }
  .kb-routine__mobile-bar { bottom: 0; display: block; left: 0; padding: var(--kb-space) calc(var(--kb-space) * 2) calc(var(--kb-space) + env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 100000; }
  .kb-routine__mobile-toggle { align-items: center; background: var(--kb-ink); border: 0; border-radius: var(--kb-radius-control); box-shadow: 0 10px 30px -12px var(--kb-ink); color: var(--kb-surface); cursor: pointer; display: flex; font-size: var(--kb-fs-meta); gap: var(--kb-space); min-height: 52px; padding: 0 calc(var(--kb-space) * 2.5); width: 100%; }
  .kb-routine__mobile-copy { flex: 1; text-align: left; }
  .kb-routine__mobile-copy > span { opacity: 0.75; }
  .kb-routine__mobile-total { font-weight: 800; }
  .kb-routine__quiz { grid-template-columns: 1fr; padding: calc(var(--kb-space) * 2.5); }
  .kb-routine__quiz form { padding: calc(var(--kb-space) * 2); }
  .kb-routine__extra { padding: calc(var(--kb-space) * 2.5); }
  .kb-routine__below { margin-top: calc(var(--kb-space) * 5); }
}
@media (max-width: 599px) {
  .kb-routine__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-routine-card__body { padding: var(--kb-space) calc(var(--kb-space) * 1.25) calc(var(--kb-space) * 1.25); }
  .kb-routine-card__add { justify-content: center; width: 100%; }
  .kb-routine-card__actives { display: none; }
  .kb-routine__quiz form, .kb-routine__glossary-grid { grid-template-columns: 1fr; }
  .kb-routine__pager-prev span { display: none; }
}
html.kb-routine-sheet-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .kb-routine *, .kb-routine__builder { transition-duration: 0s !important; }
}
