:root {
  --bg: #f7f3ec;
  --paper: #fffefa;
  --soft: #f1ece2;
  --text: #51473f;
  --muted: #71655b;
  --border: #dcd2c5;
  --terra: #c98f7e;
  --terra-dark: #925240;
  --sage: #56716a;
  --focus: #925240;
  --sidebar: 256px;
}
* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow-wrap: break-word;
}
body,
dialog {
  max-width: 100%;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 0;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border-radius: 8px;
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 12px;
  font-size: 16px;
  margin: 5px 0 16px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
fieldset legend {
  padding: 0;
  margin: 0 0 14px;
  font-weight: 600;
}
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
h1 {
  font:
    normal 32px/1.2 Georgia,
    serif;
  margin: 0;
}
h2 {
  font:
    normal 25px/1.3 Georgia,
    serif;
  margin: 0 0 18px;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 12px;
}
.primary {
  background: var(--terra);
  color: #3d271f;
  font-weight: 650;
  border: 1px solid #b37d6c;
  padding: 10px 18px;
}
.primary:hover:not(:disabled) {
  background: #bc8271;
}
.secondary {
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 15px;
}
.secondary:hover:not(:disabled) {
  background: var(--soft);
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 8px;
  font-size: 23px;
  background: transparent;
  border: 1px solid var(--border);
}
.text-button {
  background: none;
  color: var(--terra-dark);
  font-size: 14px;
  padding: 8px 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 6px 30px;
}
.brand span {
  font:
    29px Georgia,
    serif;
  letter-spacing: 4px;
}
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #faf7f1;
  border-right: 1px solid var(--border);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 40;
}
.search-open {
  border: 1px solid var(--border);
  background: transparent;
  width: 100%;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.search-open kbd {
  margin-left: auto;
  font: 13px monospace;
  color: var(--muted);
}
.nav-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin: 23px 11px 7px;
}
.nav-item {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 10px 11px;
  margin: 2px 0;
  background: none;
  text-align: left;
  font-size: 14px;
}
.nav-item:hover {
  background: var(--soft);
}
.nav-item.active {
  background: #e9dfd1;
  color: #513c2e;
  font-weight: 650;
}
.dot {
  background: var(--c);
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
.save-state {
  font-size: 11px;
  color: var(--muted);
  margin: 28px 10px 0;
}
.save-state.error {
  color: #963b2b;
}
.shell {
  margin-left: var(--sidebar);
  min-width: 0;
}
header {
  height: 72px;
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: #e8ddcf;
  font-weight: 600;
}
main {
  padding: 36px;
  max-width: 1350px;
  margin: auto;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}
.top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.top-actions button {
  white-space: nowrap;
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 28px;
}
.stat {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--paper);
  padding: 18px;
  text-align: left;
}
.stat strong {
  display: block;
  font:
    28px Georgia,
    serif;
  margin-bottom: 5px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.stat.active {
  border-color: var(--terra-dark);
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tab {
  padding: 9px 13px;
  background: none;
  border: 1px solid transparent;
  font-size: 14px;
}
.tab.active {
  background: #e9dfd1;
  border-color: #d4c4b2;
  color: #513c2e;
}
.tab small {
  font-size: 12px;
  margin-left: 6px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
}
.filters select {
  margin: 0;
  width: auto;
  max-width: 100%;
  font-size: 14px;
  padding: 8px 10px;
}
.count {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.group-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 24px 0 12px;
}
.group-title small {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.record {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 9px;
  min-width: 0;
}
.check {
  width: 44px;
  min-width: 44px;
  height: 44px;
  background: transparent;
  padding: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.check span {
  width: 23px;
  height: 23px;
  border: 1px solid #b7aa98;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.record-body {
  flex: 1;
  min-width: 0;
}
.record-title {
  padding: 0;
  background: none;
  text-align: left;
  font-size: 16px;
  font-weight: 550;
  min-height: 32px;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.record.done .record-title {
  text-decoration: line-through;
  color: var(--muted);
}
.record-note {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  margin: 4px 0;
}
.meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.meta > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.badge {
  background: #eae1d5;
  padding: 3px 7px;
  border-radius: 5px;
  color: #684b36;
}
.badge.urgent,
.badge.overdue {
  background: #f0dcd5;
  color: #843c2a;
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  max-width: 132px;
  flex-shrink: 0;
  justify-content: flex-end;
}
.record-actions button {
  width: 40px;
  min-height: 44px;
  font-size: 18px;
  background: none;
  color: #776858;
}
.record-actions button:hover {
  background: var(--soft);
}
.empty {
  padding: 26px 0;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.period-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.period-title {
  font:
    22px Georgia,
    serif;
  margin: 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 24px;
}
.weekday {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}
.calendar-day {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 6px;
  text-align: left;
  min-height: 100px;
  min-width: 0;
  overflow: hidden;
}
.calendar-day.today {
  border-color: var(--terra-dark);
}
.calendar-day.selected {
  background: #eee3d5;
}
.day-number {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}
.calendar-event {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  margin: 5px 0;
}
.calendar-event.done {
  opacity: 0.6;
  text-decoration: line-through;
}
.calendar-event small {
  font-size: 11px;
}
.calendar-more {
  font-size: 11px;
  color: var(--terra-dark);
  display: block;
  margin-top: 5px;
}
.legend {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  margin: 15px 0 24px;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.day-section {
  padding: 18px;
  background: #f4efe6;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  min-width: 0;
}
.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.day-heading h3 {
  margin: 0;
  font:
    20px Georgia,
    serif;
}
.day-heading .text-button {
  white-space: nowrap;
}
.day-section .empty {
  padding: 5px 0;
  border: 0;
  margin: 0;
}
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mini-month {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  min-width: 0;
}
.mini-month h3 {
  font:
    19px Georgia,
    serif;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.mini-grid > .weekday {
  font-size: 10px;
}
.mini-day {
  padding: 4px 0;
  background: none;
  min-height: 44px;
  font-size: 13px;
  min-width: 0;
}
.mini-day.today {
  background: #e9d4c9;
}
.day-dots {
  display: flex;
  gap: 2px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3px;
}
.day-dots .dot {
  width: 4px;
  height: 4px;
}
.planner-tabs {
  margin-bottom: 20px;
}
.meal-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.meal-slot {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  min-width: 0;
}
.meal-slot h3 {
  font:
    21px Georgia,
    serif;
}
.meal-slot .record {
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  flex-wrap: wrap;
}
.meal-slot .record-actions {
  margin-left: auto;
}
.meal-slot .check {
  width: 36px;
  min-width: 36px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.settings-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--paper);
  min-width: 0;
}
.settings-card h2 {
  font-size: 23px;
}
.settings-card p,
.settings-card li {
  font-size: 14px;
}
.settings-card .buttons {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.settings-card ol {
  padding-left: 21px;
}
.settings-card li {
  margin-bottom: 10px;
}
.settings-card .secondary,
.settings-card .primary {
  font-size: 14px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.warning {
  padding: 16px;
  background: #f0dcd5;
  color: #803f2d;
  border-radius: 8px;
  margin-bottom: 22px;
  font-size: 14px;
}
.warning button {
  color: inherit;
}
.form-error {
  color: #9c3222;
  font-size: 14px;
  white-space: pre-wrap;
  margin: 10px 0;
}
.form-error:empty {
  display: none;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 6px 0 0;
}
.dialog-head .icon {
  border: 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}
dialog {
  width: min(580px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--paper);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 80px #3d302529;
}
dialog::backdrop {
  background: #30282060;
}
body.dialog-open {
  overflow: hidden;
}
details {
  margin: 8px 0 20px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
}
.search-result {
  width: 100%;
  padding: 13px 4px;
  background: none;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.search-result small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + var(--sidebar) / 2);
  transform: translateX(-50%);
  padding: 13px 20px;
  background: #ddae9f;
  color: #3f3731;
  border-radius: 9px;
  z-index: 90;
  max-width: calc(100% - 32px);
  font-size: 14px;
  box-shadow: 0 5px 25px #30282015;
  display: none;
}
#toast.show {
  display: block;
}
#onboarding {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 25px;
  background: var(--bg);
}
.welcome-card {
  width: min(420px, 100%);
  background: var(--paper);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.welcome-card h1 {
  font-size: 30px;
  margin-bottom: 25px;
}
.welcome-card p {
  font-size: 14px;
  color: var(--muted);
}
.welcome-card .primary {
  width: 100%;
  margin-top: 10px;
}
.mobile-nav,
.menu-backdrop {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  main {
    padding: 44px 52px;
  }
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 210px;
  }
  header {
    padding: 0 25px;
  }
  main {
    padding: 30px 25px;
  }
  .meal-slots {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .record-actions {
    max-width: 88px;
  }
}
@media (max-width: 760px) {
  :root {
    --sidebar: 256px;
  }
  html {
    scrollbar-gutter: auto;
  }
  .shell {
    margin-left: 0;
  }
  #sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    max-width: calc(100vw - 44px);
    bottom: 0;
    padding-bottom: 30px;
  }
  body.menu-open #sidebar {
    transform: none;
    visibility: visible;
  }
  .menu-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #30282055;
    border-radius: 0;
    z-index: 35;
  }
  body.menu-open .menu-backdrop {
    display: block;
  }
  header {
    height: 64px;
    padding: 0 16px;
  }
  main {
    padding: 26px 16px calc(90px + env(safe-area-inset-bottom));
  }
  .page-heading {
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
  }
  .page-heading > div:first-child {
    flex: 1 1 170px;
  }
  .top-actions {
    margin-left: auto;
    flex-wrap: wrap;
    gap: 7px;
  }
  .top-actions button {
    padding: 10px 12px;
  }
  h1 {
    font-size: 29px;
  }
  .eyebrow {
    font-size: 12px;
  }
  .stats {
    gap: 8px;
    margin-bottom: 23px;
  }
  .stat {
    padding: 13px 10px;
  }
  .stat strong {
    font-size: 25px;
  }
  .stat span {
    font-size: 12px;
  }
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #faf7f1;
    border-top: 1px solid var(--border);
    z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav button {
    background: none;
    font-size: 22px;
    min-width: 65px;
    min-height: 48px;
    color: var(--muted);
  }
  .mobile-nav button span {
    display: block;
    font-size: 12px;
    margin-top: 0;
  }
  .mobile-nav button.active {
    color: var(--terra-dark);
    font-weight: 650;
  }
  .record {
    padding: 12px 10px;
    gap: 6px;
  }
  .record-actions {
    max-width: 44px;
    flex-direction: column;
  }
  .record-title {
    font-size: 16px;
  }
  .meta {
    font-size: 12px;
    gap: 7px;
  }
  .record-note {
    font-size: 14px;
  }
  .tabs {
    gap: 2px;
  }
  .tab {
    padding: 9px 10px;
    font-size: 14px;
  }
  .calendar-grid {
    gap: 3px;
  }
  .calendar-day {
    padding: 6px 3px;
    min-height: 78px;
  }
  .calendar-event {
    font-size: 11px;
  }
  .calendar-event .event-title {
    display: none;
  }
  .calendar-event .dot {
    width: 7px;
    height: 7px;
  }
  .weekday {
    font-size: 11px;
  }
  .period-title {
    font-size: 20px;
  }
  .period-nav {
    gap: 6px;
  }
  .week-toolbar {
    gap: 10px;
  }
  .year-grid {
    gap: 8px;
  }
  .mini-month {
    padding: 10px 7px;
  }
  .mini-day {
    min-height: 38px;
    font-size: 12px;
  }
  .mini-month h3 {
    font-size: 17px;
  }
  .day-section {
    padding: 13px 10px;
  }
  .day-heading h3 {
    font-size: 19px;
  }
  .meal-slots {
    grid-template-columns: 1fr;
  }
  .settings-card {
    padding: 20px;
  }
  .settings-card .buttons > * {
    flex-grow: 1;
  }
  .form-grid {
    gap: 0 10px;
  }
  dialog {
    padding: 20px;
    max-height: calc(100dvh - 20px);
    width: calc(100% - 20px);
    margin: auto;
  }
  dialog .form-grid {
    grid-template-columns: 1fr;
  }
  dialog .dialog-actions {
    position: sticky;
    bottom: -20px;
    background: var(--paper);
    padding: 12px 0 20px;
    margin-top: 8px;
  }
  .welcome-card {
    padding: 24px;
  }
  #toast {
    left: 50%;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 26px);
  }
  .legend {
    font-size: 12px;
    gap: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 760px) {
  header {
    height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  main {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  #sidebar {
    padding-top: calc(28px + env(safe-area-inset-top));
    padding-left: max(18px, env(safe-area-inset-left));
  }
  dialog {
    max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px);
  }
  .welcome-card {
    margin-top: env(safe-area-inset-top);
  }
}

/* ---------- RESET 2.0 ---------- */
body,
h1,
h2,
h3,
.period-title {
  font-variant-numeric: lining-nums;
}
.stat strong {
  font:
    600 30px/1.1 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
.brand {
  margin: 0 6px 22px;
}
.brand svg {
  flex-shrink: 0;
}
.header-brand {
  display: none;
}
#menuButton {
  display: none;
}
@media (min-width: 761px) {
  header {
    display: none;
  }
}
.search-open {
  font-size: 16px;
}
.nav-label {
  font-size: 12px;
  margin: 18px 12px 6px;
}
.nav-item {
  font-size: 16px;
  padding: 9px 12px;
  gap: 12px;
  min-height: 44px;
}
.nav-item .dot {
  width: 11px;
  height: 11px;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}
.nav-count {
  font-size: 13px;
}
.save-state {
  font-size: 12px;
}
.record-actions button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
}
.ico {
  width: 22px;
  height: 22px;
}
.check[aria-checked="true"] span {
  background: #dce7de;
  color: #375a43;
  border-color: #829985;
}
.top-actions {
  align-items: center;
}
#undoButton {
  text-align: left;
  line-height: 1.25;
}
.undo-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.undo-label:empty {
  display: none;
}
#toast {
  align-items: center;
  gap: 14px;
}
#toast.show {
  display: flex;
}
.toast-undo {
  background: none;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 32px;
  padding: 4px 6px;
  color: #3f3731;
  flex-shrink: 0;
}
.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #e8efec;
  border: 1px solid #c6d5d0;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}
.notice p {
  margin: 0;
  flex: 1 1 260px;
}
.notice-text {
  background: #eef3f1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.field-static {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin: 0 0 18px;
}
.field-static span {
  font-weight: 600;
}
.field-hint {
  margin: -10px 0 16px;
}
.slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.meal-slot .empty {
  padding: 10px 0;
}
.ingredient-day .record-actions {
  flex-direction: row;
  width: auto;
  max-width: none;
  margin: 0;
}
.ingredient-list {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}
.ingredient-list li {
  margin-bottom: 4px;
  break-inside: avoid;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
  margin-bottom: 12px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 15px;
  min-height: 42px;
}
.check-line input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--sage);
}
.check-line small {
  color: var(--muted);
  margin-left: auto;
}
.recovery-card {
  grid-column: 1 / -1;
  border-color: var(--terra-dark);
}
.welcome-logo {
  display: block;
  margin: 0 auto 24px;
}
.calendar-event b {
  font-weight: 600;
}
@media (max-width: 1100px) {
  :root {
    --sidebar: 244px;
  }
}
@media (max-width: 760px) {
  :root {
    --sidebar: 280px;
  }
  header {
    display: flex;
  }
  #menuButton {
    display: inline-flex;
  }
  .header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font:
      21px Georgia,
      serif;
    letter-spacing: 3px;
  }
  .undo-label {
    display: none !important;
  }
  .record {
    flex-wrap: wrap;
  }
  .record-actions {
    flex-direction: row;
    max-width: none;
    width: 100%;
    justify-content: flex-end;
    margin-top: -6px;
  }
  .ico {
    width: 24px;
    height: 24px;
  }
  .ingredient-list {
    columns: 1;
  }
  .check-grid {
    grid-template-columns: 1fr;
  }
  .stat strong {
    font-size: 26px;
  }
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
@media (max-width: 760px) {
  .mobile-nav button span:first-child {
    font-size: 22px;
    line-height: 1.1;
  }
}

/* ---------- RESET 2.1 · UI-01 · UI-02 · UI-03 ---------- */
/* Símbolo original (raster aprobado del icono instalado). */
.brand img,
.header-brand img,
.welcome-logo {
  flex-shrink: 0;
  object-fit: contain;
}
/* Textos mínimos de 12 px y contraste AA (completados en calendario sin opacidad). */
.undo-label,
.calendar-event small,
.calendar-more {
  font-size: 12px;
}
.calendar-event.done {
  opacity: 1;
  color: var(--muted);
}
.record.done .record-title {
  color: #6b5f55;
}
/* Campos: mismas proporciones en iPhone que en Android (Samsung como referencia). */
input[type="date"],
input[type="time"],
select {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  height: 46px;
  line-height: 22px;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2371655b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 9px;
  text-overflow: ellipsis;
}
.form-grid > * {
  min-width: 0;
}
/* Objetivos táctiles de 44 × 44. */
.record-title {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.filters select {
  min-height: 46px;
}
.header-brand {
  min-height: 44px;
}
.text-button {
  min-height: 44px;
}
.toast-undo {
  min-height: 44px;
}
/* Pie de formulario siempre visible (también en ordenador con poca altura). */
dialog .dialog-actions {
  position: sticky;
  bottom: -25px;
  background: var(--paper);
  padding: 12px 0 25px;
  margin-bottom: -25px;
  box-shadow: 0 -10px 12px -12px #3d302533;
  z-index: 2;
}
@media (max-width: 760px) {
  dialog .dialog-actions {
    bottom: -20px;
    padding: 12px 0 20px;
    margin-bottom: -20px;
  }
}
/* Tableta: iconos de acción en una sola fila. */
@media (min-width: 761px) and (max-width: 1100px) {
  .record-actions {
    max-width: none;
    flex-wrap: nowrap;
  }
}
/* Menú lateral compacto en pantallas bajas (1366 × 768, 1280 × 720, 1024 × 768). */
@media (min-width: 761px) and (max-height: 860px) {
  #sidebar {
    padding-top: 18px;
    padding-bottom: 12px;
  }
  .brand {
    margin-bottom: 12px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand span {
    font-size: 25px;
  }
  .search-open {
    margin-bottom: 6px;
    min-height: 44px;
    padding: 8px 10px;
  }
  .nav-label {
    margin: 10px 12px 2px;
  }
  .nav-item {
    margin: 0;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .save-state {
    margin: 8px 0 0;
  }
}
/* Copias y Ajustes: Deshacer integrado en la cabecera de la página. */
body.no-add .top-actions {
  align-self: flex-start;
}
@media (max-width: 760px) {
  body.no-add .top-actions {
    margin-left: 0;
    width: 100%;
  }
  body.no-add #undoButton {
    width: 100%;
    justify-content: center;
  }
}
/* Bienvenida: importar una copia existente. */
.welcome-import {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.welcome-import p {
  margin: 0 0 10px;
}
.welcome-import .secondary {
  width: 100%;
}
/* Avisos de copia y recuperación. */
.warning-text {
  color: #803f2d;
  background: #f6e7e1;
  border-radius: 8px;
  padding: 12px 14px;
}
.ok-text {
  color: #375a43;
  font-weight: 600;
}
.verify ol {
  padding-left: 20px;
}
.backup-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.backup-row small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.done-link {
  margin: -6px 0 10px;
  font-size: 14px;
}
.dayless {
  margin-top: 22px;
}
.ingredient-note {
  margin-top: 10px;
}
.danger-button {
  background: #b25a44;
  border-color: #934632;
  color: #fff;
}
@media (max-width: 760px) {
  .weekday {
    font-size: 12px;
  }
  .calendar-event {
    font-size: 12px;
  }
}
.buttons{display:flex;gap:9px;flex-wrap:wrap}
#globalWarning .recovery-card{margin-bottom:22px}
/* Objetivos táctiles restantes (medición 2.1). */
.brand,
.header-brand {
  min-height: 44px;
}
.avatar {
  width: 44px;
  height: 44px;
  min-height: 44px;
}
.tab {
  min-width: 44px;
}
/* Menú lateral: sombra inferior solo cuando queda contenido por desplazar (pantallas muy bajas). */
#sidebar {
  background:
    linear-gradient(#faf7f1 30%, #faf7f100) center top / 100% 40px no-repeat local,
    linear-gradient(#faf7f100, #faf7f1 70%) center bottom / 100% 40px no-repeat local,
    radial-gradient(farthest-side at 50% 100%, #3d30253d, #3d302500) center bottom / 100% 16px no-repeat scroll,
    #faf7f1;
}
@media (min-width: 761px) and (max-height: 740px) {
  #sidebar {
    padding-top: 12px;
  }
  .brand {
    margin-bottom: 8px;
  }
  .nav-label {
    margin: 6px 12px 0;
  }
  .save-state {
    margin-top: 4px;
  }
}

/* ---------- RESET 2.2 · cambios localizados (C07, C10) ---------- */
/* C07: el filtro «Tipo» (Agenda y Comunicación) reserva el hueco de la flecha; .filters select fijaba padding 8px 10px
   y anulaba el padding-right de los desplegables. Mismo alto, estilo y posición; el ancho crece solo lo que ocupa la flecha. */
.filters select {
  padding-right: 38px;
}
/* C10: el aviso temporal no captura las pulsaciones dirigidas a los controles que quedan debajo; sus botones
   (Deshacer, Ver) siguen siendo pulsables y accesibles. Mismo aspecto, posición y duración. */
#toast {
  pointer-events: none;
}
#toast button {
  pointer-events: auto;
}
