/* ==========================================================================
   Nippon Colours - Design System
   Tokens, base, layout primitives, buttons, forms, modals, cart, toasts.
   Light is the default. Dark applies from the OS preference or the toggle.
   ========================================================================== */

/* ---------- Light tokens (default) ---------- */
:root {
  color-scheme: light;

  --bg: #FFFFFF;
  --bg-sunk: #F5F4F1;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-input: #FFFFFF;
  --surface-hover: #F7F6F3;

  --ink: #12151A;
  --ink-2: #3B424D;
  --ink-3: #5F6672;
  --ink-4: #8A909B;

  --line: #E9E6E0;
  --line-strong: #D5D1C8;
  --line-accent: rgba(138, 104, 42, 0.38);

  --accent: #A07A36;
  --accent-text: #7A5A22;
  --accent-soft: rgba(160, 122, 54, 0.12);
  --accent-strong: #7A5A22;

  --primary: #B38C4A;
  --primary-hover: #9C7A3D;
  --primary-light: #D4B67D;
  --on-primary: #12151A;

  --success: #1E7A4C;
  --success-soft: rgba(30, 122, 76, 0.1);
  --warning: #9A6A00;
  --danger: #B42318;
  --danger-soft: rgba(180, 35, 24, 0.08);
  --info: #1D5FA8;

  --shadow-sm: 0 1px 2px rgba(18, 21, 26, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(18, 21, 26, 0.18);
  --shadow-lg: 0 30px 80px -24px rgba(18, 21, 26, 0.35);
  --overlay: rgba(18, 21, 26, 0.5);

  --font-display: 'Jost', 'Futura', 'Century Gothic', 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  --transition-fast: 150ms cubic-bezier(0.2, 0.7, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Compatibility aliases used by existing templates */
  --bg-main: var(--bg);
  --bg-subtle: var(--bg-sunk);
  --bg-card: var(--surface);
  --bg-card-hover: var(--surface-hover);
  --bg-surface: var(--surface-raised);
  --bg-input: var(--surface-input);
  --border-subtle: var(--line);
  --border-strong: var(--line-strong);
  --gold: var(--accent);
  --gold-light: var(--accent-text);
  --gold-border: var(--line-accent);
  --gold-glow: var(--accent-soft);
  --text-heading: var(--ink);
  --text-main: var(--ink-2);
  --text-body: var(--ink-2);
  --text-muted: var(--ink-3);
  --text-dim: var(--ink-4);
  --font-serif: var(--font-display);
  --font-heading: var(--font-display);
  --font-sans: var(--font-body);

  /* Admin surfaces */
  --admin-bg: var(--bg);
  --admin-sidebar: var(--surface);
  --admin-card: var(--surface);
  --admin-card-hover: var(--surface-hover);
  --admin-border: var(--line);
  --admin-border-focus: var(--accent);
}

/* ---------- Dark tokens: OS preference (unless light is forced) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0B0D11;
    --bg-sunk: #07080B;
    --surface: #13161C;
    --surface-raised: #181C23;
    --surface-input: #0E1116;
    --surface-hover: #1A1E26;

    --ink: #F4F2EC;
    --ink-2: #C9CDD5;
    --ink-3: #A0A7B3;
    --ink-4: #6F7784;

    --line: #242932;
    --line-strong: #323946;
    --line-accent: rgba(201, 169, 110, 0.36);

    --accent: #C9A96E;
    --accent-text: #DDBF86;
    --accent-soft: rgba(201, 169, 110, 0.14);
    --accent-strong: #E9D3A5;

    --primary: #C9A96E;
    --primary-hover: #D9BB85;
    --primary-light: #E6CD98;
    --on-primary: #101216;

    --success: #3FCB8B;
    --success-soft: rgba(63, 203, 139, 0.12);
    --warning: #E7B94C;
    --danger: #F47A70;
    --danger-soft: rgba(244, 122, 112, 0.12);
    --info: #6DB3F2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 14px 40px -14px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
    --overlay: rgba(3, 4, 6, 0.72);
  }
}

/* ---------- Dark tokens: forced by the theme toggle ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0B0D11;
  --bg-sunk: #07080B;
  --surface: #13161C;
  --surface-raised: #181C23;
  --surface-input: #0E1116;
  --surface-hover: #1A1E26;

  --ink: #F4F2EC;
  --ink-2: #C9CDD5;
  --ink-3: #A0A7B3;
  --ink-4: #6F7784;

  --line: #242932;
  --line-strong: #323946;
  --line-accent: rgba(201, 169, 110, 0.36);

  --accent: #C9A96E;
  --accent-text: #DDBF86;
  --accent-soft: rgba(201, 169, 110, 0.14);
  --accent-strong: #E9D3A5;

  --primary: #C9A96E;
  --primary-hover: #D9BB85;
  --primary-light: #E6CD98;
  --on-primary: #101216;

  --success: #3FCB8B;
  --success-soft: rgba(63, 203, 139, 0.12);
  --warning: #E7B94C;
  --danger: #F47A70;
  --danger-soft: rgba(244, 122, 112, 0.12);
  --info: #6DB3F2;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 40px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  --overlay: rgba(3, 4, 6, 0.72);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

body.modal-open {
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

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

a:hover {
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
}

small {
  font-size: 0.8rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-sunk);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
}

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

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* The hidden attribute always wins over a component's own display value */
[hidden] {
  display: none !important;
}

/* ---------- Icons (inline SVG via <use>) ---------- */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
}

.icon-sm {
  width: 0.95em;
  height: 0.95em;
}

/* Theme toggle shows the icon for the theme it will switch to */
.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: inline-block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-icon-sun {
    display: inline-block;
  }
}

.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary,
.btn-accent {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover,
.btn-accent:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-outline:hover {
  border-color: var(--ink);
  background: var(--surface-hover);
  color: var(--ink);
}

.btn-icon-secondary {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line);
  border-radius: var(--radius-full);
}

.btn-icon-secondary:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.btn-sm {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 52px;
  padding: 0.85rem 1.6rem;
  font-size: 0.98rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Form controls ---------- */
.search-input,
.form-input-styled,
.calc-select,
.sort-select,
.promo-input,
.color-input-styled,
.admin-input,
.admin-select,
.admin-textarea,
.pin-input,
.stock-select,
.bulk-input-styled,
.pack-size-select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  background: var(--surface-input);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.93rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea.form-input-styled,
textarea.admin-textarea,
textarea.search-input {
  min-height: 96px;
  resize: vertical;
}

.search-input:focus,
.form-input-styled:focus,
.calc-select:focus,
.sort-select:focus,
.promo-input:focus,
.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus,
.pin-input:focus,
.pack-size-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

::placeholder {
  color: var(--ink-4);
  opacity: 1;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--accent);
}

label {
  color: var(--ink-2);
}

.form-group-line {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group-line > label,
.checkout-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* ---------- Toasts ---------- */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}

.toast-pill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  animation: toast-in 260ms ease-out;
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }

.toast-icon {
  display: inline-flex;
  color: var(--ink-3);
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-error .toast-icon { color: var(--danger); }

.toast-text {
  flex: 1;
  line-height: 1.45;
}

.toast-close {
  background: none;
  border: 0;
  color: var(--ink-4);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.toast-close:hover {
  color: var(--ink);
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms, transform 400ms;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modals ---------- */
.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.modal-overlay.open,
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -46%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-smooth), transform var(--transition-smooth), visibility var(--transition-smooth);
}

.modal-card.open {
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: 1.45rem;
  color: var(--ink);
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* ---------- Cart drawer ---------- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100vh;
  background: var(--surface-raised);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(104%);
  transition: transform var(--transition-smooth);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.cart-drawer-title {
  font-size: 1.35rem;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: var(--bg-sunk);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.cart-item-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
}

.cart-item-variant,
.cart-item-price-unit {
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-top: 2px;
}

.cart-item-custom {
  font-size: 0.78rem;
  color: var(--accent-text);
  margin-top: 4px;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.cart-item-row-total {
  margin-left: auto;
  font-weight: 700;
  color: var(--ink);
}

.cart-item-remove-btn {
  align-self: start;
  background: none;
  border: 0;
  color: var(--ink-4);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.cart-item-remove-btn:hover {
  color: var(--danger);
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.qty-btn:hover {
  border-color: var(--accent);
}

.qty-number {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
}

.cart-empty-view {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-3);
}

.cart-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 6px;
}

.cart-empty-icon .icon {
  width: 28px;
  height: 28px;
}

.cart-empty-view h4 {
  font-size: 1.2rem;
}

.cart-drawer-footer {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.promo-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.promo-input-row .promo-input {
  min-height: 40px;
}

.promo-msg {
  min-height: 1.2em;
  font-size: 0.8rem;
  margin-bottom: 8px;
  color: var(--ink-3);
}

.promo-msg.success { color: var(--success); }
.promo-msg.error { color: var(--danger); }

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 5px 0;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.cart-summary-line span:last-child {
  color: var(--ink-2);
  font-weight: 600;
}

.cart-summary-line.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
  color: var(--ink);
}

.cart-summary-line.total span:last-child {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.cart-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.cart-bounce {
  animation: cart-bounce 500ms ease;
}

@keyframes cart-bounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.08); }
  70% { transform: scale(0.97); }
}

/* ---------- Shared checkout/receipt blocks ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
}

.checkout-grid h4 {
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: var(--ink);
}

.calc-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-opt-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.payment-opt-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.payment-opt-label input {
  margin-top: 4px;
}

.co-summary-box {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.co-summary-box h4 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.co-item-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
  color: var(--ink-2);
}

.co-item-line small {
  color: var(--ink-3);
}

.co-totals-calc {
  margin-top: 14px;
}

.co-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.co-line.discount {
  color: var(--success);
}

.co-line.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--ink);
}

.co-line.total strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
}

.receipt-card {
  text-align: left;
}

.receipt-card h3 {
  font-size: 1.6rem;
  margin: 0.4rem 0 0.35rem;
  text-align: center;
}

.receipt-success-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 0.5rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
}

.receipt-sub {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.receipt-box {
  margin-top: 1rem;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
  color: var(--ink-3);
}

.receipt-row:last-child {
  border-bottom: 0;
}

.receipt-row strong,
.receipt-row span:last-child {
  color: var(--ink);
  text-align: right;
}

.receipt-row.total strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.receipt-dispatch-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-sunk);
  color: var(--ink-3);
  font-size: 0.82rem;
  line-height: 1.5;
}

.receipt-head {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.receipt-panel {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--line-accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 0.86rem;
  color: var(--ink-2);
}

.receipt-panel p {
  margin-top: 6px;
  line-height: 1.5;
}

.receipt-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
}

.receipt-chip {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--line-accent);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-text);
}

.receipt-muted {
  color: var(--ink-3);
}

.receipt-bank {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--line);
}

.receipt-bank div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.receipt-bank div:last-child {
  border-bottom: 0;
}

.receipt-bank span {
  color: var(--ink-3);
}

.receipt-bank strong {
  color: var(--ink);
  text-align: right;
  word-break: break-word;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.receipt-cta {
  margin: 18px 0;
}

.receipt-actions,
.rfq-actions-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.25rem;
}

.rfq-receipt-card h4 {
  font-size: 1.35rem;
  margin: 0.9rem 0 0.4rem;
}

.rfq-receipt-card > p {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.rfq-receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rfq-ref-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.rfq-date {
  font-size: 0.8rem;
  color: var(--ink-4);
}

.rfq-summary-box {
  margin-top: 1rem;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rfq-summary-box .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
  color: var(--ink-3);
}

.rfq-summary-box .row:last-child {
  border-bottom: 0;
}

.rfq-summary-box .row strong,
.rfq-summary-box .row em {
  color: var(--ink);
  text-align: right;
  font-style: normal;
}

/* ---------- Sample box modal ---------- */
.sample-header-sub {
  color: var(--ink-3);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.sample-grid-selection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}

.modal-card #sample-picked-count {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-text);
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .container {
    padding: 0 16px;
  }

  .modal-card {
    padding: 22px 18px;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .calc-input-row {
    grid-template-columns: 1fr;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-pill {
    min-width: 0;
    max-width: none;
  }
}

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