/* ================================================================
   huecards — index.css
   Spacing scale: 4 8 12 16 24 32 48 64 96px
   Type scale: Fraunces (display), system-ui (body/UI)
================================================================ */

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

:root {
  --bg:         #ffffff;
  --surface:    #F7F5F2;
  --border:     #E8E3DB;
  --border-hi:  #BFB8AF;
  --text:       #1C1917;
  --text-mid:   #6B6460;
  --text-faint: #C4BCB5;

  /* palette circle size */
  --circle: 56px;
  --gap:    16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ================================================================
   HAMBURGER — fixed top-right, adapts to bg
================================================================ */
.menu-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.3s;
}
.menu-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.18s, background 0.3s;
  transform-origin: center;
}
.menu-btn.dark {
  background: rgba(0,0,0,0.06);
}
.menu-btn.dark span {
  background: rgba(28,25,23,0.6);
}
.menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ================================================================
   ABOUT PANEL
================================================================ */
.about-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 94vw);
  background: linear-gradient(170deg, #0f0524 0%, #1c0848 60%, #2a0d5e 100%);
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 250;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.about-panel.open { transform: translateX(0); }

.about-inner {
  padding: 64px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.6);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.about-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

.about-wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.06em;
}

.about-body {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
}
.about-body em {
  color: rgba(255,255,255,0.88);
  font-style: normal;
}

.about-quote {
  border-left: 2px solid rgba(255,255,255,0.18);
  padding-left: 16px;
  font-style: italic;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,0.8);
}

.about-rule {
  height: 1px;
  background: rgba(255,255,255,0.1);
  border: none;
}

.about-swatches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.about-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.48);
}
.about-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.about-make-link {
  display: inline-block;
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  letter-spacing: 0.06em;
  margin-top: 4px;
  transition: color 0.2s;
}
.about-make-link:hover { color: rgba(255,255,255,0.85); }

.footer-links {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links p,
.footer-links a {
  font-size: 11px;
  color: rgba(255,255,255,0.24);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.2s;
}
.footer-links a:hover { color: rgba(255,255,255,0.55); }

/* ================================================================
   OVERLAY
================================================================ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.22);
  z-index: 200;
}
.overlay.on { display: block; }

/* ================================================================
   HERO
================================================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(148deg, #0f0524 0%, #5b21b6 50%, #db2777 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Ghost color names — subtle texture, not decoration */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}
.hero-deco span {
  position: absolute;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  color: rgba(255,255,255,0.038);
  line-height: 1;
  white-space: nowrap;
}
.hero-deco span:nth-child(1) { font-size: clamp(5rem,18vw,10rem); top: 2%;  left: -2%; }
.hero-deco span:nth-child(2) { font-size: clamp(4rem,14vw, 8rem); top: 40%; right:-2%; }
.hero-deco span:nth-child(3) { font-size: clamp(4rem,13vw, 7rem); bottom:6%; left: 3%; }

.hero-nav {
  padding: 24px 24px 0;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.1em;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 32px 80px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 300;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.9;
  max-width: 240px;
  margin-bottom: 40px;
}

.hero-cta {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.hero-cta:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}

.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.hero-scroll-label {
  font-size: 9px;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-scroll-line {
  width: 1px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.28), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity:0.3; }
  50%      { opacity:0.8; }
}

/* ================================================================
   APP SECTION
================================================================ */
.app-section {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 0 32px;
}
.app-inner {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── For field ─────────────────────────────────────────────────── */
.for-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 24px;
}
.for-label {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-mid);
}
.for-input {
  width: 100%;
  max-width: 240px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  color: var(--text);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  padding: 4px 0;
  text-align: center;
  outline: none;
  caret-color: var(--text);
  transition: border-color 0.2s;
}
.for-input::placeholder { color: var(--text-faint); font-weight: 300; }
.for-input:focus { border-bottom-color: var(--border-hi); }

/* ── Palette hint ──────────────────────────────────────────────── */
.palette-hint {
  font-size: 11px;
  color: var(--text-mid);
  letter-spacing: 0.02em;
  margin: 32px 0 12px;
  text-align: center;
  padding: 0 16px;
}

/* ── Palette grid ──────────────────────────────────────────────── */
.palette {
  display: grid;
  grid-template-columns: repeat(4, var(--circle));
  gap: var(--gap);
}

/* ── Color circles ─────────────────────────────────────────────── */
.color-circle {
  width: var(--circle);
  height: var(--circle);
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.14), 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.12s, box-shadow 0.12s;
}
.color-circle:active { cursor: grabbing; }
.color-circle.dragging { opacity: 0.18; }
.color-circle.drop-target {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text);
  transform: scale(1.1);
}

/* ================================================================
   MIX PLACEHOLDER (ghost rings — visible before first mix)
================================================================ */
.mix-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  width: 100%;
  pointer-events: none;
  user-select: none;
}
.ph-rings {
  position: relative;
  width: 160px;
  height: 160px;
}
.ph-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed var(--border);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.ph-r1 { width: 76px;  height: 76px;  }
.ph-r2 { width: 116px; height: 116px; opacity: 0.65; }
.ph-r3 { width: 156px; height: 156px; opacity: 0.35; }
.ph-dot {
  position: absolute;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.ph-text {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* ================================================================
   MIX ZONE
================================================================ */
.mix-zone {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 32px;
}
.mix-zone.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ── Sundial container ─────────────────────────────────────────── */
/*
   Three-ring sundial. Center at (145,145).
   Ring 2 outer edge: 145 + 130 + 7 = 282px → 290px container.
*/
.mix-sun {
  position: relative;
  width: 290px;
  height: 290px;
  max-width: 100%;
  margin: 0 auto;
}

/* ── Mix wraps — absolutely positioned ────────────────────────── */
.mix-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    left  0.45s cubic-bezier(0.34, 1.5, 0.64, 1),
    top   0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
}
.mix-wrap .color-circle {
  /* size transitions for ring changes */
  transition:
    width    0.35s cubic-bezier(0.34, 1.5, 0.64, 1),
    height   0.35s cubic-bezier(0.34, 1.5, 0.64, 1),
    opacity  0.25s ease,
    box-shadow 0.25s ease;
}

/* Active mix — center, large */
.mix-wrap.active .color-circle {
  width: 72px !important;
  height: 72px !important;
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 5px var(--text),
    0 8px 24px rgba(0,0,0,0.12);
  opacity: 1 !important;
}
/* Orbit mixes — JS sets width/height per ring, CSS sets opacity */
.mix-wrap:not(.active) .color-circle {
  opacity: 0.52;
}
.mix-wrap:not(.active):hover .color-circle {
  opacity: 0.82;
  transform: scale(1.15);
}

/* ── Active mix name ───────────────────────────────────────────── */
.active-mix-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 300;
  color: var(--text);
  text-align: center;
  min-height: 32px;
  margin-top: 8px;
  letter-spacing: -0.01em;
  transition: opacity 0.2s;
}

/* ── Mix hint ──────────────────────────────────────────────────── */
.mix-hint {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  margin-top: 6px;
  text-align: center;
  padding: 0 24px;
}

/* ── Ring tracks (always-visible orbital guides) ───────────────── */
.ring-track {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--border);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.mix-zone.visible .ring-track { opacity: 1; }
.rt-0 { width: 136px; height: 136px; }  /* r=68  × 2 */
.rt-1 { width: 200px; height: 200px; }  /* r=100 × 2 */
.rt-2 { width: 260px; height: 260px; }  /* r=130 × 2 */

/* ── Undo button ───────────────────────────────────────────────── */
.undo-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  transition: color 0.18s, background 0.18s;
}
.undo-btn:hover { color: var(--text-mid); background: var(--surface); }

/* ── Note + send wrapper (hidden until first mix) ──────────────── */
.note-send {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.note-send.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── Section divider ───────────────────────────────────────────── */
.zone-divider {
  width: 32px;
  height: 1px;
  background: var(--border);
  margin: 28px auto;
}

/* ── Create button bottom padding ──────────────────────────────── */
.create-btn {
  margin-bottom: 48px;
}

/* ================================================================
   WYSIWYG MESSAGE
================================================================ */
.message-wrap {
  width: 100%;
  max-width: 280px;
}

.message-input {
  width: 100%;
  min-height: 80px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.65;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.message-input:focus { border-color: var(--border-hi); background: var(--bg); }
.message-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
  pointer-events: none;
}

/* Toolbar + char count share a row below the textarea */
.message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
}
.message-toolbar {
  display: flex;
  gap: 2px;
}
.fmt-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-mid);
  font-size: 12px;
  font-family: inherit;
  width: 28px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.fmt-btn:hover { background: var(--surface); border-color: var(--border-hi); color: var(--text); }
.fmt-btn.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.fmt-btn b { font-weight: 700; }
.fmt-btn i { font-style: italic; }
.fmt-btn u { text-decoration: underline; }

.char-row {
  font-size: 10px;
  color: var(--text-faint);
}

/* ================================================================
   CREATE BUTTON
================================================================ */
.create-btn {
  margin-top: 24px;
  padding: 14px 40px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.create-btn:active:not(:disabled) { transform: scale(0.97); opacity: 0.85; }
.create-btn:disabled { opacity: 0.2; cursor: default; }

.create-error {
  font-size: 11px;
  color: #b91c1c;
  margin-top: 12px;
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

/* ================================================================
   SUCCESS VIEW
================================================================ */
.success-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px 48px;
  width: 100%;
}
.success-view.hidden { display: none; }

.success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 24px;
}
.success-dial {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto 20px;
}
.success-for {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 4px;
}
.success-color-name {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 11px;
  color: var(--text-mid);
  font-family: ui-monospace, 'SF Mono', monospace;
  word-break: break-all;
  max-width: 300px;
  width: 100%;
  line-height: 1.65;
  text-align: left;
}
.success-qr {
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.success-qr-label {
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}
.success-message {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.65;
  text-align: center;
  max-width: 260px;
  margin-top: 8px;
  font-style: italic;
}
.success-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.action-btn {
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.action-btn:active { opacity: 0.7; transform: scale(0.97); }
.action-btn.primary { background: var(--text); color: var(--bg); border: none; font-weight: 600; }
.action-btn:not(.primary) { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }

.success-edit-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  transition: color 0.18s, background 0.18s;
}
.success-edit-btn:hover { color: var(--text-mid); background: var(--surface); }

/* ── bg-style picker ────────────────────────────────────────────── */
.bg-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.bg-picker-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bg-swatches { display: flex; gap: 16px; }
.bg-swatch {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.swatch-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.bg-swatch.selected .swatch-dot {
  border-color: var(--text);
  transform: scale(1.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
}
.bg-swatch:hover:not(.locked) .swatch-dot { transform: scale(1.08); }
.bg-swatch.locked { opacity: 0.5; cursor: pointer; }
.bg-swatch.locked:hover { opacity: 0.75; }
.swatch-lock {
  font-size: 13px;        /* Material Symbols renders at this size */
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20;
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  line-height: 1;
  user-select: none;
}
.cream-dot { background: #FEFCF8; border-color: #E8E3DB !important; }
.dark-dot  { background: #0f0524; }
.rose-dot  { background: #FDF0F5; border-color: #F0C8D8 !important; }
.sage-dot  { background: #F0F6F2; border-color: #C8DFD0 !important; }

/* ── bg-picker upgrade note ─────────────────────────────────────── */
.bg-upgrade-note {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  margin-top: 6px;
  text-align: center;
}

/* ── Upgrade success banner ─────────────────────────────────────── */
.upgrade-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1C1917;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 1000;
  white-space: nowrap;
  animation: fadeup 0.35s ease forwards;
}
@keyframes fadeup {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.upgrade-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color 0.15s;
}
.upgrade-link:hover { color: #fff; }

/* ================================================================
   SITE FOOTER + HISTORY
================================================================ */
.site-footer {
  width: 100%;
  padding: 12px 24px 32px;
  display: flex;
  justify-content: center;
}
.history-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}
.history-btn:hover { color: var(--text-mid); }

.history-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 24px rgba(0,0,0,0.07);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
  z-index: 220;
  max-height: 72vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 24px 48px;
}
.history-drawer.open { transform: translateY(0); }

.drawer-grip {
  display: flex;
  justify-content: center;
  padding: 12px 0 16px;
  cursor: pointer;
}
.grip-bar { width: 32px; height: 3px; background: var(--border); border-radius: 2px; }

.drawer-note {
  font-size: 10px;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.06em;
}
.history-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 8px;
}
.history-clear-btn {
  background: none;
  border: none;
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}
.history-clear-btn:hover { color: #b91c1c; }

.history-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.history-entry:last-child { border-bottom: none; }
.history-delete-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.history-delete-btn:hover { color: #b91c1c; background: #FEF2F2; }
.history-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.history-info { flex: 1; min-width: 0; }
.history-name { font-size: 14px; color: var(--text); }
.history-color { color: var(--text-faint); font-weight: 400; }
.history-msg {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 200px;
}
.history-date { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.no-history {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  padding: 40px 0;
}

/* ================================================================
   DRAG GHOST + CANVAS
================================================================ */
#drag-ghost {
  display: none;
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  opacity: 0.88;
  transform: translate(-50%, -50%);
  width: var(--circle);
  height: var(--circle);
}
#canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}
