/* ------------------------- */
/*      Base & Reset         */
/* ------------------------- */
:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-muted: #f1f5f2;
  --text: #1f2a24;
  --muted: #66736b;
  --border: #dde4dd;
  --brand: #315f8f;
  --brand-strong: #244a72;
  --warning: #b7791f;
  --warning-bg: #fff6d7;
  --danger: #b8322c;
  --danger-bg: #ffe2df;
  --shadow: 0 16px 38px rgba(31, 42, 36, 0.08);
}

[data-theme="dark"] {
  --bg: #111214;
  --surface: #1b1d21;
  --surface-muted: #25282e;
  --text: #d9dce2;
  --muted: #9da3ad;
  --border: #343841;
  --brand: #496f9f;
  --brand-strong: #5f89bd;
  --warning: #d7b56d;
  --warning-bg: #342c1d;
  --danger: #d9827c;
  --danger-bg: #352221;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #111214;
    --surface: #1b1d21;
    --surface-muted: #25282e;
    --text: #d9dce2;
    --muted: #9da3ad;
    --border: #343841;
    --brand: #496f9f;
    --brand-strong: #5f89bd;
    --warning: #d7b56d;
    --warning-bg: #342c1d;
    --danger: #d9827c;
    --danger-bg: #352221;
    --shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

.container {
  background-color: #fff;
  padding: 20px 20px;
  border-radius: 0px 30px 0px 30px;
  max-width: 900px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1, h2, h3, p {
  margin-top: 0;
}

h1, h2, h3 {
  letter-spacing: 0;
}

label {
  display: block;
  margin-top: 15px;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 10px;
}

a {
  color: var(--brand);
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ------------------------- */
/*         App Shell         */
/* ------------------------- */
.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 88px 18px 18px;
}

.app-header {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  left: 50%;
  padding: 18px 18px 12px;
  position: fixed;
  top: 0;
  transform: translateX(-50%);
  width: min(1120px, 100%);
  z-index: 100;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .brand-logo-light {
    display: none;
  }

  [data-theme="auto"] .brand-logo-dark {
    display: block;
  }
}

.header-icon-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.header-icon-button,
.app-menu {
  position: relative;
  z-index: 50;
}

.header-icon-button,
.app-menu > summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  list-style: none;
  padding: 0;
  text-decoration: none;
  width: 44px;
}

.app-menu > summary::-webkit-details-marker,
.menu-section > summary::-webkit-details-marker {
  display: none;
}

.header-icon-button img,
.app-menu > summary img {
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.app-menu-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  max-height: min(76vh, 620px);
  min-width: min(86vw, 320px);
  overflow-y: auto;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
}

.menu-primary {
  display: grid;
  gap: 4px;
}

.menu-secondary {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
}

.menu-version {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
  padding: 9px 12px 2px;
}

.menu-link,
.menu-section > summary,
.menu-sublist a,
.menu-sublist button,
.menu-sublist span {
  border-radius: 8px;
  color: var(--text);
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  padding: 11px 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.menu-primary > .menu-link,
.menu-primary > .menu-section > summary {
  font-size: 16px;
}

.menu-secondary > .menu-link,
.menu-secondary > .menu-section > summary,
.menu-secondary .menu-sublist a,
.menu-secondary .menu-sublist button,
.menu-secondary .menu-sublist span {
  font-size: 14px;
}

.menu-link:hover,
.menu-section > summary:hover,
.menu-sublist a:hover,
.menu-sublist button:hover {
  background: var(--surface-muted);
}

.menu-section > summary {
  cursor: pointer;
  list-style: none;
}

.menu-section > summary::after {
  color: var(--muted);
  content: "v";
  float: right;
}

.menu-section[open] > summary::after {
  content: "^";
}

.menu-sublist {
  border-left: 2px solid var(--border);
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 10px;
  padding-left: 8px;
}

.menu-sublist form {
  margin: 0;
}

.menu-sublist button {
  background: transparent;
  border: 0;
  cursor: pointer;
  margin: 0;
}

.menu-sublist button.is-current {
  background: var(--surface-muted);
  color: var(--brand);
}

.menu-sublist span {
  color: var(--muted);
  font-weight: 700;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.app-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.app-nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.preference-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preference-controls form {
  margin: 0;
}

.preference-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  min-height: 38px;
  padding: 7px 10px;
}

.preference-button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.app-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.dashboard-hero,
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.dashboard-hero h1,
.page-title h1 {
  font-size: 34px;
  line-height: 1.08;
  margin-bottom: 10px;
}

.dashboard-hero p,
.page-title p {
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.primary-action,
.secondary-action,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-action,
.back-button {
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
}

.primary-action:hover,
.back-button:hover {
  background: var(--brand-strong);
}

.secondary-action {
  color: var(--brand);
  background: var(--surface-muted);
  padding: 10px 14px;
}

.secondary-action.is-locked,
button.is-locked,
input:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.subscription-banner {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.subscription-banner.compact {
  margin-top: 16px;
}

.subscription-banner.is-warning {
  border-left-color: var(--warning);
}

.subscription-banner strong {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.subscription-banner span {
  color: var(--muted);
}

.subscription-banner button {
  min-height: 38px;
  padding: 8px 12px;
}

.global-upgrade-banner {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 38px;
  margin: 4px 0 8px;
  padding: 8px 12px;
  text-decoration: none;
}

.global-upgrade-banner span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}

.global-upgrade-banner strong {
  color: var(--brand);
  font-size: 13px;
  white-space: nowrap;
}

.global-add-button {
  align-items: center;
  background: var(--brand);
  border: 1px solid var(--brand-strong);
  border-radius: 8px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  color: #fff;
  display: flex;
  font-size: 34px;
  font-weight: 800;
  height: 58px;
  justify-content: center;
  line-height: 1;
  position: fixed;
  right: max(18px, calc((100vw - 1120px) / 2 + 18px));
  text-decoration: none;
  width: 58px;
  z-index: 90;
}

.global-add-button:hover {
  background: var(--brand-strong);
  color: #fff;
}

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table td span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.admin-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.admin-unit-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-unit-list a {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  padding: 12px;
  text-decoration: none;
}

.admin-log-item {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.admin-log-item span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.admin-unit-list span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.stat-card.warning {
  background: var(--warning-bg);
  border-color: #f2d57e;
}

.stat-card.danger {
  background: var(--danger-bg);
  border-color: #f5b5ae;
}

.stat-number {
  display: block;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.section-header h2 {
  font-size: 24px;
  margin-bottom: 0;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 14px 16px;
  text-decoration: none;
}

.priority-item strong,
.priority-item span {
  display: block;
}

.priority-item span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.priority-item time {
  color: var(--warning);
  font-weight: 800;
  white-space: nowrap;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.unit-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  min-height: 128px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 14px;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.unit-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.unit-card-image {
  width: 88px;
  height: 100px;
  object-fit: contain;
}

.unit-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.unit-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.unit-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}

.unit-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-warning {
  color: var(--warning);
}

.metric-danger,
.text-danger {
  color: var(--danger);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 14px;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 860px;
  min-width: 0;
  overflow: hidden;
  padding: 24px;
  width: 100%;
}

.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.content-panel h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.content-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.auth-panel h1 {
  font-size: 30px;
  line-height: 1.08;
  margin-bottom: 18px;
}

.auth-panel h2 {
  font-size: 22px;
  margin: 28px 0 10px;
}

.auth-panel form + h2,
.auth-panel table + h2 {
  margin-top: 34px;
}

.settings-hero {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  padding: 28px;
  min-width: 0;
}

.settings-hero > *,
.settings-grid > *,
.settings-card,
.settings-card *,
.settings-form-grid > *,
.settings-unit-grid > *,
.settings-unit-card > * {
  min-width: 0;
}

.settings-hero h1 {
  font-size: 36px;
  line-height: 1.06;
  margin-bottom: 8px;
}

.settings-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.settings-plan-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.settings-plan-card span,
.settings-plan-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-plan-card strong {
  color: var(--brand);
  font-size: 24px;
}

.settings-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
  max-width: 100%;
}

.settings-card.wide {
  grid-column: 1 / -1;
}

.settings-card-heading {
  margin-bottom: 16px;
}

.settings-card-heading.row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.settings-heading-actions,
.settings-unit-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.settings-card-heading span {
  color: var(--brand);
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.settings-card-heading h2 {
  font-size: 22px;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.settings-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-unit-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.settings-unit-card {
  align-items: start;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.settings-unit-card strong,
.settings-unit-card span,
.settings-unit-card small {
  display: block;
  overflow-wrap: anywhere;
}

.settings-unit-card span,
.settings-unit-card small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.settings-unit-card .unit-privacy-state {
  color: var(--accent);
  font-weight: 800;
}

.settings-unit-card form,
.settings-unit-actions {
  margin: 0;
  min-width: 0;
}

/* ------------------------- */
/*      Phase 2 Surfaces     */
/* ------------------------- */
.home-hero,
.freezer-hero {
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 30px;
}

.home-hero h1,
.freezer-hero h1 {
  font-size: 38px;
  line-height: 1.04;
  margin-bottom: 10px;
}

.home-hero p,
.freezer-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.home-hero-copy {
  max-width: 680px;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.mobile-dashboard-hero {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 24px;
}

.mobile-dashboard-hero h1 {
  font-size: 32px;
  line-height: 1.08;
  margin-bottom: 8px;
}

.mobile-dashboard-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.mobile-dashboard-hero.compact {
  align-items: center;
  padding: 16px;
}

.mobile-dashboard-hero.compact .eyebrow {
  font-size: 14px;
  margin-bottom: 0;
}

.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.storage-shortcuts {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.storage-shortcuts::-webkit-scrollbar {
  display: none;
}

.storage-shortcut {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  flex: 0 0 98px;
  gap: 6px;
  justify-items: center;
  min-height: 98px;
  padding: 11px 10px;
  text-align: center;
  text-decoration: none;
}

.storage-shortcut:hover {
  border-color: var(--brand);
}

.storage-shortcut img {
  height: 42px;
  object-fit: contain;
  width: 52px;
}

.storage-shortcut .container-kind-icon {
  height: 42px;
  transform: scale(1);
  transform-origin: center;
  width: 42px;
}

.storage-shortcut span:last-child {
  display: -webkit-box;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  max-width: 100%;
  min-height: 14px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

.compact-stats {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-stats span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 10px;
}

.insight-strip,
.freezer-summary {
  display: grid;
  gap: 12px;
}

.insight-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-card,
.freezer-summary > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.insight-card.warning,
.freezer-summary .warning {
  background: var(--warning-bg);
  border-color: var(--warning);
}

.insight-card.danger,
.freezer-summary .danger {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.priority-stack {
  display: grid;
  gap: 8px;
}

.priority-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-height: 76px;
  padding: 10px 12px;
  text-decoration: none;
}

.priority-card.is-warning {
  border-color: var(--warning);
}

.priority-card.is-danger {
  border-color: var(--danger);
}

.priority-dot {
  width: 10px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
}

.priority-card.is-warning .priority-dot {
  background: var(--warning);
}

.priority-card.is-danger .priority-dot {
  background: var(--danger);
}

.priority-copy strong,
.priority-copy span {
  display: block;
}

.priority-copy span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.priority-card time {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  justify-self: end;
  white-space: nowrap;
}

.unit-grid.modern {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.unit-card.modern {
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 154px;
  padding: 0;
  overflow: hidden;
}

.unit-image-panel {
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  min-height: 154px;
}

.unit-card.modern .unit-card-body {
  padding: 16px;
}

.unit-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.freezer-hero {
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: stretch;
}

.freezer-hero-copy {
  padding: 30px;
}

.freezer-hero-visual {
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  min-height: 180px;
  padding: 18px;
}

.freezer-hero-visual img {
  max-width: 118px;
  max-height: 150px;
  object-fit: contain;
}

.freezer-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.freezer-summary strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.freezer-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}

.add-panel-toggle {
  width: 100%;
  min-height: 52px;
  margin-top: 0;
  text-align: center;
}

.add-panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.add-panel.is-open {
  display: block;
}

.add-panel-intro {
  margin-bottom: 22px;
}

.add-panel-intro h2 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.add-panel-intro p {
  color: var(--muted);
  margin-bottom: 0;
}

.inventory-panel {
  max-width: 920px;
}

.container-picker {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px;
}

.container-picker-heading h2 {
  font-size: 24px;
  margin-bottom: 0;
}

.container-picker-group h3 {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.container-choice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.container-choice,
.kind-choice {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0;
  padding: 12px;
}

.container-choice.is-selected,
.container-choice:has(input:checked),
.kind-choice:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.container-choice input,
.kind-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.container-choice strong,
.container-choice small,
.kind-choice strong {
  display: block;
}

.container-choice small {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.kind-choice-field {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.kind-choice-field > span {
  color: var(--muted);
  font-weight: 800;
}

.storage-kind-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.container-kind-icon {
  background: linear-gradient(180deg, #eaf3ff 0%, #b8d0eb 100%);
  border: 2px solid #111;
  border-radius: 8px;
  display: inline-block;
  height: 46px;
  position: relative;
  width: 38px;
}

.container-kind-icon.kind-freezer::after {
  background: #111;
  border-radius: 999px;
  content: "";
  height: 18px;
  position: absolute;
  right: 6px;
  top: 14px;
  width: 4px;
}

.container-kind-icon.kind-fridge {
  border-radius: 8px;
}

.container-kind-icon.kind-fridge::before {
  background: #111;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  top: 50%;
}

.container-kind-icon.kind-fridge::after {
  background: #111;
  border-radius: 999px;
  content: "";
  height: 15px;
  position: absolute;
  right: 6px;
  top: 8px;
  width: 4px;
}

.container-kind-icon.kind-pantry {
  border-radius: 7px 7px 4px 4px;
  height: 34px;
  margin-top: 8px;
  width: 44px;
}

.container-kind-icon.kind-pantry::before {
  background: #111;
  border-radius: 999px;
  content: "";
  height: 4px;
  left: 11px;
  position: absolute;
  right: 11px;
  top: -8px;
}

.container-kind-icon.hero {
  height: 108px;
  width: 82px;
}

.container-kind-icon.hero.kind-pantry {
  height: 76px;
  width: 104px;
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
}

.form-grid label {
  margin-top: 0;
}

.form-grid span,
.search-box span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.barcode-panel {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  margin-top: 2px;
  padding: 14px;
}

.barcode-panel summary {
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  grid-column: 1 / -1;
}

.barcode-copy span,
.barcode-copy small {
  display: block;
}

.barcode-copy small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
}

.barcode-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  min-width: 0;
}

.barcode-actions input {
  margin: 0;
  min-width: 0;
  width: 100%;
}

.barcode-status {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  grid-column: 1 / -1;
  margin: 0;
  min-height: 18px;
}

.barcode-status.is-error {
  color: var(--danger);
}

.barcode-scanner[hidden] {
  display: none;
}

body.scanner-open {
  overflow: hidden;
}

.barcode-scanner {
  align-items: stretch;
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 14px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 80;
}

.barcode-scanner-backdrop {
  background: rgba(5, 9, 14, 0.82);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.barcode-scanner-dialog {
  align-self: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 12px;
  max-width: 520px;
  overflow: hidden;
  padding: 14px;
  position: relative;
  width: min(100%, 520px);
}

.barcode-scanner-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.barcode-scanner-header h2 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
}

.barcode-scanner-header button {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  font-size: 26px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 42px;
}

.barcode-video-frame {
  aspect-ratio: 3 / 4;
  background: #05090e;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.barcode-video-frame video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.barcode-target-frame {
  border: 3px solid var(--brand);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(5, 9, 14, 0.34);
  height: 26%;
  left: 50%;
  max-width: 360px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76%;
}

.barcode-scanner-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  min-height: 20px;
}

.barcode-scanner-status.is-error {
  color: var(--danger);
}

.offline-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 32px auto;
  max-width: 560px;
  padding: 28px;
}

.offline-panel h1 {
  font-size: 34px;
  line-height: 1.05;
  margin-bottom: 12px;
}

.offline-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.autocomplete-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  position: relative;
}

.autocomplete-field input {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.autocomplete-toggle {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--text);
  display: flex;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-height: 54px;
  padding: 0;
}

.autocomplete-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  left: 0;
  max-height: 230px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.autocomplete-menu.is-open {
  display: block;
}

.autocomplete-option {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  min-height: 42px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.autocomplete-option:hover {
  background: var(--surface-muted);
  color: var(--brand);
}

.autocomplete-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 12px;
}

.form-field-primary {
  grid-column: span 2;
}

.quick-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.quick-choice {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  min-height: 48px;
  padding: 10px 14px;
}

.unit-choice-row .quick-choice {
  flex: 1 1 92px;
}

.quick-choice:hover,
.quick-choice.is-selected {
  background: var(--brand);
  color: #f2f5f8;
}

.toolbar-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.toolbar-panel input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.select-all-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-height: 34px;
  margin-top: 0;
  white-space: nowrap;
}

.food-sections {
  display: grid;
  gap: 20px;
}

.food-section {
  display: grid;
  gap: 10px;
}

.food-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.food-section-heading h2 {
  font-size: 22px;
  margin-bottom: 0;
}

.food-section-heading span {
  color: var(--muted);
  font-weight: 800;
}

.food-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.food-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
}

.food-card.status-expired {
  border-left-color: var(--danger);
}

.food-card.status-soon {
  border-left-color: var(--warning);
}

.food-card.status-missing {
  border-left-color: var(--muted);
}

.food-select {
  display: flex;
  align-items: flex-start;
  margin-top: 2px;
}

.food-card-main {
  min-width: 0;
}

.food-card-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.status-pill {
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.status-pill.status-expired {
  color: var(--danger);
  background: var(--danger-bg);
}

.status-pill.status-soon {
  color: var(--warning);
  background: var(--warning-bg);
}

.status-pill.status-missing {
  color: var(--muted);
}

.food-card h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.food-card p {
  color: var(--muted);
  margin-bottom: 4px;
}

.food-date {
  font-size: 13px;
}

.food-card-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.text-action {
  background: transparent;
  color: var(--brand);
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 800;
}

.text-action:hover {
  background: transparent;
  color: var(--brand-strong);
}

.text-action.danger {
  color: var(--danger);
}

.bulk-bar {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 16px;
  padding: 16px;
}

.bulk-bar.is-visible {
  display: block;
}

.bulk-bar textarea {
  width: 100%;
}

.bulk-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-picker {
  margin-top: 18px;
}

.share-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.share-picker-heading h2 {
  margin: 0;
}

.share-picker-heading span {
  color: var(--muted);
  font-weight: 800;
}

.share-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.share-unit-card {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 0;
  min-height: 186px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.share-unit-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.share-unit-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.share-unit-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.share-unit-card input:checked + .share-unit-check {
  background: var(--brand);
  border-color: var(--brand);
}

.share-unit-card input:checked + .share-unit-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.share-unit-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(49, 95, 143, 0.18);
}

.share-unit-card img {
  justify-self: center;
  width: 96px;
  height: 112px;
  object-fit: contain;
}

.share-unit-copy {
  display: grid;
  gap: 3px;
}

.share-unit-copy strong {
  color: var(--text);
}

.share-unit-copy small {
  color: var(--muted);
}

/* ------------------------- */
/*      Form Elements        */
/* ------------------------- */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-sizing: border-box;
  color: var(--text);
}

.add-panel input[type="text"],
.add-panel input[type="number"],
.add-panel input[type="date"],
.add-panel select,
.add-panel textarea {
  min-height: 54px;
  padding: 14px 16px;
}

.add-panel form > button[type="submit"] {
  min-height: 52px;
  padding-left: 18px;
  padding-right: 18px;
}

/* ------------------------- */
/*        Buttons            */
/* ------------------------- */
input[type="submit"],
button {
  background-color: var(--brand);
  color: white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
}

input[type="submit"]:hover,
button:hover {
  background-color: var(--brand-strong);
}

/* Back button */
.back-button {
  margin-top: 20px;
}

/* ------------------------- */
/*        Messages           */
/* ------------------------- */
.message,
.alert {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}
.message.success,
.alert-success {
  background-color: #dff0d8;
  color: #3c763d;
}
.message.danger,
.alert-danger {
  background-color: #f2dede;
  color: #a94442;
}
.message.warning,
.alert-warning {
  background-color: #fcf8e3;
  color: #8a6d3b;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
}

.alert .close {
  background: transparent;
  color: inherit;
  margin: 0;
  padding: 0 4px;
}

/* ------------------------- */
/*        Tables             */
/* ------------------------- */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: var(--surface);
}
table th, table td {
  padding: 8px;
  border: 1px solid var(--border);
  text-align: left;
}

/* Specific table variations */
table.expiring-table th {
  background-color: var(--surface-muted);
}
table.food-table {
  margin-bottom: 10px;
}
/* ------------------------- */
/*       Alerts & Status      */
/* ------------------------- */
.expiring-red {
  background-color: var(--danger-bg);
}
.expiring-yellow {
  background-color: var(--warning-bg);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-wrap table {
  margin-top: 0;
  min-width: 680px;
}

/* ------------------------- */
/*       Storage Unit Grid   */
/* ------------------------- */
.storage-units-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}

.storage-unit-card {
  width: 150px;
  text-align: center;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 4px;
  background-color: var(--surface);
}

.storage-unit-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.storage-unit-name {
  margin-top: 8px;
  font-size: 16px;
  color: var(--text);
}

/* ------------------------- */
/*      Carousel Component   */
/* ------------------------- */
.carousel-container {
  position: relative;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  max-width: 100%;
  min-width: 0;
}

.carousel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.carousel-heading label {
  margin-top: 0;
}

.carousel-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.carousel-container::before,
.carousel-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  z-index: 1;
  pointer-events: none;
}

.carousel-container::before {
  left: 0;
  background: linear-gradient(90deg, var(--surface-muted), transparent);
}

.carousel-container::after {
  right: 0;
  background: linear-gradient(270deg, var(--surface-muted), transparent);
}

#unit-type-options {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 18px 56px;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: none;         /* Firefox */
  -ms-overflow-style: none;        /* IE 10+ */
}
#unit-type-options::-webkit-scrollbar {
  display: none;                   /* Chrome, Safari, Opera */
}

.unit-option {
  flex: 0 0 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  scroll-snap-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  border-radius: 8px;
  min-height: 164px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.unit-option:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}
.unit-option:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.unit-option.selected {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(49, 95, 143, 0.22);
  transform: scale(1.03);
}
.unit-option img {
  width: 96px;
  height: 108px;
  object-fit: contain;
  display: block;
}
.unit-option div {
  margin-top: 5px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

/* Arrow buttons for carousel */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand);
  border: none;
  color: white;
  font-size: 18px;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  opacity: 0.92;
  transition: opacity 0.2s, background 0.2s;
}
.carousel-arrow:hover {
  opacity: 1;
  background: var(--brand-strong);
}
.carousel-arrow.left {
  left: 5px;
}
.carousel-arrow.right {
  right: 5px;
}

/* ------------------------- */
/*     Collapsible Forms     */
/* ------------------------- */
.collapsible {
  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  width: 100%;
  border: 1px solid var(--border);
  text-align: left;
  outline: none;
  font-size: 18px;
  margin-bottom: 10px;
}
.active, .collapsible:hover {
  background-color: var(--surface-muted);
}
.collapsible:after {
  content: "\002B";  /* plus sign */
  float: right;
}
.active:after {
  content: "\2212"; /* minus sign */
}
.content {
  padding: 0 18px 18px;
  display: none;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
}

/* ------------------------- */
/*   Bulk & Autocomplete     */
/* ------------------------- */
.action-buttons {
  margin-top: 10px;
  display: none;
}
.autocomplete-field {
  position: relative;
}

/* ------------------------- */
/*       Shared Units        */
/* ------------------------- */
.shared-unit {
  border: 1px solid var(--border);
  padding: 10px;
  margin-bottom: 15px;
  background-color: var(--surface-muted);
  border-radius: 8px;
}
.shared-unit h4 {
  margin: 0 0 10px 0;
}
.shared-unit ul {
  list-style: none;
  padding-left: 0;
}
.shared-unit li {
  margin-bottom: 5px;
}
.shared-unit button {
  background-color: #d9534f;
  color: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
}
.shared-unit button:hover {
  background-color: #c9302c;
}

/* ------------------------- */
/*        Header Layout      */
/* ------------------------- */
.site-header {
  margin-bottom: 20px;
}

.header-container {
  position: relative;
  /* Using flex only for centering the logo */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.footer-container {
  text-align: center;
  margin-top: 30px;
}

/* Header-left: absolutely positioned in the upper left */
.header-left {
  position: absolute;
  left: 0;
  top: 10%;
  transform: translateY(-50%);
}

/* Menu button styling */
.menu-button img {
  width: 35px;  /* default size for larger screens */
  height: auto;
  cursor: pointer;
}

/* Header-center: contains the logo, centered */
.header-center {
  text-align: center;
}

/* Logo styling */
.logo {
  width: 300px;  /* adjust as needed */
  height: auto;
}

/* Divider below header top row */
.header-divider {
  border: none;
  border-top: 2px solid #000;
  margin: 10px 0;
}

/* Divider above the footer */
.footer-divider {
  border: none;
  border-top: 2px solid #000;
  margin: 10px 0;
}

/* Header info: flash messages and welcome text */
.header-info {
  text-align: center;
}
.welcome-text h2 {
  margin-bottom: 5px;
}

/* ------------------------- */
/*    Responsive Adjustments */
/* ------------------------- */
@media (max-width: 600px) {
  .app-shell {
    padding: 80px 12px 12px;
  }

  .app-header {
    align-items: center;
    flex-direction: row;
    padding: 12px;
    width: 100%;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-panel .carousel-container {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .app-nav {
    width: 100%;
  }

  .brand-logo {
    height: 40px;
    width: 40px;
  }

  .app-menu-panel {
    max-height: 78vh;
    min-width: min(88vw, 330px);
  }

  .carousel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .preference-controls {
    width: 100%;
  }

  .preference-controls form,
  .preference-button {
    flex: 1;
    width: 100%;
  }

  .dashboard-hero,
  .page-title,
  .home-hero,
  .mobile-dashboard-hero,
  .freezer-hero,
  .toolbar-panel,
  .settings-hero {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
    padding: 20px;
  }

  .settings-grid,
  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h1,
  .page-title h1,
  .home-hero h1,
  .mobile-dashboard-hero h1,
  .freezer-hero h1 {
    font-size: 28px;
  }

  .stats-grid,
  .insight-strip,
  .freezer-summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .add-panel {
    padding: 22px;
  }

  .add-panel-intro h2 {
    font-size: 30px;
  }

  .add-panel form > button[type="submit"],
  .inventory-panel form > button[type="submit"] {
    width: 100%;
  }

  .form-field-primary {
    grid-column: auto;
  }

  .barcode-panel,
  .barcode-actions {
    grid-template-columns: 1fr;
  }

  .barcode-actions .quick-choice {
    width: 100%;
  }

  .barcode-scanner {
    padding: 0;
  }

  .barcode-scanner-dialog {
    align-self: stretch;
    border: 0;
    border-radius: 0;
    max-width: none;
    padding: 14px;
    width: 100%;
  }

  .barcode-video-frame {
    aspect-ratio: auto;
    min-height: min(72vh, 680px);
  }

  .home-hero-actions {
    justify-content: stretch;
  }

  .home-hero-actions a,
  .dashboard-quick-actions a {
    width: 100%;
  }

  .home-hero-actions .secondary-action,
  .dashboard-quick-actions .secondary-action {
    width: 100%;
  }

  .dashboard-quick-actions {
    justify-content: stretch;
  }

  .mobile-dashboard-hero.compact {
    gap: 10px;
    padding: 14px;
  }

  .storage-shortcuts {
    justify-content: flex-start;
    margin-inline: -4px;
    padding-inline: 4px;
    width: calc(100% + 8px);
  }

  .storage-shortcut {
    flex-basis: 89px;
    min-height: 89px;
    padding: 10px 8px;
  }

  .storage-shortcut img {
    height: 38px;
    width: 48px;
  }

  .storage-shortcut .container-kind-icon {
    height: 38px;
    width: 38px;
  }

  .subscription-banner {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .global-upgrade-banner {
    align-items: flex-start;
    flex-direction: row;
  }

  .global-upgrade-banner span,
  .global-upgrade-banner strong {
    font-size: 12px;
  }

  .global-add-button {
    bottom: calc(14px + env(safe-area-inset-bottom));
    height: 54px;
    right: 14px;
    width: 54px;
  }

  .storage-kind-row,
  .container-choice-grid {
    grid-template-columns: 1fr;
  }

  .container-picker {
    padding: 14px;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .settings-card-heading.row,
  .settings-unit-card {
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 16px;
  }

  .settings-unit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-plan-card strong {
    font-size: 20px;
  }

  #unit-type-options {
    gap: 10px;
    padding-left: 42px;
    padding-right: 42px;
  }

  .unit-option {
    flex-basis: min(128px, 58vw);
  }

  .settings-card-heading.row {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-heading-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .settings-heading-actions .secondary-action {
    text-align: center;
    width: 100%;
  }

  .freezer-hero {
    align-items: center;
    gap: 0;
    grid-template-columns: minmax(0, 1fr) 84px;
    padding: 0;
  }

  .freezer-hero-copy {
    padding: 16px;
  }

  .freezer-hero .eyebrow {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .freezer-hero h1 {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .freezer-hero p {
    font-size: 14px;
  }

  .freezer-hero-visual {
    background: transparent;
    min-height: 0;
    padding: 12px 14px 12px 0;
  }

  .freezer-hero-visual img {
    max-height: 76px;
    max-width: 64px;
  }

  .freezer-summary {
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .freezer-summary > div {
    padding: 10px 8px;
  }

  .freezer-summary strong {
    font-size: 20px;
  }

  .freezer-summary span {
    font-size: 11px;
    margin-top: 4px;
  }

  .toolbar-panel {
    gap: 10px;
    padding: 10px;
  }

  .select-all-control {
    font-size: 13px;
    min-height: 30px;
    white-space: normal;
  }

  .priority-card {
    gap: 10px;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 9px 10px;
  }

  .priority-dot {
    height: 30px;
    width: 8px;
  }

  .priority-copy strong {
    font-size: 15px;
  }

  .priority-copy span {
    font-size: 12px;
  }

  .priority-card time {
    font-size: 13px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .priority-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .unit-card.modern {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .unit-image-panel {
    min-height: 138px;
  }

  .unit-card-image {
    width: 74px;
    height: 92px;
  }

  .food-card-grid {
    grid-template-columns: 1fr;
  }

  .food-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body {
    background: var(--bg);
  }

  .menu-button img {
    width: 32px;
  }
  .logo {
    width: 80px;
  }
}
