@import "tailwindcss";

:root {
  --paper: #f7f4eb;
  --ink: #30243d;
  --muted: #706679;
  --line: #ded9d0;
  --purple: #68429a;
  --mint: #dceee2;
  --yellow: #f7dc70;
  --peach: #f8dfcc;
  --lavender: #e9e1f4;
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, input[type="submit"], a { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 8vw, 3.7rem); line-height: 1.04; letter-spacing: -.055em; font-weight: 800; }
h2 { font-size: 1.35rem; line-height: 1.2; font-weight: 750; letter-spacing: -.035em; }
h3 { font-size: 1rem; font-weight: 750; }
.site-header { max-width: 960px; margin: auto; padding: 24px 24px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.65rem; font-weight: 850; letter-spacing: -.06em; line-height: 1; }
.brand-mark { display: grid; place-items: center; background: var(--ink); color: var(--yellow); border-radius: 13px; width: 43px; height: 43px; font-size: 36px; }
.brand-subtitle { display: block; font-size: .58rem; letter-spacing: .22em; margin-top: 6px; font-weight: 700; }
.header-note { font-size: .8rem; color: var(--muted); }
.header-note span { color: var(--purple); font-size: 1.2rem; }
.app-shell { max-width: 960px; padding: 20px 24px 125px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.eyebrow { font-size: .64rem; letter-spacing: .15em; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.heading-accent { color: var(--purple); }
.sun-sticker { display: grid; place-items: center; width: 92px; height: 92px; flex-shrink: 0; color: var(--ink); background: var(--yellow); border: 1px solid var(--ink); border-radius: 50%; font-size: 4.4rem; transform: rotate(12deg); box-shadow: 4px 4px 0 var(--ink); }
.date-switcher { display: flex; align-items: center; justify-content: space-between; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: #fffaf3; margin-bottom: 24px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: white; border: 1px solid var(--line); font-size: 1.2rem; text-decoration: none; }
.date-label { display: flex; gap: 10px; align-items: baseline; }
.date-label strong { font-size: .95rem; }
.date-label time { color: var(--muted); font-size: .85rem; }
.today-link { display: block; width: fit-content; margin: -12px auto 20px; color: var(--purple); font-size: .85rem; padding: 8px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.small-label { color: var(--muted); font-size: .75rem; }
.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.macro-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px; border: 1px solid rgb(48 36 61 / .1); border-radius: 20px; }
.macro-energy { background: var(--yellow); }
.macro-protein { background: var(--lavender); }
.macro-carbs { background: var(--mint); }
.macro-fat { background: var(--peach); }
.macro-symbol { font-size: .7rem; font-weight: 850; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .5); margin-bottom: 16px; }
.macro-value { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1; font-weight: 800; letter-spacing: -.045em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.macro-value small { font-size: .7rem; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.macro-name { font-size: .8rem; font-weight: 700; margin-top: 9px; }
.macro-note { font-size: .6rem; margin-top: 3px; color: #5b4d35; }
.summary-note { margin-top: 10px; font-size: .75rem; color: var(--muted); }
.quick-links { display: flex; gap: 8px; margin: 22px 0 26px; }
.quick-links a { flex: 1; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 700; text-decoration: none; background: #fffaf3; }
.dashboard-columns { display: grid; grid-template-columns: 1.15fr 1fr; align-items: start; gap: 20px; }
.side-panels { display: grid; gap: 20px; min-width: 0; }
.panel { background: #fffefa; border: 1px solid var(--line); border-radius: 24px; padding: 24px; min-width: 0; scroll-margin-top: 20px; box-shadow: 0 3px 0 rgb(48 36 61 / .035); }
.panel .eyebrow { margin-bottom: 6px; font-size: .59rem; }
.section-symbol { font-size: 2rem; color: var(--purple); }
.section-description { color: var(--muted); font-size: .85rem; margin-top: -6px; margin-bottom: 20px; line-height: 1.5; }
.entry-form { display: grid; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { min-width: 0; }
label { display: block; font-size: .77rem; font-weight: 700; margin-bottom: 7px; }
input:not([type="submit"]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), textarea, select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #cec7d0; border-radius: 12px; padding: 11px 12px; color: var(--ink); background: white; font-size: 16px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #817888; opacity: 1; }
input[type="file"] { font-size: .75rem !important; padding: 8px !important; }
input[type="file"]::file-selector-button { background: var(--lavender); color: var(--ink); border: 0; border-radius: 7px; font-weight: 700; padding: 8px; margin-right: 8px; cursor: pointer; }
.button, input[type="submit"], button { min-height: 48px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid transparent; font-size: .9rem; font-weight: 750; cursor: pointer; text-align: center; }
.button-primary, input[type="submit"] { background: var(--purple); color: white; }
.button-secondary { background: var(--ink) !important; color: white; }
.food-journal { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.food-journal .section-heading { margin-bottom: 8px; }
.count-badge { display: grid; place-items: center; min-width: 26px; height: 26px; background: var(--paper); border-radius: 8px; font-size: .75rem; font-weight: 700; }
.food-list { list-style: none; margin: 0; padding: 0; }
.food-item { padding: 15px 0; border-bottom: 1px solid var(--line); }
.food-item:last-child { border: 0; padding-bottom: 0; }
.food-item-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.food-name { font-size: .9rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.meal-tag { background: var(--mint); border-radius: 6px; padding: 3px 7px; font-size: .6rem; overflow-wrap: anywhere; max-width: 45%; }
.food-macros { display: flex; flex-wrap: wrap; gap: 10px; font-size: .7rem; color: var(--muted); margin-top: 7px; }
.food-macros b { color: var(--purple); }
.empty-state { text-align: center; padding: 24px 4px 8px; font-size: .9rem; font-weight: 650; }
.empty-state > span { display: block; color: var(--purple); font-size: 2.4rem; margin-bottom: 8px; }
.empty-state small { font-weight: 400; font-size: .78rem; color: var(--muted); display: inline-block; margin-top: 6px; line-height: 1.5; }
.weight-list { margin: 16px 0 0; padding: 0; list-style: none; }
.weight-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: .8rem; }
.weight-list span { color: var(--muted); }
.weight-list a { font-weight: 750; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
figure { margin: 0; min-width: 0; }
.progress-image { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
figcaption { font-size: .7rem; color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.comparison { border-top: 1px dashed var(--line); margin-top: 24px; padding-top: 20px; }
.photo-placeholder { aspect-ratio: 3 / 4; border: 1px dashed #bfb5c7; border-radius: 12px; display: grid; place-content: center; text-align: center; font-size: .75rem; color: var(--muted); background: var(--paper); padding: 8px; }
.page-footer { text-align: center; font-size: .75rem; color: var(--muted); padding: 32px 0 0; }
.page-footer span { color: var(--purple); margin-left: 4px; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 600px); display: grid; grid-template-columns: repeat(4, 1fr); padding: 9px 14px max(10px, env(safe-area-inset-bottom)); background: #fffefa; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 30px rgb(48 36 61 / .06); z-index: 10; }
.nav-item { min-height: 54px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border-radius: 14px; font-size: .65rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.nav-icon { font-size: 1.4rem; line-height: 1.2; }
.nav-item.is-active { background: var(--lavender); color: #56327f; }
.flash { padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; font-size: .85rem; line-height: 1.5; }
.flash-success { background: var(--mint); color: #285b3c; }
.flash-error { background: #ffe4e0; color: #8f2424; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 20; background: var(--ink); color: white; padding: 12px; border-radius: 8px; }
.skip-link:focus { top: 10px; }
/* Shared treatment for the history, detail, and edit screens. */
.journal-page { max-width: 720px; }
.journal-page h1 { font-size: 2.25rem; margin: 10px 0 26px; }
.journal-page p { line-height: 1.6; overflow-wrap: anywhere; }
.journal-page a:not(.button) { color: var(--purple); display: inline-block; padding-top: 10px; padding-bottom: 10px; font-size: .9rem; font-weight: 600; }
.journal-page form:not(.button_to) { display: grid; gap: 18px; background: #fffefa; border: 1px solid var(--line); padding: 22px; border-radius: 22px; margin-bottom: 18px; }
.journal-page form input[type="submit"] { width: 100%; }
.journal-page div[id^="food_log_"], .journal-page div[id^="weight_entry_"], .journal-page div[id^="progress_photo_"] { background: #fffefa; border: 1px solid var(--line); padding: 20px; border-radius: 18px; display: grid; gap: 8px; margin: 14px 0 0; }
.journal-page [id^="food_log_"] strong, .journal-page [id^="weight_entry_"] strong, .journal-page [id^="progress_photo_"] strong { color: var(--muted); font-size: .8rem; }
.journal-page img { max-width: 100%; height: auto; border-radius: 12px; }
.journal-page .button_to button { background: #fbe4e0; color: #8f2424; margin-top: 14px; }
.journal-page p[style="color: green"] { display: none; }
.field_with_errors input { border-color: #a13333 !important; }
@media (hover: hover) {
  .button:hover, input[type="submit"]:hover { filter: brightness(1.1); }
  .quick-links a:hover, .icon-button:hover { background: var(--lavender); }
  .food-name:hover { text-decoration: underline; }
  .nav-item:hover { background: var(--paper); }
}
@media (max-width: 640px) {
  .site-header { padding: 20px 20px 12px; }
  .header-note { display: none; }
  .app-shell { padding: 20px 16px calc(115px + env(safe-area-inset-bottom)); }
  .page-heading { padding: 0 4px; margin-bottom: 24px; }
  .sun-sticker { width: 68px; height: 68px; font-size: 3.3rem; margin-right: 6px; box-shadow: 3px 3px 0 var(--ink); }
  .macro-grid { gap: 7px; }
  .macro-card { padding: 12px 9px; border-radius: 16px; }
  .macro-value { font-size: 1.55rem; }
  .macro-value small { display: block; margin: 5px 0 0; font-size: .65rem; }
  .macro-symbol { margin-bottom: 12px; width: 23px; height: 23px; }
  .macro-name { font-size: .7rem; }
  .macro-note { font-size: .53rem; }
  .date-label { flex-direction: column; align-items: center; gap: 2px; }
  .date-label time { font-size: .75rem; }
  .dashboard-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side-panels { gap: 16px; }
  .panel { padding: 20px; border-radius: 22px; }
  .section-heading h2 { font-size: 1.22rem; }
  .small-label { font-size: .68rem; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .button, .quick-links a, .nav-item, .icon-button { transition: background-color .15s, filter .15s; }
}
