:root {
  color-scheme: light;
  --canvas: #f8f7f3;
  --surface: #fff;
  --ink: #23253e;
  --muted: #51556a;
  --accent: #413b9e;
  --accent-hover: #312b82;
  --line: #e4e3e9;
  --input-line: #8c86a1;
  --radius: 1.125rem;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-bottom: calc(5.75rem + env(safe-area-inset-bottom)); }
body { margin: 0; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
a { color: var(--accent); text-underline-offset: 0.19em; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.sr-only, .skip-link:not(:focus), .intensity-option input, .location-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 35.001rem) {
  .history-mobile-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.skip-link:focus {
  position: fixed;
  z-index: 1;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-radius: 0.45rem;
}

.site-header {
  padding-top: env(safe-area-inset-top);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner, .page {
  width: min(100% - 3.5rem, 77rem);
  margin-inline: auto;
}

.site-header-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  padding-block: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  font-weight: 750;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.68rem;
  flex-shrink: 0;
}

.bottom-nav {
  position: fixed;
  z-index: 2;
  inset: auto 0 0;
  padding: 0.35rem max(0.5rem, env(safe-area-inset-right)) calc(0.35rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -0.25rem 1rem rgb(35 37 62 / 6%);
}
.bottom-nav-inner {
  max-width: 34rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.5rem;
  padding: 0.2rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-size: clamp(0.76rem, 3.6vw, 0.875rem);
  text-align: center;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}
.bottom-nav a:hover { color: var(--accent); text-decoration: underline; }
.bottom-nav a[aria-current=location] { background: #f0ecfd; color: var(--accent-hover); font-weight: 750; }
.nav-icon { position: relative; display: block; width: 1.05rem; height: 1.05rem; border: 1.5px solid currentColor; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; background: currentColor; }
.nav-icon-entry { border-radius: 0.25rem; }
.nav-icon-entry::before { width: 0.53rem; height: 1.5px; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.nav-icon-entry::after { width: 1.5px; height: 0.53rem; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.nav-icon-report { border-width: 0 0 1.5px 1.5px; }
.nav-icon-report::before { width: 0.16rem; height: 0.3rem; left: 0.16rem; bottom: 0.1rem; }
.nav-icon-report::after { width: 0.16rem; height: 0.53rem; left: 0.43rem; bottom: 0.1rem; box-shadow: 0.26rem -0.23rem 0 currentColor; }
.nav-icon-medication { width: 0.75rem; height: 1.1rem; border-radius: 1rem; transform: rotate(36deg); }
.nav-icon-medication::before { width: 100%; height: 1.5px; inset-block-start: calc(50% - 0.75px); }

.page { max-width: 62rem; padding-block: clamp(1.5rem, 4vw, 3.25rem) calc(6rem + env(safe-area-inset-bottom)); }
h1 {
  margin-block-end: clamp(1.3rem, 3vw, 2.1rem);
  font-size: clamp(2.15rem, 4.8vw, 3.85rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.057em;
}
h2, h3 { letter-spacing: -0.03em; line-height: 1.2; }
h2 { font-size: clamp(1.375rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.15rem; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2.35vw, 1.85rem);
  justify-items: start;
}
.entry-panel { width: min(100%, 46rem); }
.report-panel { width: 100%; }
.catalog-panel { width: min(100%, 54rem); }

.panel {
  min-width: 0;
  padding: clamp(1.05rem, 2.4vw, 1.85rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0.3rem 1.25rem rgb(35 37 62 / 4%);
  scroll-margin-top: 1rem;
}

.panel-heading { margin-bottom: 1.55rem; }
.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.entry-form { display: grid; gap: 1.2rem; }
.field { min-width: 0; }
.field > label, legend {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.field input:not([type=radio]), .field select, .field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--input-line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--ink);
}

.field input[type=date], .field input[type=datetime-local] {
  -webkit-appearance: none;
  appearance: none;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-height: 3rem;
}
.field input::-webkit-date-and-time-value {
  min-inline-size: 0;
  max-inline-size: 100%;
  min-height: 1.5em;
  margin: 0;
  overflow: hidden;
  text-align: start;
  text-overflow: ellipsis;
}
.field input::-webkit-datetime-edit { min-inline-size: 0; padding: 0; }
.field textarea { resize: vertical; }
.field textarea::placeholder, .optional, .muted { color: var(--muted); }
.optional { font-weight: 450; }
.field [aria-invalid=true] { border-color: #a33548; }
.field-error { margin-top: 0.35rem; color: #9b263b; font-size: 0.875rem; }
.field-hint { color: var(--muted); font-size: 0.875rem; }
.field textarea + .field-hint { margin-top: 0.3rem; }

.intensity-field, .medication-fields, .location-field { border: 0; padding: 0; margin: 0; }
.location-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.location-choice { position: relative; min-width: 0; }
.location-choice label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  height: 100%;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--input-line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.location-choice label:hover { background: #f5f2fd; }
.location-choice input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.location-choice input:checked + label { background: #eee9fc; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-hover); }
.location-icon {
  --point-x: 50%;
  --point-y: 50%;
  position: relative;
  width: 1.35rem;
  height: 1.65rem;
  flex-shrink: 0;
  border: 1.5px solid var(--accent);
  border-radius: 48% 48% 43% 43%;
}
.location-icon::before, .location-temples::after {
  content: "";
  position: absolute;
  width: 0.34rem;
  height: 0.34rem;
  inset: var(--point-y) auto auto var(--point-x);
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.location-forehead { --point-y: 29%; }
.location-temple-left, .location-temples { --point-x: 15%; --point-y: 36%; }
.location-temple-right, .location-temples::after { --point-x: 85%; --point-y: 36%; }
.location-back { --point-y: 73%; }
.location-top { --point-y: 7%; }
.location-eye-left { --point-x: 31%; --point-y: 46%; }
.location-eye-right { --point-x: 69%; --point-y: 46%; }
.location-side-left { background: linear-gradient(90deg, #cfc5f3 50%, transparent 50%); }
.location-side-right { background: linear-gradient(270deg, #cfc5f3 50%, transparent 50%); }
.location-whole { background: #cfc5f3; }
.location-side-left::before, .location-side-right::before, .location-whole::before { display: none; }
.location-other::before { content: "?"; width: auto; height: auto; color: var(--accent); background: none; font-size: 0.75rem; }
.intensity-options { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 0.2rem; }
.intensity-option { position: relative; min-width: 0; }
.intensity-option label {
  display: grid;
  place-items: center;
  min-height: 2.7rem;
  border: 1px solid #9289ad;
  border-radius: 0.38rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: #f6f4fd;
  color: var(--accent-hover);
  cursor: pointer;
}
.intensity-option label:hover { background: #eae6fb; border-color: var(--accent); }
.intensity-option input:checked + label { color: #fff; background: var(--accent); border-color: var(--accent); }
.intensity-option input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.scale-hint {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.1rem 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.52rem;
  min-height: 2.8rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.save-button { width: 100%; min-height: 3rem; }
.button-secondary { color: var(--accent-hover); background: #f5f2fd; border-color: #dcd6f3; }
.button-secondary:hover { background: #eae5f8; border-color: #a79acb; }
.button-filter { color: var(--accent-hover); background: var(--surface); border-color: var(--input-line); }
.button-filter:hover { background: #f5f2fd; border-color: var(--accent); }

.medication-rows { display: grid; gap: 0.65rem; }
.medication-row {
  --medication-control-height: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) auto;
  align-items: end;
  gap: 0.45rem;
}
.medication-row:has(.medication-remove[hidden]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.medication-control { min-width: 0; }
.medication-label { display: block; margin-bottom: 0.22rem; color: var(--muted); font-size: 0.78rem; font-weight: 650; }
.medication-control select, .medication-control input[type=text] {
  -webkit-appearance: none;
  appearance: none;
  height: var(--medication-control-height);
  padding: 0 0.7rem;
  font-size: 1rem;
  line-height: 1.25;
}
.medication-select { position: relative; display: block; }
.medication-select select { padding-inline-end: 1.85rem; text-overflow: ellipsis; }
.medication-select::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 0.8rem;
  width: 0.45rem;
  height: 0.45rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.medication-control input::placeholder { color: var(--muted); }
.medication-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: var(--medication-control-height);
  min-height: var(--medication-control-height);
  padding: 0 0.75rem;
  border: 1px solid var(--input-line);
  border-radius: 0.55rem;
  color: var(--accent-hover);
  background: var(--surface);
}
.medication-remove[hidden], .medication-remove-text { display: none; }
.medication-remove-icon { font-size: 1.25rem; line-height: 1; }
.medication-remove:hover { background: #f5f2fd; border-color: var(--accent); }
.medication-add-row { margin-top: 0.65rem; min-height: 3rem; }
.medication-add-row[hidden] { display: none; }
.medication-add-row:disabled { opacity: 0.66; cursor: default; }
.medication-add-row + .field-hint { margin-top: 0.35rem; }

.catalog-form {
  display: grid;
  grid-template-columns: minmax(0, 24rem) auto;
  justify-content: start;
  align-items: start;
  gap: 0.65rem;
}
.catalog-form .button { margin-top: 1.75rem; }
.catalog-empty { margin-top: 1rem; }
.catalog-list {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}
.catalog-list li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fcfbfe;
}
.catalog-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.55rem;
  list-style: none;
  cursor: pointer;
}
.catalog-list summary::-webkit-details-marker { display: none; }
.catalog-list summary:hover { background: #f5f2fd; }
.catalog-medication-name { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.catalog-edit-label {
  color: var(--accent-hover);
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 0.19em;
}
.catalog-edit-form { margin: 0 0.75rem 0.75rem; padding-top: 0.65rem; border-top: 1px solid var(--line); }
.catalog-edit-form label { overflow-wrap: anywhere; }

.download-icon {
  position: relative;
  width: 0.88rem;
  height: 0.95rem;
  border-bottom: 1.5px solid currentColor;
}
.download-icon::before, .download-icon::after { content: ""; position: absolute; }
.download-icon::before { width: 1.5px; height: 0.54rem; background: currentColor; left: calc(50% - 0.75px); top: 0.04rem; }
.download-icon::after {
  width: 0.37rem;
  height: 0.37rem;
  left: calc(50% - 0.185rem);
  top: 0.28rem;
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.notice {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid;
  border-radius: 0.6rem;
  font-weight: 650;
}
.notice-success { color: #174c38; border-color: #a0ccba; background: #e7f5ec; }
.notice-error { color: #9b263b; border-color: #d89aa7; background: #fff1f3; }

.account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; margin-inline-start: auto; }
.account-actions .button { padding-inline: 0.65rem; }

.login-page {
  max-width: 28rem;
  padding-block: clamp(1.75rem, 7vw, 5rem) calc(2rem + env(safe-area-inset-bottom));
}
.login-panel h1 { font-size: clamp(1.85rem, 6vw, 2.55rem); }
.login-form { display: grid; gap: 1.05rem; }
.login-form .field input { min-height: 3rem; font-size: 1rem; }
.remember-option {
  padding: 0 0.7rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: #fcfbfe;
}
.remember-option label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.8rem;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}
.remember-option input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.remember-option .field-hint { margin-inline-start: 1.8rem; }

.passkey-status:not(:empty) { margin-top: 0.55rem; }
.passkey-status.field-error { color: #9b263b; }
.passkey-login[hidden], .passkeys-register form[hidden], .passkeys-list[hidden], .passkeys-list button[hidden], .passkey-confirm[hidden] { display: none; }
.passkey-login .passkey-confirm { margin-top: 0.55rem; }
.passkey-login button:disabled, .passkeys-page button:disabled { opacity: 0.66; cursor: default; }
.passkeys-page {
  max-width: 42rem;
  padding-block: clamp(1.5rem, 4vw, 3rem) calc(2rem + env(safe-area-inset-bottom));
}
.passkeys-back-link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: 0.55rem; }
.passkeys-page h1 { margin-bottom: 0.65rem; font-size: clamp(1.85rem, 6vw, 2.75rem); }
.passkeys-page h2 { margin-bottom: 0.65rem; font-size: 1.23rem; }
.passkeys-intro { margin-bottom: 1.25rem; color: var(--muted); }
.passkeys-page > .panel > .passkey-status:not(:empty) { margin-bottom: 0.9rem; }
.passkeys-list { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.passkeys-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  overflow-wrap: anywhere;
}
.passkey-name { font-weight: 650; }
.passkeys-register { margin-top: 1.15rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: start;
  column-gap: 0.65rem;
  margin-bottom: 1.6rem;
}
.filters .button-filter { margin-top: 1.75rem; min-height: 3rem; }
.filter-reset { grid-column: 1 / -1; justify-self: start; margin-top: 0.45rem; font-size: 0.875rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1.65rem;
}
.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  gap: 0.23rem;
  padding: 0.9rem clamp(0.5rem, 1.35vw, 1rem);
  border: 1px solid #ebe6fa;
  border-radius: 0.7rem;
  background: #f6f3fd;
}
.stat dt { color: #514669; font-size: 0.78rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.stat dd {
  color: var(--accent-hover);
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.stat dd span { font-size: 0.73rem; font-weight: 600; letter-spacing: normal; color: #514669; white-space: nowrap; }

.history h3 { margin-bottom: 0.8rem; }
.history-row, .entry-columns {
  display: grid;
  grid-template-columns: minmax(5.1rem, 0.85fr) minmax(0, 1.15fr) minmax(4.2rem, 0.67fr) minmax(0, 1.2fr);
  gap: 0.6rem;
}
.entry-columns {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.history-list { padding: 0; margin: 0; list-style: none; }
.history-row { padding: 0.75rem 0; align-items: start; font-size: 0.87rem; overflow-wrap: anywhere; }
.history-row + .history-row { border-top: 1px solid var(--line); }
.entry-date { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-time { display: block; color: var(--muted); font-size: 0.75rem; }
.medication-value { white-space: pre-wrap; }
.history-comment {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0.25rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  background: #f6f3fd;
}
.history-comment-label { color: #514669; font-size: 0.75rem; font-weight: 700; }
.history-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.history-mobile-label { color: var(--muted); font-weight: 650; }
.intensity-badge {
  display: inline-block;
  border-radius: 1rem;
  padding: 0.08rem 0.46rem;
  color: #195243;
  background: #e7f4ed;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.intensity-badge span { font-weight: 600; font-size: 0.76rem; }
.intensity-medium { background: #fbf0d8; color: #694700; }
.intensity-high { background: #fbe9ed; color: #882a40; }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: clamp(1.5rem, 4vw, 2.65rem) 0.75rem;
  border: 1px dashed #cecadb;
  border-radius: 0.75rem;
  background: #fcfbfe;
  text-align: center;
}
.empty-state p { font-size: 0.9rem; font-weight: 650; }
.empty-state a { font-size: 0.84rem; }
.empty-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
  background: #ebe5fc;
  border-radius: 0.8rem;
  color: var(--accent);
}
.empty-icon span {
  width: 0.9rem;
  height: 1.12rem;
  border: 1.5px solid currentColor;
  border-radius: 0.2rem;
  background: linear-gradient(currentColor, currentColor) center 34% / 55% 1px no-repeat,
              linear-gradient(currentColor, currentColor) center 62% / 55% 1px no-repeat;
}

@media (max-width: 57rem) {
  .site-header-inner, .page { width: min(100% - 2rem, 44rem); }
}

@media (max-width: 35rem) {
  .site-header-inner { padding-block: 0.35rem; }
  .location-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intensity-options { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.3rem; }
  .medication-row, .medication-row:has(.medication-remove[hidden]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fcfbfe;
  }
  .medication-remove { justify-self: end; font-size: 0.875rem; font-weight: 650; }
  .medication-remove-text { display: inline; }
  .medication-add-row { width: 100%; }
  .catalog-form { grid-template-columns: minmax(0, 1fr); }
  .catalog-form .button { margin-top: 0; justify-self: start; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0.65rem; }
  .filters .field { grid-column: 1 / -1; }
  .filters .button-filter, .filter-reset { margin-top: 0; justify-self: start; }
  .filter-reset { grid-column: auto; align-self: center; }

  .entry-columns { display: none; }
  .history-row { grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; }
  .history-row time { grid-column: 1; grid-row: 1; }
  .history-intensity { grid-column: 2; grid-row: 1; }
  .history-location, .history-medication { grid-column: 1 / -1; }
}

@media (max-width: 24rem) {
  .site-header-inner { column-gap: 0.5rem; }
  .brand { gap: 0.45rem; font-size: 0.9rem; }
  .brand-mark { width: 2.4rem; height: 2.4rem; }
}

@media (forced-colors: active) {
  .intensity-option input:checked + label, .location-choice input:checked + label, .bottom-nav a[aria-current=location] {
    forced-color-adjust: none;
    color: HighlightText;
    background: Highlight;
    border-color: Highlight;
  }
}
