:root {
  color-scheme: light;
  --page: #fff7f8;
  --surface: #fffafb;
  --surface-strong: #ffffff;
  --ink: #33263a;
  --muted: #74667b;
  --line: #ead8df;
  --primary: #f19ab4;
  --primary-dark: #a64372;
  --accent: #95c7f2;
  --warning: #d48b4a;
  --danger: #c75068;
  --fresh: #78c9bc;
  --wash: #fff0f4;
  --cream: #fffdf8;
  --label: #fff4df;
  --mint: #a5d9cb;
  --berry: #a64372;
  --periwinkle: #95c7f2;
  --glass: rgba(255, 250, 251, 0.82);
  --paper: rgba(255, 255, 255, 0.72);
  --shadow: 0 34px 90px rgba(128, 80, 103, 0.16), 0 8px 26px rgba(128, 80, 103, 0.08);
  --soft-shadow: 0 16px 40px rgba(139, 88, 111, 0.11);
  --micro-shadow: 0 8px 18px rgba(139, 88, 111, 0.08);
  --font-ui: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Avenir Next", "Nunito Sans", system-ui, sans-serif;
  --font-display: "Tsukushi A Round Gothic", "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", "Avenir Next Rounded", var(--font-ui);
  --font-data: "DIN Alternate", "Avenir Next", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --text-xs: 0.72rem;
  --text-sm: 0.82rem;
  --text-md: 0.95rem;
  --text-lg: 1.08rem;
  --text-xl: 1.28rem;
  --text-2xl: 1.62rem;
  --text-3xl: 2.12rem;
  --leading-tight: 1.08;
  --leading-title: 1.14;
  --leading-body: 1.62;
  --tracking-label: 0.07em;
  --weight-regular: 500;
  --weight-medium: 620;
  --weight-bold: 740;
  --weight-heavy: 820;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  font-family: var(--font-ui);
}

:root[data-theme="dark"] {
  --page: #14101a;
  --surface: #211927;
  --surface-strong: #2c2234;
  --ink: #fff8fb;
  --muted: #d5c7d4;
  --line: #5b465e;
  --primary: #ff9bbd;
  --primary-dark: #ffd4e2;
  --accent: #8bd7ff;
  --warning: #ffd089;
  --danger: #ff8da2;
  --fresh: #89e0ce;
  --wash: #1b1521;
  --cream: #241c2b;
  --label: #33243b;
  --mint: #89e0ce;
  --berry: #ff9bbd;
  --periwinkle: #8bd7ff;
  --glass: rgba(36, 28, 43, 0.92);
  --paper: rgba(44, 34, 52, 0.74);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.52);
  --soft-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  --micro-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

:root[data-theme="aj"] {
  --page: #10071f;
  --surface: #1b0f31;
  --surface-strong: #291848;
  --ink: #fffaff;
  --muted: #e5d8ff;
  --line: #6e56a3;
  --primary: #1ef2d0;
  --primary-dark: #ff7cda;
  --accent: #f8f46a;
  --warning: #ffe88f;
  --danger: #ff8aa0;
  --fresh: #7df9ff;
  --wash: #170d2c;
  --cream: #21123a;
  --label: #31204f;
  --mint: #1ef2d0;
  --berry: #ff7cda;
  --periwinkle: #7df9ff;
  --glass: rgba(33, 22, 65, 0.92);
  --paper: rgba(41, 24, 72, 0.76);
  --shadow: 0 26px 72px rgba(0, 0, 0, 0.56);
  --soft-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
  --micro-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

:root[data-theme="calm"] {
  --page: #f5fbff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #1f3345;
  --muted: #5c7087;
  --line: #d7e7f4;
  --primary: #89c5f2;
  --primary-dark: #407daf;
  --accent: #b9e3f8;
  --warning: #ce8b48;
  --danger: #be5b72;
  --fresh: #8bcfbe;
  --wash: #eef8ff;
  --cream: #fbfdff;
  --label: #eef8ff;
  --mint: #a6dbcf;
  --berry: #6d8fc8;
  --periwinkle: #89c5f2;
  --glass: rgba(255, 255, 255, 0.86);
  --paper: rgba(255, 255, 255, 0.76);
  --shadow: 0 18px 48px rgba(75, 112, 151, 0.13);
  --soft-shadow: 0 14px 34px rgba(75, 112, 151, 0.12);
  --micro-shadow: 0 8px 18px rgba(75, 112, 151, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, #fff2f6 0%, #f7f8ff 54%, #f8fff8 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  font-kerning: normal;
  font-optical-sizing: auto;
  font-synthesis-weight: none;
  letter-spacing: 0;
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body,
:root[data-theme="aj"] body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(135deg, var(--page) 0%, color-mix(in srgb, var(--surface) 72%, #000) 100%);
}

:root[data-theme="calm"] body {
  background:
    linear-gradient(90deg, rgba(137, 197, 242, 0.12) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(137, 197, 242, 0.1) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(135deg, #f7fbff 0%, #eef8ff 100%);
}

:root[data-theme="dark"] .mobile-column,
:root[data-theme="aj"] .mobile-column {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--surface);
}

:root[data-theme="dark"] .hero-band,
:root[data-theme="dark"] .today-hero,
:root[data-theme="dark"] .next-use-panel,
:root[data-theme="dark"] .quick-start-panel,
:root[data-theme="aj"] .hero-band,
:root[data-theme="aj"] .today-hero,
:root[data-theme="aj"] .next-use-panel,
:root[data-theme="aj"] .quick-start-panel {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--surface-strong);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .metric-item,
:root[data-theme="dark"] .label-preview article,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .action-menu details div,
:root[data-theme="aj"] .panel,
:root[data-theme="aj"] .entry-card,
:root[data-theme="aj"] .metric-item,
:root[data-theme="aj"] .label-preview article,
:root[data-theme="aj"] .settings-panel,
:root[data-theme="aj"] .action-menu details div {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--glass);
}

:root[data-theme="dark"] .app-nav,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .action-menu summary,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="aj"] .app-nav,
:root[data-theme="aj"] .bottom-nav,
:root[data-theme="aj"] .secondary-action,
:root[data-theme="aj"] .ghost-button,
:root[data-theme="aj"] .action-menu summary,
:root[data-theme="aj"] input,
:root[data-theme="aj"] select,
:root[data-theme="aj"] textarea {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--ink);
}

:root[data-theme="dark"] .app-nav button.active,
:root[data-theme="dark"] .bottom-nav button.active,
:root[data-theme="aj"] .app-nav button.active,
:root[data-theme="aj"] .bottom-nav button.active {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .nav-count,
:root[data-theme="aj"] .nav-count {
  background: color-mix(in srgb, var(--primary) 24%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .status-pill,
:root[data-theme="aj"] .status-pill {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .progress-track,
:root[data-theme="aj"] .progress-track {
  background: color-mix(in srgb, var(--line) 48%, var(--surface));
}

:root[data-theme="dark"] .appliance,
:root[data-theme="aj"] .appliance {
  border-color: color-mix(in srgb, var(--line) 68%, transparent);
  background: var(--surface-strong);
}

:root[data-theme="dark"] .mini-bag,
:root[data-theme="aj"] .mini-bag {
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

:root[data-theme="dark"] .warning .status-pill,
:root[data-theme="aj"] .warning .status-pill {
  background: color-mix(in srgb, var(--warning) 28%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .expired .status-pill,
:root[data-theme="dark"] .discarded .status-pill,
:root[data-theme="aj"] .expired .status-pill,
:root[data-theme="aj"] .discarded .status-pill {
  background: color-mix(in srgb, var(--danger) 28%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .used .status-pill,
:root[data-theme="aj"] .used .status-pill {
  background: color-mix(in srgb, var(--muted) 24%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .alert-banner,
:root[data-theme="aj"] .alert-banner {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning) 16%, var(--surface));
}

:root[data-theme="dark"] .today-hero::after,
:root[data-theme="aj"] .today-hero::after {
  display: none;
}

:root[data-theme="aj"] .primary-action,
:root[data-theme="aj"] .use-action,
:root[data-theme="aj"] .appliance-head span {
  color: #12071f;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0 64px;
}

.desktop-layout {
  display: grid;
  grid-template-columns: minmax(370px, 440px) minmax(0, 1fr);
  gap: clamp(34px, 4vw, 64px);
  align-items: start;
}

.mobile-column {
  position: relative;
  overflow: visible;
  min-width: 0;
  padding: 28px 24px 26px;
  border: 1px solid color-mix(in srgb, var(--line) 42%, rgba(255, 255, 255, 0.88));
  border-radius: 38px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), var(--surface-strong)),
    var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mobile-column::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 38px;
  left: 38px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary) 18%, var(--primary) 82%, transparent);
  opacity: 0.9;
}

.mobile-column > * {
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 24px;
}

.app-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--wash) 58%, var(--surface-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.app-nav button,
.bottom-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.app-nav button {
  flex-direction: column;
  gap: 4px;
}

.app-nav button strong {
  font-size: var(--text-xs);
  font-weight: inherit;
}

.app-nav button.active,
.bottom-nav button.active {
  background: linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 82%, var(--wash)));
  color: var(--primary-dark);
  box-shadow: var(--micro-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.nav-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-strong));
  color: var(--primary-dark);
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
}

.bottom-nav {
  display: none;
}

.top-controls,
.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.solid-storage-icon {
  fill: currentColor;
  stroke: none;
}

.solid-control-icon {
  fill: currentColor;
  stroke: none;
}

.solid-storage-icon .storage-fill,
.solid-storage-icon .snowflake-fill {
  fill: currentColor;
}

.solid-storage-icon .storage-cut {
  fill: var(--surface-strong);
}

:root[data-theme="dark"] .solid-storage-icon .storage-cut,
:root[data-theme="aj"] .solid-storage-icon .storage-cut {
  fill: var(--surface);
}

.theme-select {
  position: relative;
  display: grid;
  overflow: hidden;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-select:hover,
.icon-button:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.theme-select select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 42px;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.sort-control select {
  min-height: 40px;
  padding: 8px 34px 8px 10px;
}

.icon-button {
  display: grid;
  width: 42px;
  min-height: 42px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.settings-menu {
  position: relative;
}

.settings-menu summary {
  list-style: none;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 14px;
  width: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 94%, var(--wash));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-row input {
  width: 46px;
  height: 26px;
  accent-color: var(--primary);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-heavy);
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.app-brand img,
.brand-mark img {
  width: 44px;
  height: 44px;
  border: 2px solid var(--surface-strong);
  border-radius: 15px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 22%, transparent);
}

.onboarding {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 88px);
}

.brand-mark img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
}

.onboarding-copy h1,
.hero-band h1,
.today-hero h1,
.edit-layout h1 {
  font-family: var(--font-display);
  margin: 6px 0 14px;
  max-width: 760px;
  font-size: var(--text-3xl);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.005em;
  line-height: var(--leading-tight);
}

.onboarding-copy p:not(.eyebrow),
.hero-band p,
.today-hero p,
.edit-layout > div > p {
  max-width: 620px;
  color: var(--muted);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

.eyebrow {
  margin: 0;
  color: color-mix(in srgb, var(--primary-dark) 78%, var(--muted));
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  line-height: 1.2;
  text-transform: uppercase;
}

.panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--glass) 92%, white), var(--glass));
  border: 1px solid color-mix(in srgb, var(--line) 52%, rgba(255, 255, 255, 0.82));
  border-radius: 26px;
  box-shadow: var(--soft-shadow);
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

label span,
legend {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.25;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--wash));
  color: var(--ink);
  font-size: var(--text-md);
  line-height: 1.35;
  padding: 12px 13px;
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: color-mix(in srgb, var(--wash) 82%, var(--surface-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border-radius: 15px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.segmented input:checked + span {
  background: linear-gradient(180deg, var(--surface-strong), color-mix(in srgb, var(--surface-strong) 86%, var(--wash)));
  color: var(--primary-dark);
  box-shadow: var(--micro-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.primary-action,
.secondary-action,
.ghost-button,
.danger-action,
.use-action,
.text-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1;
}

.primary-action {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-dark) 86%, white), var(--primary-dark));
  color: white;
  padding: 0 20px;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.primary-action:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 20px 38px color-mix(in srgb, var(--primary) 36%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.secondary-action,
.ghost-button {
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.danger-action {
  background: color-mix(in srgb, var(--danger) 88%, var(--ink));
  color: var(--surface-strong);
  padding: 0 16px;
}

.use-action {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-dark) 86%, white), var(--primary-dark));
  color: var(--surface-strong);
  padding: 0 16px;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--primary) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.use-action:hover {
  background: color-mix(in srgb, var(--primary-dark) 82%, var(--ink));
}

.text-button {
  min-height: 36px;
  background: transparent;
  color: var(--primary-dark);
  padding: 0;
}

.form-note,
.muted,
.stat-card p,
.entry-foot,
.entry-notes {
  color: var(--muted);
}

.form-note {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.hero-band {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background: var(--surface-strong);
  box-shadow: var(--soft-shadow);
}

.hero-band h1 {
  font-size: var(--text-3xl);
}

.today-hero {
  position: relative;
  display: grid;
  gap: 18px;
  margin: 2px 0 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
  border-radius: 30px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 96%, var(--wash)), var(--surface-strong)),
    var(--surface-strong);
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.today-hero::after {
  display: none;
}

.today-hero-copy p:not(.eyebrow) {
  margin: 10px 0 0;
  max-width: 100%;
  font-size: var(--text-sm);
  line-height: 1.58;
}

.today-ledger {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  margin-top: 14px;
}

.today-total {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 20px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 88%, white), color-mix(in srgb, var(--wash) 38%, var(--surface-strong))),
    var(--surface-strong);
  box-shadow: var(--micro-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.today-total span,
.metric-item span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.today-total .icon,
.metric-item .icon {
  width: 17px;
  height: 17px;
}

.today-total strong {
  font-family: var(--font-data);
  font-size: clamp(2rem, 7vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.005em;
  line-height: 1;
}

.today-total small {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: 1.35;
}

.feed-time {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, var(--surface-strong)), color-mix(in srgb, var(--accent) 10%, var(--surface-strong))),
    var(--surface-strong);
}

.today-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 20px;
}

.next-use-panel,
.quick-start-panel {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 18px 0 26px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--line));
  border-radius: 26px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 92%, var(--label)), var(--surface-strong));
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.next-use-panel::before,
.quick-start-panel::before {
  display: none;
}

.next-use-panel {
  grid-template-columns: minmax(0, 1fr);
}

.next-use-copy {
  display: grid;
  gap: 8px;
}

.next-use-copy > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.next-use-copy h2,
.quick-start-panel h2,
.stash-header h1 {
  font-family: var(--font-display);
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.004em;
  line-height: var(--leading-title);
}

.next-use-copy h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.next-use-copy h2 .icon {
  width: 25px;
  height: 25px;
  color: var(--primary-dark);
}

.next-use-panel.freezer .next-use-copy h2 .icon {
  width: 32px;
  height: 32px;
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}

.next-use-panel.fridge .next-use-copy h2 .icon {
  color: color-mix(in srgb, var(--fresh) 72%, var(--ink));
}

.next-use-copy strong {
  color: var(--primary-dark);
  font-family: var(--font-data);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  line-height: 1;
}

.next-use-copy p,
.quick-start-panel p,
.stash-header p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: 1.58;
}

.next-use-actions .action-menu {
  justify-content: stretch;
}

.next-use-actions .use-action {
  flex: 1;
}

.quick-start-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stash-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 8px;
}

.add-action {
  min-width: 132px;
}

.alert-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--line));
  border-radius: 22px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-strong));
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.alert-banner strong {
  font-weight: var(--weight-bold);
}

.alert-banner span {
  color: var(--muted);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: hidden;
  margin: 14px 0 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.metric-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--wash));
  box-shadow: var(--micro-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.metric-item span,
.metric-item small {
  color: var(--muted);
  font-size: var(--text-sm);
}

.metric-item small {
  font-weight: var(--weight-regular);
  line-height: 1.3;
}

.metric-item strong {
  font-family: var(--font-data);
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.22rem;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.005em;
  line-height: 1;
}

.alert-banner.gentle {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-strong));
  color: var(--ink);
}

.alert-banner.gentle span {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 34px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 86%, var(--wash));
  box-shadow: var(--micro-shadow);
}

.stat-card span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.stat-card strong {
  font-family: var(--font-data);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-2xl);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
}

.stat-card p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.list-section {
  display: grid;
  gap: 16px;
}

.attention-section {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.view-heading {
  display: grid;
  gap: 8px;
  margin: 4px 0 20px;
}

.view-heading h1 {
  font-family: var(--font-display);
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.004em;
  line-height: var(--leading-tight);
}

.view-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.58;
}

.labels-heading {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
}

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

.label-preview article {
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--primary-dark) 42%, var(--line));
  border-radius: 18px;
  background: var(--surface-strong);
}

.label-preview strong {
  color: var(--primary-dark);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.label-preview span {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact {
  align-items: center;
}

.section-heading.compact h2 {
  font-size: var(--text-xl);
}

.section-heading h2 {
  font-family: var(--font-display);
  margin: 4px 0 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-heavy);
  letter-spacing: 0;
  line-height: var(--leading-title);
}

.sort-control {
  gap: 6px;
}

.sort-control span,
.date-filter span,
.settings-label {
  color: var(--primary-dark);
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  line-height: 1.2;
  text-transform: uppercase;
}

.date-filter {
  display: grid;
  gap: 6px;
  min-width: min(100%, 190px);
}

.date-filter input {
  min-height: 42px;
}

.date-filter .text-button {
  justify-self: start;
  min-height: 0;
  padding: 4px 0;
}

.today-tabs {
  margin-top: 8px;
}

.settings-divider {
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}

.settings-label {
  margin: 2px 0 0;
}

.file-restore input {
  width: 100%;
}

.danger-note {
  color: var(--danger);
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 360px);
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

.tabs button.active {
  background: var(--surface-strong);
  color: var(--primary-dark);
  box-shadow: var(--micro-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.tabs span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-strong));
  color: var(--primary-dark);
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
}

.entry-list {
  display: grid;
  gap: 15px;
}

.compact-list .entry-card {
  padding: 15px;
}

.compact-list .entry-card:not(.warning):not(.expired) {
  background: color-mix(in srgb, var(--surface-strong) 54%, transparent);
}

.entry-card {
  position: relative;
  overflow: visible;
  display: grid;
  gap: 12px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
  border-left: 7px solid var(--periwinkle);
  border-radius: 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 94%, var(--wash)), var(--surface-strong));
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary) 9%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.entry-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary) 13%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.entry-card:has(details[open]) {
  z-index: 30;
}

.entry-card.warning {
  border-color: color-mix(in srgb, var(--warning) 46%, rgba(255,255,255,0.74));
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

.entry-card.expired {
  border-color: color-mix(in srgb, var(--danger) 46%, rgba(255,255,255,0.74));
  border-left-color: var(--danger);
  opacity: 0.74;
}

.entry-card.used {
  border-color: color-mix(in srgb, #8f8277 22%, rgba(255,255,255,0.74));
  border-left-color: color-mix(in srgb, var(--muted) 80%, var(--line));
  background: color-mix(in srgb, #8f8277 14%, var(--surface));
}

.entry-card.discarded {
  border-color: color-mix(in srgb, var(--danger) 30%, rgba(255,255,255,0.74));
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.entry-main,
.entry-foot,
.entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-main > div:not(.entry-storage-icon) {
  flex: 1;
  min-width: 0;
}

.entry-storage-icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface-strong));
  color: var(--primary-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.entry-storage-icon.freezer {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface-strong));
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}

.entry-storage-icon.fridge {
  background: color-mix(in srgb, var(--mint) 24%, var(--surface-strong));
  color: color-mix(in srgb, var(--fresh) 72%, var(--ink));
}

.entry-storage-icon .icon {
  width: 24px;
  height: 24px;
}

.entry-storage-icon.freezer .bottle-snow-icon {
  width: 31px;
  height: 31px;
}

.entry-date {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-weight: var(--weight-bold);
  letter-spacing: 0.015em;
  line-height: 1.25;
}

.entry-card h3 {
  font-family: var(--font-data);
  margin: 0;
  font-size: 1.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.004em;
  line-height: 1;
}

.entry-card .muted {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-strong));
  color: var(--primary-dark);
  padding: 8px 11px;
  font-size: var(--text-xs);
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
  line-height: 1;
}

.warning .status-pill {
  background: #fce3bf;
  color: #743b09;
}

.expired .status-pill {
  background: #f7d8d4;
  color: var(--danger);
}

.used .status-pill {
  background: #e6ded5;
  color: #5f5349;
}

.discarded .status-pill {
  background: #f7d8d4;
  color: var(--danger);
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, var(--surface-strong));
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.warning .progress-track span {
  background: var(--warning);
}

.expired .progress-track span {
  background: var(--danger);
}

.used .progress-track span {
  background: #8f8277;
}

.discarded .progress-track span {
  background: var(--danger);
}

.entry-foot {
  flex-wrap: wrap;
  font-size: var(--text-sm);
  line-height: 1.35;
}

.entry-notes {
  margin: 0;
  padding-top: 2px;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.empty-state strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-title);
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.8fr);
  gap: 36px;
  align-items: start;
  padding-top: 34px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.action-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-menu details {
  position: relative;
}

.action-menu summary {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu details div {
  position: absolute;
  z-index: 40;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 94%, var(--wash));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.entry-list > .entry-card:last-child .action-menu details div {
  top: auto;
  bottom: calc(100% + 8px);
}

.action-menu details button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.2;
  text-align: left;
  font-weight: var(--weight-bold);
}

.action-menu details button:not(:disabled):hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.action-menu details button:disabled {
  color: var(--muted);
  cursor: default;
}

.history-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.cold-preview {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
  min-height: calc(100vh - 48px);
  align-content: start;
}

.cold-preview-copy {
  padding: 18px 8px 0;
}

.cold-preview-copy h2 {
  font-family: var(--font-display);
  margin: 6px 0 8px;
  max-width: 11ch;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.004em;
  line-height: var(--leading-tight);
}

.cold-preview-copy p:not(.eyebrow) {
  max-width: 460px;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: var(--leading-body);
}

.appliance {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 12px solid color-mix(in srgb, var(--primary-dark) 28%, var(--surface-strong));
  border-radius: 42px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 96%, var(--wash)), var(--surface-strong));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.appliance-section {
  position: relative;
  min-height: 270px;
  padding: 26px 30px 28px 56px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(0deg, transparent calc(100% - 1px), color-mix(in srgb, var(--line) 44%, transparent) calc(100% - 1px)) 0 0 / 100% 84px,
    transparent;
}

.appliance-section.fridge {
  border-bottom: 0;
}

.appliance-handle {
  position: absolute;
  left: 18px;
  top: 58px;
  width: 12px;
  height: 124px;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--fresh) 88%, white), var(--fresh));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--fresh) 11%, transparent);
}

.appliance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.appliance-head strong {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-xl);
  font-weight: var(--weight-heavy);
  letter-spacing: 0.003em;
  line-height: var(--leading-title);
}

.appliance-head strong .icon {
  width: 24px;
  height: 24px;
  color: var(--primary-dark);
}

.appliance-section.freezer .appliance-head strong .icon {
  width: 29px;
  height: 29px;
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}

.appliance-section.fridge .appliance-head strong .icon {
  color: color-mix(in srgb, var(--fresh) 74%, var(--ink));
}

.appliance-head span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-dark);
  color: white;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  line-height: 1;
}

.appliance-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
}

.mini-bag {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 13px 11px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 20px 20px 24px 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 88%, var(--wash)), color-mix(in srgb, var(--surface-strong) 72%, transparent));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 13%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.54);
  text-align: center;
  line-height: 1.2;
}

.mini-bag:nth-child(3n + 2) {
  transform: translateY(6px);
}

.mini-bag:nth-child(3n) {
  transform: translateY(2px);
}

.mini-bag strong {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
}

.mini-bag .icon {
  justify-self: center;
  width: 23px;
  height: 23px;
  color: var(--primary-dark);
}

.mini-bag.freezer .icon {
  width: 28px;
  height: 28px;
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}

.mini-bag.fridge .icon {
  color: color-mix(in srgb, var(--fresh) 74%, var(--ink));
}

.mini-bag.warning {
  border-color: var(--warning);
}

.mini-bag.expired {
  border-color: var(--danger);
}

.mini-bag span,
.mini-bag small,
.empty-shelf {
  color: var(--muted);
  font-size: var(--text-sm);
}

.mini-bag small {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

.print-labels {
  display: none;
}

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

.print-labels article {
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 14px;
  border: 1px dashed #333;
  border-radius: 8px;
  color: #111;
  background: white;
  font-family: var(--font-ui);
  font-size: 11pt;
  line-height: 1.3;
}

.print-labels strong {
  font-family: var(--font-display);
  font-size: 13pt;
  font-weight: var(--weight-heavy);
}

button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 3px;
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .today-hero,
:root[data-theme="dark"] .next-use-panel,
:root[data-theme="dark"] .quick-start-panel,
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .metric-item,
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .label-preview article,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="dark"] .action-menu details div,
:root[data-theme="aj"] .panel,
:root[data-theme="aj"] .today-hero,
:root[data-theme="aj"] .next-use-panel,
:root[data-theme="aj"] .quick-start-panel,
:root[data-theme="aj"] .entry-card,
:root[data-theme="aj"] .metric-item,
:root[data-theme="aj"] .stat-card,
:root[data-theme="aj"] .label-preview article,
:root[data-theme="aj"] .settings-panel,
:root[data-theme="aj"] .action-menu details div {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 96%, var(--wash)), var(--surface));
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="aj"] input,
:root[data-theme="aj"] select,
:root[data-theme="aj"] textarea {
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--wash));
}

:root[data-theme="dark"] .primary-action,
:root[data-theme="dark"] .use-action,
:root[data-theme="dark"] .bottom-nav .bottom-add {
  color: #251c2d;
}

:root[data-theme="aj"] .primary-action,
:root[data-theme="aj"] .use-action,
:root[data-theme="aj"] .bottom-nav .bottom-add {
  color: #12071f;
}

:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .action-menu summary,
:root[data-theme="aj"] .secondary-action,
:root[data-theme="aj"] .ghost-button,
:root[data-theme="aj"] .action-menu summary {
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--ink);
}

:root[data-theme="dark"] .appliance,
:root[data-theme="aj"] .appliance {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
}

:root[data-theme="dark"] .mini-bag,
:root[data-theme="aj"] .mini-bag {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 90%, var(--wash)), var(--surface));
}

.toast-region {
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(320px, calc(100vw - 32px));
  max-width: 380px;
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--fresh) 34%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-strong) 90%, var(--wash));
  color: var(--ink);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ink) 12%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.32;
  animation: toast-in 220ms ease-out;
}

.app-toast::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--fresh);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--fresh) 14%, transparent);
}

.app-toast.info {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.app-toast.info::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}

.app-toast.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
}

.app-toast.danger::before {
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 14%, transparent);
}

:root[data-theme="dark"] .app-toast,
:root[data-theme="aj"] .app-toast {
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--surface));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Clarity direction: fewer framed surfaces, stronger hierarchy, more air. */
body {
  background: linear-gradient(180deg, color-mix(in srgb, var(--page) 84%, white) 0%, #ffffff 58%, color-mix(in srgb, var(--wash) 26%, white) 100%);
}

:root[data-theme="dark"] body,
:root[data-theme="aj"] body {
  background: linear-gradient(180deg, var(--page) 0%, color-mix(in srgb, var(--surface) 68%, #000) 100%);
}

:root[data-theme="calm"] body {
  background: linear-gradient(180deg, #f8fcff 0%, #ffffff 68%, #f2f9ff 100%);
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  padding-top: 30px;
}

.desktop-layout {
  grid-template-columns: minmax(390px, 480px) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 84px);
}

.mobile-column {
  padding: 22px 10px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.mobile-column::before {
  display: none;
}

.topbar {
  padding: 0 0 26px;
}

.app-brand img,
.brand-mark img {
  box-shadow: none;
}

.app-nav {
  gap: 2px;
  margin-bottom: 30px;
  padding: 3px;
  border-color: color-mix(in srgb, var(--line) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 66%, transparent);
  box-shadow: none;
}

.app-nav button,
.bottom-nav button {
  min-height: 40px;
  border-radius: 999px;
}

.app-nav button {
  flex-direction: row;
}

.app-nav button .icon {
  width: 17px;
  height: 17px;
}

.app-nav button.active,
.bottom-nav button.active {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-strong));
  color: color-mix(in srgb, var(--primary-dark) 72%, var(--ink));
  box-shadow: none;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

.today-hero,
.next-use-panel,
.quick-start-panel,
.entry-card,
.metric-item,
.stat-card,
.panel,
.label-preview article,
.settings-panel {
  box-shadow: none;
}

.today-hero {
  gap: 22px;
  margin: 0 0 24px;
  padding: 0 0 28px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 0;
  background: transparent;
}

.hero-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-topline h1 {
  font-family: var(--font-data);
  margin: 8px 0 4px;
  font-size: clamp(3rem, 12vw, 4.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  letter-spacing: -0.01em;
  line-height: 0.95;
}

.hero-topline p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.42;
}

.today-ledger {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 22px;
}

.today-total {
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.today-total strong {
  font-size: clamp(1.72rem, 6vw, 2.15rem);
}

.today-total span,
.metric-item span {
  color: var(--muted);
}

.today-hero-copy > p:last-child {
  max-width: 36rem;
  margin: 18px 0 0;
  color: var(--muted);
}

.next-use-panel,
.quick-start-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 26px;
  padding: 18px 0 24px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-radius: 0;
  background: transparent;
}

.quick-start-panel {
  grid-template-columns: 1fr;
}

.next-use-copy > div {
  justify-content: flex-start;
  gap: 14px;
}

.next-use-copy h2,
.quick-start-panel h2,
.stash-header h1 {
  font-size: clamp(1.7rem, 6vw, 2.15rem);
}

.next-use-copy p,
.quick-start-panel p,
.stash-header p {
  max-width: 34rem;
}

.alert-banner {
  margin: 12px 0 24px;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--warning) 22%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 22%, var(--line));
  border-radius: 0;
  background: transparent;
}

.attention-section,
.list-section {
  gap: 18px;
}

.section-heading {
  align-items: flex-end;
}

.tabs {
  width: min(100%, 430px);
  padding: 3px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.tabs button {
  border-radius: 999px;
}

.tabs button.active {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-strong));
  box-shadow: none;
}

.stash-header,
.view-heading {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

.metric-strip,
.history-stats {
  gap: 0;
  margin: 0 0 32px;
  border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

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

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

.metric-item,
.stat-card {
  min-height: auto;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-radius: 0;
  background: transparent;
}

.metric-item:last-child,
.stat-card:last-child {
  border-right: 0;
}

.entry-list {
  gap: 10px;
}

.entry-card {
  gap: 10px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.entry-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--line) 58%, transparent);
  box-shadow: none;
}

.entry-storage-icon {
  border: 0;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: none;
}

.entry-storage-icon.freezer {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}

.entry-storage-icon.fridge {
  background: color-mix(in srgb, var(--fresh) 18%, transparent);
  color: color-mix(in srgb, var(--fresh) 72%, var(--ink));
}

.entry-storage-icon.freezer .bottle-snow-icon {
  width: 32px;
  height: 32px;
}

.status-pill {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.progress-track {
  height: 5px;
  box-shadow: none;
}

.cold-preview {
  gap: 26px;
}

.cold-preview-copy {
  padding: 26px 0 0;
}

.cold-preview-copy h2 {
  max-width: 14ch;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.appliance {
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  box-shadow: none;
}

.appliance-section {
  min-height: 240px;
  padding: 24px 24px 26px 44px;
  background: transparent;
}

.appliance-handle {
  left: 18px;
  width: 6px;
  background: color-mix(in srgb, var(--fresh) 78%, var(--surface-strong));
  box-shadow: none;
}

.mini-bag {
  min-height: 104px;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: var(--surface-strong);
  box-shadow: none;
}

.mini-bag.freezer {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.mini-bag.fridge {
  border-color: color-mix(in srgb, var(--fresh) 42%, var(--line));
}

.entry-card.warning,
.entry-card.expired,
.entry-card.used,
.entry-card.discarded {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-left: 0;
  background: transparent;
  opacity: 1;
}

.entry-card.warning {
  border-bottom-color: color-mix(in srgb, var(--warning) 42%, var(--line));
}

.entry-card.expired,
.entry-card.discarded {
  border-bottom-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.warning .status-pill {
  background: color-mix(in srgb, var(--warning) 14%, var(--surface-strong));
  color: color-mix(in srgb, var(--warning) 56%, var(--ink));
}

.expired .status-pill,
.discarded .status-pill {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-strong));
  color: color-mix(in srgb, var(--danger) 58%, var(--ink));
}

.used .status-pill {
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  color: var(--muted);
}

.discard-only-action {
  min-width: 118px;
}

:root[data-theme="dark"] .app-nav,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="aj"] .app-nav,
:root[data-theme="aj"] .bottom-nav {
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
}

:root[data-theme="dark"] .app-nav button,
:root[data-theme="dark"] .bottom-nav button,
:root[data-theme="aj"] .app-nav button,
:root[data-theme="aj"] .bottom-nav button {
  color: var(--muted);
}

:root[data-theme="dark"] .app-nav button.active,
:root[data-theme="dark"] .bottom-nav button.active,
:root[data-theme="aj"] .app-nav button.active,
:root[data-theme="aj"] .bottom-nav button.active {
  background: color-mix(in srgb, var(--primary) 24%, var(--surface-strong));
  color: var(--ink);
}

:root[data-theme="dark"] .today-hero,
:root[data-theme="dark"] .next-use-panel,
:root[data-theme="dark"] .quick-start-panel,
:root[data-theme="dark"] .stash-header,
:root[data-theme="dark"] .view-heading,
:root[data-theme="dark"] .entry-card,
:root[data-theme="dark"] .metric-strip,
:root[data-theme="dark"] .history-stats,
:root[data-theme="aj"] .today-hero,
:root[data-theme="aj"] .next-use-panel,
:root[data-theme="aj"] .quick-start-panel,
:root[data-theme="aj"] .stash-header,
:root[data-theme="aj"] .view-heading,
:root[data-theme="aj"] .entry-card,
:root[data-theme="aj"] .metric-strip,
:root[data-theme="aj"] .history-stats {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
}

:root[data-theme="dark"] .entry-storage-icon,
:root[data-theme="aj"] .entry-storage-icon {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent);
}

:root[data-theme="dark"] .entry-storage-icon.freezer,
:root[data-theme="aj"] .entry-storage-icon.freezer {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: var(--accent);
}

:root[data-theme="dark"] .entry-storage-icon.fridge,
:root[data-theme="aj"] .entry-storage-icon.fridge {
  background: color-mix(in srgb, var(--fresh) 20%, var(--surface));
  color: var(--fresh);
}

:root[data-theme="dark"] .status-pill,
:root[data-theme="aj"] .status-pill {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}

:root[data-theme="dark"] .warning .status-pill,
:root[data-theme="aj"] .warning .status-pill {
  background: color-mix(in srgb, var(--warning) 22%, var(--surface));
  color: var(--warning);
}

:root[data-theme="dark"] .expired .status-pill,
:root[data-theme="dark"] .discarded .status-pill,
:root[data-theme="aj"] .expired .status-pill,
:root[data-theme="aj"] .discarded .status-pill {
  background: color-mix(in srgb, var(--danger) 22%, var(--surface));
  color: var(--danger);
}

:root[data-theme="dark"] .danger-action,
:root[data-theme="aj"] .danger-action {
  background: color-mix(in srgb, var(--danger) 18%, var(--surface-strong));
  color: var(--danger);
}

:root[data-theme="dark"] .appliance,
:root[data-theme="aj"] .appliance {
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}

:root[data-theme="dark"] .mini-bag,
:root[data-theme="aj"] .mini-bag {
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
}

:root[data-theme="dark"] .mini-bag.freezer,
:root[data-theme="aj"] .mini-bag.freezer {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

:root[data-theme="dark"] .mini-bag.fridge,
:root[data-theme="aj"] .mini-bag.fridge {
  border-color: color-mix(in srgb, var(--fresh) 48%, var(--line));
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 14px;
    padding-bottom: 104px;
  }

  .mobile-column {
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .mobile-column::before {
    display: none;
  }

  .desktop-layout {
    grid-template-columns: 1fr;
  }

  .cold-preview {
    display: none;
  }

  .app-nav {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    z-index: 30;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 13%, transparent);
    backdrop-filter: blur(12px);
  }

  .bottom-nav button {
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    border-radius: 16px;
    font-size: var(--text-xs);
  }

  .bottom-nav .icon {
    width: 18px;
    height: 18px;
  }

  .bottom-nav .bottom-add {
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary-dark) 88%, white), var(--primary-dark));
    color: white;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 35%, transparent);
  }

  .toast-region {
    right: 12px;
    bottom: 92px;
    left: 12px;
  }

  .app-toast {
    width: 100%;
    max-width: none;
    min-width: 0;
    border-radius: 18px;
  }

  .topbar,
  .top-controls,
  .section-actions {
    flex-wrap: wrap;
  }

  .topbar {
    flex-wrap: nowrap;
  }

  .top-controls {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    margin-left: auto;
  }

  .section-actions {
    width: 100%;
  }

  .theme-select,
  .settings-menu {
    flex: 0 0 42px;
  }

  .theme-select select {
    width: 42px;
  }

  .settings-panel {
    right: 0;
    left: auto;
    width: min(86vw, 280px);
  }

  .onboarding,
  .edit-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding-top: 18px;
  }

  .hero-band,
  .today-hero,
  .stash-header,
  .section-heading,
  .alert-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band,
  .today-hero {
    padding: 0 0 26px;
    border-radius: 0;
  }

  .today-hero {
    margin-top: 2px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  }

  .hero-topline {
    flex-direction: column;
    gap: 18px;
  }

  .hero-topline h1 {
    font-size: clamp(2.85rem, 17vw, 4.15rem);
  }

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

  .today-hero::after {
    right: 20px;
    top: 22px;
    bottom: auto;
    width: 58px;
    height: 38px;
    opacity: 0.4;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .today-summary,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .history-stats {
    grid-template-columns: 1fr;
  }

  .metric-item,
  .stat-card {
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  }

  .metric-item:last-child,
  .stat-card:last-child {
    border-bottom: 0;
  }

  .next-use-panel,
  .quick-start-panel {
    grid-template-columns: 1fr;
    padding: 16px 0 22px;
  }

  .tabs {
    width: 100%;
  }

  .entry-main {
    align-items: flex-start;
  }

  .entry-main .status-pill {
    margin-left: auto;
  }

  .stash-header {
    display: flex;
  }

  .labels-heading,
  .label-preview {
    grid-template-columns: 1fr;
  }

  .entry-actions,
  .form-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .entry-actions button,
  .action-menu,
  .action-menu .use-action,
  .form-actions button,
  .add-action,
  .secondary-action {
    width: 100%;
  }

  .action-menu details,
  .action-menu summary {
    width: 100%;
  }
}

/* Calm Cockpit direction: task-first, quieter hierarchy, fewer primary destinations. */
:root {
  --page: #fbf8f7;
  --surface: #fffdfc;
  --surface-strong: #ffffff;
  --ink: #263140;
  --muted: #687583;
  --line: #e7dee0;
  --primary: #f28aac;
  --primary-dark: #4379a4;
  --accent: #7fb6d6;
  --fresh: #78bba9;
  --wash: #fff3f6;
  --shadow: 0 22px 60px rgba(88, 95, 115, 0.12);
  --soft-shadow: 0 12px 32px rgba(88, 95, 115, 0.1);
  --font-ui: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Avenir Next", system-ui, sans-serif;
  --font-display: "Hiragino Maru Gothic ProN", "Tsukushi A Round Gothic", "Avenir Next Rounded", var(--font-ui);
  --font-data: "DIN Alternate", "Avenir Next", "Hiragino Sans", system-ui, sans-serif;
}

:root[data-theme="calm"] {
  --page: #f8fcff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #21384b;
  --muted: #64798a;
  --line: #dcecf6;
  --primary: #8fc9ef;
  --primary-dark: #407dad;
  --accent: #9bd4f2;
  --fresh: #8ecfbc;
  --wash: #eef8ff;
}

:root[data-theme="dark"] {
  --page: #131017;
  --surface: #1d1721;
  --surface-strong: #251d2b;
  --ink: #fff8fb;
  --muted: #cfbfcc;
  --line: #4c3c52;
  --primary: #ff99ba;
  --primary-dark: #ffbfd2;
  --accent: #8bd3fb;
  --fresh: #90dac8;
  --wash: #19131f;
}

:root[data-theme="aj"] {
  --page: #10071f;
  --surface: #1a0e2e;
  --surface-strong: #25153f;
  --ink: #fff8ff;
  --muted: #decef8;
  --line: #594685;
  --primary: #ff70d2;
  --primary-dark: #0fe7cb;
  --accent: #fff06a;
  --fresh: #6ff7ff;
  --wash: #170b2b;
}

body {
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 32rem),
    linear-gradient(180deg, var(--page) 0%, color-mix(in srgb, var(--surface) 78%, var(--page)) 100%);
}

:root[data-theme="dark"] body,
:root[data-theme="aj"] body {
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 30rem),
    linear-gradient(180deg, var(--page), color-mix(in srgb, var(--surface) 72%, black));
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  padding: 28px 0 56px;
}

.desktop-layout {
  grid-template-columns: minmax(380px, 520px) minmax(340px, 1fr);
  gap: clamp(44px, 6vw, 86px);
}

.mobile-column {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mobile-column::before {
  display: none;
}

.topbar {
  padding: 8px 0 28px;
}

.app-brand {
  gap: 12px;
}

.app-brand span {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: var(--weight-heavy);
}

.app-brand img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.theme-select,
.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
}

.theme-select:hover,
.icon-button:hover,
.settings-menu[open] .icon-button {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--ink);
}

.app-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin: 0 0 28px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
}

.app-nav button {
  min-height: 42px;
  border-radius: 999px;
  color: var(--muted);
}

.app-nav button.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-strong));
  color: var(--primary-dark);
}

.nav-count {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--primary-dark);
}

.cockpit-hero,
.next-use-panel,
.quick-start-panel,
.today-flow,
.stash-header,
.view-heading {
  margin: 0 0 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cockpit-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.cockpit-hero-main h1,
.stash-header h1 {
  margin: 6px 0 4px;
  color: var(--ink);
  font-family: var(--font-data);
  font-size: clamp(3.6rem, 11vw, 5.7rem);
  font-weight: var(--weight-heavy);
  letter-spacing: 0;
  line-height: 0.92;
}

.stash-header h1 {
  font-size: clamp(2.4rem, 8vw, 3.8rem);
}

.cockpit-hero-main p:not(.eyebrow),
.stash-header p,
.view-heading p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.45;
}

.add-action {
  align-self: start;
  min-width: 148px;
}

.cockpit-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cockpit-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

.cockpit-metric span,
.metric-item span,
.stat-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.cockpit-metric strong {
  color: var(--ink);
  font-family: var(--font-data);
  font-size: clamp(1.48rem, 4vw, 2rem);
  font-weight: var(--weight-heavy);
  line-height: 1.05;
}

.cockpit-metric small {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.28;
}

.next-use-panel,
.quick-start-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
}

.next-use-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.next-use-line h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 6vw, 2.35rem);
  line-height: 1.02;
}

.next-use-line p,
.next-use-status {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.next-use-line strong {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-family: var(--font-data);
  font-size: var(--text-xl);
  font-weight: var(--weight-heavy);
}

.next-use-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.next-use-status span:first-child {
  color: var(--ink);
  font-weight: var(--weight-bold);
}

.next-use-actions {
  align-self: end;
}

.today-flow {
  padding-top: 2px;
}

.today-flow .entry-card,
.compact-list .entry-card {
  padding: 14px 0;
}

.tabs {
  width: auto;
  min-width: min(100%, 310px);
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
}

.tabs button.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--primary-dark);
}

.stash-header,
.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.section-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.metric-strip,
.history-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 28px;
  border-top: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.metric-item,
.stat-card {
  padding: 15px 18px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.metric-item:last-child,
.stat-card:last-child {
  border-right: 0;
}

.section-heading.compact {
  align-items: end;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.16;
}

.stash-tools {
  position: relative;
}

.stash-tools summary {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 15px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  color: var(--ink);
  font-weight: var(--weight-bold);
  list-style: none;
}

.stash-tools summary::-webkit-details-marker {
  display: none;
}

.stash-tools > div {
  position: absolute;
  z-index: 45;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 12px;
  width: min(420px, 86vw);
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 96%, var(--surface));
  box-shadow: var(--shadow);
}

.entry-card {
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 0;
  background: transparent;
}

.entry-main {
  align-items: center;
}

.entry-storage-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-radius: 15px;
}

.entry-card h3 {
  font-size: 1.54rem;
}

.status-pill {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--primary-dark);
}

.progress-track {
  height: 4px;
  background: color-mix(in srgb, var(--line) 55%, transparent);
}

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

.action-menu {
  gap: 8px;
}

.use-action,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-dark);
  color: white;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary-dark) 20%, transparent);
}

:root[data-theme="aj"] .use-action,
:root[data-theme="aj"] .primary-action {
  background: var(--primary);
  color: #13071f;
}

.secondary-action,
.ghost-button,
.action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: color-mix(in srgb, var(--line) 74%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
  color: var(--ink);
  box-shadow: none;
}

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

.label-preview article {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  box-shadow: none;
}

.cockpit-companion,
.cold-preview {
  position: sticky;
  top: 28px;
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: auto;
  padding-top: 70px;
}

.companion-panel {
  display: grid;
  gap: 8px;
  max-width: 500px;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.companion-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.98;
}

.companion-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.48;
}

.companion-list {
  display: grid;
  max-width: 500px;
  border-top: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.companion-list article {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

.companion-list article:last-child {
  border-bottom: 0;
}

.companion-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.companion-list strong {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.1;
}

.companion-list small {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.cold-preview-copy h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.appliance {
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.settings-panel {
  width: min(330px, 88vw);
}

:root[data-theme="dark"] .companion-panel,
:root[data-theme="dark"] .stash-tools > div,
:root[data-theme="dark"] .settings-panel,
:root[data-theme="aj"] .companion-panel,
:root[data-theme="aj"] .stash-tools > div,
:root[data-theme="aj"] .settings-panel {
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 12px;
    padding-bottom: 96px;
  }

  .desktop-layout {
    grid-template-columns: 1fr;
  }

  .cockpit-companion,
  .cold-preview,
  .app-nav {
    display: none;
  }

  .topbar {
    padding: 4px 0 24px;
  }

  .bottom-nav {
    grid-template-columns: 1fr 1fr 76px 1fr;
    gap: 6px;
    padding: 7px;
    border-radius: 26px;
  }

  .bottom-nav button {
    min-height: 56px;
  }

  .bottom-nav .bottom-add {
    min-height: 64px;
    margin-top: -14px;
    border-radius: 20px;
  }

  .cockpit-hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 22px;
  }

  .cockpit-hero-main h1 {
    font-size: clamp(3.55rem, 18vw, 5rem);
  }

  .add-action {
    width: 100%;
  }

  .cockpit-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }

  .cockpit-metric {
    padding-top: 12px;
  }

  .next-use-panel,
  .quick-start-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .next-use-line {
    display: grid;
    gap: 8px;
  }

  .next-use-line strong {
    font-size: var(--text-lg);
  }

  .next-use-actions,
  .action-menu,
  .action-menu .use-action,
  .action-menu details,
  .action-menu summary {
    width: 100%;
  }

  .action-menu {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .section-heading.compact,
  .stash-header,
  .view-heading,
  .labels-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-actions {
    width: 100%;
  }

  .section-actions > * {
    flex: 1;
  }

  .metric-strip,
  .history-stats {
    grid-template-columns: 1fr;
  }

  .metric-item,
  .stat-card {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  }

  .metric-item:last-child,
  .stat-card:last-child {
    border-bottom: 0;
  }

  .stash-tools {
    width: 100%;
  }

  .stash-tools summary {
    width: 100%;
  }

  .stash-tools > div {
    position: static;
    width: 100%;
    margin-top: 10px;
    box-shadow: none;
  }

  .entry-list {
    padding-bottom: 28px;
  }

  .entry-main {
    align-items: flex-start;
  }

  .entry-actions {
    justify-content: stretch;
  }

  .entry-actions > .text-button,
  .entry-actions > .danger-action {
    width: 100%;
  }

  .label-preview {
    grid-template-columns: 1fr;
  }

  .toast-region {
    top: 72px;
    right: 12px;
    bottom: auto;
    left: 12px;
  }
}

/* Calm Cockpit typography rebuild */
:root {
  --font-ui: "Atkinson Hyperlegible", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  --font-display: "M PLUS Rounded 1c", "Tsukushi A Round Gothic", "Hiragino Maru Gothic ProN", var(--font-ui);
  --font-data: "M PLUS Rounded 1c", "Atkinson Hyperlegible", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading-tight: 1.08;
  --leading-title: 1.16;
  --leading-body: 1.5;
  --tracking-label: 0.035em;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-heavy: 800;
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  line-height: var(--leading-body);
}

button,
input,
select,
textarea {
  font-family: var(--font-ui);
}

.app-brand span,
.section-heading h2,
.view-heading h1,
.labels-heading h1,
.form-shell h1,
.empty-state strong,
.quick-start-panel h2,
.next-use-line h2,
.companion-panel h2,
.cold-preview-copy h2,
.appliance-head h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: var(--leading-title);
}

.app-brand span {
  font-size: 1.22rem;
  font-weight: var(--weight-heavy);
}

.eyebrow,
.settings-label,
.date-filter span,
label > span,
.entry-meta,
.status-pill,
.nav-count {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  line-height: 1.25;
}

.eyebrow,
.settings-label,
.date-filter span,
label > span {
  text-transform: uppercase;
}

.cockpit-hero-main h1,
.stash-header h1,
.entry-card h3,
.metric-item strong,
.stat-card strong,
.cockpit-metric strong,
.next-use-line strong,
.companion-list strong,
.history-total strong {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-heavy);
  letter-spacing: 0;
}

.cockpit-hero-main h1 {
  font-size: clamp(3.25rem, 9.5vw, 5.15rem);
  line-height: 0.98;
}

.stash-header h1 {
  font-size: clamp(2.55rem, 6.2vw, 3.9rem);
  line-height: 1;
}

.companion-panel h2 {
  font-size: clamp(2.35rem, 4.8vw, 3.8rem);
}

.cold-preview-copy h2 {
  font-size: clamp(2.05rem, 3.8vw, 3rem);
}

.section-heading h2,
.view-heading h1,
.labels-heading h1,
.form-shell h1,
.quick-start-panel h2 {
  font-size: var(--text-2xl);
}

.next-use-line h2 {
  font-size: clamp(1.55rem, 4.2vw, 2.05rem);
}

.entry-card h3 {
  font-size: 1.46rem;
  line-height: 1.05;
}

.metric-item strong,
.stat-card strong,
.cockpit-metric strong {
  font-size: clamp(1.32rem, 3.2vw, 1.72rem);
  line-height: 1.08;
}

.cockpit-hero-main p:not(.eyebrow),
.stash-header p,
.view-heading p,
.next-use-line p,
.next-use-status,
.empty-state p,
.form-note,
.companion-panel p:not(.eyebrow),
.companion-list small,
.cockpit-metric small,
.metric-item small,
.stat-card p,
.entry-card .muted {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  line-height: 1.45;
}

.cockpit-hero-main p:not(.eyebrow),
.stash-header p,
.companion-panel p:not(.eyebrow) {
  font-size: var(--text-md);
}

.app-nav button,
.bottom-nav button,
.primary-action,
.secondary-action,
.ghost-button,
.text-button,
.danger-action,
.use-action,
.action-menu summary,
.tabs button,
.theme-choice,
.stash-tools summary {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.2;
}

.app-nav button strong,
.bottom-nav button strong,
.bottom-nav button span {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
}

.status-pill {
  min-height: 28px;
  padding-inline: 12px;
  text-transform: none;
}

.entry-meta {
  color: var(--muted);
  text-transform: none;
}

.settings-panel,
.settings-panel input,
.settings-panel select,
.stash-tools select,
.stash-tools input,
.file-restore {
  font-size: var(--text-sm);
  line-height: 1.35;
}

.theme-menu {
  position: relative;
}

.theme-menu summary {
  list-style: none;
}

.theme-menu summary::-webkit-details-marker {
  display: none;
}

.theme-menu[open] > summary {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--ink);
}

.theme-panel {
  position: absolute;
  z-index: 90;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 6px;
  width: 224px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 96%, var(--surface));
  box-shadow: var(--shadow);
}

.theme-choice {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
  padding: 8px 34px 8px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.theme-choice:hover,
.theme-choice.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.theme-choice.active::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary-dark);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 8px;
  box-shadow: inset 0 0 0 5px color-mix(in srgb, white 28%, transparent);
}

.theme-swatch.light {
  background: #f58aad;
}

.theme-swatch.dark {
  background: #211927;
}

.theme-swatch.aj {
  background: linear-gradient(135deg, #0fe7cb 0 50%, #ff70d2 50% 100%);
}

.theme-swatch.calm {
  background: #8fc9ef;
}

:root[data-theme="dark"] .theme-panel,
:root[data-theme="aj"] .theme-panel {
  background: color-mix(in srgb, var(--surface-strong) 94%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
}

:root[data-theme="dark"] .theme-choice.active::after {
  background: var(--primary);
}

:root[data-theme="aj"] .theme-choice.active::after {
  background: var(--primary-dark);
}

@media (max-width: 760px) {
  .cockpit-hero-main h1 {
    font-size: clamp(3rem, 15vw, 4.55rem);
  }

  .stash-header h1 {
    font-size: clamp(2.35rem, 13vw, 3.45rem);
  }

  .section-heading h2,
  .view-heading h1,
  .labels-heading h1,
  .form-shell h1,
  .quick-start-panel h2 {
    font-size: var(--text-xl);
  }

  .theme-panel {
    right: -48px;
    width: min(224px, calc(100vw - 24px));
  }
}

/* Boris Lozano product-style UX remake */
:root {
  --font-ui: "Manrope", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-display: "Fraunces", "Cooper Black", "Recoleta", Georgia, serif;
  --font-data: "Manrope", "DIN Alternate", system-ui, sans-serif;
  --page: #f6efdf;
  --surface: #fffaf0;
  --surface-strong: #fffef8;
  --ink: #210021;
  --muted: #766975;
  --line: #221022;
  --primary: #ef8aaa;
  --primary-dark: #2a002b;
  --accent: #e6b94a;
  --fresh: #31c6b4;
  --wash: #fff5df;
  --cream: #f8f0df;
  --label: #f4d99a;
  --shadow: 0 22px 0 rgba(42, 0, 43, 0.08), 0 30px 70px rgba(42, 0, 43, 0.16);
  --soft-shadow: 0 12px 0 rgba(42, 0, 43, 0.05), 0 20px 42px rgba(42, 0, 43, 0.12);
  --micro-shadow: 0 6px 0 rgba(42, 0, 43, 0.05);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
}

:root[data-theme="calm"] {
  --page: #edf8ff;
  --surface: #fbfdff;
  --surface-strong: #ffffff;
  --ink: #082b45;
  --muted: #5d7687;
  --line: #123b57;
  --primary: #8fd1f3;
  --primary-dark: #0c5f91;
  --accent: #f0bf60;
  --fresh: #48c6b1;
  --wash: #eef8ff;
  --cream: #f7fcff;
  --label: #d8efff;
}

:root[data-theme="dark"] {
  --page: #130d16;
  --surface: #1e1520;
  --surface-strong: #2b1e2e;
  --ink: #fff8ec;
  --muted: #d8c9d2;
  --line: #f2d99e;
  --primary: #ff91b5;
  --primary-dark: #f5cb6b;
  --accent: #f5cb6b;
  --fresh: #66dfcf;
  --wash: #1a111d;
  --cream: #261a29;
  --label: #4b3651;
}

:root[data-theme="aj"] {
  --page: #0f0621;
  --surface: #190d2d;
  --surface-strong: #24143d;
  --ink: #fff8ff;
  --muted: #dfd1f5;
  --line: #18ebd2;
  --primary: #ff6fd4;
  --primary-dark: #18ebd2;
  --accent: #fff05d;
  --fresh: #18ebd2;
  --wash: #150925;
  --cream: #201135;
  --label: #3b2458;
}

body {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary-dark) 7%, transparent) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(180deg, var(--page), color-mix(in srgb, var(--surface) 72%, var(--page)));
  color: var(--ink);
  font-family: var(--font-ui);
}

:root[data-theme="dark"] body,
:root[data-theme="aj"] body {
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 30rem),
    linear-gradient(180deg, var(--page), #08040f);
}

.app-shell {
  width: min(1220px, calc(100% - 36px));
}

.desktop-layout {
  grid-template-columns: minmax(380px, 500px) minmax(420px, 1fr);
  gap: clamp(32px, 5vw, 74px);
}

.mobile-column {
  padding: 0;
}

.topbar {
  padding: 18px 0;
  border-bottom: 2px solid color-mix(in srgb, var(--line) 16%, transparent);
}

.app-brand span {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.34rem;
  font-weight: 800;
}

.app-brand img {
  width: 48px;
  height: 48px;
  border: 2px solid var(--surface-strong);
  border-radius: 14px;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 16%, transparent);
}

.icon-button,
.theme-select {
  border: 2px solid color-mix(in srgb, var(--line) 22%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.app-nav {
  margin: 18px 0 22px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.app-nav button {
  min-height: 52px;
  border-radius: 0;
  color: var(--muted);
}

.app-nav button + button {
  border-left: 2px solid color-mix(in srgb, var(--line) 24%, transparent);
}

.app-nav button.active {
  background: var(--primary-dark);
  color: var(--surface-strong);
}

.app-nav button.active .nav-count {
  background: var(--accent);
  color: var(--ink);
}

.cold-chain-hero,
.stash-command,
.logbook-hero {
  display: grid;
  gap: 18px;
  margin: 0 0 22px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: var(--primary-dark);
  color: var(--surface-strong);
  box-shadow: var(--shadow);
}

.system-title h1,
.stash-command h1,
.logbook-hero h1 {
  margin: 6px 0 4px;
  color: currentColor;
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 11vw, 5.15rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0;
}

.system-title p:not(.eyebrow),
.stash-command p,
.logbook-hero p,
.route-map-head span {
  color: color-mix(in srgb, currentColor 76%, transparent);
}

.cold-chain-hero .eyebrow,
.stash-command .eyebrow {
  color: var(--accent);
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.route-map {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1.5px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 8%, transparent);
}

.route-map-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.route-map-head strong {
  display: block;
  font-size: var(--text-lg);
}

.route-map-head small {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
}

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

.route-line::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 11%;
  left: 11%;
  height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, currentColor 34%, transparent);
}

.route-node {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.route-node > span {
  width: 40px;
  height: 40px;
  border: 3px solid currentColor;
  border-radius: 999px;
  background: var(--primary-dark);
}

.route-node.active > span {
  background: var(--accent);
  box-shadow: inset 0 0 0 7px var(--primary-dark);
}

.route-node strong {
  font-size: var(--text-sm);
}

.route-node small {
  color: color-mix(in srgb, currentColor 70%, transparent);
  font-size: var(--text-xs);
  line-height: 1.25;
}

.cockpit-board {
  display: grid;
  gap: 18px;
  margin-bottom: 26px;
}

.board-main .next-use-panel,
.board-main .quick-start-panel {
  margin: 0;
}

.next-use-panel,
.quick-start-panel {
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  box-shadow: var(--soft-shadow);
}

.next-use-line h2,
.quick-start-panel h2,
.section-heading h2 {
  font-family: var(--font-display);
}

.status-rail,
.stash-route-summary,
.history-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 24px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.status-rail .cockpit-metric,
.stash-route-summary .metric-item,
.history-stats .stat-card {
  padding: 16px;
  border-top: 0;
  border-right: 2px solid color-mix(in srgb, var(--line) 24%, transparent);
  background: transparent;
}

.status-rail .cockpit-metric:last-child,
.stash-route-summary .metric-item:last-child,
.history-stats .stat-card:last-child {
  border-right: 0;
}

.cockpit-metric strong,
.metric-item strong,
.stat-card strong {
  color: var(--ink);
  font-family: var(--font-display);
}

.today-flow,
.list-section {
  padding: 18px 0 0;
  border-top: 2px solid color-mix(in srgb, var(--line) 16%, transparent);
}

.tabs,
.stash-tools summary {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.tabs button.active {
  background: var(--accent);
  color: var(--ink);
}

.stash-command {
  grid-template-columns: minmax(0, 1fr);
}

.stash-command .primary-action {
  background: var(--accent);
  color: var(--ink);
}

.shelf-list {
  display: grid;
  gap: 20px;
}

.storage-shelf {
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  overflow: hidden;
}

.storage-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 2px solid color-mix(in srgb, var(--line) 18%, transparent);
  background: var(--surface);
}

.storage-shelf-head strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.storage-shelf-head span {
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
}

.storage-shelf .entry-list {
  padding: 0 16px;
}

.shelf-empty {
  padding: 18px 0;
  color: var(--muted);
  font-weight: 750;
}

.entry-card {
  border-bottom: 2px solid color-mix(in srgb, var(--line) 14%, transparent);
}

.entry-card:last-child {
  border-bottom: 0;
}

.entry-card h3 {
  color: var(--ink);
  font-family: var(--font-display);
}

.entry-storage-icon {
  border: 2px solid var(--line);
  background: var(--accent);
}

.entry-storage-icon.fridge {
  background: var(--fresh);
}

.status-pill {
  border: 1.5px solid var(--line);
  background: var(--label);
  color: var(--ink);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 12%, transparent);
}

.progress-track span {
  background: var(--primary);
}

.primary-action,
.use-action,
.bottom-nav .bottom-add {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--primary);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--line);
}

.secondary-action,
.ghost-button,
.text-button,
.action-menu summary,
.danger-action {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--ink);
}

.danger-action {
  background: #ffc6c6;
}

.logbook-hero {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr);
  background: var(--surface-strong);
  color: var(--ink);
}

.logbook-hero aside {
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--label);
}

.logbook-hero aside span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.logbook-hero aside strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.cockpit-companion,
.cold-preview {
  padding-top: 92px;
}

.cockpit-companion .route-map {
  max-width: 560px;
  border: 2px solid var(--line);
  background: var(--primary-dark);
  color: var(--surface-strong);
  box-shadow: var(--soft-shadow);
}

.companion-panel {
  border: 2px solid var(--line);
  background: var(--surface-strong);
}

.companion-panel h2 {
  color: var(--ink);
  font-family: var(--font-display);
}

.companion-list {
  max-width: 560px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
}

.companion-list article {
  padding: 18px;
}

.appliance {
  border: 2px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.theme-panel,
.settings-panel,
.stash-tools > div {
  border: 2px solid var(--line);
  background: var(--surface-strong);
}

:root[data-theme="dark"] .cold-chain-hero,
:root[data-theme="dark"] .route-node > span,
:root[data-theme="dark"] .cockpit-companion .route-map,
:root[data-theme="aj"] .cold-chain-hero,
:root[data-theme="aj"] .route-node > span,
:root[data-theme="aj"] .cockpit-companion .route-map {
  background: var(--surface);
}

:root[data-theme="dark"] .next-use-panel,
:root[data-theme="dark"] .quick-start-panel,
:root[data-theme="dark"] .storage-shelf,
:root[data-theme="dark"] .logbook-hero,
:root[data-theme="dark"] .companion-panel,
:root[data-theme="dark"] .companion-list,
:root[data-theme="dark"] .stash-route-summary,
:root[data-theme="dark"] .history-stats,
:root[data-theme="dark"] .status-rail,
:root[data-theme="aj"] .next-use-panel,
:root[data-theme="aj"] .quick-start-panel,
:root[data-theme="aj"] .storage-shelf,
:root[data-theme="aj"] .logbook-hero,
:root[data-theme="aj"] .companion-panel,
:root[data-theme="aj"] .companion-list,
:root[data-theme="aj"] .stash-route-summary,
:root[data-theme="aj"] .history-stats,
:root[data-theme="aj"] .status-rail {
  background: var(--surface-strong);
}

:root[data-theme="dark"] .primary-action,
:root[data-theme="dark"] .use-action {
  background: var(--primary);
  color: #130d16;
}

:root[data-theme="aj"] .primary-action,
:root[data-theme="aj"] .use-action,
:root[data-theme="aj"] .bottom-nav .bottom-add {
  background: var(--primary-dark);
  color: #0f0621;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1220px);
  }

  .topbar {
    padding-top: 10px;
  }

  .cold-chain-hero,
  .stash-command,
  .logbook-hero {
    padding: 18px;
    border-radius: 22px;
  }

  .system-title h1,
  .stash-command h1,
  .logbook-hero h1 {
    font-size: clamp(3rem, 16vw, 4.4rem);
  }

  .hero-actions,
  .section-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .route-map {
    padding: 14px;
  }

  .route-map-head {
    display: grid;
  }

  .route-map-head span {
    display: none;
  }

  .route-line {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .route-line::before {
    display: block;
    right: 48px;
    left: 18px;
    top: 24px;
  }

  .route-node {
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .route-node > span {
    width: 34px;
    height: 34px;
  }

  .route-node strong {
    font-size: 0.78rem;
  }

  .route-node small {
    font-size: 0.68rem;
  }

  .cold-chain-hero .route-line {
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }

  .cold-chain-hero .route-node {
    flex: 0 0 74px;
    display: grid;
    gap: 3px;
    min-width: 74px;
    padding: 0;
    border: 0;
  }

  .cold-chain-hero .route-node > span {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  .status-rail,
  .stash-route-summary,
  .history-stats {
    grid-template-columns: 1fr;
  }

  .status-rail .cockpit-metric,
  .stash-route-summary .metric-item,
  .history-stats .stat-card {
    border-right: 0;
    border-bottom: 2px solid color-mix(in srgb, var(--line) 18%, transparent);
  }

  .status-rail .cockpit-metric:last-child,
  .stash-route-summary .metric-item:last-child,
  .history-stats .stat-card:last-child {
    border-bottom: 0;
  }

  .logbook-hero {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    border: 2px solid var(--line);
    background: var(--surface-strong);
  }
}

/* Layout and contrast correction */
:root:not([data-theme]),
:root[data-theme="light"] {
  --page: #fbf7ee;
  --surface: #fffdf7;
  --surface-strong: #ffffff;
  --ink: #250725;
  --muted: #756875;
  --line: #250725;
  --primary: #ef86ad;
  --primary-dark: #4a0a45;
  --accent: #e9bf45;
  --label: #f7dfa3;
}

body {
  overflow-x: hidden;
  background: var(--page);
}

:root[data-theme="calm"] body {
  background: var(--page);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
}

.desktop-layout {
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px);
}

.mobile-column {
  width: 100%;
  max-width: 500px;
  min-width: 0;
}

.cold-chain-hero,
.stash-command,
.logbook-hero,
.next-use-panel,
.quick-start-panel,
.storage-shelf,
.status-rail,
.stash-route-summary,
.history-stats,
.bottom-nav {
  max-width: 100%;
}

.system-title h1,
.stash-command h1,
.logbook-hero h1 {
  font-size: clamp(3.1rem, 10vw, 4.7rem);
  overflow-wrap: anywhere;
}

.route-line {
  min-width: 0;
}

.route-node {
  min-width: 0;
}

:root[data-theme="dark"] .cold-chain-hero,
:root[data-theme="dark"] .stash-command,
:root[data-theme="dark"] .cockpit-companion .route-map,
:root[data-theme="aj"] .cold-chain-hero,
:root[data-theme="aj"] .stash-command,
:root[data-theme="aj"] .cockpit-companion .route-map {
  background: var(--surface-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .system-title h1,
:root[data-theme="dark"] .system-title p,
:root[data-theme="dark"] .route-map,
:root[data-theme="dark"] .route-map-head strong,
:root[data-theme="dark"] .route-node strong,
:root[data-theme="dark"] .route-node small,
:root[data-theme="aj"] .system-title h1,
:root[data-theme="aj"] .system-title p,
:root[data-theme="aj"] .route-map,
:root[data-theme="aj"] .route-map-head strong,
:root[data-theme="aj"] .route-node strong,
:root[data-theme="aj"] .route-node small {
  color: var(--ink);
}

:root[data-theme="dark"] .route-node > span,
:root[data-theme="aj"] .route-node > span {
  background: var(--surface-strong);
  color: var(--ink);
}

:root[data-theme="dark"] .route-node.active > span,
:root[data-theme="aj"] .route-node.active > span {
  background: var(--accent);
  box-shadow: inset 0 0 0 7px var(--surface-strong);
}

:root[data-theme="dark"] .route-line::before,
:root[data-theme="aj"] .route-line::before {
  background: color-mix(in srgb, var(--ink) 38%, transparent);
}

:root[data-theme="dark"] .cold-chain-hero .eyebrow,
:root[data-theme="dark"] .stash-command .eyebrow,
:root[data-theme="aj"] .cold-chain-hero .eyebrow,
:root[data-theme="aj"] .stash-command .eyebrow {
  color: var(--accent);
}

:root[data-theme="dark"] .next-use-panel,
:root[data-theme="dark"] .quick-start-panel,
:root[data-theme="dark"] .storage-shelf,
:root[data-theme="dark"] .logbook-hero,
:root[data-theme="dark"] .companion-panel,
:root[data-theme="dark"] .companion-list,
:root[data-theme="dark"] .stash-route-summary,
:root[data-theme="dark"] .history-stats,
:root[data-theme="dark"] .status-rail,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="aj"] .next-use-panel,
:root[data-theme="aj"] .quick-start-panel,
:root[data-theme="aj"] .storage-shelf,
:root[data-theme="aj"] .logbook-hero,
:root[data-theme="aj"] .companion-panel,
:root[data-theme="aj"] .companion-list,
:root[data-theme="aj"] .stash-route-summary,
:root[data-theme="aj"] .history-stats,
:root[data-theme="aj"] .status-rail,
:root[data-theme="aj"] .bottom-nav {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .text-button,
:root[data-theme="dark"] .action-menu summary,
:root[data-theme="aj"] .secondary-action,
:root[data-theme="aj"] .ghost-button,
:root[data-theme="aj"] .text-button,
:root[data-theme="aj"] .action-menu summary {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--line);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 500px);
    padding-top: 10px;
    padding-bottom: 104px;
  }

  .desktop-layout {
    display: block;
  }

  .mobile-column {
    width: 100%;
    max-width: none;
  }

  .topbar {
    gap: 12px;
  }

  .app-brand {
    min-width: 0;
  }

  .app-brand span {
    font-size: clamp(1.15rem, 7vw, 1.9rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-brand img {
    width: clamp(48px, 14vw, 64px);
    height: clamp(48px, 14vw, 64px);
    flex: 0 0 auto;
  }

  .top-controls {
    gap: 8px;
    flex: 0 0 auto;
  }

  .icon-button {
    width: clamp(42px, 12vw, 56px);
    height: clamp(42px, 12vw, 56px);
  }

  .cold-chain-hero,
  .stash-command,
  .logbook-hero {
    gap: clamp(14px, 4vw, 18px);
    padding: clamp(16px, 5vw, 22px);
    border-radius: clamp(20px, 7vw, 30px);
  }

  .system-title h1,
  .stash-command h1,
  .logbook-hero h1 {
    font-size: clamp(3.35rem, 18vw, 5.1rem);
  }

  .hero-actions {
    gap: 10px;
  }

  .primary-action,
  .secondary-action,
  .ghost-button,
  .text-button,
  .danger-action,
  .use-action,
  .action-menu summary {
    min-height: 48px;
  }

  .route-map {
    gap: 12px;
    padding: clamp(12px, 4vw, 16px);
    overflow: hidden;
  }

  .route-line {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(6px, 2.3vw, 12px);
    overflow: visible;
  }

  .route-line::before {
    top: 15px;
    right: 12%;
    left: 12%;
    height: 4px;
  }

  .cold-chain-hero .route-line {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .cold-chain-hero .route-node {
    min-width: 0;
    flex: initial;
  }

  .route-node > span,
  .cold-chain-hero .route-node > span {
    width: clamp(24px, 8vw, 34px);
    height: clamp(24px, 8vw, 34px);
    border-width: 3px;
  }

  .route-node.active > span {
    box-shadow: inset 0 0 0 clamp(5px, 1.8vw, 7px) var(--primary-dark);
  }

  .route-node strong {
    font-size: clamp(0.72rem, 3.4vw, 0.9rem);
    line-height: 1.1;
  }

  .route-node small {
    font-size: clamp(0.62rem, 2.9vw, 0.76rem);
    line-height: 1.18;
  }

  .next-use-panel,
  .quick-start-panel {
    padding: clamp(14px, 4vw, 18px);
  }

  .bottom-nav {
    right: max(9px, env(safe-area-inset-right));
    bottom: max(9px, env(safe-area-inset-bottom));
    left: max(9px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) clamp(66px, 19vw, 84px) minmax(0, 1fr);
    gap: clamp(4px, 1.6vw, 8px);
    max-width: 500px;
    margin: 0 auto;
    padding: clamp(5px, 1.8vw, 8px);
    border-radius: clamp(20px, 7vw, 28px);
  }

  .bottom-nav button {
    min-width: 0;
    min-height: clamp(54px, 14vw, 64px);
    padding: 5px 4px;
    font-size: clamp(0.68rem, 3vw, 0.82rem);
  }

  .bottom-nav .bottom-add {
    min-height: clamp(66px, 18vw, 80px);
    margin-top: clamp(-14px, -3vw, -8px);
  }
}

/* Desktop-only scale correction */
@media (min-width: 761px) {
  .app-shell {
    width: min(1060px, calc(100% - 64px));
    padding-top: 22px;
    padding-bottom: 48px;
  }

  .desktop-layout {
    grid-template-columns: minmax(0, 420px) minmax(340px, 1fr);
    gap: clamp(34px, 4vw, 54px);
    align-items: start;
  }

  .mobile-column {
    max-width: 420px;
  }

  .topbar {
    padding: 10px 0 16px;
  }

  .app-brand {
    gap: 10px;
  }

  .app-brand img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 14%, transparent);
  }

  .app-brand span {
    font-size: 1.18rem;
  }

  .icon-button,
  .theme-select {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .app-nav {
    margin: 14px 0 18px;
  }

  .app-nav button {
    min-height: 42px;
  }

  .cold-chain-hero,
  .stash-command,
  .logbook-hero {
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 21px;
    box-shadow: 0 12px 0 rgba(42, 0, 43, 0.06), 0 22px 48px rgba(42, 0, 43, 0.12);
  }

  .system-title h1,
  .stash-command h1,
  .logbook-hero h1 {
    margin-top: 4px;
    font-size: clamp(2.8rem, 4.4vw, 3.45rem);
    line-height: 0.96;
  }

  .system-title p:not(.eyebrow),
  .stash-command p,
  .logbook-hero p {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .primary-action,
  .hero-actions .secondary-action,
  .section-actions .primary-action,
  .section-actions .secondary-action {
    min-height: 40px;
  }

  .route-map {
    gap: 12px;
    padding: 13px;
    border-radius: 15px;
  }

  .mobile-column .route-map-head span {
    display: none;
  }

  .route-map-head strong {
    font-size: 1rem;
  }

  .route-map-head small {
    font-size: 0.7rem;
  }

  .route-line {
    gap: 8px;
  }

  .route-line::before {
    top: 14px;
    right: 12%;
    left: 12%;
    height: 4px;
  }

  .route-node > span {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  .route-node.active > span {
    box-shadow: inset 0 0 0 6px var(--primary-dark);
  }

  .route-node strong {
    font-size: 0.76rem;
    line-height: 1.1;
  }

  .route-node small {
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .cockpit-board {
    gap: 14px;
    margin-bottom: 20px;
  }

  .next-use-panel,
  .quick-start-panel {
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
  }

  .next-use-line h2 {
    font-size: 1.45rem;
  }

  .next-use-line strong {
    font-size: 1rem;
  }

  .next-use-status {
    gap: 6px 10px;
  }

  .status-rail,
  .stash-route-summary,
  .history-stats {
    margin-bottom: 18px;
    border-radius: 15px;
  }

  .status-rail .cockpit-metric,
  .stash-route-summary .metric-item,
  .history-stats .stat-card {
    padding: 12px;
  }

  .cockpit-metric strong,
  .metric-item strong,
  .stat-card strong {
    font-size: 1.12rem;
  }

  .cockpit-metric small,
  .metric-item small,
  .stat-card p {
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .today-flow,
  .list-section {
    padding-top: 14px;
  }

  .section-heading.compact {
    margin-bottom: 12px;
  }

  .tabs button {
    min-height: 38px;
  }

  .entry-card {
    padding: 14px 0;
  }

  .entry-storage-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 12px;
  }

  .entry-card h3 {
    font-size: 1.26rem;
  }

  .cockpit-companion,
  .cold-preview {
    top: 22px;
    padding-top: 54px;
  }

  .companion-panel {
    max-width: 440px;
    padding: 20px;
    border-radius: 21px;
  }

  .companion-panel h2 {
    font-size: clamp(2.1rem, 3vw, 2.85rem);
  }

  .cockpit-companion .route-map,
  .companion-list {
    max-width: 440px;
  }

  .companion-list article {
    padding: 14px 16px;
  }

  .cold-preview-copy h2 {
    max-width: 14ch;
    font-size: clamp(1.85rem, 3vw, 2.55rem);
  }

  .cold-preview-copy p {
    max-width: 34ch;
    font-size: 0.92rem;
  }

  .appliance {
    max-width: 520px;
  }
}

/* v44 route dismissal and tab contrast fixes */
.route-map-head {
  align-items: start;
}

.route-dismiss {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  border: 1.5px solid color-mix(in srgb, currentColor 38%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-strong) 9%, transparent);
  color: currentColor;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.tabs {
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: none;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--muted);
  box-shadow: none;
}

.tabs button.active {
  background: var(--accent);
  color: #250725;
  box-shadow: none;
}

.tabs span,
.tabs button.active span,
.bottom-nav .nav-count,
.bottom-nav button.active .nav-count {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  margin-left: 0;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 88%, white);
  color: #250725;
  font-weight: 900;
}

:root[data-theme="dark"] .tabs,
:root[data-theme="aj"] .tabs {
  background: var(--surface);
  border-color: var(--line);
}

:root[data-theme="dark"] .tabs button,
:root[data-theme="aj"] .tabs button {
  color: var(--ink);
}

:root[data-theme="dark"] .tabs button.active,
:root[data-theme="aj"] .tabs button.active {
  background: var(--accent);
  color: #160018;
}

:root[data-theme="dark"] .tabs span,
:root[data-theme="dark"] .tabs button.active span,
:root[data-theme="dark"] .bottom-nav .nav-count,
:root[data-theme="dark"] .bottom-nav button.active .nav-count,
:root[data-theme="aj"] .tabs span,
:root[data-theme="aj"] .tabs button.active span,
:root[data-theme="aj"] .bottom-nav .nav-count,
:root[data-theme="aj"] .bottom-nav button.active .nav-count {
  background: var(--accent);
  color: #160018;
}

:root[data-theme="aj"] .bottom-nav button.active,
:root[data-theme="dark"] .bottom-nav button.active {
  background: color-mix(in srgb, var(--primary) 28%, var(--surface-strong));
  color: var(--ink);
}

@media (max-width: 760px) {
  .route-map-head {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .route-dismiss {
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .tabs {
    width: 100%;
    border-radius: 18px;
  }

  .tabs button {
    min-width: 0;
    padding: 0 10px;
    font-size: clamp(0.84rem, 4.2vw, 1rem);
  }
}

@media print {
  body {
    background: white;
  }

  .screen-content {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    min-height: auto;
    padding: 0;
  }

  .desktop-layout {
    display: block;
  }

  .print-labels {
    display: grid;
    gap: 16px;
    padding: 20px;
  }
}
