.jr-screen {
  --jr-ink: #183b31;
  --jr-text: #293a32;
  --jr-muted: #54665c;
  --jr-line: #dce1d6;
  --jr-paper: #fffefa;
  --jr-wash: #f2f3e9;
  --jr-lime: #e4ed8c;
  --jr-lavender: #e8e6f2;
  --jr-radius: 17px;
  color: var(--jr-text);
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  color-scheme: light;
}

.jr-screen *, .jr-screen *::before, .jr-screen *::after { box-sizing: border-box; }
.jr-screen :is(h1, h2, h3, p, ul) { margin: 0; }
.jr-screen :is(button, input, select, textarea) { font: inherit; }
.jr-screen button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.jr-screen button:disabled { opacity: .57; cursor: progress; }
.jr-screen :is(button, input, select, textarea, summary):focus-visible { outline: 3px solid #648b32; outline-offset: 3px; }
.jr-screen .jr-icon, .jr-screen .sd-icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.jr-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.jr-switch button, .jr-filters button {
  appearance: none;
  border: 0;
  color: var(--jr-muted);
  background: transparent;
  font-weight: 600;
  line-height: 1.25;
}
.jr-switch button:hover, .jr-filters button:hover { color: var(--jr-ink); background: #e6eade; }

.jr-page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: clamp(18px, 2.7vw, 29px) 0 25px; }
.jr-page-head h1 { color: var(--jr-ink); font-size: clamp(2.05rem, 3.4vw, 3.05rem); line-height: 1.03; font-weight: 900; letter-spacing: -.055em; }
.jr-page-head p { margin-top: 9px; color: var(--jr-muted); font-size: .98rem; line-height: 1.5; max-width: 59ch; }
.jr-screen h2 { color: var(--jr-ink); font-size: 1.19rem; font-weight: 750; line-height: 1.25; letter-spacing: -.032em; }
.jr-screen h3 { color: var(--jr-ink); font-weight: 700; letter-spacing: -.02em; }

.jr-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.jr-btn-primary, .jr-btn-lime { color: #fff; background: var(--jr-ink); border-color: var(--jr-ink); }
.jr-btn-primary:hover, .jr-btn-lime:hover { color: #fff; background: #245242; }
.jr-btn-secondary { border-color: var(--jr-line); background: var(--jr-paper); color: var(--jr-ink); }
.jr-btn-secondary:hover { background: var(--jr-wash); }
.jr-btn-danger { background: #973b35; color: white; }
.jr-btn-danger:hover { background: #7d2c27; }
.jr-icon-btn {
  display: inline-grid;
  place-content: center;
  min-width: 37px;
  min-height: 37px;
  padding: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--jr-muted);
  border-radius: 8px;
}
.jr-icon-btn:hover { background: #eef1e8; color: var(--jr-ink); }
.jr-icon-btn.jr-danger-icon:hover { color: #893b32; background: #faeeea; }
.jr-item-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.jr-text-btn { border: 0; background: transparent; color: var(--jr-ink); text-decoration: underline; text-underline-offset: 3px; font-size: .82rem; font-weight: 650; padding: 7px 3px; }

.jr-panel, .jr-weight-summary, .jr-reminder { min-width: 0; padding: clamp(18px, 2.5vw, 27px); border-radius: var(--jr-radius); }
.jr-panel { color: var(--jr-text); border: 1px solid var(--jr-line); background: var(--jr-paper); }
.jr-panel-top, .jr-chart-head, .jr-food-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jr-panel-top { justify-content: flex-start; gap: 8px; }
.jr-count { display: inline-grid; place-items: center; min-width: 25px; height: 23px; padding: 0 7px; border-radius: 7px; background: #edf0e7; color: var(--jr-muted); font-weight: 700; font-size: .76rem; }
.jr-history { margin-top: 19px; }
.jr-list { list-style: none; padding: 0; }
.jr-screen .jr-list-empty { color: var(--jr-muted); font-size: .91rem; line-height: 1.55; padding-top: 18px; }
.jr-screen .jr-caption { margin-top: 12px; color: var(--jr-muted); font-size: .75rem; line-height: 1.5; }

.jr-weight-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(192px, .85fr); gap: 16px; }
.jr-chart-panel { display: flex; flex-direction: column; }
.jr-switch { display: inline-flex; padding: 3px; border: 1px solid var(--jr-line); background: #f2f3ed; border-radius: 8px; }
.jr-switch button { padding: 6px 8px; border-radius: 5px; white-space: nowrap; font-size: .76rem; }
.jr-switch button[aria-pressed="true"], .jr-filters button[aria-pressed="true"] { color: white; background: var(--jr-ink); }
.jr-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; margin-top: 22px; padding-top: 4px; font-variant-numeric: tabular-nums; }
.jr-chart-axis { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; height: 148px; font-size: .69rem; color: var(--jr-muted); }
.jr-chart-grid { min-width: 0; }
.jr-chart-grid > svg { display: block; width: 100%; height: 148px; overflow: visible; }
.jr-guide { fill: none; stroke: #d8dfd1; stroke-width: 1; stroke-dasharray: 3 4; }
.jr-chart-line { fill: none; stroke: #315f48; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.jr-chart-fill { fill: #aabe8c; fill-opacity: .22; }
.jr-chart-dots { fill: #315f48; stroke: var(--jr-paper); stroke-width: 1.5; }
.jr-chart-labels { display: flex; justify-content: space-between; margin-top: 7px; color: var(--jr-muted); font-size: .69rem; }
.jr-chart-labels.jr-center { justify-content: center; }
.jr-chart-empty { flex: 1; min-height: 150px; display: grid; justify-items: center; align-content: center; gap: 12px; padding: 18px 14px; margin-top: 14px; border-radius: 10px; background: repeating-linear-gradient(0deg, transparent, transparent 33px, #dce3d695 33px, #dce3d695 34px), #f6f7f1; color: var(--jr-muted); text-align: center; }
.jr-chart-empty strong { font-size: .9rem; font-weight: 550; }
.jr-weight-summary { display: flex; flex-direction: column; color: #f5f7ee; background: #214839; }
.jr-summary-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; color: #e4e9d6; }
.jr-weight-value { padding-top: 22px; color: #f8faef; font-size: clamp(2.4rem, 4.5vw, 3.7rem); font-weight: 750; letter-spacing: -.06em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.jr-weight-value small { font-size: .41em; letter-spacing: -.03em; }
.jr-weight-summary p { color: #e2e7d8; font-size: .83rem; margin: 5px 0 20px; }
.jr-summary-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid #698072; font-size: .75rem; color: #e7ecde; }
.jr-summary-bottom strong { color: var(--jr-lime); font-size: .94rem; font-variant-numeric: tabular-nums; }
.jr-history > .jr-list, .jr-meal-group { margin-top: 15px; }
.jr-weight-row, .jr-food-row { display: grid; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--jr-line); font-size: .89rem; }
.jr-weight-row { grid-template-columns: minmax(115px, 1fr) minmax(65px, .6fr) minmax(0, 1.8fr) auto; }
.jr-weight-row > time, .jr-row-note { color: var(--jr-muted); }
.jr-weight-row strong { color: var(--jr-ink); font-size: 1.02rem; }
.jr-weight-row strong small { font-size: .76rem; }
.jr-row-note { overflow-wrap: anywhere; white-space: pre-line; line-height: 1.5; }

.jr-food-head { flex-wrap: wrap; }
.jr-food-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.jr-date-nav, .jr-day-control { display: inline-flex; align-items: center; gap: 8px; }
.jr-date-nav { flex-wrap: wrap; }
.jr-day-control { gap: 1px; border: 1px solid var(--jr-line); border-radius: 8px; color: var(--jr-ink); }
.jr-day-control input { max-width: 145px; min-width: 107px; background: transparent; color: var(--jr-ink); border: none; padding: 5px 0; font-size: .84rem; font-weight: 600; }
.jr-day-control .jr-icon-btn { min-height: 34px; min-width: 30px; padding: 5px; }
.jr-nutrients { display: grid; grid-template-columns: 1.24fr repeat(3, 1fr); gap: 9px; margin-top: 17px; }
.jr-energy, .jr-macro { min-width: 0; display: flex; flex-direction: column; border-radius: 10px; padding: clamp(12px, 1.8vw, 20px); background: #f1f3e9; color: var(--jr-ink); }
.jr-energy { background: #e7edbd; }
.jr-nutrients span { font-size: .81rem; font-weight: 650; }
.jr-nutrients strong { margin: 10px 0 5px; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: 1; letter-spacing: -.045em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.jr-nutrients strong small { font-size: .49em; letter-spacing: -.02em; }
.jr-nutrients > div > small { color: var(--jr-muted); font-size: .72rem; line-height: 1.35; }
.jr-empty { padding: 35px 18px 22px; text-align: center; color: var(--jr-muted); }
.jr-empty > svg { margin-bottom: 11px; color: #66876a; }
.jr-empty h3 { font-size: 1.02rem; }
.jr-empty p { font-size: .86rem; line-height: 1.5; margin-top: 6px; }
.jr-meal-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 13px; border-radius: 8px; background: #f0f2e9; font-size: .82rem; font-weight: 600; }
.jr-meal-title h3 { font-size: .94rem; }
.jr-food-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.jr-food-row:first-child { border: 0; }
.jr-food-row > div:first-child { display: grid; gap: 3px; overflow-wrap: anywhere; }
.jr-food-row > span, .jr-food-row small { color: var(--jr-muted); }
.jr-food-row strong { color: var(--jr-ink); }
.jr-food-row small { font-size: .78rem; }

.jr-reminder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .34fr); align-items: center; gap: 15px; color: var(--jr-ink); border: 1px solid #d7d6df; background: var(--jr-lavender); padding: clamp(22px, 3.2vw, 38px); }
.jr-reminder-body { min-width: 0; overflow-wrap: anywhere; }
.jr-jar { justify-self: center; display: block; width: min(100%, 185px); height: auto; }
.jr-reminder h2 { max-width: 23ch; font-size: clamp(1.55rem, 3vw, 2.3rem); letter-spacing: -.045em; line-height: 1.12; }
.jr-reminder h2:focus { outline: 0; }
.jr-reminder p { max-width: 56ch; margin-top: 10px; font-size: .96rem; line-height: 1.55; color: #435648; }
.jr-reminder .jr-btn { margin-top: 19px; }
.jr-drawn-text { white-space: pre-line; }
.jr-drawn-meta { display: inline-block; margin-bottom: 10px; font-size: .81rem; font-weight: 600; color: #485957; }
.jr-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.jr-filters button { border: 1px solid var(--jr-line); border-radius: 7px; font-size: .77rem; padding: 7px 10px; }
.jr-filters button[aria-pressed="true"] { border-color: var(--jr-ink); }
.jr-memory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; margin-top: 18px; }
.jr-memory-card { min-width: 0; display: flex; flex-direction: column; padding: 15px 15px 8px; border: 1px solid var(--jr-line); border-radius: 11px; background: #fafbf5; }
.jr-memory-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.jr-memory-meta time { color: var(--jr-muted); font-size: .73rem; }
.jr-category { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: .74rem; font-weight: 650; color: var(--jr-ink); background: #e5edcc; }
.jr-cat-1 { background: #e3dff0; }
.jr-cat-2 { background: #f0e5c8; }
.jr-cat-3 { background: #f0dcd0; }
.jr-cat-4 { background: #e5e6e2; }
.jr-memory-card h3 { margin-top: 13px; font-size: 1.05rem; overflow-wrap: anywhere; }
.jr-memory-card p { margin-top: 7px; white-space: pre-line; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.55; color: var(--jr-muted); }
.jr-memory-card .jr-item-actions { margin: auto -5px 0 auto; padding-top: 9px; }

body:has(.jr-dialog[open]) { overflow: hidden; }
.jr-dialog {
  position: fixed;
  inset: 0;
  width: min(490px, calc(100% - 26px));
  max-height: min(90vh, 90dvh);
  margin: auto;
  padding: 0;
  border: 1px solid var(--jr-line);
  border-radius: 16px;
  background: var(--jr-paper);
  color: var(--jr-text);
  box-shadow: 0 24px 80px #12291c40;
  overflow: auto;
  overscroll-behavior: contain;
}
.jr-dialog::backdrop { background: #112d23a6; }
.jr-dialog-inner { padding: 23px; }
.jr-dialog-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.jr-dialog-head h2 { font-size: 1.43rem; letter-spacing: -.04em; }
.jr-dialog-head > .jr-icon-btn { margin: -4px -4px -4px 0; }
.jr-dialog-fields { display: grid; gap: 15px; margin-top: 18px; }
.jr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: .83rem; font-weight: 650; color: var(--jr-ink); }
.jr-field :is(input, select, textarea) { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; color: var(--jr-text); background: #fff; border: 1px solid #bcc9ba; border-radius: 7px; font-size: .92rem; font-weight: 400; line-height: 1.35; }
.jr-field :is(input, textarea)::placeholder { color: #67776c; opacity: 1; }
.jr-field textarea { resize: vertical; }
.jr-field-pair, .jr-macro-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jr-nutrient-fields { min-width: 0; margin: 0; padding: 10px 12px 13px; border: 1px solid var(--jr-line); border-radius: 9px; }
.jr-nutrient-fields legend { padding: 0 4px; color: var(--jr-ink); font-size: .82rem; font-weight: 650; }
.jr-nutrient-fields summary { cursor: pointer; width: fit-content; margin-top: 12px; color: var(--jr-muted); font-size: .83rem; font-weight: 550; }
.jr-macro-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 10px; }
.jr-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--jr-line); }
.jr-screen :is(.jr-delete-copy, .jr-form-error, .jr-dialog-copy, .jr-photo-copy) { overflow-wrap: anywhere; font-size: .92rem; line-height: 1.5; color: var(--jr-muted); }
.jr-screen :is(.jr-delete-copy, .jr-form-error, .jr-dialog-copy):not(:empty) { margin-top: 15px; }
.jr-screen .jr-form-error { color: #87352c; }
.jr-meal-preview { width: 100%; max-height: 210px; object-fit: contain; border-radius: 8px; background: var(--jr-wash); }
.jr-photo-footer { flex-wrap: wrap; }
.jr-photo-scale { flex-direction: row; align-items: center; gap: 10px; }
.jr-photo-scale select { width: auto; min-width: 72px; }

@container (max-width: 720px) {
  .jr-weight-grid { grid-template-columns: minmax(0, 1.7fr) minmax(166px, .8fr); gap: 12px; }
  .jr-chart-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .jr-nutrients { gap: 6px; }
  .jr-reminder { grid-template-columns: minmax(0, 1fr) minmax(96px, .38fr); }
}
@container (max-width: 560px) {
  .jr-page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .jr-page-head > .jr-btn { align-self: flex-start; }
  .jr-weight-grid { grid-template-columns: 1fr; }
  .jr-chart-head { align-items: center; flex-direction: row; flex-wrap: wrap; }
  .jr-weight-summary { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .jr-summary-label { grid-column: 1; align-self: end; }
  .jr-weight-value { grid-column: 2; grid-row: 1 / span 2; font-size: 2.15rem; padding: 0; }
  .jr-weight-summary p { grid-column: 1; margin: 4px 0 0; }
  .jr-summary-bottom { grid-column: 1 / -1; margin-top: 13px; padding-top: 11px; }
  .jr-weight-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 3px 9px; }
  .jr-weight-row .jr-row-note:not(:empty) { grid-column: 1 / -1; grid-row: 2; }
  .jr-weight-row .jr-row-note:empty { display: none; }
  .jr-weight-row .jr-item-actions { grid-column: 3; grid-row: 1; }
  .jr-nutrients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jr-food-head { align-items: flex-start; flex-direction: column; }
  .jr-nutrients strong { margin-top: 8px; }
  .jr-reminder { gap: 8px; padding: 19px; grid-template-columns: minmax(0, 1fr) 85px; }
  .jr-jar { align-self: start; }
  .jr-memory-grid { grid-template-columns: 1fr; }
}
@container (max-width: 330px) {
  .jr-reminder { grid-template-columns: minmax(0, 1fr) 65px; padding: 15px; }
  .jr-chart-head { align-items: flex-start; flex-direction: column; }
  .jr-weight-row, .jr-food-row { font-size: .8rem; gap: 5px; }
  .jr-item-actions { gap: 0; }
  .jr-item-actions .jr-icon-btn { min-width: 32px; padding: 5px; }
}
@media (max-width: 620px) {
  .jr-field :is(input, select, textarea), .jr-day-control input { font-size: 16px; }
  .jr-dialog { max-height: calc(100dvh - 24px); }
  .jr-dialog-inner { padding: 18px; }
}
@media (forced-colors: active) {
  .jr-switch button[aria-pressed="true"], .jr-filters button[aria-pressed="true"] { outline: 1px solid currentColor; }
}
