:root {
  --bg: #050607;
  --bg-2: #090d10;
  --surface: #101416;
  --surface-2: #171b1e;
  --surface-3: #20242a;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6f7;
  --text-soft: #c7cdd2;
  --muted: #858f96;
  --quiet: #59636a;
  --gold-dark: #8f6f37;
  --gold: #c7a668;
  --gold-2: #e0c57e;
  --gold-3: #f0d999;
  --gold-soft: rgba(199, 166, 104, 0.16);
  --gold-glow: rgba(224, 197, 126, 0.28);
  --red: var(--gold);
  --red-2: var(--gold-2);
  --red-soft: var(--gold-soft);
  --green: #4fc774;
  --green-soft: rgba(79, 199, 116, 0.14);
  --amber: #f1b640;
  --amber-soft: rgba(241, 182, 64, 0.14);
  --blue: #78a6ff;
  --blue-soft: rgba(120, 166, 255, 0.13);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  background: var(--bg);
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  touch-action: manipulation;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(224, 197, 126, 0.68);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  max-width: 100vw;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: clip;
  background:
    linear-gradient(180deg, rgba(199, 166, 104, 0.13), transparent 250px),
    radial-gradient(420px 260px at 88% 4%, rgba(224, 197, 126, 0.13), transparent 70%),
    linear-gradient(180deg, #060708 0%, #0a0f12 54%, #050607 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 30px 80px rgba(0, 0, 0, 0.45);
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 18px 12px;
  background: linear-gradient(180deg, rgba(5, 6, 7, 0.96), rgba(5, 6, 7, 0.72));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 4px;
  width: max-content;
}

.brand-main {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 900;
  line-height: 0.78;
  letter-spacing: 0.02em;
  color: transparent;
  background: linear-gradient(90deg, #d9bf7a 0%, #f2dda0 34%, #9c7336 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-sub {
  color: #d1b878;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.29em;
  white-space: nowrap;
}

.date-line {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.icon-button .icon {
  font-size: 19px;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  color: #fff;
  color: #090806;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  font-size: 10px;
  font-weight: 900;
}

.view-stack {
  min-height: calc(100dvh - 72px);
  padding: 16px 14px calc(96px + var(--safe-bottom));
  overflow-x: hidden;
}

.view {
  display: none;
  animation: viewIn 180ms ease both;
}

.view.active {
  display: block;
}

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

.hero-grid {
  display: grid;
  gap: 14px;
}

.welcome-copy {
  padding: 8px 4px 0;
}

.welcome-copy p,
.card-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-copy h1 {
  margin-top: 2px;
  font-size: 42px;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.welcome-copy span {
  display: block;
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 650;
}

.score-card,
.panel,
.workout-card,
.mini-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--surface);
  box-shadow: var(--shadow);
}

.score-card {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.score-layout {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.score-ring {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--gold-2) calc(var(--score-pct) * 1%), rgba(255, 255, 255, 0.1) 0);
}

.score-ring strong {
  font-size: 36px;
  font-weight: 900;
  line-height: 0.95;
}

.score-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-card h2 {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.score-card p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 0;
  color: var(--red-2);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.text-button .icon {
  font-size: 15px;
}

.panel {
  margin-top: 14px;
  border-radius: var(--radius-lg);
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.panel-head > div,
.setup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel-icon,
.round-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(224, 197, 126, 0.34);
  border-radius: var(--radius-md);
  color: #0c0a06;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-dark));
  box-shadow: 0 10px 24px rgba(199, 166, 104, 0.23);
}

.panel-icon .icon,
.round-icon .icon {
  font-size: 17px;
}

.panel h2,
.mini-card strong,
.setup-panel h2 {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.reset-copy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.habit-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.032);
}

.habit-row.hidden {
  display: none;
}

.habit-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
}

.habit-meta {
  min-width: 0;
}

.habit-meta strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-meta span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.segmented {
  display: grid;
  grid-template-columns: 44px 44px;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

.segmented button {
  height: 31px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.segmented button.active.yes {
  color: #0b0905;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  box-shadow: 0 8px 20px rgba(224, 197, 126, 0.22);
}

.segmented button.active.no {
  color: #0b0905;
  background: linear-gradient(180deg, #d9bf7a, #9d7438);
}

.submit-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: var(--radius-md);
  color: #fff;
  color: #0b0905;
  background: linear-gradient(180deg, var(--gold-3), var(--gold-dark));
  box-shadow: 0 14px 32px rgba(224, 197, 126, 0.22);
  font-size: 14px;
  font-weight: 900;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.submit-button .icon {
  font-size: 17px;
}

.workout-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
}

.workout-photo {
  position: relative;
  height: 92px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(224, 197, 126, 0.28), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, #1b2227 0 11px, #11171b 11px 20px);
}

.workout-photo::before {
  content: "";
  position: absolute;
  inset: 55% -20% 18% -20%;
  background: rgba(255, 255, 255, 0.09);
  transform: rotate(-5deg);
}

.workout-photo span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  color: var(--gold-2);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.workout-body {
  min-width: 0;
}

.workout-body h2 {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
}

.workout-body p {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
}

.workout-body span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workout-card > .icon {
  color: var(--red-2);
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mini-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border-radius: var(--radius-lg);
  padding: 13px;
  text-align: left;
}

.mini-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.mini-card.alert .round-icon {
  border-color: rgba(224, 197, 126, 0.36);
  color: #1b1304;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
  box-shadow: 0 10px 24px rgba(224, 197, 126, 0.18);
}

.coach-preview p,
.safety-panel p,
.setup-panel p {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.screen-head {
  padding: 8px 4px 2px;
}

.screen-head h1 {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.screen-head p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
}

select {
  max-width: 96px;
  height: 38px;
  padding: 0 9px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.reflection-panel {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

label input:not([type="range"]),
label textarea {
  min-height: 44px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

textarea {
  resize: vertical;
}

input[type="range"] {
  accent-color: var(--red);
}

.range-value {
  justify-self: end;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 900;
}

.chat-panel {
  min-height: calc(100dvh - 340px - var(--safe-bottom));
  max-height: calc(100dvh - 240px - var(--safe-bottom));
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto auto;
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 280px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.message {
  width: fit-content;
  max-width: 86%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.052);
  font-size: 13px;
  font-weight: 650;
}

.message.coach {
  border-color: rgba(224, 197, 126, 0.24);
  color: var(--text);
  background: rgba(199, 166, 104, 0.12);
}

.message.member {
  align-self: flex-end;
  color: #061109;
  background: var(--green);
}

.chat-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}

.chat-suggestions::-webkit-scrollbar {
  display: none;
}

.chat-suggestions button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 850;
}

.chat-suggestions button:active {
  color: #0b0905;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-form input {
  height: 44px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button.send {
  width: 44px;
  height: 44px;
  color: #0b0905;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.metric-card {
  min-height: 114px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
}

.metric-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.metric-card p {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.flag-list,
.coaching-data {
  display: grid;
  gap: 9px;
}

.flag-item,
.data-item {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.036);
}

.flag-item strong,
.data-item strong {
  font-size: 13px;
  font-weight: 900;
}

.flag-item span,
.data-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.flag-item.high {
  border-color: rgba(224, 197, 126, 0.34);
  background: rgba(199, 166, 104, 0.12);
}

.flag-item.medium {
  border-color: rgba(241, 182, 64, 0.34);
  background: rgba(241, 182, 64, 0.1);
}

.setup-panel {
  display: grid;
  gap: 10px;
}

.setup-row {
  align-items: flex-start;
}

.instruction-box {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.034);
}

.instruction-box strong {
  font-size: 13px;
  font-weight: 900;
}

.instruction-box span {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 430px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 9px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(5, 6, 7, 0.92);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  padding: 7px 3px;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
  font-weight: 800;
}

.tab .icon {
  font-size: 19px;
}

.tab.active {
  color: var(--red-2);
  background: rgba(199, 166, 104, 0.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  z-index: 50;
  width: min(calc(100% - 28px), 392px);
  min-height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(16, 22, 26, 0.96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.toast.visible {
  display: flex;
}

.install-modal[hidden] {
  display: none;
}

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + var(--safe-bottom));
}

.install-modal__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(224, 197, 126, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.install-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 402px);
  padding: 20px;
  border: 1px solid rgba(224, 197, 126, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(27, 25, 20, 0.97), rgba(11, 12, 11, 0.98)),
    var(--surface);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(224, 197, 126, 0.08);
  animation: dbkMsgIn 240ms cubic-bezier(0.32, 0.72, 0.24, 1) both;
}

.install-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
}

.install-modal__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  color: var(--gold-2);
}

.install-modal h2 {
  margin: 2px 0 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  font-weight: 950;
}

.install-modal__copy {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
}

.install-steps li {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.install-steps strong {
  color: var(--text);
}

.install-steps span {
  color: var(--gold-2);
}

.install-modal__actions {
  display: grid;
  gap: 10px;
}

.install-modal-open {
  overflow: hidden;
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(760px 420px at 20% 10%, rgba(199, 166, 104, 0.10), transparent 70%),
      radial-gradient(760px 420px at 82% 16%, rgba(255, 255, 255, 0.03), transparent 72%),
      #050607;
  }

  .app-shell {
    width: min(100%, 852px);
    min-height: 100dvh;
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    overflow: visible;
    background:
      radial-gradient(620px 360px at 75% 0%, rgba(199, 166, 104, 0.12), transparent 68%),
      linear-gradient(180deg, #050607 0%, #070a0c 100%);
    box-shadow: none;
  }

  .app-top {
    padding: calc(34px + var(--safe-top)) 40px 18px;
    background: linear-gradient(180deg, rgba(5, 6, 7, 0.98), rgba(5, 6, 7, 0.84));
    border-bottom: 0;
  }

  .brand-main {
    font-size: 72px;
  }

  .brand-sub {
    font-size: 15px;
    letter-spacing: 0.24em;
  }

  .date-line {
    display: none;
  }

  .icon-button {
    width: 52px;
    height: 52px;
    border-color: transparent;
    background: transparent;
  }

  .icon-button .icon {
    font-size: 29px;
  }

  .notification-dot {
    top: 5px;
    right: 3px;
    min-width: 25px;
    height: 25px;
    font-size: 13px;
  }

  .view-stack {
    padding: 34px 38px calc(132px + var(--safe-bottom));
  }

  .hero-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(390px, 1.1fr);
    align-items: end;
    gap: 36px;
    margin-bottom: 16px;
  }

  .welcome-copy {
    padding: 0 10px 44px 12px;
  }

  .welcome-copy p {
    color: var(--text-soft);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  .welcome-copy h1 {
    margin-top: 8px;
    font-size: 46px;
  }

  .welcome-copy span {
    max-width: 240px;
    margin-top: 20px;
    color: var(--text-soft);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.55;
  }

  .score-card {
    align-self: end;
    padding: 24px;
    border-radius: 12px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
      #111517;
  }

  .score-layout {
    grid-template-columns: 170px 1fr;
    gap: 26px;
  }

  .score-ring {
    width: 155px;
    height: 155px;
  }

  .score-ring strong {
    font-size: 48px;
  }

  .score-ring span {
    font-size: 18px;
  }

  .score-card h2 {
    font-size: 34px;
  }

  .score-card p {
    font-size: 20px;
    line-height: 1.45;
  }

  .text-button {
    width: calc(100% + 48px);
    margin: 22px -24px -24px;
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-between;
    font-size: 20px;
  }

  .panel,
  .workout-card,
  .mini-card {
    border-radius: 12px;
  }

  .panel {
    padding: 24px;
  }

  .panel-head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .panel-head.compact {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .panel-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    color: var(--gold-2);
    background: transparent;
    box-shadow: none;
  }

  .panel h2,
  .mini-card strong,
  .setup-panel h2 {
    font-size: 24px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .reset-copy {
    font-size: 17px;
    font-weight: 600;
  }

  .habit-list {
    gap: 0;
  }

  .habit-row {
    grid-template-columns: 64px minmax(0, 1fr) 258px;
    min-height: 82px;
    padding: 0 0;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
  }

  .habit-row:last-child {
    border-bottom: 0;
  }

  .habit-icon {
    width: 42px;
    height: 42px;
    color: var(--gold-2);
    background: transparent;
  }

  .habit-icon .icon {
    font-size: 30px;
  }

  .habit-meta strong {
    font-size: 20px;
    font-weight: 700;
  }

  .habit-meta span {
    margin-top: 0;
    font-size: 17px;
    font-weight: 500;
  }

  .segmented {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 47px;
    padding: 3px;
  }

  .segmented button {
    height: 39px;
    font-size: 18px;
    font-weight: 700;
  }

  .submit-button {
    min-height: 0;
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    background: transparent;
    box-shadow: none;
    color: var(--text-soft);
    font-size: 19px;
    font-weight: 500;
  }

  .submit-button .icon {
    display: none;
  }

  .workout-card {
    grid-template-columns: 220px minmax(0, 1fr) 30px;
    min-height: 140px;
    padding: 16px 22px;
  }

  .workout-photo {
    height: 92px;
  }

  .workout-body h2 {
    font-size: 24px;
  }

  .workout-body p,
  .workout-body span {
    font-size: 18px;
  }

  .mini-grid {
    gap: 14px;
  }

  .mini-card {
    min-height: 150px;
    padding: 22px;
  }

  .mini-card span:last-child,
  .coach-preview p {
    font-size: 18px;
  }

  .bottom-nav {
    bottom: 0;
    width: min(100%, 852px);
    min-height: 92px;
    padding: 12px 28px calc(12px + var(--safe-bottom));
    border-radius: 0;
    overflow: hidden;
  }

  .tab {
    min-height: 62px;
    font-size: 16px;
  }

  .tab .icon {
    font-size: 31px;
  }
}

@media (max-width: 374px) {
  .view-stack {
    padding-left: 10px;
    padding-right: 10px;
  }

  .score-layout {
    grid-template-columns: 96px 1fr;
  }

  .score-ring {
    width: 96px;
    height: 96px;
  }

  .habit-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .segmented {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .workout-card {
    grid-template-columns: 78px minmax(0, 1fr) 18px;
  }

  .workout-photo {
    height: 78px;
  }
}

/* ============================================================
   FINAL POLISH OVERRIDES (cascade-last; intentional premium pass)
   ============================================================ */

@keyframes dbkMsgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dbkSpin {
  to { transform: rotate(360deg); }
}

@keyframes dbkShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -100% 0; }
}

@keyframes dbkPulseDot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  40%       { opacity: 1;    transform: translateY(-2px); }
}

@keyframes dbkPulseGlow {
  0%, 100% { box-shadow: 0 14px 32px rgba(224, 197, 126, 0.22); }
  50%       { box-shadow: 0 18px 44px rgba(224, 197, 126, 0.38); }
}

/* Saving / busy state */
.submit-button[data-busy="true"],
.secondary-button[data-busy="true"],
.icon-button[data-busy="true"] {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.submit-button[data-busy="true"] .icon,
.secondary-button[data-busy="true"] .icon,
.icon-button[data-busy="true"] .icon {
  visibility: hidden;
}

.submit-button[data-busy="true"]::after,
.secondary-button[data-busy="true"]::after,
.icon-button[data-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: dbkShimmer 1.1s linear infinite;
}

.submit-button[data-busy="true"]::before,
.secondary-button[data-busy="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(11, 9, 5, 0.3);
  border-top-color: rgba(11, 9, 5, 0.95);
  animation: dbkSpin 0.7s linear infinite;
  z-index: 1;
}

.secondary-button[data-busy="true"]::before {
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.9);
}

/* Saved-confirmation flash */
.submit-button.saved {
  animation: dbkPulseGlow 0.9s ease-out 1;
}

/* Chat polish — native-app quality bubbles, smooth append */
#view-coach.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 176px - var(--safe-bottom));
}

#view-coach .screen-head {
  padding: 12px 8px 14px;
}

#view-coach .screen-head h1 {
  font-size: 38px;
  letter-spacing: -0.035em;
}

#view-coach .screen-head p {
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.chat-panel {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: min(500px, calc(100dvh - 366px - var(--safe-bottom)));
  max-height: min(500px, calc(100dvh - 366px - var(--safe-bottom)));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: 14px 14px 12px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(14, 18, 19, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 52px rgba(0, 0, 0, 0.34);
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-height: 0;
  scroll-behavior: smooth;
  padding: 6px 2px 16px;
}

.chat-log::-webkit-scrollbar {
  width: 4px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.message {
  max-width: min(88%, 320px);
  padding: 13px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.52;
  animation: dbkMsgIn 220ms cubic-bezier(0.32, 0.72, 0.24, 1) both;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.message.coach {
  border-top-left-radius: 8px;
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.12), rgba(224, 197, 126, 0.035)),
    rgba(11, 12, 12, 0.74);
  border-color: rgba(224, 197, 126, 0.22);
  color: var(--text);
  font-weight: 650;
}

.message.member {
  align-self: flex-end;
  border-top-right-radius: 8px;
  background: linear-gradient(180deg, #f5dda0, var(--gold) 62%, var(--gold-dark));
  color: #0b0905;
  border-color: rgba(224, 197, 126, 0.45);
  font-weight: 700;
}

.message.coach.typing::after {
  content: "";
  display: inline-block;
  width: 30px;
  margin-left: 6px;
  background:
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 0 50%/6px 6px,
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 11px 50%/6px 6px,
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 22px 50%/6px 6px;
  background-repeat: no-repeat;
  height: 6px;
  vertical-align: middle;
  animation: dbkPulseDot 1.1s ease-in-out infinite;
}

.chat-suggestions {
  gap: 9px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.chat-suggestions button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.chat-suggestions button:active {
  color: #0b0905;
  border-color: rgba(224, 197, 126, 0.44);
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
}

.chat-form {
  position: relative;
  padding: 12px 0 0;
}

.chat-form input {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
    rgba(15, 14, 12, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 24px;
  height: 48px;
  padding: 0 18px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.chat-form input:focus {
  border-color: rgba(224, 197, 126, 0.42);
  outline: none;
  box-shadow: 0 0 0 4px rgba(224, 197, 126, 0.10);
}

.icon-button.send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(224, 197, 126, 0.32);
  transition: transform 180ms cubic-bezier(0.32, 0.72, 0.24, 1), box-shadow 180ms ease;
}

.icon-button.send:hover { transform: translateY(-1px) scale(1.03); }
.icon-button.send:active { transform: translateY(0) scale(0.97); }

/* Score ring — subtle premium glow */
.score-ring {
  position: relative;
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0.24, 1);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(224, 197, 126, 0.18), transparent 70%);
  z-index: -1;
  filter: blur(8px);
  opacity: 0.7;
}

/* Habit row hover/press affordance */
.habit-row {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.habit-row:active {
  transform: scale(0.995);
}

.segmented button {
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.segmented button:active { transform: scale(0.96); }

/* Install/push panels — premium affordance */
.setup-panel {
  position: relative;
  overflow: hidden;
}

.setup-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(224, 197, 126, 0.22), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}

.setup-panel:hover::before { opacity: 1; }

.setup-row {
  align-items: center;
}

.setup-row h2 {
  font-size: 17px;
}

.instruction-box {
  position: relative;
  overflow: hidden;
}

.instruction-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-dark));
  opacity: 0.5;
}

/* Toast polish */
.toast {
  border: 1px solid rgba(224, 197, 126, 0.22);
  background:
    linear-gradient(180deg, rgba(20, 18, 14, 0.96), rgba(12, 11, 8, 0.96));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(224, 197, 126, 0.08);
}

.toast.visible {
  animation: dbkMsgIn 220ms cubic-bezier(0.32, 0.72, 0.24, 1);
}

/* View transitions — keep the existing keyframe but smoother */
.view {
  animation: dbkMsgIn 200ms cubic-bezier(0.32, 0.72, 0.24, 1) both;
}

/* Bottom nav glass refinement */
.bottom-nav {
  background:
    linear-gradient(180deg, rgba(5, 6, 7, 0.78), rgba(5, 6, 7, 0.94));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-top-color: rgba(224, 197, 126, 0.08);
}

.tab {
  position: relative;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tab.active {
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.16), rgba(224, 197, 126, 0.04));
}

.tab.active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28%;
  right: 28%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}

.tab:active { transform: scale(0.96); }

/* Top-bar glass refinement */
.app-top {
  background:
    linear-gradient(180deg, rgba(5, 6, 7, 0.92), rgba(5, 6, 7, 0.62));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

/* Metric card hover */
.metric-card {
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.metric-card:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 197, 126, 0.22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

/* Notification dot — subtle pulse */
.notification-dot {
  position: absolute;
  box-shadow: 0 0 0 3px rgba(5, 6, 7, 0.9), 0 4px 10px rgba(224, 197, 126, 0.35);
}

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

/* ============================================================
   Sprint 13 (2026-05-12): Nutrition tab — meal plan flow.
   ============================================================ */

.nutrition-cta p {
  margin: 6px 0 14px;
  font-size: 14px;
  color: var(--text-2, #d5cbb4);
  line-height: 1.5;
}

.nutrition-form label,
.nutrition-result label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #9f947d);
}

.nutrition-form input,
.nutrition-form select,
.nutrition-form textarea {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #f7f2e5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 500;
}

.nutrition-form textarea::placeholder,
.reflection-panel textarea::placeholder {
  color: rgba(199, 205, 210, 0.36);
}

.nutrition-form textarea {
  min-height: 110px;
  resize: vertical;
}

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

@media (max-width: 380px) {
  .nutrition-grid { grid-template-columns: 1fr; }
}

.nutrition-disclaimer {
  margin: 14px 0 0;
  padding: 12px;
  background: rgba(199, 166, 104, 0.07);
  border: 1px solid rgba(224, 197, 126, 0.18);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2, #d5cbb4);
  line-height: 1.45;
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 14px;
}

.macro-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.macro-cell span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #9f947d);
  font-weight: 700;
}
.macro-cell strong {
  font-size: 20px;
  color: var(--gold-2, #e0c57e);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.macro-cell em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted, #9f947d);
}

.nutrition-flags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.meal-plan-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.meal-plan-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--gold-2, #e0c57e);
}
.meal-plan-head p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted, #9f947d);
}

.meal-day {
  margin-bottom: 14px;
}

.meal-day h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2, #d5cbb4);
}

.meal-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 4px 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 8px;
  align-items: start;
}

.meal-slot {
  grid-row: 1 / 3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-2, #e0c57e);
  padding-top: 2px;
}
.meal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #f7f2e5);
  line-height: 1.35;
}
.meal-macros {
  font-size: 12px;
  color: var(--muted, #9f947d);
  font-variant-numeric: tabular-nums;
}

.nutrition-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.nutrition-actions .submit-button,
.nutrition-actions .secondary-button {
  flex: 1;
  min-width: 140px;
}

.meal-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.meal-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  cursor: pointer;
}
.meal-track-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--gold-2, #e0c57e);
}
.meal-track-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meal-track-meta strong {
  font-size: 13.5px;
  color: var(--text, #f7f2e5);
}
.meal-track-meta small {
  font-size: 11px;
  color: var(--muted, #9f947d);
}

/* Sprint 14 follow-up: one-row nav, richer progress, readable nutrition. */
.bottom-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 4px;
  padding-inline: 8px;
}

.tab {
  min-height: 52px;
  white-space: nowrap;
  overflow: hidden;
}

.tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.more-action {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(224, 197, 126, 0.18);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-align: left;
  background: linear-gradient(180deg, rgba(224, 197, 126, 0.08), rgba(255, 255, 255, 0.035));
}

.more-action strong {
  font-size: 15px;
  font-weight: 900;
}

.more-action span:last-child {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.nutrition-form select,
.nutrition-form input,
.nutrition-form textarea {
  max-width: none;
  min-height: 48px;
  color: var(--text);
  background-color: rgba(20, 24, 25, 0.98);
}

.nutrition-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-2) 50%),
    linear-gradient(135deg, var(--gold-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.nutrition-form select option {
  color: #f4f6f7;
  background: #121617;
}

.progress-chart-card {
  grid-column: 1 / -1;
  padding: 14px;
}

.trend-chart {
  width: 100%;
  height: 130px;
  margin-top: 10px;
  overflow: visible;
}

.trend-chart path {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.trend-chart polyline {
  fill: none;
  stroke: var(--gold-2);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(224, 197, 126, 0.35));
}

.bar-chart {
  height: 138px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}

.bar-chart span {
  position: relative;
  min-width: 0;
  height: var(--bar);
  min-height: 18px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--gold-2), rgba(199, 166, 104, 0.18));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.bar-chart em {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.meal-row {
  display: block;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meal-row[open] {
  border-color: rgba(224, 197, 126, 0.26);
  background: rgba(224, 197, 126, 0.06);
}

.meal-summary {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 4px 12px;
  list-style: none;
}

.meal-summary::-webkit-details-marker {
  display: none;
}

.meal-summary::after {
  content: "Tap for amounts";
  grid-column: 2;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
}

.meal-row[open] .meal-summary::after {
  content: "Hide details";
}

.meal-detail {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.meal-detail strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meal-detail ul,
.meal-detail ol {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
}

@media (max-width: 390px) {
  .tab {
    gap: 3px;
    padding-inline: 2px;
    font-size: 10px;
  }

  .tab .icon {
    font-size: 18px;
  }
}

/* Sprint 15: app-shell hardening for DBK member PWA. */
html,
body {
  height: 100%;
  overflow: hidden;
}

.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-top {
  position: fixed;
  left: 50%;
  top: 0;
  width: min(100%, 430px);
  transform: translateX(-50%);
  padding: calc(6px + var(--safe-top)) 14px 6px;
}

.brand-main {
  font-size: 25px;
}

.brand-sub {
  font-size: 6.8px;
  letter-spacing: 0.2em;
}

.date-line {
  margin-top: 2px;
  font-size: 10px;
}

.app-top .icon-button {
  width: 36px;
  height: 36px;
}

.view-stack {
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(56px + var(--safe-top));
  padding-bottom: calc(86px + var(--safe-bottom));
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  bottom: 0;
  transform: translateX(-50%) translateZ(0);
}

.tab {
  min-height: 50px;
  font-size: 9.5px;
}

.tab .icon {
  font-size: 17px;
}

.progress-chart-card .panel-head {
  align-items: start;
  gap: 10px;
}

.progress-chart-card .reset-copy {
  max-width: 132px;
  white-space: normal;
  text-align: right;
  line-height: 1.25;
}

.current-plan-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  margin: 0 0 12px;
  padding: 13px;
  border: 1px solid rgba(224, 197, 126, 0.24);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.12), rgba(255, 255, 255, 0.035));
}

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

.current-plan-card strong,
.current-plan-card small {
  display: block;
  min-width: 0;
}

.current-plan-card strong {
  font-size: 14px;
  font-weight: 900;
}

.current-plan-card small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.recycle-meal-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(224, 197, 126, 0.24);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(224, 197, 126, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.recycle-meal-button .icon {
  font-size: 15px;
}

.chat-panel {
  min-height: calc(100dvh - 220px - var(--safe-bottom));
  max-height: none;
  grid-template-rows: minmax(260px, 1fr) auto;
}

.chat-form {
  align-items: end;
}

.chat-form textarea {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 13px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-size: 16px;
  line-height: 1.35;
  outline: none;
}

.chat-form textarea:focus {
  border-color: rgba(224, 197, 126, 0.42);
  box-shadow: 0 0 0 4px rgba(224, 197, 126, 0.10);
}

.chat-suggestions,
.safety-panel {
  display: none !important;
}

@media (max-width: 640px) {
  input,
  textarea,
  select,
  .chat-form textarea,
  .nutrition-form input,
  .nutrition-form select,
  .nutrition-form textarea,
  #authEmail {
    font-size: 16px !important;
  }
}

@media (max-width: 380px) {
  .tab span {
    font-size: 9px;
  }

  .progress-chart-card .reset-copy {
    max-width: 112px;
  }
}

/* Kevin review polish: completion states, honest setup, nutrition tracker. */
.completion-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(79, 199, 116, 0.32);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(79, 199, 116, 0.16), rgba(79, 199, 116, 0.06));
}

.completion-banner[hidden] {
  display: none;
}

.completion-banner strong {
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.completion-banner span {
  grid-column: 1;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.completion-banner .text-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(79, 199, 116, 0.28);
  border-radius: 999px;
  color: var(--green);
  background: rgba(79, 199, 116, 0.08);
}

.completed-panel .habit-list,
.completed-panel label {
  opacity: 0.52;
}

.completed-panel .segmented,
.completed-panel input,
.completed-panel textarea,
.completed-panel select {
  pointer-events: none;
}

.muted-card {
  opacity: 0.88;
}

.status-pill {
  justify-self: end;
  align-self: start;
  padding: 6px 8px;
  border: 1px solid rgba(224, 197, 126, 0.2);
  border-radius: 999px;
  color: var(--gold-2);
  background: rgba(224, 197, 126, 0.08);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-status {
  margin: 10px 4px 0;
  padding: 10px 12px;
  border: 1px solid rgba(224, 197, 126, 0.18);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 750;
}

.ai-status[data-state="live"] {
  border-color: rgba(79, 199, 116, 0.28);
  color: var(--green);
  background: rgba(79, 199, 116, 0.08);
}

.ai-status[data-state="error"] {
  border-color: rgba(216, 193, 132, 0.24);
  color: rgba(238, 220, 170, 0.86);
  background: rgba(216, 193, 132, 0.075);
}

.bar-chart {
  height: 166px;
  align-items: end;
  padding: 10px 4px 28px;
}

.bar-chart em {
  bottom: -24px;
  max-width: 42px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.heads-up-card {
  position: relative;
  padding-right: 46px;
}

.heads-up-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.2);
}

.tracker-summary {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 2px 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
}

.tracker-ring {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--green) calc(var(--tracker-pct) * 1%), rgba(255, 255, 255, 0.1) 0);
}

.tracker-ring strong {
  font-size: 22px;
  font-weight: 950;
}

.tracker-ring span {
  color: var(--muted);
  max-width: 70px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.tracker-summary h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 950;
}

.tracker-summary p {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.tracker-meal-count {
  display: inline-flex;
  margin-top: 8px;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 900;
}

.tracker-macro-bars {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.tracker-macro {
  display: grid;
  gap: 6px;
}

.tracker-macro > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.tracker-macro span {
  color: var(--text-soft);
  font-weight: 850;
}

.tracker-macro strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.tracker-macro i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.tracker-macro i::before {
  content: "";
  display: block;
  width: calc(var(--macro-pct) * 1%);
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--macro-colour, var(--gold-2));
  transition: width 220ms ease;
}

.tracker-macro.protein { --macro-colour: #78a6ff; }
.tracker-macro.carbs { --macro-colour: #80d3c7; }
.tracker-macro.fat { --macro-colour: #ef7f75; }

.meal-track-row {
  position: relative;
  min-height: 68px;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.meal-track-row.tracked {
  border-color: rgba(79, 199, 116, 0.3);
  background: rgba(79, 199, 116, 0.08);
}

.meal-track-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.meal-track-check {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(224, 197, 126, 0.45);
  border-radius: 999px;
  color: #061109;
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
  font-weight: 950;
}

.meal-track-row.tracked .meal-track-check {
  border-color: var(--green);
  background: var(--green);
}

.meal-track-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.meal-track-meta strong {
  font-size: 13px;
  text-transform: none;
}

.track-action {
  flex: 0 0 auto;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.meal-track-row.tracked .track-action {
  color: var(--green);
}

.custom-meal-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(224, 197, 126, 0.18);
  border-radius: var(--radius-md);
  background: rgba(224, 197, 126, 0.06);
}

.secondary-button.subtle {
  min-height: 42px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.current-plan-card strong {
  font-size: 16px;
}

.current-plan-card[aria-expanded="true"] {
  border-color: rgba(224, 197, 126, 0.34);
  background: linear-gradient(180deg, rgba(224, 197, 126, 0.13), rgba(255, 255, 255, 0.04));
}

.nutrition-result.readonly-plan .nutrition-actions {
  display: none;
}

.nutrition-result.readonly-plan .meal-plan-head {
  margin-top: 2px;
}

.nutrition-tracker {
  border-color: rgba(79, 199, 116, 0.16);
}

#view-coach.active {
  min-height: auto;
}

#view-coach .screen-head {
  padding: 4px 6px 8px;
}

#view-coach .screen-head h1 {
  font-size: 30px;
}

#view-coach .screen-head p {
  display: none;
}

#view-coach .ai-status {
  margin-top: 6px;
  padding: 8px 10px;
}

#view-coach .chat-panel {
  min-height: calc(100dvh - 340px - var(--safe-bottom));
}

.nutrition-result[hidden],
.nutrition-tracker[hidden],
.nutrition-form[hidden],
.nutrition-cta[hidden],
.custom-meal-form[hidden] {
  display: none;
}

/* Round 3 premium restraint: tighter scale, glass surface, less generated-card weight. */
:root {
  --bg: #050608;
  --bg-2: #090b0d;
  --surface: rgba(16, 18, 20, 0.66);
  --surface-2: rgba(22, 24, 27, 0.72);
  --surface-3: rgba(28, 31, 34, 0.76);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f3f4f2;
  --text-soft: #b7bebd;
  --muted: #777f80;
  --quiet: #555d5e;
  --gold: #c5aa73;
  --gold-2: #d8c184;
  --gold-3: #ead8a2;
  --green: #54c77a;
  --blue: #7aa7e8;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

body {
  font-size: 13px;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #050608 0%, #090b0d 52%, #040506 100%);
}

.icon {
  stroke-width: 1.65;
}

.app-shell {
  width: min(100%, 414px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.008) 34%),
    linear-gradient(180deg, #07090a 0%, #0a0d0f 48%, #050607 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.055), 0 24px 72px rgba(0, 0, 0, 0.42);
}

.app-top {
  min-height: 58px;
  padding: calc(9px + var(--safe-top)) 14px 9px;
  background: rgba(5, 6, 7, 0.74);
  border-bottom-color: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.brand-main {
  font-size: 27px;
  line-height: 0.86;
}

.brand-sub {
  font-size: 7px;
  letter-spacing: 0.24em;
  color: rgba(216, 193, 132, 0.78);
}

.date-line {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
}

.app-top .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.app-top .icon-button .icon {
  font-size: 15px;
}

.notification-dot {
  top: 5px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  font-size: 8px;
}

.view-stack {
  padding: calc(64px + var(--safe-top)) 12px calc(80px + var(--safe-bottom));
}

.view {
  animation: none;
}

.welcome-copy {
  padding: 3px 2px 0;
}

.welcome-copy p,
.card-kicker {
  font-size: 9px;
  letter-spacing: 0.08em;
}

.welcome-copy h1 {
  margin-top: 1px;
  font-size: 28px;
  line-height: 1.02;
  font-weight: 850;
}

.welcome-copy span {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.screen-head {
  padding: 2px 2px 6px;
}

.screen-head h1,
#view-coach .screen-head h1 {
  font-size: 24px;
  line-height: 1.08;
  font-weight: 850;
}

.screen-head p {
  margin-top: 5px;
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  font-weight: 600;
}

.score-card,
.panel,
.workout-card,
.mini-card,
.current-plan-card,
.meal-track-row,
.tracker-summary,
.tracker-macro-bars {
  border-color: rgba(255, 255, 255, 0.074);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.024)),
    rgba(12, 14, 15, 0.58);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

.panel {
  margin-top: 10px;
  padding: 11px;
}

.panel-head {
  gap: 9px;
  margin-bottom: 9px;
}

.panel-head.compact {
  margin-bottom: 8px;
}

.panel h2,
.mini-card strong,
.setup-panel h2,
.workout-body h2 {
  font-size: 14px;
  font-weight: 820;
}

.panel-icon,
.round-icon,
.habit-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--gold-2);
  background: rgba(216, 193, 132, 0.1);
  border-color: rgba(216, 193, 132, 0.17);
  box-shadow: none;
}

.panel-icon .icon,
.round-icon .icon {
  font-size: 14px;
}

.score-card {
  padding: 12px;
}

.score-layout {
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  margin-top: 9px;
}

.score-ring {
  width: 82px;
  height: 82px;
}

.score-ring strong {
  font-size: 27px;
}

.score-ring span {
  font-size: 9px;
}

.score-card h2 {
  font-size: 20px;
  line-height: 1.05;
  font-weight: 850;
}

.score-card p,
.coach-preview p,
.safety-panel p,
.setup-panel p,
.workout-body p,
.workout-body span,
.mini-card span:last-child,
.reset-copy,
.current-plan-card small {
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.habit-list {
  gap: 7px;
}

.habit-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 46px;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.032);
}

.habit-meta strong {
  font-size: 12px;
  font-weight: 780;
}

.habit-meta span {
  font-size: 10.5px;
}

.segmented {
  grid-template-columns: 38px 38px;
  gap: 3px;
  padding: 2px;
}

.segmented button {
  height: 28px;
  font-size: 11px;
}

.submit-button,
.secondary-button {
  min-height: 42px;
  margin-top: 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 820;
  box-shadow: 0 10px 22px rgba(216, 193, 132, 0.14);
}

.secondary-button {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.052);
  box-shadow: none;
}

.submit-button .icon {
  font-size: 14px;
}

.workout-card {
  grid-template-columns: 72px minmax(0, 1fr) 16px;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
}

.workout-photo {
  height: 72px;
  border-radius: 8px;
}

.workout-photo span {
  left: 8px;
  bottom: 8px;
  font-size: 18px;
}

.mini-grid {
  gap: 8px;
  margin-top: 10px;
}

.mini-card {
  min-height: 106px;
  gap: 7px;
  padding: 10px;
}

.more-grid {
  gap: 8px;
}

.more-action {
  min-height: 92px;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.more-action strong {
  font-size: 13px;
  font-weight: 820;
}

.more-action span:last-child {
  font-size: 10.5px;
}

.bottom-nav {
  width: min(calc(100% - 20px), 394px);
  min-height: calc(58px + var(--safe-bottom));
  padding: 6px 8px calc(6px + var(--safe-bottom));
  border-radius: 14px 14px 0 0;
  border-color: rgba(255, 255, 255, 0.085);
  background: rgba(8, 10, 11, 0.78);
  box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.tab {
  min-height: 44px;
  gap: 3px;
  border-radius: 9px;
  color: rgba(183, 190, 189, 0.74);
  font-size: 8.5px;
  font-weight: 760;
}

.tab .icon {
  font-size: 14px;
}

.tab.active {
  color: var(--gold-2);
  background: rgba(216, 193, 132, 0.095);
}

.nutrition-form label,
.nutrition-result label,
label {
  font-size: 10.5px;
  letter-spacing: 0.035em;
}

.nutrition-form input,
.nutrition-form select,
.nutrition-form textarea,
label input:not([type="range"]),
label textarea,
#authEmail {
  min-height: 44px;
  border-radius: 8px;
  font-size: 16px;
  background: rgba(10, 12, 13, 0.72);
}

.macro-grid {
  gap: 7px;
}

.macro-cell {
  padding: 9px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.macro-cell span,
.macro-cell em {
  font-size: 9.5px;
}

.macro-cell strong {
  font-size: 16px;
}

.meal-row {
  border-radius: 8px;
}

.meal-name {
  font-size: 13px;
}

.meal-macros,
.meal-slot {
  font-size: 10.5px;
}

.current-plan-card {
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  gap: 9px;
  padding: 10px;
}

.current-plan-card strong {
  font-size: 13px;
}

.tracker-summary {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.tracker-ring {
  width: 70px;
  height: 70px;
}

.tracker-ring strong {
  font-size: 18px;
}

.tracker-summary h3 {
  font-size: 14px;
}

.tracker-summary p,
.tracker-macro > div,
.tracker-macro strong,
.tracker-meal-count,
.track-action,
.meal-track-meta small {
  font-size: 10.5px;
}

.meal-track-row {
  min-height: 56px;
  padding: 9px;
}

.meal-track-check {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.meal-track-meta strong {
  font-size: 12px;
}

.ai-status {
  margin: 6px 2px 0;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 10.5px;
}

#view-coach .screen-head {
  padding: 0 2px 6px;
}

#view-coach .chat-panel,
.chat-panel {
  min-height: calc(100dvh - 322px - var(--safe-bottom));
  max-height: none;
  border-radius: 8px;
  padding: 10px;
}

.message {
  max-width: min(88%, 300px);
  padding: 10px 11px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.2);
}

.message.coach,
.message.member {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.chat-form {
  padding-top: 9px;
}

.chat-form textarea {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.055);
}

.icon-button.send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(216, 193, 132, 0.16);
}

.completion-banner,
.nutrition-disclaimer,
.flag-item,
.custom-meal-form {
  border-radius: 8px;
}

@media (max-width: 380px) {
  .welcome-copy h1 {
    font-size: 25px;
  }

  .screen-head h1,
  #view-coach .screen-head h1 {
    font-size: 22px;
  }
}

/* Round 3.2 premium mobile restraint: smaller scale, sharper app chrome. */
body {
  color: rgba(244, 245, 242, 0.94);
  text-rendering: geometricPrecision;
}

.app-shell {
  width: min(100%, 402px);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -8%, rgba(216, 193, 132, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 24%);
  opacity: 0.74;
  z-index: 0;
}

.app-top,
.bottom-nav,
.view-stack {
  z-index: 1;
}

.app-top {
  min-height: 52px;
  padding: calc(6px + var(--safe-top)) 12px 6px;
  background: rgba(5, 6, 7, 0.68);
}

.brand-main {
  font-size: 22px;
  line-height: 0.88;
  font-weight: 900;
}

.brand-sub {
  font-size: 6px;
  letter-spacing: 0.18em;
}

.date-line {
  margin-top: 2px;
  font-size: 9px;
  color: rgba(183, 190, 189, 0.68);
}

.app-top .icon-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.app-top .icon-button .icon {
  font-size: 13px;
}

.notification-dot {
  min-width: 12px;
  height: 12px;
  font-size: 7px;
}

.view-stack {
  padding: calc(54px + var(--safe-top)) 10px calc(74px + var(--safe-bottom));
}

.hero-grid {
  gap: 8px;
}

.welcome-copy {
  padding: 0 2px;
}

.welcome-copy p,
.card-kicker {
  font-size: 8px;
}

.welcome-copy h1 {
  font-size: 24px;
  line-height: 1;
}

.welcome-copy span {
  margin-top: 3px;
  font-size: 10.5px;
}

.screen-head {
  padding: 0 2px 5px;
}

.screen-head h1,
#view-coach .screen-head h1 {
  font-size: 21px;
  line-height: 1.06;
}

.screen-head p {
  margin-top: 4px;
  font-size: 10.8px;
  line-height: 1.35;
}

.panel,
.score-card,
.workout-card,
.mini-card,
.more-action,
.current-plan-card,
.meal-track-row,
.tracker-summary,
.tracker-macro-bars {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.018)),
    rgba(10, 12, 13, 0.58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel {
  margin-top: 8px;
  padding: 9px;
}

.panel-head {
  gap: 7px;
  margin-bottom: 7px;
}

.panel h2,
.mini-card strong,
.setup-panel h2,
.workout-body h2 {
  font-size: 12.5px;
}

.panel-icon,
.round-icon,
.habit-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.panel-icon .icon,
.round-icon .icon,
.habit-icon .icon {
  font-size: 12px;
}

.score-card {
  padding: 10px;
}

.score-layout {
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  margin-top: 7px;
}

.score-ring {
  width: 68px;
  height: 68px;
}

.score-ring strong {
  font-size: 22px;
}

.score-ring span {
  font-size: 8px;
}

.score-card h2 {
  font-size: 16px;
}

.score-card p,
.coach-preview p,
.safety-panel p,
.setup-panel p,
.workout-body p,
.workout-body span,
.mini-card span:last-child,
.reset-copy,
.current-plan-card small,
.completion-banner span,
.instruction-box span {
  font-size: 10px;
}

.text-button {
  font-size: 10.5px;
}

.habit-list {
  gap: 5px;
}

.habit-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-height: 44px;
  gap: 7px;
  padding: 7px;
}

.habit-meta strong {
  font-size: 11px;
}

.habit-meta span {
  font-size: 9.5px;
}

.segmented {
  grid-template-columns: 34px 34px;
}

.segmented button {
  height: 26px;
  min-height: 26px;
  font-size: 10px;
}

.submit-button,
.secondary-button {
  min-height: 44px;
  margin-top: 8px;
  font-size: 11.5px;
}

.submit-button .icon {
  font-size: 12px;
}

.workout-card {
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px;
}

.workout-photo {
  height: 58px;
}

.workout-photo span {
  font-size: 15px;
}

.status-pill {
  font-size: 8px;
  padding: 4px 6px;
}

.mini-grid {
  gap: 7px;
  margin-top: 8px;
}

.mini-card {
  min-height: 88px;
  gap: 6px;
  padding: 9px;
}

.more-grid {
  gap: 7px;
}

.more-action {
  min-height: 78px;
  padding: 9px;
}

.more-action strong {
  font-size: 12px;
}

.more-action span:last-child {
  font-size: 9.5px;
}

.bottom-nav {
  width: min(calc(100% - 16px), 386px);
  min-height: calc(52px + var(--safe-bottom));
  padding: 5px 7px calc(5px + var(--safe-bottom));
  border-radius: 12px 12px 0 0;
}

.tab {
  min-height: 44px;
  gap: 2px;
  font-size: 7.6px;
}

.tab .icon {
  font-size: 12px;
}

.nutrition-form label,
.nutrition-result label,
label {
  font-size: 9.8px;
}

.nutrition-form input,
.nutrition-form select,
.nutrition-form textarea,
label input:not([type="range"]),
label textarea,
#authEmail {
  min-height: 44px;
  font-size: 16px;
}

.macro-grid,
.nutrition-grid {
  gap: 6px;
}

.macro-cell {
  padding: 8px 6px;
}

.macro-cell strong {
  font-size: 14px;
}

.meal-name,
.current-plan-card strong {
  font-size: 12px;
}

.meal-macros,
.meal-slot {
  font-size: 9.8px;
}

.tracker-summary {
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
}

.tracker-ring {
  width: 62px;
  height: 62px;
}

.tracker-ring strong {
  font-size: 16px;
}

.tracker-ring span {
  font-size: 8px;
}

.tracker-summary h3 {
  font-size: 12.5px;
}

.tracker-summary p,
.tracker-macro > div,
.tracker-macro strong,
.tracker-meal-count,
.track-action,
.meal-track-meta small {
  font-size: 9.8px;
}

.meal-track-row {
  min-height: 52px;
  padding: 8px;
}

.meal-track-check {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.meal-track-meta strong {
  font-size: 11px;
}

.ai-status {
  padding: 7px 8px;
  font-size: 9.8px;
}

#view-coach .chat-panel,
.chat-panel {
  min-height: calc(100dvh - 304px - var(--safe-bottom));
  padding: 8px;
}

.message {
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 11.2px;
  line-height: 1.42;
}

.chat-form {
  gap: 7px;
  padding-top: 8px;
}

.chat-form textarea {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 16px;
}

.icon-button.send {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

@media (max-width: 380px) {
  .welcome-copy h1 {
    font-size: 22px;
  }

  .screen-head h1,
  #view-coach .screen-head h1 {
    font-size: 20px;
  }

  .panel {
    padding: 8px;
  }
}

/* Real-device shell fit: full-bleed app chrome, compact More menu. */
html,
body {
  width: 100%;
  background: #050608;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
}

.app-shell::before {
  left: 0;
  right: 0;
}

.app-top {
  left: 0;
  width: 100%;
  max-width: none;
  transform: none;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

.view-stack {
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-bottom: calc(64px + var(--safe-bottom));
}

.bottom-nav {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  transform: none;
  border-radius: 14px 14px 0 0;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  padding-bottom: max(6px, var(--safe-bottom));
}

.more-menu-panel {
  padding-top: 10px;
}

.more-menu-panel .more-grid {
  grid-template-columns: 1fr;
}

.more-menu-panel .more-action {
  min-height: 62px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-content: center;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px;
  text-align: left;
}

.more-menu-panel .more-action .round-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
}

.more-menu-panel .more-action strong,
.more-menu-panel .more-action span:last-child {
  grid-column: 2;
  justify-self: start;
  min-width: 0;
}

.more-menu-panel .more-action strong {
  align-self: end;
}

.more-menu-panel .more-action span:last-child {
  align-self: start;
  max-width: 100%;
  line-height: 1.25;
  text-wrap: pretty;
}

.more-detail-panel[hidden],
.more-menu-panel[hidden] {
  display: none;
}
