/* ==========================================================================
   VPlus — Nocturne redesign
   Drop-in replacement for style.css. Same class names and ids as before,
   so no JS besides js/ui/render.js + js/features/stats.js needs to change.
   ========================================================================== */

:root {
  /* ground + text */
  --color-bg: #f4f7fa;
  --color-surface: #ffffff;
  --color-text: #1f2937;

  /* accent ramp */
  --color-accent: #7367f0;
  --color-accent-100: #5b4fcf;
  --color-accent-200: #6b5fd9;
  --color-accent-300: #7367f0;
  --color-accent-500: #7367f0;
  --color-accent-600: #5b4fcf;
  --color-accent-700: #c4b5fd;
  --color-accent-800: #e0dcff;
  --color-accent-900: #f0eeff;

  /* neutral ramp */
  --color-neutral-300: #6b7280;
  --color-neutral-400: #9ca3af;
  --color-neutral-500: #8b8fa3;
  --color-neutral-600: #b5b7c0;
  --color-neutral-700: #d1d5db;
  --color-neutral-800: #e5e7eb;
  --color-neutral-900: #f3f4f6;

  --color-divider: #e5e7eb;
  --color-danger: #ef4444;

  /* legacy aliases — older inline styles in index.html still use these */
  --gray: var(--color-neutral-500);
  --gray-light: var(--color-neutral-800);
  --primary: var(--color-accent);

  --font-heading: "Secular One", "Assistant", system-ui, sans-serif;
  --font-body: "Secular One", "Assistant", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, .1);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
}
html[data-text-scale="2"] { font-size: 112%; }
html[data-text-scale="3"] { font-size: 125%; }
html[data-text-scale="4"] { font-size: 138%; }
html[data-text-scale="5"] { font-size: 150%; }

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f4f7fa 0%, #e8ecf3 100%);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  -webkit-text-size-adjust: 100%;
}

::selection { background: var(--color-accent-800); }

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

.hidden { display: none !important; }

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
}

/* — header — */

.app-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0;
}

.app-logo {
  font: 800 1.3125rem/1 var(--font-heading);
  letter-spacing: .02em;
  direction: ltr;
}
.logo-v { color: #22c55e; }
.logo-plus { color: #4f46e5; }
.logo-pro { font-size: 0.5625rem; color: #9055ff; vertical-align: super; font-weight: 800; }

.app-version {
  font: 400 0.5625rem var(--font-body);
  letter-spacing: normal;
  direction: rtl;
  color: var(--color-neutral-400);
  margin-top: 2px;
}

/* — list name bar (name + count + icon actions) — */

.list-name-bar {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  padding: 14px 16px 0;
}

.lnb-info { min-width: 0; }

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

.list-name-display {
  font: 500 1.3125rem/1.2 var(--font-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.lnb-meta-row {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-count-display {
  font-size: 0.75rem;
  color: var(--color-neutral-400);
}

.shared-indicator {
  display: inline-flex;
  align-items: center;
  flex: none;
  border: none;
  background: rgba(34, 197, 94, .12);
  color: #16a34a;
  border-radius: 999px;
  padding: 1px 8px;
  font: 700 0.625rem var(--font-body);
  cursor: pointer;
}

.owner-indicator {
  display: inline-flex;
  align-items: center;
  flex: none;
  background: rgba(234, 179, 8, .14);
  color: #a16207;
  border-radius: 999px;
  padding: 1px 8px;
  font: 700 0.625rem var(--font-body);
}

.share-code-display {
  margin-top: 8px;
  text-align: center;
  font: 700 1.125rem var(--font-body);
  letter-spacing: 0.15em;
  color: var(--color-accent);
}

.toolbar-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px 0;
}

/* — buttons — */

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-neutral-300);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--color-neutral-900); color: var(--color-text); }
.icon-btn:active { background: var(--color-neutral-800); }

.icon-btn-danger { color: var(--color-danger); }
.icon-btn-danger:hover { background: rgba(239,68,68,.12); color: var(--color-danger); }
.icon-btn.active { background: var(--color-accent-900); color: var(--color-accent-100); }

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font: 400 0.8125rem var(--font-body);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}

.btn-primary {
  background: var(--color-accent);
  border: none;
  color: #ffffff;
  font-weight: 700;
}
.btn-primary:hover { background: var(--color-accent-100); }
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  background: var(--color-neutral-900);
  border: 1px solid var(--color-neutral-700);
  color: var(--color-text);
}
.btn-secondary:hover { background: var(--color-neutral-800); }

.btn-danger {
  background: var(--color-danger);
  border: none;
  color: #ffffff;
  font-weight: 700;
}
.btn-danger:hover { background: #dc2626; }

.link-btn {
  display: inline-block;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--color-accent-300);
  font: 400 0.78125rem var(--font-body);
  cursor: pointer;
}
.link-btn:hover { color: var(--color-accent-200); }

/* — top tab bar (replaces the old bottom bar) — */

.tab-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #7367f0 0%, #9055ff 100%);
  border-radius: 35px 35px 0 0;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, .15);
}

.tab-btn {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: none;
  color: rgba(255, 255, 255, .75);
  font: 700 0.8125rem var(--font-body);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active {
  color: var(--color-accent);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.tab-btn span { display: none; }
.tab-btn .tab-label { display: inline; }

.fab-btn {
  width: 62px;
  height: 62px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(34, 197, 94, .5);
  cursor: pointer;
  animation: fabPulse 2.4s ease-out infinite;
}
.fab-btn:hover { background: #16a34a; }

.fab-btn .plus-icon { position: relative; width: 18px; height: 18px; flex: none; }
.fab-btn .plus-icon::before,
.fab-btn .plus-icon::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 2px;
}
.fab-btn .plus-icon::before { top: 0; bottom: 0; left: 50%; width: 3.5px; margin-left: -1.75px; }
.fab-btn .plus-icon::after { left: 0; right: 0; top: 50%; height: 3.5px; margin-top: -1.75px; }

@keyframes fabPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .65), 0 6px 20px rgba(34, 197, 94, .5); }
  70%  { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0), 0 6px 20px rgba(34, 197, 94, .5); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 6px 20px rgba(34, 197, 94, .5); }
}

/* — search bars — */

.list-search-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 0;
}
.list-search-bar input { flex: 1; }

input[type="text"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="search"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--color-neutral-700);
  border-radius: var(--radius-md);
  background: var(--color-neutral-900);
  color: var(--color-text);
  font: 400 0.8125rem var(--font-body);
  font-family: var(--font-body);
}
input::placeholder, textarea::placeholder { color: var(--color-neutral-600); }
input:focus, select:focus, textarea:focus {
  border-color: var(--color-accent-700);
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}
textarea { resize: vertical; }

label {
  display: block;
  margin: 10px 0 5px;
  font: 400 0.6875rem var(--font-body);
  letter-spacing: .04em;
  color: var(--color-neutral-400);
}

/* — pages — */

.page {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0;
}
.page::-webkit-scrollbar { display: none; }

#pageSummary, #pageStats { padding: 14px 16px 20px; }

/* — budget warning — */

.budget-warning {
  margin: 14px 16px 0;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-accent-700);
  border-radius: var(--radius-md);
  background: var(--color-accent-900);
  font-size: 0.71875rem;
  color: var(--color-accent-100);
}

/* — live share typing indicator — */

.typing-indicator {
  margin: 14px 16px 0;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: rgba(115, 103, 240, .1);
  font-size: 0.6875rem;
  color: var(--color-accent);
}

.new-item-banner {
  margin: 14px 16px 0;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: rgba(115, 103, 240, .1);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* — pill row (edit/stats/delete shortcuts) — */

.pill-row {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(135deg, #f4f7fa 0%, #e8ecf3 100%);
}

.pill {
  flex: 1;
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s;
  font-family: var(--font-body);
}

.pill-purple {
  background: rgba(115, 103, 240, .08);
  border: 1.5px solid rgba(115, 103, 240, .25);
  color: var(--color-accent);
}
.pill-purple:hover { background: rgba(115, 103, 240, .16); }
.pill-purple.active { background: var(--color-accent); color: #fff; }

.pill-red {
  background: rgba(239, 68, 68, .08);
  border: 1.5px solid rgba(239, 68, 68, .25);
  color: var(--color-danger);
}
.pill-red:hover { background: rgba(239, 68, 68, .16); }

#shareListBtn { font-size: 1rem; line-height: 1; }

/* — items — */

.items-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 2px 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
}
.category-header:first-child { padding-top: 0; }
.category-header .cat-sum {
  margin-inline-start: auto;
  font-size: 0.65625rem;
  color: var(--color-neutral-500);
  font-variant-numeric: tabular-nums;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-inline-start: 4px solid var(--cat, transparent);
  background: var(--color-surface);
  border-radius: 25px;
  box-shadow: var(--shadow-sm);
  transition: filter .12s;
}
.item-card:hover { filter: brightness(1.03); }

.item-checkbox {
  width: 19px;
  height: 19px;
  flex: none;
  border: 1px solid var(--color-neutral-700);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s;
}
.item-checkbox:hover { border-color: var(--color-accent); }
.item-checkbox.checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.item-checkbox.checked::after {
  content: "";
  width: 8px;
  height: 4px;
  border: 1.5px solid var(--color-bg);
  border-top: none;
  border-right: none;
  transform: rotate(-45deg) translateY(-1px);
}

.item-main { flex: 1; min-width: 0; cursor: pointer; }

.item-name {
  font-size: 0.84375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  -webkit-touch-callout: none;
}
.item-name.expanded {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.item-meta {
  margin-top: 1px;
  font-size: 0.65625rem;
  color: var(--color-neutral-500);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--color-neutral-900);
  color: var(--color-neutral-300);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.625rem;
  font-weight: 700;
}

.item-line-total {
  font-size: 0.78125rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.item-card.checked { background: var(--color-neutral-900); }
.item-card.checked .item-name {
  text-decoration: line-through;
  color: var(--color-neutral-600);
}
.item-card.checked .item-line-total { color: var(--color-neutral-600); }

html[data-light-view="1"] .item-card {
  background: transparent;
  border-inline-start: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-neutral-700);
  padding: 8px 2px;
}
html[data-light-view="1"] .item-card:hover { filter: none; }
html[data-light-view="1"] .item-card.checked { background: transparent; }

html[data-light-view="1"] .item-checkbox {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  background: none !important;
  font-size: 0.875rem;
  line-height: 1;
}
html[data-light-view="1"] .item-checkbox::before { content: "☐"; }
html[data-light-view="1"] .item-checkbox.checked::before { content: "☑"; color: var(--color-accent); }
html[data-light-view="1"] .item-checkbox.checked::after { content: none; }

html[data-light-view="1"] .qty-chip {
  background: none;
  color: var(--color-neutral-500);
  padding: 0;
  border-radius: 0;
  font-weight: 400;
}

html[data-light-view="1"] .category-header {
  color: var(--color-text) !important;
}

.item-actions button {
  border: none;
  background: none;
  color: var(--color-neutral-600);
  font-size: 0.8125rem;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.item-actions button:hover { color: var(--color-danger); background: var(--color-neutral-900); }

.drag-handle {
  color: var(--color-neutral-600);
  cursor: grab;
  font-size: 0.875rem;
}

.item-checkbox-select {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

/* — totals bar — */

.list-totals-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 11px 16px;
  border-top: 1px solid var(--color-neutral-800);
  background: var(--color-surface);
}

.totals-numbers { display: flex; gap: 15px; }
.totals-numbers > div { display: flex; flex-direction: column; }
.totals-numbers span:not(.totals-label) {
  font-size: 0.78125rem;
  font-variant-numeric: tabular-nums;
}
.totals-numbers > div:last-child span:not(.totals-label) { color: var(--color-accent-300); }

.totals-label {
  font-size: 0.59375rem;
  color: var(--color-neutral-500);
}

.list-totals-bar .btn-danger {
  margin-inline-start: auto;
  padding: 5px 12px;
  font-size: 0.75rem;
}

/* — summary rows (lists + history + מחירון) — */

.summary-container { display: block; }

.summary-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 4px;
  border-top: 1px solid var(--color-neutral-900);
  cursor: pointer;
  transition: background .12s;
}
.summary-row:hover { background: var(--color-neutral-900); }

.summary-name { font-size: 0.84375rem; }
.summary-sub {
  margin-top: 2px;
  font-size: 0.65625rem;
  color: var(--color-neutral-500);
  font-variant-numeric: tabular-nums;
}

.summary-row button {
  border: none;
  background: none;
  color: var(--color-neutral-600);
  font-size: 0.8125rem;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.summary-row button:hover { color: var(--color-danger); background: var(--color-neutral-800); }

.summary-progress {
  width: 70px;
  flex: none;
}
.summary-progress .track {
  height: 2px;
  border-radius: 2px;
  background: var(--color-neutral-800);
  overflow: hidden;
}
.summary-progress .fill {
  height: 2px;
  background: var(--color-accent);
}
.summary-progress .pct {
  margin-top: 5px;
  font-size: 0.59375rem;
  color: var(--color-neutral-500);
  font-variant-numeric: tabular-nums;
}

/* — stats — */

.stat-headline { margin-bottom: 22px; }
.stat-kicker {
  font-size: 0.65625rem;
  letter-spacing: .09em;
  color: var(--color-neutral-400);
}
.stat-value {
  margin-top: 7px;
  font: 500 2.125rem/1.1 var(--font-heading);
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  margin-top: 3px;
  font-size: 0.71875rem;
  color: var(--color-neutral-500);
}

.stat-pair {
  display: flex;
  gap: 24px;
  margin-bottom: 22px;
}
.stat-pair .stat-value { font-size: 1.3125rem; }

.chart-card {
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
}
.chart-card h3 {
  margin: 0 0 10px;
  font: 400 0.65625rem var(--font-body);
  letter-spacing: .09em;
  color: var(--color-neutral-400);
}
.chart-card ul { color: var(--color-text); }
.chart-card li { padding: 3px 0; font-size: 0.78125rem; }

/* — toast — */

.toast-bar {
  position: fixed;
  bottom: 84px;
  right: 16px;
  left: 16px;
  max-width: 398px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  background: var(--color-neutral-900);
  box-shadow: var(--shadow-md);
  font-size: 0.71875rem;
  z-index: 40;
}
.toast-bar.toast-item-shape {
  border: none;
  border-radius: 25px;
  background: #dc2626;
  box-shadow: var(--shadow-md);
  padding: 13px 14px;
  gap: 11px;
}
.toast-item-shape .toast-content { color: #fff; }
.toast-item-shape .toast-undo-btn {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

.toast-content { flex: 1; }
.toast-undo-btn {
  border: none;
  background: none;
  color: var(--color-accent-300);
  font: 400 0.71875rem var(--font-body);
  padding: 2px 8px;
  cursor: pointer;
}

/* — modals — */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 14, .66);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-card::-webkit-scrollbar { display: none; }

/* — scroll hint: a soft fade at the bottom of a scrollable modal card,
     visible only while there's more content below the fold — */
.modal-scroll-hint {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  margin-top: -28px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-surface) 75%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.modal-scroll-hint.visible { opacity: 1; }

#itemModal .modal-card {
  max-height: min(335px, 88vh);
  max-height: min(335px, 88dvh);
}

.modal-card h2 {
  margin: 0 0 14px;
  font: 500 1.0625rem var(--font-heading);
}

.item-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.item-modal-header h2 { margin: 0; }

.modal-card p { font-size: 0.8125rem; line-height: 1.6; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#itemModal .quick-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--color-neutral-900);
  border-radius: 16px;
  background: #f9fafb;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
#itemModal .quick-input::placeholder { color: var(--color-neutral-400); font-weight: 700; }
#itemModal .quick-input:focus {
  border-color: var(--color-accent-700);
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

/* — quick add: name + quantity on one row, rest behind "עוד אפשרויות" — */

.quick-name-qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-name-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.qty-stepper {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 4px;
  border: 2px solid var(--color-neutral-900);
  border-radius: 16px;
  background: #f9fafb;
}
.qty-step-btn {
  width: 26px;
  height: 26px;
  flex: none;
  border: none;
  border-radius: 999px;
  background: var(--color-accent-900);
  color: var(--color-accent-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}
.qty-step-btn:hover { background: var(--color-accent-800); }
.qty-step-btn:active { transform: scale(.94); }
#itemModal .qty-input {
  width: 26px;
  border: none;
  background: none;
  padding: 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
#itemModal .qty-input::-webkit-outer-spin-button,
#itemModal .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.advanced-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent-900);
  color: var(--color-accent-100);
  font: 700 0.75rem var(--font-body);
  cursor: pointer;
}
.advanced-toggle-btn:hover { background: var(--color-accent-800); }
.advanced-toggle-btn i { transition: transform .2s; }
.advanced-toggle-btn.open i { transform: rotate(180deg); }

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.modal-actions button { flex: 1; }

/* — quick add: continuous mode + target list — */

.continuous-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.continuous-toggle-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-neutral-400);
  transition: color .2s;
  white-space: nowrap;
}
.continuous-toggle-wrap.active .continuous-toggle-label { color: var(--color-accent); }

.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-neutral-800);
  border-radius: 999px;
  transition: background .25s;
  cursor: pointer;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .25s, box-shadow .25s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, #7367f0, #9055ff);
}
.toggle-switch input:checked + .toggle-track::after { transform: translateX(-16px); }

.context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 10px;
  background: var(--color-accent-900);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-accent-800);
  position: relative;
}
label[for="itemName"] { margin-top: 4px; }
.context-bar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-neutral-400);
  white-space: nowrap;
  flex: none;
}
.context-list-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  background: #ffffff;
  border: 1.5px solid var(--color-accent-700);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  cursor: pointer;
  transition: background .15s;
  min-width: 0;
}
.context-list-btn:hover { background: var(--color-accent-900); }
.context-list-name {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--color-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.context-list-arrow {
  font-size: 0.65625rem;
  color: var(--color-accent-700);
  flex: none;
  transition: transform .2s;
}
.context-list-btn.open .context-list-arrow { transform: rotate(180deg); }

.list-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline: 0;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-accent-800);
  box-shadow: 0 8px 24px rgba(115, 103, 240, .15);
  z-index: 10;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .28s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
.list-dropdown.open {
  max-height: 280px;
  opacity: 1;
}
.list-dropdown-scroll {
  max-height: 200px;
  overflow-y: auto;
}
.list-dropdown-item {
  padding: 10px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-neutral-900);
  transition: background .12s;
}
.list-dropdown-item:last-child { border-bottom: none; }
.list-dropdown-item:hover { background: var(--color-accent-900); }
.list-dropdown-item.active { background: var(--color-accent-900); color: var(--color-accent); }
.list-dropdown-item.active::before { content: "✓"; font-size: 0.6875rem; }
.list-dropdown-item:not(.active)::before { content: ""; width: 12px; display: inline-block; }
.list-dropdown-new {
  padding: 8px 10px;
  border-top: 2px solid var(--color-accent-800);
  background: #f8f7ff;
}
.list-dropdown-new-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.list-dropdown-new .list-dropdown-new-input {
  flex: 1;
  width: auto;
  border: 1.5px solid var(--color-accent-700);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--color-text);
}
.list-dropdown-new-btn {
  background: linear-gradient(135deg, #7367f0, #9055ff);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.78125rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

/* — autocomplete — */

.autocomplete-list {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  z-index: 5;
  margin-top: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.autocomplete-list > * {
  display: flex;
  justify-content: space-between;
  padding: 7px 11px;
  font-size: 0.78125rem;
  cursor: pointer;
}
.autocomplete-list > *:hover { background: var(--color-neutral-900); }
.autocomplete-item.swiping {
  background: rgba(239, 68, 68, .12);
  color: var(--color-danger);
}

/* — category chips (used by the redesigned item modal) — */

.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--color-neutral-800);
  border-radius: 999px;
  background: transparent;
  color: var(--color-neutral-400);
  font: 400 0.71875rem var(--font-body);
  cursor: pointer;
}
.cat-chip:hover { background: var(--color-neutral-900); }
.cat-chip.active {
  background: var(--color-accent-900);
  border-color: var(--color-accent-700);
  color: var(--color-accent-100);
}

/* — print — */

@media print {
  .app-header, .tab-bar, .toolbar-row, .pill-row, .list-search-bar,
  .list-totals-bar, .toast-bar, .item-actions, .modal-backdrop { display: none !important; }
  html, body { background: #fff; color: #111; }
  #app { height: auto; }
  .page { overflow: visible; height: auto; }
}
