@font-face {
  font-family: "Diary Roboto";
  src: url("./assets/fonts/roboto.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
}
/* User-approved Material palette and typography; all product values live here. */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-warm: var(--surface);
  --fg: #111827;
  --fg-2: var(--fg);
  --muted: #5b616e;
  --meta: var(--muted);
  --border: #d8d6da;
  --border-soft: color-mix(in srgb, var(--border), var(--surface) 40%);
  --control-border: #73717a;
  --accent: #f8cfe0;
  --accent-on: #8f345b;
  --accent-hover: color-mix(in srgb, var(--accent), var(--accent-on) 6%);
  --accent-active: color-mix(in srgb, var(--accent), var(--accent-on) 10%);
  --accent-soft: color-mix(in srgb, var(--accent), var(--surface) 64%);
  --danger: #b3261e;
  --scrim: color-mix(in srgb, var(--fg), transparent 48%);
  --font-display: "Diary Roboto", sans-serif;
  --font-body: "Diary Roboto", sans-serif;
  --text-sm: .875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-field: 8px;
  --radius-surface: 12px;
  --radius-button: 24px;
  --line-body: 1.5;
  --line-heading: 1.4;
  --duration: 180ms;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent-on), transparent 70%);
  --modal-shadow: 0 8px 24px color-mix(in srgb, var(--fg), transparent 84%);
  --touch: 48px;
  --phone-screen-bg: var(--surface);
}
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--text-base); font-weight: 400; font-synthesis: none; line-height: var(--line-body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; font-synthesis: none; color: inherit; }
button { cursor: pointer; }
button, input, textarea, select, a, summary, pre[tabindex] { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .62; cursor: progress; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: var(--line-heading); overflow-wrap: break-word; }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); font-weight: 600; }
strong { font-weight: 600; }
a { color: var(--accent-on); text-underline-offset: var(--space-1); }
:where(button, input, textarea, select, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent-on); outline-offset: 2px; box-shadow: var(--focus-ring); }
:where(h1, #screen-content):focus:not(:focus-visible) { outline: none; }
button > span { display: block; min-width: 0; }
.muted, .field-help { color: var(--muted); }
.danger, .error, .field-error, .error-summary, .warning { color: var(--danger); }
.required { font-weight: 400; color: var(--muted); }
.icon { display: block; flex: none; width: 24px; height: 24px; }
.od-stack { --od-gap: var(--space-2); }
.od-row, .od-row-top, .od-cluster { --od-gap: var(--space-2); }
.od-field { --od-gap: var(--space-1); }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.price, .date-display, .total-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.presentation { display: grid; justify-items: center; gap: var(--space-6); padding: var(--space-8) var(--space-4); }
.presentation-heading { text-align: center; display: grid; gap: var(--space-1); max-width: 60ch; }
.presentation-heading strong { font-size: var(--text-lg); font-weight: 500; }
.presentation-note { max-width: 56ch; text-align: center; color: var(--muted); font-size: var(--text-sm); }
.presentation-note a { display: inline-flex; align-items: center; min-height: var(--touch); }
.phone-content { display: flex; flex-direction: column; overflow: visible; background: var(--surface); }
#app-mount { display: flex; flex: 1 1 0; min-height: 0; min-width: 0; }
.app { flex: 1 1 0; height: auto; min-width: 0; min-height: 0; background: var(--surface); }
.app-header { flex-wrap: wrap; align-items: center; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border-soft); background: var(--surface); }
.app-title { font-size: var(--text-xl); font-weight: 500; min-width: min(100%, 8rem); }
.app-header:has(.icon-button + .app-title) .app-title { font-size: var(--text-lg); }
.app-body { padding: var(--space-4); scroll-padding-block: var(--space-4); scrollbar-width: thin; overflow-x: clip; }
.app-body > * + * { margin-top: var(--space-4); }
.app-body > .feedback[hidden] + * { margin-top: 0; }
.feedback { padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-field); overflow-wrap: anywhere; }
.feedback.error { border-color: var(--danger); }
.icon-button, .text-button, .outlined-button, .primary-button, .segmented > button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: 1px solid transparent; background: transparent; border-radius: var(--radius-button); padding: var(--space-3) var(--space-4); min-height: var(--touch); max-width: 100%; text-decoration: none; line-height: var(--line-body); font-weight: 500; transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease); }
.icon-button { padding: var(--space-3); width: var(--touch); flex: none; color: var(--accent-on); }
.text-button { color: var(--accent-on); }
.text-button.danger, .outlined-button.danger { color: var(--danger); }
.outlined-button { border-color: var(--control-border); color: var(--accent-on); }
.primary-button { width: 100%; color: var(--accent-on); background: var(--accent); }
.primary-button > span { text-wrap: balance; }
.text-button:active, .outlined-button:active { background: var(--accent-soft); }
.primary-button:active { background: var(--accent-active); }
.day-controls { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.day-heading { display: grid; gap: var(--space-1); }
.date-display { display: block; font-size: var(--text-xl); font-weight: 500; }
.day-controls .od-cluster { justify-content: space-between; }
.diary-section + .diary-section { margin-top: var(--space-4); }
.section-heading { margin-bottom: var(--space-1); flex-wrap: wrap; }
.section-heading h2 { min-width: min(100%, 8rem); }
.record-row, .event-row, .data-link { display: flex; width: 100%; padding: var(--space-3) 0; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; text-align: left; text-decoration: none; color: var(--fg); min-height: var(--touch); align-items: center; }
.record-row strong { font-weight: 500; white-space: pre-line; }
.record-row > .icon, .event-row > .icon, .data-link > .icon { color: var(--muted); }
.record-row .od-field, .event-row .od-field, .data-link .od-field { gap: var(--space-1); }
.event-row strong { font-weight: 500; }
.event-row { padding-block: var(--space-3); }
.empty-line { padding: var(--space-2) 0 var(--space-3); }
.day-total { margin-top: var(--space-6); border-top: 1px solid var(--border); padding-top: var(--space-4); }
.total-number { display: block; max-width: 100%; overflow-x: auto; font-size: clamp(1.25rem, 7vw, 2rem); font-weight: 500; line-height: var(--line-heading); }
.bottom-nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-2); padding: var(--space-2); border-top: 1px solid var(--border); background: var(--surface); }
.nav-item { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--space-1); border: 0; border-radius: var(--radius-field); padding: var(--space-2) var(--space-1); min-height: var(--touch); color: var(--muted); background: transparent; font-size: var(--text-base); font-weight: 500; }
.nav-item > span:last-child { text-align: center; }
.nav-symbol { display: grid; place-items: center; min-width: 56px; min-height: 32px; padding: var(--space-1) var(--space-4); border-radius: var(--radius-button); }
.nav-item.current { color: var(--accent-on); }
.nav-item.current .nav-symbol { background: var(--accent); }
.form-stack { gap: var(--space-4); }
.field { gap: var(--space-2); min-width: 0; }
.field label, .field legend { font-weight: 500; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select, .date-input input { display: block; width: 100%; min-width: 0; min-height: var(--touch); border: 1px solid var(--control-border); border-radius: var(--radius-field); padding: var(--space-3); background: var(--surface); color: var(--fg); font-variant-numeric: tabular-nums; }
.field textarea { resize: vertical; font-variant-numeric: normal; line-height: var(--line-body); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field [aria-invalid=true] { border-color: var(--danger) !important; }
.date-input { align-items: stretch; }
.date-input input { flex: 1 1 0; }
.date-input .icon-button { align-self: center; }
.field-help, .field-error { font-size: var(--text-base); line-height: var(--line-body); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: var(--space-2); }
.choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 120px; min-height: var(--touch); padding: var(--space-2) var(--space-3); border: 1px solid var(--control-border); border-radius: var(--radius-field); cursor: pointer; }
.choice input { display: block; flex: none; width: 20px; height: 20px; accent-color: var(--accent-on); }
.choice:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-on); color: var(--accent-on); }
.choice:has(input:focus-visible) { box-shadow: var(--focus-ring); outline: 2px solid var(--accent-on); outline-offset: 2px; }
.time-inputs { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.time-inputs > .od-field { flex: 1 1 120px; }
.optional-fields { padding-block: var(--space-2); border-block: 1px solid var(--border); }
summary { cursor: pointer; min-height: var(--touch); padding-block: var(--space-3); font-weight: 500; }
.optional-fields > .od-stack { padding-block: var(--space-3); gap: var(--space-4); }
.form-footer { display: grid; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); background: var(--surface); }
.error-summary { padding: var(--space-3); border: 1px solid var(--danger); border-radius: var(--radius-field); }
.error-summary ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
.error-summary a { color: var(--danger); }
.record-detail { gap: var(--space-4); }
.detail-dishes { font-size: var(--text-xl); }
.detail-field { padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-soft); }
.detail-actions { margin-top: var(--space-2); }
.search-results { margin-top: var(--space-6); }
.result-count { color: var(--muted); margin-bottom: var(--space-2); }
.segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.segmented > button { flex: 1 1 120px; border-color: var(--control-border); border-radius: var(--radius-field); }
.segmented > button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-on); color: var(--accent-on); }
.spending-summary { margin-top: var(--space-6); padding-block: var(--space-4); border-block: 1px solid var(--border); }
.data-links { margin-top: var(--space-4); }
.data-link { padding-block: var(--space-4); }
.privacy-note { padding-top: var(--space-4); }
.switch-row { display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch); padding-block: var(--space-2); cursor: pointer; }
.switch-row > input { display: block; flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent-on); }
.switch-row > span { display: block; min-width: 0; }
.switch-row:focus-within { outline: 2px solid var(--accent-on); outline-offset: 2px; border-radius: var(--radius-field); }
.report-date { font-variant-numeric: tabular-nums; }
.report-actions { margin-top: var(--space-4); }
.report-disclosure { border-top: 1px solid var(--border); }
.report-text { margin: 0; padding-block: var(--space-3); font-family: var(--font-body); font-size: var(--text-base); line-height: var(--line-body); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.restore-section { padding-top: var(--space-6); margin-top: var(--space-6); border-top: 1px solid var(--border); }
.restore-review { padding-top: var(--space-4); border-top: 1px solid var(--border-soft); gap: var(--space-3); }
.file-name, .file-status { overflow-wrap: anywhere; }
.file-label { cursor: pointer; width: 100%; }
.file-control:focus-within .file-label { outline: 2px solid var(--accent-on); outline-offset: 2px; box-shadow: var(--focus-ring); }
.visually-hidden { position: absolute; display: block; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
#dialog-host { position: absolute; inset: var(--phone-safe-top) 0 var(--phone-safe-bottom); z-index: 30; pointer-events: none; }
.modal-scrim { display: grid; align-items: center; justify-items: center; gap: var(--space-4); min-height: 100%; max-height: 100%; padding: var(--space-4); overflow-y: auto; background: var(--scrim); pointer-events: auto; }
.confirm-dialog { width: 100%; max-width: 32rem; max-height: 100%; overflow-y: auto; padding: var(--space-5); border-radius: var(--radius-surface); background: var(--surface); box-shadow: var(--modal-shadow); gap: var(--space-4); }
.confirm-dialog h2 { font-size: var(--text-xl); }
.confirm-dialog p { overflow-wrap: anywhere; }
.dialog-actions { gap: var(--space-2); }
.calendar-fields { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.calendar-fields > .field { flex: 1 1 80px; }
.hardware-button, .status-bar, .home-indicator, .dynamic-island { pointer-events: none; }
.skip-link { position: fixed; top: var(--space-2); left: var(--space-2); z-index: 100; padding: var(--space-3); color: var(--accent-on); background: var(--surface); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
@media (hover: hover) {
  .primary-button:hover { background: var(--accent-hover); }
  .text-button:hover, .icon-button:hover, .outlined-button:hover { background: var(--accent-soft); }
  .record-row:hover, .event-row:hover, .data-link:hover, .nav-item:hover { background: var(--bg); }
  a:hover { text-decoration-thickness: 2px; }
}
@media (min-width: 768px) { .presentation { padding-block: var(--space-8); } }
@media (min-width: 1024px) { .presentation { gap: var(--space-8); } }
@media (min-width: 1440px) { .presentation { padding-inline: var(--space-12); } }
/* Do not shrink the handset in a short viewport. Let the app and page flow. */
@media (max-width: 480px), (max-height: 700px) {
  .presentation { display: block; padding: 0; }
  .presentation-heading, .presentation-note { display: none; }
  .phone-frame { width: 100%; height: auto; min-height: 100dvh; padding: 0; border-radius: 0; background: var(--surface); box-shadow: none; }
  .phone-frame::before, .phone-frame::after, .hardware-button { display: none; }
  .phone-screen { width: 100%; height: auto; min-height: 100dvh; border-radius: 0; box-shadow: none; overflow: visible; }
  .phone-content { position: relative; inset: auto; min-height: 100dvh; padding-top: var(--phone-safe-top); padding-bottom: var(--phone-safe-bottom); }
  #app-mount { flex: 1 0 auto; }
  .app { display: flex; flex-direction: column; min-height: calc(100dvh - var(--phone-safe-top) - var(--phone-safe-bottom)); }
  .app-body { overflow: visible; flex: 1 0 auto; }
  .app-header, .bottom-nav, .form-footer { flex: none; }
  #dialog-host { position: fixed; inset: var(--phone-safe-top) 0 var(--phone-safe-bottom); }
  .home-indicator { position: fixed; }
}
@media (max-width: 375px) {
  .app-header, .app-body { padding-inline: var(--space-3); }
  .day-controls .od-cluster { justify-content: flex-start; }
  .confirm-dialog { padding: var(--space-4); }
}
@media (max-height: 500px) {
  :root { --phone-safe-top: 32px; --phone-safe-bottom: 20px; }
  .dynamic-island { display: none; }
  .status-bar { padding-top: var(--space-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
