:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #edf0f7;
  --ink: #0a1f44;
  --text: #2f3a4a;
  --muted: #6b7a90;
  --line: #dbe1eb;
  --purple: #5e3bc5;
  --purple-dark: #3a1f8a;
  --purple-soft: #f0ecfa;
  --green: #0f9d58;
  --orange: #d97706;
  --red: #b42318;
  --blue: #1664d9;
  --ios-blue: #007aff;
  --ios-fill: rgba(118, 118, 128, .12);
  --ios-separator: rgba(60, 60, 67, .18);
  --chart-grid: #ddd8ee;
  --chart-axis: #5b528a;
  --chart-pill: #faf8ff;
  --chart-pill-border: #dcd3f8;
  --bar-above: #3a1f8a;
  --bar-below: #bba8f2;
  --bar-equal: #5e3bc5;
  --today-outline: rgba(94, 59, 197, .35);
  --shadow: 0 14px 32px rgba(35, 34, 72, .10);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-top: env(safe-area-inset-top);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

.topbar {
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 4;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-icon,
.round-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.brand-icon {
  background: transparent;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.round-nav-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(35, 34, 72, .08);
}

.round-nav-btn svg { width: 19px; height: 19px; }

.brand-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.brand-icon img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}
.brand-copy {
  min-width: 0;
  overflow: hidden;
}
.brand-title {
  color: var(--purple-dark);
  font-weight: 760;
  font-size: 17px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-chip {
  min-width: 96px;
  border: 1px solid #cfe8dc;
  background: #effaf5;
  color: var(--green);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 740;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chat {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px calc(176px + var(--safe-bottom));
  scroll-behavior: smooth;
}

.screen-view {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px calc(96px + var(--safe-bottom));
}

.screen-inner {
  max-width: 720px;
  min-width: 0;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.screen-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 6px;
}

.screen-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.screen-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.chat-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.row { display: flex; gap: 10px; align-items: flex-start; }
.row.user { justify-content: flex-end; }
.launch-row {
  align-items: center;
  gap: 0;
  max-width: 100%;
  min-width: 0;
}
.launch-mascot {
  width: clamp(78px, 19vw, 122px);
  height: auto;
  flex: 0 0 auto;
  margin-right: -20px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 12px 18px rgba(35, 34, 72, .12));
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 2px;
  overflow: hidden;
}
.avatar svg {
  width: 20px;
  height: 20px;
  display: block;
}
.avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.bubble {
  max-width: min(560px, calc(100vw - 76px));
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(20, 28, 46, .05);
}
.bubble.wide { max-width: min(680px, calc(100vw - 76px)); width: 100%; }
.assistant .bubble { border-top-left-radius: 6px; }
.user .bubble {
  color: white;
  background: var(--purple);
  border-color: var(--purple);
  border-top-right-radius: 6px;
}
.launch-card {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(640px, calc(100vw - 82px));
  padding: 28px 28px 24px 48px;
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(35, 34, 72, .10);
}

.bubble h2, .bubble h3, .bubble p { margin: 0; }
.bubble h2 { color: var(--ink); font-size: 17px; line-height: 1.2; }
.bubble p { color: inherit; line-height: 1.5; font-size: 15px; }
.assistant .bubble p { color: var(--text); }
.launch-card h2 {
  color: var(--purple-dark);
  font-size: clamp(22px, 3.3vw, 28px);
  line-height: 1.18;
  letter-spacing: -.03em;
}
.launch-body {
  margin-top: 18px !important;
  max-width: 580px;
  color: var(--muted) !important;
  font-size: clamp(14px, 1.9vw, 16px) !important;
  line-height: 1.55 !important;
}
.launch-try {
  margin-top: 18px;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.scenario-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 0 3px;
  margin-top: 10px;
}
.scenario-strip::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.chip:active { transform: scale(.98); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.card-head {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 18px; color: var(--ink); font-weight: 780; line-height: 1.15; }
.card-subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; }
.pill {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}
.pill.green { color: var(--green); background: #eefaf4; border: 1px solid #cfebdd; }
.pill.orange { color: var(--orange); background: #fff6e8; border: 1px solid #f0d9b4; }
.pill.red { color: var(--red); background: #fff1ef; border: 1px solid #f2c7c2; }
.pill.blue { color: var(--blue); background: #eef5ff; border: 1px solid #c9defb; }

.card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.card-body { padding: 14px; display: grid; gap: 12px; }
.interpreted-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.interpreted-list li {
  color: var(--ink);
  line-height: 1.35;
}
.interpreted-list span {
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.fact {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 8px;
  min-height: 70px;
}
.fact span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 760;
}
.fact b {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.guidance {
  border-left: 4px solid var(--purple);
  background: var(--purple-soft);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.choice {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #d3c7f7;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 13px;
  font-weight: 720;
}

.remember-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.remember-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--purple);
  flex: 0 0 auto;
}

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 860px);
  margin: 0 auto;
  background: rgba(247, 249, 252, .94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + var(--safe-bottom));
  display: grid;
  gap: 8px;
  z-index: 7;
  box-shadow: 0 -14px 34px rgba(35, 34, 72, .08);
}

.details-tabs {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 9px 13px 10px;
  background: rgba(247, 249, 252, .94);
  border-bottom: 1px solid var(--line);
}

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

.nav-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 760;
}

.nav-tab.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.chat-fab {
  position: fixed;
  right: max(18px, calc((100vw - 860px) / 2 + 18px));
  bottom: calc(22px + var(--safe-bottom));
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 34px rgba(20, 28, 46, .26);
  z-index: 6;
}

.chat-fab svg { width: 30px; height: 30px; }

.composer {
  padding: 0;
}
.composer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.icon-btn, .send-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.icon-btn {
  background: var(--surface-soft);
  color: var(--purple-dark);
}
.send-btn {
  background: var(--purple);
  color: white;
}
.icon-btn svg, .send-btn svg { width: 21px; height: 21px; }
.input-wrap {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 21px;
  display: flex;
  align-items: center;
  padding: 0 13px;
}
.input-wrap:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(94, 59, 197, .12);
}
.input {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  min-height: 22px;
  max-height: 110px;
  line-height: 1.35;
  color: var(--ink);
  background: transparent;
  padding: 8px 0;
}

.photo-preview {
  width: 190px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dashboard {
  display: grid;
  gap: 12px;
}

.profile-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8d1ef;
  background: linear-gradient(135deg, #fff 0%, #f5f1ff 100%);
  border-radius: 8px;
  padding: 13px;
}

.kicker {
  color: var(--purple);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 820;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.profile-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
}

.profile-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.insight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mini-card,
.metric {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
}

.mini-card span,
.metric span,
.section-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.mini-card b,
.metric b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.metric b { font-size: 17px; }

.trend-card,
.control-card,
.adjust-card,
.daily-insight,
.upgrade-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 11px;
}

.history-screen {
  overflow-x: hidden;
  gap: 12px;
}

.history-screen .trend-card {
  border-color: rgba(94, 59, 197, .12);
  background:
    radial-gradient(circle at 12% 0%, rgba(94, 59, 197, .08), transparent 28%),
    rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(58, 31, 138, .07), 0 1px 2px rgba(0, 0, 0, .04);
  overflow: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.history-screen .trend-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(18px, 3.8vw, 24px);
  line-height: 1.05;
  font-weight: 820;
}

.history-screen .trend-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}

.history-screen .chart-pill {
  min-height: 36px;
  max-width: 100%;
  background: var(--chart-pill);
  border: 1.5px solid var(--chart-pill-border);
  border-radius: 12px;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(58, 31, 138, .03);
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.history-screen .chart-pill.nutrient-control {
  max-width: none;
  overflow: visible;
  position: relative;
  z-index: 5;
}

.history-screen .chart-pill.target-control {
  max-width: none;
  display: grid;
  grid-template-columns: 18px auto 42px minmax(50px, 1fr) auto;
  align-items: center;
  gap: 5px;
}

.history-screen .chart-pill > * {
  min-width: 0;
}

.history-screen .pill-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.history-screen .pill-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.history-screen .trend-select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  padding: 0;
}

.history-screen .nutrient-picker {
  min-width: 0;
  width: 100%;
  position: relative;
}

.history-screen .nutrient-picker-button {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.history-screen .nutrient-picker-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-screen .select-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--ink);
}

.history-screen .nutrient-menu {
  display: none;
  position: absolute;
  left: -34px;
  top: calc(100% + 8px);
  width: min(260px, calc(100vw - 48px));
  max-height: min(420px, 58dvh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(94, 59, 197, .2);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 42px rgba(20, 28, 46, .22);
  z-index: 20;
}

.history-screen .nutrient-picker.open .nutrient-menu {
  display: grid;
  gap: 2px;
}

.history-screen .nutrient-option {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 760;
}

.history-screen .nutrient-option:hover,
.history-screen .nutrient-option:focus-visible {
  background: var(--purple-soft);
  outline: 0;
}

.history-screen .nutrient-option.selected {
  background: #f4f0ff;
  color: var(--purple-dark);
}

.history-screen .option-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f7f9fc;
}

.history-screen .option-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.history-screen .target-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.history-screen .target-control select,
.history-screen .target-control input {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--purple);
  font: inherit;
  font-size: 13px;
  font-weight: 820;
}

.history-screen .target-control select {
  width: 38px;
  padding: 0 2px;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.history-screen .target-control input {
  width: 100%;
  min-width: 0;
  text-align: right;
  color: var(--purple);
}

.history-screen .target-control em {
  color: var(--ink);
  font-style: normal;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}

.history-screen .target-control input:focus,
.history-screen .target-control select:focus,
.history-screen .trend-select:focus {
  outline: 2px solid rgba(94, 59, 197, .24);
  border-radius: 10px;
}

.history-screen .trend-total {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  justify-items: start;
  text-align: left;
  min-width: 0;
}

.history-screen .trend-total span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.history-screen .trend-total b {
  color: var(--ink);
  font-size: clamp(20px, 5.4vw, 28px);
  line-height: 1;
  font-weight: 820;
  white-space: nowrap;
}

.history-screen .chart-section {
  margin-top: 4px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.history-screen .trend-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.history-screen .trend-svg-axis {
  fill: var(--chart-axis);
  font-size: 12px;
  font-weight: 650;
}

.history-screen .trend-svg-grid {
  stroke: var(--chart-grid);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.history-screen .trend-svg-base {
  stroke: #d8d4e8;
  stroke-width: 2;
}

.history-screen .trend-svg-target {
  stroke: rgba(94, 59, 197, .58);
  stroke-width: 1.7;
  stroke-dasharray: 5 5;
}

.history-screen .trend-svg-target-label {
  fill: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.history-screen .trend-svg-value {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 760;
}

.history-screen .trend-svg-date {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.history-screen .trend-svg-bar {
  shape-rendering: geometricPrecision;
}

.history-screen .trend-svg-bar.above {
  fill: url(#trendBarAbove);
}

.history-screen .trend-svg-bar.below {
  fill: url(#trendBarBelow);
}

.history-screen .trend-svg-bar.equal {
  fill: url(#trendBarEqual);
}

.history-screen .trend-svg-bar.today {
  stroke: rgba(94, 59, 197, .36);
  stroke-width: 4;
}

.history-screen .chart-wrap {
  display: grid;
  grid-template-columns: var(--axis-width) minmax(0, 1fr);
  gap: var(--axis-gap);
  align-items: stretch;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.history-screen .y-axis {
  height: var(--chart-height);
  position: relative;
  color: var(--chart-axis);
  font-size: 10px;
  font-weight: 620;
  min-width: 0;
}

.history-screen .y-axis-scale {
  position: absolute;
  inset: var(--label-headroom) 0 0 0;
}

.history-screen .tick-label {
  position: absolute;
  right: 5px;
  transform: translateY(-50%);
  white-space: nowrap;
  line-height: 1;
}

.history-screen .plot-area {
  height: var(--chart-height);
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.history-screen .plot-scale {
  position: absolute;
  inset: var(--label-headroom) 0 0 0;
  border-bottom: 2px solid #d8d4e8;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.history-screen .grid-line {
  position: absolute;
  left: var(--plot-inset);
  right: var(--plot-inset);
  border-top: 1.5px dashed var(--chart-grid);
  pointer-events: none;
  z-index: 0;
}

.history-screen .target-grid {
  top: var(--target-y, 0%);
  border-color: rgba(94, 59, 197, .54);
}

.history-screen .mid-grid { top: var(--mid-y, 50%); }

.history-screen .bars-layer {
  position: absolute;
  inset: 0 var(--plot-inset) 0 var(--plot-inset);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: var(--bar-gap);
  align-items: end;
  z-index: 3;
  min-width: 0;
}

.history-screen .bar-group {
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.history-screen .value-label {
  position: absolute;
  bottom: calc(var(--bar-height) + 7px);
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(58, 31, 138, .13);
  color: var(--ink);
  padding: 4px 5px;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
  box-shadow: 0 6px 12px rgba(58, 31, 138, .04);
  white-space: nowrap;
  max-width: 100%;
  text-align: center;
}

.history-screen .bar {
  width: min(30px, 58%);
  max-width: 100%;
  height: var(--bar-height);
  min-height: 7px;
  border-radius: 12px 12px 0 0;
  transition: height 240ms ease, background 240ms ease, box-shadow 240ms ease, outline 240ms ease;
}

.history-screen .bar.above {
  background: linear-gradient(180deg, #5130ba 0%, var(--bar-above) 100%);
  box-shadow: 0 10px 20px rgba(58, 31, 138, .16);
}

.history-screen .bar.below {
  background: linear-gradient(180deg, #c9b9f8 0%, var(--bar-below) 100%);
  box-shadow: 0 8px 16px rgba(122, 100, 214, .10);
}

.history-screen .bar.equal {
  background: linear-gradient(180deg, #7a5de2 0%, var(--bar-equal) 100%);
  box-shadow: 0 10px 18px rgba(94, 59, 197, .12);
}

.history-screen .bar.today {
  outline: 2px solid var(--today-outline);
  outline-offset: 2px;
}

.history-screen .x-axis-row {
  display: grid;
  grid-template-columns: var(--axis-width) minmax(0, 1fr);
  gap: var(--axis-gap);
  margin-top: 5px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.history-screen .x-axis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: var(--bar-gap);
  padding-inline: var(--plot-inset);
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.history-screen .x-label {
  min-width: 0;
  text-align: center;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.15;
  color: var(--ink);
  white-space: normal;
}

.history-screen .legend-panel {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  padding: 9px 10px;
  background: #faf8ff;
  border: 1px solid #e5ddf8;
  border-radius: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.history-screen .legend-title {
  font-size: 9px;
  font-weight: 820;
  color: var(--ink);
  text-transform: uppercase;
}

.history-screen .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  white-space: normal;
}

.history-screen .legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  flex: 0 0 auto;
}

.history-screen .legend-swatch.above { background: var(--bar-above); }
.history-screen .legend-swatch.below { background: var(--bar-below); }
.history-screen .legend-swatch.equal { background: var(--bar-equal); }

.history-screen .legend-line {
  width: 18px;
  border-top: 2px dashed var(--purple);
  display: inline-block;
  transform: translateY(-1px);
  flex: 0 0 auto;
}

.history-screen .legend-today {
  width: 11px;
  height: 11px;
  border: 2.5px solid var(--today-outline);
  border-radius: 4px;
  display: inline-block;
  background: rgba(94, 59, 197, .08);
  flex: 0 0 auto;
}

@media (max-width: 390px) {
  .history-screen .chart-pill.nutrient-control,
  .history-screen .chart-pill.target-control {
    max-width: none;
  }

  .history-screen .trend-control-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-screen .value-label {
    display: none;
  }
}

@media (min-width: 760px) {
  .history-screen .trend-control-row {
    grid-template-columns: minmax(190px, .9fr) minmax(270px, 1.1fr);
  }

  .history-screen .chart-section {
    --chart-height: 230px;
    --bar-gap: 4px;
  }

  .history-screen .bar {
    width: min(34px, 64%);
  }
}

@media (max-width: 700px) {
  .screen-view {
    padding: 14px 12px calc(84px + var(--safe-bottom));
  }

  .history-screen {
    gap: 10px;
  }

  .history-screen .screen-hero {
    padding: 13px 14px;
  }

  .history-screen .screen-hero h1 {
    font-size: 22px;
    line-height: 1.08;
    letter-spacing: -0.02em;
  }

  .history-screen .screen-hero p {
    font-size: 13px;
    line-height: 1.35;
  }

  .history-screen .trend-card {
    padding: 13px;
    border-radius: 14px;
  }

  .history-screen .trend-title {
    margin-bottom: 10px;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .history-screen .trend-control-row {
    grid-template-columns: minmax(116px, .78fr) minmax(0, 1.22fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .history-screen .chart-pill {
    min-height: 38px;
    border-radius: 14px;
    padding: 7px 9px;
  }

  .history-screen .chart-pill.target-control {
    grid-template-columns: 18px minmax(42px, .8fr) 24px minmax(42px, 54px) auto;
    gap: 5px;
  }

  .history-screen .trend-select,
  .history-screen .target-label,
  .history-screen .target-control select,
  .history-screen .target-control input,
  .history-screen .target-control em {
    font-size: 12px;
  }

  .history-screen .target-control input {
    text-align: left;
  }

  .history-screen .trend-total {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e5ddf8;
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
  }

  .history-screen .trend-total span {
    font-size: 10px;
  }

  .history-screen .trend-total b {
    font-size: 18px;
  }

  .history-screen .chart-section {
    margin-top: 6px;
  }

  .history-screen .trend-svg {
    height: 168px;
    margin-top: 2px;
  }

  .history-screen .trend-svg-value {
    font-size: 8px;
    font-weight: 740;
  }

  .history-screen .trend-svg-axis,
  .history-screen .trend-svg-date {
    font-size: 8px;
  }

  .history-screen .trend-svg-target-label {
    display: none;
  }

  .history-screen .legend-panel {
    margin-top: 8px;
    padding: 8px;
    border-radius: 12px;
    gap: 6px 8px;
  }

  .history-screen .legend-title,
  .history-screen .legend-item {
    font-size: 9px;
    line-height: 1.25;
  }

  .history-screen .quick-lists {
    gap: 8px;
  }

  .history-screen .chip-list {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-top: 6px;
  }

  .history-screen .chip.small {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.2;
  }

  .history-meal-list {
    padding-bottom: 72px;
  }

  .history-meal-summary {
    grid-template-columns: 48px minmax(0, 1fr);
    padding-right: 8px;
  }

  .history-meal-head {
    display: block;
  }

  .history-card-actions {
    top: 10px;
  }

  .history-food-icon {
    width: 48px;
    height: 48px;
  }

  .history-meal-side {
    grid-column: 2;
    justify-content: flex-start;
  }

  .status-toggle {
    min-width: min(100%, 154px);
  }

  .history-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .history-screen .trend-control-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .history-screen .trend-svg-value,
  .history-screen .trend-svg-target-label {
    font-size: 9px;
  }

  .history-screen .trend-svg-date,
  .history-screen .trend-svg-axis {
    font-size: 10px;
  }
}

.quick-lists {
  display: grid;
  gap: 10px;
}

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

.entry-row {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 11px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
}

.entry-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
}

.entry-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.entry-row b {
  display: block;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entry-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.entry-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.entry-thumb.pictogram {
  display: grid;
  place-items: center;
  color: var(--purple-dark);
}

.entry-thumb.pictogram svg {
  width: 28px;
  height: 28px;
}

.history-meal-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  min-width: 0;
}

.history-meal-card {
  position: relative;
  width: 100%;
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #fff3f3;
  touch-action: pan-y;
}

.today-meal-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(94, 59, 197, .12);
  box-shadow: 0 8px 22px rgba(58, 31, 138, .05);
}

.today-meal-card .history-meal-summary {
  border-radius: 18px;
}

.status-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 154px;
  padding: 3px;
  border: 1px solid rgba(94, 59, 197, .14);
  border-radius: 999px;
  background: #f6f7fc;
  gap: 3px;
}

.status-toggle-option {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
  font-weight: 820;
}

.status-toggle-option.active.planned {
  color: var(--blue);
  background: var(--blue-bg);
  box-shadow: inset 0 0 0 1px var(--blue-border);
}

.status-toggle-option.active.taken {
  color: var(--green);
  background: #eefaf4;
  box-shadow: inset 0 0 0 1px #cfebdd;
}

.history-card-surface {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(94, 59, 197, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(58, 31, 138, .06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  transform: translateX(0);
}

.history-meal-card:not(.swiped) .history-delete-rail {
  visibility: hidden;
}

.history-card-surface.is-swiping {
  transition: none;
}

.history-meal-card.expanded .history-card-surface {
  border-color: rgba(94, 59, 197, .34);
  box-shadow: 0 14px 32px rgba(58, 31, 138, .10);
}

.history-meal-card.swiped .history-card-surface {
  transform: translateX(-104px);
}

.history-delete-rail {
  position: absolute;
  inset: 0 0 0 auto;
  width: 104px;
  border: 0;
  border-radius: 0 18px 18px 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #f15656 0%, #e04444 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 820;
}

.history-delete-rail svg {
  width: 24px;
  height: 24px;
}

.history-meal-head {
  position: relative;
  display: block;
}

.history-meal-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  text-align: left;
}

.history-card-actions {
  position: absolute;
  top: 10px;
  z-index: 2;
  display: grid;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.history-card-actions.manage-actions {
  right: 10px;
  transform: translateX(18px);
}

.history-meal-card.expanded .history-card-actions,
.history-meal-card:hover .history-card-actions,
.history-meal-card:focus-within .history-card-actions {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.history-action-btn {
  min-width: 72px;
  height: 32px;
  border: 1px solid rgba(94, 59, 197, .16);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fff;
  color: var(--purple);
  font-size: 11px;
  font-weight: 820;
  box-shadow: 0 3px 10px rgba(58, 31, 138, .05);
}

.history-action-btn svg {
  width: 16px;
  height: 16px;
}

.history-action-btn:disabled {
  opacity: .34;
  cursor: not-allowed;
}

.history-action-btn.danger {
  color: var(--red);
  border-color: rgba(180, 35, 24, .2);
  background: #fff8f8;
}

.history-action-btn.reorder {
  color: #6e6598;
  display: none;
}

.history-action-btn .grip-dots {
  width: 14px;
  height: 18px;
  background-image: radial-gradient(currentColor 1.6px, transparent 1.7px);
  background-size: 7px 7px;
  background-position: 0 0;
}

.history-meal-card.expanded .history-meal-summary {
  align-items: start;
  padding-bottom: 9px;
}

.history-food-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: linear-gradient(180deg, #f4f0ff 0%, #eee8fb 100%);
  border: 1px solid rgba(94, 59, 197, .13);
  flex: 0 0 auto;
}

.history-food-icon svg {
  width: 32px;
  height: 32px;
}

.history-meal-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.history-meal-title {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 830;
  overflow-wrap: anywhere;
}

.history-meal-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 620;
}

.history-meal-meta .dot {
  color: var(--purple);
  margin: 0 5px;
}

.history-meal-side {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.history-expand-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.history-meal-card.expanded .history-expand-icon {
  transform: rotate(180deg);
}

.history-meal-details {
  padding: 0 12px 13px;
}

.history-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-metric-tile {
  min-width: 0;
  min-height: 70px;
  border-radius: 13px;
  border: 1px solid rgba(94, 59, 197, .12);
  background: linear-gradient(180deg, #fbfaff 0%, #f6f7fc 100%);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 8px;
}

.history-metric-icon {
  display: grid;
  place-items: center;
}

.history-metric-icon svg {
  width: 28px;
  height: 28px;
}

.history-metric-label {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.history-metric-tile b {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.05;
  font-weight: 830;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.history-serving-panel {
  margin-top: 10px;
  border: 1px solid rgba(94, 59, 197, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  padding: 10px 11px;
}

.history-serving-panel b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
}

.history-callout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(94, 59, 197, .14) 0%, rgba(94, 59, 197, .06) 100%);
}

.history-callout-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(180deg, #6f4adb 0%, var(--purple) 100%);
}

.history-callout-icon svg {
  width: 22px;
  height: 22px;
}

.history-callout p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 540;
}

.component-list {
  display: grid;
  gap: 8px;
  max-height: min(58dvh, 520px);
  overflow-y: auto;
  padding-right: 2px;
}

.component-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  align-items: center;
}

.component-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.impact-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.component-control {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.component-control output {
  color: var(--ink);
  font-weight: 780;
  text-align: right;
  font-size: 13px;
}

.component-range {
  min-width: 0;
}

@media (max-width: 520px) {
  .component-row {
    grid-template-columns: 1fr;
  }
  .component-control {
    grid-template-columns: 52px minmax(0, 1fr);
  }
}

.stepper {
  display: grid;
  grid-template-columns: 32px 38px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  flex: 0 0 auto;
}

.stepper button {
  min-height: 30px;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-weight: 780;
}

.stepper output {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-inline: 1px solid var(--line);
  color: var(--ink);
  font-weight: 760;
}

.chip-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 7px 0 2px;
}

.chip-list::-webkit-scrollbar { display: none; }
.chip.small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
}

.daily-insight {
  border-left: 4px solid #27a57a;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  background: #f0faf6;
}

.upgrade-card {
  display: grid;
  gap: 4px;
  background: #fff8ec;
  border-color: #efd5aa;
  color: #653b04;
  font-size: 13px;
  line-height: 1.4;
}

.slider-row,
.form-row,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-row {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.slider-row label,
.form-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.slider-row output {
  color: var(--ink);
  font-weight: 780;
  font-size: 13px;
}

.range {
  width: 100%;
  accent-color: var(--purple);
}

.mini-select {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 5px 8px;
  max-width: 190px;
}

.preview-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.toggle-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 8px;
}

.toggle-line input {
  margin-top: 2px;
  accent-color: var(--purple);
}

.review-details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.review-details summary {
  color: var(--purple-dark);
  font-weight: 760;
  cursor: pointer;
}

.hidden-controls {
  margin-top: 6px;
}

.primary-action,
.secondary-action {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 760;
  border: 1px solid transparent;
}

.primary-action {
  color: #fff;
  background: var(--purple);
}

.primary-action:disabled {
  opacity: .72;
  cursor: default;
}

.secondary-action {
  color: var(--purple-dark);
  border-color: #d3c7f7;
  background: var(--purple-soft);
}

.drawer {
  position: fixed;
  inset: auto 0 0 0;
  max-width: 860px;
  max-height: min(86dvh, 720px);
  overflow-y: auto;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px 16px calc(16px + var(--safe-bottom));
  transform: translateY(110%);
  transition: transform .24s ease;
  z-index: 10;
}
.drawer.open { transform: translateY(0); }
.drawer-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.drawer-title { color: var(--ink); font-weight: 780; font-size: 17px; }
.settings-grid { display: grid; gap: 10px; }
.field label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 6px;
}
.select, .text-field {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
}

.hidden { display: none !important; }

@media (min-width: 760px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .chat,
  .screen-view { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-icon,
  .round-nav-btn {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .launch-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    gap: 0;
    width: 100%;
    max-width: 100%;
  }

  .launch-mascot {
    width: 70px;
    max-width: none;
    grid-column: 1 / 2;
    grid-row: 1;
    justify-self: start;
    align-self: start;
    margin-right: 0;
    margin-top: 10px;
  }

  .launch-card {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    padding: 20px 16px 18px 64px;
    border-radius: 18px;
  }

  .launch-card h2 {
    font-size: 22px;
  }

  .launch-body {
    margin-top: 14px !important;
    font-size: 14px !important;
  }

  .status-chip {
    min-width: 0;
    padding-inline: 8px;
  }

  .app-footer {
    padding-left: 10px;
    padding-right: 10px;
  }

  .composer-inner {
    gap: 7px;
  }

  .icon-btn,
  .send-btn {
    width: 40px;
    height: 40px;
  }

  .facts,
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .focus-grid { grid-template-columns: 1fr; }
  .action-row { align-items: stretch; gap: 8px; }
  .primary-action,
  .secondary-action { flex: 1 1 calc(50% - 8px); padding-inline: 10px; }
}
