:root {
  color-scheme: light;
  --color-background: #ffffff;
  --color-background-secondary: #f7f9fc;
  --color-surface: #ffffff;
  --color-text-primary: #1f2328;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-divider: #e5e7eb;
  --color-border: #dde2e8;
  --color-accent: #2f80ed;
  --color-accent-pressed: #2468c7;
  --color-accent-light: #eaf3ff;
  --color-alert: #c94a4a;
  --color-alert-light: #fff1f1;
  --color-nav-inactive: #7d838a;
  --color-overlay: rgb(31 35 40 / 34%);
  --color-navigation-background: rgb(255 255 255 / 96%);

  --font-family-system:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic",
    sans-serif;
  --font-size-nav: 11px;
  --font-size-caption: 12px;
  --font-size-section: 13px;
  --font-size-body-small: 14px;
  --font-size-body: 15px;
  --font-size-item: 16px;
  --font-size-screen-title: 22px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Capacitor injects --safe-area-inset-* on Android when native env() values are unavailable. */
  --safe-area-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-area-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --safe-area-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-area-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));

  /* Legacy aliases keep existing components on the shared design tokens. */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --surface-subtle: var(--color-background-secondary);
  --surface-strong: var(--color-background-secondary);
  --text: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --tertiary: var(--color-text-tertiary);
  --line: var(--color-divider);
  --border: var(--color-border);
  --accent: var(--color-accent);
  --accent-strong: var(--color-accent-pressed);
  --accent-soft: var(--color-accent-light);
  --accent-soft-strong: var(--color-accent-light);
  --accent-line: var(--color-accent);
  --danger: var(--color-alert);
  --danger-soft: var(--color-alert-light);
  --danger-line: var(--color-border);
  --warning: var(--color-text-secondary);
  --shadow: none;
  font-family: var(--font-family-system);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
}

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

input,
select,
textarea {
  font-size: 16px;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 920px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(14px, var(--safe-area-top)) 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.header-actions {
  display: flex;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong,
b {
  font-weight: var(--font-weight-semibold);
}

h1 {
  margin-bottom: 0;
  font-size: var(--font-size-screen-title);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
}

.folder-selector {
  min-height: 40px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.folder-selector:active {
  background: var(--accent-soft);
}

.folder-menu-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
  justify-self: center;
}

.folder-menu-icon i,
.folder-menu-icon::before,
.folder-menu-icon::after {
  position: absolute;
  left: 1px;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--color-nav-inactive);
  content: "";
}

.folder-menu-icon::before {
  top: 1px;
}

.folder-menu-icon i {
  top: 6px;
}

.folder-menu-icon::after {
  top: 11px;
}

.folder-selector-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.folder-selector-copy strong {
  overflow: hidden;
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-selector-count {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  min-height: 48px;
  padding: 4px 12px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.summary-tile + .summary-tile {
  border-left: 1px solid var(--line);
}

.summary-action {
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

.summary-action:disabled {
  cursor: default;
  opacity: 1;
  color: var(--color-text-tertiary);
}

.summary-action:disabled span,
.summary-action:disabled strong {
  color: var(--color-text-tertiary);
}

.summary-action:disabled strong {
  font-weight: var(--font-weight-regular);
}

.summary-action:active {
  background: var(--accent-soft);
}

.summary-tile.is-count-bump strong {
  animation: count-bump 0.8s ease;
}

@keyframes count-bump {
  0% {
    transform: scale(1);
    color: var(--text);
  }
  22% {
    transform: scale(1.2);
    color: var(--accent-strong);
  }
  68% {
    transform: scale(1.1);
    color: var(--accent-strong);
  }
  100% {
    transform: scale(1);
    color: var(--text);
  }
}

.summary-tile span {
  display: block;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.summary-tile strong {
  display: block;
  margin-top: 0;
  font-size: 22px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.summary-tile small {
  grid-column: 1 / -1;
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

.summary-tile small[hidden] {
  display: none;
}

.tabs {
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 10px -6px 0;
  padding: 8px 6px max(8px, var(--safe-area-bottom));
  border-top: 1px solid var(--line);
  background: var(--color-navigation-background);
  backdrop-filter: blur(12px);
}

.tab,
.bottom-nav-item {
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-nav-inactive);
  padding: 5px 2px;
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-medium);
}

.tab.is-active,
.bottom-nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.bottom-nav-item.is-active:focus-visible {
  outline: 0;
}

.panel {
  display: none;
  min-height: 0;
}

.panel.is-active {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.list.swipe-in-from-right {
  animation: category-swipe-in-from-right 180ms ease-out;
}

.list.swipe-in-from-left {
  animation: category-swipe-in-from-left 180ms ease-out;
}

@keyframes category-swipe-in-from-right {
  from {
    opacity: 0.72;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes category-swipe-in-from-left {
  from {
    opacity: 0.72;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#stockPanel,
#shoppingPanel,
#purchaseHistoryPanel,
#settingsPanel,
#stockPanel button,
#shoppingPanel button,
#purchaseHistoryPanel button,
#settingsPanel button {
  touch-action: pan-y;
}

.category-tabs,
.category-tabs button,
.purchase-sites,
.purchase-sites button {
  touch-action: pan-x;
}

@media (prefers-reduced-motion: reduce) {
  .list.swipe-in-from-right,
  .list.swipe-in-from-left {
    animation: none;
  }
}

main {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -16px 10px;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-medium);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.category-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.button-pair {
  display: flex;
  gap: 8px;
}

.search-field {
  flex: 1;
}

.share-shopping-button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 0 14px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.share-shopping-button:active {
  background: var(--accent-soft);
}

.share-shopping-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.bottom-nav-item {
  display: grid;
  grid-template-rows: 22px 14px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  line-height: 14px;
}

.bottom-add-item {
  color: var(--accent);
}

.bottom-add-item .nav-icon {
  background: var(--accent);
}

.nav-icon {
  display: block;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask: var(--nav-icon) center / contain no-repeat;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
}

.nav-icon-list {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5.5A1.5 1.5 0 0 1 5.5 4h13A1.5 1.5 0 0 1 20 5.5v2A1.5 1.5 0 0 1 18.5 9h-13A1.5 1.5 0 0 1 4 7.5v-2Zm0 5.5a1.5 1.5 0 0 1 1.5-1.5h13A1.5 1.5 0 0 1 20 11v2a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 13v-2Zm1.5 4A1.5 1.5 0 0 0 4 16.5v2A1.5 1.5 0 0 0 5.5 20h13a1.5 1.5 0 0 0 1.5-1.5v-2a1.5 1.5 0 0 0-1.5-1.5h-13Z'/%3E%3C/svg%3E");
}

.nav-icon-empty {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M7.1 5.45a1.1 1.1 0 0 1 1.55.05l2.88 3.08h.94l2.88-3.08a1.1 1.1 0 0 1 1.6 1.5l-1.48 1.58h3.76c1.1 0 1.93.99 1.75 2.08l-1.35 8.1A2.66 2.66 0 0 1 17 21H7a2.66 2.66 0 0 1-2.63-2.24l-1.35-8.1a1.78 1.78 0 0 1 1.75-2.08h3.76L7.05 7a1.1 1.1 0 0 1 .05-1.55ZM5.6 11l1.18 7.02c.02.12.12.21.24.21h9.96c.12 0 .22-.09.24-.21L18.4 11H5.6Zm3.05 1.8a1 1 0 0 1 1 1v2.1a1 1 0 1 1-2 0v-2.1a1 1 0 0 1 1-1Zm3.35 0a1 1 0 0 1 1 1v2.1a1 1 0 1 1-2 0v-2.1a1 1 0 0 1 1-1Zm3.35 0a1 1 0 0 1 1 1v2.1a1 1 0 1 1-2 0v-2.1a1 1 0 0 1 1-1Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.nav-icon-add {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.5 3h3v7.5H21v3h-7.5V21h-3v-7.5H3v-3h7.5V3Z'/%3E%3C/svg%3E");
}

.nav-icon-history {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M8 2.5a1 1 0 0 1 1 1V5h2V3.5a1 1 0 1 1 2 0V5h2V3.5a1 1 0 1 1 2 0V5h.75A2.25 2.25 0 0 1 20 7.25v11.5A2.25 2.25 0 0 1 17.75 21H6.25A2.25 2.25 0 0 1 4 18.75V7.25A2.25 2.25 0 0 1 6.25 5H7V3.5a1 1 0 0 1 1-1ZM6.5 8v10.5h11V8h-11Zm2 3a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2h-5a1 1 0 0 1-1-1Zm0 4a1 1 0 0 1 1-1h5a1 1 0 1 1 0 2h-5a1 1 0 0 1-1-1Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.nav-icon-settings {
  --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M9.9 2h4.2l.55 2.72c.46.16.9.35 1.32.56l2.32-1.53 2.96 2.96-1.53 2.32c.21.42.4.86.56 1.32L23 10.9v4.2l-2.72.55c-.16.46-.35.9-.56 1.32l1.53 2.32-2.96 2.96-2.32-1.53c-.42.21-.86.4-1.32.56L14.1 24H9.9l-.55-2.72c-.46-.16-.9-.35-1.32-.56l-2.32 1.53-2.96-2.96 1.53-2.32c-.21-.42-.4-.86-.56-1.32L1 15.1v-4.2l2.72-.55c.16-.46.35-.9.56-1.32L2.75 6.71l2.96-2.96 2.32 1.53c.42-.21.86-.4 1.32-.56L9.9 2Zm2.1 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E");
}

label span,
legend {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.list {
  display: grid;
  align-content: start;
  gap: 10px;
}

#stockPanel .list {
  gap: 0;
}

#stockPanel .list:not(.is-empty) {
  border-top: 1px solid var(--line);
}

#stockPanel .list,
#shoppingPanel .list,
#purchaseHistoryPanel .list {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

#stockPanel .list,
#shoppingPanel .list,
#purchaseHistoryPanel .list {
  flex: 1;
}

.shopping-card,
.purchase-history-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.shopping-card,
.purchase-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.stock-list-row.is-stock-preview {
  animation: stock-preview-hold 620ms ease;
}

.shopping-card.is-dismissing,
.purchase-history-card.is-dismissing {
  animation: dismiss-card-right 0.8s ease forwards;
  pointer-events: none;
}

@keyframes dismiss-card-right {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(34px);
  }
}

@keyframes stock-preview-hold {
  0% {
    transform: translateX(0);
  }
  28% {
    transform: translateX(3px);
  }
  100% {
    transform: translateX(0);
  }
}

.purchase-history-card {
  min-height: 90px;
  grid-template-columns: minmax(0, 1fr) 68px;
}

.shopping-card {
  min-height: 90px;
  align-items: stretch;
}

.shopping-main:active,
.purchase-history-main:active {
  background: var(--accent-soft);
}

.shopping-main,
.purchase-history-main {
  padding: 14px;
}

.shopping-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: center;
  overflow: hidden;
  padding: 10px 12px;
}

.purchase-history-main {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
}

.stock-toggle-control,
.purchase-check-control,
.history-delete-button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-width: 92px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.stock-toggle-control {
  min-height: 0;
  height: 100%;
}

.purchase-check-control {
  width: 76px;
  min-width: 76px;
  min-height: 90px;
  height: 100%;
  gap: 5px;
  font-size: var(--font-size-nav);
}

.stock-toggle-control:active,
.purchase-check-control:active,
.history-delete-button:active {
  background: var(--accent-soft);
}

.history-delete-button {
  width: 68px;
  min-width: 68px;
  min-height: 90px;
  border-left-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.toggle-track {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--border);
  transition: background 160ms ease;
}

.toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: none;
  transition: transform 160ms ease;
}

.stock-toggle-control.is-on {
  color: var(--accent);
}

.stock-toggle-control.is-on .toggle-track {
  background: var(--accent);
}

.stock-toggle-control.is-on .toggle-track span {
  transform: translateX(18px);
}

.stock-toggle-control.is-off {
  gap: 2px;
  color: var(--danger);
}

.stock-toggle-control > small {
  color: var(--muted);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-regular);
  line-height: 1;
  white-space: nowrap;
}

.stock-toggle-control:disabled {
  cursor: default;
  opacity: 1;
}

.stock-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  height: 60px;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.stock-list-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 8px 7px 4px;
  text-align: left;
}

.stock-list-main:active {
  background: var(--accent-soft);
}

.stock-list-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.stock-list-name,
.stock-list-memo {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-list-name {
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
}

.stock-list-memo {
  min-height: 14px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.25;
}

.stock-list-memo.is-empty {
  visibility: hidden;
}

.stock-row-status-control {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
}

.stock-row-status-control:active {
  background: var(--accent-soft);
}

.stock-status-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
}

.stock-row-status-control.is-on .stock-status-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.stock-row-status-control.is-on .stock-status-mark::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 4px;
  border-bottom: 1.5px solid var(--surface);
  border-left: 1.5px solid var(--surface);
  transform: rotate(-45deg);
}

.stock-row-status-control.is-off {
  color: var(--danger);
}

.stock-status-label {
  display: grid;
  min-width: 28px;
  height: 18px;
  place-items: center;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  line-height: 18px;
}

.stock-row-status-control:disabled {
  cursor: default;
  opacity: 1;
}

.check-box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.check-box::after {
  content: "";
  width: 11px;
  height: 6px;
  border-bottom: 3px solid var(--accent);
  border-left: 3px solid var(--accent);
  transform: translateY(-1px) rotate(-45deg);
}

.offer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shopping-main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shopping-main h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.purchase-history-main h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.history-card-meta {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.shopping-card-meta {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.shopping-card-meta > span {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-date-button {
  display: inline-flex;
  flex: 0 0 150px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 150px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--accent);
  padding: 0 10px;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.history-date-button span {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-nav);
  line-height: 1;
}

.history-date-button time {
  color: var(--accent);
  font-size: var(--font-size-caption);
  line-height: 1;
  white-space: nowrap;
}

.history-date-button:active {
  background: var(--accent-soft);
}

.alert-date-block {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.alert-date-block span {
  color: var(--muted);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-regular);
}

.alert-date-block time {
  flex: 0 0 auto;
  color: var(--danger);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
}

.alert-date-block.learning-state strong {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
}

.stock-list-row .alert-date-block span {
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-regular);
}

.stock-list-row .alert-date-block time,
.stock-list-row .alert-date-block.learning-state strong {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  border-radius: 8px;
  min-height: 44px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: var(--font-weight-semibold);
}

.primary-button {
  background: var(--accent);
  color: var(--surface);
}

.primary-button:active,
.tab:active {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent);
}

.danger-button {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  width: 44px;
  padding: 0;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
}

.gear-button {
  display: grid;
  place-items: center;
}

.gear-icon {
  width: 30px;
  height: 30px;
  background: var(--text);
  mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M9.9 2h4.2l.55 2.72c.46.16.9.35 1.32.56l2.32-1.53 2.96 2.96-1.53 2.32c.21.42.4.86.56 1.32L23 10.9v4.2l-2.72.55c-.16.46-.35.9-.56 1.32l1.53 2.32-2.96 2.96-2.32-1.53c-.42.21-.86.4-1.32.56L14.1 24H9.9l-.55-2.72c-.46-.16-.9-.35-1.32-.56l-2.32 1.53-2.96-2.96 1.53-2.32c-.21-.42-.4-.86-.56-1.32L1 15.1v-4.2l2.72-.55c.16-.46.35-.9.56-1.32L2.75 6.71l2.96-2.96 2.32 1.53c.42-.21.86-.4 1.32-.56L9.9 2Zm2.1 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  -webkit-mask:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M9.9 2h4.2l.55 2.72c.46.16.9.35 1.32.56l2.32-1.53 2.96 2.96-1.53 2.32c.21.42.4.86.56 1.32L23 10.9v4.2l-2.72.55c-.16.46-.35.9-.56 1.32l1.53 2.32-2.96 2.96-2.32-1.53c-.42.21-.86.4-1.32.56L14.1 24H9.9l-.55-2.72c-.46-.16-.9-.35-1.32-.56l-2.32 1.53-2.96-2.96 1.53-2.32c-.21-.42-.4-.86-.56-1.32L1 15.1v-4.2l2.72-.55c.16-.46.35-.9.56-1.32L2.75 6.71l2.96-2.96 2.32 1.53c.42-.21.86-.4 1.32-.56L9.9 2Zm2.1 7a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.purchase-sites {
  display: flex;
  min-width: 0;
  max-width: 68%;
  gap: 6px;
  margin-top: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.purchase-sites::-webkit-scrollbar {
  display: none;
}

.offer-row {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--accent);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.offer-row:active {
  background: var(--accent-soft);
}

.subtext {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.empty-offers,
.offer-editor-empty {
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
}

.empty-state {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.is-settings-tab .folder-selector,
.is-settings-tab .summary-grid,
.is-settings-tab .inventory-controls {
  display: none;
}

.settings-screen {
  min-height: 0;
}

.settings-screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.settings-screen-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.settings-page {
  min-height: 100%;
}

.settings-screen-header {
  padding: 6px 4px 14px;
}

.settings-screen-header h1 {
  font-size: var(--font-size-screen-title);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.settings-section + .settings-section {
  margin-top: 20px;
}

.settings-section > h2 {
  margin: 0 0 4px;
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-medium);
}

.settings-list,
.settings-detail-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.settings-list-row,
.settings-detail-action-row,
.settings-detail-switch-row,
.settings-about-list > div {
  width: 100%;
  min-height: 56px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.settings-list-row,
.settings-detail-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
  text-align: left;
  text-decoration: none;
}

.settings-list-row {
  min-height: 52px;
  padding: 6px 4px;
}

.settings-list-row + .settings-list-row,
.settings-detail-list > * + * {
  border-top: 1px solid var(--line);
}

.settings-list-row:active,
.settings-detail-action-row:active {
  background: var(--accent-soft);
}

.settings-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-row-copy strong {
  overflow: hidden;
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-row-accessory {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.settings-row-value {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.settings-detail-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 52px;
  margin-bottom: 18px;
  background: var(--bg);
}

.settings-detail-header h2 {
  grid-column: 2;
  text-align: center;
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
}

.settings-back-button {
  grid-column: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
}

.settings-back-button span {
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--text);
  border-left: 2px solid var(--text);
  transform: rotate(45deg);
}

.settings-detail-switch-row {
  cursor: pointer;
}

.settings-detail-switch-row input[role="switch"] {
  position: relative;
  width: 44px;
  height: 26px;
  min-height: 26px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  padding: 0;
}

.settings-detail-switch-row input[role="switch"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
  transition: transform 160ms ease;
}

.settings-detail-switch-row input[role="switch"]:checked {
  background: var(--accent);
}

.settings-detail-switch-row input[role="switch"]:checked::after {
  transform: translateX(18px);
}

.settings-detail-switch-row input[role="switch"]:disabled {
  opacity: 0.45;
}

.settings-detail-action-row {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--accent);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  text-align: left;
}

.file-import-row {
  cursor: pointer;
}

.settings-detail-action-row:disabled {
  color: var(--muted);
  opacity: 0.55;
}

.settings-detail-note {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.55;
}

.settings-support-id {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 4px 0;
  border-top: 1px solid var(--line);
}

.settings-about-list {
  margin: 0;
}

.settings-about-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.settings-about-list > div + div {
  border-top: 1px solid var(--line);
}

.settings-about-list dt {
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
}

.settings-about-list dd {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.settings-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shortcut-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.shortcut-copy-row input {
  min-width: 0;
}

.shortcut-copy-row button {
  min-width: 84px;
  white-space: nowrap;
}

.file-import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-align: center;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.category-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}

.category-suggestion {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  padding: 0 12px;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toggle-row input {
  width: 22px;
  min-height: 22px;
}

.item-dialog,
.settings-dialog,
.default-lead-dialog,
.date-picker-dialog,
.history-dialog,
.summary-dialog,
.folder-dialog,
.pro-dialog,
.onboarding-dialog,
.voice-guide-dialog,
.family-sharing-dialog {
  width: min(calc(100% - 24px), 620px);
  max-height: min(
    86dvh,
    calc(
      100dvh - max(var(--safe-area-top), var(--safe-area-bottom)) -
        max(var(--safe-area-top), var(--safe-area-bottom)) - 24px
    ),
    780px
  );
  overflow: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.item-dialog::backdrop,
.settings-dialog::backdrop,
.default-lead-dialog::backdrop,
.date-picker-dialog::backdrop,
.history-dialog::backdrop,
.summary-dialog::backdrop,
.folder-dialog::backdrop,
.pro-dialog::backdrop,
.onboarding-dialog::backdrop,
.voice-guide-dialog::backdrop,
.family-sharing-dialog::backdrop {
  background: var(--color-overlay);
}

.date-picker-dialog {
  width: min(calc(100% - 16px), 560px);
  max-height: min(
    88dvh,
    calc(
      100dvh - max(var(--safe-area-top), var(--safe-area-bottom)) -
        max(var(--safe-area-top), var(--safe-area-bottom)) - 16px
    ),
    680px
  );
}

.settings-panel,
.history-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pro-dialog {
  width: min(calc(100% - 24px), 480px);
}

.pro-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.pro-panel.is-pro-user .pro-eyebrow,
.pro-panel.is-pro-user .pro-reason,
.pro-panel.is-pro-user .pro-benefits,
.pro-panel.is-pro-user .pro-purchase-button {
  display: none;
}

.pro-panel .dialog-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pro-eyebrow {
  color: var(--accent);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-medium);
}

.pro-reason {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
}

.pro-benefits {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  list-style: none;
}

.pro-benefits li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.pro-benefits li:last-child {
  border-bottom: 0;
}

.pro-benefits li > span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
}

.pro-benefits strong {
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
}

.pro-benefits small {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
}

.pro-current-usage {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.pro-current-usage span {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.pro-current-usage strong {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
}

.pro-purchase-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.5;
  text-align: center;
}

.pro-purchase-button {
  width: 100%;
}

.pro-purchase-button:disabled,
.pro-panel .secondary-button:disabled {
  opacity: 0.5;
}

.pro-note {
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
  text-align: center;
}

.onboarding-dialog {
  width: min(calc(100% - 24px), 500px);
}

.onboarding-panel,
.voice-guide-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.onboarding-heading {
  display: grid;
  gap: 5px;
}

.onboarding-heading > span {
  color: var(--accent);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-medium);
}

.onboarding-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.5;
}

.starter-item-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(46vh, 400px);
  overflow-y: auto;
}

.starter-item-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.starter-item-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.starter-item-option input {
  width: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.starter-item-option > span {
  min-width: 0;
  margin: 0;
}

.starter-item-option strong,
.starter-item-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starter-item-option strong {
  color: var(--text);
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
}

.starter-item-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.onboarding-actions {
  display: grid;
  gap: 8px;
}

.quick-guide-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
}

.quick-guide-list li {
  min-height: 78px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.quick-guide-list li:last-child {
  border-bottom: 0;
}

.guide-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
}

.quick-guide-list strong,
.quick-guide-list small {
  display: block;
}

.quick-guide-list strong {
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.quick-guide-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
}

.voice-guide-dialog {
  width: min(calc(100% - 24px), 520px);
}

.family-sharing-dialog {
  width: min(calc(100% - 24px), 520px);
}

.voice-guide-panel .dialog-header > div {
  min-width: 0;
}

.voice-guide-panel .dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
}

.family-sharing-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.family-sharing-panel .dialog-header > div {
  min-width: 0;
}

.family-sharing-panel .dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
}

.family-unavailable,
.family-invite-notice,
.family-invite-accept {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.family-unavailable[hidden],
.family-invite-notice[hidden],
.family-invite-accept[hidden] {
  display: none;
}

.family-unavailable p,
.family-invite-notice small,
.family-invite-accept small {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.5;
}

.family-invite-actions {
  display: grid;
  gap: 8px;
  margin-top: 5px;
}

.family-store-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.family-auth-section,
.family-account-section,
.family-auth-form,
.family-list-management {
  display: grid;
  gap: 12px;
}

.family-auth-section[hidden],
.family-account-section[hidden] {
  display: none;
}

.family-auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border-radius: 8px;
  background: var(--surface-strong);
}

.family-auth-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

.family-auth-switch button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}

.family-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: var(--font-size-caption);
  line-height: 1.4;
}

.family-text-button {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.family-text-button.is-danger {
  color: var(--danger);
}

.family-privacy-note {
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.5;
}

.family-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.family-account-row > div {
  min-width: 0;
}

.family-account-row span,
.family-account-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-account-row span {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.family-account-row strong {
  margin-top: 3px;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
}

.family-compact-button {
  min-height: 38px;
  padding-inline: 10px;
  font-size: var(--font-size-caption);
}

.family-sync-status {
  min-height: 17px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  text-align: center;
}

.family-list-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.family-list-card.is-shared {
  border-color: var(--accent-line);
}

.family-list-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.family-list-heading > div {
  min-width: 0;
}

.family-list-heading strong,
.family-list-heading small {
  display: block;
}

.family-list-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
}

.family-list-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.family-role-badge,
.shared-list-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.family-member-list {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.family-member-list::-webkit-scrollbar {
  display: none;
}

.family-member-chip {
  flex: 0 0 auto;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.family-member-chip {
  border: 0;
  font-family: inherit;
}

.family-member-chip.is-removable {
  color: var(--danger);
}

.family-list-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.family-list-actions .secondary-button,
.family-list-actions .primary-button {
  min-width: 0;
  padding-inline: 8px;
  font-size: var(--font-size-caption);
}

.family-account-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.voice-guide-steps ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
  counter-reset: voice-step;
}

.voice-guide-steps li {
  position: relative;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px 10px 48px;
  border-bottom: 1px solid var(--line);
  counter-increment: voice-step;
}

.voice-guide-steps li:last-child {
  border-bottom: 0;
}

.voice-guide-steps li::before {
  content: counter(voice-step);
  position: absolute;
  top: 50%;
  left: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-semibold);
  transform: translateY(-50%);
}

.voice-guide-steps strong,
.voice-guide-steps small {
  display: block;
}

.voice-guide-steps strong {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
}

.voice-guide-steps small,
.voice-guide-note {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
}

.folder-dialog {
  inset: 0 auto 0 0;
  width: min(88vw, 360px);
  max-width: 360px;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.folder-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 0;
  padding:
    max(16px, var(--safe-area-top)) max(16px, var(--safe-area-right))
    max(16px, var(--safe-area-bottom)) max(16px, var(--safe-area-left));
}

.folder-drawer-header {
  min-height: 52px;
  margin-bottom: 8px;
}

.folder-panel .dialog-header > div {
  min-width: 0;
}

.folder-panel .dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.folder-list {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.folder-row {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 48px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.folder-row.is-active {
  background: var(--accent-soft);
}

.folder-select-button,
.folder-row-action {
  min-width: 0;
  border: 0;
  background: transparent;
}

.folder-select-button {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
}

.folder-select-button strong {
  overflow: hidden;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-select-button small {
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.folder-row-action {
  border-left: 0;
  color: var(--accent);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.folder-row-action.is-danger {
  color: var(--danger);
}

.folder-row-action:disabled {
  color: var(--muted);
  opacity: 0.42;
}

.folder-edit-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--accent-soft);
}

.folder-edit-row input {
  min-width: 0;
}

.folder-edit-row button {
  min-height: 40px;
  padding: 0 10px;
}

.folder-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 14px;
  border-top: 0;
}

.folder-add-form button {
  min-width: 72px;
}

.summary-dialog-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.summary-dialog-panel .dialog-header > div {
  min-width: 0;
}

.summary-dialog-panel .dialog-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.45;
}

.summary-dialog-list {
  display: grid;
  gap: 8px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
}

.summary-dialog-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.summary-dialog-row > div:first-child {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
}

.summary-dialog-row h3 {
  margin: 0;
  overflow: hidden;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-dialog-row > div:first-child > span {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-stock-toggle {
  width: 84px;
  min-width: 84px;
  min-height: 72px;
  font-size: var(--font-size-caption);
}

.summary-stock-toggle .toggle-track {
  width: 40px;
  height: 24px;
}

.summary-stock-toggle .toggle-track span {
  width: 18px;
  height: 18px;
}

.alert-dialog-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.alert-dialog-row .alert-date-block {
  min-width: 76px;
  align-content: center;
  padding: 10px 12px;
}

.summary-dialog-action {
  width: 100%;
}

.summary-dialog-action:disabled {
  cursor: default;
  opacity: 0.45;
}

.history-content {
  display: grid;
  gap: 14px;
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-summary > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-strong);
}

.history-summary span {
  display: block;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
}

.history-summary strong {
  display: block;
  margin-top: 4px;
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
}

.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.date-picker-panel {
  display: grid;
  gap: 18px;
  padding: 18px 18px 22px;
}

.date-picker-header,
.date-picker-month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.date-picker-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 160px;
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 3px;
}

.date-picker-mode span {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-medium);
}

.date-picker-mode .is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: none;
}

.date-picker-save {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
}

.date-picker-month-row strong {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
}

.date-nav-button {
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
}

.date-nav-button:active {
  background: var(--accent-soft);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.calendar-day,
.calendar-empty {
  display: grid;
  min-height: 44px;
  place-items: center;
}

.calendar-day {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-medium);
}

.calendar-day.is-selected {
  background: var(--accent);
  color: var(--surface);
}

.calendar-day:active {
  background: var(--accent-soft);
}

.calendar-day.is-selected:active {
  background: var(--accent-strong);
}

.history-list time {
  font-weight: var(--font-weight-medium);
}

.history-list span,
.history-help {
  color: var(--muted);
  font-size: var(--font-size-caption);
}

.history-help {
  margin: 0;
  line-height: 1.5;
}

#itemForm {
  display: grid;
  gap: 14px;
  padding: 16px 16px 92px;
}

.dialog-header,
.form-row {
  display: flex;
  gap: 10px;
}

.dialog-header {
  align-items: center;
  justify-content: space-between;
}

.dialog-actions {
  position: sticky;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  margin: 4px -16px -92px;
  padding: 12px 16px calc(12px + var(--safe-area-bottom));
  border-top: 1px solid var(--line);
  background: var(--color-navigation-background);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.dialog-actions button {
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  white-space: nowrap;
  font-size: var(--font-size-section);
}

.dialog-actions button[hidden] {
  display: none;
}

.form-row > label {
  flex: 1;
}

.alert-custom-toggle {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.alert-custom-toggle span {
  margin-bottom: 0;
  color: var(--text);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
}

.alert-custom-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.35;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.alert-custom-fields {
  display: grid;
  gap: 12px;
}

.field-action-button {
  align-self: end;
  min-width: 72px;
  margin-bottom: 28px;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-link-panel {
  display: grid;
  gap: 8px;
}

.search-link-panel > span {
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

.search-link-buttons,
.url-entry {
  display: grid;
  gap: 8px;
}

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

.search-link-button {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--accent);
  font-weight: var(--font-weight-medium);
}

.search-link-button:disabled {
  color: var(--muted);
  opacity: 0.52;
}

.url-entry {
  grid-template-columns: 1fr;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.registered-offers {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.registered-offers-heading {
  display: grid;
  gap: 2px;
}

.registered-offers-heading strong {
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
}

.registered-offers-heading small {
  color: var(--muted);
  font-size: var(--font-size-caption);
  line-height: 1.4;
}

.offer-editor-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.offer-editor-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offer-site-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.offer-editor-row-header strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-offer-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--danger);
  padding: 0 10px;
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-medium);
}

/* Remaining screens share the same quiet list system as inventory and settings. */
.share-shopping-button {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.share-shopping-icon {
  width: 21px;
  height: 21px;
  background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 5 5-1.41 1.41L13 5.83V16h-2V5.83L8.41 8.41 7 7l5-5ZM5 11h2v8h10v-8h2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-8Z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 5 5-1.41 1.41L13 5.83V16h-2V5.83L8.41 8.41 7 7l5-5ZM5 11h2v8h10v-8h2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-8Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#shoppingPanel .list,
#purchaseHistoryPanel .list {
  gap: 0;
}

#shoppingPanel .list:not(.is-empty),
#purchaseHistoryPanel .list:not(.is-empty) {
  border-top: 1px solid var(--line);
}

.shopping-list-row,
.purchase-history-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.shopping-list-row.is-dismissing,
.purchase-history-list-row.is-dismissing {
  animation: dismiss-card-right 0.8s ease forwards;
  pointer-events: none;
}

.shopping-main,
.purchase-history-main {
  align-content: center;
  gap: 5px;
  padding: 9px 4px;
}

.shopping-main h3,
.purchase-history-main h3 {
  font-size: var(--font-size-item);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
}

.shopping-card-meta,
.history-card-meta {
  min-width: 0;
  gap: 10px;
}

.purchase-sites {
  max-width: 72%;
}

.offer-row {
  min-height: 28px;
  padding: 0 9px;
  background: var(--surface);
}

.purchase-check-control,
.history-delete-button {
  align-self: center;
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 38px;
  height: auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0 4px 0 10px;
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-medium);
}

.purchase-check-control {
  color: var(--accent);
}

.purchase-action-mark {
  display: block;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: relative;
}

.purchase-action-mark::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 4px;
  border-bottom: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  content: "";
  transform: rotate(-45deg);
}

.history-delete-button {
  color: var(--danger);
  padding-left: 12px;
}

.history-date-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.history-date-button:active,
.purchase-check-control:active,
.history-delete-button:active {
  background: var(--accent-soft);
}

.purchase-history-main {
  overflow: visible;
}

.purchase-history-main h3 {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.list-empty-state {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 38px 16px;
  text-align: center;
}

.list-empty-state strong {
  color: var(--text);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

.list-empty-state span {
  max-width: 300px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.55;
}

#itemForm {
  --item-editor-padding-left: max(16px, var(--safe-area-left));
  --item-editor-padding-right: max(16px, var(--safe-area-right));
  gap: 18px;
  padding:
    0 var(--item-editor-padding-right) calc(24px + var(--safe-area-bottom))
    var(--item-editor-padding-left);
}

.item-editor-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 56px;
  align-items: center;
  min-height: calc(56px + var(--safe-area-top));
  margin:
    0 calc(0px - var(--item-editor-padding-right)) 0
    calc(0px - var(--item-editor-padding-left));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding:
    var(--safe-area-top) max(16px, var(--safe-area-right)) 0
    max(16px, var(--safe-area-left));
}

.item-editor-header h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--font-size-screen-title);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-header-cancel,
.item-header-save {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: var(--font-size-body-small);
}

.item-header-cancel {
  justify-self: start;
  font-weight: var(--font-weight-regular);
}

.item-header-save {
  justify-self: end;
  font-weight: var(--font-weight-semibold);
}

.item-header-cancel:focus-visible,
.item-header-save:focus-visible {
  outline: 0;
  background: transparent;
}

.bottom-add-item:focus-visible {
  outline: 0;
  background: var(--accent-soft);
}

.item-editor-field > span,
.item-purchase-section > h3,
.url-entry > h4,
.search-link-panel > span {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-medium);
}

.item-purchase-section > h3 {
  margin-bottom: 2px;
}

.item-selection-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.item-selection-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
  gap: 12px;
}

.item-selection-row + .item-selection-row {
  border-top: 1px solid var(--line);
}

.item-selection-label {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
}

.item-selection-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  min-width: 0;
}

.item-selection-control input,
.item-selection-control select {
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--muted);
  text-align: right;
}

.item-selection-chevron,
.row-chevron {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: 24px;
  font-weight: var(--font-weight-regular);
  line-height: 1;
}

.item-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.item-switch-row > span {
  margin: 0;
  color: var(--text);
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
}

.item-switch-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  line-height: 1.35;
}

#itemForm .switch-input {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  min-width: 44px;
  min-height: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  padding: 0;
  transition: background 160ms ease;
}

#itemForm .switch-input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
  transition: transform 160ms ease;
}

#itemForm .switch-input:checked {
  background: var(--accent);
}

#itemForm .switch-input:checked::after {
  transform: translateX(18px);
}

.alert-custom-toggle {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.item-purchase-section,
.search-link-panel,
.url-entry,
.registered-offers {
  display: grid;
  gap: 10px;
}

.search-link-buttons {
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-link-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0 2px 0 4px;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-regular);
  text-align: left;
}

.search-link-button + .search-link-button {
  border-top: 1px solid var(--line);
}

.search-link-button:active {
  background: var(--accent-soft);
}

.url-entry {
  grid-template-columns: 1fr;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 0 0;
}

.url-entry > h4 {
  margin-top: 2px;
}

.registered-offers {
  margin-top: 2px;
  padding-top: 14px;
}

.offer-editor-row {
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0 0;
}

.remove-offer-button {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.continue-adding-row {
  margin-top: 2px;
}

.item-editor-destructive {
  display: flex;
  justify-content: center;
}

.item-delete-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0 14px;
  font-size: var(--font-size-body-small);
  font-weight: var(--font-weight-medium);
}

@media (max-width: 620px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-tile {
    padding: 4px 8px 7px;
  }

  .summary-tile strong {
    font-size: 20px;
  }

  .toolbar,
  .section-heading,
  .button-pair,
  .form-row,
  .field-with-action {
    align-items: stretch;
  }

  .field-with-action {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .field-action-button {
    margin-bottom: 28px;
    padding: 0 8px;
  }

  .button-pair {
    flex-direction: column;
  }

  .search-link-buttons {
    grid-template-columns: 1fr;
  }

  .item-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .dialog-actions button {
    padding: 0 6px;
    font-size: var(--font-size-caption);
  }
}
