/* FueliQ — iOS-inspired design system */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ios-blue: #007aff;
  --ios-blue-dark: #0062cc;
  --ios-green: #34c759;
  --ios-red: #ff3b30;
  --ios-orange: #ff9500;
  --ios-purple: #af52de;

  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f2f2f7;
  --bg-input: rgba(120, 120, 128, 0.08);

  --label: #000000;
  --label-secondary: rgba(60, 60, 67, 0.6);
  --label-tertiary: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.18);
  --separator-opaque: #c6c6c8;

  --primary: var(--ios-blue);
  --primary-dark: var(--ios-blue-dark);
  --danger: var(--ios-red);
  --card: var(--bg-elevated);
  --border: var(--separator);
  --text: var(--label);
  --muted: var(--label-secondary);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.06);

  --header-height: 52px;
  --tab-bar-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --page-padding: 16px;
  --max-width: 680px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    system-ui, sans-serif;

  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-tertiary: #3a3a3c;
    --bg-input: rgba(118, 118, 128, 0.24);

    --label: #ffffff;
    --label-secondary: rgba(235, 235, 245, 0.6);
    --label-tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --separator-opaque: #38383a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.47;
  font-size: 17px;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.has-tab-bar {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:active {
  opacity: 0.6;
}

/* ── App header ── */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 242, 247, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

@media (prefers-color-scheme: dark) {
  .app-header {
    background: rgba(28, 28, 30, 0.72);
  }
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: calc(var(--max-width) + var(--page-padding) * 2);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
}

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

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  color: var(--primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition);
}

.btn-link:active {
  opacity: 0.5;
}

/* Desktop nav links (hidden on mobile — tab bar takes over) */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.desktop-nav a {
  color: var(--label-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}

.desktop-nav a:hover {
  background: var(--bg-input);
  color: var(--label);
}

.desktop-nav a.active {
  background: var(--primary);
  color: #fff;
}

@media (min-width: 768px) {
  body.has-tab-bar {
    padding-bottom: 0;
  }

  .desktop-nav {
    display: flex;
  }

  .tab-bar {
    display: none !important;
  }

  .header-bar {
    height: 56px;
  }
}

/* ── Bottom tab bar (mobile) ── */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(249, 249, 249, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}

@media (prefers-color-scheme: dark) {
  .tab-bar {
    background: rgba(28, 28, 30, 0.82);
  }
}

.tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--label-secondary);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 0 4px;
  transition: color var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.tab-bar a.active {
  color: var(--primary);
}

.tab-bar a:active {
  opacity: 0.6;
}

.tab-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-bar a.active .tab-icon svg {
  stroke-width: 2;
}

/* ── Main content ── */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px var(--page-padding) 32px;
}

.page-header {
  margin-bottom: 20px;
  padding-top: 4px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--label);
}

.page-header p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header-row > div {
  flex: 1;
  min-width: 0;
}

.settings-fab {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  text-decoration: none;
  transition: transform var(--transition), opacity var(--transition);
  margin-top: 4px;
}

.settings-fab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.settings-fab:active {
  transform: scale(0.94);
  opacity: 0.7;
}

h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  color: var(--label);
}

h3.section-title {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 24px 0 8px;
}

/* ── Auth pages ── */

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 64px);
  padding: 24px var(--page-padding);
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  text-align: center;
}

.auth-logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(145deg, #007aff 0%, #5856d6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.auth-logo-icon svg {
  width: 36px;
  height: 36px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.75;
}

.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.auth-card > h1 {
  display: none;
}

.auth-card > p {
  margin-top: 20px;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
}

.auth-card > p a {
  font-weight: 500;
}

/* ── Forms ── */

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

input,
textarea,
select {
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-family: var(--font);
  width: 100%;
  background: var(--bg-input);
  color: var(--label);
  transition: box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}

input::placeholder,
textarea::placeholder {
  color: var(--label-tertiary);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Buttons ── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font);
  width: 100%;
  margin-top: 4px;
  transition: background var(--transition), transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--primary);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  transition: opacity var(--transition), transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.btn-secondary:active {
  opacity: 0.6;
  transform: scale(0.98);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--danger);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  transition: opacity var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.btn-danger:active {
  opacity: 0.5;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

/* ── Alerts ── */

.error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15px;
}

/* ── Cards & sections ── */

.form-card,
.list-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.grouped-section {
  margin-bottom: 24px;
}

.grouped-header {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 8px 16px;
}

.grouped-list {
  list-style: none;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.grouped-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--separator);
  min-height: 52px;
}

.grouped-item:last-child {
  border-bottom: none;
}

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

.item-title {
  font-size: 17px;
  font-weight: 400;
  color: var(--label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-top: 2px;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
}

.item-meta span {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 6px;
}

.item-action {
  flex-shrink: 0;
}

.item-action form {
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 17px;
}

.empty {
  color: var(--muted);
  font-style: normal;
  font-size: 15px;
  padding: 16px;
  text-align: center;
}

/* ── Grid forms ── */

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.grid-form .btn-primary {
  margin-top: 0;
  grid-column: 1 / -1;
}

@media (min-width: 480px) {
  .grid-form .btn-primary {
    grid-column: auto;
    width: auto;
    min-width: 140px;
  }
}

/* ── Dashboard ── */

.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .dashboard-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.dashboard-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--label);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.dashboard-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-card-icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-card-icon.meals { background: linear-gradient(135deg, #ff9500, #ff6b00); }
.dashboard-card-icon.workouts { background: linear-gradient(135deg, #34c759, #30b350); }
.dashboard-card-icon.recipes { background: linear-gradient(135deg, #007aff, #5856d6); }

.dashboard-card-content h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--label);
}

.dashboard-card-content p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-card-chevron {
  margin-left: auto;
  align-self: center;
  color: var(--label-tertiary);
}

.dashboard-card-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Tables (desktop fallback) ── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--separator);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

td {
  padding: 12px;
  border-bottom: 0.5px solid var(--separator);
  color: var(--label);
}

tr:last-child td {
  border-bottom: none;
}

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ── Recipe page ── */

.ingredient-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
  gap: 0;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--label-secondary);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  -webkit-user-select: none;
  user-select: none;
}

.tab-btn.active {
  background: var(--card);
  color: var(--label);
  box-shadow: var(--shadow-sm);
}

.tab-btn:active {
  opacity: 0.7;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.search-wrap { position: relative; }

.spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid var(--separator);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.search-results,
.selected-ingredients {
  list-style: none;
  margin-top: 8px;
}

.search-results li,
.selected-ingredients li {
  background: var(--card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.search-result-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 17px;
  font-family: var(--font);
  color: var(--label);
  transition: background var(--transition);
}

.search-result-btn:active {
  background: var(--bg-input);
}

.selected-ingredients li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-form input { flex: 1; }
.inline-form .btn-secondary { width: auto; flex-shrink: 0; }

.barcode-actions { margin-bottom: 12px; }

.recipe-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 600px) {
  .recipe-results-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.recipe-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.recipe-card-header h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.badge,
.saved-badge {
  background: rgba(0, 122, 255, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.saved-badge {
  background: rgba(52, 199, 89, 0.15);
  color: var(--ios-green);
}

.macro-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.macro-summary span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-input);
  padding: 4px 10px;
  border-radius: 8px;
}

.recipe-steps {
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 12px;
  color: var(--label);
}

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

.recipe-actions form { margin: 0; }

.recipe-ingredient-list {
  margin-bottom: 12px;
  box-shadow: none;
}

.recipe-ingredient-list .grouped-item {
  min-height: 44px;
  padding: 10px 14px;
}

.recipe-ingredient-list .item-title {
  font-size: 15px;
}

.modal-close-btn {
  width: 100%;
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

.off-attribution {
  margin-top: 32px;
  font-size: 13px;
  color: var(--label-tertiary);
  text-align: center;
}

/* ── Modal ── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

@media (min-width: 480px) {
  .modal {
    align-items: center;
  }
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.portion-options {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.portion-options li + li {
  margin-top: 8px;
}

.portion-option-btn,
.search-result-btn {
  width: 100%;
  text-align: left;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
}

.nevo-attribution,
.retailer-attribution {
  margin-top: 16px;
  font-size: 13px;
  color: var(--label-tertiary);
  text-align: center;
}

.barcode-label {
  margin-top: 16px;
}

#qr-reader { margin: 16px 0; border-radius: var(--radius-md); overflow: hidden; }

.hidden { display: none !important; }

/* ── Settings page ── */

.settings-intro {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.45;
}

.success-banner {
  background: rgba(52, 199, 89, 0.12);
  color: var(--ios-green);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 500;
}

.meal-pref-card {
  margin-bottom: 16px;
}

.meal-pref-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.meal-pref-header h2 {
  margin-bottom: 0;
}

.default-meal-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
  cursor: pointer;
}

.default-meal-radio input {
  width: auto;
  accent-color: var(--primary);
}

.macro-sum {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.macro-sum-over {
  color: var(--danger);
  font-weight: 600;
}

.macro-sum-over .macro-sum-value {
  color: var(--danger);
}

#settings-form > .btn-primary {
  margin-top: 8px;
}

/* ── Utilities ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
