/* ═══════════════════════════════════════════════════════════════════
   Alphabase ColorLab v1.0 — Main Stylesheet
   colorlab.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens — Dark (default) ──────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --surface:     #111111;
  --surface2:    #181818;
  --border:      #222222;
  --border2:     #2d2d2d;
  --text:        #f0ece4;
  --text-muted:  #777;
  --text-dim:    #444;
  --accent:      #e8ff47;
  --accent2:     #ff6b35;
  --grid-line:   rgba(255,255,255,0.025);
  --shadow:      rgba(0,0,0,0.5);
  --radius:      16px;
  --radius-sm:   10px;
  --font-body:   'Inter', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
}

/* ── Design Tokens — Light ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f7f6f2;
  --surface:     #ffffff;
  --surface2:    #f0eeea;
  --border:      #e4e1db;
  --border2:     #d4d0c8;
  --text:        #18160f;
  --text-muted:  #888;
  --text-dim:    #bbb;
  --accent:      #18160f;
  --accent2:     #e05a28;
  --grid-line:   rgba(0,0,0,0.035);
  --shadow:      rgba(0,0,0,0.08);
}

/* ── Body ─────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Grid background ──────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
}

/* Light mode: no grid, pure clean background */
[data-theme="light"] body::before { display: none; }

/* ── Layout wrapper ───────────────────────────────────────────────── */
.wrap {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; padding: 0 32px;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════ */
header {
  padding: 44px 32px 36px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 52px;
  margin-left: -32px; margin-right: -32px;
  position: relative;
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 24px 24px;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* The actual solid color fill — set via JS inline style */
/* header.header-colored uses the exact hex as background */
header.header-colored {
  border-bottom-color: transparent;
}

header > * { position: relative; z-index: 1; }

.logo {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 20px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  /* color is overridden inline by JS for contrast */
  transition: color 0.2s;
}

/* Header text contrast classes — set by JS */
header.header-on-dark .logo,
header.header-on-dark .version-tag,
header.header-on-dark .header-sub-line,
header.header-on-dark .donate-btn,
header.header-on-dark .theme-btn {
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.3) !important;
}

header.header-on-dark .donate-btn svg,
header.header-on-dark .theme-btn svg { stroke: #ffffff !important; }

header.header-on-light .logo,
header.header-on-light .version-tag,
header.header-on-light .header-sub-line,
header.header-on-light .donate-btn,
header.header-on-light .theme-btn {
  color: #111111 !important;
  border-color: rgba(0,0,0,0.18) !important;
}

header.header-on-light .donate-btn svg,
header.header-on-light .theme-btn svg { stroke: #111111 !important; }

.header-sub-line {
  display: flex; align-items: center; gap: 10px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

/* ── Header controls ──────────────────────────────────────────────── */
.header-controls { display: flex; align-items: center; gap: 8px; }

.theme-btn,
.donate-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 10px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  min-height: 42px;
}

.theme-btn:hover { border-color: var(--text-dim); color: var(--text); }
.donate-btn:hover { border-color: rgba(0,112,186,0.6); color: #0070ba; background: rgba(0,112,186,0.06); }

/* ── Version badge ────────────────────────────────────────────────── */
.version-tag {
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}

/* ═══════════════════════════════════════════════════════════════════
   INPUT ZONE
   ═══════════════════════════════════════════════════════════════════ */
.input-zone {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; margin-bottom: 48px; align-items: stretch;
}

.hex-input-wrap {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

[data-theme="light"] .hex-input-wrap {
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.hex-input-wrap:focus-within {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(100,100,100,0.08);
}

[data-theme="light"] .hex-input-wrap:focus-within {
  border-color: #555;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.color-preview-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #ff6b35; flex-shrink: 0;
  transition: background 0.25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hash-label {
  font-family: var(--font-mono);
  font-size: 22px; color: var(--text-dim);
  user-select: none; line-height: 1;
}

#hexInput {
  background: transparent; border: none; outline: none;
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 500;
  color: var(--text); width: 100%;
  letter-spacing: 0.06em;
  caret-color: var(--accent);
}
#hexInput::placeholder { color: var(--text-dim); }

.analyze-btn {
  background: var(--accent); color: #0a0a0a; border: none;
  border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: 0.08em; padding: 0 32px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}

[data-theme="light"] .analyze-btn {
  background: #18160f; color: #f7f6f2;
}

.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,255,71,0.2);
}

[data-theme="light"] .analyze-btn:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.analyze-btn:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════════
   COLOR SPACE BADGE
   ═══════════════════════════════════════════════════════════════════ */
#colorSpaceBadge {
  display: none; align-items: center; gap: 10px;
  margin-bottom: 36px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); letter-spacing: 0.07em;
}
#colorSpaceBadge.visible { display: flex; }

.cs-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ═══════════════════════════════════════════════════════════════════
   COLOR HERO
   ═══════════════════════════════════════════════════════════════════ */
.color-hero {
  display: none; align-items: center; gap: 28px;
  margin-bottom: 48px; padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.3s;
}

[data-theme="light"] .color-hero {
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.color-hero.visible { display: flex; }

.color-hero-swatch {
  width: 96px; height: 96px;
  border-radius: var(--radius-sm); flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  transition: background 0.3s;
}

[data-theme="light"] .color-hero-swatch {
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.color-hero-meta { flex: 1; min-width: 0; }

.color-hero-hex {
  font-family: var(--font-body); font-weight: 100;
  font-size: 44px; letter-spacing: 0.05em;
  margin-bottom: 2px; line-height: 1;
}

#heroName {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.color-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tag {
  font-family: var(--font-mono); font-size: 10px;
  border: 1px solid var(--border2);
  border-radius: 100px; padding: 4px 12px;
  color: var(--text-muted); letter-spacing: 0.05em;
}

.tag.highlight {
  border-color: var(--text-muted);
  color: var(--text);
}

[data-theme="light"] .tag.highlight {
  background: var(--surface2);
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION TITLE
   ═══════════════════════════════════════════════════════════════════ */
.section-title {
  font-family: var(--font-body); font-weight: 500;
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════
   STANDARDS GRID
   ═══════════════════════════════════════════════════════════════════ */
#standardsGrid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px; margin-bottom: 52px;
}
#standardsGrid.visible { display: grid; }

.std-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: border-color 0.18s, transform 0.15s, box-shadow 0.18s;
}

[data-theme="light"] .std-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.std-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

[data-theme="light"] .std-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.std-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--card-accent, var(--accent)); opacity: 0.7;
}

.std-label {
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 9px;
}

.std-value {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--text); font-weight: 500;
  word-break: break-all; line-height: 1.45;
}

.std-desc {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px; line-height: 1.5;
  font-weight: 400;
}

.copy-hint {
  position: absolute; top: 14px; right: 14px;
  font-size: 9px; color: var(--text-dim);
  font-family: var(--font-mono);
  opacity: 0; transition: opacity 0.2s;
  letter-spacing: 0.08em;
}
.std-card:hover .copy-hint { opacity: 1; }

.copied-flash {
  position: absolute; inset: 0;
  background: rgba(100,200,100,0.07);
  border-radius: var(--radius-sm);
  pointer-events: none; opacity: 0;
  transition: opacity 0.35s;
}
.copied-flash.show { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════
   PANTONE SECTION
   ═══════════════════════════════════════════════════════════════════ */
#pantoneSection { display: none; margin-bottom: 52px; }
#pantoneSection.visible { display: block; }

.pantone-grid { display: flex; gap: 14px; flex-wrap: wrap; }

.pantone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  width: 156px; flex-shrink: 0; position: relative;
}

[data-theme="light"] .pantone-card {
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.pantone-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
}

[data-theme="light"] .pantone-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.pantone-swatch { height: 116px; width: 100%; position: relative; }

.pantone-delta {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 8px; border-radius: 100px;
  color: rgba(255,255,255,0.85); letter-spacing: 0.04em;
}

.pantone-info { padding: 13px 15px; }

.pantone-code {
  font-family: var(--font-body); font-weight: 600;
  font-size: 12px; color: var(--text); margin-bottom: 2px;
  letter-spacing: 0.01em;
}

.pantone-name {
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}

.pantone-hex {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
}

/* ── Copyable rows inside pantone card ────────────────────────────── */
.pantone-copyable {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-radius: 5px;
  padding: 3px 5px;
  margin: 0 -5px;
  transition: background 0.15s;
}

.pantone-copyable:hover { background: var(--surface2); }

.copy-micro {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}

.pantone-copyable:hover .copy-micro { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════
   PANTONE DISCLAIMER
   ═══════════════════════════════════════════════════════════════════ */
.pantone-disclaimer {
  margin: 52px 0 0;
  padding: 22px 28px;
  border: 1px solid rgba(200,162,0,0.5);
  border-left: 4px solid #c8a200;
  border-radius: var(--radius);
  background: rgba(200,162,0,0.04);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

[data-theme="light"] .pantone-disclaimer {
  background: #fffdf0;
  border-color: rgba(180,140,0,0.4);
  border-left-color: #b48c00;
}

.disclaimer-icon {
  flex-shrink: 0;
  font-size: 20px;
  margin-top: 1px;
  line-height: 1;
}

.disclaimer-body { flex: 1; min-width: 0; }

.disclaimer-title {
  font-size: 11px;
  font-weight: 600;
  color: #c8a200;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

[data-theme="light"] .disclaimer-title { color: #8a6e00; }

.disclaimer-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.disclaimer-text strong { color: var(--text); font-weight: 500; }

.disclaimer-text a {
  color: #c8a200;
  text-decoration: underline;
  text-decoration-color: rgba(200,162,0,0.35);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

[data-theme="light"] .disclaimer-text a { color: #8a6e00; }
.disclaimer-text a:hover { color: var(--text); text-decoration-color: currentColor; }

.best-match-badge {
  position: absolute; top: 9px; left: 9px;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  padding: 3px 8px; border-radius: 100px;
  letter-spacing: 0.07em; text-transform: uppercase;
}

/* ── Pantone info note ────────────────────────────────────────────── */
.pantone-info-note {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px; /* larger for readability */
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.pantone-info-note svg { flex-shrink: 0; margin-top: 2px; opacity: 0.6; }
.pantone-info-note strong { color: var(--text); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 36px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #1a1a1a; color: #f0ece4;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 13px 22px; border-radius: 14px;
  opacity: 0; transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none; z-index: 9999; white-space: nowrap;
  display: flex; align-items: center; gap: 11px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  max-width: 460px;
}

[data-theme="light"] #toast {
  background: #18160f;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.toast-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: #3ecf8e;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 11px; color: #fff;
  font-weight: 700;
}

.toast-label {
  color: rgba(255,255,255,0.45); font-weight: 400; font-size: 12px; flex-shrink: 0;
}

.toast-val {
  color: #f0ece4; font-weight: 600;
  font-family: var(--font-mono); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; max-width: 280px;
}

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 88px 20px; color: var(--text-dim);
}
.empty-icon { font-size: 44px; margin-bottom: 18px; opacity: 0.25; }
.empty-state p {
  font-size: 14px; color: var(--text-dim);
  font-family: var(--font-mono); letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════════
   LEADS / EMAIL SECTION
   ═══════════════════════════════════════════════════════════════════ */
.leads-section {
  margin: 52px 0 0; padding: 36px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

[data-theme="light"] .leads-section {
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.leads-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 32px; flex-wrap: wrap;
}

.leads-title {
  font-size: 17px; font-weight: 400;
  letter-spacing: 0.01em; margin-bottom: 6px; color: var(--text);
}

.leads-sub {
  font-size: 13px; color: var(--text-muted);
  max-width: 400px; line-height: 1.65; font-weight: 400;
}

.leads-form { display: flex; gap: 8px; align-items: center; }

.leads-form input[type="email"] {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: var(--font-body); font-size: 14px;
  color: var(--text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 240px;
}

.leads-form input[type="email"]::placeholder { color: var(--text-dim); }

.leads-form input[type="email"]:focus {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.leads-form button {
  background: var(--text); color: var(--bg);
  border: none; border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap; letter-spacing: 0.02em;
}
.leads-form button:hover { opacity: 0.82; transform: translateY(-1px); }

.leads-success {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; color: var(--text-muted); font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════
   DONATE MODAL
   ═══════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 22px; padding: 40px;
  width: 400px; max-width: calc(100vw - 40px);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.22s ease;
  position: relative;
}

[data-theme="light"] .modal {
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface2); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer;
  color: var(--text-muted); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.modal-close:hover { background: var(--border2); color: var(--text); }

.modal-title {
  font-size: 20px; font-weight: 300;
  letter-spacing: 0.02em; margin-bottom: 8px; color: var(--text);
}

.modal-sub {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 28px; line-height: 1.6;
}

.amount-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 14px;
}

.amount-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 4px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.15s; text-align: center;
}
.amount-btn:hover,
.amount-btn.active { border-color: #0070ba; color: #0070ba; background: rgba(0,112,186,0.07); }

.custom-amount-wrap {
  display: flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 16px;
  margin-bottom: 20px; transition: border-color 0.2s;
}
.custom-amount-wrap:focus-within { border-color: #0070ba; }

.currency-label {
  font-size: 15px; color: var(--text-muted);
  font-weight: 400; margin-right: 8px;
}

#donateAmount {
  background: transparent; border: none; outline: none;
  font-family: var(--font-body); font-size: 22px; font-weight: 200;
  color: var(--text); padding: 13px 0; width: 100%;
}

.paypal-btn {
  width: 100%; background: #0070ba; color: #fff; border: none;
  border-radius: 12px; padding: 15px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center;
  gap: 9px; letter-spacing: 0.02em;
}
.paypal-btn:hover { background: #005ea6; transform: translateY(-1px); }
.paypal-btn:active { transform: none; }

.modal-note {
  font-size: 11px; color: var(--text-dim);
  text-align: center; margin-top: 13px; letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0; margin-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

footer span {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-dim); letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tablet / large phone (≤ 720px) ──────────────────────────────── */
@media (max-width: 720px) {

  /* Layout */
  .wrap { padding: 0 16px; }

  /* Header */
  header {
    padding: 24px 16px 20px;
    margin-left: -16px; margin-right: -16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    border-radius: 0 0 16px 16px;
  }

  .logo { font-size: 17px; letter-spacing: 0.2em; }

  .header-sub-line { font-size: 11px; }

  .header-controls {
    width: 100%;
    gap: 8px;
  }

  .donate-btn,
  .theme-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13px;
    min-height: 46px;
  }

  /* Input zone */
  .input-zone {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 36px;
  }

  .hex-input-wrap { padding: 14px 16px; gap: 12px; }
  .hash-label { font-size: 20px; }
  #hexInput { font-size: 24px; }
  .color-preview-dot { width: 30px; height: 30px; }

  .analyze-btn {
    padding: 16px;
    font-size: 14px;
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  /* Gamut badge */
  #colorSpaceBadge { font-size: 10px; flex-wrap: wrap; margin-bottom: 28px; }

  /* Color hero */
  .color-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    margin-bottom: 36px;
  }

  .color-hero-swatch {
    width: 100%;
    height: 80px;
    border-radius: 10px;
  }

  .color-hero-hex { font-size: 30px; }
  #heroName { font-size: 13px; }
  .tag { font-size: 9px; padding: 3px 10px; }

  /* Standards grid */
  #standardsGrid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 36px;
  }

  .std-card { padding: 14px 14px; }
  .std-value { font-size: 12px; }
  .std-desc { font-size: 11px; }

  /* Pantone grid — scrollable row */
  .pantone-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 8px;
    /* hide scrollbar but keep scroll */
    scrollbar-width: none;
  }
  .pantone-grid::-webkit-scrollbar { display: none; }

  .pantone-card {
    width: 136px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .pantone-swatch { height: 96px; }
  .pantone-info { padding: 10px 12px; }
  .pantone-code { font-size: 11px; }
  .pantone-name { font-size: 11px; }
  .pantone-hex { font-size: 10px; }

  /* Pantone info note */
  .pantone-info-note { font-size: 12px; padding: 12px 14px; }

  /* Disclaimer */
  .pantone-disclaimer {
    padding: 18px 16px;
    gap: 12px;
    margin-top: 36px;
  }
  .disclaimer-title { font-size: 10px; }
  .disclaimer-text { font-size: 12px; }
  .disclaimer-icon { font-size: 18px; }

  /* Leads */
  .leads-section { padding: 20px 16px; margin-top: 36px; }
  .leads-inner { flex-direction: column; align-items: stretch; gap: 16px; }
  .leads-title { font-size: 15px; }
  .leads-sub { font-size: 12px; max-width: 100%; }
  .leads-form { flex-direction: column; align-items: stretch; gap: 8px; }
  .leads-form input[type="email"] { width: 100%; font-size: 15px; padding: 13px 16px; }
  .leads-form button { justify-content: center; padding: 13px 16px; font-size: 14px; }

  /* Footer */
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px 0;
  }

  /* Modal */
  .modal { padding: 28px 20px; border-radius: 16px; }
  .modal-title { font-size: 17px; }
  .amount-btn { font-size: 13px; padding: 10px 4px; }
  #donateAmount { font-size: 20px; }

  /* Toast */
  #toast {
    bottom: 20px;
    max-width: calc(100vw - 32px);
    font-size: 12px;
    padding: 11px 16px;
  }
  .toast-val { max-width: 180px; }
}

/* ── Small phone (≤ 400px) ────────────────────────────────────────── */
@media (max-width: 400px) {
  #standardsGrid { grid-template-columns: 1fr; }

  .color-hero-hex { font-size: 26px; }

  .logo { font-size: 15px; letter-spacing: 0.15em; }

  .pantone-card { width: 124px; }

  .donate-btn,
  .theme-btn { font-size: 12px; padding: 11px 12px; }
}

/* ── Prevent iOS zoom on input focus ──────────────────────────────── */
@media (max-width: 720px) {
  input, select, textarea {
    font-size: max(16px, 1em) !important;
  }
  /* Exception: keep mono input readable but still ≥16px */
  #hexInput { font-size: 20px !important; }
}
