:root {
  --ink: #171713;
  --ink-soft: #34342f;
  --mustard: #e1a400;
  --mustard-light: #f4cb58;
  --cream: #f4efe3;
  --paper: #fffdf8;
  --rust: #a8432d;
  --green: #2f6a4f;
  --red: #9e3f32;
  --line: #d8d0bf;
  --muted: #706b61;
  --shadow: 0 16px 40px rgba(23, 23, 19, .08);
  --radius: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.05; letter-spacing: -.035em; }
em { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.eyebrow { margin: 0 0 10px; font-size: .73rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.skip-link { position: fixed; left: 10px; top: -80px; padding: 10px 14px; z-index: 999; background: var(--ink); color: #fff; }
.skip-link:focus { top: 10px; }

.top-line { min-height: 30px; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 6px 18px; color: var(--paper); background: var(--ink); font-size: .68rem; letter-spacing: .13em; }
.top-line strong { color: var(--mustard-light); }
.site-header { height: 74px; max-width: var(--max); margin: 0 auto; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.03em; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.desktop-nav { display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 750; }
.desktop-nav a { padding: 9px 10px; border-radius: 6px; }
.desktop-nav a:hover, .desktop-nav a:focus-visible { background: rgba(225,164,0,.15); }
.desktop-nav .control-link { margin-left: 6px; background: var(--mustard); color: var(--ink); }
.mobile-menu { display: none; position: relative; }
.mobile-menu summary { cursor: pointer; list-style: none; padding: 9px 13px; border: 1px solid var(--ink); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.mobile-menu nav { position: absolute; right: 0; top: 48px; width: 220px; display: grid; z-index: 20; background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--shadow); }
.mobile-menu nav a { padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.messages { position: fixed; right: 18px; top: 90px; z-index: 50; width: min(380px, calc(100% - 36px)); }
.message { padding: 13px 16px; background: var(--ink); color: white; border-left: 6px solid var(--mustard); box-shadow: var(--shadow); }

.site-footer { max-width: var(--max); margin: 72px auto 0; padding: 34px 22px 28px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: center; }
.footer-main { display: flex; align-items: center; gap: 14px; }
.footer-main img { width: 54px; height: 54px; object-fit: contain; }
.footer-main strong { font-size: 1.05rem; }
.footer-main p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.footer-links { display: flex; gap: 18px; font-size: .78rem; font-weight: 800; }
.site-footer > small { grid-column: 1 / -1; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }

/* Homepage: a grown-up personal profile */
.profile-page { max-width: var(--max); margin: 0 auto; padding: 12px 22px 60px; }
.profile-thesis { display: grid; grid-template-columns: 1fr 280px; gap: 30px; align-items: end; padding: 30px 34px; background: var(--mustard); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.profile-thesis h1 { max-width: 780px; margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.profile-thesis h1 em { display: block; }
.profile-thesis > p { margin: 0; padding-left: 24px; border-left: 1px solid rgba(23,23,19,.45); font-weight: 700; }
.profile-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; margin-top: 26px; align-items: start; }
.profile-sidebar, .profile-main { display: grid; gap: 20px; }
.profile-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(23,23,19,.04); overflow: hidden; }
.profile-identity { padding: 18px; }
.profile-photo { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: var(--mustard); border: 1px solid var(--ink); }
.profile-photo img { width: 100%; height: 100%; object-fit: contain; }
.profile-name { padding: 17px 2px 14px; }
.profile-name h2 { margin: 0 0 6px; font-size: 1.65rem; }
.profile-name p { margin: 0; color: var(--muted); font-size: .85rem; }
.profile-status { padding: 14px; background: var(--ink); color: white; border-radius: 7px; }
.profile-status > span { display: block; margin-bottom: 6px; color: var(--mustard-light); font-size: .65rem; font-weight: 900; letter-spacing: .16em; }
.profile-status strong, .profile-status small { display: block; }
.profile-status strong { font-size: 1rem; }
.profile-status small { margin-top: 3px; color: #cbc8be; line-height: 1.4; }
.profile-about, .profile-numbers, .profile-vitals { padding: 18px; }
.card-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .67rem; font-weight: 900; letter-spacing: .14em; }
.card-heading a { color: var(--rust); letter-spacing: 0; }
.profile-about > p { margin: 0; color: var(--ink-soft); font-family: Georgia, 'Times New Roman', serif; font-size: .98rem; line-height: 1.65; }
.profile-numbers dl { margin: 0 0 14px; }
.profile-numbers dl div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.profile-numbers dt { color: var(--muted); font-size: .82rem; }
.profile-numbers dd { margin: 0; font-size: 1.15rem; font-weight: 900; }
.text-link { font-size: .78rem; font-weight: 850; color: var(--rust); }
.vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vital-grid div { padding: 11px; background: var(--cream); border-radius: 7px; }
.vital-grid strong, .vital-grid span { display: block; }
.vital-grid strong { font-size: 1.15rem; }
.vital-grid span { color: var(--muted); font-size: .67rem; }
.journey-intro { padding: 30px; }
.journey-intro h2 { margin-bottom: 12px; font-size: 2rem; }
.journey-intro > p:last-of-type { max-width: 760px; color: var(--ink-soft); font-family: Georgia, 'Times New Roman', serif; font-size: 1.06rem; line-height: 1.7; }
.profile-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.profile-shortcuts a { padding: 15px; border-right: 1px solid var(--line); background: var(--cream); }
.profile-shortcuts a:last-child { border-right: 0; }
.profile-shortcuts a:hover { background: var(--mustard); }
.profile-shortcuts b, .profile-shortcuts span { display: block; }
.profile-shortcuts b { margin-bottom: 3px; font-size: .84rem; }
.profile-shortcuts span { color: var(--muted); font-size: .67rem; line-height: 1.35; }
.profile-shortcuts a:hover span { color: var(--ink); }
.journey-feed { padding: 28px 30px; }
.section-title-row { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.section-title-row h2 { margin: 0; font-size: 2rem; }
.section-title-row > a { font-size: .75rem; font-weight: 850; color: var(--rust); }
.feed-item { padding: 24px 0 22px 18px; border-bottom: 1px solid var(--line); border-left: 5px solid var(--mustard); }
.feed-item.feed-essay { border-left-color: var(--rust); }
.feed-meta, .feed-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.feed-meta { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.feed-item h3 { margin: 10px 0 8px; font-size: 1.45rem; }
.feed-item h3 a:hover { color: var(--rust); }
.feed-item > p { margin-bottom: 12px; color: var(--ink-soft); }
.feed-footer { font-size: .72rem; font-weight: 800; }
.feed-footer > span { padding: 3px 8px; background: var(--cream); border-radius: 4px; }
.feed-footer a { color: var(--rust); }
.empty-profile { padding: 48px 10px 30px; text-align: center; }
.empty-profile strong { display: block; font-size: 2rem; }
.empty-profile p { color: var(--muted); }
.profile-feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-feature { padding: 20px; }
.profile-feature > img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; margin-bottom: 16px; border-radius: 6px; }
.profile-feature h3 { margin: 0 0 8px; font-size: 1.3rem; }
.profile-feature > p { color: var(--ink-soft); }
.profile-feature > small { color: var(--muted); }
.empty-mini { padding: 24px 4px; }
.empty-mini p { margin: 5px 0 0; color: var(--muted); }

/* Public content pages */
.page-hero { max-width: var(--max); margin: 10px auto 34px; padding: 54px 48px; border: 1px solid var(--ink); }
.page-hero h1 { max-width: 840px; margin: 0 0 18px; font-size: clamp(2.35rem, 5vw, 4rem); }
.page-hero > p:last-child { max-width: 680px; margin: 0; font-size: 1.02rem; }
.mustard-page { background: var(--mustard); }
.cream-page { background: var(--paper); }
.ink-page { background: var(--ink); color: var(--paper); }
.rust-page { background: var(--rust); color: white; }
.listing-wrap, .essay-list, .chart-section, .milestone-section, .photo-section { max-width: var(--max); margin: 0 auto; padding: 20px 22px 56px; }
.log-grid, .content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.log-card { display: grid; grid-template-columns: 82px 1fr; gap: 18px; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--mustard); border-radius: 8px; }
.status-border-no { border-left-color: var(--red); }
.status-border-rest { border-left-color: #547287; }
.status-border-yes { border-left-color: var(--green); }
.log-date { display: grid; justify-items: center; align-content: start; padding: 10px 6px; background: var(--ink); color: white; }
.log-date span, .log-date small { font-size: .65rem; letter-spacing: .12em; }
.log-date strong { line-height: 1; font-size: 2rem; }
.status-pill, .status-inline { display: inline-block; padding: 4px 7px; background: var(--cream); border-radius: 4px; font-size: .66rem; font-weight: 850; }
.log-card h2 { margin: 10px 0 7px; font-size: 1.35rem; }
.log-card p { color: var(--muted); }
.mini-metrics { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .64rem; }
.mini-metrics span { color: var(--muted); }
.mini-metrics b { color: var(--ink); }
.content-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.content-card > img, .card-placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-placeholder { display: grid; place-items: center; background: var(--mustard); font-weight: 900; font-size: 1.4rem; line-height: 1; text-align: center; }
.content-card-copy { padding: 22px; }
.tag { color: var(--rust); font-size: .66rem; font-weight: 900; letter-spacing: .08em; }
.content-card h2 { margin: 10px 0 8px; font-size: 1.5rem; }
.content-card p { color: var(--muted); }
.card-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); font-size: .63rem; font-weight: 800; }
.workout-list-card { display: grid; grid-template-columns: 100px 1fr; }
.workout-number { display: grid; place-items: center; min-height: 220px; background: var(--mustard); font-size: 2.6rem; font-weight: 900; }
.essay-list > article { display: grid; grid-template-columns: 70px 1fr 35px; gap: 22px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line); }
.essay-index { color: var(--mustard); font-size: 1.4rem; font-weight: 900; }
.essay-list h2 { margin: 6px 0 8px; font-size: 1.8rem; }
.essay-list article p:last-child { max-width: 700px; color: var(--muted); }
.essay-arrow { font-size: 1.4rem; }
.empty-state { grid-column: 1 / -1; padding: 54px 24px; text-align: center; background: var(--paper); border: 1px dashed var(--line); }
.empty-state strong { display: block; font-size: 1.35rem; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.pagination { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .8rem; }

.entry-page, .content-detail, .essay-detail { max-width: 980px; margin: 25px auto 0; padding: 0 22px 50px; }
.entry-header { display: grid; grid-template-columns: 110px 1fr; gap: 28px; align-items: center; padding: 34px 0; border-bottom: 2px solid var(--ink); }
.entry-date-block { display: grid; justify-items: center; padding: 14px 8px; color: white; background: var(--ink); }
.entry-date-block strong { font-size: 2.8rem; line-height: 1; }
.entry-date-block span, .entry-date-block small { font-size: .7rem; letter-spacing: .12em; }
.entry-header h1, .detail-header h1, .essay-detail header h1 { margin: 7px 0 12px; font-size: clamp(2.2rem, 5vw, 4rem); }
.entry-deck, .detail-header > p:last-child, .essay-detail header > p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 1.12rem; }
.entry-image, .detail-hero-image { width: 100%; max-height: 580px; object-fit: cover; margin: 30px 0; border-radius: 10px; }
.entry-metrics, .recipe-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 28px 0; border: 1px solid var(--line); background: var(--paper); }
.entry-metrics div, .recipe-facts div { padding: 18px; border-right: 1px solid var(--line); }
.entry-metrics div:last-child, .recipe-facts div:last-child { border-right: 0; }
.entry-metrics span, .recipe-facts span { display: block; color: var(--muted); font-size: .64rem; font-weight: 850; letter-spacing: .08em; }
.entry-metrics strong, .recipe-facts strong { display: block; margin-top: 5px; font-size: 1.05rem; }
.prose { max-width: 740px; margin: 34px auto; color: #292925; font-family: Georgia, 'Times New Roman', serif; font-size: 1.08rem; line-height: 1.82; }
.prose p { margin-bottom: 1.25em; }
.accounting-grid, .review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 34px 0; }
.accounting-grid > div, .review-grid > section { padding: 20px; background: var(--paper); border-top: 5px solid var(--mustard); }
.accounting-grid span, .review-grid .eyebrow { font-size: .65rem; font-weight: 900; letter-spacing: .1em; }
.accounting-bad { border-top-color: var(--rust) !important; }
.entry-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .8rem; font-weight: 800; }
.entry-nav a:last-child { text-align: right; }
.detail-header, .essay-detail > header { padding: 46px 0 30px; border-bottom: 2px solid var(--ink); }
.recipe-columns { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; margin: 36px 0; }
.recipe-columns section, .instruction-block, .personal-note, .review-grid > section { padding: 24px; background: var(--paper); border: 1px solid var(--line); }
.line-list p, .numbered-lines p { padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); }
.personal-note { margin: 34px 0; border-left: 7px solid var(--mustard); }
.personal-note small, .review-grid small { display: block; margin-top: 18px; color: var(--muted); }
.instruction-block { margin: 34px 0; }
.review-grid { grid-template-columns: 1fr 1fr; }
.verdict-banner { display: flex; justify-content: space-between; gap: 20px; padding: 20px 24px; background: var(--mustard); }
.verdict-banner span { font-size: .7rem; font-weight: 900; }
.essay-signoff { margin: 40px 0; font-size: 2.2rem; line-height: .95; }
.essay-signoff strong { color: var(--rust); }

/* Statistics */
.receipts-dashboard { max-width: var(--max); margin: 0 auto; padding: 0 22px 20px; display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; }
.receipt-stat { padding: 22px; background: var(--paper); border: 1px solid var(--line); }
.receipt-stat span { display: block; color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.receipt-stat strong { display: block; margin-top: 4px; font-size: 2.3rem; }
.receipt-stat.dark { background: var(--ink); color: white; }
.receipt-stat.dark p { margin: 8px 0 0; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 2rem; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chart-button { padding: 8px 12px; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 4px; font-size: .75rem; font-weight: 800; }
.chart-button.active { background: var(--ink); color: white; }
.chart-wrap { min-height: 360px; padding: 18px; background: var(--paper); border: 1px solid var(--line); }
.chart-wrap canvas { width: 100%; height: 330px; }
.milestone-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.milestone-list article { padding: 20px; background: var(--paper); border-top: 5px solid var(--mustard); }
.milestone-list time { color: var(--muted); font-size: .68rem; }
.milestone-list h3 { margin: 8px 0; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.photo-grid figure { margin: 0; background: var(--paper); border: 1px solid var(--line); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo-grid figcaption { padding: 14px; font-size: .8rem; }
.photo-grid figcaption strong { display: block; }

/* About */
.about-hero { max-width: var(--max); margin: 10px auto 0; padding: 42px 48px; display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: center; background: var(--mustard); border: 1px solid var(--ink); overflow: hidden; }
.about-hero h1 { margin: 0 0 16px; font-size: clamp(2.6rem, 5vw, 4.5rem); }
.about-hero > div > p:last-child { font-weight: 700; }
.about-hero img { width: 280px; height: 280px; object-fit: contain; }
.about-body { max-width: 980px; margin: 0 auto; padding: 55px 22px; display: grid; grid-template-columns: 180px 1fr; gap: 40px; }
.about-number { color: var(--mustard); font-size: 7rem; font-weight: 900; line-height: 1; }
.large-prose { margin: 0; }
.manifesto { max-width: var(--max); margin: 0 auto; padding: 48px; }
.dark-manifesto { background: var(--ink); color: white; }
.manifesto blockquote { max-width: 850px; margin: 0 0 24px; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.2; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 17px; border: 1px solid var(--ink); border-radius: 5px; font-size: .78rem; font-weight: 850; }
.button-dark { color: white; background: var(--ink); }
.button-mustard { color: var(--ink); background: var(--mustard); }
.button-outline { color: var(--ink); background: transparent; }

/* Control room */
.control-body { background: #ebe5d7; }
.control-shell, .editor-shell { max-width: var(--max); margin: 0 auto; padding: 24px 22px 60px; }
.control-header, .editor-header { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 24px; }
.control-header h1, .editor-header h1 { margin: 0 0 6px; font-size: clamp(2.2rem, 5vw, 4rem); }
.control-header > div > p:last-child { margin: 0; color: var(--muted); }
.control-account { display: flex; gap: 12px; align-items: center; font-size: .78rem; }
.control-account button { padding: 7px 10px; background: transparent; border: 1px solid var(--ink); }
.today-control { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 26px; background: var(--mustard); border: 2px solid var(--ink); }
.today-control h2 { margin: 0 0 7px; font-size: 1.8rem; }
.today-control p:last-child { margin: 0; }
.quick-create { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0; background: var(--ink); border: 1px solid var(--ink); gap: 1px; }
.quick-create a { min-height: 118px; padding: 17px; background: var(--paper); }
.quick-create a:hover { background: var(--mustard-light); }
.quick-create span, .quick-create b, .quick-create small { display: block; }
.quick-create span { color: var(--rust); font-size: .66rem; font-weight: 900; }
.quick-create b { margin: 8px 0 3px; }
.quick-create small { color: var(--muted); line-height: 1.35; }
.control-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.control-stats > div { padding: 18px; background: var(--paper); border: 1px solid var(--line); }
.control-stats span, .control-stats strong, .control-stats small { display: block; }
.control-stats span { color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .08em; }
.control-stats strong { font-size: 2rem; }
.control-stats small { color: var(--muted); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.control-panel { padding: 22px; background: var(--paper); border: 1px solid var(--line); }
.control-panel-wide { grid-column: 1 / -1; }
.panel-heading { display: flex; justify-content: space-between; gap: 18px; align-items: end; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.panel-heading h2 { margin: 0; }
.panel-heading > a { color: var(--rust); font-size: .75rem; font-weight: 850; }
.record-list > a { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: center; }
.record-list time { font-weight: 900; }
.record-list span b, .record-list span small, .compact-records span b, .compact-records span small { display: block; }
.record-list span small, .compact-records span small { color: var(--muted); }
.record-list em, .compact-records em { color: var(--muted); font-size: .67rem; font-style: normal; }
.compact-records > a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tools-panel > a { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); font-weight: 750; }
.empty-control { padding: 20px 0; color: var(--muted); }

.editor-header > a { font-size: .8rem; font-weight: 850; }
.content-editor, .daily-form { display: grid; gap: 18px; }
.editor-fields, .form-section { padding: 28px; background: var(--paper); border: 1px solid var(--line); }
.editor-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-fields .form-field:has(textarea), .editor-fields .form-field:has(input[type='file']), .editor-check { grid-column: 1 / -1; }
.form-section-heading { display: flex; gap: 14px; align-items: start; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.form-section-heading > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; background: var(--mustard); border-radius: 50%; font-weight: 900; }
.form-section-heading h2 { margin: 0; font-size: 1.55rem; }
.field-grid { display: grid; gap: 16px; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.field-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; margin-bottom: 6px; font-size: .75rem; font-weight: 850; }
.form-field input:not([type='checkbox']), .form-field select, .form-field textarea, .control-input:not([type='checkbox']) { width: 100%; padding: 11px 12px; color: var(--ink); background: white; border: 1px solid #aaa28f; border-radius: 5px; }
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field small { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
.form-section-dark { color: white; background: var(--ink); }
.form-section-dark .form-field small { color: #bbb7ac; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check-grid label, .editor-check { display: flex; gap: 11px; align-items: flex-start; padding: 16px; background: var(--cream); border: 1px solid var(--line); }
.check-grid input, .editor-check input { width: 19px; height: 19px; flex: 0 0 auto; }
.check-grid b, .check-grid small, .editor-check b, .editor-check small { display: block; }
.check-grid small, .editor-check small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 0; }
.form-errors, .field-error { color: #7b2117; background: #f7d7d1; border: 1px solid #c97769; padding: 10px 12px; }
.field-error { margin-top: 5px; padding: 5px 8px; font-size: .72rem; }

/* Login and 404 */
.login-page { max-width: 980px; margin: 30px auto; padding: 0 22px; display: grid; grid-template-columns: 1.2fr .8fr; box-shadow: var(--shadow); }
.login-brand { padding: 42px; background: var(--mustard); }
.login-brand img { width: 170px; margin-bottom: 26px; }
.login-brand h1 { font-size: 2.5rem; }
.login-form { padding: 42px; background: var(--paper); }
.login-form h2 { font-size: 2rem; }
.not-found { max-width: 720px; margin: 80px auto; padding: 42px; text-align: center; background: var(--paper); border: 1px solid var(--line); }
.not-found > span { display: block; color: var(--mustard); font-size: 5rem; font-weight: 900; }
.not-found h1 { font-size: 3rem; }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-menu { display: block; }
  .profile-thesis { grid-template-columns: 1fr; }
  .profile-thesis > p { padding: 15px 0 0; border-left: 0; border-top: 1px solid rgba(23,23,19,.45); }
  .profile-layout { grid-template-columns: 270px 1fr; }
  .profile-shortcuts { grid-template-columns: 1fr 1fr; }
  .profile-shortcuts a:nth-child(2) { border-right: 0; }
  .profile-shortcuts a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .quick-create, .control-stats { grid-template-columns: 1fr 1fr; }
  .field-grid.four { grid-template-columns: 1fr 1fr; }
  .about-hero { grid-template-columns: 1fr 240px; }
  .about-hero img { width: 230px; height: 230px; }
}

@media (max-width: 700px) {
  .top-line { justify-content: flex-start; overflow: hidden; white-space: nowrap; }
  .site-header { height: 64px; padding: 0 15px; }
  .brand img { width: 40px; height: 40px; }
  .profile-page { padding: 6px 12px 35px; }
  .profile-thesis { padding: 24px 20px; box-shadow: 5px 5px 0 var(--ink); }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-identity { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
  .profile-photo { grid-row: 1 / 3; }
  .profile-name { padding: 0; }
  .profile-status { align-self: stretch; }
  .profile-about, .profile-numbers, .profile-vitals { padding: 16px; }
  .journey-intro, .journey-feed { padding: 22px 18px; }
  .profile-feature-grid { grid-template-columns: 1fr; }
  .profile-shortcuts { grid-template-columns: 1fr 1fr; }
  .section-title-row { align-items: start; }
  .page-hero { margin: 4px 12px 24px; padding: 34px 24px; }
  .listing-wrap, .essay-list, .chart-section, .milestone-section, .photo-section { padding: 12px 12px 38px; }
  .log-grid, .content-grid { grid-template-columns: 1fr; }
  .workout-list-card { grid-template-columns: 70px 1fr; }
  .workout-number { min-height: 190px; font-size: 2rem; }
  .essay-list > article { grid-template-columns: 38px 1fr 20px; gap: 12px; }
  .entry-page, .content-detail, .essay-detail { padding: 0 14px 40px; }
  .entry-header { grid-template-columns: 78px 1fr; gap: 15px; }
  .entry-date-block strong { font-size: 2rem; }
  .accounting-grid, .review-grid, .recipe-columns { grid-template-columns: 1fr; }
  .entry-metrics div, .recipe-facts div { border-bottom: 1px solid var(--line); }
  .receipts-dashboard { grid-template-columns: 1fr 1fr; padding: 0 12px 15px; }
  .receipt-stat.dark { grid-column: 1 / -1; }
  .milestone-list, .photo-grid { grid-template-columns: 1fr; }
  .about-hero { margin: 4px 12px 0; padding: 30px 22px 0; grid-template-columns: 1fr; }
  .about-hero img { width: 210px; height: 210px; justify-self: center; }
  .about-body { grid-template-columns: 1fr; gap: 15px; padding: 36px 18px; }
  .about-number { font-size: 4.5rem; }
  .manifesto { margin: 0 12px; padding: 30px 22px; }
  .site-footer { margin-top: 42px; padding: 28px 16px; grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; }
  .control-shell, .editor-shell { padding: 18px 12px 40px; }
  .control-header, .editor-header { align-items: start; flex-direction: column; }
  .today-control { align-items: flex-start; flex-direction: column; }
  .quick-create, .control-stats, .control-grid { grid-template-columns: 1fr; }
  .control-panel-wide { grid-column: auto; }
  .quick-create a { min-height: 94px; }
  .record-list > a { grid-template-columns: 54px 1fr; }
  .record-list em { grid-column: 2; }
  .editor-fields, .form-section { padding: 20px 16px; }
  .editor-fields, .field-grid.three, .field-grid.four, .check-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .login-page { margin: 12px auto; grid-template-columns: 1fr; }
  .login-brand, .login-form { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
