:root {
  --ink: #1d1d3b; --muted: #5b5b78; --bg: #fffaf0; --card: #fff; --line: #ece4d2;
  --sun: #ffcf4a; --coral: #e4572e; --sky: #3a86ff; --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--sky); }
img { max-width: 100%; height: auto; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; margin: .4em 0 .3em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 .4em; }
h2 a { color: inherit; text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.prose p { margin: .7em 0; }

.top { background: #fff; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.top nav a { white-space: nowrap; padding: 6px 11px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current] { background: #fff1c2; }

.hero { background: linear-gradient(160deg, #fff1c2, #ffe0e9 60%, #dff0ff); padding: 36px 0 44px; }
.hero p { max-width: 640px; color: var(--muted); font-size: 1.1rem; }
.maker-cta { margin-top: 18px; max-width: 520px; }
.maker-cta label { font-weight: 700; display: block; margin-bottom: 6px; }
.maker-cta div { display: flex; gap: 8px; }
input, textarea { font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; width: 100%; background: #fff; color: var(--ink); }

button, .btn { font: inherit; font-weight: 700; padding: 10px 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #d6c9a8; }
.primary { background: var(--coral); border-color: var(--coral); color: #fff; }
.primary:hover { filter: brightness(1.05); border-color: var(--coral); }
.pin { color: #c8232c; }

.crumbs { font-size: .9rem; color: var(--muted); margin-top: 16px; }
.crumbs a { color: var(--muted); }
.intro { color: var(--muted); max-width: 780px; }
.sub { color: var(--muted); margin-top: 0; }
.more { margin-top: 10px; font-weight: 700; }
.cta { font-weight: 700; margin: 18px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; display: flex; flex-direction: column; transition: transform .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--sun); }
.thumb { aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; padding: 8px; background: #fff; }
.thumb img { max-height: 100%; width: auto; object-fit: contain; }
.label { padding: 8px 10px 10px; font-weight: 700; font-size: .92rem; border-top: 1px solid var(--line); }

.studio { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 14px; margin: 18px 0; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; position: sticky; top: 62px; background: #fff; z-index: 2; padding: 4px 0 10px; }
.palette { display: grid; grid-template-columns: repeat(12, 30px); gap: 6px; }
.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(0,0,0,.18); }
.sw[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.actions, .out { display: flex; flex-wrap: wrap; gap: 8px; }
.art { display: flex; justify-content: center; touch-action: manipulation; }
.art svg { width: 100%; max-width: 720px; height: auto; display: block; cursor: pointer; }
.art .r:hover { stroke-width: inherit; filter: brightness(.97); }
.out { justify-content: center; margin-top: 14px; }
.tip { text-align: center; color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
.maker { display: grid; gap: 8px; max-width: 520px; }
.maker label { font-weight: 700; }
.ad { margin: 22px auto; min-height: 120px; text-align: center; }

.foot { margin-top: 48px; padding: 24px 0; background: #fff; border-top: 2px solid var(--line); color: var(--muted); font-size: .95rem; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .palette { grid-template-columns: repeat(8, 32px); }
  .sw { width: 32px; height: 32px; }
  .tools { top: 0; position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media print {
  @page { margin: 0.4in; }
  body { background: #fff; }
  body * { visibility: hidden; }
  #art, #art * { visibility: visible; }
  #art { position: absolute; inset: 0; }
  #art svg { max-width: none; width: 100%; height: auto; max-height: 100vh; }
  .hints rect.r { fill-opacity: 0 !important; }
}
