@font-face {
  font-family: "PT Serif";
  src: url("/assets/fonts/pt-serif-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "PT Serif";
  src: url("/assets/fonts/pt-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --page: #f8f7f3;
  --paper: #fffefa;
  --ink: #282924;
  --muted: #65665d;
  --line: #dfdfd5;
  --forest: #252924;
  --forest-hover: #f0eee7;
  --green: #b94027;
  --green-strong: #97321c;
  --green-light: #fbede6;
  --serif: "PT Serif", Georgia, serif;
  --radius: 16px;
  --shadow: 0 2px 5px #37332604;
  --protein: #577555;
  --fat: #b37d34;
  --carbs: #b94c35;
  --rail: 218px;
}

body { font-variant-numeric: lining-nums; }
.boot-status { position: absolute; inset: 42% 0 auto; text-align: center; color: var(--muted); }
::selection { background: #f2c4ac; color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
.page-heading h1, .diary-heading h1 { font: 400 clamp(2.375rem, 3.5vw, 3.65rem)/1.12 var(--serif); letter-spacing: -.052em; }
.button { min-height: 44px; border-radius: 9px; letter-spacing: -.022em; }
.primary { background: var(--green); box-shadow: 0 2px 4px #62271318, inset 0 1px #ffffff25; }
.primary:hover { background: var(--green-strong); }
.secondary, .icon-button { background: var(--paper); border-color: var(--line); color: var(--ink); }
.secondary:hover, .icon-button:hover { background: var(--forest-hover); border-color: #c8c8bc; color: var(--ink); }
.icon-box, .history-icon { background: #f1eee6; color: #727362; }
.page-heading p, .muted { color: var(--muted); }
.diary-heading .caption, #device-status, #page-benchmark :is(th, td, .metric-card span, .metric-card small, .section-heading p, .benchmark-note, .example-meta, .example-meta b) { color: var(--muted); }
.brand strong { font-size: 1.625rem; font-weight: 750; letter-spacing: -.075em; line-height: 1; }
.brand-accent { color: var(--green); font-weight: 600; }
.brand-mark { background: var(--green); border-radius: 10px; box-shadow: none; width: 38px; height: 38px; flex: 0 0 38px; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand small { color: var(--muted); font-size: .8125rem; line-height: 1.4; letter-spacing: 0; }
.brand-copy { gap: 4px; }
.sidebar { width: var(--rail); padding: 32px 15px 20px; background: #f4f3ed; border-color: var(--line); }
.navigation { gap: 4px; margin-top: 45px; }
.navigation a { min-height: 46px; padding-left: 14px; gap: 13px; font-size: .9375rem; color: #53564c; }
.navigation a::after, #scale-setup-link::after { content: none; }
.navigation .icon { width: 19px; height: 19px; }
.navigation a[aria-current="page"] { background: #eae4da; color: #773422; }
.navigation a[aria-current="page"] .icon { color: var(--green); }
.navigation a:hover, .sidebar-footer a:hover { background: #ecebe3; color: var(--ink); }
.navigation [data-page="catalog"] { margin-top: 15px; }
.sidebar-footer { border-color: #dcdcd0; padding-top: 13px; }
.sidebar-footer a { gap: 9px; padding: 7px 6px; color: #505349; }
.device-shortcut-icon { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #d9dbcf; border-radius: 9px; background: #fbfaf5; }
.device-shortcut-icon .icon { width: 17px; height: 17px; }
.mobile-brand, .more-trigger { display: none; }
.workspace { margin-left: var(--rail); }
.content { max-width: 1500px; padding: clamp(24px, 2.8vw, 44px) clamp(24px, 3.4vw, 58px) 12px; }
.topbar { min-height: 66px; padding-inline: max(clamp(24px, 3.4vw, 58px), calc((100% - 1500px) / 2 + 58px)); background: var(--page); border-color: var(--line); }
.breadcrumb, .network { color: var(--muted); }
.breadcrumb strong, .account-link { color: var(--ink); }
.breadcrumb .icon { color: #949489; }
.top-actions { gap: 20px; }
.account-initial { background: #e7e6db; color: #464b3d; border: 1px solid #d7d8ca; }
body[data-online="true"] .network i { background: #5a8057; box-shadow: none; }
.footer { color: var(--muted); font-size: .8125rem; border-color: var(--line); gap: 13px 24px; }
.full-nutrition summary, .nutrient-row strong { color: var(--ink); }
.full-nutrition summary .icon, .nutrient-groups h3 { color: #585e50; }
.full-nutrition summary::after { color: var(--green); }
.nutrient-row, .nutrition-note, .nutrient-row dd small { color: var(--muted); }
.nutrient-row { border-color: var(--line); }
.portion-nutrition { background: #faf9f4; border-color: var(--line); }

.journal-heading { align-items: center; margin-bottom: 24px; }
.journal-heading .button { padding-inline: 18px; min-height: 46px; }
.day-tools { margin: 12px 0 0; gap: 7px 12px; }
.day-picker { gap: 0; padding: 0; background: transparent; border: 0; margin-left: -7px; }
.day-picker .icon-button { width: 36px; height: 36px; color: #65685b; }
.day-picker .icon-button:hover { background: #eae9e0; }
.calendar-control { position: relative; display: flex; gap: 8px; align-items: center; padding: 7px 6px; color: #53574c; font-size: .9375rem; font-weight: 550; cursor: pointer; border-radius: 6px; }
.calendar-control > span:first-child { display: inline-flex; }
.calendar-control .icon { width: 16px; height: 16px; }
#diary-date::first-letter { text-transform: uppercase; }
.calendar-control:hover { background: #eeede5; }
.calendar-control:focus-within { outline: 2px solid var(--green); outline-offset: 1px; }
.calendar-control input { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; min-width: 0; opacity: 0; cursor: pointer; }
.calendar-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.calendar-control input:focus-visible { opacity: 1; background: var(--paper); color: var(--ink); }
#jump-today { color: var(--green); min-height: 36px; }
.diary-retry { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.diary-summary, .diary-grid { grid-template-columns: minmax(0, 1.47fr) minmax(0, 1fr); gap: clamp(15px, 1.5vw, 24px); }
.day-energy {
  display: flex; align-items: stretch; min-height: 280px; padding: clamp(22px, 2.4vw, 36px);
  color: #fffdf6; border: 0; border-radius: var(--radius);
  background: linear-gradient(90deg, #141611ec, #161812c9 42%, #18191415 84%), #242622 url("/assets/diary-lunch.webp") center right / cover no-repeat;
}
.daily-copy { display: flex; flex-direction: column; justify-content: space-between; gap: 26px; width: 67%; max-width: 430px; }
.energy-label { font-size: 1.0625rem; font-weight: 570; color: #f8f4e9; }
.day-energy .energy-number { margin: 12px 0 5px; color: #e7e2d3; font-size: 1.125rem; }
.day-energy .energy-number strong { font: 500 clamp(3.6rem, 5vw, 5.3rem)/1 Inter, sans-serif; letter-spacing: -.075em; color: #fffef7; }
.energy-goal { color: #e0ded0; font-size: .9375rem; line-height: 1.5; margin-top: 6px; }
.energy-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 5px 12px; flex-wrap: wrap; }
.energy-remaining { font-size: .9375rem; color: #f8f5ec; font-weight: 550; }
#day-percent { color: #e9dec6; font-size: .875rem; font-variant-numeric: tabular-nums; }
.day-meter { display: block; place-items: normal; width: 100%; height: 5px; aspect-ratio: auto; margin-top: 10px; overflow: hidden; border-radius: 2px; background: #e1ddcd55; }
.day-meter i { display: block; height: 100%; width: var(--progress, 0%); border-radius: inherit; background: #e4ad76; }
.macros-card, .diary-entries, .diary-week { padding: clamp(19px, 2vw, 29px); }
.day-card-heading { align-items: center; }
.day-card-heading h2 { font-size: clamp(1.13rem, 1.4vw, 1.375rem); font-weight: 650; letter-spacing: -.045em; }
.day-card-heading > [data-icon] { width: 30px; height: 30px; margin: 0; background: #f1f0e8; color: #777967; border-radius: 8px; }
.day-card-heading > [data-icon] .icon { width: 17px; height: 17px; }
.day-card-heading .text-link { color: var(--green); font-size: .875rem; }
.macros-card { display: grid; grid-template-rows: auto 1fr auto; gap: 16px; }
.day-macros { display: grid; grid-template-columns: 1fr; align-content: center; gap: 12px; border: 0; padding: 0; }
.day-macros > div { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 5px; }
.day-macros div > span:first-child { color: #494d42; font-size: .9375rem; }
.day-macros div > span:first-child i { display: none; }
.day-macros strong { font-size: 1.25rem; line-height: 1.12; margin: 0; font-weight: 620; }
.day-macros small { margin: 0; font-size: .875rem; color: var(--muted); }
.day-macros div > .macro-meter { grid-column: 1/-1; height: 4px; margin: 0; background: #ebeae2; }
.day-macros div:nth-child(1) .macro-meter i { background: var(--protein); }
.day-macros div:nth-child(2) .macro-meter i { background: var(--fat); }
.day-macros div:nth-child(3) .macro-meter i { background: var(--carbs); }
.portion-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 11px; color: var(--muted); }
.portion-foot .day-count, .portion-foot .day-portion { margin: 0; font-size: .9375rem; color: var(--muted); }
.day-portion { display: inline; }
.day-portion strong { font: inherit; font-weight: 650; color: var(--ink); }
.diary-grid { align-items: stretch; margin-top: clamp(15px, 1.5vw, 24px); }
.diary-entries, .diary-week { min-height: 0; }
.diary-empty { display: flex; align-items: center; gap: 16px; padding: 27px 0 20px; min-height: 155px; }
.diary-empty .icon-box { width: 52px; height: 52px; flex: 0 0 52px; margin: 0; background: #f2eae0; color: #99664c; border-radius: 50%; }
.diary-empty .icon-box .icon { width: 27px; height: 27px; }
.diary-empty h3 { color: var(--ink); font: 400 1.5rem/1.25 var(--serif); letter-spacing: -.035em; }
.diary-empty p { color: var(--muted); margin-top: 7px; max-width: 42ch; line-height: 1.55; }
.entry-open { padding-block: 13px; }
.entry-open:hover { background: #f6f4ed; }
.entry-list li + li { border-color: var(--line); }
.entry-name small, .entry-totals small { color: var(--muted); }
.entry-thumb, .entry-thumb img { background: #efeee5; color: #747866; }
.entry-arrow .icon { color: #77796e; }
.diary-week .muted, .week-legend { color: var(--muted); }
.week-chart { margin-top: 20px; }
.week-plot { height: 100px; border-color: #e0dfd4; background: repeating-linear-gradient(to top, transparent 0 32px, #eeede5 32px 33px); }
.week-target { border-color: #9a9a88; }
.week-empty { position: absolute; inset: 46% 0 auto; width: fit-content; max-width: 95%; margin: 0 auto; padding: 2px 8px; text-align: center; background: var(--paper); color: var(--muted); font-size: .875rem; pointer-events: none; }
.week-bar { width: min(55%, 25px); background: #889783; border-radius: 4px 4px 0 0; }
.week-day [aria-current="date"] .week-bar, .week-day button:hover .week-bar { background: var(--green); }
.week-bar.unrecorded { visibility: hidden; }
.week-day-name { color: var(--muted); top: calc(100% + 6px); font-size: .875rem; }
.week-day [aria-current="date"] .week-day-name { color: var(--green-strong); text-decoration: underline; text-underline-offset: 3px; }
.week-tip { position: absolute; z-index: 2; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); background: #30332b; color: white; padding: 3px 7px; border-radius: 5px; font-size: .8125rem; white-space: nowrap; visibility: hidden; }
.week-day:first-of-type .week-tip { left: 0; transform: none; }
.week-day:last-child .week-tip { left: auto; right: 0; transform: none; }
.week-day button:is(:focus-visible, :hover) .week-tip { visibility: visible; }
.week-legend { margin-top: 35px; font-size: .8125rem; }
.week-legend i { background: #889783; }
.week-legend span:last-child i { border-color: #9a9a88; }
.full-nutrition { margin-top: clamp(15px, 1.5vw, 24px); }
.more-dialog { color: var(--ink); width: min(100%, 450px); background: var(--paper); border: 1px solid var(--line); padding: 22px; }
.more-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.more-heading h2 { font: 400 1.8rem/1.2 var(--serif); }
.more-dialog nav { display: grid; gap: 4px; }
.more-dialog a { display: flex; align-items: center; min-height: 48px; gap: 13px; padding: 9px 12px; border-radius: 8px; }
.more-dialog a:hover, .more-dialog [aria-current] { background: var(--green-light); color: var(--green-strong); }
.api-page { max-width: 880px; padding: clamp(22px, 5vw, 60px) 20px; }
.api-page .card { padding: 24px; }
.api-page .card p + p, .api-page dl dt { margin-top: 12px; }
.api-page code { overflow-wrap: anywhere; }
@media (min-width: 1600px) { :root { --rail: 240px; } }
@media (min-width: 741px) and (max-width: 1150px) {
  :root { --rail: 184px; }
  .sidebar { padding-inline: 10px; }
  .navigation a { padding-inline: 10px; }
  .content, .topbar { padding-inline: 22px; }
  .brand-copy small { font-size: .75rem; }
  .daily-copy { width: 77%; }
}
@media (max-width: 995px) {
  .diary-summary, .diary-grid { grid-template-columns: minmax(0, 1fr); }
  .day-energy { min-height: 245px; }
  .daily-copy { width: min(64%, 340px); }
}
@media (max-width: 740px) {
  .sidebar { position: static; display: contents; }
  .sidebar > .brand, .sidebar-footer, .topbar .breadcrumb { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 65px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
  .mobile-brand { display: flex; padding: 0; gap: 8px; }
  .mobile-brand strong { font-size: 1.45rem; }
  .mobile-brand .brand-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 8px; }
  .mobile-brand .brand-mark .icon { width: 21px; height: 21px; }
  .network { font-size: .8125rem; }
  .top-actions { gap: 13px; }
  .account-link { min-width: 40px; min-height: 42px; justify-content: center; }
  .account-initial { height: 33px; width: 33px; flex-basis: 33px; }
  .navigation { margin-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 5px 8px max(6px, env(safe-area-inset-bottom)); border-color: var(--line); background: #fffefa; box-shadow: 0 -2px 10px #28251309; }
  .navigation a, .navigation button { font: 550 .875rem/1.3 Inter, sans-serif; color: #54584e; margin: 0; padding: 6px 2px; border: 0; min-height: 48px; background: transparent; }
  .navigation [data-page="catalog"], .navigation [data-page="scales"], .navigation [data-page="profile"] { display: none; }
  .navigation a, .more-trigger { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border-radius: 8px; }
  .navigation a[aria-current="page"], .more-trigger.current { background: #f4e9df; color: var(--green-strong); }
  .more-trigger > span { display: flex; }
  .more-trigger .icon { width: 19px; height: 19px; }
  .content { padding: 25px 20px calc(84px + env(safe-area-inset-bottom)); }
  .page-heading h1, .diary-heading h1 { font-size: clamp(2.25rem, 7vw, 3rem); }
  .journal-heading { display: flex; flex-flow: row wrap; align-items: center; gap: 14px; margin-bottom: 17px; }
  .day-tools { margin-top: 5px; }
  .day-energy { min-height: 235px; }
  .daily-copy { width: min(72%, 340px); }
  .more-dialog { inset: auto 0 0; margin: 0 auto; border-radius: 18px 18px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .diary-empty { min-height: 130px; }
}
@media (max-width: 460px) {
  .content, .topbar { padding-inline: 16px; }
  .day-energy { padding: 21px; min-height: 238px; }
  .daily-copy { width: 86%; }
  .day-energy { background-position: 62% center; }
  .diary-empty { align-items: flex-start; gap: 12px; }
  .diary-empty .icon-box { width: 38px; height: 38px; flex-basis: 38px; }
  .diary-empty .icon-box .icon { width: 23px; }
  .diary-empty h3 { font-size: 1.3125rem; }
  .journal-heading .button { min-height: 43px; }
}
@media (prefers-reduced-motion: no-preference) {
  .day-meter i, .macro-meter i { transition: width .25s ease-out; }
}
