:root {
  color-scheme: light;
  --ink: #0a2f35;
  --ink-soft: #416066;
  --surface: #ffffff;
  --canvas: #eef5f2;
  --line: #dce9e4;
  --mint: #22b89a;
  --mint-dark: #087c69;
  --mint-soft: #dff7ef;
  --lime: #c9ef62;
  --sun: #ffca58;
  --coral: #ff765f;
  --blue: #dcecff;
  --shadow: 0 16px 40px rgba(10, 47, 53, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.is-hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  background: #dce9e5;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(34, 184, 154, 0.18), transparent 26rem),
    radial-gradient(circle at 90% 80%, rgba(255, 202, 88, 0.18), transparent 24rem),
    #dce9e5;
}

button,
input {
  font: inherit;
}

textarea,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(34, 184, 154, 0.38);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--canvas);
  box-shadow: 0 0 80px rgba(10, 47, 53, 0.14);
  position: relative;
}

body[data-role="admin"] .app-shell {
  width: min(100%, 1120px);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  padding: 22px;
  place-items: center;
}

.login-card {
  width: min(100%, 430px);
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-lockup .brand-mark {
  width: 56px;
  height: 56px;
}

.login-copy {
  color: var(--ink-soft);
  line-height: 1.5;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin: 22px 0 16px;
}

.install-button {
  cursor: pointer;
}

.install-button.compact {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: .75rem;
  font-weight: 850;
}

.connection-status {
  position: fixed;
  z-index: 100;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  color: #fff;
  background: #8d1725;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(10, 47, 53, .2);
  font-size: .75rem;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.install-dialog p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.install-dialog > .primary-button {
  margin-top: 18px;
}

@media (max-width: 440px) {
  .install-button.compact {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .install-button.compact::after {
    content: "↓";
    font-size: 1rem;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: rgba(238, 245, 242, 0.93);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(220, 233, 228, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--ink);
  border-radius: 13px 13px 13px 4px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(10, 47, 53, 0.07);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(10, 47, 53, 0.06);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--lime);
  border-radius: 50%;
}

main {
  min-height: calc(100vh - 66px);
}

.screen {
  padding: 24px 18px calc(112px + env(safe-area-inset-bottom));
  animation: screen-in 220ms ease-out;
}

.screen[hidden] {
  display: none;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 7vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.eyebrow,
.section-kicker {
  margin-bottom: 6px;
  color: var(--mint-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.welcome-row,
.screen-title-row,
.section-heading,
.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.phase-badge,
.count-badge,
.streak-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin: 22px -2px 18px;
}

.timeline-shell {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 7px;
  align-items: center;
  margin: 22px -2px 18px;
}

.timeline-shell .week-strip {
  display: flex;
  gap: 5px;
  margin: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.timeline-shell .week-strip::-webkit-scrollbar {
  display: none;
}

.timeline-shell .week-strip button {
  flex: 0 0 46px;
  scroll-snap-align: center;
}

.day-dot.training {
  width: 7px;
  height: 7px;
  background: var(--sun);
  box-shadow: 0 0 0 3px rgba(255, 202, 88, .25);
}

.rule-card {
  display: grid;
  gap: 16px;
  margin-bottom: 12px;
  padding: 21px;
  color: #fff;
  background:
    linear-gradient(145deg, var(--ink) 0%, #0c4f51 100%);
  border-radius: 28px 28px 28px 9px;
  box-shadow: var(--shadow);
}

.rule-card h2 {
  margin-bottom: 9px;
  font-size: 1.45rem;
}

.rule-card p:not(.eyebrow) {
  margin-bottom: 0;
  color: rgba(255,255,255,.78);
  line-height: 1.5;
}

.rule-card .eyebrow {
  color: var(--lime);
}

.rule-actions {
  display: flex;
  gap: 12px;
}

.rule-actions .text-link {
  color: var(--lime);
}

.week-strip button {
  min-height: 68px;
  padding: 8px 2px 6px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
}

.week-strip button span,
.week-strip button strong {
  display: block;
}

.week-strip button span {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.week-strip button strong {
  font-size: 0.95rem;
}

.week-strip button.is-current {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(10, 47, 53, 0.2);
}

.week-strip button.is-current span {
  color: rgba(255,255,255,.72);
}

.day-dot {
  display: block;
  width: 5px;
  height: 5px;
  margin: 6px auto 0;
  border-radius: 50%;
  background: transparent;
}

.day-dot.done {
  background: var(--mint);
}

.otti-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42%;
  min-height: 260px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 24%, rgba(201, 239, 98, .2), transparent 46%),
    linear-gradient(145deg, #0a2f35 0%, #0c4f51 100%);
  border-radius: 30px 30px 30px 9px;
  box-shadow: var(--shadow);
}

.otti-copy {
  z-index: 1;
  align-self: center;
  padding: 26px 0 26px 24px;
}

.otti-copy .section-kicker {
  color: var(--lime);
}

.otti-copy h2 {
  max-width: 220px;
  margin-bottom: 10px;
  font-size: 1.55rem;
}

.otti-copy p {
  max-width: 240px;
  margin-bottom: 15px;
  color: rgba(255,255,255,.76);
  font-size: 0.91rem;
  line-height: 1.48;
}

.text-link {
  padding: 5px 0;
  color: var(--lime);
  background: transparent;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.otti-visual {
  position: relative;
  min-width: 0;
  align-self: stretch;
}

.otti-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: screen;
}

.score-ring {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 66px;
  height: 66px;
  padding-top: 18px;
  color: var(--ink);
  background: var(--lime);
  border: 5px solid rgba(255,255,255,.8);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0,0,0,.17);
}

.score-ring strong {
  font-size: 1.2rem;
  line-height: 1;
}

.score-ring span {
  font-size: .72rem;
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 12px 0 28px;
}

.quick-actions.four {
  grid-template-columns: repeat(4, 1fr);
}

.quick-actions button {
  min-height: 50px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(10,47,53,.05);
  cursor: pointer;
}

.quick-actions button span {
  margin-right: 5px;
  color: var(--mint-dark);
  font-size: 1rem;
}

.pwa-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: -8px 0 28px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 5px 16px rgba(10,47,53,.05);
}

.pwa-card strong,
.pwa-card small {
  display: block;
}

.pwa-card strong {
  margin-bottom: 4px;
  font-size: .94rem;
}

.pwa-card small {
  color: var(--ink-soft);
  font-size: .73rem;
  line-height: 1.35;
}

.pwa-actions {
  display: grid;
  gap: 7px;
}

.pwa-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-size: .72rem;
  font-weight: 850;
  cursor: pointer;
}

.pwa-actions button:last-child {
  color: var(--ink);
  background: var(--lime);
}

.section-block {
  margin-top: 28px;
}

.section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  width: 100%;
  padding: 11px 13px 11px 11px;
  text-align: left;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: 0 5px 16px rgba(10,47,53,.055);
  cursor: pointer;
}

.task-card[data-state="done"] {
  border-color: rgba(34, 184, 154, .3);
}

.task-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--mint-soft);
  font-size: 1.25rem;
}

.task-icon {
  color: var(--ink);
  font-weight: 900;
}

.task-icon.protein { background: #fff2cb; }
.task-icon.movement { background: var(--blue); color: #285b94; font-weight: 900; }

.task-copy {
  min-width: 0;
}

.task-copy strong,
.task-copy small {
  display: block;
}

.task-copy strong {
  margin-bottom: 5px;
  font-size: .93rem;
}

.task-copy small {
  color: var(--ink-soft);
  font-size: .74rem;
  line-height: 1.35;
}

.task-state {
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: var(--mint-soft);
  font-size: .7rem;
  font-weight: 850;
}

.task-card[data-state="partial"] .task-state {
  color: #785900;
  background: #fff2bf;
}

.task-card[data-state="open"] .task-state {
  color: var(--ink-soft);
  background: #e9efed;
}

.coach-note {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 17px;
  background: #dcecff;
  border-radius: 22px 22px 8px 22px;
}

.coach-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: #285b94;
  border-radius: 50%;
  font-weight: 900;
}

.coach-note strong {
  display: block;
  font-size: .86rem;
  line-height: 1.44;
}

.coach-note button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 900;
  cursor: pointer;
}

.camera-button span {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.camera-button span::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 4px;
  width: 10px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.camera-button span::after {
  content: "";
  position: absolute;
  inset: 3px 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin: 22px 0 16px;
  background: #dfeae6;
  border-radius: 15px;
}

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

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
  cursor: pointer;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(10,47,53,.08);
}

.energy-card {
  padding: 22px;
  color: #fff;
  background: var(--ink);
  border-radius: 28px 28px 28px 9px;
}

.energy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.energy-top span,
.energy-top strong,
.energy-top small {
  display: block;
}

.energy-top span {
  color: rgba(255,255,255,.68);
  font-size: .8rem;
}

.energy-top strong {
  margin: 2px 0;
  font-size: 2.45rem;
  line-height: 1;
  letter-spacing: -.05em;
}

.energy-top small {
  color: rgba(255,255,255,.66);
}

.energy-gauge {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  background: conic-gradient(var(--lime) var(--gauge, 0%), rgba(255,255,255,.14) 0);
  border-radius: 50%;
  position: relative;
}

.energy-gauge::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--ink);
  border-radius: 50%;
}

.energy-gauge span {
  z-index: 1;
  color: #fff;
  font-weight: 800;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
}

.macro-grid span,
.macro-grid strong,
.macro-grid small {
  display: block;
}

.macro-grid span {
  color: rgba(255,255,255,.6);
  font-size: .66rem;
}

.macro-grid strong {
  margin: 4px 0 7px;
  font-size: .84rem;
}

.macro-grid small {
  margin-top: 5px;
  color: rgba(255,255,255,.48);
  font-size: .6rem;
  white-space: nowrap;
}

.macro-grid i,
.score-breakdown i {
  display: block;
  height: 4px;
  overflow: hidden;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
}

.macro-grid i b,
.score-breakdown i b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  border-radius: inherit;
  transition: width 240ms ease;
}

.phase-hint {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0 18px;
  padding: 13px 15px;
  background: #fff2cb;
  border-radius: 17px;
}

.tracker-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.tracker-tools button,
.metric-switch button,
.admin-tabs button,
.recipe-filter button,
.secondary-button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: .76rem;
  font-weight: 850;
  cursor: pointer;
}

.metric-switch {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 20px 0 13px;
  scrollbar-width: none;
}

.metric-switch::-webkit-scrollbar {
  display: none;
}

.metric-switch button {
  flex: 0 0 auto;
}

.metric-switch button.is-active,
.admin-tabs button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.phase-hint > span {
  font-size: 1.4rem;
}

.phase-hint strong,
.phase-hint p {
  display: block;
}

.phase-hint strong {
  font-size: .86rem;
}

.phase-hint p {
  margin: 2px 0 0;
  color: #725e27;
  font-size: .75rem;
}

.meal-list {
  display: grid;
  gap: 11px;
}

.meal-card {
  overflow: hidden;
  background: var(--surface);
  border-radius: 21px;
  box-shadow: 0 5px 16px rgba(10,47,53,.05);
}

.meal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 15px 12px;
}

.meal-card header div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--mint-soft);
  font-size: 1rem;
}

.meal-card header strong,
.meal-card header small {
  display: block;
}

.meal-card header strong {
  font-size: .92rem;
}

.meal-card header small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: .72rem;
}

.meal-add {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--mint-dark);
  font-size: 1.25rem;
  cursor: pointer;
}

.food-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  margin: 0 14px;
  border-top: 1px solid var(--line);
}

.food-entry strong,
.food-entry small {
  display: block;
}

.food-entry strong {
  font-size: .82rem;
}

.food-entry small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: .7rem;
}

.food-entry > span {
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 750;
}

.food-entry button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.empty-meal {
  padding: 0 15px 14px;
  color: var(--ink-soft);
  font-size: .76rem;
}

.primary-button {
  min-height: 48px;
  padding: 11px 16px;
  color: #fff;
  background: var(--mint-dark);
  border: 0;
  border-radius: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(8,124,105,.2);
}

.primary-button.block {
  width: 100%;
  margin-top: 14px;
}

.recipe-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 13px;
  scrollbar-width: none;
}

.recipe-filter::-webkit-scrollbar { display: none; }

.recipe-filter button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}

.recipe-filter button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.recipe-grid {
  display: grid;
  gap: 13px;
}

.recipe-card {
  display: grid;
  grid-template-columns: 42% minmax(0,1fr);
  overflow: hidden;
  min-height: 178px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 7px 22px rgba(10,47,53,.07);
}

.recipe-card[hidden] { display: none; }

.recipe-image {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 178px;
  background: linear-gradient(145deg, #a9e0cf, #4c9b84);
}

.recipe-two { background: linear-gradient(145deg, #ffe19a, #f0a858); }
.recipe-three { background: linear-gradient(145deg, #c9d8ff, #7b8fd5); }

.recipe-image b {
  font-size: 3.4rem;
  filter: drop-shadow(0 8px 9px rgba(10,47,53,.16));
}

.recipe-image span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  font-size: .66rem;
  font-weight: 850;
}

.recipe-card > div:last-child {
  align-self: center;
  padding: 16px;
}

.recipe-card small {
  color: var(--mint-dark);
  font-size: .7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.recipe-card h2 {
  margin: 5px 0 8px;
  font-size: 1.05rem;
}

.recipe-card p {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: .76rem;
}

.recipe-card button {
  min-height: 36px;
  padding: 6px 11px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--mint-dark);
  font-size: .74rem;
  font-weight: 800;
  cursor: pointer;
}

.training-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin: 24px 0 16px;
  padding: 15px 12px;
  background: var(--surface);
  border-radius: 19px;
}

.training-week span {
  display: grid;
  place-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: .72rem;
  font-weight: 750;
}

.training-week i {
  width: 9px;
  height: 9px;
  border: 2px solid #bbc9c5;
  border-radius: 50%;
}

.training-week .done i { background: var(--mint); border-color: var(--mint); }
.training-week .planned i { background: var(--sun); border-color: var(--sun); }
.training-week .today { color: var(--ink); font-weight: 900; }
.training-week .today i { width: 13px; height: 13px; border: 3px solid var(--ink); }

.workout-card {
  overflow: hidden;
  color: #fff;
  background: var(--ink);
  border-radius: 28px 28px 28px 9px;
  box-shadow: var(--shadow);
}

.workout-art {
  display: grid;
  place-items: center;
  min-height: 220px;
  position: relative;
  background:
    linear-gradient(35deg, transparent 46%, rgba(201,239,98,.28) 46% 51%, transparent 51%),
    linear-gradient(-35deg, transparent 46%, rgba(34,184,154,.35) 46% 51%, transparent 51%),
    radial-gradient(circle, #176267 0 18%, transparent 18%),
    #0e454b;
}

.duration,
.level {
  position: absolute;
  top: 15px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(10,47,53,.72);
  font-size: .68rem;
  font-weight: 850;
}

.duration { left: 15px; }
.level { right: 15px; color: var(--lime); }

.play-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding-left: 4px;
  color: var(--ink);
  background: var(--lime);
  border: 7px solid rgba(255,255,255,.18);
  border-radius: 50%;
  font-size: 1.3rem;
}

.workout-body {
  padding: 21px;
}

.workout-body .eyebrow { color: var(--lime); }
.workout-body h2 { font-size: 1.65rem; }
.workout-body p:not(.eyebrow) { margin: 8px 0 18px; color: rgba(255,255,255,.7); line-height: 1.5; }
.workout-body .primary-button { color: var(--ink); background: var(--lime); box-shadow: none; }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.stats-row div {
  padding: 16px;
  background: var(--surface);
  border-radius: 17px;
}

.stats-row span,
.stats-row strong {
  display: block;
}

.stats-row span { color: var(--ink-soft); font-size: .72rem; }
.stats-row strong { margin-top: 5px; font-size: 1.05rem; }

.upcoming-list {
  display: grid;
  gap: 9px;
}

.upcoming-list article {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 20px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border-radius: 17px;
}

.upcoming-list article > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--mint-dark);
  background: var(--mint-soft);
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 900;
}

.upcoming-list strong,
.upcoming-list small { display: block; }
.upcoming-list strong { font-size: .88rem; }
.upcoming-list small { margin-top: 4px; color: var(--ink-soft); font-size: .72rem; }

.otti-detail-card {
  display: grid;
  grid-template-columns: 58% 42%;
  overflow: hidden;
  min-height: 330px;
  margin-top: 22px;
  color: #fff;
  background: var(--ink);
  border-radius: 30px 30px 30px 9px;
}

.otti-detail-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
}

.otti-detail-score {
  align-self: center;
  padding: 20px 18px 20px 4px;
}

.otti-detail-score span,
.otti-detail-score strong,
.otti-detail-score p { display: block; }
.otti-detail-score span { color: rgba(255,255,255,.62); font-size: .76rem; }
.otti-detail-score strong { margin: 5px 0; color: var(--lime); font-size: 2.3rem; letter-spacing: -.05em; }
.otti-detail-score p { margin: 0; font-weight: 800; }

.score-breakdown {
  margin-top: 28px;
}

.score-breakdown > .section-heading > strong {
  color: var(--mint-dark);
}

.score-breakdown article {
  margin-top: 10px;
  padding: 15px;
  background: var(--surface);
  border-radius: 18px;
}

.score-breakdown article div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .84rem;
}

.score-breakdown i {
  height: 7px;
  background: #e2ece8;
}

.score-breakdown i b { background: var(--mint); }

.score-breakdown article small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: .72rem;
}

.restart-card {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 17px;
  background: #fff2cb;
  border-radius: 20px;
}

.restart-card > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background: var(--sun);
  border-radius: 12px;
  font-weight: 900;
}

.restart-card strong { font-size: .9rem; }
.restart-card p { margin: 5px 0 0; color: #725e27; font-size: .78rem; line-height: 1.45; }

.weight-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 22px;
  color: #fff;
  background: var(--ink);
  border-radius: 26px 26px 26px 8px;
}

.weight-card span,
.weight-card strong,
.weight-card p { display: block; }
.weight-card span { color: rgba(255,255,255,.62); font-size: .76rem; }
.weight-card > div > strong { margin: 4px 0; font-size: 2.25rem; letter-spacing: -.04em; }
.weight-card strong small { font-size: 1rem; }
.weight-card p { margin: 0; color: rgba(255,255,255,.65); font-size: .75rem; }
.weight-card p b { color: var(--lime); }
.weight-card button { padding: 9px 11px; border: 0; border-radius: 12px; color: var(--ink); background: var(--lime); font-size: .75rem; font-weight: 850; cursor: pointer; }

.chart-card,
.measurements,
.photo-progress {
  margin-top: 13px;
  padding: 18px;
  background: var(--surface);
  border-radius: 22px;
}

.chart-card .section-heading > span,
.measurements .section-heading > span {
  color: var(--ink-soft);
  font-size: .72rem;
}

.chart-card svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}

.chart-card .target-line { stroke: #c7d6d1; stroke-width: 1; stroke-dasharray: 4 4; }
.chart-card .area-line { fill: url(#chart-fill); }
.chart-card .weight-line { fill: none; stroke: var(--mint-dark); stroke-width: 4; stroke-linecap: round; }
.chart-card .chart-points { fill: var(--surface); stroke: var(--mint-dark); stroke-width: 3; }
.chart-card text { fill: var(--ink-soft); font-size: 10px; font-family: inherit; }

.measurement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.measurement-grid article {
  padding: 14px;
  background: var(--canvas);
  border-radius: 15px;
}

.measurement-grid span,
.measurement-grid strong,
.measurement-grid small { display: block; }
.measurement-grid span { color: var(--ink-soft); font-size: .72rem; }
.measurement-grid strong { margin: 5px 0 2px; }
.measurement-grid small { color: var(--mint-dark); font-size: .68rem; font-weight: 800; }

.photo-progress .section-heading button {
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  color: var(--mint-dark);
  background: var(--mint-soft);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.photo-row article {
  text-align: center;
}

.photo-row article div {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  margin-bottom: 8px;
  color: var(--ink-soft);
  background: linear-gradient(145deg, #dce9e5, #eef5f2);
  border-radius: 14px;
  font-size: 1.25rem;
}

.photo-row article.current div { background: linear-gradient(145deg, #c9ef62, #83d7aa); }
.photo-row strong,
.photo-row small { display: block; }
.photo-row strong { font-size: .76rem; }
.photo-row small { margin-top: 2px; color: var(--ink-soft); font-size: .66rem; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: min(100%, 560px);
  min-height: 74px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(255,255,255,.94);
  border-top: 1px solid rgba(210,226,220,.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 -8px 24px rgba(10,47,53,.07);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  padding: 5px 2px;
  border: 0;
  border-radius: 14px;
  color: #6c8487;
  background: transparent;
  cursor: pointer;
}

.bottom-nav button span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 24px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.bottom-nav button small {
  max-width: 100%;
  overflow: hidden;
  font-size: .64rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.bottom-nav button.is-active {
  color: var(--mint-dark);
  background: var(--mint-soft);
}

.bottom-nav .otti-nav-icon {
  color: inherit;
  background: transparent;
  border-radius: 0;
  font-size: 1rem;
}

.shop-link {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--mint-dark);
  background: var(--surface);
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}

.shop-intro { max-width: 42rem; margin: -4px 0 20px; color: var(--ink-soft); font-size: .92rem; line-height: 1.55; }
.shop-grid { display: grid; gap: 14px; }
.shop-product-card { display: grid; gap: 24px; min-height: 230px; padding: 22px; overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--mint-dark), #12656a); border-radius: 24px; box-shadow: var(--shadow); }
.shop-product-card:nth-child(2) { background: linear-gradient(145deg, #003365, #12648a); }
.shop-product-card:nth-child(3) { background: linear-gradient(145deg, #263442, #536879); }
.shop-product-card h2 { margin: 10px 0 7px; color: inherit; font-size: 1.35rem; }
.shop-product-card p { margin: 0; color: rgba(255,255,255,.78); font-size: .86rem; line-height: 1.5; }
.shop-product-cycle { font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.shop-product-footer { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.shop-product-footer strong, .shop-product-footer small { display: block; }
.shop-product-footer strong { font-size: 1.55rem; }
.shop-product-footer small { margin-top: 2px; color: rgba(255,255,255,.72); }
.shop-product-footer button, .shop-cart button { min-height: 43px; padding: 0 16px; border: 0; border-radius: 13px; color: var(--mint-dark); background: #fff; font-weight: 900; cursor: pointer; }
.shop-cart { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.shop-cart p { margin: 4px 0 0; color: var(--ink-soft); font-size: .76rem; }
.shop-cart > div:last-child { display: grid; justify-items: end; gap: 8px; flex: 0 0 auto; }
.shop-cart button { color: #fff; background: var(--mint-dark); }

dialog {
  color: var(--ink);
}

.environment-badge {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 8px;
  z-index: 1000;
  padding: 5px 9px;
  color: #fff;
  background: #c51f32;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(111, 0, 16, .3);
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .1em;
  pointer-events: none;
}

dialog::backdrop {
  background: rgba(5, 26, 30, .58);
  backdrop-filter: blur(2px);
}

.bottom-sheet {
  width: min(100%, 560px);
  max-height: min(82vh, 760px);
  margin: auto auto 0;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--canvas);
}

.bottom-sheet[open] {
  animation: sheet-in 220ms ease-out;
}

@keyframes sheet-in {
  from { transform: translateY(30px); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 0 auto 16px;
  background: #b6c7c2;
  border-radius: 999px;
}

.sheet-heading button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #dde9e5;
  font-size: 1.3rem;
  cursor: pointer;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.search-field span {
  color: var(--ink-soft);
  font-size: 1.3rem;
}

.search-field input {
  width: 100%;
  min-height: 49px;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
}

.meal-picker {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0 10px;
  scrollbar-width: none;
}

.meal-picker::-webkit-scrollbar { display: none; }

.meal-picker button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.meal-picker button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.food-results {
  display: grid;
  gap: 7px;
  max-height: 47vh;
  overflow-y: auto;
  padding: 4px 0;
}

.food-result {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 11px 10px 14px;
  text-align: left;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
}

.food-result strong,
.food-result small { display: block; }
.food-result strong { margin-bottom: 4px; font-size: .86rem; }
.food-result small { color: var(--ink-soft); font-size: .7rem; }
.food-result span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--mint-dark); font-size: 1.2rem; }

.small-dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: var(--canvas);
  box-shadow: var(--shadow);
}

.small-dialog label {
  display: block;
  margin: 22px 0 7px;
  font-size: .78rem;
  font-weight: 800;
}

.small-dialog input {
  width: 100%;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 1.1rem;
}

.small-dialog textarea,
.small-dialog select,
.admin-form textarea,
.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
}

.small-dialog textarea,
.admin-form textarea {
  min-height: 96px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-section-label {
  margin: 22px 0 8px;
}

.nutrition-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nutrition-form-grid label {
  margin: 0;
  font-size: .7rem;
}

.nutrition-form-grid input {
  min-height: 44px;
  font-size: .9rem;
}

.form-hint {
  color: var(--ink-soft);
  font-size: .8rem;
  line-height: 1.45;
}

.long-text {
  max-height: 58vh;
  overflow-y: auto;
  color: var(--ink-soft);
  line-height: 1.55;
}

.approval-card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.approval-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: .82rem;
  line-height: 1.45;
}

.approval-card button,
.admin-form button,
.challenge-grid button,
.video-program-list button {
  min-height: 39px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--mint-dark);
  font-weight: 850;
  cursor: pointer;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: var(--mint-soft);
  font-size: .68rem;
  font-weight: 900;
}

.upload-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin: 14px 0;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.upload-preview img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.analysis-dialog {
  width: min(calc(100% - 24px), 570px);
  max-height: min(92vh, 880px);
  overflow-y: auto;
}

.analysis-dialog > label:first-of-type {
  margin-top: 14px;
}

.analysis-meal-picker {
  margin: 6px 0;
}

.analysis-state {
  margin: 10px 0;
  padding: 11px 13px;
  color: var(--ink-soft);
  background: var(--surface);
  border-left: 4px solid var(--line);
  border-radius: 10px;
  font-size: .78rem;
  line-height: 1.4;
}

.analysis-state[data-kind="loading"] { border-left-color: #d99b15; }
.analysis-state[data-kind="success"] { border-left-color: var(--mint-dark); }
.analysis-state[data-kind="error"] { color: #8d1725; border-left-color: #c51f32; }

.analysis-results {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.analysis-summary {
  padding: 12px 14px;
  background: #fff2cb;
  border-radius: 14px;
}

.analysis-summary span {
  display: inline-block;
  padding: 3px 7px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 900;
}

.analysis-summary p {
  margin: 7px 0 0;
  color: #725e27;
  font-size: .73rem;
  line-height: 1.4;
}

.analysis-result {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.analysis-result label {
  margin: 8px 0 5px;
}

.analysis-result .analysis-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
}

.analysis-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.analysis-toggle b {
  color: var(--ink-soft);
  font-size: .67rem;
}

.analysis-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.analysis-fields label {
  position: relative;
  min-width: 0;
}

.analysis-fields input {
  min-height: 44px;
  padding-right: 31px;
  font-size: .88rem;
}

.analysis-fields label > span {
  position: absolute;
  right: 8px;
  bottom: 13px;
  color: var(--ink-soft);
  font-size: .58rem;
  pointer-events: none;
}

/* Kaufmännische Module */
.business-module { margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.module-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.module-heading h2 { margin: 2px 0 0; font-size: 1.12rem; }
.module-heading button, .module-actions button { min-height: 40px; padding: 0 13px; border: 0; border-radius: 12px; color: #fff; background: var(--mint-dark); font-weight: 850; cursor: pointer; }
.module-count { padding: 7px 10px; border-radius: 999px; color: var(--mint-dark); background: var(--mint-soft); font-size: .7rem; font-weight: 900; white-space: nowrap; }
.module-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: end; }
.module-help { margin: -5px 0 14px; color: var(--ink-soft); font-size: .78rem; line-height: 1.5; }
.business-form { display: grid; gap: 10px; margin-bottom: 16px; padding: 14px; border-radius: 17px; background: var(--canvas); }
.business-form-inline { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.business-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.business-form label { display: grid; gap: 6px; color: var(--ink-soft); font-size: .7rem; font-weight: 850; }
.business-form input, .business-form select, .business-form textarea, #bank-file { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font: inherit; }
.business-form textarea { resize: vertical; }
.business-form button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 11px; color: #fff; background: var(--mint-dark); font-weight: 900; cursor: pointer; }
.business-form .form-wide { grid-column: 1 / -1; }
.business-form .check-label { display: flex; align-items: center; align-self: end; min-height: 44px; flex-direction: row; }
.business-form .check-label input { width: 20px; min-height: 20px; }
.split-module { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.business-list { display: grid; gap: 8px; }
.business-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 15px; }
.business-row strong, .business-row small, .compact-row strong, .compact-row small { display: block; }
.business-row small, .compact-row small { margin-top: 3px; color: var(--ink-soft); font-size: .68rem; }
.business-row .sync-state { color: #58777c; }
.business-row button, .compact-row button, .business-table button, .row-actions button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--mint-dark); background: var(--surface); font-size: .7rem; font-weight: 850; cursor: pointer; }
.business-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--mint-dark); font-size: .75rem; font-weight: 950; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; }
.compact-row > span:not(.status-chip):not(.access-badge) { display: grid; place-items: center; min-width: 29px; min-height: 29px; border-radius: 10px; background: var(--mint-soft); font-weight: 900; }
.status-chip, .access-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; color: #426064; background: #eaf0ef; font-size: .65rem; font-weight: 900; white-space: nowrap; }
.status-active, .status-paid, .access-basis { color: #17643f; background: #e2f4e9; }
.status-invited, .status-open, .status-overdue, .status-draft, .status-paused, .is-warning { color: #855813; background: #fff0cf; }
.access-plus { color: #0b5982; background: #deeff8; }
.access-premium { color: #683e87; background: #efe3f6; }
.product-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-admin-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--canvas); }
.product-admin-card.is-disabled { opacity: .58; }
.product-card-top, .product-card-actions, .product-price { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-card-top > span:first-child { color: var(--ink-soft); font-size: .66rem; font-weight: 900; letter-spacing: .06em; }
.product-admin-card h3 { margin: 0; font-size: 1rem; }
.product-admin-card p { min-height: 36px; margin: 0; color: var(--ink-soft); font-size: .75rem; line-height: 1.45; }
.product-price strong, .product-price small { display: block; }
.product-price strong { font-size: 1.2rem; }
.product-price small { color: var(--ink-soft); font-size: .67rem; }
.product-card-actions button { border: 0; color: var(--mint-dark); background: transparent; font-size: .68rem; font-weight: 850; cursor: pointer; }
.readiness-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.readiness-grid article { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--canvas); }
.readiness-grid strong, .readiness-grid small { display: block; }
.readiness-grid small { margin-top: 3px; color: var(--ink-soft); font-size: .67rem; }
.readiness-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #d69d38; }
.readiness-dot.is-ready { background: #2a9b5e; }
.business-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 14px; }
.business-kpis article { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.business-kpis span, .business-kpis strong { display: block; }
.business-kpis span { color: var(--ink-soft); font-size: .66rem; font-weight: 800; }
.business-kpis strong { margin-top: 6px; font-size: 1.05rem; }
.business-table-wrap { overflow-x: auto; }
.business-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.business-table th { padding: 9px; color: var(--ink-soft); font-size: .65rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.business-table td { padding: 11px 9px; border-top: 1px solid var(--line); white-space: nowrap; }
.invoice-builder { margin-bottom: 12px; }
.invoice-builder .business-form { margin-bottom: 0; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.report-grid article { padding: 14px; border-radius: 15px; background: var(--canvas); }
.report-grid span, .report-grid strong, .report-grid small { display: block; }
.report-grid span, .report-grid small { color: var(--ink-soft); font-size: .66rem; }
.report-grid strong { margin: 5px 0; font-size: 1.1rem; }
.bank-drop { margin: 10px 0; padding: 12px; border: 1px dashed var(--line); border-radius: 13px; color: var(--ink-soft); background: var(--canvas); font-size: .75rem; }
.audit-list { display: grid; gap: 0; }
.audit-list article { display: grid; grid-template-columns: 115px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .73rem; }
.audit-list article:last-child { border-bottom: 0; }
.audit-list span, .audit-list small { color: var(--ink-soft); }
.dunning-levels { display: flex; gap: 7px; overflow-x: auto; margin: -3px 0 14px; }
.dunning-levels span { flex: 0 0 auto; padding: 7px 9px; border-radius: 999px; color: var(--ink-soft); background: var(--canvas); font-size: .65rem; font-weight: 800; }
.reminder-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 14px; border: 1px solid var(--line); border-left: 4px solid #d69d38; border-radius: 15px; }
.reminder-card strong, .reminder-card small { display: block; }
.reminder-card small { margin-top: 4px; color: var(--ink-soft); font-size: .7rem; }
.reminder-level { display: block; margin-bottom: 4px; color: #9a6815; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.row-actions { display: flex; gap: 6px; grid-column: 1 / -1; }

@media (max-width: 680px) {
  .business-form-inline, .business-form-grid, .split-module { grid-template-columns: 1fr; }
  .business-form .form-wide { grid-column: auto; }
  .business-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .business-row > button { grid-column: 2 / -1; justify-self: start; }
  .product-admin-grid, .readiness-grid { grid-template-columns: 1fr; }
  .business-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  .module-heading { align-items: flex-start; flex-direction: column; }
  .module-actions { justify-content: start; }
  .audit-list article { grid-template-columns: 1fr; gap: 3px; }
  .shop-cart { align-items: stretch; flex-direction: column; }
  .shop-cart > div:last-child { justify-items: stretch; }
}

@media (max-width: 390px) {
  .analysis-fields { grid-template-columns: repeat(2, 1fr); }
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  border-radius: 24px 24px 8px 8px;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-hitbox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 10px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.2), transparent 38%);
  cursor: pointer;
}

.video-hitbox span {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 11px;
  background: rgba(10,47,53,.78);
  font-size: .75rem;
  font-weight: 900;
}

.video-hitbox:hover span,
.video-hitbox:focus-visible span {
  background: var(--mint-dark);
}

#training-video-frame:fullscreen {
  display: grid;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}

#training-video-frame:fullscreen iframe {
  height: 100%;
}

#training-video-frame:fullscreen .video-hitbox {
  display: none;
}

.page-chat {
  min-height: 42vh;
  max-height: 58vh;
  padding-bottom: 18px;
}

.sticky-composer {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 5;
  padding: 10px 0 0;
  background: var(--canvas);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0 18px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
}

.admin-tabs button { flex: 0 0 auto; padding-inline: 14px; }

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.admin-kpis article,
.admin-list article {
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.admin-kpis span,
.admin-list small {
  display: block;
  color: var(--ink-soft);
  font-size: .74rem;
}

.admin-kpis strong {
  display: block;
  margin-top: 5px;
  font-size: 1.5rem;
}

.admin-list {
  display: grid;
  gap: 9px;
}

.admin-attention-list {
  display: grid;
  gap: 9px;
}

.admin-attention-card,
.admin-row-button {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
}

.admin-row-button {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-attention-card strong,
.admin-attention-card small,
.admin-row-button strong,
.admin-row-button small {
  display: block;
}

.admin-attention-card small,
.admin-row-button small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: .73rem;
  line-height: 1.35;
}

.admin-attention-card b {
  color: var(--mint-dark);
  font-size: .68rem;
}

.traffic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.traffic-green .traffic-dot { background: #22a06b; }
.traffic-yellow .traffic-dot { background: #d99b15; }
.traffic-red .traffic-dot { background: #c51f32; }

.traffic-green { border-left: 5px solid #22a06b; }
.traffic-yellow { border-left: 5px solid #d99b15; }
.traffic-red { border-left: 5px solid #c51f32; }

.approval-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.approval-actions button:nth-child(2) {
  color: var(--ink);
  background: var(--mint-soft);
}

.approval-actions button:nth-child(3) {
  background: #8d1725;
}

.admin-list strong,
.admin-list small {
  display: block;
}

.admin-form {
  display: grid;
  gap: 11px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.admin-form.compact {
  margin-bottom: 12px;
}

.admin-form label,
.small-dialog label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 850;
}

.challenge-grid {
  display: grid;
  gap: 9px;
}

.challenge-grid button {
  padding: 14px;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.challenge-grid strong,
.challenge-grid small {
  display: block;
}

.challenge-grid small {
  margin-top: 5px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.video-program-list {
  display: grid;
  gap: 8px;
}

.pending-food-list {
  display: grid;
  gap: 9px;
}

.photo-row article .has-image {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.chat-sheet {
  display: flex;
  flex-direction: column;
  height: min(82vh, 720px);
}

.chat-sheet:not([open]) {
  display: none;
}

.chat-status {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr);
  column-gap: 9px;
  align-items: center;
  margin: 14px 0 10px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.chat-status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
}

.chat-status strong,
.chat-status small {
  grid-column: 2;
  display: block;
}

.chat-status strong {
  font-size: .86rem;
}

.chat-status small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: .72rem;
}

.chat-center,
.admin-chat-center {
  display: grid;
  gap: 14px;
}

.chat-sidebar,
.chat-conversation,
.new-chat-form {
  min-width: 0;
}

.assigned-admin-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  color: var(--ink);
  text-align: left;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: 17px;
  cursor: pointer;
}

.assigned-admin-card > span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: var(--mint-dark);
  border-radius: 14px;
  font-size: .72rem;
  font-weight: 900;
}

.assigned-admin-card small,
.assigned-admin-card strong {
  display: block;
}

.assigned-admin-card small {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: .67rem;
}

.assigned-admin-card b { color: var(--mint-dark); }

.new-chat-form {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.new-chat-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.new-chat-form label {
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 850;
}

.new-chat-form select,
.new-chat-form button {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 11px;
  font: inherit;
}

.new-chat-form select {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.new-chat-form button,
.push-toggle {
  color: #fff;
  background: var(--mint-dark);
  border: 0;
  font-size: .74rem;
  font-weight: 850;
  cursor: pointer;
}

.push-toggle {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
}

.push-toggle.is-active {
  color: var(--mint-dark);
  background: var(--mint-soft);
  box-shadow: inset 0 0 0 1px var(--mint-dark);
}

.push-toggle:disabled,
.chat-composer button:disabled,
.chat-composer input:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.chat-thread-list {
  display: grid;
  gap: 7px;
}

.chat-thread-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
}

.chat-thread-button.is-active {
  background: var(--mint-soft);
  border-color: var(--mint-dark);
}

.chat-thread-button strong,
.chat-thread-button small { display: block; }

.chat-thread-button strong {
  margin-bottom: 4px;
  font-size: .8rem;
}

.chat-thread-button small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-button b {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border-radius: 999px;
  font-size: .68rem;
}

.chat-thread-button time {
  color: var(--ink-soft);
  font-size: .6rem;
}

.chat-conversation {
  display: flex;
  flex-direction: column;
  padding: 0 12px 12px;
  background: rgba(255,255,255,.48);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.chat-list-heading,
.chat-admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-list-heading {
  margin: 15px 2px 8px;
  font-size: .75rem;
}

.chat-list-heading span,
.chat-admin-heading p,
.push-help {
  color: var(--ink-soft);
  font-size: .7rem;
}

.chat-admin-heading { margin-bottom: 14px; }
.chat-admin-heading h2,
.chat-admin-heading p { margin: 0; }
.chat-admin-heading .eyebrow { margin-bottom: 4px; }
.admin-new-chat-form { margin-top: 0; }

.admin-chat-messages {
  min-height: 360px;
  max-height: 56vh;
}

.push-help {
  margin: 9px 2px 0;
  line-height: 1.4;
}

.chat-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  text-align: center;
}

.chat-empty strong,
.chat-empty span { display: block; }
.chat-empty span { margin-top: 5px; color: var(--ink-soft); font-size: .76rem; }

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 220px;
  overflow-y: auto;
  padding: 10px 0 14px;
}

.chat-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(10,47,53,.045);
}

.chat-bubble strong,
.chat-bubble span {
  display: block;
}

.chat-bubble strong {
  margin-bottom: 4px;
  font-size: .73rem;
  color: var(--mint-dark);
}

.chat-bubble span {
  font-size: .88rem;
  line-height: 1.42;
}

.chat-bubble small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: .66rem;
}

.chat-bubble.is-user {
  align-self: flex-end;
  color: #fff;
  background: var(--ink);
  border-bottom-right-radius: 6px;
}

.chat-bubble.is-user strong,
.chat-bubble.is-user small {
  color: rgba(255,255,255,.7);
}

.chat-bubble.is-admin {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chat-composer input {
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  outline: 0;
}

.chat-composer button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--mint-dark);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100% - 40px);
  padding: 11px 15px;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: .8rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 390px) {
  .screen { padding-inline: 14px; }
  .topbar { padding-inline: 15px; }
  .brand > span:last-child { display: none; }
  .profile-button > span:first-child { display: none; }
  .pwa-card { grid-template-columns: 1fr; }
  .pwa-actions { grid-template-columns: 1fr 1fr; }
  .otti-hero { grid-template-columns: minmax(0, 1fr) 40%; min-height: 280px; }
  .otti-copy { padding-left: 19px; }
  .otti-copy h2 { font-size: 1.35rem; }
  .otti-copy p { font-size: .82rem; }
  .task-card { grid-template-columns: 44px minmax(0,1fr); }
  .task-icon { width: 44px; height: 44px; }
  .task-state { grid-column: 2; justify-self: start; margin-top: -5px; }
  .macro-grid { gap: 7px; }
  .macro-grid strong { font-size: .76rem; }
  .macro-grid small { font-size: .55rem; }
  .recipe-card { grid-template-columns: 39% minmax(0, 1fr); }
  .bottom-nav button small { font-size: .55rem; }
}

@media (min-width: 760px) {
  .app-shell {
    margin-block: 24px;
    min-height: calc(100vh - 48px);
    border-radius: 30px;
    overflow: hidden;
  }
  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 30px 30px;
  }
  .topbar {
    padding-top: 10px;
  }
  .admin-chat-center {
    grid-template-columns: 310px minmax(0, 1fr);
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
