:root {
  color-scheme: light;
  --paper: #f2f6f6;
  --panel: #fff;
  --ink: #193338;
  --muted: #50676b;
  --border: #dce2ed;
  --brand: #176e65;
  --brand-dark: #10544d;
  --tint: #e6f2ed;
  --accent: #106e63;
  --accent-tint: #e7f5f1;
  --radius: 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--brand-dark); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem .9rem; border: 1px solid var(--border);
  border-radius: 10px; color: var(--ink); background: var(--panel);
  text-decoration: none; font-weight: 600;
}
button:hover, .button:hover { border-color: var(--brand); }
button:disabled { opacity: .55; cursor: wait; }
.primary { color: white; background: var(--brand); border-color: var(--brand); }
.primary:hover { background: var(--brand-dark); }
:focus-visible { outline: 3px solid #645bd3; outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.05; letter-spacing: -.05em; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; }
p, dd { line-height: 1.55; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 3; background: #f2f6f6f2; border-bottom: 1px solid #dbe5e4; backdrop-filter: blur(14px); }
.topbar-inner { max-width: 1200px; margin-inline: auto; min-height: 67px; padding-inline: clamp(.9rem, 5vw, 3rem); display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: .57rem; align-items: center; line-height: 1; color: var(--ink); text-decoration: none; font-size: 1.34rem; font-weight: 800; letter-spacing: -.045em; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--brand); color: white; font-family: Georgia, serif; font-style: italic; font-size: 1.65rem; padding-bottom: .25rem; }
.topbar-actions { display: flex; align-items: center; gap: .42rem; }
.site-menu { position: relative; }
.site-menu > summary, .page-refresh { width: 44px; min-height: 44px; padding: 0; margin: 0; display: grid; place-items: center; border: 1px solid #dbe5e4; border-radius: 13px; background: white; }
.page-refresh { border-radius: 50%; color: var(--brand-dark); }
.page-refresh:hover { background: var(--tint); border-color: var(--brand); }
.page-refresh svg { width: 19px; height: 19px; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary::marker { content: ''; }
.hamburger { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px; box-shadow: 0 -5px var(--ink), 0 5px var(--ink); }
.site-menu-panel { position: absolute; right: 0; top: calc(100% + .45rem); width: max-content; min-width: min(11rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem); max-height: calc(100dvh - 5rem); overflow: auto; overscroll-behavior: contain;
  background: var(--panel); padding: .32rem; border: 1px solid #dbe5e4; border-radius: 12px; box-shadow: 0 11px 30px #1b414320; }
.site-menu nav a, .site-menu form button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 36px;
  padding: .35rem .6rem; text-align: left; text-decoration: none; border: 0; border-radius: 7px; color: var(--ink); font-size: .9rem; line-height: 1.25; }
.site-menu nav a[aria-current], .site-menu nav a:hover, .site-menu form button:hover { background: var(--tint); color: var(--brand-dark); }
.site-menu .sign-out { border-top: 1px solid #e2e9e8; margin-top: .2rem; padding-top: .2rem; }
.workspace { isolation: isolate; margin-inline: auto; padding: 2rem clamp(.8rem, 5vw, 3rem) 4rem; max-width: 1200px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-head p { margin-top: .45rem; }
.stack { display: grid; gap: 1rem; min-width: 0; }
.panel { padding: clamp(1rem, 3vw, 1.45rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.section-title, .row { display: flex; gap: .65rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.panel > .row + *, .panel > .section-title + * { margin-top: 1rem; }
.workspace[data-compact-page] { padding-block-start: clamp(.7rem, 2vw, 1.3rem); }
[data-compact-page] .page-head { align-items: center; gap: .44rem .7rem; margin-bottom: .7rem; }
[data-compact-page] .page-head h1 { font-size: clamp(1.58rem, 5.5vw, 2.35rem); }
[data-compact-page] .stack { gap: .62rem; }
[data-compact-page] .panel { padding: .68rem .78rem; border-radius: 12px; }
[data-compact-page] .section-title { gap: .35rem .6rem; }
[data-compact-page] .panel h2 { font-size: 1.03rem; }
[data-compact-page] .panel > .row + *, [data-compact-page] .panel > .section-title + * { margin-top: .46rem; }
[data-compact-page] .actions, [data-compact-page] .controls { gap: .36rem; }
[data-compact-page] :is(.actions, .page-head, .section-title, .controls) :is(button, .button) {
  min-height: 37px; padding: .35rem .58rem; border-radius: 8px; font-size: .84rem;
}
[data-compact-page] .controls :is(input, select) {
  min-height: 38px; padding-block: .35rem;
}
[data-compact-page] .chips { gap: .3rem; }
[data-compact-page] .panel :is(.chip, .pill) { font-size: .76rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip, .pill { border-radius: 999px; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .55rem; color: var(--brand-dark); background: var(--tint); font-size: .83rem; font-weight: 640; }
.pill.spoken { color: var(--accent); background: var(--accent-tint); }
.controls, .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.controls input { max-width: 10.5rem; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .45rem; }
.quick button { justify-content: flex-start; text-align: left; font-size: .91rem; }
label { display: grid; gap: .3rem; font-size: .92rem; font-weight: 650; color: var(--ink); }
input:not([type=radio],[type=checkbox]), select, textarea {
  color: var(--ink); border: 1px solid #cbd4e3; border-radius: 9px;
  min-width: 0; width: 100%; min-height: 44px; padding: .55rem .65rem; background: #fbfcff;
  font-size: 1rem;
}
textarea { resize: vertical; min-height: 82px; }
form { display: grid; gap: .85rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: .55rem; }
.group { display: grid; gap: .65rem; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.option-list { display: grid; gap: .35rem; }
.option { display: flex; align-items: flex-start; gap: .55rem; padding: .55rem; background: var(--paper); border-radius: 8px; line-height: 1.35; }
.option input { flex: 0 0 auto; margin-top: .2rem; }
.option small { display: block; margin-top: .2rem; font-weight: 450; }
details > summary { cursor: pointer; color: var(--brand-dark); width: fit-content; min-height: 34px; padding-top: .35rem; }
details[open] > summary { margin-bottom: .35rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: .7rem; border-top: 1px solid var(--border); padding: .9rem 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline time { color: var(--muted); padding-top: .18rem; font-size: .9rem; font-variant-numeric: tabular-nums; }
.timeline h3 { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.timeline-feelings { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; margin-top: .35rem; }
.timeline-feeling { flex: 0 0 auto; max-width: 100%; padding: .1rem .48rem; border-radius: 999px;
  background: #edf2f1; color: #304b51; font-size: .77rem; line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-feeling-base { background: var(--tint);
  background: color-mix(in srgb, var(--feel, var(--brand)) 20%, white); color: var(--ink); }
.timeline .summary { margin-top: .4rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline .line-actions { margin-top: .55rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.timeline .line-actions button { min-height: 38px; font-size: .84rem; }
.medication-section > h2 { margin-bottom: .45rem; }
.medication-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .45rem; }
.medication-card { display: grid; align-content: start; gap: .36rem; min-width: 0; padding: .48rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fcfdfd; }
.medication-card-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .38rem; }
.medication-card-title h3 { font-size: .93rem; line-height: 1.22; overflow-wrap: anywhere; }
.medication-icon { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 8px; background: #e8f2ef; }
.medication-stock { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .38rem; padding: .24rem .36rem;
  background: #edf6f2; color: var(--brand-dark); border-radius: 8px; }
.medication-stock[data-medication-negative] { background: #f9eeed; color: #8c332d; }
.medication-stock[data-medication-untracked] { background: #f2f5f5; color: var(--muted); }
.medication-stock-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .38rem; font-size: .86rem; overflow-wrap: anywhere; }
.medication-stock-value small { color: inherit; }
.medication-stock-value strong { font-variant-numeric: tabular-nums; }
.medication-card-actions { display: flex; align-items: center; gap: .24rem; }
.medication-card-actions :is(button, .button) { min-height: 2.1rem; padding: .22rem .42rem; border-radius: 7px; font-size: .75rem; white-space: nowrap; }
.medication-card-actions .medication-take { background: #e8f2ef; color: var(--brand-dark); }
.medication-card-actions .medication-icon-button { min-width: 2.1rem; padding-inline: .28rem; }
.medication-stock .medication-card-actions button { min-height: 1.9rem; }
.journal-page.stack, .journal-page [data-journal-days] { gap: .52rem; }
.journal-page .panel:is(.journal-day, .journal-metric-chart) { padding: .44rem .64rem; border-radius: 12px; }
.journal-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.compact-filter-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center;
  gap: .08rem .34rem; min-width: 0; padding: .36rem .54rem; border-radius: 9px; text-align: start; font-size: .86rem; line-height: 1.15; }
.compact-filter-button > :is(span, small) { grid-column: 1; }
.compact-filter-button > small { display: flex; align-items: baseline; gap: .22rem; min-width: 0; white-space: nowrap; font-weight: 500; }
.compact-filter-button > small span:first-child { overflow: hidden; text-overflow: ellipsis; }
.compact-filter-button > small span + span { flex-shrink: 0; }
.compact-filter-button::after { content: ''; grid-area: 1 / 2 / 3; align-self: center; width: .36rem; height: .36rem;
  margin-inline-end: .1rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.compact-filter-button[data-active] { background: var(--tint); border-color: #a4c8ba; color: var(--brand-dark); }
.compact-period-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: inherit; }
.journal-period-dates input { display: block; min-width: 0; max-width: 100%; padding-inline: .44rem; }
.journal-period-dates input[type=date] { -webkit-appearance: none; appearance: none; }
.journal-period-dates input[type=date]::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
.contacts-page .page-head { gap: .3rem .5rem; margin-bottom: .48rem; }
.contacts-page .page-head h1 { font-size: clamp(1.42rem, 4.8vw, 2.2rem); }
.contact-filters { margin-bottom: .48rem; }
.contact-list { display: grid; gap: .38rem; list-style: none; padding: 0; margin: 0; }
.contact-card.panel { padding: .26rem .44rem; border-radius: 11px; }
.contact-empty.panel { padding: .64rem; }
.contact-card-row, .contact-category-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .28rem; }
.contact-card-open { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-content: stretch;
  gap: .45rem; min-width: 0; min-height: 42px; padding: .22rem .42rem .22rem .12rem; background: transparent;
  border: 1px solid transparent; border-radius: 8px; text-align: start; }
.contact-card-open[aria-expanded=true] { background: #f1f6f4; border-color: #dce9e4; }
@media (hover: hover) {
  .contact-card-open:hover { background: #f1f6f4; border-color: #dce9e4; }
}
.contact-row-icon { display: grid; place-items: center; flex: 0 0 auto; width: 1.7rem; height: 1.7rem;
  border-radius: 7px; background: var(--tint); color: var(--brand-dark); }
.contact-row-icon .record-glyph { width: .92rem; height: .92rem; }
.contact-row-label { display: grid; gap: .08rem; min-width: 0; line-height: 1.14; }
.contact-row-label strong { overflow-wrap: anywhere; font-size: .9rem; }
.contact-row-label small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; font-weight: 480; }
.contact-card-chevron { width: .34rem; height: .34rem; margin-inline-end: .12rem; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.contact-card-open[aria-expanded=true] .contact-card-chevron { transform: rotate(45deg); }
.contact-card .contact-icon-button, .contact-category-option .contact-icon-button { width: 2.2rem; min-height: 2.2rem;
  padding: .28rem; border-radius: 7px; color: var(--brand-dark); }
.contact-icon-button .record-glyph { width: .94rem; height: .94rem; }
.contact-history { margin-top: .28rem; border-top: 1px solid var(--border); padding: .35rem .28rem .24rem; }
.contact-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; margin: .3rem 0; }
.contacts-page .contact-history-head h2 { font-size: .88rem; }
.contact-history-head button, .contact-history-more { min-height: 34px; padding: .24rem .48rem; font-size: .78rem; }
.contact-history-more { margin-top: .35rem; color: var(--brand-dark); background: var(--tint); }
.contact-notes, .contact-history-caption { font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; }
.contact-notes { white-space: pre-wrap; }
.contact-history-caption { margin-top: .35rem; }
.contact-history .contact-entry-list { gap: .22rem; }
.contact-entry > .journal-row { min-height: 40px; padding: .22rem .38rem; gap: .32rem; }
.contact-entry > .journal-row time { text-align: end; font-size: .73rem; line-height: 1.2; font-weight: 650; }
.contact-entry > .journal-row time small { display: block; color: var(--muted); font-size: .68rem; font-weight: 450; }
.contact-entry-label { display: grid; gap: .09rem; min-width: 0; line-height: 1.15; }
.contact-entry-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 680; }
.contact-entry-label small { color: var(--muted); font-size: .73rem; }
.contact-entry[open] .contact-entry-label strong { white-space: normal; overflow-wrap: anywhere; }
.contact-entry .compact-event-full .timeline-feelings { display: flex; }
.contact-entry .compact-event-full .reflection-kind { display: block; }
.contact-medical-links { display: grid; gap: .25rem; margin: .38rem 0; }
.contact-medical-links h3 { font-size: .78rem; color: var(--muted); }
.contact-medical-links a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: .36rem; padding: .3rem .46rem; min-height: 38px; background: var(--tint); border-radius: 7px;
  color: var(--brand-dark); text-decoration: none; overflow-wrap: anywhere; }
.contact-medical-links strong, .contact-medical-links small { display: block; }
.contact-medical-links strong { font-size: .85rem; }
.contact-medical-links small { font-size: .74rem; }
.people-stats { display: flex; flex-wrap: wrap; gap: .3rem; margin: .36rem 0 0; }
.people-stats > div { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .45rem;
  border-radius: 8px; background: #edf3f0; font-size: .77rem; }
.people-stats dt { color: var(--muted); }
.people-stats dd { margin: 0; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.contact-history .line-actions button { min-height: 34px; padding: .28rem .48rem; font-size: .8rem; }
.contact-category-options { display: grid; gap: .22rem; max-height: min(50dvh, 25rem); overflow: auto; }
.contact-category-option > label { grid-column: 1 / -1; cursor: pointer; }
.contact-category-option:has(button) > label { grid-column: 1; }
.contact-category-add { justify-self: start; }
.medical-page .journal-filters { margin-bottom: .58rem; }
.medical-record-group { display: grid; gap: .32rem; min-width: 0; }
.medical-record-group > h2 { margin: .14rem .08rem 0; font-size: .87rem; color: var(--muted); }
[data-compact-page] .medical-record.panel { padding: .25rem .45rem; }
.medical-record > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .4rem; width: 100%; min-height: 40px; padding: .22rem .15rem; margin: 0; list-style: none; color: var(--ink); }
.medical-record > summary::-webkit-details-marker { display: none; }
.medical-record > summary::marker { content: ''; }
.medical-record[open] > summary .contact-card-chevron { transform: rotate(45deg); }
.medical-record-label { display: grid; gap: .05rem; line-height: 1.18; }
.medical-record-label strong { font-size: .92rem; overflow-wrap: anywhere; }
.medical-record-label small { font-size: .75rem; overflow-wrap: anywhere; }
.medical-record-body { display: grid; gap: .26rem; border-top: 1px solid var(--border); padding: .32rem .15rem .16rem; }
.medical-record-body > p { font-size: .78rem; }
.medical-record-body .fields { margin: 0 0 .3rem; }
.medical-record-body .fields dd { font-size: .88rem; }
.medical-record-actions :is(button, .button) { max-width: 100%; overflow-wrap: anywhere; }
.medical-detail-page { max-width: 46rem; margin-inline: auto; }
.medical-back { display: inline-flex; align-items: center; gap: .3rem; min-height: 34px;
  color: var(--brand-dark); font-size: .85rem; font-weight: 650; }
.medical-back > span { font-size: 1.35rem; line-height: 1; }
.medical-detail-page .page-head { margin-bottom: .5rem; }
.medical-detail-page .page-head > div { min-width: 0; }
.medical-detail-page h1 { font-size: clamp(1.4rem, 4.7vw, 2.2rem); overflow-wrap: anywhere; }
.medical-detail-stack { gap: .46rem; }
.medical-detail-stack > .panel { padding: .5rem .64rem; }
.medical-detail-metadata, .medical-detail-notes { display: grid; margin: 0; }
.medical-detail-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .24rem .58rem; }
:is(.medical-detail-metadata, .medical-detail-notes) > div { min-width: 0; padding: .26rem 0; }
:is(.medical-detail-metadata, .medical-detail-notes) dt { color: var(--muted); font-size: .78rem; }
:is(.medical-detail-metadata, .medical-detail-notes) dd {
  margin: .08rem 0 0; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.medical-detail-notes > div + div { border-top: 1px solid var(--border); }
.medical-detail-notes dd { white-space: pre-wrap; }
.medical-detail-metadata + .medical-record-actions { border-top: 1px solid var(--border); padding-top: .4rem; margin-top: .32rem; }
.medical-detail-report .section-title > div { min-width: 0; overflow-wrap: anywhere; }
.journal-day .journal-day-heading { gap: .2rem .6rem; margin-bottom: .2rem; }
.journal-day-heading h2 { font-size: .94rem; }
.journal-day-heading a { font-size: .77rem; font-weight: 650; }
.journal-day > :is(details, .compact-event-list) { margin-top: .27rem; min-width: 0; }
.journal-row { list-style: none; min-height: 40px; width: 100%; margin: 0; padding: .36rem .45rem;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .25rem .47rem;
  border-radius: 8px; color: var(--ink); background: #f5f8f7; }
.journal-row::-webkit-details-marker { display: none; }
.journal-row::after { content: ''; width: .34rem; height: .34rem; margin-inline: .12rem;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
details[open] > .journal-row { margin-bottom: .22rem; }
details[open] > .journal-row::after { transform: rotate(45deg); }
.journal-row-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #e7f0ec; }
.journal-row-icon .record-glyph { width: 15px; height: 15px; }
.journal-row-icons { display: grid; gap: .2rem; align-self: start; }
.journal-row-icons + .journal-row-body { align-self: start; padding-block-start: .15rem; }
.journal-row-body { min-width: 0; font-size: .85rem; overflow-wrap: anywhere; }
.journal-row-body > strong { font-weight: 690; }
.reflection-kind { display: block; margin-top: .14rem; color: var(--muted); font-size: .69rem; font-weight: 550; }
.journal-row-value { margin-inline-start: .34rem; font-weight: 550; }
.journal-row-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.journal-preview-caption[data-preview-lines="2"] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  white-space: normal; }
.journal-settings { width: 40px; min-height: 40px; padding: 0; color: var(--brand-dark); }
.journal-settings .record-glyph { width: 19px; height: 19px; }
.journal-preview-options { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .4rem; }
.journal-preview-options label { gap: .2rem; min-width: 0; font-size: .84rem; }
.journal-preview-options :is(input, select) { min-width: 0; min-height: 38px; padding-inline: .4rem; }
.journal-priority-group { display: grid; gap: .24rem; }
.journal-priority-group legend { margin-bottom: .18rem; font-size: .84rem; }
.journal-priority-group .journal-content-choices { max-height: min(33dvh, 20rem); }
.journal-priority-group [data-priority-position] { margin-inline-start: auto; padding-inline: .2rem; }
.journal-medication-preview { display: flex; justify-content: space-between; gap: .35rem; }
.journal-medication-preview > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.journal-medication-preview > span + span { flex-shrink: 0; }
.journal-row-body .timeline-feelings { margin-top: .18rem; gap: .2rem .27rem; }
.journal-row-body .timeline-feeling { font-size: .72rem; }
.journal-row > time { white-space: nowrap; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.journal-note p { margin: .25rem .45rem; font-size: .87rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-note[open] .journal-row-preview, .compact-event[open] .journal-row-preview,
.journal-entries[open] > summary .journal-row-preview { display: none; }
.journal-entries [data-journal-entries] { overflow-wrap: anywhere; }
.compact-event-list { display: grid; gap: .25rem; min-width: 0; }
.compact-batch .journal-row-value { white-space: nowrap; }
.compact-batch > .compact-event-list, .compact-batch > [data-journal-entries] {
  margin-inline-start: .58rem; padding-inline-start: .42rem; border-inline-start: 1px solid #dce9e3;
}
.day-events .compact-batch > .compact-event-list { margin-top: .22rem; }
.compact-event-full { padding: .05rem .48rem .45rem; }
.compact-event-full .timeline > li { display: block; border: 0; padding: .2rem 0 .35rem; font-size: .86rem; }
.compact-event-full .timeline > li > time, .compact-event-full .timeline-entry-head,
.compact-event-full :is(.timeline-feelings, .reflection-kind) { display: none; }
.compact-event-full .timeline .line-actions button { min-height: 34px; padding: .32rem .55rem; }
.journal-metric-chart { padding: .62rem .76rem; border-radius: 12px; }
.journal-metric-chart summary { width: 100%; font-size: .88rem; font-weight: 680; }
.metric-mini-chart { margin: 0; min-width: 0; }
.metric-mini-chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: .22rem .6rem; margin-bottom: .45rem; color: var(--muted); font-size: .79rem; }
.metric-mini-chart figcaption strong { color: var(--ink); }
.metric-mini-chart figcaption small { font-size: .74rem; font-weight: 500; }
.metric-mini-average { font-size: .73rem; white-space: nowrap; }
.metric-mini-plot { display: block; height: 80px; position: relative; border-radius: 8px; overflow: hidden; background: #eff5f3; }
.metric-mini-plot::before { content: ''; position: absolute; left: 0; right: 0;
  bottom: clamp(1px, var(--preview-zero, 0%), calc(100% - 1px)); border-top: 1px solid #a5c1b9; }
.metric-mini-plot canvas, .metric-mini-slots { position: absolute; inset: 0; width: 100%; height: 100%; }
.metric-mini-slots { display: grid; grid-template-columns: repeat(var(--preview-count, 1), minmax(0, 1fr)); }
.metric-mini-slots > span { position: relative; min-width: 0; }
.metric-mini-slots i { position: absolute; inset-inline: 14%; bottom: var(--preview-bottom);
  height: max(2px, var(--preview-height)); background: #378778; border-radius: 2px; }
.day-metric-detail { --metric-trend-color: #93582d; }
.day-metric-detail .metric-mini-plot { height: 116px; }
.day-metric-detail .metric-mini-slots, .day-metric-detail canvas { inset-block-start: 14px; height: calc(100% - 14px); }
.metric-mini-smoothing { color: var(--metric-trend-color); z-index: 1; pointer-events: none; }
.metric-mini-trend-key { display: block; text-align: end; margin-top: .35rem; font-size: .68rem; }
.metric-mini-trend-key::before { content: ''; display: inline-block; width: .8rem;
  vertical-align: middle; margin-inline-end: .28rem; border-top: 1px solid var(--metric-trend-color); }
.metric-mini-dates { display: grid; grid-template-columns: repeat(var(--preview-count), minmax(0, 1fr));
  margin-top: .2rem; font-size: .62rem; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.metric-mini-dates span { display: flex; justify-content: center; white-space: nowrap; }
.metric-stats-back { display: inline-flex; justify-self: start; align-items: center; min-height: 32px;
  color: var(--brand-dark); font-size: .81rem; font-weight: 650; text-decoration: none; }
.metric-stats-back:hover { text-decoration: underline; }
.metric-stats-page .page-head h1 { min-width: 0; overflow-wrap: anywhere; }
.metric-stats-page .panel { min-width: 0; }
.metric-stats-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.6rem, 1fr));
  gap: .4rem .58rem; margin: 0 0 .4rem; padding-bottom: .48rem; border-bottom: 1px solid #e3ebe7; }
.metric-stats-summary dt { color: var(--muted); font-size: .72rem; }
.metric-stats-summary dd { margin: .12rem 0 0; font-size: .94rem; font-weight: 700;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-stats-scroll { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.metric-stats-scroll .metric-mini-chart { min-width: calc(var(--preview-count, 1) * 11px); }
.metric-stats-scroll .metric-mini-plot { height: 146px; }
.metric-stats-days summary { font-size: .9rem; }
.metric-stats-days summary small { margin-inline-start: .38rem; font-weight: 500; }
.metric-stats-days ul { margin: .38rem 0 0; padding: 0; list-style: none; }
.metric-stats-days li + li { border-top: 1px solid #e3ebe7; }
.metric-stats-days li button { display: grid; grid-template-columns: minmax(0, 1fr) auto .45rem;
  align-items: center; width: 100%; min-height: 37px; padding: .24rem .22rem; border: 0;
  text-align: start; font-size: .83rem; font-weight: 500; }
.metric-stats-days li button:hover { background: #edf5f1; }
.metric-stats-days time { color: var(--muted); }
dialog:has(.day-metric-preview) .dialog-head { justify-content: flex-start; gap: .18rem .55rem; padding: .55rem .72rem; }
dialog:has(.day-metric-preview) .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
dialog:has(.day-metric-preview) .dialog-head button { margin-inline-start: auto; min-height: 34px; padding: .3rem .5rem; font-size: .77rem; }
.day-metric-preview { gap: 0; padding: .65rem .72rem .8rem; }
.day-metric-preview .error:empty { display: none; }
.metric-preview-journal { display: inline-flex; align-items: center; min-height: 32px;
  white-space: nowrap; font-size: .75rem; text-underline-offset: .14em; }
.card-metric-options { max-height: 16rem; overflow: auto; }
.journal-pagination { display: grid; justify-items: center; gap: .35rem; }
.journal-pagination [role="alert"]:empty { display: none; }
.journal-pagination:has(button[hidden]):has([role="alert"]:empty) { display: none; }
dl.fields { margin: .25rem 0 .5rem; }
dl.fields dt { font-size: .86rem; font-weight: 650; padding-top: .5rem; }
dl.fields dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kpis { display: flex; align-items: stretch; flex-wrap: wrap; gap: .6rem; }
.kpi { padding: .6rem .75rem; min-width: 7.3rem; border: 1px solid var(--border); border-radius: 11px; background: #f8f9fd; }
.kpi strong { display: block; font-size: 1.5rem; }
.kpi small { display: block; }
button.kpi { display: block; text-align: left; }
.metric-cell { min-height: 34px; padding: .25rem .45rem; font-weight: 500; color: var(--brand-dark); }
.reflection { padding: .75rem; border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.reflection p { margin-block: .4rem; white-space: pre-wrap; }
.scroll-grid { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: right; }
th, td { padding: .55rem .65rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead { background: var(--paper); }
th:first-child { text-align: left; position: sticky; left: 0; background: #f7f9fc; }
.error { color: #8b2636; }
.toast { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 5; padding: .75rem 1rem; border-radius: 10px; background: #242446; color: white; max-width: calc(100% - 2.4rem); }
dialog { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); width: min(650px, calc(100% - 1.5rem)); max-height: min(90dvh, 800px); color: var(--ink); box-shadow: 0 20px 65px #19193938; }
dialog::backdrop { background: #1c24406b; }
dialog .dialog-head { position: sticky; top: 0; background: white; padding: .95rem 1.2rem; border-bottom: 1px solid var(--border); z-index: 1; }
dialog form { padding: 1rem 1.2rem; }
dialog .dialog-actions { position: sticky; bottom: -1rem; padding: .7rem 0; background: white; }
dialog:has(:is(.compact-filter-dialog, .check-period-editor, .contact-editor, .medical-editor, .metric-batch-picker, .metric-batch-editor)) {
  width: min(28rem, calc(100% - 1.2rem)); }
dialog:has(:is(.compact-filter-dialog, .check-period-editor, .contact-editor, .medical-editor, .metric-batch-picker, .metric-batch-editor)) .dialog-head { padding: .55rem .72rem; }
dialog :is(.compact-filter-dialog, .check-period-editor, .contact-editor, .medical-editor, .metric-batch-picker, .metric-batch-editor) { gap: .48rem; padding: .58rem .72rem; }
:is(.compact-filter-dialog, .check-period-editor, .contact-editor, .medical-editor, .metric-batch-picker, .metric-batch-editor) .error:empty { display: none; }
dialog :is(.compact-filter-dialog, .check-period-editor, .contact-editor, .medical-editor, .metric-batch-editor) .dialog-actions { position: static; justify-content: flex-end; padding: .43rem 0 0;
  border-top: 1px solid var(--border); }
.compact-filter-dialog :is(input[type=search], input[type=date], button) { min-height: 38px; }
.compact-filter-dialog button { padding: .35rem .58rem; font-size: .84rem; }
.contact-editor [data-contact-fields] { display: grid; gap: .48rem; }
.contact-editor input[type=datetime-local] { display: block; min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; }
.contact-editor input[type=datetime-local]::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
.medical-editor :is(select, input, textarea, label) { min-width: 0; }
.medical-editor :is(select, input[type=date], input[type=time], input[type=text], input[name=title]) {
  display: block; max-width: 100%; min-height: 39px; padding: .38rem .48rem; }
.medical-editor :is(input[type=date], input[type=time]) { appearance: none; }
.medical-editor input::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
.medical-editor :is(.medical-date-row, .medical-fields) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.medical-editor label { gap: .2rem; font-size: .84rem; }
.medical-editor legend { font-size: .8rem; margin-bottom: .22rem; color: var(--muted); }
.medical-edit-fold { border-top: 1px solid var(--border); }
.medical-edit-fold > summary { width: 100%; margin-bottom: 0; font-size: .86rem; font-weight: 650; }
.medical-edit-fold label + label, .medical-reminder-field [data-medical-lead] { margin-top: .36rem; }
.medical-booking-fields { display: grid; gap: .28rem; margin-top: .36rem; }
.medical-booking-fields fieldset { padding: 0; }
.medical-reminder-field > .option { align-items: center; }
.medical-reminder-status { display: block; margin-top: .26rem; }
@media (max-width: 400px) {
  .medical-editor .medical-fields { grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); }
  .medical-editor .medical-fields select { font-size: .8rem; padding-inline: .38rem 1rem; }
}
dialog:has(.metric-batch-picker, .metric-batch-editor) .dialog-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
dialog:has(.metric-batch-picker, .metric-batch-editor) .dialog-head h2 { overflow-wrap: anywhere; }
dialog:has(.metric-batch-picker, .metric-batch-editor) [data-close] {
  width: 2.2rem; min-height: 2.2rem; padding: 0; font-size: 1.28rem; }
.metric-batch-choices { display: grid; gap: .32rem; }
.metric-batch-choice { padding: .22rem .44rem; border: 1px solid var(--border); border-radius: 8px; }
.metric-batch-choice > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: .1rem .32rem; min-height: 38px; width: auto; margin: 0; padding: .18rem .08rem; list-style: none; }
.metric-batch-choice > summary::-webkit-details-marker { display: none; }
.metric-batch-choice > summary::marker { content: ''; }
.metric-batch-choice > summary :is(strong, small) { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.metric-batch-choice > summary strong { font-size: .88rem; color: var(--ink); }
.metric-batch-choice > summary small { font-size: .73rem; }
.metric-batch-choice > summary .contact-card-chevron { grid-column: 2; grid-row: 1 / 3; }
.metric-batch-choice[open] > summary .contact-card-chevron { transform: rotate(45deg); }
.metric-batch-choice ul { margin: .2rem 0; padding: .22rem .08rem 0; border-top: 1px solid var(--border); list-style: none; }
.metric-batch-choice li { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem;
  padding: .21rem 0; font-size: .83rem; overflow-wrap: anywhere; }
.metric-batch-choice li small { color: var(--muted); text-align: end; }
.metric-batch-choice > button { display: flex; margin: .36rem 0 .18rem auto; }
.metric-batch-settings { justify-self: start; }
.metric-batch-fields label { grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 45%);
  align-items: center; gap: .38rem; padding: .26rem 0; border-bottom: 1px solid var(--border); }
.metric-batch-editor label { min-width: 0; font-size: .84rem; overflow-wrap: anywhere; }
.metric-batch-editor :is(input, select) { display: block; min-width: 0; max-width: 100%; min-height: 39px; padding: .3rem .42rem; }
.metric-batch-editor .metric-batch-fields select { font-size: .82rem; }
.metric-batch-editor input[type=datetime-local] { -webkit-appearance: none; appearance: none; }
.metric-batch-editor input::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
.metric-batch-note > summary { width: 100%; font-size: .84rem; }
.metric-batch-note textarea { min-height: 61px; }
.metric-batch-fields { display: grid; gap: .25rem; }
.metric-batch-row { min-width: 0; }
.metric-batch-current { display: flex; align-items: center; gap: .32rem; padding: .37rem .45rem;
  color: var(--muted); background: #eef2f2; border-radius: 8px; font-size: .82rem; }
.metric-batch-current > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.metric-batch-current small { display: block; font-size: .72rem; }
.metric-batch-current small:empty { display: none; }
.metric-batch-current output { flex-shrink: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-batch-current button { display: grid; place-items: center; flex: 0 0 auto; width: 30px; min-height: 30px;
  padding: 0; border-color: #dbe5e1; border-radius: 7px; color: var(--brand-dark); font-size: 1rem; }
.metric-batch-current button .record-glyph { width: 15px; height: 15px; }
.metric-batch-input { min-width: 0; padding: 0; margin: 0; border: 0; }
.metric-batch-current:not([hidden]) + .metric-batch-input:not([hidden]) { margin-top: .23rem; }
.timed-metric { display: grid; gap: .35rem; min-width: 0; }
.metric-timer { min-width: 0; padding: .4rem .55rem; border: 1px solid #dce8e4; border-radius: 9px; background: #f2f7f5; }
.metric-timer > summary { min-height: 24px; padding-top: 0; font-size: .83rem; font-weight: 680; }
.metric-timer-presets, .metric-timer-row { display: flex; align-items: center; flex-wrap: wrap; gap: .33rem; margin-top: .35rem; }
.metric-timer button { min-height: 38px; padding: .3rem .6rem; font-size: .81rem; }
.metric-timer button[aria-pressed=true] { background: #e0efe9; border-color: #a7cabb; color: var(--brand-dark); font-weight: 700; }
.metric-timer button:disabled:not([aria-pressed=true]) { opacity: .55; }
.metric-timer-row { justify-content: space-between; gap: .5rem; }
.metric-timer-row [role=timer] { color: var(--brand-dark); font-size: 1.6rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.metric-timer [data-timer-custom] { grid-template-columns: minmax(0, 1fr) minmax(0, 5.5rem); align-items: center;
  gap: .4rem; margin-top: .35rem; padding: 0; border: 0; font-size: .83rem; }
.metric-timer [data-timer-custom] input { min-width: 0; min-height: 38px; padding: .3rem .45rem; }
.metric-timer [data-timer-status] { margin: .24rem 0 0; }
.metric-timer [data-timer-status]:empty { display: none; }
.mood-scale-field { min-width: 0; margin-block: .14rem .33rem; }
.mood-scale-field legend { margin-bottom: .34rem; font-size: .88rem; }
.mood-scale-options, .mood-scale-guide { display: grid; gap: .18rem; }
.mood-scale-options { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mood-scale-options label { position: relative; display: block; min-width: 0; }
.mood-scale-options input[type=radio] { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.mood-scale-options label > span { display: grid; place-items: center; min-height: 41px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--paper); font-size: .8rem; font-variant-numeric: tabular-nums; }
.mood-scale-options label[data-value-sign="-1"] { --mood-tint: #f8e5e8; --mood-ink: #862f40; }
.mood-scale-options label[data-value-sign="1"] { --mood-tint: #dbefe6; --mood-ink: #1a5d4b; }
.mood-scale-options input:checked + span { background: var(--mood-tint, #e1eaec);
  color: var(--mood-ink, var(--ink)); border-color: currentColor; font-weight: 750; }
.mood-scale-options input:focus-visible + span { outline: 2px solid #6656c4; outline-offset: 1px; }
.mood-scale-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .2rem;
  color: var(--muted); font-size: clamp(.59rem, 2.4vw, .73rem); text-align: center; }
.mood-scale-guide span:first-child { text-align: start; }
.mood-scale-guide span:last-child { text-align: end; }
.mood-scale-field [data-clear-mood] { padding-inline: 0; font-size: .73rem; }
dialog:has(.metric-entry-picker, .metric-entry-form) { width: min(28rem, calc(100% - 1.2rem)); }
dialog:has(.metric-entry-picker, .metric-entry-form) .dialog-head { padding: .5rem .72rem; }
dialog:has(.metric-entry-picker, .metric-entry-form) [data-close] { min-width: 44px; padding: .25rem; font-size: 1.3rem; }
dialog :is(.metric-entry-picker, .metric-entry-form) { gap: .42rem; padding: .55rem .72rem; }
:is(.metric-entry-picker, .metric-entry-form) .error:empty { display: none; }
.metric-entry-form input[type=datetime-local] { appearance: none; min-width: 0; max-width: 100%; }
.metric-entry-form input::-webkit-date-and-time-value { margin: 0; min-width: 0; text-align: start; }
.metric-entry-form textarea { min-height: 58px; }
dialog .metric-entry-form .dialog-actions { bottom: -.55rem; justify-content: flex-end; padding: .4rem 0 .1rem; }
.metric-entry-form .dialog-actions button { padding-inline: .55rem; font-size: .85rem; }
dialog:has(.metric-entry-form .timed-metric) .dialog-head { flex-wrap: nowrap; }
dialog:has(.metric-entry-form .timed-metric) .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
dialog .metric-entry-form:has(.timed-metric) .dialog-actions { bottom: 0; }
.metric-entry-search { position: relative; }
.metric-entry-search input { padding-inline-start: 2.25rem; }
.metric-entry-search-icon { position: absolute; inset-inline-start: .82rem; top: 50%; transform: translateY(-60%);
  width: .71rem; height: .71rem; border: 1.6px solid var(--muted); border-radius: 50%; pointer-events: none; }
.metric-entry-search-icon::after { content: ''; position: absolute; left: .48rem; top: .49rem; width: .34rem;
  height: 1.6px; background: var(--muted); transform: rotate(45deg); transform-origin: left center; }
.metric-entry-choices { display: grid; grid-auto-rows: max-content; gap: .23rem;
  overflow-y: auto; max-height: min(48dvh, 24rem); padding: 2px; }
.metric-entry-choices:empty { display: none; }
.metric-entry-choices button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto .48rem;
  gap: .45rem; align-items: center; min-height: 44px; padding: .25rem .65rem .25rem .35rem;
  text-align: start; border-color: transparent; background: var(--paper); font-size: .86rem; }
.metric-entry-choices button:hover { background: var(--tint); }
.metric-entry-choices strong { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.metric-entry-choices small { color: var(--muted); }
.metric-entry-choices .contact-card-chevron { grid-column: 4; }
.metric-entry-icon { display: grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border-radius: 7px; background: var(--tint); }
.medical-edit-fold textarea { min-height: 63px; }
.journal-period-options { margin: 0; min-inline-size: 0; }
.journal-period-options legend { padding: 0; margin-bottom: .24rem; color: var(--muted); font-size: .77rem; }
.journal-period-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .24rem; }
.journal-period-presets button { min-width: 0; border-radius: 8px; }
.journal-period-presets [aria-pressed=true], .journal-content-option:has(input:checked) { border-color: #a4c8ba;
  background: var(--tint); color: var(--brand-dark); }
.journal-recent-days { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 9rem); align-items: center;
  gap: .36rem; padding: .26rem 0; border-block: 1px solid var(--border); }
.journal-recent-days > label { font-size: .84rem; }
.journal-day-stepper { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem; gap: .2rem; }
.journal-day-stepper button { padding: 0; font-size: 1rem; }
.journal-day-stepper input { min-width: 0; min-height: 38px; padding: .22rem; text-align: center; appearance: textfield; }
.journal-day-stepper input::-webkit-inner-spin-button { appearance: none; }
.journal-period-dates { gap: .36rem; }
.journal-period-dates label { min-width: 0; gap: .2rem; font-size: .8rem; }
.check-period-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .36rem; }
.check-period-fields label { min-width: 0; gap: .22rem; font-size: .8rem; }
.check-period-fields :is(input, select) { min-width: 0; padding-inline: .46rem; }
.journal-content-choices { max-height: min(46dvh, 24rem); overflow: auto; overscroll-behavior: contain; }
.journal-content-group + .journal-content-group { margin-top: .52rem; }
.journal-content-group legend { margin-bottom: .22rem; color: var(--muted); font-size: .76rem; }
.journal-content-option { display: flex; align-items: center; gap: .44rem; min-height: 36px; padding: .24rem .4rem;
  border: 1px solid transparent; border-radius: 7px; font-size: .87rem; overflow-wrap: anywhere; }
.journal-content-option input { flex-shrink: 0; margin: 0; }
.journal-content-option span { min-width: 0; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%,430px); padding: 2rem; }
.login-card .brand { padding: 0; margin-bottom: 1.4rem; }
.login-card h1 { font-size: 2rem; margin-bottom: 1.1rem; }
@media (max-width: 640px) {
  .topbar-inner { min-height: 56px; }
  .workspace { padding: .9rem .75rem 3.5rem; }
  .page-head { margin-bottom: 1rem; }
  .toast { bottom: 1rem; right: .75rem; }
}

.day-page { display: grid; gap: 1.45rem; min-width: 0; }
.day-head {
  background: linear-gradient(130deg, #133f45 0%, #18555a 67%, #1e6362 100%);
  color: #f7ffff; border-radius: 23px; padding: clamp(.88rem, 2.9vw, 1.62rem) clamp(1rem, 3.2vw, 1.8rem);
  box-shadow: 0 12px 25px #1c4d4b17;
}
.day-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; }
.day-heading h1 { font-size: clamp(2.05rem, 7vw, 3.25rem); }
.day-heading-title { display: flex; align-items: center; gap: .55rem; }
.day-pin-gear { flex: 0 0 34px; min-height: 34px; padding: 0; color: #e2f6ec; background: #ffffff12;
  border-color: #ffffff18; border-radius: 9px; }
.day-pin-gear:hover { background: #ffffff24; border-color: #ffffff46; }
.day-heading p { color: #d8e9e7; margin-top: .36rem; }
.day-add { background: #e2f6ec; border: 0; color: #194f47; min-height: 46px; white-space: nowrap; }
.day-add span { font-size: 1.32rem; line-height: 1; }
.day-add:hover { background: #f4fff8; }
.day-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.day-date { display: flex; align-items: center; gap: .18rem; padding: .22rem; border-radius: 11px; background: #102f365e; }
.day-date button, .day-jump { border: 0; color: #e9fcf4; background: transparent; min-height: 38px; }
.day-date button { min-width: 35px; padding: .08rem .44rem .22rem; font-size: 1.4rem; }
.day-date button:hover, .day-jump:hover { background: #ffffff20; }
.day-date input[type=date] { color-scheme: dark; color: #f6fffb; background: none; border: 0; width: auto; min-height: 38px; padding: .28rem .22rem; font-size: .91rem; }
.day-overview { margin-top: 1.15rem; border-top: 1px solid #ffffff34; padding-top: .65rem; }
.day-pins { --day-pin-columns: 2; display: grid; grid-template-columns: repeat(var(--day-pin-columns), minmax(0, 1fr));
  gap: .42rem; margin-top: .55rem; }
.day-pins[data-day-pin-columns="1"] { --day-pin-columns: 1; }
.day-pins[data-day-pin-columns="3"] { --day-pin-columns: 3; }
.day-pin-card { display: grid; justify-content: stretch; align-content: start; gap: .19rem; min-width: 0;
  padding: .46rem .52rem; text-align: start; border-color: #d2f5e72c; border-radius: 9px; background: #ffffff14; color: #f3fff8; }
.day-pin-card:hover { background: #ffffff24; border-color: #d2f5e762; }
.day-pin-card-title { display: flex; align-items: center; gap: .3rem; min-width: 0; font-size: .77rem; line-height: 1.2; font-weight: 690; }
.day-pin-card-title .record-glyph { width: 15px; height: 15px; flex-basis: 15px; }
.day-pin-card-title > span, .day-pin-card-description { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.day-pin-card-description { color: #d0e9e4; font-size: .7rem; line-height: 1.25; font-weight: 530; }
.day-pin-card-description strong { font-size: .84rem; font-variant-numeric: tabular-nums; color: #f5fff8; }
.day-pin-card-description small { color: inherit; font-size: inherit; }
.day-pin-card-steps .day-pin-card-description { display: flex; flex-wrap: wrap; align-items: baseline; gap: .08rem .23rem; }
.day-pin-card-metric_group .day-pin-card-description { display: grid; gap: .11rem; }
.day-pin-group-count, .day-pin-group-values { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-pin-group-count { font-variant-numeric: tabular-nums; }
.day-pin-progress { appearance: none; display: block; width: 100%; height: 4px; margin-top: .12rem; border: 0;
  border-radius: 4px; overflow: hidden; background: #c5e8dd3b; }
.day-pin-progress::-webkit-progress-bar { background: #c5e8dd3b; }
.day-pin-progress::-webkit-progress-value { background: #89dbbc; border-radius: 4px; }
.day-pin-progress::-moz-progress-bar { background: #89dbbc; border-radius: 4px; }
dialog:has(.day-settings-accordion) { width: min(31rem, calc(100% - 1.2rem)); }
dialog:has(.day-settings-accordion) .dialog-head { padding: .5rem .72rem; flex-wrap: nowrap; }
dialog:has(.day-settings-accordion) .dialog-head button { width: 34px; min-height: 34px; padding: 0; flex: 0 0 34px; font-size: 1.1rem; }
.day-settings-accordion { display: grid; gap: .36rem; padding: .65rem .72rem; }
.day-settings-accordion > details { min-width: 0; border: 1px solid #dce9e4; border-radius: 9px; }
.day-settings-accordion > details > summary { display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 42px; padding: .32rem .62rem; background: #f2f7f5; border-radius: 8px; cursor: pointer;
  color: var(--brand-dark); font-size: .88rem; font-weight: 680; list-style: none; }
.day-settings-accordion > details > summary::-webkit-details-marker { display: none; }
.day-settings-accordion > details > summary::after { content: ''; width: 7px; height: 7px; margin-inline-end: .15rem;
  transform: rotate(45deg); border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.day-settings-accordion > details[open] > summary { border-radius: 8px 8px 0 0; border-bottom: 1px solid #dce9e4; }
.day-settings-accordion > details[open] > summary::after { transform: rotate(225deg); }
dialog .day-settings-form { display: grid; gap: .5rem; padding: .58rem .58rem .42rem; }
.day-settings-form .error:empty { display: none; }
.day-settings-form .dialog-actions { position: static; justify-content: space-between; padding: .2rem 0 0; }
.day-settings-result { color: var(--brand-dark); font-size: .78rem; }
.day-event-settings { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; gap: .38rem;
  min-width: 0; margin: 0; padding: 0 0 .52rem; border: 0; border-bottom: 1px solid var(--border); }
.day-event-settings legend { padding: 0; margin-bottom: .28rem; font-size: .9rem; font-weight: 700; }
.day-event-settings label { gap: .16rem; min-width: 0; font-size: .78rem; }
.day-event-settings :is(select, input) { min-width: 0; min-height: 36px; padding: .25rem .4rem; }
.day-display-sections { min-width: 0; margin: 0; border: 0; padding: 0 0 .5rem; border-bottom: 1px solid var(--border); }
.day-display-sections legend { padding: 0; margin-bottom: .24rem; font-size: .9rem; font-weight: 700; }
.day-display-order { display: grid; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.day-display-row { display: flex; align-items: center; gap: .25rem; padding-inline-end: .22rem;
  border: 1px solid #e4eeea; border-radius: 8px; background: var(--panel); }
.day-display-row:has(:checked) { background: #edf5f1; border-color: #dcebe3; }
.day-display-row .option { flex: 1; min-width: 0; align-items: center; min-height: 35px;
  padding: .28rem .44rem; gap: .38rem; font-size: .79rem; background: transparent; }
.day-display-row .option input { margin-top: 0; }
.day-display-row .metric-group-grip { min-height: 34px; }
.day-display-row[data-metric-dragging] { opacity: .32; }
.day-display-row.metric-group-drag-preview { background: #e4f3ed; }
.day-display-sections input { accent-color: var(--brand); }
.day-chart-setting { grid-template-columns: minmax(0, 1fr) auto; align-items: center; font-size: .82rem; }
.day-chart-setting :is(input, select) { min-height: 36px; font-size: .82rem; padding: .24rem .38rem; }
.day-chart-setting input { width: 4.25rem; }
.day-pin-settings-body { display: grid; gap: .46rem; margin-top: .45rem; }
.day-pin-columns { display: flex; align-items: center; justify-content: space-between; min-width: 0; margin: 0; padding: .15rem 0; border: 0; }
.day-pin-columns legend { float: left; margin: 0; padding: .42rem 0; font-size: .83rem; }
.day-pin-columns > div { display: flex; gap: .22rem; }
.day-pin-columns label { position: relative; cursor: pointer; }
.day-pin-columns input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-pin-columns span { display: grid; place-items: center; min-width: 34px; min-height: 33px; border: 1px solid var(--border);
  border-radius: 7px; font-size: .81rem; }
.day-pin-columns input:checked + span { background: #e2f0e9; border-color: #accabb; color: var(--brand-dark); }
.day-pin-columns input:focus-visible + span { outline: 3px solid #645bd3; outline-offset: 2px; }
.day-pin-selected { display: grid; gap: .23rem; }
.day-pin-selected:empty { display: none; }
.day-pin-selected-row { display: flex; align-items: center; justify-content: space-between; gap: .32rem; min-width: 0;
  padding: .18rem .25rem .18rem .45rem; border-radius: 8px; background: #f0f6f3; font-size: .8rem; }
.day-pin-selected-row > span, .day-pin-selected-row > div { display: flex; align-items: center; gap: .26rem; min-width: 0; }
.day-pin-selected-row > div { flex: 0 0 auto; }
.day-pin-selected-row strong { overflow-wrap: anywhere; }
.day-pin-selected-row button { min-width: 31px; min-height: 32px; padding: 0; border-radius: 6px; }
.day-settings-form button:disabled { cursor: default; }
.day-pin-goal { display: flex; align-items: center; justify-content: space-between; gap: .35rem; font-size: .8rem; }
.day-pin-goal input { width: 7rem; min-height: 37px; padding: .3rem .42rem; }
.day-pin-quick-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .34rem; }
.day-pin-choice { width: 100%; min-height: 35px; justify-content: space-between; gap: .25rem; min-width: 0; padding: .3rem .46rem;
  border-radius: 7px; text-align: start; font-size: .8rem; }
.day-pin-choice > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.day-pin-choice small { display: block; font-size: .72rem; font-weight: 500; }
.day-pin-choice [data-day-pin-choice-mark] { color: var(--brand-dark); font-size: 1rem; }
.day-pin-picker { border: 1px solid var(--border); border-radius: 8px; padding: .35rem .48rem; }
.day-pin-picker > summary { cursor: pointer; color: var(--brand-dark); padding: .12rem 0; font-size: .82rem; font-weight: 650; }
.day-pin-picker-list { display: grid; gap: .25rem; margin-top: .36rem; max-height: 13rem; overflow-y: auto; }
.day-pin-picker-list p { font-size: .77rem; }
.day-pin-picker input[type=search] { min-height: 36px; margin-top: .3rem; padding: .22rem .42rem; }
.sleep-detail > summary::-webkit-details-marker, .emotion-panel > summary::-webkit-details-marker,
.source-detail > summary::-webkit-details-marker { display: none; }
.sleep-detail > summary::marker, .source-detail > summary::marker, .emotion-panel > summary::marker { content: ''; }
.day-overview-toggle { color: #e4f4ee; border: 0; background: #ffffff13; min-height: 34px; font-size: .74rem; padding: .3rem .48rem; }
.day-overview-toggle:hover { background: #ffffff20; }
.day-overview-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: .22rem; }
.day-overview-toggle[aria-expanded="true"] .day-overview-chevron { transform: rotate(225deg); }
.day-band-track { --band-chip-size: 18px; height: 14px; position: relative; border-radius: 10px; background: #d9f2ee4d; margin: .55rem .3rem 0; }
.night-segment, .band-divider, .band-now { position: absolute; left: var(--position, 0%); }
.night-segment { top: 0; width: var(--width,0%); height: 100%; border-radius: 10px; background: #a7adee; opacity: .94; }
.night-segment[class*="sleep-"] { border-radius: 1px; opacity: 1; }
.sleep-deep { background: #7f72d1; }
.sleep-light { background: #b9b7f3; }
.sleep-rem { background: #5cc1da; }
.sleep-awake { background: #ef967a; }
.band-workouts { position: absolute; inset: 0; overflow: hidden; }
.band-workout-segment { position: absolute; inset-block: 0; left: calc(var(--position) + var(--width) / 2);
  width: max(2px, var(--width)); transform: translateX(-50%); background: #81d5a8; }
.band-divider { height: 100%; border-left: 1px solid #e1f0ed6a; }
.band-event-button { position: absolute; z-index: 3; top: 0; left: var(--band-event-left, 0px); width: var(--band-event-width, calc(var(--band-chip-size) + 8px));
  transform: translateY(-100%); gap: 0; min-height: 36px; padding: 2px 4px; border: 0; background: transparent; border-radius: 100px; }
.band-event-button:hover, .band-event-button[aria-expanded="true"] { background: #ffffff25; }
.band-event-chip { position: absolute; bottom: 16px; left: var(--band-chip-center, 50%); transform: translate(-50%, 50%);
  display: grid; place-items: center; width: var(--band-chip-size); height: var(--band-chip-size);
  border: 1px solid #305e63; border-radius: 50%; background: #e4f4ed; }
.day-head .band-event-chip .record-glyph { width: 16px; height: 16px; color: #21504a; }
.band-event-chip:has(.glyph-pill) { background: #e4eafb; }
.band-event-chip:has(.glyph-plate, .glyph-cup) { background: #f9e8d0; }
.band-event-chip:has(.glyph-spark, .glyph-speech) { background: #f0dff1; }
.band-event-chip:has(.glyph-night) { background: #dcd8f6; }
.day-head .band-event-chip .glyph-night { color: #443885; }
.band-event-chip[data-band-reminder="pending"] { background: #f6e6bc; border-color: #8a733f; }
.band-event-chip[data-band-reminder="done"] { background: #cbead7; border-color: #4f806d; }
.band-event-chip[data-band-reminder="skipped"] { background: #e5e9e8; border-color: #788788; }
.day-head .band-event-chip[data-band-reminder="pending"] .record-glyph { color: #735519; }
.day-head .band-event-chip[data-band-reminder="skipped"] .record-glyph { color: #5f6e70; }
.band-now { top: -7px; bottom: -7px; z-index: 2; border-left: 2px dashed #ffd17d; transform: translateX(-50%); pointer-events: none; }
.day-band-labels { display: block; position: relative; margin: .55rem .3rem 0; min-height: 1.1rem; font-size: .74rem; color: #e1f1ef; font-variant-numeric: tabular-nums; }
.day-band-labels > span { position: absolute; }
.band-edge-start { left: 0; }
.band-edge-end { right: 0; }
.band-tick-label { left: var(--position, 0%); transform: translateX(-50%); }
.day-now-clock { display: inline-flex; align-items: baseline; gap: .34rem; color: #ffe0a8; white-space: nowrap;
  font-size: .74rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.day-now-clock time { font-size: clamp(.9rem, 3.4vw, 1.03rem); font-weight: 720; }
.day-now-clock small { display: inline-block; min-width: 3.5ch; color: inherit; font-size: .66em; font-weight: 600; }
.day-checks .check-period { margin-left: auto; white-space: nowrap; min-height: 32px; padding: .18rem .48rem; gap: .24rem;
  border-color: #dbe7e2; border-radius: 7px; background: #eef4f2; color: #36564f; font-size: .74rem; }
.day-checks .check-period:hover, .check-period-options button[aria-pressed="true"] { background: #e1f0ea; border-color: #a9cabc; color: var(--brand-dark); }
.day-checks .check-period::after { content: '⌄'; }
.check-period-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .36rem; }
.check-period-options button { min-height: 36px; padding: .25rem .32rem; border-radius: 8px; font-size: .8rem; }
.fold-preview { display: block; margin-top: .18rem; color: #61737a; font-size: .76rem; font-weight: 480;
  line-height: 1.35; overflow-wrap: anywhere; }
details[open] > summary .fold-preview { display: none; }
.day-check-tables { container-type: inline-size; margin-top: .4rem; }
.day-check-grid { table-layout: fixed; }
.day-check-grid .check-name-col { width: 29%; }
.day-check-grid thead { background: transparent; }
.day-check-grid th, .day-check-grid td { padding: 0; vertical-align: middle; text-align: center; }
.day-check-grid th:first-child { position: static; background: transparent; text-align: start; }
.day-check-grid thead th { position: relative; height: 1.2rem; font-size: .64rem; font-weight: 660; }
.day-check-grid thead time { position: absolute; top: .14rem; left: 50%; transform: translateX(-50%); }
.check-grid-dense .check-date-first time { left: 0; transform: none; }
.check-grid-dense .check-date-last time { right: 0; left: auto; transform: none; }
.check-grid-dense .check-date-anchor:not(.check-date-first, .selected-day) { box-shadow: inset 1px 0 #e4eeea; }
.check-grid-packed .check-date-minor time, .check-grid-dense .check-date-minor time { display: none; }
.check-week-range, .check-grid-show-range .check-week-end { display: none; }
.check-grid-show-range .check-week-range { display: inline; }
@container (min-width: 28rem) {
  .check-grid-packed:not(.check-grid-weekly) .check-date-minor time { display: block; }
}
@container (min-width: 36rem) {
  .check-grid-roomy .check-week-range { display: inline; }
  .check-grid-roomy .check-week-end { display: none; }
}
@container (min-width: 44rem) {
  .check-grid-packed.check-grid-weekly .check-date-minor time { display: block; }
}
.day-check-grid .selected-day { color: var(--brand-dark); background: #f1f6f4; font-weight: 760; }
.check-row-name { width: 100%; min-height: 34px; justify-content: space-between; gap: .18rem; padding: .2rem .25rem .2rem 0;
  border: 0; border-radius: 5px; background: transparent; font-size: .75rem; line-height: 1.2; font-weight: 610;
  text-align: start; white-space: normal; overflow-wrap: anywhere; }
.check-row-name::after { content: ''; flex: 0 0 5px; height: 5px; margin-right: .12rem; border-top: 1px solid var(--muted);
  border-right: 1px solid var(--muted); transform: rotate(45deg); }
.check-row-name:hover { color: var(--brand-dark); background: #f1f6f4; }
.check-row-name:focus-visible { outline-offset: -2px; }
.check-unit { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .61rem; font-weight: 480; }
.check-weekly-hint { margin-top: .28rem; font-size: .7rem; }
.day-check-empty { margin: .55rem 0 0; font-size: .84rem; }
.day-check-actions { display: flex; align-items: center; gap: .36rem; flex-wrap: wrap; justify-content: space-between; margin-top: .58rem; }
.day-check-actions .day-link { font-size: .78rem; }
.check-cell { display: grid; justify-items: center; min-width: 0; font-size: .7rem; line-height: 1.1; }
.check-pill { display: grid; place-items: center; min-width: min(100%, 1.16rem); max-width: 100%; min-height: 1.12rem;
  padding-inline: .08rem; overflow: hidden; border-radius: 4px; }
.check-taken, .check-reported { --check-fill: #dff2e9; --check-ink: #075e51; }
.check-skipped { --check-fill: #f8e8e3; --check-ink: #8b4131; }
.check-partial { --check-fill: #f7eddc; --check-ink: #77521e; }
.check-denied { --check-fill: #e9efef; --check-ink: #50676b; }
.check-pill { background: var(--check-fill, transparent); color: var(--check-ink, var(--muted)); }
.check-grid-packed .check-pill { padding-inline: 0; font-size: .63rem; }
.check-grid-packed .check-pill:has(.check-reading-long), .check-grid-dense .check-pill {
  width: 75%; min-width: 1px; min-height: 6px; border-radius: 3px; background: var(--check-ink, transparent); }
.check-grid-packed .check-reading-long, .check-grid-dense .check-reading, .check-grid-dense td .check-unit { display: none; }
.check-plot { --check-baseline: 18px; --check-extent: 16px; position: relative; width: 100%; height: 20px; margin-top: 10px; }
[data-check-axis="down"] .check-plot { --check-baseline: 2px; }
[data-check-axis="both"] .check-plot { --check-baseline: 10px; --check-extent: 9px; }
.check-plot::before { content: ''; position: absolute; top: var(--check-baseline); inset-inline: 0; border-top: 1px solid #d2e1dc; }
.check-plot .check-reading { position: absolute; top: -10px; inset-inline: 0; overflow: hidden; font-size: .63rem; font-weight: 660; }
.check-stem { position: absolute; left: 50%; top: var(--check-baseline); width: min(13px, 72%); min-width: 1px;
  height: max(2px, calc(var(--check-extent) * var(--check-level))); border-radius: 2px 2px 0 0;
  transform: translate(-50%, -100%); background: #368274; }
.check-plot[data-check-side="down"] .check-stem { transform: translateX(-50%); border-radius: 0 0 2px 2px; background: #b36945; }
.check-zero .check-stem { transform: translate(-50%, -40%); border-radius: 50%; width: min(5px, 72%); height: 5px;
  border: 1px solid #5a8884; background: #f6fbf9; }
.check-grid-dense .check-plot { margin-top: 0; }
.check-grid-dense .check-graded .check-stem { border-radius: 0; }
dialog:has(.check-detail-list) { width: min(26rem, calc(100% - 1.2rem)); }
dialog:has(.check-detail-list) .dialog-head { padding: .55rem .72rem; }
.check-detail-list { margin: 0; padding: .25rem .72rem .45rem; }
.check-detail-list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem;
  padding: .4rem 0; font-size: .8rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.check-detail-list > div:last-child { border-bottom: 0; }
.check-detail-list dt { color: var(--muted); }
.check-detail-list dd { margin: 0; text-align: end; line-height: inherit; font-weight: 620; }
.trend-panel { min-width: 0; }
[data-compact-page] .trend-panel { padding-inline: .55rem; }
html:has(.workspace[data-report-page]) { scrollbar-gutter: stable; overscroll-behavior-x: none; }
.workspace[data-report-page] { width: 100%; min-width: 0; overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.report-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.report-controls button { min-height: 44px; }
@media (min-width: 760px) { .report-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
dialog:has(:is(.report-filter-dialog, .report-settings-editor)) { width: min(31rem, calc(100% - 1.2rem)); }
dialog:has(:is(.report-filter-dialog, .report-settings-editor)) .dialog-head { padding: .55rem .72rem; }
dialog :is(.report-filter-dialog, .report-settings-editor) { display: grid; gap: .45rem; padding: .58rem .72rem; }
:is(.report-filter-dialog, .report-settings-editor) .error:empty { display: none; }
dialog .report-settings-editor .dialog-actions { bottom: -.58rem; padding-block: .4rem .1rem; }
.report-extra-settings { display: grid; gap: .5rem; }
.report-settings-fold > summary { padding-block: .32rem; font-size: .87rem; font-weight: 650; }
.report-settings-fold > summary small { color: var(--muted); margin-inline-start: .25rem; }
.report-group-choices { display: grid; gap: .22rem; margin-block-end: .5rem; }
.report-group-choices details { padding: .15rem .55rem .2rem; border-radius: 8px; background: var(--paper); }
.report-group-choices summary { font-size: .83rem; font-weight: 650; }
.report-group-choices :is(p, button) { margin-block-end: .35rem; font-size: .8rem; }
.report-group-choices small, .report-visit-details small { margin-inline-start: .25rem; color: var(--muted); }
.report-visit-options { max-height: 14rem; overflow: auto; }
.report-visit-options :is(legend, strong) { font-size: .83rem; }
.report-visit-options small { color: var(--muted); }
.report-visit-details { margin-top: .45rem; border-top: 1px solid var(--border); }
.report-visit-details summary { font-size: .83rem; font-weight: 650; }
.report-visit-labels { display: grid; gap: .25rem; }
.report-visit-labels button { justify-content: flex-start; min-width: 0; gap: .5rem; text-align: start; font-size: .8rem; }
.report-visit-labels time { flex: 0 0 auto; color: var(--muted); }
.report-visit-labels span { overflow-wrap: anywhere; }
.report-action-list { display: grid; gap: .32rem; }
.report-action-list :is(button, a) { justify-content: flex-start; text-align: start; overflow-wrap: anywhere; }
.report-action-list button[aria-pressed="true"] {
  color: var(--brand-dark); border-color: #a4c8ba; background: var(--tint);
}
.report-period-visits { gap: .34rem; }
.report-period-visits label { min-width: 0; gap: .18rem; font-size: .8rem; }
.report-period-visits select { min-width: 0; min-height: 38px; padding: .3rem .4rem; }
.report-daily-note { margin-top: .5rem; font-size: .8rem; }
.trend-matrix .metric-cell:has(.report-scale-trace) { display: inline-grid; align-content: center; justify-items: center;
  gap: .2rem; font-size: .76rem; line-height: 1; font-variant-numeric: tabular-nums; }
.report-scale-trace { position: relative; display: block; width: min(100%, 2.45rem); min-width: 1.25rem;
  height: 3px; border-radius: 3px; background: #e1ebe8; }
.report-scale-trace > i { position: absolute; inset-block: 0;
  inset-inline-start: clamp(0px, var(--report-scale-start), calc(100% - 2px));
  width: max(2px, var(--report-scale-length)); border-radius: inherit; background: #39846f; }
.report-scale-trace[data-value-sign="-1"] > i { background: #af4759; }
.report-scale-trace[data-value-sign="0"] > i { background: #7c9191; }
.trend-chart-area, [data-report-pages] { width: 100%; min-width: 0; }
.trend-chart-area, .trend-matrix { --trend-name-width: clamp(4.25rem, 23vw, 8rem); }
.trend-chart-area { overflow: clip; touch-action: pan-y pinch-zoom; }
.trend-chart-area[data-chart-fixed] { overflow-x: auto; touch-action: auto; overscroll-behavior-x: none; }
.trend-chart-frame { position: relative; }
.trend-chart-area[data-chart-fixed] .trend-chart-frame { width: calc(var(--trend-name-width) + var(--trend-fixed-dates-width)); }
.trend-period-lines { position: absolute; inset: 0 0 0 var(--trend-name-width); z-index: 2; pointer-events: none; }
.trend-period-lines i { position: absolute; inset-block: 0; width: 1px;
  background: repeating-linear-gradient(to bottom, #87a9a0a0 0 5px, transparent 5px 8px, #87a9a0a0 8px 9px, transparent 9px 12px); }
.trend-matrix {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.trend-name-col { width: var(--trend-name-width); }
.trend-matrix th, .trend-matrix td { padding: .28rem .35rem; text-align: center; }
.trend-matrix th:first-child { z-index: 3; padding-inline: .24rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.trend-matrix.report-daily-grid { --trend-name-width: clamp(6.25rem, 29vw, 10rem); }
.report-daily-grid tbody th:first-child { font-size: .82rem; hyphens: auto; }
.trend-matrix thead th:first-child { font-size: .78rem; }
.trend-matrix thead th:not(:first-child) { padding-inline: 2px; border-left: 1px solid #d6e2df; }
.trend-matrix thead th.trend-week-start { border-left-color: #9fb9b1; }
.trend-matrix thead th[data-report-visit-day] { background: #fcf4e8; box-shadow: inset 0 -2px #b87944; }
.trend-matrix thead time { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; line-height: 1.35; }
.trend-metric-name { display: flex; align-items: center; gap: .2rem; font-size: .79rem; overflow-wrap: anywhere; }
.trend-matrix th small { display: block; margin-top: .16rem; font-size: .7rem; font-weight: 500; }
.trend-scale-legend { color: var(--muted); overflow-wrap: anywhere; }
.trend-scale-legend span { display: block; }
.trend-matrix td { padding-inline: 1px; }
.trend-matrix:not(.trend-chart) td { white-space: normal; overflow-wrap: anywhere; }
.trend-matrix td .metric-cell {
  display: block; width: 100%; padding-inline: .15rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; font-size: .78rem;
}
.trend-chart {
  --trend-plot-height: 3.3rem;
  --trend-label-room: 0rem;
}
.trend-chart thead time { font-size: var(--trend-fit-date-size, var(--trend-date-size, 10px)); }
.trend-chart[data-chart-height="compact"] { --trend-plot-height: 2.45rem; }
.trend-chart[data-chart-height="tall"] { --trend-plot-height: 5.4rem; }
.trend-chart[data-trend-values] { --trend-label-room: .85rem; }
.trend-chart thead th:not(:first-child), .trend-chart td { padding-inline: 0; border-inline-start: 0; }
.trend-chart[data-fit-ticks] thead th:not(:first-child) { position: relative; }
.trend-chart[data-fit-ticks] thead time { position: absolute; left: 50%; top: 50%; width: 100%;
  transform: translate(-50%, -50%); clip-path: inset(50%); }
.trend-chart[data-fit-ticks] thead th[data-trend-tick] time { z-index: 1; width: max-content; clip-path: none; }
.trend-chart[data-fit-ticks] .trend-slot.empty { font-size: 0; }
.trend-matrix tbody tr:nth-child(3n+2 of :not(.trend-inline-totals)) { --trend-color: #6e61b4; }
.trend-matrix tbody tr:nth-child(3n of :not(.trend-inline-totals)) { --trend-color: #a55d35; }
.trend-slot { width: 100%; height: calc(var(--trend-plot-height) + var(--trend-label-room)); min-height: 0;
  position: relative; display: grid; place-items: center; padding: 0; border: 0; background: transparent; }
.trend-slot:hover { background: #f1f7f4; }
.trend-drawing { position: absolute; inset: var(--trend-label-room) 0 0; pointer-events: none; }
.trend-drawing::before { content: ''; position: absolute; bottom: var(--trend-zero); left: 0; right: 0; border-top: 1px solid #d7e4df; }
[data-trend-average] .trend-drawing::after { content: ''; position: absolute; bottom: var(--trend-average); left: 0; right: 0;
  z-index: 1; border-top: 1px dashed #bf7838; }
.trend-slot.empty { color: #82928f; font-size: .7rem; }
.trend-bar { position: absolute; inset-inline: var(--trend-bar-inset, 20%); bottom: var(--trend-bottom); height: var(--trend-height);
  background: var(--trend-color, #398471); border-radius: 2px; }
.trend-bar.zero { bottom: clamp(0px, calc(var(--trend-bottom) - 1.5px), calc(100% - 3px)); height: 3px; }
.trend-inline-value { position: absolute; left: 0; right: 0; bottom: calc(var(--trend-top) + 3px); z-index: 2; font-size: .62rem;
  line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; overflow: hidden; }
.trend-smoothing { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.trend-line-key { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .55rem; font-size: .76rem; color: var(--muted); }
.trend-line-key span { display: inline-flex; align-items: center; gap: .35rem; }
.trend-line-key i { width: 1.15rem; border-top: 2px solid #225b96; }
.trend-line-key .trend-key-average { border-top: 1px dashed #bf7838; }
.report-date-pager { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: .45rem; margin-bottom: .6rem; color: var(--muted); font-size: .8rem; text-align: center; }
.report-date-pager button { min-height: 44px; min-width: 44px; padding: .25rem; font-size: 1.25rem; }
.report-daily-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: .32rem; margin-bottom: .36rem; }
.report-daily-toolbar .report-date-pager { gap: .22rem; margin: 0; font-size: .72rem; font-variant-numeric: tabular-nums; }
.report-daily-toolbar .report-date-pager-still { display: block; padding-inline: .2rem; text-align: start; }
.report-daily-toolbar button { min-width: 36px; min-height: 36px; border-radius: 7px; }
.report-daily-toolbar [data-report-fit] { padding: .28rem .48rem; color: var(--brand-dark); background: var(--tint); font-size: .73rem; }
[data-report-daily-note] { margin-top: .35rem; font-size: .71rem; }
.trend-matrix.report-daily-fit { --trend-name-width: clamp(4.625rem, 22vw, 8rem); }
.report-daily-fit thead { background: var(--paper); }
.report-daily-fit thead th:first-child { padding: .25rem .2rem; font-size: .62rem; white-space: nowrap; }
.report-daily-fit thead th:not(:first-child) { position: relative; border-left: 0; padding: 0; }
.report-daily-fit thead time { display: none; position: absolute; inset-inline-start: 50%; inset-block-start: 50%; z-index: 1;
  width: max-content; transform: translate(-50%, -50%); font-size: .53rem; font-weight: 650; }
.report-daily-fit thead th[data-daily-date-label] time, .report-daily-measuring thead time { display: block; }
.report-daily-fit thead th:nth-child(2) time { inset-inline-start: 0; transform: translateY(-50%); }
.report-daily-fit thead th:last-child:not(:nth-child(2)) time { inset-inline: auto 0; transform: translateY(-50%); }
.report-daily-fit tbody th:first-child { padding: .2rem; background: var(--paper); font-size: .65rem; line-height: 1.16; }
.report-daily-fit tbody th > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.report-daily-fit tbody td { padding: 0; }
.report-daily-fit :is(.daily-value-control, .daily-value-mark) { display: block; position: relative; width: 100%; height: 1.65rem; }
.report-daily-fit .daily-value-control { min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 3px; }
.report-daily-fit .daily-value-control:is(:hover, :focus-visible) { background: var(--tint); }
.report-daily-fit .daily-value-control:focus-visible { z-index: 2; outline-offset: -1px; }
.daily-fit-plot { position: absolute; inset: auto 0 4px; height: 45%; pointer-events: none; }
.daily-fit-plot > i { position: absolute; display: block; inset-block-end: var(--daily-bar-bottom, 0%); inset-inline-start: 50%;
  transform: translateX(-50%); width: min(var(--daily-bar-width, 60%), .75rem); height: max(2px, var(--daily-bar-height, 0%));
  border-radius: .65px; background: #378675; }
.daily-value-mark[data-daily-sign="negative"] i { background: #ab5267; }
.daily-value-mark[data-daily-sign="zero"] i { width: min(65%, .6rem); height: 2px; background: #647d7c;
  inset-block-end: clamp(0px, calc(var(--daily-bar-bottom) - 1px), calc(100% - 2px)); }
.daily-value-mark[data-daily-sign="missing"] i { width: min(56%, 2px); height: 2px; background: #afc4c1; }
[data-daily-average] .daily-fit-plot::after { content: ''; position: absolute; inset-inline: 0;
  inset-block-end: var(--daily-average); z-index: 1; border-top: 1px dashed #bf7838; }
.daily-value-text { display: none; position: absolute;
  inset-block-end: calc(6px + (var(--daily-caption-top, 0%) * .45)); inset-inline-start: 50%; width: max-content;
  transform: translateX(-50%) scaleX(var(--daily-value-scale, 1)); font-size: .42rem; font-weight: 650;
  line-height: 1; font-variant-numeric: tabular-nums; z-index: 3; }
.report-daily-measuring .daily-value-text { transform: translateX(-50%); }
[data-report-daily-legend] .trend-line-key { margin-top: .33rem; gap: .22rem .72rem; font-size: .68rem; }
[data-daily-label-mode="full"] .daily-value-text:not([data-daily-alternate-text]),
[data-daily-label-mode="alternate"] [data-daily-alternate-text],
.report-daily-measuring .daily-value-text { display: block; }
.daily-alternate-unit { display: none; }
[data-daily-label-mode="alternate"] .daily-alternate-unit { display: inline; }
.trend-summary h3 { margin-block: .9rem .5rem; }
.settings-page { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.settings-page .settings-panel { display: grid; gap: .4rem; padding: .58rem .7rem; }
[data-compact-page] .settings-panel > .section-title + * { margin-top: 0; }
.settings-page .settings-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.settings-page .settings-actions :is(button, .button) { min-height: 36px; padding: .32rem .42rem; font-size: .81rem; text-align: center; }
.metric-group-list { list-style: none; margin: 0; padding: 0; }
.metric-group-list, .metric-group-selected { display: grid; gap: .27rem; }
.metric-group-selected:empty { display: none; }
.metric-group-empty { font-size: .79rem; padding: .14rem 0; }
.metric-group-row { display: flex; align-items: center; justify-content: space-between; gap: .42rem; min-width: 0;
  padding: .24rem .33rem; background: #f1f6f4; border-radius: 8px; }
.metric-group-grip { display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.1rem; min-height: 2.4rem;
  padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: var(--brand-dark); cursor: grab; touch-action: none; user-select: none; }
.metric-group-grip span { width: 12px; height: 18px;
  background: radial-gradient(circle, currentColor 1.35px, transparent 1.55px) 0 0 / 6px 6px; }
.metric-group-grip:hover:enabled { background: #e2ece7; border-color: #cddfd7; }
.metric-group-grip:disabled { opacity: .32; cursor: default; }
.metric-group-row[data-metric-dragging] { opacity: .32; }
.metric-group-drag-preview { position: fixed; z-index: 20; pointer-events: none;
  background: #e4f3ed; box-shadow: 0 6px 16px #16353030; }
.metric-group-drag-preview .metric-group-grip { cursor: grabbing; }
.metric-group-assist { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.metric-group-open { flex: 1; min-width: 0; min-height: 35px; justify-content: flex-start; gap: .42rem;
  text-align: left; padding: .18rem .23rem; border: 0; background: transparent; }
.metric-group-open:hover { background: #e4f0eb; }
.metric-group-open span { min-width: 0; }
.metric-group-open strong, .metric-group-editor .metric-group-row > strong { display: block; font-size: .85rem; overflow-wrap: anywhere; }
.metric-group-editor .metric-group-row > strong { flex: 1; min-width: 0; }
.metric-group-open small { display: block; margin-top: .08rem; font-size: .72rem; font-weight: 500; }
.metric-group-report { flex: 0 0 auto; min-height: 35px; padding: .25rem .52rem; font-size: .79rem; }
.metric-group-item-controls { display: flex; align-items: center; gap: .22rem; flex: 0 0 auto; }
.metric-group-item-controls button {
  min-width: 31px; min-height: 33px; padding: 0; font-size: .87rem; border-radius: 6px; }
dialog:has(.metric-group-editor) { width: min(32rem, calc(100% - 1.2rem)); }
dialog:has(.metric-group-editor) .dialog-head { padding: .56rem .72rem; }
dialog .metric-group-editor { display: grid; gap: .5rem; padding: .6rem .72rem; }
.metric-group-editor > label, .metric-group-editor .metric-group-item-controls label { font-size: .81rem; }
.metric-group-editor :is(input[name=name], input[type=search]) { min-height: 37px; padding: .28rem .45rem; }
.metric-group-item-controls label { display: inline-flex; align-items: center; gap: .16rem; color: var(--brand-dark); cursor: pointer; }
.metric-group-item-controls input { margin: 0; accent-color: var(--brand); }
.metric-group-options { display: grid; gap: .22rem; max-height: 11rem; overflow-y: auto; padding: .15rem; }
.metric-group-options button { width: 100%; justify-content: space-between; min-height: 34px; padding: .24rem .4rem;
  border-radius: 7px; font-size: .81rem; text-align: start; overflow-wrap: anywhere; }
.metric-group-options button span + span { color: var(--brand-dark); font-size: .94rem; }
.metric-group-editor .error:empty { display: none; }
.metric-group-editor .dialog-actions { justify-content: space-between; padding: .42rem 0 .18rem; }
.metric-group-editor .metric-group-delete { color: #8b4131; }
.settings-disclosure { border-top: 1px solid var(--border); }
.settings-disclosure > summary { display: flex; align-items: center; gap: .35rem; width: 100%; min-height: 32px;
  margin: 0; padding: .28rem .1rem; color: var(--brand-dark); font-size: .81rem; font-weight: 650; }
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary::marker { content: ''; }
.settings-disclosure > summary::after { content: ''; width: .38rem; height: .38rem; margin-inline: auto .24rem;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.settings-disclosure[open] > summary::after { transform: rotate(225deg); }
.settings-disclosure > summary small { font-size: .73rem; font-weight: 500; }
.settings-metrics, .settings-collections { list-style: none; padding: 0; margin: 0; }
.settings-metrics li, .settings-collections li { display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .28rem .05rem; overflow-wrap: anywhere; }
.settings-metrics li + li, .settings-collections li + li { border-top: 1px solid var(--border); }
.settings-metrics strong { font-size: .85rem; }
.settings-metrics small { display: block; font-size: .72rem; }
.settings-metrics button { flex: 0 0 auto; min-height: 30px; padding: .22rem .42rem; border-radius: 7px; font-size: .77rem; }
.metric-catalog-link { flex: 1; display: grid; align-content: center; gap: .06rem; min-width: 0; min-height: 36px;
  padding-inline: .14rem; border-radius: 5px; color: var(--brand-dark); text-decoration: none; }
.metric-catalog-link:hover strong { text-decoration: underline; }
.settings-integration { display: grid; gap: .36rem; padding: .45rem .5rem; border: 1px solid #dbe8e3; border-radius: 9px; background: #f8fbfa; }
.settings-integration-head { display: flex; align-items: center; justify-content: space-between; gap: .28rem .55rem; flex-wrap: wrap; }
.settings-integration-head h3 { font-size: .89rem; }
.settings-state { padding: .14rem .4rem; border-radius: 6px; background: #eef2f2; color: var(--muted); font-size: .72rem; font-weight: 650; }
.settings-state[data-connected] { background: #e8f4ed; color: var(--brand-dark); }
.settings-telegram { padding: .23rem .5rem; }
.settings-telegram > button {
  min-height: 35px; margin-inline-start: auto; padding: .28rem .55rem; font-size: .78rem;
}
.telegram-buttons-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: center; }
.telegram-buttons-search [data-telegram-button-count] { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.telegram-button-options .journal-content-option > span { overflow-wrap: anywhere; }
.telegram-button-options .journal-content-option > small { margin-inline-start: auto; white-space: nowrap; }
.settings-integration p, .settings-integration output, .settings-collections { font-size: .8rem; line-height: 1.35; }
.settings-integration output { display: block; overflow-wrap: anywhere; }
.settings-integration output:empty { display: none; }
.settings-integration details output { margin-top: .28rem; }
.settings-collections small { flex: 0 0 auto; }
.settings-collection-error { color: #8b4131; font-weight: 700; }
@media (max-width: 720px) { .settings-page { grid-template-columns: minmax(0, 1fr); } }
.trend-inline-totals th, .trend-inline-totals td { background: #f0f5f3; padding: .3rem .24rem; vertical-align: middle; }
.trend-inline-totals td { padding-inline: 0; }
.trend-inline-totals th strong { display: block; font-size: .73rem; }
.trend-total-grid { display: grid; align-items: center; }
.trend-total-block { container-type: inline-size; min-width: 0; position: relative; padding-inline: 2px; text-align: center; }
.trend-total-block > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.trend-total-block span { color: var(--muted); font-size: .64rem; }
.trend-total-block strong { font-size: .73rem; }
.trend-total-block b { display: none; }
@container (width < 68px) {
  .trend-total-block span { font-size: .55rem; }
  .trend-total-block strong { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
  .trend-total-block b { display: block; font-size: .63rem; }
}
.trend-summary label, .trend-summary select { font-size: .85rem; }
.trend-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .45rem; }
.trend-totals > div { display: grid; padding: .55rem; border: 1px solid var(--border); border-radius: 8px; }
.trend-totals > div strong { font-size: .81rem; }
.trend-totals > div span { font-size: 1.06rem; font-weight: 750; }
.trend-rule-list { display: grid; gap: .25rem; max-height: 17rem; overflow: auto; }
.trend-rule-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: .3rem; align-items: center; }
.trend-rule-row label, .trend-rule-row select { font-size: .83rem; }
.trend-rule-item { border-bottom: 1px solid var(--border); padding-block: .25rem; }
.trend-policy { color: var(--muted); font-size: .8rem; }
.trend-policy summary { padding-block: .3rem; }
.trend-width-field > span { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.trend-width-value { color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.trend-width-field input[type="range"] { accent-color: var(--brand); padding: 0; border: 0; background: transparent; }
input[name="chart_cell_width"][readonly] { color: var(--muted); background: var(--paper); }
.trend-metric-options { max-height: 13rem; overflow: auto; margin-top: .5rem; }
.quick-records { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .38rem; }
.quick-records button { padding: .45rem .55rem; justify-content: flex-start; text-align: left; min-width: 0; min-height: 45px; font-size: .9rem; font-weight: 600; }
.drinks-screen { max-width: 44rem; }
.drinks-week-heading {
  display: grid; grid-template-columns: 2.2rem minmax(0, 11rem) 2.2rem; justify-content: center; align-items: center; gap: .4rem;
}
.drinks-week-heading button { min-height: 36px; padding: 0; font-size: 1.35rem; line-height: 1; }
.drinks-week-heading input { min-height: 36px; padding: .26rem .4rem; font-size: .91rem; text-align: center; }
.drinks-week-heading button:disabled, .drinks-week button:disabled { opacity: .4; cursor: default; }
.drinks-week { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: .23rem; margin-top: .5rem; }
.drinks-week button {
  display: grid; grid-template-rows: 1fr auto 1fr; gap: .15rem; justify-items: center; text-align: center;
  padding: .24rem .14rem .2rem; min-width: 0; min-height: 51px; border-radius: 8px;
}
.drinks-week button[aria-pressed=true], .drink-picker-category button[aria-pressed=true],
.drink-portion-choices button[aria-pressed=true], .drink-brands button[aria-pressed=true] {
  border-color: #a8d2c6; background: var(--tint); color: var(--brand-dark);
}
.drinks-week button > span:first-child { color: var(--muted); font-size: .66rem; font-weight: 630; }
.drinks-week time { font-size: .9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.drink-volume-bar { align-self: end; display: block; width: max(3px, var(--drink-volume, 0%)); height: 3px;
  border-radius: 4px; background: var(--brand); }
.drink-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .48rem; margin: 0; }
.drink-total { display: grid; gap: .18rem; align-content: start; }
.drink-total dt { font-size: .79rem; font-weight: 620; color: var(--muted); }
.drink-total dd { margin: 0; font-size: clamp(1.1rem, 4vw, 1.45rem); font-weight: 760; line-height: 1.22; letter-spacing: -.035em; }
.drink-total small { font-size: .72rem; line-height: 1.3; }
.drinks-history h2 { margin-bottom: .44rem; }
.drinks-history > p { font-size: .86rem; }
dialog:has(.drink-editor) { width: min(34rem, calc(100% - 1.2rem)); }
dialog:has(.drink-editor) .dialog-head { padding: .55rem .72rem; }
dialog .drink-editor { gap: .52rem; padding: .64rem .72rem; }
dialog .drink-editor .dialog-actions { bottom: 0; justify-content: flex-end; padding: .38rem 0 .12rem; }
.drink-picker {
  min-width: 0; padding: .4rem .52rem; border: 1px solid var(--border); border-radius: 10px; background: #f8fbfa;
}
.drink-picker input[type=search] { min-height: 38px; padding-block: .4rem; }
.drink-picker-options { display: grid; gap: .16rem; max-height: min(31dvh, 13rem); overflow: auto;
  padding: .2rem .16rem; margin-top: .25rem; scrollbar-width: thin; }
.drink-picker[data-has-drink] .drink-picker-options { max-height: min(18dvh, 8rem); }
.drink-picker-category > summary {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; min-height: 29px; padding: .18rem .32rem;
  font-size: .81rem; font-weight: 650; list-style: none; border-bottom: 1px solid #e1ebe8;
}
.drink-picker-category > summary::-webkit-details-marker { display: none; }
.drink-picker-category > summary::after {
  content: ''; width: .35rem; height: .35rem; margin-inline: .15rem;
  border: solid var(--brand-dark); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
}
.drink-picker-category[open] > summary { margin-bottom: .24rem; }
.drink-picker-category[open] > summary::after { transform: rotate(45deg); }
.drink-picker-category > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(6.7rem, 100%),1fr));
  gap: .28rem; padding: .08rem .22rem .25rem; }
.drink-picker-category button {
  min-width: 0; min-height: 34px; padding: .3rem .36rem; line-height: 1.2; font-size: .8rem; overflow-wrap: anywhere;
}
.drink-current { display: flex; gap: .35rem; align-items: center; min-width: 0; font-size: .91rem; overflow-wrap: anywhere; }
.drink-inputs { display: grid; gap: .48rem; }
.drink-brands legend { margin-bottom: .23rem; color: var(--muted); font-size: .75rem; font-weight: 650; }
.drink-brands > div { display: flex; gap: .25rem; flex-wrap: wrap; }
.drink-brands button { min-width: 0; min-height: 31px; padding: .24rem .45rem; border-radius: 999px;
  font-size: .76rem; line-height: 1.2; overflow-wrap: anywhere; }
.drink-portion-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(3.35rem, 100%),1fr)); gap: .28rem; }
.drink-portion-choices button {
  display: grid; gap: .08rem; padding: .25rem .25rem; min-width: 0; min-height: 37px; line-height: 1.15; font-size: .84rem;
}
.drink-portion-choices strong { white-space: nowrap; font-size: .79rem; }
.drink-portion-choices small { font-size: .69rem; }
.drink-editor :is(input[type=number], input[name=label], input[type=datetime-local]) { min-height: 40px; padding-block: .4rem; }
.drink-estimate-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: .12rem .42rem; }
.drink-estimate-info a { font-size: .72rem; }
.drink-facts { color: var(--muted); font-size: .76rem; }
.drink-facts summary { min-height: 25px; padding-top: .12rem; }
.drink-facts dl { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .18rem .5rem; margin: .1rem 0 0; }
.drink-facts dd { margin: 0; text-align: right; }
.drink-note > summary { min-height: 28px; padding-top: .16rem; font-size: .84rem; }
.drink-note textarea { min-height: 55px; }
.record-glyph { display: inline-block; width: 17px; height: 17px; flex: 0 0 17px; color: #23564d;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.day-head .record-glyph { color: #d5f1e9; }
.record-glyph.glyph-night { color: #5d4e94; }
.day-link { padding-inline: .35rem; min-height: 37px; border: 0; color: var(--brand-dark); background: transparent; }
.day-link:hover { text-decoration: underline; }
.today-highlights .section-title { margin-bottom: .58rem; }
.day-oura { display: flex; align-items: center; justify-content: space-between; gap: .35rem .75rem;
  flex-wrap: wrap; margin-bottom: .5rem; color: var(--muted); font-size: .8rem; }
.day-oura .day-link { min-height: 2rem; padding-inline: .45rem; font-size: .82rem; }
.today-highlights h2, .day-main h2 { font-size: 1.22rem; }
.today-highlights h2 small { color: var(--muted); font-size: .72rem; font-weight: 550; white-space: nowrap; }
.today-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.today-metric { display: grid; grid-template-columns: minmax(0, 1fr); gap: .28rem; text-align: left;
  justify-content: stretch; padding: .46rem .55rem; align-content: center; border-radius: 12px; border-color: #dce7e6; min-height: 44px; }
.today-metric-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: baseline; gap: .3rem; }
.today-metric-label, .today-metric-average, .today-metric-latest { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-metric-label { font-size: .79rem; color: var(--muted); }
.today-metric-average { font-size: .68rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.today-metric-average strong { color: var(--ink); font-weight: 700; }
.today-metric-latest { font-size: .68rem; }
.today-metric-chart .metric-mini-plot { height: 29px; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-plot { border-radius: 0; background: transparent; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-plot::before { content: none; }
.today-metric-chart .metric-mini-slots { inset-block-start: 8px; height: auto; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-slots::before { content: ''; position: absolute; inset-inline: 0;
  bottom: clamp(0px,var(--preview-zero,0%),calc(100% - 1px)); border-top: 1px solid #e3e9e8; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-slots > span { container-type: inline-size; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-slots i { inset-inline: .5px; border-radius: 1px 1px 0 0; }
:is(.today-metric-chart, .day-metric-detail) .metric-mini-slots [data-preview-height="0"] i {
  bottom: clamp(0px,var(--preview-bottom),calc(100% - 2px)); }
.metric-mini-label { display: none; position: absolute; inset-inline-start: 50%; transform: translateX(-50%);
  bottom: min(calc(100% + 1px), calc(var(--preview-label-point) + 2px));
  width: max-content; white-space: nowrap; font-size: 7px; line-height: 7px; font-weight: 650;
  color: #47615f; font-variant-numeric: tabular-nums; }
.day-metric-detail .metric-mini-label { font-size: clamp(7px, 38cqi, 10px); line-height: 1.1; z-index: 2; }
.day-metric-detail .metric-mini-label[data-preview-label-size="long"] { font-size: clamp(7px, 30cqi, 10px); }
@container (min-width: 9px) { .metric-mini-label[data-preview-label-size="short"] { display: block; } }
@container (min-width: 15px) { .metric-mini-label[data-preview-label-size="medium"] { display: block; } }
@container (min-width: 20px) { .metric-mini-label[data-preview-label-size="long"] { display: block; } }
.day-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .82fr); align-items: start; gap: 1rem; }
.day-left { grid-area: 1 / 1; }
.day-right { grid-area: 1 / 2; }
.day-main-single { grid-template-columns: minmax(0, 1fr); }
.day-main-single > .stack { grid-area: 1 / 1; }
.day-main-reordered > * { min-width: 0; }
.day-main-reordered > :is(.day-med-reminders, .today-highlights, .day-events, .day-checks, :only-child) { grid-column: 1 / -1; }
.day-main .panel { border-color: #dce7e6; border-radius: 17px; }
.day-main .day-fold-panel { padding: .64rem .75rem; border-radius: 13px; }
.day-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: .36rem .5rem; }
.day-section-head h2 { font-size: 1.05rem; }
.day-section-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #e8f2ed; }
.day-section-icon .record-glyph { width: 15px; height: 15px; }
.day-checks-medications .day-section-icon { background: #e8edf8; }
.day-note .day-section-icon { background: #f4ebd9; }
.day-section-head .day-quiet-action { margin-left: auto; }
.day-quiet-action { min-height: 34px; padding: .29rem .55rem; color: var(--brand-dark); border-color: #e4eeea; background: #f2f7f5; font-size: .76rem; }
.day-quiet-action:hover { background: #e6f0ec; }
.day-events .compact-event-list { margin-top: .5rem; }
.day-events .compact-event { scroll-margin-block-start: 74px; }
.day-events .day-section-head { min-height: 32px; gap: .32rem; flex-wrap: nowrap; }
.day-events .day-section-head h2 { min-width: 0; margin-inline-end: auto; }
.day-events .day-quiet-action { margin-left: 0; min-height: 32px; }
.day-events-toggle, .emotion-panel > summary { display: flex; align-items: center; justify-content: flex-start;
  gap: .32rem; min-height: 32px; padding: 0; color: var(--ink);
  border: 0; background: transparent; font-size: clamp(.82rem, 4vw, 1rem); font-weight: 760; }
.emotion-panel > summary { width: 100%; cursor: pointer; list-style: none; }
.day-events-toggle small { color: var(--muted); font-size: .7rem; font-weight: 550; }
#day-events-body > .day-link { margin-top: .2rem; }
.day-events .empty-events { margin-top: .42rem; }
.day-med-reminders > .section-title a { font-size: .87rem; font-weight: 650; padding-block: .35rem; }
.day-med-reminders > p { font-size: .85rem; }
.reminder-page { max-inline-size: 48rem; }
[data-compact-page] .reminder-page-actions [data-reminder-settings] { inline-size: 2.3rem; padding: 0; }
.reminder-week-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .28rem; margin-bottom: .48rem; }
.reminder-week-nav > div { display: flex; align-items: center; justify-content: center; gap: .42rem; }
.reminder-week-nav strong { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reminder-week-nav > button { width: 2.2rem; min-height: 2.05rem; padding: 0; font-size: 1.28rem; line-height: 1; }
.reminder-week-nav [data-schedule-today] { min-height: 1.85rem; padding: .2rem .42rem; border-color: #dce9e3;
  color: var(--brand-dark); background: #f3f8f5; font-size: .73rem; }
.reminder-week-nav [data-schedule-today]:disabled { opacity: 1; color: var(--muted); background: transparent; border-color: transparent; cursor: default; }
.reminder-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .22rem; }
.reminder-week-day { --reminder-day-bg: #f7faf9; min-height: 3.65rem; padding: .32rem 0; display: grid; justify-items: center;
  align-content: center; gap: .16rem; font-weight: 650; color: var(--muted); background: var(--reminder-day-bg); line-height: 1; }
.reminder-week-day > span:first-child { font-size: .67rem; }
.reminder-week-day time { color: var(--ink); font-size: .83rem; font-variant-numeric: tabular-nums; }
.reminder-week-day[aria-current="date"] time { color: var(--brand-dark); font-weight: 800; }
.reminder-week-day[aria-pressed="true"] { --reminder-day-bg: var(--tint); border-color: #96bcb2; }
.reminder-day-progress { display: grid; place-items: center; position: relative; width: 1.06rem; height: 1.06rem;
  border-radius: 50%; font-size: .72rem; line-height: 1; }
.reminder-day-progress[data-progress="planned"] { background: conic-gradient(var(--brand) var(--reminder-progress), #d9e5e0 0); }
.reminder-day-progress[data-progress="planned"]::after { content: ''; position: absolute; inset: 2.5px;
  border-radius: 50%; background: var(--reminder-day-bg); }
.reminder-day-progress[data-progress="done"] { background: var(--brand); color: white; }
.reminder-day-progress[data-progress="skipped"] { background: #eee3ce; color: #724e1c; font-weight: 800; }
.reminder-day-progress[data-progress="empty"]::after { content: ''; width: .24rem; height: .24rem; border-radius: 50%; background: #bacbc5; }
.reminder-day > .section-title small { font-size: .76rem; white-space: nowrap; }
.reminder-day > p { font-size: .86rem; }
.reminder-occurrences { display: grid; gap: .32rem; }
.reminder-occurrence { width: 100%; min-height: 46px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: .4rem; align-items: center; padding: .38rem .5rem; text-align: start; background: #f8faf9; border-color: #e1ebe7; }
.reminder-occurrence[data-settled="done"] { background: #f2f8f5; }
.reminder-occurrence[data-settled="skipped"] { background: #faf8f2; }
.reminder-occurrence-icon { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: .46rem;
  background: var(--tint); color: var(--brand-dark); font-size: .86rem; font-weight: 750; }
.reminder-occurrence-icon .record-glyph { width: .9rem; height: .9rem; }
.reminder-occurrence[data-settled="skipped"] .reminder-occurrence-icon { background: #eee3ce; color: #724e1c; }
.reminder-occurrence-body { display: grid; justify-items: start; min-width: 0; gap: .12rem; line-height: 1.26; overflow-wrap: anywhere; }
.reminder-occurrence-body strong { font-size: .87rem; font-weight: 700; }
.reminder-occurrence-body small { font-size: .75rem; font-weight: 520; }
.reminder-occurrence-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.reminder-occurrence-body .reminder-occurrence-status, .reminder-filled { color: var(--brand-dark); font-weight: 650; }
.reminder-occurrence[data-settled="skipped"] .reminder-occurrence-status { color: #724e1c; }
.reminder-occurrence time, .reminder-detail-date time { color: var(--brand-dark); font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 750; }
.reminder-schedule-telegram { max-width: 100%; padding: .09rem .3rem; border-radius: .36rem; background: var(--tint); color: var(--brand-dark); font-size: .71rem; }
dialog:has(.reminder-detail) { width: min(32rem, calc(100% - 1.2rem)); overscroll-behavior: contain; }
dialog:has(.reminder-detail) .dialog-head { flex-wrap: nowrap; gap: .3rem; padding: .55rem .72rem; }
dialog:has(.reminder-detail) .dialog-head h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 1.07rem; }
dialog:has(.reminder-detail) .dialog-head button { flex: none; width: 2.2rem; min-height: 2.15rem; padding: 0; }
dialog:has(.reminder-detail) .dialog-head [data-close] { font-size: 1.23rem; }
dialog .reminder-detail { gap: .45rem; padding: .62rem .72rem; }
.reminder-detail .error:empty { display: none; }
.reminder-detail-date { color: var(--muted); font-size: .81rem; }
.reminder-detail-items { list-style: none; padding: 0; margin: 0; }
.reminder-detail-items li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .55rem;
  padding: .32rem 0; border-bottom: 1px solid var(--border); font-size: .84rem; overflow-wrap: anywhere; }
.reminder-filled { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem; font-size: .83rem; }
dialog:has(.metric-reminder-picker) { width: min(28rem, calc(100% - 1.2rem)); }
dialog:has(.metric-reminder-picker) .dialog-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; padding: .58rem .72rem; }
dialog:has(.metric-reminder-picker) [data-close] { width: 2.2rem; min-height: 2.2rem; padding: 0; font-size: 1.28rem; }
dialog .metric-reminder-picker { gap: .42rem; padding: .58rem .72rem; }
.metric-reminder-picker .error:empty { display: none; }
.metric-reminder-picker .quick-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reminder-weekdays { display: flex; flex-wrap: wrap; gap: .3rem; }
.reminder-weekdays label { display: flex; min-height: 38px; align-items: center; gap: .24rem; padding: .25rem .45rem;
  border: 1px solid var(--border); border-radius: 7px; }
.reminder-weekdays input { margin: 0; }
.reminder-catalog, .reminder-log { display: grid; gap: .45rem; }
.reminder-amounts { margin-top: .35rem; }
dialog:has(.reminder-editor) { max-inline-size: calc(100vw - 1.5rem); overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; }
dialog:has(.reminder-editor) .dialog-head { padding: .55rem .85rem; }
dialog .reminder-editor { display: grid; gap: .6rem; min-width: 0; padding: .75rem .85rem; }
.reminder-editor-close { width: 36px; min-height: 36px; padding: 0; font-size: 1.35rem; }
.reminder-editor-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; gap: .45rem; }
.reminder-editor :is(label, fieldset, .cols) { min-width: 0; }
.reminder-editor :is(input:not([type=checkbox]), select) { min-height: 38px; font-size: 1rem; padding: .4rem .55rem; }
.reminder-editor :is(input[type=time], input[type=date]) { display: block; width: 100%; min-width: 0; max-width: 100%;
  -webkit-appearance: none; appearance: none; text-align: start; }
.reminder-editor input::-webkit-date-and-time-value { margin: 0; min-width: 0; text-align: start; }
.reminder-editor .reminder-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; }
.reminder-editor .reminder-weekdays label { justify-content: center; gap: .12rem; padding: .15rem 0; font-size: .75rem; }
.reminder-editor .reminder-weekdays input { width: .78rem; height: .78rem; accent-color: var(--brand); }
.reminder-editor .option { padding-block: .36rem; }
.reminder-monthly { display: grid; gap: .35rem; }
.reminder-editor .reminder-amounts > label { margin-bottom: .2rem; }
.reminder-stepper { display: grid; grid-template-columns: minmax(0, 1fr) 2.38rem 2.38rem; gap: .25rem; }
.reminder-stepper button { min-height: 38px; padding: 0; font-size: 1.2rem; }
.reminder-editor .dialog-actions { bottom: -.75rem; padding-block: .4rem 0; }
.reminder-log-item { min-width: 0; border: 1px solid #dce8e2; border-radius: 9px; padding: .33rem .48rem .5rem; background: #f7faf9; }
.reminder-log-item legend { max-width: 100%; margin: 0; padding-inline: .18rem; font-size: .87rem; overflow-wrap: anywhere; }
.reminder-log-fields { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; gap: .35rem; }
.reminder-log-fields label, .reminder-log-times label { min-width: 0; gap: .18rem; font-size: .78rem; }
.reminder-log-fields :is(select, input), .reminder-log-times input[type="time"] { min-width: 0; min-height: 36px;
  padding: .28rem .4rem; font-size: 1rem; }
.reminder-log-fields select { padding-inline-end: 1.1rem; font-size: .87rem; }
.reminder-log-amount input:disabled { opacity: .6; }
.reminder-log-times { margin-block: .28rem; }
.reminder-log-times legend { font-size: .82rem; }
.reminder-log-times .option { padding: .28rem .38rem; }
dialog .reminder-intake-detail .dialog-actions { bottom: -.62rem; }
dialog .reminder-log-actions { bottom: 0; flex-wrap: nowrap; gap: .35rem; padding: .4rem 0; }
.reminder-log-actions button { min-width: 0; padding: .4rem .5rem; font-size: .79rem; line-height: 1.2; }
.reminder-log-actions [data-reminder-mark-all] { flex: 1 1 auto; }
.reminder-log-time-options { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem .4rem; }
.reminder-recorded { margin-bottom: .25rem; font-size: .74rem; }
.day-main .timeline li { scroll-margin-top: 74px; }
.day-main .timeline li:focus { outline-offset: 0; border-radius: 6px; }
.day-main .timeline time { color: #3d6562; font-weight: 650; }
.sleep-timing { color: #546178; margin-top: .2rem; font-size: .91rem; }
.empty-events { padding-block: .25rem .65rem; }
.emotion-panel { background: #faf9fc; }
.diary-action-list { display: grid; gap: .32rem; margin-top: .4rem; }
.diary-action { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto; gap: .55rem; align-items: center;
  width: 100%; padding: .32rem .5rem; text-align: left; border: 1px solid #dce6e3; background: #fff; }
.diary-action:hover { background: #f4f9f6; border-color: #9cbeb2; }
.diary-action strong, .diary-action small { display: block; }
.diary-action strong { font-size: .88rem; line-height: 1.28; }
.diary-action small { margin-top: .14rem; font-size: .76rem; }
.diary-action-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: #e6f2ed; }
.diary-action-arrow { color: var(--brand-dark); font-size: 1.1rem; }
.emotion-0 { --feel: #b95745; } .emotion-1 { --feel: #a37323; } .emotion-2 { --feel: #507fa7; }
.emotion-3 { --feel: #50946a; } .emotion-4 { --feel: #a05c86; }
.day-main .day-note { background: #fdfcf8; border-color: #e9e5db; }
.day-note-disclosure > summary { display: grid; gap: .18rem; width: 100%; min-height: 36px; padding: 0; }
.day-note-disclosure > summary::-webkit-details-marker { display: none; }
.day-note-disclosure > summary::marker { content: ''; }
.day-note-text, .day-note-excerpt { margin: .42rem 0 0; color: var(--ink); font-size: .86rem; overflow-wrap: anywhere; }
.day-note-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.day-note-text { white-space: pre-wrap; }
.day-note-more, .day-note-less { color: var(--brand-dark); font-size: .75rem; font-weight: 630; }
.day-note-less, .day-note-disclosure[open] .day-note-more, .day-note-disclosure[open] .day-note-excerpt { display: none; }
.day-note-disclosure[open] .day-note-less { display: block; }
.sleep-detail > summary, .source-detail > summary { width: 100%; display: flex; gap: .5rem; align-items: center; padding: 0; min-height: 25px; color: var(--ink); font-weight: 760; }
.source-detail > summary::after { content: '+'; margin-left: auto; color: var(--brand); font-weight: 500; }
.source-detail[open] > summary::after { content: '−'; }
.vendor { color: #4d6c70; font-size: .73rem; border-radius: 50px; border: 1px solid #dce7e6; padding: .1rem .47rem; font-weight: 580; }
.sleep-detail > summary { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  gap: .35rem; min-height: 32px; cursor: pointer; white-space: nowrap; }
.sleep-summary-title { display: inline-flex; align-items: center; gap: .32rem; font-size: clamp(.82rem, 4vw, 1rem); }
.sleep-detail > summary .vendor { justify-self: end; padding: .05rem .31rem; font-size: .68rem; }
.sleep-summary-time { color: #335653; font-size: clamp(.86rem, 3.9vw, 1rem); font-variant-numeric: tabular-nums; font-weight: 720; }
@media (max-width: 360px) {
  .sleep-summary-title, .day-events-toggle, .emotion-panel > summary { font-size: .77rem; }
}
.sleep-stats { margin: .66rem 0 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .36rem; }
.sleep-stats > div { padding: .62rem; border-radius: 8px; background: #f1f1fc; }
.sleep-stats dt { color: #52647b; font-size: .79rem; }
.sleep-phase-dot { display: inline-block; width: .55rem; height: .55rem; margin-inline-end: .32rem; border-radius: 2px; }
.sleep-stats dd { margin: .17rem 0 0; font-weight: 740; }
.sleep-sessions, .source-list { list-style: none; margin: .53rem 0 0; padding: 0; }
.sleep-sessions li { display: flex; justify-content: space-between; gap: .65rem; padding: .43rem .1rem; }
.source-list button { display: flex; justify-content: space-between; text-align: left; width: 100%; border: 0; border-top: 1px solid #e1e9e9; border-radius: 0; padding: .6rem .08rem; gap: .7rem; font-size: .92rem; }
.source-list button > span:last-child { white-space: nowrap; }
.source-list small { font-weight: 400; display: block; margin-top: .2rem; }
.source-list button:hover { background: #f6fafa; }

@media (max-width: 720px) {
  .today-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .48rem; }
  .day-main { grid-template-columns: 1fr; gap: .8rem; }
  .day-left, .day-right { grid-area: auto; gap: .8rem; }
  .day-page { gap: 1rem; }
  .day-head { border-radius: 18px; padding: .8rem .8rem; }
  .today-metric { padding: .42rem .5rem; }
  .quick-records button { padding: .4rem .39rem; font-size: .77rem; gap: .31rem; }
  .quick-records .record-glyph { scale: .84; }
}
@media (max-width: 355px) {
  .quick-records { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .day-date input[type=date] { font-size: .82rem; }
}

.day-tools { margin-top: .47rem; }
.day-overview { margin-top: .69rem; padding-top: .4rem; }
.overview-label { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.overview-label > .day-overview-toggle { margin-inline-start: auto; }
.day-band { display: block; padding: 1.95rem 0 .5rem; }
.day-band-track { display: block; margin-top: .37rem; }
.day-event-preview {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem;
  padding: .34rem 0 .52rem; border-block: 1px solid #ffffff29; margin-bottom: .55rem;
}
.day-event-preview button { border: 0; padding: .24rem .35rem; min-height: 34px; min-width: 0; color: #edfdf8;
  background: #ffffff15; justify-content: flex-start; gap: .3rem; font-size: .8rem; }
.day-head .day-event-preview .record-glyph { scale: .72; color: #d5f1e9; }
.day-event-preview .event-preview-label, .day-event-preview .event-preview-value {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-event-preview .event-preview-label { flex: 1 1 auto; text-align: start; }
.day-event-preview .event-preview-value { max-width: 47%; flex: 0 0 auto; color: #bfd9d5; font-size: .74rem;
  font-weight: 500; text-align: end; font-variant-numeric: tabular-nums; }
.day-event-preview [data-inline-preview] .event-preview-label { flex: 0 0 auto; max-width: 50%; }
.day-event-preview [data-inline-preview] .event-preview-value { flex: 1 1 auto; max-width: none; text-align: start; }
.day-event-preview time { flex-shrink: 0; color: #c8ede2; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .day-event-preview { grid-template-columns: minmax(0, 1fr); }
}
.day-band-empty { grid-column: 1 / -1; color: #e0f0ec; font-size: .84rem; }
.day-events h2 { scroll-margin-top: 72px; }
.feeling-group { border: 1px solid var(--border); border-radius: 9px; padding: .25rem .5rem .45rem; }
.feeling-group > summary { width: 100%; font-weight: 750; }
.feeling-subgroup { border-top: 1px solid var(--border); }
.feeling-subgroup > summary { width: 100%; min-height: 40px; padding-block: .55rem; font-size: .88rem; font-weight: 650; }
.feeling-subgroup[open] { padding-bottom: .4rem; }
.feeling-group .option { padding: .4rem .45rem; }
.chosen-feelings > summary { max-width: 100%; overflow-wrap: anywhere; font-weight: 600; }
.review-feelings { display: grid; gap: .55rem; min-width: 0; padding: .7rem; background: #eef4f2; border: 1px solid #dbe8e2; border-radius: 11px; }
.review-feelings select { color: #184a41; font-weight: 720; }
.chosen-feelings[open] > summary { margin-bottom: .65rem; }
.chosen-feelings > label, .chosen-feelings > fieldset { margin-block: .42rem; }
.field-hint { color: #61737a; font-size: .78rem; font-weight: 480; line-height: 1.35; }
.review-extra { border-top: 1px solid var(--border); padding-top: .4rem; }
dialog:has(.reflection-editor) { width: min(33rem, calc(100% - 1.2rem)); }
dialog:has(.reflection-editor) .dialog-head { padding: .55rem .73rem; }
dialog:has(.reflection-editor) [data-close] { min-width: 40px; padding: .24rem; font-size: 1.3rem; }
dialog .reflection-editor { gap: .55rem; padding: .6rem .73rem; }
.reflection-editor :is(label, input, select, textarea) { min-width: 0; }
.reflection-editor label { font-size: .84rem; }
.reflection-editor :is(select, input:not([type=radio], [type=checkbox])) { min-height: 40px; padding: .38rem .5rem; }
.reflection-editor input[type=datetime-local] { appearance: none; max-width: 100%; }
.reflection-editor input[type=datetime-local]::-webkit-date-and-time-value { margin: 0; text-align: start; }
.reflection-editor textarea { min-height: 60px; padding: .44rem .5rem; }
.reflection-editor .review-feelings { gap: .32rem; padding: .5rem; }
.reflection-editor .error:empty { display: none; }
dialog .reflection-editor .dialog-actions { bottom: 0; padding: .38rem 0 .16rem; justify-content: flex-end; }
.reflection-support { min-width: 0; padding: .32rem .55rem; border: 1px solid #dbe8e2; border-radius: 9px; background: #f2f7f5; }
.reflection-support > summary { display: flex; align-items: center; gap: .32rem; width: 100%; min-height: 34px;
  list-style: none; padding: .12rem 0; font-size: .84rem; font-weight: 650; }
.reflection-support > summary::-webkit-details-marker { display: none; }
.reflection-support > summary .vendor { margin-left: auto; }
.reflection-support > summary::after { content: '›'; font-size: 1rem; }
.reflection-support[open] > summary::after { transform: rotate(90deg); }
.reflection-support[open] > :not(summary) { margin-top: .42rem; }
.reflection-support-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .28rem; }
.reflection-support-modes label { position: relative; cursor: pointer; }
.reflection-support-modes input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.reflection-support-modes span { display: grid; place-items: center; min-height: 37px; padding: .3rem .33rem;
  border: 1px solid var(--border); border-radius: 7px; color: var(--brand-dark); background: #fff; text-align: center; font-size: .77rem; }
.reflection-support-modes input:checked + span { border-color: #a9c9bd; background: #e1f0e8; font-weight: 680; }
.reflection-support-modes input:focus-visible + span { outline: 2px solid #6656c4; outline-offset: 1px; }
.reflection-support button { min-height: 37px; padding: .3rem .55rem; font-size: .81rem; }
.reflection-support [data-support-status]:empty { display: none; }
.reflection-support-result { display: grid; justify-items: start; gap: .4rem; padding: .47rem; background: #fff; border-radius: 7px; }
.reflection-support-result p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.review-toggle[aria-pressed="true"] { border-color: #b1ccbf; background: #e4f2e9; color: #23564d; }
@media (max-width: 640px) {
  .trend-metric-name { text-wrap: balance; }
  .trend-metric-name .record-glyph { display: none; }
  .topbar-inner { min-height: 52px; }
  .workspace { padding-top: .66rem; }
  .day-page { gap: .7rem; }
  .day-head { padding: .66rem .7rem; }
  .day-heading h1 { font-size: clamp(1.65rem, 7vw, 2rem); }
  .day-add { min-height: 41px; padding-inline: .65rem; }
  .day-date button, .day-date input[type=date] { min-height: 32px; }
  .day-overview { margin-top: .56rem; }
  .day-band-labels { margin-top: .42rem; }
  .today-highlights .section-title { margin-bottom: .35rem; }
}

.day-page { grid-template-columns: minmax(0, 1fr); }
.day-head, .today-highlights, .day-main { min-width: 0; }
.quick-records button > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .topbar-inner { padding-inline: .72rem; }
  .workspace { padding-inline: .53rem; }
  .day-heading { position: relative; display: block; }
  .day-heading-title { padding-right: 92px; gap: .38rem; }
  .day-heading h1 { overflow-wrap: anywhere; }
  .day-pin-gear { flex-basis: 30px; min-height: 30px; }
  .day-pins { gap: .32rem; }
  .day-pin-card { padding-inline: .39rem; }
  .day-pin-card-title .record-glyph { width: 12px; height: 12px; flex-basis: 12px; }
  .day-heading .day-add { position: absolute; top: 0; right: 0; min-height: 37px; padding-inline: .47rem; font-size: .85rem; }
  .day-tools { width: 100%; }
  .day-date input[type=date] { max-width: 9rem; min-width: 0; }
}
