:root {
  --ink: #17181d;
  --muted: #68707c;
  --line: #dfe5ea;
  --paper: #fff7fb;
  --surface: #ffffff;
  --accent: #ff6fae;
  --accent-dark: #c93377;
  --secondary: #2ec4b6;
  --warm: #ffd166;
  --card: #ffffff;
  --soft: #fff0f7;
  --green-bg: #e7f6ee;
  --green-text: #16603d;
  --red-bg: #fff0ed;
  --red-text: #9a341f;
  --shadow: 0 16px 36px rgba(64, 40, 68, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12px 12px, color-mix(in srgb, var(--accent) 18%, transparent) 0 2px, transparent 2px 100%),
    linear-gradient(135deg, var(--paper), #f4fffd 48%, #fff8df);
  background-size: 28px 28px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
body.theme-classic { background: var(--paper); }
body.theme-mint {
  background:
    radial-gradient(circle at 12px 12px, rgba(46, 196, 182, 0.16) 0 2px, transparent 2px 100%),
    linear-gradient(135deg, var(--paper), #f5fff7 48%, #fff7e6);
  background-size: 28px 28px, auto;
}
body.theme-sunny {
  background:
    radial-gradient(circle at 12px 12px, rgba(255, 209, 102, 0.24) 0 2px, transparent 2px 100%),
    linear-gradient(135deg, var(--paper), #fff8df 48%, #f3fffb);
  background-size: 28px 28px, auto;
}
button, input, select, textarea { font: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 52px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
body[data-page="order"] .topbar,
body[data-page="owner"] .topbar { display: none; }
.eyebrow { color: var(--accent-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.05; }
h2 { font-size: 24px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; align-items: start; }
.layout-checkout { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin: 0 auto; }
.back-to-cart-btn { margin-bottom: 12px; min-height: 36px; padding: 0 14px; font-weight: 700; }
.summary-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.summary-header h2 { margin: 0; }
.back-icon { color: var(--accent-dark); }

/* Checkout summary: highlighted gradient border (no animation) */
.checkout-summary {
  border: 3px solid transparent;
  border-radius: 10px;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--warm) 55%, var(--secondary)) border-box;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Hero ↔ checkout summary tight */
body[data-checkout-step="checkout"] .order-hero { margin-bottom: 4px; }
body[data-checkout-step="checkout"] .layout-checkout { margin-top: 0; }

/* PDF section heading */
.pdf-flow + .product-section-heading,
h4.product-section-heading + .csv-flow.pdf-flow { margin-top: 4px; }

/* Email message hint */
.hint { display: block; font-size: 11px; line-height: 1.5; margin-top: 4px; color: var(--muted); }
.panel, .summary, .receipt, .admin-panel, .loading-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel, .receipt, .admin-panel, .loading-card { padding: 24px; }
.summary { padding: 20px; position: sticky; top: 18px; display: grid; gap: 16px; }
.summary-note { display: grid; gap: 4px; color: var(--muted); font-size: 14px; }
.summary-note strong { color: var(--accent-dark); margin-right: 2px; }
.checkout-form { display: grid; gap: 12px; }
.checkout-grid { grid-template-columns: 1fr; }
.order-banner {
  width: 100%;
  aspect-ratio: 14 / 3;
  min-height: 156px;
  max-height: 252px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #050505;
  box-shadow: var(--shadow);
  margin-bottom: 0;
}
.order-banner-crop { height: 100%; border: 0; border-radius: 8px; }
.order-hero {
  position: relative;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 0 0 8px 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, #fff), color-mix(in srgb, var(--secondary) 15%, #fff)), var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 8px 88px 14px 18px;
}
.hero-admin-links {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  gap: 8px;
  justify-items: end;
  z-index: 2;
}
.language-switcher {
  position: relative;
  display: grid;
  justify-items: end;
}
.language-trigger {
  min-width: 58px;
  min-height: 32px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(64, 40, 68, .08);
}
.language-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
}
.language-icon svg { width: 16px; height: 16px; }
.language-options {
  position: absolute;
  top: 0;
  right: calc(100% + 6px);
  display: none;
  grid-auto-flow: column;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  padding: 4px;
  box-shadow: var(--shadow);
  z-index: 5;
  white-space: nowrap;
}
.language-switcher.open .language-options { display: grid; }
.language-option {
  min-width: 48px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 0 7px;
}
.language-option.active {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
}
.hero-admin-links .admin-login-link {
  width: 30px;
  height: 30px;
  box-shadow: 0 8px 18px rgba(64, 40, 68, .08);
  background: rgba(255, 255, 255, .72);
  opacity: .7;
}
.hero-admin-links .admin-login-link:hover,
.hero-admin-links .admin-login-link:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, .94);
}
.hero-admin-links .admin-login-link svg { width: 15px; height: 15px; }
.admin-link-stack {
  display: flex;
  flex-direction: row;
  gap: 5px;
  justify-content: flex-end;
}
.hero-badge {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  color: var(--accent-dark);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.hero-copy { display: grid; gap: 6px; max-width: 760px; align-content: start; }
.hero-copy h2 { font-size: clamp(54px, 12vw, 108px); line-height: 1.0; font-weight: 400; letter-spacing: -0.005em; font-family: 'Cherry Bomb One', system-ui, sans-serif; }
.hero-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.hero-title small { display: block; width: 100%; color: var(--accent-dark); font-size: clamp(13px, 2.2vw, 18px); font-weight: 400; opacity: 0.85; font-family: 'Cherry Bomb One', system-ui, sans-serif; }
.order-tabs-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
}
.order-tabs-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}
.order-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.order-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: var(--ink);
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
}
.order-tabs button svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--accent-dark); }
.order-tabs button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
}
.order-tabs button.active svg { color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; color: #2c333d; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.products { display: grid; gap: 10px; margin: 18px 0; }
.products.products-invalid {
  border: 2px solid #e2518f;
  border-radius: 8px;
  background: var(--red-bg);
  padding: 10px;
}
.products.products-invalid .product-row { border-color: #e2518f; }
.product-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 118px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--soft) 72%, #fff));
}
.product-row.sold-out { opacity: .58; }
.product-media, .product-preview {
  height: 128px;
  border: 1px solid color-mix(in srgb, var(--secondary) 24%, var(--line));
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  justify-self: start;
}
div.product-media, div.product-preview {
  width: 128px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, #fff), color-mix(in srgb, var(--secondary) 18%, #fff));
}
.product-media img, .product-preview img { height: 100%; width: auto; display: block; image-orientation: from-image; }
.product-media-button { padding: 0; cursor: zoom-in; }
.product-group { display: grid; gap: 10px; }
.product-group-title { padding-top: 6px; color: var(--accent-dark); font-size: 15px; font-weight: 900; }
.price { color: var(--accent-dark); font-weight: 900; white-space: nowrap; }
.price.discounted { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 2px 0; }
.price-original { color: var(--muted); text-decoration: line-through; font-weight: 700; font-size: 13px; }
.price-current { color: var(--red-text, #c83e62); font-weight: 900; font-size: 16px; }
.discount-tag { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; font-size: 11px; line-height: 1; }
.discount-tag .discount-percent { background: linear-gradient(135deg, #ff5e80, #ff8a5b); color: #fff; padding: 3px 8px; border-radius: 999px; font-weight: 900; letter-spacing: .02em; }
.discount-tag .discount-exclusive { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent-dark); padding: 3px 8px; border-radius: 999px; font-weight: 800; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.product-row.has-discount { border-color: color-mix(in srgb, #ff5e80 32%, var(--line)); box-shadow: 0 1px 0 color-mix(in srgb, #ff5e80 14%, transparent); }
.qty-field { gap: 6px; }
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; width: fit-content; }
.qty-btn { width: 38px; min-height: 38px; border: 0; background: transparent; color: var(--accent-dark); font-size: 18px; font-weight: 900; cursor: pointer; padding: 0; line-height: 1; transition: background 100ms ease, transform 80ms ease; }
.qty-btn:hover:not(:disabled) { background: var(--soft); }
.qty-btn:active:not(:disabled) { transform: scale(0.92); }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-input { width: 46px; min-height: 38px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; padding: 0; text-align: center; font-weight: 800; background: transparent; -moz-appearance: textfield; }
.qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; box-shadow: none; border-color: var(--line); }

/* Compact stepper for order summary */
.qty-stepper-compact { display: inline-flex; align-items: center; }
.qty-stepper-compact .qty-btn { width: 28px; min-height: 28px; font-size: 14px; }
.qty-stepper-compact .qty-display { min-width: 24px; text-align: center; font-weight: 800; font-size: 13px; padding: 0 4px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 28px; }

/* Summary row layout */
.summary-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row-name { font-size: 14px; line-height: 1.3; color: var(--ink); font-weight: 700; }
.summary-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary-row-pricegroup { flex: 1; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 60px; }
.summary-row-original { color: var(--muted); text-decoration: line-through; font-weight: 700; font-size: 11px; }
.summary-row-price { text-align: right; color: var(--accent-dark); font-weight: 900; font-size: 14px; }
.summary-row.has-discount .summary-row-price { color: var(--red-text, #c83e62); }
.summary-row-discount { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; line-height: 1; padding: 2px 0 0; }
.summary-row-discount .discount-percent { background: linear-gradient(135deg, #ff5e80, #ff8a5b); color: #fff; padding: 3px 8px; border-radius: 999px; font-weight: 900; }
.summary-row-discount .discount-exclusive { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent-dark); padding: 3px 8px; border-radius: 999px; font-weight: 800; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.summary-row-remove { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 999px; display: inline-grid; place-items: center; padding: 0; flex: 0 0 auto; transition: background 100ms ease, color 100ms ease; }
.summary-row-remove:hover { background: var(--red-bg); color: var(--red-text); }

/* Bonus banner ✨ */
.bonus-banner { text-align: center; padding: 10px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.bonus-banner.bonus-pending { background: #f4f6f8; color: var(--muted); border: 1px dashed var(--line); font-weight: 700; font-size: 13px; }
.bonus-banner.bonus-pending strong { color: var(--ink); font-weight: 900; }
.bonus-banner.bonus-earned {
  background: linear-gradient(135deg, var(--accent), var(--warm) 50%, var(--secondary));
  background-size: 200% 200%;
  color: #fff;
  border: 0;
  font-size: 15px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
  animation: bonusShimmer 3s linear infinite, bonusPulse 1.8s ease-in-out infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.bonus-banner.bonus-earned .bonus-text { letter-spacing: 0.02em; }
.bonus-banner.bonus-earned .bonus-sparkle { display: inline-block; font-size: 18px; animation: sparkleTwinkle 1.4s ease-in-out infinite; }
.bonus-banner.bonus-earned .bonus-sparkle:last-child { animation-delay: 0.7s; }
@keyframes bonusShimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes bonusPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes sparkleTwinkle { 0%, 100% { transform: rotate(0deg) scale(1); opacity: 1; } 50% { transform: rotate(180deg) scale(1.25); opacity: 0.6; } }
.stock-note { color: var(--muted); font-size: 12px; font-weight: 700; }
.line-item, .admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.line-item:last-child, .admin-row:last-child { border-bottom: 0; }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 16px; font-weight: 900; }
.total strong { font-size: 30px; color: var(--accent-dark); }
.primary-button, .ghost-button, .danger-button, .icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  transition: transform 80ms ease, filter 100ms ease, box-shadow 140ms ease;
}
.primary-button { background: linear-gradient(135deg, var(--accent), var(--secondary)); border-color: transparent; color: #fff; font-weight: 800; }
.danger-button { border-color: #f2c6ba; color: var(--red-text); }
.primary-button:not(:disabled):hover,
.ghost-button:not(:disabled):hover,
.danger-button:not(:disabled):hover,
.icon-button:not(:disabled):hover { filter: brightness(1.05); }
.primary-button:not(:disabled):active,
.ghost-button:not(:disabled):active,
.danger-button:not(:disabled):active,
.icon-button:not(:disabled):active,
.order-tabs button:not(:disabled):active,
.admin-tabs button:not(:disabled):active,
.admin-login-link:active,
.language-trigger:active,
.language-option:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}
.order-tabs button, .admin-tabs button,
.admin-login-link, .language-trigger, .language-option {
  transition: transform 80ms ease, filter 100ms ease;
}
.notice { border: 1px solid var(--line); border-left: 4px solid var(--secondary); border-radius: 8px; background: #fbfcfd; padding: 12px 14px; color: #26303b; font-size: 14px; }
.email-failure-banner { margin: 0 0 14px; }
.email-failure-banner .email-failure-list { margin: 6px 0 6px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.email-failure-banner .email-failure-list code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.error { border-color: #f2c6ba; border-left-color: #c65336; background: var(--red-bg); color: var(--red-text); }
.field-invalid { border-color: #e2518f !important; box-shadow: 0 0 0 3px rgba(226, 81, 143, .16); }
.label-invalid { color: var(--red-text); }
.checkbox-row.field-invalid {
  border: 2px solid #e2518f;
  border-radius: 8px;
  background: var(--red-bg);
  padding: 10px;
}
.empty { border: 1px dashed var(--line); border-radius: 8px; padding: 22px; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
.status { display: inline-flex; justify-content: center; align-items: center; min-height: 30px; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status-paid, .status-picked_up { color: var(--green-text); background: var(--green-bg); }
.status-new, .status-paypal_created, .status-wise_pending { color: #6d4a00; background: #fff6d8; }
.status-error { color: var(--red-text); background: var(--red-bg); }
.wise-payment-panel {
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--secondary) 32%, var(--line));
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.wise-payment-panel h3 { color: var(--accent-dark); }
.wise-reference {
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--soft) 70%, #fff);
}
.wise-pay-button { width: 100%; }
.qr-wrap { display: grid; justify-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#qr-canvas { width: 220px; height: 220px; }
.receipt-actions, .admin-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.receipt-actions { justify-content: center; }
.receipt-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.receipt-header-actions .language-trigger { background: var(--surface); border-color: var(--line); }
.receipt-header-actions .language-options { background: var(--surface); }
.admin-title-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-title-actions { display: flex; align-items: center; gap: 8px; }
.round-icon { width: 44px; height: 44px; border-radius: 999px; padding: 0; flex: 0 0 auto; }
.danger-icon { color: var(--red-text); }
.admin-tools { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, .7fr) auto; gap: 10px; margin-bottom: 16px; }
.admin-login-panel { max-width: 460px; margin: 40px auto; }
.admin-login-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; }
.scan-tools { grid-template-columns: minmax(220px, 1fr) auto auto auto; }
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.owner-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  padding: 0 10px;
}
.admin-tabs button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: #fff;
}
.admin-section, .scan-box, .product-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
  margin: 16px 0;
  display: grid;
  gap: 12px;
}
.step-list { margin: 0; padding-left: 22px; color: var(--muted); font-size: 14px; font-weight: 700; }
.step-list li + li { margin-top: 4px; }
.save-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--secondary) 28%, var(--line));
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 14px;
}
.save-bar .primary-button { min-width: 96px; }
.save-settings-button.saved {
  background: #eef1f4;
  border-color: var(--line);
  color: var(--muted);
}
.help-grid, .settings-grid, .design-grid, .dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.settings-grid, .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help-item, .metric { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 10px; color: var(--muted); font-size: 13px; }
.help-item strong, .metric strong { display: block; color: var(--ink); }
.metric strong { font-size: 24px; color: var(--accent-dark); }
.owner-settings-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(130px, .5fr) minmax(130px, .5fr) minmax(130px, .5fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.unpicked-row { border-left: 4px solid var(--accent); padding-left: 12px; }
.inventory-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.page-preview-editor { display: grid; gap: 14px; }
.banner-editor {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.banner-frame { max-width: 100%; min-width: 0; }
.page-preview-editor { min-width: 0; }
.page-preview-editor > * { max-width: 100%; min-width: 0; box-sizing: border-box; }
.banner-frame { position: relative; }
.banner-upload-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  cursor: pointer;
  z-index: 2;
}
.banner-upload-icon input { display: none; }
.banner-icon-actions {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.banner-crop {
  position: relative;
  width: 100%;
  aspect-ratio: 7 / 1;
  min-height: 92px;
  overflow: hidden;
  border-radius: 8px;
  background: #050505;
  display: grid;
  place-items: center;
}
.banner-crop img {
  position: absolute;
  max-width: none;
  height: auto;
  display: block;
}
.banner-preview {
  border: 1px dashed color-mix(in srgb, var(--secondary) 45%, var(--line));
  color: var(--accent-dark);
  touch-action: none;
  cursor: grab;
}
.banner-preview:active { cursor: grabbing; }
.banner-empty { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; }
.banner-controls { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; }
.preview-hero, .preview-panel, .preview-summary {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.preview-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, #fff), color-mix(in srgb, var(--secondary) 11%, #fff));
}
.preview-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 12px; }
.preview-title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; font-size: clamp(24px, 4vw, 42px); font-weight: 900; line-height: 1.04; }
.preview-title-line input {
  width: min(360px, 100%);
  min-height: 50px;
  padding: 4px 8px;
  font-size: inherit;
  font-weight: inherit;
}
.preview-title-line span { color: var(--accent-dark); font-size: clamp(16px, 2.5vw, 24px); }
.preview-badge-input { width: min(360px, 100%); color: var(--accent-dark); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.preview-heading-input { font-size: 24px; font-weight: 900; }
.preview-button-input { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--secondary)); text-align: center; font-weight: 900; }
.preview-product-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 13px; }
.preview-product-row div { aspect-ratio: 1 / 1; border-radius: 6px; background: var(--soft); }
.compact-design { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-design label { font-size: 12px; gap: 4px; }
.compact-design input[type="color"] { width: 56px; min-height: 32px; padding: 2px; cursor: pointer; }
.compact-design select { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.compact-design .theme-row { display: flex; align-items: center; gap: 6px; width: 100%; }
.compact-design .theme-row select { flex: 1; min-width: 0; }
.compact-design .theme-custom-tag { font-size: 10px; font-weight: 900; color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 14%, #fff); border-radius: 999px; padding: 1px 6px; flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 820px) {
  .design-grid.compact-design { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .design-grid.compact-design label:first-child,
  .design-grid.compact-design label:nth-child(2) { grid-column: 1 / -1; }
  .section-heading { flex-wrap: wrap; gap: 8px; }
  .section-heading > h3 { flex: 1 1 auto; min-width: 0; }
  .section-heading > .primary-button { flex: 0 0 auto; }
  .admin-panel, .admin-section, .product-editor, .scan-box { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .admin-panel form, .admin-section form { min-width: 0; max-width: 100%; }
  .admin-panel form > *, .admin-section form > * { max-width: 100%; min-width: 0; }
  .page-preview-editor { min-width: 0; max-width: 100%; }
  .page-preview-editor > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
}
.csv-flow { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.pdf-flow { grid-template-columns: auto auto 1fr; align-items: center; }
.pdf-flow #pdf-progress { font-size: 12px; }
.bonus-text-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.csv-upload input { margin-top: 7px; }
.product-edit-form { display: grid; grid-template-columns: 96px minmax(110px, .8fr) minmax(150px, 1fr) minmax(220px, 2fr) 84px 80px 76px 76px; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.deploy-version { font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Google Pay button container — Google's createButton fills its host width */
.google-pay-button { margin-top: 10px; min-height: 0; }
.google-pay-button:empty { display: none; }

/* Apple Pay button — Apple's <apple-pay-button> custom element fills width */
.apple-pay-button { margin-top: 10px; min-height: 0; }
.apple-pay-button:empty { display: none; }
.apple-pay-button apple-pay-button {
  --apple-pay-button-width: 100%;
  --apple-pay-button-height: 48px;
  --apple-pay-button-border-radius: 8px;
  width: 100%;
  display: block;
}
.apple-pay-fallback-btn { width: 100%; height: 48px; border-radius: 8px; background: #000; color: #fff; border: 0; font-weight: 700; cursor: pointer; }

/* Staff QR scanner page */
.scanner-panel { max-width: 720px; margin: 0 auto; }
.scanner-lang-row { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.scanner-lang-select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; min-height: 34px; }
.scanner-panel h2 { font-size: 20px; }
.scanner-login { display: grid; gap: 14px; padding: 10px 0; }
.scanner-login label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.scanner-login input { padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; min-height: 48px; }
.scanner-login button { min-height: 48px; }
.scanner-actions { display: flex; align-items: center; gap: 10px; }
.scanner-staff-name { font-size: 13px; }
.scanner-flash { margin-bottom: 12px; border-left-color: #2cb673; background: color-mix(in srgb, #2cb673 12%, #fff); color: #1f8857; font-weight: 700; }
.scanner-pickup-block { display: grid; gap: 4px; flex: 1; min-width: 180px; }
.scanner-pickup-guide { margin: 0; font-size: 12px; color: var(--red-text, #c83e62); font-weight: 700; text-align: center; line-height: 1.4; padding: 4px 8px; }
.scanner-result { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; margin-top: 14px; }
.scanner-result-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 18px; color: #fff; }
.scanner-result-header .tone-icon { font-size: 22px; }
.scanner-result-header.tone-ok { background: linear-gradient(135deg, #2cb673, #4ed395); }
.scanner-result-header.tone-warn { background: linear-gradient(135deg, #c83e62, #ff7474); }
.scanner-result-header.tone-error { background: linear-gradient(135deg, #6c757d, #495057); }
.scanner-result-body { padding: 14px 18px; display: grid; gap: 8px; }
.scanner-result-body .lookup-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.scanner-result-body .lookup-row:last-child { border-bottom: 0; }
.scanner-already-picked-banner { background: color-mix(in srgb, var(--red-bg, #ffe2e2) 95%, transparent); border: 1px solid #f2c6ba; border-radius: 8px; padding: 12px 14px; margin: 6px 0; line-height: 1.6; color: var(--red-text, #c83e62); }
.scanner-items { font-size: 13px; }
.scanner-items summary { cursor: pointer; color: var(--accent-dark); padding: 6px 0; }
.scanner-items ul { margin: 6px 0 0; padding-left: 20px; }
.scanner-result-actions { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfd; flex-wrap: wrap; }
.scanner-pickup-btn { flex: 1; min-width: 180px; min-height: 56px; font-size: 18px; }
@media (max-width: 480px) {
  .scanner-result-header { font-size: 16px; padding: 12px 14px; }
  .scanner-result-body { padding: 12px 14px; }
  .scanner-result-actions { padding: 10px 14px; }
  .scanner-pickup-btn { min-width: 100%; }
}
.new-product-section { border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, #fff); padding: 14px; margin: 18px 0; }
.new-product-section .product-edit-form { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.existing-products-section { margin-top: 8px; }
.product-section-heading { font-size: 14px; font-weight: 800; color: var(--ink); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.product-section-heading.new { color: var(--accent-dark); border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.product-form-error, .csv-form-error { grid-column: 1 / -1; }
.product-image-picker {
  grid-row: span 2;
  position: relative;
  width: 96px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--secondary) 24%, var(--line));
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, #fff), color-mix(in srgb, var(--secondary) 18%, #fff));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-dark);
}
.product-image-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.product-image-picker img { width: 100%; height: 100%; object-fit: contain; image-orientation: from-image; display: block; }
.image-empty-icon, .image-edit-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); }
.image-edit-icon { position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; }
.name-field input { min-width: 0; }
.number-field input { text-align: right; }
.wide { grid-column: span 2; }
.full { grid-column: 1 / -1; }
.enabled-control { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.enabled-control input, .checkbox-row input { width: 18px; min-height: 18px; }
.product-actions { grid-column: 5 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.product-actions button { padding: 0 12px; min-width: 108px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 13px; font-weight: 700; }
.scan-box-compact { max-width: 760px; }
.scanner-frame { display: none; overflow: hidden; border-radius: 8px; border: 1px solid var(--line); background: #101318; aspect-ratio: 16 / 9; max-height: 360px; }
.scanner-frame.active { display: block; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; }
.lookup-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--secondary);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  font-size: 13px;
}
.order-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 900; word-break: break-word; }
.utility-footer { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: flex; gap: 8px; align-items: center; }
.admin-login-link { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent-dark); box-shadow: var(--shadow); display: inline-grid; place-items: center; text-decoration: none; padding: 0; }
.owner-login-link { color: var(--secondary); }
.portal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 22, 28, .42);
}
.portal-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
  position: relative;
}
.portal-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.confirm-dialog .confirm-title { margin: 0; font-size: 17px; font-weight: 900; color: var(--ink); }
.confirm-dialog .confirm-message { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.confirm-dialog .confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-dialog .confirm-actions > button { min-width: 96px; }
@media (max-width: 480px) {
  .confirm-dialog .confirm-actions { flex-direction: column-reverse; }
  .confirm-dialog .confirm-actions > button { width: 100%; }
}
.image-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 10, 14, .78);
}
.image-modal-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: min(86vh, 920px);
  display: grid;
  place-items: center;
}
.image-modal-dialog img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: 8px;
  background: #050505;
  box-shadow: var(--shadow);
}
.image-modal-close {
  background: rgba(255,255,255,.92);
  color: var(--ink);
  z-index: 2;
}
.loading-card { width: min(720px, 100%); margin: 34px auto; text-align: center; }
.loading-dots { display: flex; justify-content: center; gap: 6px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); animation: pulse 900ms ease-in-out infinite alternate; }
.loading-dots span:nth-child(2) { animation-delay: 160ms; background: var(--secondary); }
.loading-dots span:nth-child(3) { animation-delay: 320ms; background: var(--warm); }
@keyframes pulse { from { opacity: .35; transform: translateY(0); } to { opacity: 1; transform: translateY(-4px); } }
button:disabled, input:disabled { cursor: not-allowed; opacity: .52; }

@media (max-width: 820px) {
  .shell { width: min(100% - 24px, 720px); padding-top: 18px; }
  body[data-page="order"] .shell { padding-bottom: 150px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .order-hero { padding: 6px 74px 12px 16px; }
  .hero-admin-links { left: auto; right: 10px; top: 10px; justify-items: end; }
  .language-trigger { min-width: 52px; min-height: 30px; padding: 0 8px; }
  .language-options { min-width: 52px; }
  .language-option { min-width: 42px; }
  .hero-admin-links .admin-login-link { width: 28px; height: 28px; }
  .order-tabs-wrap {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    margin: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
  }
  .order-tabs-label { text-align: center; }
  .order-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; }
  .order-tabs button { min-height: 34px; padding: 0 8px; }
  body[data-page="order"] .utility-footer { bottom: 126px; }
  .layout, .grid, .admin-tools, .dashboard-grid, .finance-grid, .help-grid, .settings-grid, .design-grid, .inventory-row, .preview-layout, .compact-design, .csv-flow, .bonus-text-form, .lookup-result, .banner-controls, .owner-settings-form { grid-template-columns: 1fr; }
  .product-edit-form {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 1fr 1fr;
    grid-template-areas:
      "image name name name name"
      "image category category category category"
      "tab tab price price stock"
      "maxqty maxqty maxqty discount discount"
      "hidden hidden actions actions actions";
    gap: 8px;
    padding: 12px;
    align-items: start;
  }
  .product-edit-form .product-image-picker {
    grid-row: 1 / 3 !important;
    grid-column: 1 / 2 !important;
    width: 100%;
    max-width: 100px;
    height: 100px;
    aspect-ratio: 1;
    align-self: start;
  }
  .product-edit-form .name-field { grid-area: name; }
  .product-edit-form .category-field { grid-area: category; }
  .product-edit-form .tab-field { grid-area: tab; }
  .product-edit-form .price-field { grid-area: price; }
  .product-edit-form .stock-field { grid-area: stock; }
  .product-edit-form .maxqty-field { grid-area: maxqty; }
  .product-edit-form .discount-field { grid-area: discount; }
  .product-edit-form .enabled-control { grid-area: hidden; font-size: 11px; min-height: 32px; min-width: 0; }
  .product-edit-form .product-actions { grid-area: actions; justify-content: flex-end; gap: 6px; min-width: 0; }
  .product-edit-form .product-actions button { min-width: 54px; padding: 0 8px; font-size: 12px; flex: 0 0 auto; }
  .product-edit-form label:not(.product-image-picker):not(.enabled-control) { font-size: 11px; gap: 3px; }
  .product-edit-form input, .product-edit-form select { min-height: 36px; padding: 4px 8px; font-size: 13px; }
  .order-banner { aspect-ratio: 3 / 1; min-height: 110px; max-height: 180px; }
  .admin-tabs { grid-template-columns: 1fr; }
  .order-banner, .banner-crop { min-height: 72px; }
  /* On narrow screens the banner is only ~72px tall, so right-side icons overlap.
     Move the camera (upload) icon to the left so undo/delete keep the right. */
  .banner-upload-icon { left: 10px; right: auto; bottom: 10px; width: 36px; height: 36px; }
  .banner-icon-actions { top: 8px; right: 8px; gap: 6px; }
  .banner-icon-actions .icon-button { width: 32px; height: 32px; min-height: 32px; }
  .banner-icon-actions .icon-button svg { width: 16px; height: 16px; }
  .save-bar { align-items: stretch; flex-direction: column; }
  .summary { position: static; }
  .product-row { grid-template-columns: auto minmax(0, 1fr); }
  .product-media, .product-preview { height: 96px; }
  div.product-media, div.product-preview { width: 96px; }
  .product-row label, .wide, .full { grid-column: 1 / -1; }
  .preview-title-line input { width: 100%; }
  .product-edit-form { align-items: stretch; }
  .product-image-picker { width: 100%; max-width: 180px; }
  .admin-row { grid-template-columns: 1fr; }
}

/* Self-service settings panel (single-tenant deployments) */
.settings-section {
  background: var(--card-color, #fff);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.settings-section h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.settings-section label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #444;
}
.settings-section input[type="text"],
.settings-section input[type="email"],
.settings-section input[type="password"],
.settings-section select,
.settings-section textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.settings-section textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85rem; }
.settings-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.settings-help { background: #fafaf8; border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; border: 1px solid #ececec; }
.settings-help[open] summary { margin-bottom: 8px; }
.settings-help summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.settings-help ol { padding-left: 20px; margin: 8px 0; }
.settings-help li { margin-bottom: 6px; line-height: 1.5; }
.settings-help code { background: #efefef; padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
.settings-danger { border-left: 4px solid #c0392b; }

/* Pills for setup status / configured indicators */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.pill-ready { background: #d8f5d8; color: #1c6c2d; }
.pill-pending { background: #fde9d3; color: #9a4a00; }
.pill-info { background: #e1edf9; color: #1a4677; }

/* Setup completion banner (Phase F) */
.setup-banner { background: linear-gradient(135deg, #fff5e6 0%, #fff 100%); border-left: 4px solid #f0a500; }
.setup-bar { background: #ececec; border-radius: 999px; height: 8px; overflow: hidden; margin: 8px 0 10px; }
.setup-bar-fill { background: #f0a500; height: 100%; transition: width 0.4s ease; }

/* Flash messages */
#settings-flash { margin-bottom: 14px; }
.notice.success { background: #d8f5d8; color: #1c6c2d; padding: 10px 14px; border-radius: 8px; }

/* Instruction step lists with clickable external links and copy hints */
.instruction-steps {
  padding-left: 0;
  list-style: none;
  margin: 8px 0;
}
.instruction-steps > li {
  margin-bottom: 12px;
  padding-left: 28px;
  position: relative;
  line-height: 1.6;
  counter-increment: step-counter;
}
.instruction-steps {
  counter-reset: step-counter;
}
.instruction-steps > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 2px;
  background: #4f6df0;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.instruction-steps .step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eef2ff;
  border: 1px solid #c7d3ff;
  border-radius: 6px;
  color: #1f3da8;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.instruction-steps .step-link:hover,
.instruction-steps .step-link:focus {
  background: #dde6ff;
  border-color: #93a8ff;
  outline: none;
}
.instruction-steps .step-link-icon {
  font-size: 0.85em;
  opacity: 0.7;
}
.instruction-steps .step-detail {
  margin-left: 4px;
}

/* Copy-on-click code blocks (ドメイン名・URL等を1クリックでコピー) */
.copy-target {
  cursor: pointer;
  user-select: all;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f1f1;
  border: 1px dashed #cdcdcd;
  transition: background 0.15s, border-color 0.15s;
}
.copy-target:hover {
  background: #fffbe5;
  border-color: #f0a500;
}
.copy-target.copied {
  background: #d8f5d8 !important;
  border-color: #1c6c2d !important;
  border-style: solid;
}
.copy-target.copied::after {
  content: " ✓ Copied";
  color: #1c6c2d;
  font-weight: 600;
  font-size: 0.85em;
}

/* Bonus tier editor rows */
.bonus-tier-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}
.bonus-tier-row label {
  margin-bottom: 0 !important;
}
.bonus-tier-remove {
  margin-bottom: 0;
}
.bonus-tier-actions {
  margin-top: 12px;
}
.bonus-preview {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e3e8;
}
.bonus-preview ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.bonus-preview li { margin-bottom: 4px; }

/* Multi-tier bonus banner rows on the customer page */
.bonus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.bonus-row-earned { color: #1c6c2d; font-weight: 600; }
.bonus-row-pending { color: #555; }
.bonus-row + .bonus-row {
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

/* Responsive: stack tier row on small screens */
@media (max-width: 600px) {
  .bonus-tier-row {
    grid-template-columns: 1fr;
  }
  .bonus-tier-remove {
    justify-self: end;
  }
}

/* Setup banner pending chips: clickable shortcuts to each section */
.setup-pending-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.pill-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.pill.pill-link:hover, .pill.pill-link:focus {
  background: #fbd9a8;
  outline: none;
}
.pill.pill-link:active {
  transform: translateY(1px);
}
