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

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-overlay.fade-out { opacity: 0; visibility: hidden; }
.loading-inner { text-align: center; }
.loading-logo {
  width: 48px; height: 48px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 12px;
  animation: loading-pulse 1.2s ease-in-out infinite;
}
.loading-text {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.5px; color: #2C2C2C;
  margin-bottom: 16px;
}
.loading-bar {
  width: 120px; height: 3px;
  background: #E0DBD3; border-radius: 2px;
  overflow: hidden; margin: 0 auto;
}
.loading-bar-fill {
  width: 0%; height: 100%;
  background: #E8642C; border-radius: 2px;
  animation: loading-fill 1.5s ease-out forwards;
}
@keyframes loading-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}
@keyframes loading-fill {
  0% { width: 0%; }
  60% { width: 70%; }
  100% { width: 90%; }
}
body.is-loading .grid-container,
body.is-loading .filter-bar { opacity: 0; }
.grid-container, .filter-bar { transition: opacity 0.4s ease 0.1s; }

:root {
  --bg: #FAF8F5;
  --bg-warm: #F5F0E8;
  --ink: #2C2C2C;
  --ink-light: #6B6B6B;
  --ink-muted: #9B9B9B;
  --accent: #E8642C;
  --accent-soft: #FFF0E8;
  --border: #E0DBD3;
  --card-bg: #FFFFFF;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  --radius: 12px;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, system-ui, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image: var(--grain);
  opacity: 0.025;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 48px);
}
.header-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px;
  height: auto;
}
.logo {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.logo-sketch {
  width: 28px; height: 28px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.header-right {
  display: flex; align-items: center; gap: 10px;
}
.header-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg-warm);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.lang-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 3px;
  transition: border-color 0.2s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-option {
  color: var(--ink-muted);
  transition: color 0.2s, font-weight 0.2s;
}
.lang-option.active {
  color: var(--accent);
  font-weight: 700;
}
.lang-divider { color: var(--border); }

/* ── Filter Bar ── */
.filter-bar {
  max-width: 1440px; margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 16px;
}
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
.filter-btn {
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}
.filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.search-input {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 14px 6px 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239B9B9B' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--ink);
  outline: none;
  width: 200px;
  transition: border-color 0.2s, width 0.3s;
}
.search-input:focus {
  border-color: var(--accent);
  width: 260px;
}
.search-input::placeholder { color: var(--ink-muted); }

/* ── Masonry Grid ── */
.grid-container {
  max-width: 1440px; margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 48px) 80px;
}
.masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .masonry { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .masonry { grid-template-columns: 1fr; } }

/* ── ISM Card ── */
.ism-card {
  break-inside: avoid;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s, opacity 0.4s ease;
  animation: cardFadeIn 0.4s ease both;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton Card ── */
.ism-card--skeleton {
  animation: none;
}
.ism-skeleton-images { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.ism-skeleton-block {
  background: linear-gradient(90deg, var(--bg-warm) 25%, var(--border) 50%, var(--bg-warm) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  height: 160px;
}
.ism-skeleton-block.ism-skeleton-sm { height: 80px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ism-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.ism-card-header {
  padding: 20px 20px 12px;
}
.ism-label-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ism-number {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--bg-warm);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.ism-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.ism-name-kr {
  font-size: 13px;
  color: var(--ink-muted);
  margin-left: 6px;
  font-weight: 400;
}
.ism-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.ism-desc {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.7;
  word-break: keep-all;
}

/* ── Palette ── */
.ism-palette {
  display: flex; gap: 4px;
  padding: 8px 20px 0;
}
.ism-swatch {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}
.ism-swatch:hover { transform: scale(1.2); }
.ism-swatch[title]::after {
  content: attr(title);
  position: absolute;
  bottom: -22px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.ism-swatch:hover::after { opacity: 1; }

/* ── Images ── */
.ism-images {
  padding: 12px 20px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.ism-img-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  background: var(--bg-warm);
}
.ism-img-wrap img {
  width: 100%; display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.ism-img-wrap img[data-lazy] { opacity: 0; }
.ism-img-wrap img:not([data-lazy]) { opacity: 1; }
.ism-img-wrap:hover img { transform: scale(1.03); }
.ism-img-label {
  position: absolute; bottom: 8px; left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--ink-light);
  letter-spacing: 0.3px;
}
.ism-img-placeholder {
  aspect-ratio: 16/10;
  background: var(--bg-warm);
  border-radius: 8px;
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink-muted);
  font-family: var(--font-mono);
}

/* ── Keywords ── */
.ism-keywords {
  padding: 12px 20px 0;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.ism-kw {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Example Links ── */
.ism-examples {
  padding: 12px 20px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.ism-example-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-light);
  transition: color 0.2s;
}
.ism-example-link:hover { color: var(--accent); }
.ism-example-link::before {
  content: '→';
  font-size: 12px;
  color: var(--ink-muted);
}
.ism-example-link span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: auto;
}
.ism-example-link.hidden { display: none; }
.ism-examples-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: none; border: none;
  cursor: pointer; padding: 4px 0;
  text-align: left;
  transition: opacity 0.15s;
}
.ism-examples-toggle:hover { opacity: 0.7; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 120px 20px;
  color: var(--ink-muted);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 8px;
}

/* ── Footer ── */
.site-footer {
  max-width: 1440px; margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 40px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
}

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.4);
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ── Scroll to top ── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 30;
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top svg {
  width: 16px; height: 16px;
  stroke: var(--ink-light); stroke-width: 2; fill: none;
}

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-container {
  position: relative;
  width: min(720px, 92vw);
  max-height: 88vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}
.modal-scroll {
  overflow-y: auto;
  max-height: 88vh;
  padding: 36px 32px 32px;
  overscroll-behavior: contain;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-light);
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Modal: Header ── */
.modal-number {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-muted); background: var(--bg-warm);
  padding: 3px 10px; border-radius: 4px;
  display: inline-block; margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  letter-spacing: -1px; line-height: 1.2;
}
.modal-title-kr {
  font-size: 15px; color: var(--ink-muted);
  font-weight: 400; margin-left: 8px;
}
.modal-tagline {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); margin: 4px 0 16px;
  letter-spacing: 0.3px;
}

/* ── Modal: History ── */
.modal-history {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 13px; line-height: 1.8;
  color: var(--ink-light);
  word-break: keep-all;
}

/* ── Modal: Description ── */
.modal-desc {
  font-size: 15px; line-height: 1.8;
  color: var(--ink); margin-bottom: 24px;
  word-break: keep-all;
}

/* ── Modal: Main Image ── */
.modal-main-image { margin-bottom: 6px; }
.modal-main-image img {
  width: 100%; border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.3s;
}
.modal-main-image img:hover { transform: scale(1.01); }
.modal-main-label {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  color: var(--ink); margin: 6px 0 4px;
}

/* ── Modal: Prompt ── */
.modal-prompt {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 8px 0 20px;
  font-family: var(--font-mono); font-size: 12px;
  line-height: 1.7; color: var(--ink-light);
  position: relative;
  word-break: break-word;
}
.prompt-copy-btn {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono); font-size: 10px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 10px;
  cursor: pointer; color: var(--ink-muted);
  transition: all 0.15s;
}
.prompt-copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ── Modal: Collapsible ── */
.modal-collapsible {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.modal-collapsible:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.modal-collapsible-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-warm);
  cursor: pointer; user-select: none;
  font-family: var(--font-sans); font-size: 13px;
  font-weight: 500; color: var(--ink);
  transition: background 0.15s;
}
.modal-collapsible-header:hover { background: #ebe5da; }
.modal-collapsible-arrow {
  font-size: 10px; color: var(--ink-muted);
  transition: transform 0.25s ease;
  display: inline-block;
}
.modal-collapsible.open .modal-collapsible-arrow { transform: rotate(90deg); }
.modal-collapsible-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease;
}
.modal-collapsible.open .modal-collapsible-body { max-height: 800px; }
.modal-collapsible-inner {
  padding: 14px 16px;
}
.modal-collapsible-body img {
  width: 100%; border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px; cursor: zoom-in;
}

/* ── Modal: Prompt ── */
.modal-prompt {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 1.6;
  color: var(--ink-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
}
.modal-prompt-main { margin-bottom: 16px; }
.modal-prompt-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  margin-bottom: 4px;
}

/* ── Modal: Section Title ── */
.modal-section-title {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--ink); margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Modal: Palette ── */
.modal-palette {
  display: flex; gap: 10px; margin-bottom: 4px;
  flex-wrap: wrap;
}
.modal-swatch {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer;
}
.modal-swatch-color {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.modal-swatch:hover .modal-swatch-color {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.modal-swatch-hex {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-muted);
}

/* ── Modal: Keywords ── */
.modal-keywords {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.modal-kw {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-muted); background: var(--bg);
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.modal-kw:hover { background: var(--bg-warm); }

/* ── Modal: Examples ── */
.modal-examples {
  display: flex; flex-direction: column; gap: 4px;
}
.modal-examples-visible {
  display: flex; flex-direction: column; gap: 4px;
}
.modal-examples-hidden {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.modal-examples-hidden.open { max-height: 400px; }
.modal-example-link {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-light);
  padding: 5px 8px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.modal-example-link:hover {
  color: var(--accent); background: var(--accent-soft);
}
.modal-example-link::before {
  content: '→'; font-size: 11px; color: var(--ink-muted);
}
.modal-example-domain {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-muted); margin-left: auto;
}
.modal-examples-toggle {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); background: none; border: none;
  cursor: pointer; padding: 6px 8px; text-align: left;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-examples-toggle:hover { background: var(--accent-soft); }

/* ── Modal: Related ISMs ── */
.modal-related {
  display: flex; gap: 10px;
  overflow-x: auto; padding: 8px 0 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.modal-related::-webkit-scrollbar { height: 4px; }
.modal-related::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 2px;
}
.modal-related-card {
  flex: 0 0 auto;
  width: 150px; padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.modal-related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-color: var(--accent);
}
.modal-related-name {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
}
.modal-related-tagline {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--ink-muted);
  margin-top: 4px; line-height: 1.4;
}

/* ── Modal: Development Guide ── */
.modal-section-title-dev {
  margin-top: 20px;
}
.modal-dev-guide {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-warm);
  padding: 16px;
  margin-bottom: 8px;
}
.modal-dev-summary {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-light);
  margin-bottom: 14px;
}
.modal-dev-block {
  min-width: 0;
}
.modal-dev-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.modal-dev-components {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.modal-dev-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
}
.modal-dev-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.modal-dev-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.modal-dev-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-light);
  overflow-wrap: anywhere;
}
.modal-dev-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.modal-dev-list-checks li::before {
  content: '✓';
  font-size: 11px;
  top: 1px;
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff;
  font-family: var(--font-mono); font-size: 12px;
  padding: 8px 24px; border-radius: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── Mobile Modal ── */
@media (max-width: 640px) {
  .modal-container {
    width: 100vw; max-height: 95vh;
    border-radius: 20px 20px 0 0;
    align-self: flex-end;
  }
  .modal-scroll { max-height: 95vh; padding: 28px 20px 24px; }
  .modal-title { font-size: 22px; }
  .modal-examples { grid-template-columns: 1fr; }
  .modal-dev-columns { grid-template-columns: 1fr; }
}

/* ── Guide Split View ── */
.modal-container.expanded {
  width: min(1200px, 95vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}
.modal-container.expanded .modal-close { grid-column: 1 / -1; position: absolute; top: 14px; right: 14px; z-index: 10; }
.modal-container.expanded .modal-scroll { max-height: 88vh; }
.modal-container.expanded .modal-guide-panel { max-height: 88vh; overflow-y: auto; padding: 36px 28px 32px; border-left: 1px solid var(--border); }

.modal-guide-panel { display: none; }
.modal-container.expanded .modal-guide-panel { display: block; }

.guide-toggle-btn {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  width: 100%; padding: 14px 20px; margin-top: 24px;
  background: var(--ink); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.guide-toggle-btn:hover { background: var(--accent); }
.guide-toggle-btn:active { transform: scale(0.98); }
.guide-toggle-btn svg { transition: transform 0.3s; }
.modal-container.expanded .guide-toggle-btn svg { transform: rotate(180deg); }

.guide-panel-header {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--accent);
}
.guide-section { margin-bottom: 20px; }
.guide-section-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted);
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.guide-row {
  display: flex; gap: 8px; padding: 5px 0;
  font-size: 13px; line-height: 1.5;
}
.guide-row-label {
  flex-shrink: 0; width: 100px;
  font-weight: 600; color: var(--ink);
  font-family: var(--font-mono); font-size: 11px;
}
.guide-row-value { color: var(--ink-light); overflow-wrap: break-word; min-width: 0; }

.guide-do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-do-title { color: #16a34a; }
.guide-dont-title { color: #dc2626; }
.guide-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.guide-list li { padding: 4px 0; padding-left: 16px; position: relative; color: var(--ink-light); }
.guide-list-do li::before { content: '✓'; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.guide-list-dont li::before { content: '✗'; position: absolute; left: 0; color: #dc2626; font-weight: 700; }

.guide-loading, .guide-error {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--ink-muted); font-size: 14px;
}

@media (max-width: 1023px) {
  .modal-container.expanded {
    display: flex; flex-direction: column;
    width: min(720px, 92vw);
  }
  .modal-container.expanded .modal-guide-panel {
    border-left: none; border-top: 1px solid var(--border);
    max-height: none; padding: 24px 20px;
  }
  .modal-container.expanded .modal-scroll { max-height: none; flex-shrink: 0; }
}
@media (max-width: 600px) {
  .modal-container.expanded { width: 100%; }
  .modal-container.expanded .modal-guide-panel { padding: 20px 16px; }
  .guide-row { flex-direction: column; gap: 2px; }
  .guide-row-label { width: auto; }
  .guide-do-dont { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-container, .modal-collapsible-body,
  .modal-examples-hidden, .toast { transition: none; }
}
