:root {
  color-scheme: dark;
  --ink: #0b0a09;
  --coal: #161412;
  --slate: #211e1b;
  --slate-raised: #28241f;
  --line: #2b2723;
  --line-soft: rgba(243, 239, 230, 0.075);
  --paper: #f3efe6;
  --paper-bright: #fff7df;
  --fog: #a39c8f;
  --dim: #918a7d;
  --gold: #c8a75f;
  --gold-soft: #e0c784;
  --gold-dim: #8a7442;
  --blue: #829ab7;
  --sage: #819b83;
  --rust: #bd7968;
  --sand: #c1a36d;
  --danger: #e3917d;
  --success: #90a77b;
  --radius-lg: 24px;
  --radius-md: 17px;
  --content: 1280px;
  --mobile-nav-height: 66px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(720px 420px at 50% -130px, rgba(200, 167, 95, 0.12), transparent 72%),
    radial-gradient(620px 420px at 100% 108%, rgba(200, 167, 95, 0.045), transparent 70%),
    var(--ink);
  color: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
label[for] {
  -webkit-user-select: none;
  user-select: none;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden],
.hidden {
  display: none !important;
}

::selection {
  background: rgba(200, 167, 95, 0.32);
}

:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line);
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-150%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-stage {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 66px;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 10, 9, 0.7);
  backdrop-filter: blur(30px) saturate(1.35);
  -webkit-backdrop-filter: blur(30px) saturate(1.35);
}

.wordmark {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 11px;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(243, 239, 230, 0.1);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(243, 239, 230, 0.11), rgba(243, 239, 230, 0.025));
  color: var(--gold);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-capsule {
  position: relative;
  display: grid;
  width: 302px;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(243, 239, 230, 0.08);
  border-radius: 999px;
  background: rgba(31, 28, 24, 0.66);
  box-shadow: inset 0 1px 0 rgba(243, 239, 230, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.root-tab {
  position: relative;
  z-index: 2;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease;
}

.root-tab:hover {
  color: var(--fog);
}

.root-tab.active {
  color: var(--gold-soft);
}

.nav-indicator {
  position: absolute;
  z-index: 1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 12px) / 3);
  border: 1px solid rgba(243, 239, 230, 0.09);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(243, 239, 230, 0.11), rgba(243, 239, 230, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 380ms cubic-bezier(0.2, 0.9, 0.24, 1);
}

.desktop-root-nav[data-active-root="journal"] .nav-indicator {
  transform: translateX(calc(100% + 2px));
}

.desktop-root-nav[data-active-root="work"] .nav-indicator {
  transform: translateX(calc(200% + 4px));
}

.privacy-state {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 12px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(144, 167, 123, 0.08);
}

.app-main {
  width: min(var(--content), calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 100px;
}

.root-surface {
  animation: surface-in 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

.app-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 15px 17px;
  border: 1px solid rgba(227, 145, 125, 0.28);
  border-radius: var(--radius-md);
  background: rgba(97, 48, 38, 0.2);
  color: var(--paper);
}

.app-alert div {
  display: grid;
  gap: 4px;
}

.app-alert span {
  color: #c9a59c;
  font-size: 13px;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.19em;
  line-height: 1.3;
  text-transform: uppercase;
}

.page-hero h1 {
  max-width: 820px;
  margin: 11px 0 14px;
  color: var(--paper-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 6vw, 78px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.lede,
.view-heading p {
  margin: 0;
  color: var(--fog);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(243, 239, 230, 0.09);
  border-radius: 13px;
  background: rgba(34, 31, 27, 0.78);
  color: var(--paper);
  font-size: 13px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}

.button svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:hover:not(:disabled) {
  border-color: rgba(243, 239, 230, 0.16);
  background: rgba(42, 38, 33, 0.9);
}

.button:active:not(:disabled),
.icon-button:active:not(:disabled) {
  transform: scale(0.975);
}

.button.primary {
  border-color: rgba(224, 199, 132, 0.25);
  background: var(--gold);
  color: #17120a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 28px rgba(138, 116, 66, 0.16);
}

.button.primary:hover:not(:disabled) {
  background: var(--gold-soft);
}

.button.quiet {
  background: rgba(27, 24, 21, 0.6);
}

.button.small {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.button:disabled {
  opacity: 0.42;
}

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

.section-tabs {
  display: flex;
  width: max-content;
  gap: 4px;
  margin: 46px 0 22px;
  padding: 4px;
  scroll-margin-top: 82px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(24, 21, 18, 0.5);
}

.section-tab {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.section-tab:hover {
  color: var(--fog);
}

.section-tab.active {
  border-color: rgba(243, 239, 230, 0.08);
  background: rgba(243, 239, 230, 0.075);
  color: var(--gold-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.health-view {
  animation: view-in 220ms ease both;
}

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

.status-ribbon {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(22, 20, 18, 0.54);
  color: var(--fog);
  font-size: 12px;
}

.status-orb {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(144, 167, 123, 0.08);
}

.status-orb.loading {
  background: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}

.status-orb.offline {
  background: var(--dim);
  box-shadow: 0 0 0 5px rgba(129, 121, 108, 0.08);
}

@keyframes pulse {
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

.metric-card,
.panel,
.insight-strip,
.honest-placeholder {
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(243, 239, 230, 0.025), transparent 1px),
    rgba(22, 20, 18, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 18px 50px rgba(0, 0, 0, 0.14);
}

.metric-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 19px;
  border-radius: var(--radius-md);
}

.metric-card::after {
  position: absolute;
  right: -22px;
  bottom: -50px;
  width: 110px;
  height: 110px;
  border-radius: 99px;
  background: var(--tone, var(--gold));
  content: "";
  filter: blur(52px);
  opacity: 0.1;
}

.metric-label,
.health-metric-label {
  color: var(--fog);
  font-size: 12px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 17px;
  color: var(--paper-bright);
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.metric-goal {
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

.progress {
  height: 4px;
  margin-top: 17px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(243, 239, 230, 0.075);
}

.progress i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--tone, var(--gold));
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overview-grid,
.nutrition-grid,
.chart-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
}

.nutrition-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
}

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

.panel {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.view-heading h2,
.honest-placeholder h2 {
  margin: 5px 0 0;
  color: var(--paper);
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 4px 0;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
}

.text-button:hover {
  color: var(--gold-soft);
}

.timeline {
  min-height: 390px;
  margin-top: 13px;
}

.timeline.compact {
  min-height: 250px;
  max-height: 380px;
  overflow: auto;
}

.entry {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.entry:first-child {
  border-top: 0;
}

.entry-time {
  color: var(--dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.entry-copy h3 {
  overflow: hidden;
  margin: 0 0 5px;
  color: var(--paper);
  font-size: 13px;
  font-weight: 580;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-copy p {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
}

.entry-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-calories {
  color: var(--paper);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.entry-calories small {
  margin-left: 3px;
  color: var(--dim);
  font-size: 8px;
  font-weight: 500;
}

.delete-entry {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 130ms ease, color 130ms ease, background 130ms ease;
}

.entry:hover .delete-entry,
.delete-entry:focus-visible {
  opacity: 1;
}

.delete-entry:hover {
  background: rgba(227, 145, 125, 0.08);
  color: var(--danger);
}

.delete-entry svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.snapshot-metric {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(243, 239, 230, 0.055);
  border-radius: 13px;
  background: rgba(243, 239, 230, 0.025);
}

.snapshot-metric span {
  display: block;
  overflow: hidden;
  color: var(--dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--paper);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.snapshot-metric small {
  margin-left: 2px;
  color: var(--dim);
  font-size: 10px;
}

.mini-chart {
  min-height: 126px;
  margin-top: 12px;
}

.mini-chart .line-chart-svg {
  height: 104px;
}

.mini-chart .chart-range {
  display: none;
}

.insight-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
}

.insight-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(200, 167, 95, 0.18);
  border-radius: 12px;
  background: rgba(200, 167, 95, 0.08);
  color: var(--gold);
}

.insight-strip strong {
  display: block;
  margin-top: 4px;
  color: #d8d2c4;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.5;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 4px 0 20px;
}

.view-heading h2 {
  margin: 7px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
}

.date-control {
  display: grid;
  gap: 7px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.field {
  width: 100%;
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid rgba(243, 239, 230, 0.09);
  border-radius: 13px;
  outline: none;
  background: rgba(38, 34, 30, 0.86);
  color: var(--paper);
  font-size: 14px;
  transition: border-color 150ms ease, background 150ms ease;
}

.field:focus {
  border-color: rgba(200, 167, 95, 0.5);
  background: rgba(42, 38, 33, 0.96);
  box-shadow: 0 0 0 3px rgba(200, 167, 95, 0.08);
}

.field::placeholder {
  color: #8d8578;
}

input[type="date"] {
  color-scheme: dark;
}

.bar-chart {
  display: flex;
  height: 330px;
  align-items: flex-end;
  gap: clamp(3px, 0.6vw, 8px);
  padding-top: 38px;
}

.bar {
  position: relative;
  flex: 1;
  min-width: 4px;
  border: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, var(--gold-dim), var(--gold-soft));
  opacity: 0.68;
  transition: opacity 120ms ease, filter 120ms ease;
}

.bar:hover,
.bar:focus-visible {
  opacity: 1;
  filter: brightness(1.1);
}

.bar::after {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 8px);
  left: 50%;
  display: none;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100f0d;
  color: var(--paper);
  content: attr(data-tip);
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.bar:hover::after,
.bar:focus-visible::after {
  display: block;
}

.health-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.health-metric {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(22, 20, 18, 0.8);
}

.health-metric::after {
  position: absolute;
  right: -18px;
  bottom: -48px;
  width: 90px;
  height: 90px;
  border-radius: 99px;
  background: var(--tone, var(--gold));
  content: "";
  filter: blur(45px);
  opacity: 0.12;
}

.health-metric-value {
  display: block;
  margin-top: 15px;
  color: var(--paper-bright);
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  letter-spacing: -0.035em;
}

.health-metric-value small {
  margin-left: 3px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 500;
}

.health-average {
  margin-top: 10px;
  color: var(--dim);
  font-size: 10px;
}

.freshness {
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(243, 239, 230, 0.025);
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

.chart-panel {
  min-height: 330px;
}

.chart-panel.wide {
  grid-column: 1 / -1;
}

.chart-heading {
  align-items: flex-start;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--dim);
  font-size: 10px;
}

.legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 99px;
  background: var(--legend);
  content: "";
}

.line-chart {
  min-height: 236px;
  margin-top: 13px;
}

.line-chart-svg {
  display: block;
  width: 100%;
  height: 205px;
  overflow: visible;
}

.line-chart-svg .chart-grid line {
  stroke: rgba(243, 239, 230, 0.07);
  stroke-width: 1;
}

.line-chart-svg .chart-series {
  fill: none;
  stroke: var(--series);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--series) 24%, transparent));
}

.line-chart-svg .chart-point {
  fill: var(--coal);
  stroke: var(--series);
  stroke-width: 3;
}

.chart-range {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: var(--dim);
  font-size: 9px;
}

.correlation {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--line-soft);
}

.correlation:first-child {
  border-top: 0;
}

.correlation-score {
  min-width: 54px;
  color: var(--gold-soft);
  font-size: 23px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.correlation-copy strong {
  display: block;
  color: var(--paper);
  font-size: 12px;
}

.correlation-copy span,
.correlation-days {
  color: var(--dim);
  font-size: 10px;
}

.connections-panel {
  margin-top: 14px;
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-top: 10px;
}

.integration {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.integration-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(243, 239, 230, 0.07);
  border-radius: 13px;
  background: rgba(243, 239, 230, 0.035);
  color: var(--paper);
  font-size: 18px;
  font-weight: 700;
}

.whoop-icon {
  color: #b4ca91;
}

.integration-copy h3 {
  margin: 0;
  color: var(--paper);
  font-size: 13px;
}

.integration-copy p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.45;
}

.connection-badge {
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  color: var(--dim);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 28px 16px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.small-empty {
  min-height: 130px;
}

.data-unavailable {
  width: 100%;
  min-height: 110px;
  grid-column: 1 / -1;
}

.loading-state {
  animation: soft-pulse 1.4s ease-in-out infinite;
}

.skeleton-card,
.mini-skeleton {
  overflow: hidden;
  background: rgba(31, 28, 25, 0.72);
}

.skeleton-card::before,
.mini-skeleton::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(243, 239, 230, 0.045) 50%, transparent 80%);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

.mini-skeleton {
  position: relative;
  min-height: 74px;
  border-radius: 13px;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes soft-pulse {
  50% { opacity: 0.52; }
}

.compact-hero {
  margin-bottom: 36px;
}

.honest-placeholder {
  max-width: 920px;
  padding: clamp(30px, 6vw, 72px);
  border-radius: 30px;
}

.placeholder-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(200, 167, 95, 0.18);
  border-radius: 18px;
  background: rgba(200, 167, 95, 0.07);
  color: var(--gold);
}

.placeholder-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.honest-placeholder h2 {
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 46px);
  font-style: italic;
  font-weight: 400;
}

.honest-placeholder > p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--fog);
  line-height: 1.7;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 38px;
}

.future-grid div {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(243, 239, 230, 0.025);
}

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

.future-grid strong {
  color: var(--paper);
  font-size: 12px;
}

.future-grid span {
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.mobile-root-nav,
.mobile-nav-feather {
  display: none;
}

/* Food logger */
.modal {
  width: min(720px, calc(100% - 28px));
  max-width: none;
  max-height: min(860px, calc(100dvh - 32px));
  padding: 0;
  border: 0;
  border-radius: 27px;
  outline: 0;
  background: transparent;
  color: var(--paper);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  max-height: min(860px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid rgba(243, 239, 230, 0.1);
  border-radius: 27px;
  background: rgba(22, 20, 18, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 28px 90px rgba(0, 0, 0, 0.62);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 21px 15px;
}

.modal-head strong {
  display: block;
  margin-top: 3px;
  font-size: 20px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(243, 239, 230, 0.035);
  color: var(--fog);
}

.logger-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin: 0 14px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(11, 10, 9, 0.5);
}

.logger-tabs button {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 11px;
  font-weight: 620;
}

.logger-tabs button.active {
  border-color: var(--line-soft);
  background: rgba(243, 239, 230, 0.075);
  color: var(--gold-soft);
}

.modal-body {
  max-height: calc(100dvh - 205px);
  overflow: auto;
}

.pane {
  padding: 23px;
}

.pane-intro {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 21px;
}

.pane-icon {
  display: grid;
  flex: 0 0 auto;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid rgba(200, 167, 95, 0.14);
  border-radius: 13px;
  background: rgba(200, 167, 95, 0.06);
  color: var(--gold);
  font-size: 18px;
}

.pane-intro h3 {
  margin: 0;
  font-size: 14px;
}

.pane-intro p {
  margin: 4px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

.field-label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--fog);
  font-size: 11px;
  font-weight: 600;
}

.field-label > span {
  color: var(--dim);
  font-weight: 400;
}

.search-field-wrap {
  position: relative;
}

.search-field-wrap svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--dim);
  stroke-linecap: round;
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.search-field-wrap .field {
  padding-left: 39px;
}

.results {
  margin-top: 13px;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.result:last-child {
  border-bottom: 0;
}

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

.result-copy strong {
  display: block;
  overflow: hidden;
  color: var(--paper);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy p {
  margin: 5px 0 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.result-warning {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.45;
}

.product-action {
  display: flex;
  align-items: center;
  gap: 7px;
}

.portion-field {
  width: 70px;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(243, 239, 230, 0.035);
  color: var(--paper);
  font-size: 12px;
  text-align: right;
}

.portion-unit {
  color: var(--dim);
  font-size: 10px;
}

.camera {
  width: 100%;
  margin: 14px 0;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  background: #050505;
  object-fit: cover;
}

.inline-status,
.modal-status {
  min-height: 18px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.45;
}

.inline-status {
  margin-top: 9px;
}

.modal-status {
  padding: 0 23px 13px;
}

.photo-drop {
  display: grid;
  min-height: 145px;
  place-items: center;
  align-content: center;
  gap: 6px;
  margin-bottom: 17px;
  padding: 25px;
  border: 1px dashed rgba(200, 167, 95, 0.28);
  border-radius: 17px;
  background: rgba(200, 167, 95, 0.03);
  color: var(--paper);
  cursor: pointer;
  text-align: center;
}

.photo-drop:hover {
  border-color: rgba(200, 167, 95, 0.48);
  background: rgba(200, 167, 95, 0.05);
}

.photo-drop svg {
  width: 27px;
  height: 27px;
  margin-bottom: 5px;
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.photo-drop strong {
  font-size: 13px;
}

.photo-drop span {
  color: var(--dim);
  font-size: 10px;
}

textarea.field {
  min-height: 98px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 10px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.error {
  color: var(--danger) !important;
}

.toast {
  position: fixed;
  z-index: 150;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 32px));
  padding: 12px 15px;
  border: 1px solid rgba(243, 239, 230, 0.11);
  border-radius: 13px;
  background: rgba(31, 28, 24, 0.96);
  color: var(--paper);
  font-size: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error-toast {
  border-color: rgba(227, 145, 125, 0.26);
}

/* Sign in and privacy */
.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(440px, 100%);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-style: italic;
}

.login-card {
  padding: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: rgba(22, 20, 18, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 28px 90px rgba(0, 0, 0, 0.34);
}

.login-card h1 {
  margin: 0;
  color: var(--paper-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 13px 0 0;
  color: var(--fog);
  font-size: 13px;
  line-height: 1.65;
}

.login-card form {
  display: grid;
  gap: 11px;
  margin-top: 25px;
}

.login-note {
  margin-top: 16px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.privacy {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 0 100px;
}

.privacy > .eyebrow {
  display: block;
  margin-top: 42px;
}

.privacy h1 {
  margin: 12px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 7vw, 62px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.045em;
}

.privacy h2 {
  margin: 36px 0 10px;
  color: var(--paper);
  font-size: 17px;
}

.privacy p,
.privacy li {
  color: var(--fog);
  line-height: 1.7;
}

.privacy a {
  color: var(--gold);
  text-underline-offset: 3px;
}

@media (max-width: 1100px) {
  .health-metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .overview-grid,
  .nutrition-grid {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    height: 230px;
  }
}

@media (max-width: 767px) {
  :root {
    --radius-lg: 20px;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    height: calc(55px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 18px 0;
  }

  .desktop-root-nav {
    display: none;
  }

  .wordmark {
    font-size: 20px;
  }

  .wordmark-mark {
    width: 31px;
    height: 31px;
    border-radius: 11px;
    font-size: 13px;
  }

  .privacy-state span:last-child {
    display: none;
  }

  .app-main {
    width: min(100% - 28px, 620px);
    padding: 32px 0 calc(var(--mobile-nav-height) + 48px + env(safe-area-inset-bottom));
  }

  .page-hero {
    display: block;
  }

  [data-root-surface="health"][data-active-health]:not([data-active-health="overview"]) > .page-hero {
    display: none;
  }

  [data-root-surface="health"][data-active-health]:not([data-active-health="overview"]) > .section-tabs {
    margin-top: 0;
  }

  .page-hero h1 {
    margin-top: 8px;
    font-size: clamp(39px, 12vw, 55px);
  }

  .lede {
    font-size: 13px;
    line-height: 1.58;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-actions .button {
    flex: 1;
  }

  .section-tabs {
    width: 100%;
    margin: 30px 0 16px;
  }

  .section-tab {
    flex: 1;
    padding: 0 10px;
  }

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

  .metric-card {
    min-height: 124px;
    padding: 16px;
  }

  .metric-value {
    margin-top: 13px;
    font-size: 25px;
  }

  .progress {
    margin-top: 14px;
  }

  .panel {
    padding: 18px;
  }

  .overview-grid,
  .nutrition-grid,
  .chart-grid {
    display: block;
  }

  .overview-grid > *,
  .nutrition-grid > *,
  .chart-grid > * {
    margin-top: 10px;
  }

  .overview-grid > :first-child,
  .nutrition-grid > :first-child,
  .chart-grid > :first-child {
    margin-top: 0;
  }

  .timeline.compact {
    min-height: 230px;
  }

  .delete-entry {
    opacity: 1;
  }

  .snapshot-metrics {
    gap: 6px;
  }

  .snapshot-metric {
    padding: 11px;
  }

  .snapshot-metric strong {
    font-size: 18px;
  }

  .insight-strip {
    align-items: flex-start;
  }

  .view-heading {
    display: block;
  }

  .view-heading h2 {
    font-size: 33px;
  }

  .date-control {
    margin-top: 18px;
  }

  .date-control .field {
    width: 100%;
  }

  .health-metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .health-metric {
    min-height: 119px;
    padding: 15px;
  }

  .health-metric-value {
    font-size: 23px;
  }

  .freshness {
    display: inline-flex;
    margin-top: 14px;
  }

  .chart-panel {
    min-height: 305px;
  }

  .chart-heading {
    display: block;
  }

  .legend {
    margin-top: 12px;
  }

  .line-chart {
    min-height: 214px;
  }

  .line-chart-svg {
    height: 184px;
  }

  .connections-grid {
    grid-template-columns: 1fr;
  }

  .integration:first-child {
    border-top: 0;
  }

  .compact-hero {
    margin-bottom: 24px;
  }

  .honest-placeholder {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .honest-placeholder h2 {
    font-size: 31px;
  }

  .future-grid {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .mobile-nav-feather {
    position: fixed;
    z-index: 38;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    height: calc(var(--mobile-nav-height) + 35px + env(safe-area-inset-bottom));
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.72) 55%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.72) 55%, transparent 100%);
  }

  .mobile-root-nav {
    position: fixed;
    z-index: 40;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 50%;
    display: grid;
    width: min(318px, calc(100vw - 30px));
    height: var(--mobile-nav-height);
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 4px;
    border: 1px solid rgba(243, 239, 230, 0.13);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(65, 60, 54, 0.62), rgba(28, 26, 23, 0.86)),
      rgba(22, 20, 18, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 14px 38px rgba(0, 0, 0, 0.48);
    transform: translateX(-50%);
    backdrop-filter: blur(46px) saturate(1.65);
    -webkit-backdrop-filter: blur(46px) saturate(1.65);
  }

  .mobile-root-nav::after {
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 12px) / 3);
    border: 1px solid rgba(243, 239, 230, 0.11);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(243, 239, 230, 0.14), rgba(243, 239, 230, 0.065));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 5px 18px rgba(0, 0, 0, 0.18);
    content: "";
    transition: transform 400ms cubic-bezier(0.2, 0.92, 0.24, 1);
  }

  .mobile-root-nav[data-active-root="journal"]::after {
    transform: translateX(calc(100% + 2px));
  }

  .mobile-root-nav[data-active-root="work"]::after {
    transform: translateX(calc(200% + 4px));
  }

  .mobile-root-tab {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--dim);
    font-size: 10px;
    font-weight: 550;
    transition: color 160ms ease, transform 120ms ease;
  }

  .mobile-root-tab:active {
    transform: scale(0.965);
  }

  .mobile-root-tab.active {
    color: var(--gold-soft);
  }

  .mobile-root-tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
  }

  .modal {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
    margin: auto auto 6px;
    border-radius: 25px;
  }

  .modal-card {
    max-height: calc(100dvh - 12px);
    border-radius: 25px;
  }

  .modal-body {
    max-height: calc(100dvh - 185px - env(safe-area-inset-bottom));
  }

  .logger-tabs {
    overflow-x: auto;
  }

  .logger-tabs button {
    min-width: 76px;
  }

  .pane {
    padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .result {
    grid-template-columns: 1fr;
  }

  .product-action {
    justify-content: flex-end;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast {
    right: auto;
    bottom: calc(var(--mobile-nav-height) + 24px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translate(-50%, 12px);
  }

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

  .login-card {
    padding: 29px 22px;
  }
}

@media (max-width: 390px) {
  .app-main {
    width: calc(100% - 22px);
  }

  .hero-actions {
    gap: 7px;
  }

  .button {
    padding-inline: 12px;
  }

  .metric-card {
    min-height: 118px;
    padding: 14px;
  }

  .metric-value {
    font-size: 23px;
  }

  .metric-goal {
    font-size: 10px;
  }

  .entry {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .entry-calories {
    font-size: 12px;
  }

  .snapshot-metric {
    padding: 9px;
  }

  .snapshot-metric strong {
    font-size: 16px;
  }

  .health-metric-grid {
    gap: 7px;
  }

  .health-metric {
    min-height: 113px;
    padding: 13px;
  }

  .health-metric-value {
    font-size: 21px;
  }

  .integration {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .integration-icon {
    width: 38px;
    height: 38px;
  }
}

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