@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Nunito:wght@700;800&display=swap');

:root {
  --font-heading: "Nunito", sans-serif;
  --font-body: "Inter", sans-serif;
  --color-primary: #4E7D79;
  --color-secondary: #87AF9D;
  --color-accent: #E89C74;
  --color-peach-light: #F0B090;
  --color-skin-light: #F8D4B6;
  --color-sage-light: #A9C5B8;
  --color-background: #FDFBF5;
  --color-text: #4E7D79;
  --color-text-muted: #6A7D80;
  --color-border: #B7CBC5;
  color-scheme: light;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(139, 72, 38, 0.13), transparent 28%),
    radial-gradient(circle at top right, rgba(196, 145, 71, 0.16), transparent 24%),
    linear-gradient(180deg, #f7efdf 0%, #eadcc5 100%);
  color: #3b2417;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 800; letter-spacing: -0.02em; color: #4E7D79; }
body, button, input, textarea { font-family: var(--font-body); }
h1:focus, h2:focus, h3:focus, h4:focus { outline: none; }

body { background: var(--color-background); color: var(--color-text); }
.button-link, button:not(.secondary) { background: var(--color-primary); }
.button-link.secondary, button.secondary { background: var(--color-secondary); color: #fff; }
.panel, .item, .modal-window { border-color: var(--color-border); }
.brand-logo { width: 320px; height: 140px; object-fit: contain; }
.quick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick-card { display: flex; align-items: flex-start; gap: 10px; min-height: 130px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--color-border); }
.quick-card > div { display: grid; gap: 5px; }
.quick-card strong { color: var(--color-text); }
.quick-card span:not(.quick-icon), .quick-card small { color: var(--color-text-muted); }
.quick-icon { font-size: 1.7rem; }
.category-feed { border-top: 5px solid var(--color-accent); }
.category-diaper { border-top: 5px solid var(--color-secondary); }
.category-care { border-top: 5px solid var(--color-peach-light); }
.category-temperature { border-top: 5px solid var(--color-primary); }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.status-card { border-left: 7px solid var(--color-secondary); }
.status-card.status-due { border-left-color: var(--color-accent); }
.status-card.status-alert { border-left-color: #d76d52; }
.status-card h3 { margin-top: 0; }
.status-card > strong { font-size: 1.35rem; }
.action-status-grid { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.action-status { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; padding: 12px 14px; border: 1px solid var(--color-border); border-left: 6px solid var(--color-accent); border-radius: 14px; background: #fff; }
.action-status { color: inherit; font: inherit; text-align: left; cursor: pointer; }
.action-status.status-alert { border-left-color: #d76d52; background: #fff4ee; box-shadow: 0 6px 18px rgba(215, 109, 82, .16); }
.action-status-icon { font-size: 1.5rem; }
.action-status div { display: grid; gap: 2px; }
.action-status strong { color: var(--color-primary); }
.action-status.status-alert strong { color: #b84f38; }
.action-status span:not(.action-status-icon) { color: var(--color-text-muted); font-size: .85rem; }
.action-status-ok { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: #34825c; font-size: .82rem; font-weight: 700; order: 2; }
.task-completion-celebration { display: grid; justify-items: center; gap: 2px; width: 100%; margin: -8px 0 2px; color: #8b6818; font-size: .95rem; }
.task-completion-trophy { position: relative; width: min(190px, 45vw); height: 154px; color: #d9a92e; font-size: 5rem; line-height: 154px; text-align: center; }
.task-completion-trophy canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.action-status { order: 1; }
.pump-task-action { display: inline-flex; align-items: center; justify-self: start; margin-top: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(78,125,121,.1); color: var(--color-primary) !important; font-size: .78rem !important; font-weight: 700; }
.pumping-nav-status { color: #b84f38 !important; font-weight: 800; white-space: nowrap; }
.pumping-nav-status { order: 5; padding: 9px 14px; border-radius: 999px; background: linear-gradient(135deg,#fff0e8,#ffe2d4); border: 1px solid #edb59e; box-shadow: 0 3px 10px rgba(184,79,56,.12); }
.feed-history-line { fill: none; stroke: var(--color-primary); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.feed-history-point { fill: var(--color-primary); }
.feed-projected-point { fill: var(--color-accent); stroke: #fff; stroke-width: 2; }
.feed-actual-point { fill: #fff; stroke: #b84f38; stroke-width: 3; }
.three-bottle-card { display: flex; align-items: center; justify-content: center; gap: 22px; width: 100%; min-height: 290px; padding: 8px 0 16px; }
.three-bottle-canvas { position: relative; width: min(300px, 52vw); height: 280px; }
.three-bottle-canvas canvas { display: block; width: 100%; height: 100%; }
.three-bottle-fallback { position: absolute; inset: 0; display: grid; place-items: center; transform: translateY(-12px); }
.fallback-bottle { position: relative; width: 218px; height: 190px; margin-top: 24px; border: 3px solid rgba(78,125,121,.7); border-radius: 24px; overflow: visible; background: rgba(218,241,238,.22); box-shadow: inset 0 0 10px rgba(78,125,121,.15); }
.fallback-liquid { position: absolute; left: 7px; right: 7px; bottom: 7px; border-radius: 14px 14px 10px 10px; min-height: 0; }
.fallback-formula { background: rgba(232,223,202,.98); }
.fallback-breast-milk { background: rgba(253,252,249,.98); border: 2px solid rgba(78,125,121,.95); }
.fallback-capacity { position: absolute; right: 6px; bottom: 6px; color: var(--color-text-muted); font-size: .75rem; }
.three-bottle-capacity { position: absolute; right: 6px; bottom: 6px; color: var(--color-text-muted); font-size: .75rem; }
.three-bottle-values { display: grid; gap: 9px; min-width: 180px; color: var(--color-text-muted); }
.three-bottle-values strong { color: var(--color-primary); }
.bottle-legend { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border-radius: 50%; vertical-align: -1px; }
.formula-legend { background: #e8dfca; }
.breast-milk-legend { background: #fdfcf9; border: 1px solid #788d80; }
.three-loading-spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid rgba(78,125,121,.2); border-top-color: #4e7d79; border-radius: 50%; animation: three-spinner-fallback .8s linear infinite; }
.three-loading-spinner canvas { display: block; width: 36px; height: 36px; }
@keyframes three-spinner-fallback { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .three-bottle-card { flex-direction: column; gap: 8px; min-height: 0; }
  .three-bottle-canvas { width: min(320px, 88vw); height: 280px; }
  .three-bottle-values { width: min(320px, 88vw); min-width: 0; }
}
.weight-line { fill: none; stroke: var(--color-primary); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.weight-point { fill: var(--color-accent); }
.baby-log-form { display: grid; gap: 18px; }
.log-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; }
.log-section h3 { margin: 0; color: var(--color-primary); }
.log-section-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: transparent; color: var(--color-primary); text-align: left; font: inherit; }
.log-section-title { font-weight: 800; }
.collapse-chevron { display: none; font-size: 1.35rem; line-height: 1; }
.log-section-content { display: grid; gap: 12px; }
.date-recorded-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.date-recorded-fields > label { min-width: 0; }
.date-time-field { display: grid; gap: 6px; min-width: 0; }
.date-recorded-fields input[type="datetime-local"] { width: 100%; min-width: 0; appearance: auto; -webkit-appearance: auto; cursor: pointer; }
.date-recorded-fields input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; }
.comment-field { field-sizing: content; }
.toggle-row { display: flex !important; align-items: center; gap: 10px; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--color-primary); }
.poop-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.poop-button { min-width: 44px; min-height: 44px; padding: 6px; background: #fff; color: var(--color-text); border: 1px solid var(--color-border); }
.poop-button.selected { background: var(--color-accent); color: #fff; }
.care-grid, .two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.log-table-wrap { overflow-x: auto; border: 1px solid #d2d2d7; border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(60, 60, 67, .08); }
.log-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.log-table th, .log-table td { padding: 12px 10px; border-bottom: 1px solid #e5e5ea; text-align: left; vertical-align: top; }
.log-table th { color: #6e6e73; background: #f5f5f7; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.log-table tbody tr:nth-child(even):not(.log-date-row) td { background: #f9f9fb; }
.log-table tbody tr:not(.log-date-row):hover td { background: #f0f7f5; }
.log-table tbody tr:last-child td { border-bottom: 0; }
.wet-indicator { display: inline-block; width: 34px; height: 10px; border-radius: 999px; background: #9aa3aa; vertical-align: middle; }
.check-mark { color: #69737a; font-size: 1.15rem; font-weight: 800; }
.empty-cell { color: var(--color-text-muted); }
.poop-cell { white-space: nowrap; }
.comment-info { display: none; font-size: .9rem; line-height: 1; vertical-align: middle; color: var(--color-primary); }
.comment-detail-row { display: none; }
.comment-detail-content { overflow: hidden; }
.day-switcher { display: flex; align-items: center; gap: 10px; }
.loading-spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loading-spin .7s linear infinite; vertical-align: -.15em; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 96px; color: var(--color-text-muted); }
.load-more-row { display: flex; justify-content: center; padding: 16px 0 4px; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.save-success-modal { position: fixed !important; inset: 0 !important; z-index: 2147483647; display: grid; place-items: center; padding: 20px; background: rgba(255, 255, 255, .72); animation: save-success-fade 1.5s linear both; }
.save-success-center { display: grid; justify-items: center; gap: 14px; color: #23834f; font-size: 1.25rem; animation: save-success-center-fade 1.5s ease-in-out both; }
.save-success-check { display: grid; place-items: center; width: 112px; height: 112px; border: 7px solid #2f9d63; border-radius: 50%; background: #fff; color: #2f9d63; font-size: 5rem; line-height: 1; font-weight: 800; box-shadow: 0 12px 38px rgba(35, 131, 79, .2); }
.delete-confirmation { width: min(440px, 100%); }
.delete-confirmation h2 { margin-top: 0; color: var(--color-primary); }
.danger-button,
button.danger-button { background: #b84f38 !important; color: #fff; border: 0 !important; box-shadow: none; }
@keyframes save-success-fade { 0% { opacity: 0; } 30% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes save-success-center-fade { 0% { opacity: 0; transform: scale(.88); } 30% { opacity: 1; transform: scale(1); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
.stats-page-summary { margin: 18px 0 24px; }
.stats-total { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 4px; color: var(--color-primary); }
.stats-total span { font-size: 1.05rem; }
.stats-total strong { font-size: 2rem; }
.log-date-row td { padding: 8px 10px 4px; border-bottom: 0; color: #4e7d79; font-weight: 700; background: #eef3f1; }
.feed-chart-section { margin-top: 24px; padding: 18px; border: 1px solid var(--color-border); border-radius: 16px; background: #fff; }
.chart-section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.chart-section-head h3 { margin: 0 0 4px; color: var(--color-primary); }
.chart-section-head > strong { font-size: 1.35rem; white-space: nowrap; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 16px 0 4px; color: var(--color-text-muted); font-size: .9rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend small { font-size: .8em; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.breast-milk-swatch { background: var(--color-secondary); }
.formula-swatch { background: var(--color-accent); }
.chart-scroll { overflow-x: auto; }
.feed-area-chart { display: block; width: 100%; min-width: 560px; height: auto; margin-top: 4px; }
.chart-grid-line { stroke: rgba(135,175,157,.35); stroke-width: 1; }
.chart-y-label, .chart-x-label { fill: var(--color-text-muted); font-size: 14px; }
.chart-tick { stroke: var(--color-primary); stroke-width: 1; }
.breast-milk-area { fill: rgba(135,175,157,.72); }
.formula-area { fill: rgba(232,156,116,.78); }
.breast-milk-line, .formula-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.breast-milk-line { stroke: #4f8b68; }
.formula-line { stroke: #c76b45; }
.adjustment-swatch { width: 18px; height: 0; border-top: 3px dashed #5f7775; border-radius: 0; }
.adjustment-line { fill: none; stroke: #5f7775; stroke-width: 3; stroke-dasharray: 10 6; opacity: 1; }
.temperature-line { fill: none; stroke: var(--color-primary); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.temperature-point { fill: var(--color-primary); }
.temperature-medicine-marker { font-size: 18px; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.temperature-medicine-marker rect { fill: #e89c74; stroke: #7a4229; stroke-width: 1.5; }
.temperature-medicine-marker line { stroke: #fff; stroke-width: 1.5; }
.log-temperature-event strong { font-size: .78em; font-weight: 700; }
.chart-point { stroke: #fff; stroke-width: 2; }
.formula-point { fill: var(--color-accent); }
.chart-axis-label { color: var(--color-text-muted); font-size: .85rem; margin-left: 6px; }
.chart-empty { margin-top: 24px; }
.feed-chart { height: 260px; display: flex; align-items: end; justify-content: center; padding: 20px; background: linear-gradient(to top, rgba(135,175,157,.18) 1px, transparent 1px); background-size: 100% 20%; border-bottom: 2px solid var(--color-primary); }
.feed-chart-dual { gap: 18px; }
.feed-chart-dual .chart-bar { width: min(22%, 120px); }
.formula-bar { background: var(--color-accent); }
.breast-milk-bar { background: var(--color-secondary); }
.chart-bar { width: min(120px, 30%); min-height: 4%; display: flex; align-items: start; justify-content: center; padding-top: 8px; background: var(--color-accent); color: #fff; border-radius: 12px 12px 0 0; transition: height .2s ease; }
.chart-axis { display: flex; justify-content: space-between; color: var(--color-text-muted); margin: 8px 0 20px; }
.app-version { color: var(--color-primary); }
.settings-link { display: block; padding: 8px 0; color: var(--color-primary); }
.admin-override-grid { display: grid; gap: 18px; margin: 18px 0 8px; }
.admin-override-grid label { display: grid; gap: 8px; }
.admin-override-grid input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.admin-override-scale { display: flex; justify-content: space-between; gap: 8px; color: var(--color-text-muted); font-size: .75rem; }
.admin-config-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--color-border); }
.admin-config-section h2 { margin: 0 0 4px; color: var(--color-primary); }
.telegram-config-status { display: grid; gap: 6px; align-content: start; color: #425065; font-size: .94rem; }
.telegram-config-status strong { font-weight: 500; color: var(--color-text-muted); }
.faq-page { max-width: 820px; }
.faq-list { display: grid; gap: 16px; margin-top: 22px; }
.faq-item { padding: 18px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; }
.faq-item h3 { margin: 0 0 8px; color: var(--color-primary); }
.faq-item p { margin: 0; }
.faq-item ul { margin: 12px 0 0; padding-left: 22px; }
.entry-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--color-border); padding-bottom: 10px; }
.section-menu { display: inline-flex; align-items: center; gap: 3px; margin: 0 0 18px; padding: 4px; border: 1px solid #d5dfdb; border-radius: 12px; background: #e9efec; box-shadow: 0 1px 2px rgba(27,55,46,.08); }
.section-menu-item { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 74px; width: auto; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent !important; color: #52645f; font-weight: 600; transition: background-color .15s ease, box-shadow .15s ease, color .15s ease; }
.section-menu-item:hover { background: rgba(255,255,255,.55) !important; }
.section-menu-item.selected { background: #fff !important; color: var(--color-primary); box-shadow: 0 1px 3px rgba(27,55,46,.2); font-weight: 700; }
.section-menu-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.section-menu-icon { min-width: 44px; padding-inline: 10px; }
.section-menu-repeat-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.entry-tabs button.active { background: var(--color-primary); color: white; }
.entry-tabs button { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; width: auto; min-height: 40px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 10px; }
.entry-tabs button.active { background: var(--color-primary); color: #fff; }
.task-log-tab-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.repeating-task-config { display: grid; gap: 12px; }
.repeating-task-config h2, .repeating-task-config p { margin: 0; }
.repeating-task-config-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; }
.repeating-task-config-icon { font-size: 1.5rem; }
.repeating-task-config-card > div { flex: 1; display: grid; gap: 4px; }
.repeating-task-config-card > div span { color: var(--color-text-muted); font-size: .85rem; }
.repeating-task-config-card.inactive { opacity: .65; }
.repeating-task-config-card .task-inactive-label { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: #eef0ed; font-size: .72rem; font-weight: 600; }
.repeating-task-editor { padding: 16px; border: 1px solid var(--color-border); border-radius: 14px; background: rgba(255,255,255,.65); }
.repeating-task-modal { width: min(620px, 100%); max-height: min(90vh, 820px); overflow-y: auto; }
.repeating-task-modal .modal-head { position: sticky; top: -22px; z-index: 1; padding: 4px 0 12px; background: var(--color-background); }
.repeating-task-modal .modal-head h2 { margin: 0; }
.repeating-task-modal .actions { margin-top: 18px; }
.task-event-status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: rgba(47,157,99,.12); color: #23764a; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.task-event-status.skipped { background: rgba(106,125,128,.13); color: #58676a; }
.task-reminder-hours { margin: 0; border: 1px solid var(--color-border); border-radius: 12px; }
.task-hour-options { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
.task-hour-options label { display: flex; align-items: center; gap: 5px; }
.feed-bar-chart { height: 260px; display: flex; align-items: end; gap: 12px; overflow-x: auto; padding: 12px 8px 0; border-bottom: 2px solid var(--color-primary); }
.feed-bar-item { min-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; color: var(--color-text-muted); }
.feed-bar-stack { height: calc(100% - 26px); width: 32px; display: flex; flex-direction: column-reverse; justify-content: start; }
.feed-bar-stack span { display: block; min-height: 0; width: 100%; }
.mama-summary { margin-top: 18px; }
.subsection-heading { margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--color-border); color: var(--color-primary); font-size: 1.15rem; font-weight: 800; }
.changelog-content { display: grid; gap: 10px; max-width: 100%; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; }
.changelog-content h1, .changelog-content h2, .changelog-content h3 { margin: 8px 0 0; }
.changelog-content h1 { font-size: 1.5rem; }
.changelog-content h2 { font-size: 1.2rem; padding-bottom: 4px; border-bottom: 1px solid var(--color-border); }
.changelog-content h3 { margin-top: 4px; color: var(--color-text); font-size: 1rem; }
.changelog-content ul { margin: 0; padding-left: 24px; }
.changelog-content li { padding-left: 4px; }
.changelog-content code { padding: 2px 5px; border-radius: 5px; background: #f1e9dc; color: #76502d; font-size: .92em; }
.changelog-content a { text-decoration: underline; }
.dashboard-collapsible { margin-bottom: 18px; }
.dashboard-collapsible > summary { cursor: pointer; list-style: none; }
.dashboard-collapsible > summary::-webkit-details-marker { display: none; }
.dashboard-collapsible > summary::after { content: '+'; float: right; font-size: 1.25rem; line-height: 1; }
.dashboard-collapsible[open] > summary::after { content: '−'; }
.dashboard-collapsible .quick-grid { margin-bottom: 0; }
.mama-heading { margin-top: 28px; }
.feed-bar-total { min-height: 1.2em; color: var(--color-primary); font-size: .78rem; white-space: nowrap; }
.client-chart { min-height: 260px; display: flex; align-items: end; gap: 12px; overflow-x: auto; padding: 12px 8px 0; border-bottom: 2px solid var(--color-primary); }
.client-chart-column { min-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; color: var(--color-text-muted); }
.client-chart-stack { height: 210px; width: 32px; display: flex; flex-direction: column-reverse; justify-content: start; }
.client-chart-stack span { display: block; min-height: 0; width: 100%; }
.client-chart-total { min-height: 1.2em; color: var(--color-primary); font-size: .78rem; white-space: nowrap; }
.vitamin-checks { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.person-short { display: none; }

@media (min-width: 851px) {
  .feed-area-chart .chart-x-label { font-size: 15px; }
}

@media (max-width: 960px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .quick-grid, .status-grid, .care-grid, .two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quick-card { min-height: auto; padding: 11px 9px; gap: 6px; } .quick-card strong { font-size: .85rem; } .quick-icon { font-size: 1.35rem; } .settings-popover { right: 0; left: auto; max-width: calc(100vw - 32px); } }
@media (max-width: 850px) {
  .mobile-collapsible { gap: 0; padding: 12px; }
  .mobile-collapsible .collapse-chevron { display: inline; transition: transform .18s ease; }
  .mobile-collapsible.expanded .collapse-chevron { transform: rotate(180deg); }
  .mobile-collapsible:not(.expanded) .log-section-content { display: none; }
  .comment-field { min-height: 2.75rem; height: 2.75rem; resize: vertical; }
}
.suction-dot { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; margin-left: 2px; border-radius: 50%; color: #fff; font-size: .72em; font-weight: 800; vertical-align: middle; transform: translateY(-2px); }
.suction-level-1 { background: #e96b72; }
.suction-level-2 { background: #ed9b4e; }
.suction-level-3 { background: #d7b83d; color: #4f3c00; }
.suction-level-4 { background: #66a96f; }
.suction-level-5 { background: #4d91c2; }
@media (max-width: 640px) { .feed-chart-section { padding: 14px 10px; } .chart-section-head { flex-direction: column; } }
@media (max-width: 640px) { .feed-chart-section, .chart-scroll { max-width: 100%; overflow-x: hidden; } .feed-area-chart { min-width: 0; width: 100%; } .stats-page-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stats-page-summary .stat { padding: 10px 6px; } }
@media (max-width: 640px) { .settings-popover { position: fixed; top: 72px; left: 8px; right: 8px; width: auto; max-width: none; } }
@media (max-width: 850px) {
  .panel { padding: 4px; }
  .log-table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; }
  .log-table { min-width: 0; max-width: 100%; width: 100%; table-layout: fixed; }
  .log-table { font-size: .82rem; }
  .log-table th, .log-table td { min-width: 0; width: auto; max-width: 100%; padding: 3px 2px; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
  .log-table th.log-table-column-time,
  .log-table th.log-table-column-events,
  .log-table th.log-table-column-formula,
  .log-table th.log-table-column-breast-milk,
  .log-table th.log-table-column-latch,
  .log-table th.log-table-column-comment,
  .log-table th.log-table-column-pumped,
  .log-table th.log-table-column-taiso,
  .log-table th.log-table-column-vitamins,
  .log-table th.log-table-column-person,
  .log-table th.log-table-column-weight,
  .log-table th.log-table-column-height { writing-mode: vertical-lr; text-orientation: mixed; height: 104px; white-space: nowrap; vertical-align: top; text-align: left; padding: 8px 2px 0; }
  .log-table .log-table-column-time { width: 3ch; }
  .log-table .log-table-column-events { width: 4ch; }
  .log-table .log-table-column-formula { width: 2.5ch; }
  .log-table .log-table-column-breast-milk { width: 2.5ch; }
  .log-table .log-table-column-latch { width: 1ch; }
  .log-table .log-table-column-comment { width: .8ch; padding-right: 0; }
  .log-table .log-table-column-person { width: 1.5ch; }
  .log-table .log-table-column-pumped { width: 4ch; }
  .log-table .log-table-column-taiso,
  .log-table .log-table-column-vitamins { width: 2ch; }
  .log-table .log-table-column-weight,
  .log-table .log-table-column-height { width: 4ch; }
  .log-table .log-table-column-actions { width: 1.25ch; padding-left: 1px; padding-right: 1px; }
  .log-date-row td { width: 100% !important; padding: 6px 3px 3px; font-size: .75rem; }
  .comment-text { display: none; }
  .comment-info { display: inline; }
  .log-data-row { cursor: pointer; }
  .comment-detail-row { display: table-row; }
  .comment-detail-row td { padding: 0 !important; border-bottom: 0 !important; }
  .comment-detail-content { max-height: 0; padding: 0 4px; opacity: 0; overflow: hidden; transition: max-height .5s ease, padding .5s ease, opacity .5s ease; }
  .comment-detail-row.expanded .comment-detail-content { max-height: 20rem; padding: 8px 4px 10px; opacity: 1; }
  .person-full { display: none; }
  .person-short { display: inline; }
  .poop-count { font-size: .65em; font-weight: 800; }
  .log-table .log-table-column-actions .icon-button { background: transparent; border: 0; box-shadow: none; padding: 0; color: var(--color-primary); }
}


/* MaguLog palette overrides */
body { background: var(--color-background); color: var(--color-text); }
.button-link, button:not(.secondary) { background: var(--color-primary); }
.button-link.secondary, button.secondary { background: var(--color-secondary); color: #fff; }
.panel, .item, .modal-window { border-color: var(--color-border); }

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

body:has(.image-lightbox) {
  overflow: hidden;
}

a {
  color: #7a4229;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar,
.workspace {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  padding: 16px 0 20px;
}

.brand { grid-column: 2; display: flex; align-items: center; }
.brand-logo { width: 320px; height: 140px; object-fit: contain; object-position: center; border-radius: 14px; }

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8b5a35;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 800;
}

.nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(104, 57, 26, 0.14);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.84);
  box-shadow: 0 10px 24px rgba(70, 39, 21, 0.08);
  justify-content: flex-end;
}

.nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  color: #6b3824;
  font-weight: 700;
}

.nav > a:hover,
.nav > a:focus-visible { background: #f1e3cc; text-decoration: none; }
.nav-icon-link { width: 42px; min-width: 42px; justify-content: center; padding: 0 !important; }
.nav-home-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-add-icon { font-size: 1.8rem; line-height: 1; }

.settings-menu { position: relative; }
.settings-menu summary { list-style: none; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #5e2d1d; color: #f9e9c8; font-size: 1.2rem; }
.settings-menu summary::-webkit-details-marker { display: none; }
.settings-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; padding: 10px; background: #fffaf0; border: 1px solid rgba(88, 45, 25, .16); border-radius: 14px; box-shadow: 0 14px 30px rgba(70, 39, 21, .16); }

.workspace {
  padding-bottom: 40px;
}

.auth-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(440px, 100%);
}

.app-shell {
  min-height: 100vh;
}

.panel {
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(104, 57, 26, 0.14);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(20, 31, 56, 0.08);
  padding: 22px;
  margin-bottom: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  align-items: start;
}

.hero h2,
.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.muted,
.message,
.card-subtitle {
  color: #5d6b7f;
}

.stats,
.grid,
.stack {
  display: grid;
  gap: 12px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f9fe 0%, #eef3fd 100%);
  border: 1px solid rgba(72, 95, 176, 0.1);
}

.stat strong {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar,
.hero-actions,
.item-head,
.item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: flex-end;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.button-link.secondary {
  background: #f1e3cc;
  color: #6b3824;
}

.button-link:hover {
  text-decoration: none;
}

.create-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.create-button span { font-size: 1.25em; line-height: .8; }
.create-button.icon-only { width: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: 0 8px 0 4px; font-size: 1.8rem; }
.create-button.icon-only .visually-hidden { font-size: 1rem; }
.language-picker { display: grid; gap: 5px; min-width: 180px; padding: 4px; color: #425065; font-size: .85rem; font-weight: 700; }
.settings-popover { display: grid; gap: 10px; }
.app-version { color: #6b3824; font-size: .85rem; font-weight: 700; padding: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.item {
  border: 1px solid rgba(34, 48, 79, 0.09);
  border-radius: 16px;
  background: #fffdf8;
  padding: 14px 16px;
}

.person-card { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.person-card:hover, .person-card:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(88, 45, 25, .11); outline: none; }
.interaction-index { margin-top: 18px; }
.interaction-index h3 { margin-bottom: 8px; }
.interaction-index-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.interaction-index-actions { display: flex; align-items: center; gap: 10px; }
.history-details { position: relative; }
.history-details summary { cursor: pointer; color: #7a4229; font-size: .86rem; }
.history-entry { margin-top: 8px; padding: 8px; max-width: 340px; background: #f6ead6; border-radius: 8px; font-size: .84rem; }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px; background: #f8efdf; border-radius: 10px; }
.checkbox-grid label { display: flex; align-items: center; gap: 5px; }
.reaction-person .tag { margin-top: 4px; }
.reaction-person { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reaction-person > a { min-width: 0; }
.wizard { display: grid; gap: 16px; }
.wizard-progress { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(104, 57, 26, .14); color: #6b3824; }
.interaction-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.interaction-type-tile { min-height: 72px; background: #fffdf8; color: #6b3824; border: 1px solid rgba(104, 57, 26, .18); }
.interaction-type-tile:hover { background: #f1e3cc; }
.wizard-actions { display: flex; justify-content: space-between; gap: 10px; }
.preview-card { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: #f8efdf; }
.birthday-actions { align-items: center; }

.item h3,
.item p {
  margin: 0;
}

.item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.item-head {
  justify-content: space-between;
  align-items: start;
}

.item-actions {
  justify-content: flex-end;
}

.item .meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #60708a;
  font-size: 0.92rem;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2e3ca;
  color: #754126;
  font-size: 0.8rem;
  font-weight: 700;
}

.meta .tag + .tag, .meta .pill + .pill { margin-left: 4px; }

.tag {
  background: #f1e0c4;
  color: #80552b;
}

form {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #425065;
  font-size: 0.94rem;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cad4e4;
  border-radius: 12px;
  background: white;
  color: #132033;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: #f1e3cc;
  color: #6b3824;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions .message {
  margin-left: 4px;
}

.search {
  min-width: 220px;
}

.stack .item {
  display: grid;
  gap: 6px;
}

.interaction-timeline {
  --timeline-rail: 78%;
  position: relative;
  display: grid;
  gap: 0;
  padding: 8px 0;
}

.interaction-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--timeline-rail);
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9a6a3f, #dbc39b);
  transform: translateX(-50%);
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-rail) minmax(0, 1fr);
  align-items: start;
  min-height: 112px;
}

.timeline-copy {
  grid-column: 1;
  padding: 0 34px 28px 0;
  text-align: right;
}

.timeline-entry-reaction .timeline-copy {
  grid-column: 2;
  padding-right: 0;
  padding-left: 34px;
  text-align: left;
}

.timeline-entry-reaction .timeline-copy .meta {
  justify-content: flex-start;
}

.timeline-connector {
  position: absolute;
  z-index: 0;
  top: 12px;
  left: var(--timeline-rail);
  width: calc(22% - 22px);
  height: 2px;
  background: #c6a979;
}

.timeline-copy time {
  display: block;
  color: #8b5a35;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.timeline-copy h3 {
  margin: 5px 0 6px;
  color: #132033;
  font-size: 1rem;
}

.timeline-copy p {
  color: #5d6b7f;
  white-space: pre-wrap;
}

.timeline-copy .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  grid-column: 2;
  justify-self: start;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  margin-left: -9px;
  border: 4px solid white;
  border-radius: 50%;
  background: #8b4b2f;
  box-shadow: 0 0 0 3px #d0b17c, 0 5px 14px rgba(88, 45, 25, 0.25);
}

/* Timeline cards keep the chronological rail while giving every entry a readable surface. */
.timeline-cards {
  gap: 10px;
  padding-left: 52px;
}

.timeline-cards::before {
  left: 18px;
}

.timeline-cards .timeline-entry {
  display: block;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid rgba(34, 48, 79, 0.09);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 5px 14px rgba(88, 45, 25, .05);
}

.timeline-cards .timeline-copy,
.timeline-cards .timeline-entry-reaction .timeline-copy {
  display: block;
  grid-column: auto;
  padding: 0;
  text-align: left;
}

.timeline-cards .timeline-copy .meta,
.timeline-cards .timeline-entry-reaction .timeline-copy .meta {
  justify-content: flex-start;
}

.timeline-cards .timeline-dot {
  position: absolute;
  left: -43px;
  top: 17px;
  margin: 0;
}

.timeline-cards .timeline-connector {
  left: -34px;
  width: 32px;
}

.timeline-cards .timeline-image {
  margin-left: 0;
}

.timeline-entry-muted .timeline-copy time {
  color: #8993a3;
}

.timeline-entry-muted .timeline-copy p {
  color: #8993a3;
  font-style: italic;
}

.timeline-entry-muted .timeline-dot {
  background: #aeb6c3;
  box-shadow: 0 0 0 3px #d2d7df, 0 5px 14px rgba(87, 99, 119, 0.18);
}

.timeline-image {
  display: block;
  width: min(220px, 100%);
  max-height: 180px;
  margin: 10px 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #d8dfeb;
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100dvh;
  padding: 24px;
  overflow: hidden;
  background: rgba(5, 10, 20, .82);
  cursor: zoom-out;
}

.image-lightbox img {
  display: block;
  max-width: min(96vw, 1100px);
  max-height: calc(100dvh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,.4);
}

.reaction-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.reaction-status-grid h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.reaction-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
}

.reaction-person.reacted {
  color: #24714b;
}

button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.icon-button {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 11px;
  font-size: 1.05rem;
  line-height: 1;
}

.muted-button {
  background: #eee5d7;
  color: #765b42;
}

.reaction-actions {
  display: inline-flex;
  gap: 6px;
}

.ignored-people {
  margin-top: 18px;
  border-top: 1px solid #eadfce;
  padding-top: 12px;
}

.ignored-people summary {
  cursor: pointer;
  color: #765b42;
  font-weight: 700;
}

.subevent-card {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.subevent-card:hover,
.subevent-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(88, 45, 25, .11);
  outline: none;
}

.checkbox-label {
  display: flex !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px !important;
}

.checkbox-label input {
  width: auto;
  justify-self: start;
}

.image-upload {
  padding: 12px;
  border: 1px dashed #b9c6dd;
  border-radius: 12px;
  background: #f8faff;
}

.image-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.image-upload-actions > span {
  display: grid;
  gap: 5px;
  min-width: min(240px, 100%);
}

.image-upload-actions small {
  color: #425065;
  font-weight: 700;
}

.details {
  display: grid;
  gap: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid > div {
  background: #f7f9fd;
  border: 1px solid rgba(37, 52, 87, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.detail-grid strong {
  display: block;
  margin-bottom: 4px;
}

.spaced {
  margin-top: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 16, 31, 0.48);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: start center;
  padding: 24px;
  z-index: 1000;
}

.modal-window {
  width: min(860px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(37, 52, 87, 0.12);
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(4, 11, 28, 0.22);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-body {
  display: grid;
  gap: 16px;
}

button.settings-link { display: block; width: 100%; padding: 8px 0; border: 0; border-radius: 0; background: transparent; color: var(--color-primary); text-align: left; font: inherit; font-weight: inherit; cursor: pointer; }
.log-section-toggle { margin: -4px -4px 0; padding: 8px 10px; border-radius: 10px; background: #f7f3ed !important; color: var(--color-primary) !important; }
.log-section-toggle:hover, .log-section-toggle:focus-visible { background: #eee5d7 !important; }
.action-status { background: #fff !important; }
.action-status.status-alert { background: #fff4ee !important; }
.suction-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.suction-button { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; color: #fff; font-size: 1rem; font-weight: 800; line-height: 1; }
.suction-button-empty { background: #fff; color: var(--color-text); border: 1px solid var(--color-border); }
.suction-button.suction-level-1 { background: #e96b72; }
.suction-button.suction-level-2 { background: #ed9b4e; }
.suction-button.suction-level-3 { background: #d7b83d; }
.suction-button.suction-level-4 { background: #66a96f; }
.suction-button.suction-level-5 { background: #4d91c2; }
.suction-button.selected { box-shadow: 0 0 0 3px rgba(88, 45, 25, .25); }
.suction-button.suction-level-3 { color: #4f3c00; }
.suction-picker:has(.suction-button.selected) .suction-button:not(.selected) { opacity: .28; filter: grayscale(1); }
.video-modal[hidden] { display: none; }
.video-modal-window { width: min(960px, 100%); }
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #111827; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }

.selected-images { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 42px; }
.selected-image { padding: 7px 10px; border-radius: 9px; background: #f1e3cc; color: #6b3824; font-size: .85rem; }
.add-image-button { flex: 0 0 auto; }
.swipe-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 8px; border: 1px solid #cad4e4; border-radius: 12px; background: #fff; touch-action: pan-y; }
.swipe-picker strong { flex: 1; text-align: center; }

.small {
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .hero,
  .grid.two,
  .grid.three,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0 8px;
  }

  .brand { flex: 0 0 auto; }
  .brand-logo { width: min(178px, 44vw); height: 71px; }

  .nav {
    justify-content: flex-end;
    width: auto;
    position: relative;
    gap: 3px;
    padding: 3px;
  }

  .nav > a {
    min-height: 36px;
    padding: 0 10px;
  }

  .nav-icon-link,
  .settings-menu summary {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .workspace .section-head {
    gap: 6px;
    margin-bottom: 8px;
  }

  .workspace .section-head h1,
  .workspace > h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.15;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .reaction-status-grid {
    grid-template-columns: 1fr;
  }

  .interaction-timeline {
    --timeline-rail: 12px;
    padding-left: 32px;
  }

  .interaction-timeline::before {
    left: var(--timeline-rail);
  }

  .timeline-entry {
    grid-template-columns: 1fr;
  }

  .timeline-copy {
    grid-column: 1;
    padding: 0 0 28px;
    text-align: left;
  }

  .timeline-copy .meta {
    justify-content: flex-start;
  }

  .timeline-dot {
    position: absolute;
    left: -32px;
    top: 0;
  }

  .timeline-entry-reaction .timeline-copy {
    grid-column: 1;
    padding-left: 0;
    text-align: left;
  }

  .timeline-entry-reaction .timeline-copy .meta {
    justify-content: flex-start;
  }

  .timeline-connector {
    left: 12px;
    width: 20px;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-backdrop { padding: 8px; }
  .modal-window { width: 100%; max-height: calc(100dvh - 16px); padding: 14px; border-radius: 18px; }
  .modal-head { position: sticky; top: -14px; z-index: 1; padding: 4px 0 10px; background: rgba(255,255,255,.98); }
  .settings-popover { right: 0; left: auto; max-width: calc(100vw - 32px); }
}

@media (max-width: 760px) {
  .timeline-cards {
    padding-left: 32px;
  }

  .timeline-cards::before {
    left: 12px;
  }

  .timeline-cards .timeline-dot {
    left: -29px;
    top: 17px;
  }

  .event-interactions-timeline {
    display: grid;
    gap: 10px;
    padding: 0 0 0 32px;
  }

  .event-interactions-timeline::before {
    display: block;
  }

  .event-interactions-timeline .timeline-connector {
    display: none;
  }

  .event-interactions-timeline::before {
    left: 12px;
  }

  .event-interactions-timeline .timeline-entry {
    display: block;
    min-height: 0;
    padding: 13px 14px;
    border: 1px solid rgba(34, 48, 79, 0.09);
    border-radius: 14px;
    background: #fffdf8;
  }

  .event-interactions-timeline .timeline-copy,
  .event-interactions-timeline .timeline-entry-reaction .timeline-copy {
    display: block;
    padding: 0;
    text-align: left;
  }

  .event-interactions-timeline .timeline-copy .meta,
  .event-interactions-timeline .timeline-entry-reaction .timeline-copy .meta {
    justify-content: flex-start;
  }

  .event-interactions-timeline .timeline-dot {
    display: block;
    position: absolute;
    left: -29px;
    top: 17px;
    margin: 0;
  }

  .event-interactions-timeline .timeline-image {
    margin-left: 0;
  }
}

/* Mobile shell overrides must come after all base layout rules. */
@media (max-width: 850px) {
  .topbar,
  .workspace {
    width: min(1180px, calc(100vw - 24px));
  }

  .panel {
    padding: 4px;
  }

  .stats-page .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .stats-page .day-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .stats-page .day-switcher strong {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 850px) {
  .workspace,
  .panel,
  .log-table-wrap {
    display: block;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .workspace { padding-inline: 4px; box-sizing: border-box; }

  .log-table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  .log-table th,
  .log-table td {
    min-width: 0 !important;
    max-width: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  .log-table .log-date-row td {
    max-width: 100% !important;
  }

  .log-table .log-table-column-time,
  .log-table col.log-table-column-time { width: 12.5% !important; }
  .log-table .log-table-column-events,
  .log-table col.log-table-column-events { width: 17.5% !important; }
  .log-table .log-table-column-formula,
  .log-table col.log-table-column-formula { width: 12.5% !important; }
  .log-table .log-table-column-breast-milk,
  .log-table col.log-table-column-breast-milk { width: 14% !important; }
  .log-table .log-table-column-latch,
  .log-table col.log-table-column-latch { width: 8% !important; }
  .log-table .log-table-column-comment,
  .log-table col.log-table-column-comment { width: 10% !important; }
  .log-table .log-table-column-person,
  .log-table col.log-table-column-person { width: 8% !important; }
  .log-table .log-table-column-actions,
  .log-table col.log-table-column-actions { width: 11.5% !important; }
  .task-log-table .task-log-name-column,
  .task-log-table .task-log-name-cell { width: 42% !important; max-width: none !important; }
  .task-log-table .task-log-status-column,
  .task-log-table .task-log-status-cell { width: 18% !important; }
  .task-log-table .task-log-time-column,
  .task-log-table .task-log-time-cell { width: 13% !important; }
  .task-log-table .task-log-person-column,
  .task-log-table .task-log-person-cell { width: 10% !important; }
  .task-log-table .task-log-actions-column,
  .task-log-table .task-log-actions-cell { width: 17% !important; }
  .task-log-table .task-log-name-cell { overflow-wrap: anywhere; }
  .task-log-table .task-log-time-cell { white-space: nowrap; }
  .task-log-table .task-log-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex-wrap: nowrap; }
  .task-log-table .task-log-actions .icon-button { display: inline-flex; align-items: center; justify-content: center; width: 22px; min-width: 22px; height: 26px; min-height: 26px; padding: 1px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: var(--color-primary); font-size: .82rem; }
  .log-table .log-table-column-pumped,
  .log-table col.log-table-column-pumped { width: 24% !important; }
  .log-table .log-table-column-taiso,
  .log-table col.log-table-column-taiso { width: 12% !important; }
  .log-table .log-table-column-vitamins,
  .log-table col.log-table-column-vitamins { width: 12% !important; }
  .log-table .log-table-column-weight,
  .log-table col.log-table-column-weight { width: 22% !important; }
  .log-table .log-table-column-height,
  .log-table col.log-table-column-height { width: 22% !important; }
  .mama-log-table .log-table-column-time,
  .mama-log-table col.log-table-column-time { width: 12.5% !important; }
  .mama-log-table .log-table-column-pumped,
  .mama-log-table col.log-table-column-pumped { width: 24% !important; }
  .mama-log-table .log-table-column-taiso,
  .mama-log-table col.log-table-column-taiso { width: 12% !important; }
  .mama-log-table .log-table-column-vitamins,
  .mama-log-table col.log-table-column-vitamins { width: 12% !important; }
  .mama-log-table .log-table-column-comment,
  .mama-log-table col.log-table-column-comment { width: 10% !important; }
  .mama-log-table .log-table-column-person,
  .mama-log-table col.log-table-column-person { width: 8% !important; }
  .mama-log-table .log-table-column-actions,
  .mama-log-table col.log-table-column-actions { width: 15.5% !important; }
  .measurement-log-table .log-table-column-time,
  .measurement-log-table col.log-table-column-time { width: 15% !important; }
  .measurement-log-table .log-table-column-weight,
  .measurement-log-table col.log-table-column-weight { width: 25% !important; }
  .measurement-log-table .log-table-column-height,
  .measurement-log-table col.log-table-column-height { width: 25% !important; }
  .measurement-log-table .log-table-column-person,
  .measurement-log-table col.log-table-column-person { width: 10% !important; }
  .measurement-log-table .log-table-column-actions,
  .measurement-log-table col.log-table-column-actions { width: 15% !important; }
  .log-table col { min-width: 0 !important; }
}
