/* Manga UI Kit — neo-manga / anime pop-art components
   Accent periwinkle, hard tinted shadows, springy motion, comic VFX.
   No gradients, no glass. Google Fonts: Nunito + Bangers. */

:root {
  --bg: #F7F5FF;
  --bg-dot: #D9D6EE;
  --surface: #FFFFFF;
  --ink: #1C1C28;
  --muted: #8A8A9C;
  --line: #E4E2F0;
  --line-strong: #1C1C28;
  --accent: #6B74E8;
  --accent-2: #8B5CF6;
  --accent-deep: #4F56C9;
  --accent-soft: #E8EAFF;
  --accent-mid: #C5C9F5;
  --shadow: #C5C9F5;
  --shadow-ink: #1C1C28;
  --danger: #E5486D;
  --danger-soft: #FFE0E8;
  --ok: #22A06B;
  --ok-soft: #D8F5E8;
  --warn: #E8A317;
  --warn-soft: #FFF3D0;
  --star: #F5C518;
  --radius: 12px;
  --radius-sm: 10px;
  --pill: 999px;
  --bd: 2px;
  --shadow-n: 4px 4px 0 var(--shadow);
  --shadow-lg: 6px 6px 0 var(--shadow);
  --shadow-sm: 2px 2px 0 var(--shadow);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --font: "Nunito", ui-rounded, "Avenir Next", system-ui, sans-serif;
  --font-sfx: "Bangers", "Nunito", system-ui, sans-serif;
  --z-fx: 40;
  --z-pop: 80;
  --z-modal: 120;
  --z-toast: 140;
  --accent-ink: #ffffff;
  --font-display: var(--font-sfx, var(--font));
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-scale: 1;
  --motion: 1;
  --dur-1: calc(0.12s * var(--motion));
  --dur-2: calc(0.22s * var(--motion));
  --dur-3: calc(0.4s * var(--motion));
  --focus-ring: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent);
}

html { accent-color: var(--accent); }
:focus-visible {
  outline: 3px solid var(--accent-2, var(--accent));
  outline-offset: 3px;
}
.skip-link {
  position: absolute; left: 12px; top: -40px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

[data-theme="dark"] {
  --bg: #161622;
  --bg-dot: #2A2A40;
  --surface: #1E1E2E;
  --ink: #F4F2FF;
  --muted: #9A9AB0;
  --line: #34344A;
  --line-strong: #F4F2FF;
  --accent: #8B93F0;
  --accent-2: #A78BFA;
  --accent-deep: #6B74E8;
  --accent-soft: #2A2D55;
  --accent-mid: #3A3E70;
  --shadow: #0B0B14;
  --danger-soft: #3A1B28;
  --ok-soft: #143328;
  --warn-soft: #3A2E12;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); }

/* ========== Gallery ========== */
.kit-wrap { max-width: 1280px; margin: 0 auto; padding: 40px 24px 80px; }
.kit-hero { text-align: center; margin: 8px 0 40px; position: relative; }
.kit-kicker {
  display: inline-block;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.kit-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.kit-hero h1 span { color: var(--accent); }
.kit-hero p {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
  font-weight: 700;
  font-size: 17px;
}
.kit-meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.kit-chip {
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  padding: 4px 12px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.kit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.kit-card {
  background: var(--surface);
  border: var(--bd) solid var(--line);
  border-radius: 20px;
  padding: 18px 18px 16px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
.kit-card-head { margin-bottom: 8px; }
.kit-num {
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--accent-deep);
}
.kit-card h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
}
.kit-card .kit-desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.kit-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 8px;
  position: relative;
  min-height: 140px;
}
.kit-stage.stage-wide { padding: 16px 0; }
.kit-status {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 18px;
}

@media (max-width: 1024px) {
  .kit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kit-wrap { padding: 24px 14px 60px; }
  .kit-grid { grid-template-columns: 1fr; }
  .kit-card { min-height: 240px; }
}

/* ========== Shared control look ========== */
.m-fx-host { position: relative; }

/* ========== Buttons ========== */
.m-btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-bd: var(--ink);
  --btn-sh: var(--shadow);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 22px;
  border: var(--bd) solid var(--btn-bd);
  border-radius: var(--pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .01em;
  box-shadow: 4px 4px 0 var(--btn-sh);
  transform: translate(0, 0);
  transition: transform .18s var(--ease-spring), box-shadow .18s var(--ease-spring), background .15s var(--ease-out);
  user-select: none;
  white-space: nowrap;
}
.m-btn:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--btn-sh); }
.m-btn:active, .m-btn.is-pressed {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--btn-sh);
  transition-duration: .08s;
}
.m-btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.m-btn-primary { --btn-bg: var(--accent); --btn-fg: #fff; --btn-sh: var(--accent-mid); }
.m-btn-cancel, .m-btn-secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-sh: var(--shadow);
}
.m-btn-danger { --btn-bg: var(--danger); --btn-sh: #F5B3C4; }
.m-btn-ghost {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  box-shadow: none;
}
.m-btn-sm { min-height: 34px; padding: 4px 14px; font-size: 13px; }
.m-btn-icon {
  width: 46px; height: 46px; min-height: 46px; padding: 0;
  border-radius: 14px;
}
.m-fab {
  width: 60px; height: 60px; min-height: 60px; padding: 0;
  border-radius: 50%;
  font-size: 28px;
  box-shadow: 5px 5px 0 var(--accent-mid);
}
.m-btn svg, .m-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m-fab svg { width: 26px; height: 26px; }

.m-btn-group {
  display: inline-flex;
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  box-shadow: var(--shadow-n);
  overflow: hidden;
  background: var(--surface);
  position: relative;
}
.m-btn-group .m-btn {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 42px;
  background: transparent;
  color: var(--ink);
}
.m-btn-group .m-btn + .m-btn { border-left: var(--bd) solid var(--ink); }
.m-btn-group .m-btn:hover { transform: none; background: var(--accent-soft); }
.m-btn-group .m-btn.is-active, .m-btn-group .m-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

/* ========== Toggle ========== */
.m-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 800; }
.m-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.m-toggle-track {
  width: 68px; height: 38px;
  border-radius: var(--pill);
  background: #D0D2E0;
  border: var(--bd) solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  position: relative;
  display: block;
  transition: background .28s var(--ease-spring), box-shadow .2s var(--ease-spring);
}
.m-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 28px; height: 28px;
  background: #fff;
  border: var(--bd) solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--accent-mid);
  transition: transform .34s var(--ease-spring);
}
.m-toggle input:checked + .m-toggle-track { background: var(--accent); }
.m-toggle input:checked + .m-toggle-track .m-toggle-thumb { transform: translateX(30px); }
.m-toggle input:focus-visible + .m-toggle-track { outline: 3px solid var(--accent-2); outline-offset: 3px; }

/* ========== Slider ========== */
.m-slider, .m-range {
  width: min(260px, 100%);
  position: relative;
  padding: 28px 8px 8px;
  touch-action: none;
  user-select: none;
}
.m-slider-track, .m-range-track {
  height: 10px;
  background: var(--accent-soft);
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  position: relative;
}
.m-slider-fill, .m-range-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 50%;
  background: var(--accent);
  border-radius: var(--pill);
  pointer-events: none;
}
.m-slider-thumb, .m-range-thumb {
  position: absolute;
  top: 50%;
  width: 22px; height: 22px;
  background: #fff;
  border: var(--bd) solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--accent-mid);
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 2;
  padding: 0;
}
.m-slider-thumb:active, .m-range-thumb:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.12); }
.m-slider-badge {
  position: absolute;
  top: 0;
  transform: translate(-50%, 0);
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  box-shadow: 2px 2px 0 var(--shadow);
  pointer-events: none;
  z-index: 3;
}

/* ========== Checkbox / Radio ========== */
.m-check, .m-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  user-select: none;
  position: relative;
}
.m-check input, .m-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-check-box, .m-radio-dot {
  width: 24px; height: 24px;
  border: var(--bd) solid var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease-spring), background .15s, box-shadow .2s var(--ease-spring);
  flex-shrink: 0;
  position: relative;
}
.m-check-box { border-radius: 8px; }
.m-radio-dot { border-radius: 50%; }
.m-check-box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .28s var(--ease-spring); }
.m-check input:checked + .m-check-box { background: var(--accent); }
.m-check input:checked + .m-check-box svg { opacity: 1; transform: scale(1); }
.m-radio-pip {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .28s var(--ease-spring);
}
.m-radio input:checked + .m-radio-dot .m-radio-pip { transform: scale(1); }
.m-check input:focus-visible + .m-check-box,
.m-radio input:focus-visible + .m-radio-dot { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.m-radio-list { display: flex; flex-direction: column; gap: 10px; }

/* ========== Inputs ========== */
.m-field { position: relative; width: min(280px, 100%); }
.m-input, .m-textarea, .m-select-btn, .m-search input {
  width: 100%;
  border: var(--bd) solid var(--ink);
  background: var(--surface);
  border-radius: var(--pill);
  padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 700;
  outline: none;
  transition: box-shadow .18s var(--ease-spring), transform .18s var(--ease-spring), border-color .15s;
}
.m-input:focus, .m-textarea:focus, .m-search:focus-within, .m-select-btn:focus {
  box-shadow: 6px 6px 0 var(--accent-mid);
  transform: translateY(-1px);
  border-color: var(--accent-deep);
}
.m-input::placeholder, .m-textarea::placeholder { color: var(--muted); font-weight: 700; }
.m-field.has-caret .m-input { caret-color: transparent; }
.m-caret {
  position: absolute;
  width: 3px;
  height: 1.15em;
  background: var(--accent);
  border-radius: 1px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  animation: caretBlink 1s steps(1) infinite;
  display: none;
}
.m-field.is-focused .m-caret { display: block; }
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.m-textarea {
  border-radius: 14px;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.m-search { position: relative; width: min(280px, 100%); display: flex; align-items: center; }
.m-search .m-search-icon {
  position: absolute; left: 12px; width: 18px; height: 18px;
  stroke: var(--muted); fill: none; stroke-width: 2.2; pointer-events: none;
}
.m-search input { padding-left: 38px; padding-right: 36px; }
.m-search-clear {
  position: absolute; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-weight: 900; color: var(--muted);
}
.m-search.has-value .m-search-clear { display: flex; }

.m-password { position: relative; width: min(280px, 100%); }
.m-password input { padding-right: 46px; width: 100%; }
.m-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.m-eye svg { width: 18px; height: 18px; }

.m-otp { display: flex; gap: 8px; }
.m-otp input {
  width: 44px; height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  border: var(--bd) solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--shadow);
  outline: none;
}
.m-otp input:focus { box-shadow: 4px 4px 0 var(--accent-mid); transform: translateY(-2px); }

/* Select + dropdown */
.m-select, .m-menu-wrap { position: relative; width: min(240px, 100%); }
.m-select-btn, .m-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border: var(--bd) solid var(--ink);
  background: var(--surface);
  border-radius: var(--pill);
  padding: 10px 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 800;
  cursor: pointer;
}
.m-select-btn:hover, .m-menu-btn:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--shadow); }
.m-caret-icon { width: 16px; height: 16px; transition: transform .25s var(--ease-spring); }
.m-select.open .m-caret-icon, .m-menu-wrap.open .m-caret-icon { transform: rotate(180deg); }
.m-drop {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 6px;
  z-index: var(--z-pop);
  display: none;
  transform-origin: top center;
  animation: popIn .28s var(--ease-spring);
}
.m-select.open .m-drop, .m-menu-wrap.open .m-drop, .m-pop.open { display: block; }
.m-drop[data-align="right"] { left: auto; right: 0; min-width: 200px; }
.m-drop button, .m-drop a {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
}
.m-drop button:hover, .m-drop a:hover, .m-drop button.is-active { background: var(--accent-soft); }
.m-drop .m-sep { height: 2px; background: var(--line); margin: 4px 6px; }

@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px) scale(.92); }
  to { opacity: 1; transform: none; }
}

/* File upload */
.m-dropzone {
  width: min(300px, 100%);
  border: 2px dashed var(--ink);
  border-radius: 16px;
  background: var(--accent-soft);
  padding: 22px 16px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .2s var(--ease-spring), background .15s;
}
.m-dropzone:hover, .m-dropzone.is-over { transform: translateY(-2px); background: #DDDFFF; }
.m-dropzone strong { display: block; }
.m-dropzone span { color: var(--muted); font-size: 13px; }
.m-dropzone input { display: none; }

/* Stepper */
.m-stepper {
  display: inline-flex;
  align-items: center;
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  box-shadow: var(--shadow-n);
  overflow: hidden;
  background: var(--surface);
}
.m-stepper button {
  width: 40px; height: 40px;
  font-size: 20px; font-weight: 900;
  background: var(--accent-soft);
}
.m-stepper button:hover { background: var(--accent); color: #fff; }
.m-stepper .m-step-val {
  min-width: 48px;
  text-align: center;
  font-weight: 900;
  font-size: 18px;
}

/* Progress */
.m-progress { width: min(260px, 100%); }
.m-progress-bar {
  height: 16px;
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  background: var(--accent-soft);
  overflow: hidden;
  box-shadow: 3px 3px 0 var(--shadow);
}
.m-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: var(--pill);
  transition: width .7s var(--ease-out);
}
.m-progress-label { font-weight: 800; font-size: 13px; margin-bottom: 6px; display: flex; justify-content: space-between; }

.m-circular { width: 84px; height: 84px; position: relative; }
.m-circular svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.m-circular circle { fill: none; stroke-width: 8; }
.m-circular .bg { stroke: var(--accent-soft); }
.m-circular .fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 226; stroke-dashoffset: 226; transition: stroke-dashoffset .7s var(--ease-out); }
.m-circular span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px;
}

/* Loader */
.m-loader { width: 56px; height: 56px; position: relative; }
.m-loader-ring {
  width: 56px; height: 56px;
  border: 5px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.m-loader-lines {
  position: absolute; inset: -10px;
  animation: spin 1.4s linear infinite;
}
.m-loader-lines i {
  position: absolute; left: 50%; top: 0;
  width: 3px; height: 10px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: 50% 38px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Badge / chip */
.m-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  background: var(--danger); color: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  font-size: 11px; font-weight: 900;
  box-shadow: 2px 2px 0 var(--shadow);
}
.m-badge.ok { background: var(--ok); }
.m-badge.accent { background: var(--accent); }
.m-badge-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.m-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 12px;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  font-weight: 800; font-size: 13px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.m-chip button {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); font-weight: 900; font-size: 12px; line-height: 1;
}
.m-chip-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Avatars */
.m-avatars { display: flex; align-items: center; padding-left: 8px; }
.m-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px;
  margin-left: -10px;
  box-shadow: 2px 2px 0 var(--shadow);
  transition: transform .25s var(--ease-spring), margin .25s var(--ease-spring);
  position: relative;
  color: var(--accent-deep);
}
.m-avatars:hover .m-avatar { margin-left: 2px; transform: translateY(-4px); }
.m-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Tooltip / popover */
.m-tip-wrap { position: relative; display: inline-block; }
.m-tooltip {
  position: absolute;
  left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%) scale(.8);
  background: var(--ink); color: #fff;
  font-weight: 800; font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .24s var(--ease-spring);
  z-index: var(--z-pop);
}
.m-tooltip::after {
  content: "";
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.m-tip-wrap:hover .m-tooltip, .m-tip-wrap:focus-within .m-tooltip,
.m-tooltip.is-on { opacity: 1; transform: translateX(-50%) scale(1); }

.m-pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px;
  display: none;
  z-index: var(--z-pop);
  animation: popIn .28s var(--ease-spring);
  text-align: left;
}
.m-pop strong { display: block; margin-bottom: 4px; }
.m-pop p { margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; }

/* Modal */
.m-modal-back {
  position: fixed; inset: 0;
  background: rgba(28, 28, 40, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 20px;
}
.m-modal-back.is-open { display: flex; }
.m-modal {
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--shadow);
  max-width: 400px;
  width: 100%;
  padding: 22px;
  animation: slamIn .4s var(--ease-spring);
  position: relative;
}
@keyframes slamIn {
  0% { transform: scale(.6) rotate(-4deg); opacity: 0; }
  70% { transform: scale(1.06) rotate(1deg); }
  100% { transform: scale(1) rotate(0); }
}
.m-modal h3 { margin: 0 0 8px; font-size: 22px; }
.m-modal p { margin: 0 0 16px; color: var(--muted); font-weight: 700; }
.m-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Toast */
.m-toasts {
  position: fixed;
  right: 18px; bottom: 18px;
  display: flex; flex-direction: column-reverse; gap: 10px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.m-toast {
  pointer-events: auto;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px 14px;
  min-width: 240px;
  font-weight: 800;
  animation: toastIn .4s var(--ease-spring);
  display: flex; align-items: center; gap: 10px;
}
@keyframes toastIn {
  from { transform: translateX(120%) rotate(6deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.m-toast.is-out { animation: toastOut .3s var(--ease-out) forwards; }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* Alert */
.m-alert {
  width: min(320px, 100%);
  border: var(--bd) solid var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  font-weight: 800;
  background: var(--warn-soft);
  display: flex; gap: 10px; align-items: flex-start;
  animation: slamIn .4s var(--ease-spring);
}
.m-alert.info { background: var(--accent-soft); }
.m-alert.ok { background: var(--ok-soft); }
.m-alert.danger { background: var(--danger-soft); }
.m-alert button { margin-left: auto; font-weight: 900; }

/* Accordion */
.m-acc { width: min(320px, 100%); border: var(--bd) solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-n); overflow: hidden; background: var(--surface); }
.m-acc-item + .m-acc-item { border-top: var(--bd) solid var(--ink); }
.m-acc-btn {
  width: 100%; text-align: left;
  padding: 12px 14px;
  font-weight: 800;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
}
.m-acc-btn:hover { background: var(--accent-soft); }
.m-acc-panel {
  display: none;
  padding: 0 14px 12px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.m-acc-item.open .m-acc-panel { display: block; animation: accOpen .3s var(--ease-out); }
@keyframes accOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.m-acc-item.open .m-acc-btn .m-caret-icon { transform: rotate(180deg); }

/* Pagination */
.m-pager { display: flex; gap: 6px; align-items: center; }
.m-pager button {
  min-width: 36px; height: 36px;
  border: var(--bd) solid var(--ink);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--shadow);
}
.m-pager button:hover { transform: translateY(-2px); }
.m-pager button.is-active { background: var(--accent); color: #fff; }

/* Navbar */
.m-nav {
  width: min(360px, 100%);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-n);
}
.m-nav .brand { font-weight: 900; margin-right: auto; padding: 0 8px; color: var(--accent-deep); }
.m-nav a {
  text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 13px;
  padding: 6px 8px; border-radius: 8px;
  position: relative;
}
.m-nav a:hover, .m-nav a.is-active { background: var(--accent-soft); }

/* Sidebar */
.m-sidebar {
  width: 200px;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-n);
  padding: 10px;
  text-align: left;
}
.m-sidebar button {
  width: 100%; text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  display: flex; gap: 8px; align-items: center;
}
.m-sidebar button:hover, .m-sidebar button.is-active { background: var(--accent-soft); }
.m-sidebar button.is-active { box-shadow: inset 3px 0 0 var(--accent); }

/* Bottom nav */
.m-bottom {
  width: min(320px, 100%);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-n);
  padding: 6px;
}
.m-bottom button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  font-weight: 800; font-size: 11px;
}
.m-bottom button svg { width: 20px; height: 20px; }
.m-bottom button.is-active { background: var(--accent); color: #fff; transform: translateY(-4px); }

/* Tabs + segmented */
.m-tabs, .m-segment {
  position: relative;
  display: inline-flex;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: var(--pill);
  box-shadow: var(--shadow-n);
  padding: 3px;
  overflow: hidden;
}
.m-tabs { border-radius: 14px; }
.m-tab-pill, .m-seg-pill {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  background: var(--accent);
  border-radius: var(--pill);
  z-index: 0;
  transition: left .38s var(--ease-spring), width .38s var(--ease-spring), transform .38s var(--ease-spring);
  pointer-events: none;
}
.m-tabs .m-tab-pill { border-radius: 11px; }
.m-tabs button, .m-segment button {
  position: relative; z-index: 1;
  padding: 8px 16px;
  font-weight: 800;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  min-height: 36px;
}
.m-tabs button.is-active, .m-segment button.is-active { color: #fff; }
.m-tab-panels { margin-top: 12px; font-weight: 800; text-align: center; min-height: 24px; color: var(--muted); font-size: 13px; }

/* Cards */
.m-card, .m-price, .m-product {
  width: min(260px, 100%);
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-n);
  padding: 14px;
  text-align: left;
  transition: transform .2s var(--ease-spring), box-shadow .2s var(--ease-spring);
}
.m-card:hover, .m-price:hover, .m-product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.m-card h4, .m-price h4, .m-product h4 { margin: 0 0 4px; font-size: 16px; }
.m-card p, .m-product p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }

.m-price { text-align: center; }
.m-price .amt { font-size: 28px; font-weight: 900; margin: 6px 0; }
.m-price .amt small { font-size: 14px; }
.m-price ul { list-style: none; padding: 0; margin: 0 0 12px; font-weight: 700; font-size: 13px; color: var(--muted); }
.m-price.is-featured { border-color: var(--accent-deep); background: var(--accent-soft); }

.m-product .m-prod-art {
  height: 92px;
  border: var(--bd) solid var(--ink);
  border-radius: 12px;
  background: var(--accent-soft);
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  position: relative;
  overflow: hidden;
}
.m-product .price { font-weight: 900; color: var(--accent-deep); margin: 6px 0 8px; }
.m-product .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Bell / like */
.m-bell, .m-like, .m-copy {
  position: relative;
  width: 48px; height: 48px;
  border: var(--bd) solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-n);
  display: inline-flex; align-items: center; justify-content: center;
}
.m-bell:hover, .m-like:hover, .m-copy:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.m-bell .m-badge { position: absolute; top: -8px; right: -8px; }
.m-bell.is-ring svg { animation: bellShake .6s var(--ease-spring); }
@keyframes bellShake {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(18deg); }
  40% { transform: rotate(-16deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-6deg); }
}
.m-like.is-on { background: var(--danger-soft); color: var(--danger); }
.m-like svg { width: 22px; height: 22px; }
.m-like.is-on svg { fill: var(--danger); stroke: var(--danger); }

/* Date picker */
.m-date { width: 250px; }
.m-date-head { display: flex; align-items: center; justify-content: space-between; font-weight: 800; margin-bottom: 8px; }
.m-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.m-date-grid span, .m-date-grid button {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-weight: 800; font-size: 12px;
}
.m-date-grid span { color: var(--muted); font-size: 10px; }
.m-date-grid button:hover { background: var(--accent-soft); }
.m-date-grid button.is-on { background: var(--accent); color: #fff; }

/* Color swatches */
.m-swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.m-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: var(--bd) solid var(--ink);
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 0;
}
.m-swatch.is-on { transform: scale(1.18); box-shadow: 3px 3px 0 var(--ink); }

/* Cart qty */
.m-cart-qty { display: inline-flex; align-items: center; gap: 0; }
.m-cart-qty .m-stepper { }

/* Theme switch */
.m-theme {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800;
}

/* Countdown */
.m-count { display: flex; gap: 8px; }
.m-count-unit {
  min-width: 58px;
  background: var(--surface);
  border: var(--bd) solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-n);
  text-align: center;
  padding: 8px 4px 6px;
}
.m-count-unit b { display: block; font-size: 22px; font-weight: 900; }
.m-count-unit span { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.m-count-unit.is-tick b { animation: tickPop .35s var(--ease-spring); }
@keyframes tickPop { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* Empty state */
.m-empty { text-align: center; max-width: 260px; }
.m-empty .m-empty-art {
  font-size: 42px;
  margin-bottom: 8px;
  animation: floaty 2.4s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-6px); } }
.m-empty h4 { margin: 0 0 4px; }
.m-empty p { margin: 0 0 12px; color: var(--muted); font-weight: 700; font-size: 13px; }

/* Star rating */
.m-stars { display: inline-flex; gap: 4px; position: relative; }
.m-stars button {
  width: 32px; height: 32px; padding: 0;
  color: var(--ink);
  background: none;
}
.m-stars button svg { width: 28px; height: 28px; stroke: var(--ink); fill: transparent; transition: transform .25s var(--ease-spring), fill .15s; }
.m-stars button.is-on svg, .m-stars button.is-hover svg { fill: var(--star); stroke: var(--ink); }
.m-stars button:hover svg { transform: scale(1.18) rotate(-8deg); }

/* ========== Manga FX ========== */
.manga-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: var(--z-fx);
}
.fx-puff, .fx-shard, .fx-star, .fx-slash, .fx-line, .fx-hand, .fx-spark, .fx-after {
  position: absolute;
  pointer-events: none;
}
.fx-sfx {
  position: absolute;
  font-family: var(--font-sfx);
  letter-spacing: .04em;
  font-size: 30px;
  line-height: 1;
  color: var(--accent-deep);
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--accent-mid), 5px 5px 0 var(--ink);
  letter-spacing: -.04em;
  white-space: nowrap;
  transform: rotate(-14deg) skewX(-8deg) scale(.2);
  opacity: 0;
  animation: sfxPop .7s var(--ease-spring) forwards;
  z-index: 5;
}
.fx-sfx.lg { font-size: 40px; }
.fx-sfx.sm { font-size: 22px; -webkit-text-stroke: 3px #fff; }
@keyframes sfxPop {
  0% { opacity: 0; transform: rotate(-14deg) skewX(-8deg) scale(.2); }
  55% { opacity: 1; transform: rotate(-10deg) skewX(-6deg) scale(1.18); }
  100% { opacity: 1; transform: rotate(-12deg) skewX(-8deg) scale(1); }
}
.fx-sfx.is-fade { animation: sfxFade .35s ease forwards; }
@keyframes sfxFade { to { opacity: 0; transform: rotate(-16deg) skewX(-8deg) scale(.8) translateY(-10px); } }

.fx-puff { width: 54px; height: 54px; animation: puffOut .7s var(--ease-out) forwards; }
.fx-puff svg { width: 100%; height: 100%; overflow: visible; }
@keyframes puffOut {
  0% { opacity: 0; transform: scale(.2); }
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.35) translate(var(--dx, 8px), var(--dy, -16px)); }
}

.fx-shard {
  width: 14px; height: 18px;
  background: var(--accent-soft);
  border: 2px solid var(--accent-deep);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: shardFly .7s var(--ease-out) forwards;
}
@keyframes shardFly {
  0% { opacity: 1; transform: translate(0,0) rotate(0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, 40px), var(--dy, 50px)) rotate(160deg) scale(.6); }
}

.fx-star {
  width: 16px; height: 16px;
  animation: starPop .55s var(--ease-spring) forwards;
}
@keyframes starPop {
  0% { opacity: 0; transform: scale(0) rotate(0); }
  50% { opacity: 1; transform: scale(1.3) rotate(20deg); }
  100% { opacity: 0; transform: scale(.4) translate(var(--dx, 10px), var(--dy, -20px)) rotate(40deg); }
}

.fx-slash {
  width: 46px; height: 6px;
  background: var(--ink);
  border-radius: 3px;
  transform: rotate(-38deg) scaleX(0);
  transform-origin: left center;
  animation: slashDraw .28s var(--ease-out) forwards;
  box-shadow: 0 0 0 2px #fff;
}
.fx-slash:nth-child(2) { top: 8px; animation-delay: .05s; width: 34px; }
@keyframes slashDraw {
  0% { transform: rotate(-38deg) scaleX(0); opacity: 1; }
  70% { transform: rotate(-38deg) scaleX(1); opacity: 1; }
  100% { transform: rotate(-38deg) scaleX(1) translateX(8px); opacity: 0; }
}

.fx-line {
  height: 3px;
  background: var(--accent-deep);
  border-radius: 2px;
  transform-origin: left center;
  animation: lineOut .4s var(--ease-out) forwards;
  opacity: .85;
}
@keyframes lineOut {
  0% { transform: scaleX(.2); opacity: 1; }
  100% { transform: scaleX(1) translateX(8px); opacity: 0; }
}

.fx-hand {
  font-size: 28px;
  animation: handPoint .6s var(--ease-spring) forwards;
  filter: drop-shadow(2px 2px 0 #fff);
}
@keyframes handPoint {
  0% { transform: translate(16px, 16px) scale(.4); opacity: 0; }
  50% { transform: translate(0, 0) scale(1.15); opacity: 1; }
  100% { opacity: 0; transform: translate(-6px, -8px) scale(1); }
}

.fx-spark {
  width: 8px; height: 8px;
  background: var(--star);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: sparkGo .5s var(--ease-out) forwards;
}
@keyframes sparkGo {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(1.4) translate(var(--dx, 12px), var(--dy, -16px)); opacity: 0; }
}

.fx-after {
  width: 22px; height: 22px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: .5;
  animation: afterFade .35s linear forwards;
}
@keyframes afterFade { to { opacity: 0; transform: scale(.7); } }

.fx-impact {
  position: absolute;
  width: 80px; height: 80px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.fx-impact i {
  position: absolute; left: 50%; top: 50%;
  width: 18px; height: 3px;
  background: var(--accent-deep);
  border-radius: 2px;
  transform-origin: -22px 50%;
  animation: impactLine .4s var(--ease-out) forwards;
}
@keyframes impactLine {
  0% { transform: rotate(var(--r, 0deg)) scaleX(0); opacity: 1; }
  100% { transform: rotate(var(--r, 0deg)) scaleX(1) translateX(10px); opacity: 0; }
}

/* Standalone snippet pages */
.snippet-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.snippet-page .back { position: absolute; top: 18px; left: 18px; font-weight: 800; }
.snippet-page h1 { font-size: 22px; margin: 0 0 6px; }
.snippet-page .lead { color: var(--muted); font-weight: 700; margin: 0 0 28px; }
.snippet-stage { position: relative; padding: 40px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .manga-fx, .fx-sfx, .m-empty .m-empty-art { animation: none !important; display: none; }
  .m-empty .m-empty-art { display: block; }
  .m-loader-ring, .m-loader-lines { animation: none; }
  .m-caret { animation: none; opacity: 1; }
}

/* ========== Showcase website chrome ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--shadow);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo .mark {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sfx);
  font-size: 16px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.site-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.site-search input {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  padding: 8px 14px 8px 38px;
  background: var(--bg);
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--shadow);
  outline: none;
}
.site-search input:focus { background: var(--surface); box-shadow: 4px 4px 0 var(--accent-mid); }
.site-search svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  stroke: var(--muted); fill: none; stroke-width: 2.2; pointer-events: none;
}
.site-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-count {
  font-weight: 800;
  font-size: 13px;
  background: var(--accent-soft);
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  padding: 4px 10px;
  box-shadow: 2px 2px 0 var(--shadow);
}
.site-menu-btn {
  display: none;
  width: 42px; height: 42px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--shadow);
  font-weight: 900;
  font-size: 18px;
}

.site-body {
  display: grid;
  grid-template-columns: 230px 1fr;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
}
.site-side {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 22px 14px 40px 22px;
  border-right: 2px solid var(--line);
}
.site-side h2 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-side a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
}
.site-side a:hover { background: var(--accent-soft); }
.site-side a.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 3px 3px 0 var(--shadow);
}
.site-side a .n {
  font-size: 11px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--pill);
  min-width: 22px;
  text-align: center;
  padding: 0 5px;
  font-weight: 900;
}
.site-side a.is-active .n { background: #fff; }

.site-main { padding: 8px 28px 80px 24px; min-width: 0; }
.site-intro {
  padding: 28px 8px 10px;
  max-width: 760px;
}
.site-intro h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 0 0 8px;
  line-height: 1.05;
}
.site-intro h1 em {
  font-style: normal;
  color: var(--accent-deep);
  font-family: var(--font-sfx);
  font-size: .7em;
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--accent-mid);
}
.site-intro p { margin: 0; color: var(--muted); font-weight: 700; font-size: 16px; }

.kit-section { padding: 28px 0 10px; scroll-margin-top: 88px; }
.kit-section > .sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ink);
}
.kit-section > .sec-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.kit-section > .sec-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.kit-card.is-hidden, .kit-section.is-hidden { display: none; }
.kit-empty-filter {
  display: none;
  text-align: center;
  padding: 60px 20px;
  font-weight: 800;
  color: var(--muted);
}
.kit-empty-filter.show { display: block; }

.kit-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.kit-copy {
  flex-shrink: 0;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  background: var(--surface);
  font-weight: 800;
  box-shadow: 2px 2px 0 var(--shadow);
}
.kit-copy:hover { transform: translateY(-1px); background: var(--accent-soft); }
.kit-copy.is-ok { background: var(--ok); color: #fff; }

/* Timeline */
.m-timeline { width: min(280px, 100%); text-align: left; }
.m-tl-item { display: grid; grid-template-columns: 16px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.m-tl-item:last-child { padding-bottom: 0; }
.m-tl-item::before {
  content: "";
  position: absolute;
  left: 7px; top: 16px; bottom: 0;
  width: 2px;
  background: var(--ink);
}
.m-tl-item:last-child::before { display: none; }
.m-tl-dot {
  width: 16px; height: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--shadow);
  margin-top: 2px;
  transition: transform .28s var(--ease-spring), background .2s;
}
.m-tl-item.is-on .m-tl-dot { background: var(--accent); transform: scale(1.2); }
.m-tl-body { font-weight: 800; font-size: 13px; }
.m-tl-body span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }

/* ========== Typography elements ========== */
.ty-headline {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
}
.ty-type {
  font-weight: 800;
  font-size: 18px;
  min-height: 1.5em;
  position: relative;
  display: inline-block;
  text-align: left;
}
.ty-type .ty-cursor {
  display: inline-block;
  width: 3px; height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: -2px;
  animation: caretBlink 1s steps(1) infinite;
}
.ty-glitch {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -.02em;
  position: relative;
  cursor: pointer;
  display: inline-block;
}
.ty-glitch.is-on { animation: glitchShake .45s steps(2) both; }
.ty-glitch.is-on::before,
.ty-glitch.is-on::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
}
.ty-glitch.is-on::before { color: var(--danger); transform: translate(3px, -2px); mix-blend-mode: multiply; }
.ty-glitch.is-on::after { color: var(--accent); transform: translate(-3px, 2px); mix-blend-mode: multiply; }
@keyframes glitchShake {
  0%,100% { transform: none; }
  20% { transform: translate(-3px, 1px) skewX(-4deg); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 0) skewX(3deg); }
  80% { transform: translate(2px, 1px); }
}

.ty-speed {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: .02em;
  position: relative;
  display: inline-block;
  cursor: pointer;
  z-index: 1;
}
.ty-speed.is-on { animation: speedSlide .45s var(--ease-out) both; }
@keyframes speedSlide {
  0% { transform: translateX(-18px); letter-spacing: -.08em; }
  60% { transform: translateX(4px); letter-spacing: .06em; }
  100% { transform: none; letter-spacing: .02em; }
}

.ty-outline {
  font-weight: 900;
  font-size: 30px;
  letter-spacing: -.03em;
  color: var(--surface);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 var(--accent);
  cursor: pointer;
  display: inline-block;
  line-height: 1.1;
}
.ty-outline:hover, .ty-outline.is-on {
  transform: translate(-2px, -2px);
  text-shadow: 7px 7px 0 var(--accent-2);
  transition: transform .2s var(--ease-spring), text-shadow .2s var(--ease-spring);
}

.ty-marker {
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
  cursor: pointer;
}
.ty-marker mark {
  background: transparent;
  color: inherit;
  position: relative;
  padding: 0 2px;
  isolation: isolate;
}
.ty-marker mark::before {
  content: "";
  position: absolute;
  left: 0; top: 10%; bottom: 8%;
  width: 0;
  background: #FFE56A;
  z-index: -1;
  transform: rotate(-1.5deg);
  border-radius: 3px;
}
.ty-marker.is-on mark::before { animation: markerWipe .55s var(--ease-out) forwards; }
@keyframes markerWipe { to { width: 100%; } }

.ty-wave { display: inline-flex; font-weight: 900; font-size: 28px; cursor: pointer; line-height: 1; }
.ty-wave span {
  display: inline-block;
  transform-origin: center bottom;
}
.ty-wave.is-on span { animation: letterBounce .7s var(--ease-spring) both; }
@keyframes letterBounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-14px) rotate(-8deg) scale(1.08); }
  100% { transform: translateY(0); }
}

.ty-counter {
  font-weight: 900;
  font-size: 42px;
  letter-spacing: -.04em;
  cursor: pointer;
  display: inline-block;
  min-width: 4ch;
  text-align: center;
}
.ty-counter b { font-size: 14px; color: var(--muted); display: block; font-weight: 800; letter-spacing: 0; }

.ty-sticker {
  display: inline-block;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -.02em;
  background: #FFE56A;
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 6px 14px;
  border-radius: 8px 14px 10px 12px;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-3deg);
  cursor: pointer;
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-spring);
}
.ty-sticker:hover, .ty-sticker.is-on {
  transform: rotate(2deg) translateY(-3px) scale(1.06);
  box-shadow: 7px 7px 0 var(--ink);
}

.ty-bubble {
  position: relative;
  display: inline-block;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 4px 4px 0 var(--shadow);
  max-width: 240px;
  cursor: pointer;
  animation: popIn .35s var(--ease-spring);
}
.ty-bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -12px;
  width: 16px; height: 16px;
  background: var(--surface);
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(45deg);
  box-shadow: 3px 3px 0 var(--shadow);
}
.ty-bubble .sfx {
  position: absolute;
  top: -18px; right: -10px;
  font-family: var(--font-sfx);
  font-size: 14px;
  color: var(--accent-deep);
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  transform: rotate(12deg);
}

/* Dark theme typography tweaks */
[data-theme="dark"] .ty-outline { color: var(--bg); }
[data-theme="dark"] .ty-glitch.is-on::before,
[data-theme="dark"] .ty-glitch.is-on::after { mix-blend-mode: screen; }
[data-theme="dark"] .ty-marker mark::before { background: #C9A227; }
[data-theme="dark"] .ty-sticker { background: #E6C84A; }

.site-backdrop { display: none; }

@media (max-width: 900px) {
  .site-body { grid-template-columns: 1fr; }
  .site-side {
    position: fixed;
    top: 60px; left: 0; bottom: 0;
    width: min(260px, 84vw);
    background: var(--surface);
    z-index: 190;
    transform: translateX(-110%);
    transition: transform .28s var(--ease-out);
    box-shadow: 6px 0 0 var(--shadow);
    border-right: 3px solid var(--ink);
    height: auto;
  }
  .site-side.is-open { transform: none; }
  .site-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .site-main { padding: 8px 14px 80px; }
  .site-logo span.word { display: none; }
  .site-backdrop {
    display: none;
    position: fixed; inset: 0; top: 60px;
    background: rgba(28,28,40,.35);
    z-index: 180;
  }
  .site-backdrop.show { display: block; }
}
@media (max-width: 640px) {
  .site-count { display: none; }
  .site-header { padding: 8px 12px; gap: 8px; }
}

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

/* Library chrome + subcategory tree */
.site-logo .word-theme { color: var(--accent-deep); }
.site-lib-link, .site-theme-switch a {
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  padding: 4px 10px;
  box-shadow: 2px 2px 0 var(--shadow);
  background: var(--surface);
}
.site-theme-switch { display: flex; gap: 6px; align-items: center; }
.site-theme-switch a.is-here { background: var(--accent); color: #fff; }
.site-lib-link:hover, .site-theme-switch a:hover { transform: translateY(-1px); }

.tree-item { margin-bottom: 4px; }
.tree-item > .tree-cat {
  width: 100%;
}
.tree-subs {
  display: flex;
  flex-direction: column;
  padding: 2px 0 6px 12px;
  gap: 1px;
}
.tree-subs a {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 5px 10px;
}
.tree-subs a.is-active {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: none;
}

.kit-subsec { scroll-margin-top: 96px; margin: 8px 0 22px; }
.kit-subsec > h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--accent-deep);
  text-transform: uppercase;
}
.kit-subsec.is-hidden { display: none; }
.site-intro .theme-name {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  padding: 3px 10px;
  box-shadow: 2px 2px 0 var(--shadow);
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .site-theme-switch .swap-label { display: none; }
  .site-lib-link { padding: 4px 8px; }
}


/* Shared non-manga motion FX */
.lg-ripple {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; pointer-events: none; z-index: var(--z-fx);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, white), transparent 70%);
  animation: kit-ripple calc(0.7s * var(--motion)) var(--ease-out) forwards;
}
.lg-ring {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; pointer-events: none; z-index: var(--z-fx);
  border: 2px solid var(--accent);
  animation: kit-ring calc(0.7s * var(--motion)) var(--ease-out) forwards;
}
@keyframes kit-ripple {
  to { transform: scale(18); opacity: 0; }
}
@keyframes kit-ring {
  to { transform: scale(14); opacity: 0; }
}

/* Theme customizer */
.kit-cust-btn { white-space: nowrap; }
.kit-cust {
  position: fixed; top: 0; right: 0; z-index: 160;
  width: min(360px, 100vw); height: 100vh;
  background: var(--surface); color: var(--ink);
  border-left: var(--bd, 2px) solid var(--line-strong, var(--line));
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(0,0,0,.2));
  transform: translateX(110%);
  transition: transform var(--dur-2) var(--ease-out);
  display: flex; flex-direction: column;
}
.kit-cust.is-open { transform: none; }
.kit-cust-head, .kit-cust-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.kit-cust-foot { border-bottom: 0; border-top: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.kit-cust h2 { margin: 0; font-size: 16px; }
.kit-cust-body { overflow: auto; padding: 16px 18px 32px; display: grid; gap: 14px; }
.kit-cust label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kit-cust input[type="color"] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0; }
.kit-cust input[type="range"], .kit-cust select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  background: var(--bg); color: var(--ink);
}
.kit-cust-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kit-cust-scrim {
  position: fixed; inset: 0; background: rgba(10,10,16,.45); z-index: 155;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2);
}
.kit-cust-scrim.is-open { opacity: 1; pointer-events: auto; }

/* Library header nav */
.site-nav {
  display: flex; align-items: center; gap: 4px; margin-left: 12px;
}
.site-nav a {
  text-decoration: none; font-weight: 800; font-size: 13px;
  padding: 6px 10px; border-radius: var(--radius-sm, 10px); color: var(--muted);
}
.site-nav a:hover, .site-nav a.is-active { color: var(--ink); background: var(--accent-soft); }
.site-header .site-lib-link + .site-nav { margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
  .lg-ripple, .lg-ring { animation: none !important; opacity: 0; }
  .kit-cust { transition: none; }
}


/* ========== Layout lock: no horizontal overflow, stable chrome ========== */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
img, video, canvas, svg, iframe { max-width: 100%; }
video, iframe, .media-frame, .preview-frame, .theme-preview {
  height: auto;
}
video, .preview-video, .theme-preview { aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface, #111); }
iframe.live-frame { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
.site-header, .site-body, .site-main, .kit-wrap, .kit-grid, .kit-card,
.tpl-wrap, .tpl-hero, .tpl-bento, .tpl-pricing, .tpl-quotes, .tpl-grid,
.kit-stage, .kit-card-top, .site-side, .tree-subs a, .site-search {
  min-width: 0;
}
.kit-grid, .tpl-bento, .tpl-pricing, .tpl-quotes, .tpl-grid, .tpl-hero {
  width: 100%;
}
.kit-card, .kit-stage, h1, h2, h3, p, .ty-headline, .ty-wave {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.site-side {
  width: 240px;
  flex: 0 0 240px;
  max-width: 80vw;
}
.site-body { display: flex; align-items: flex-start; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 24px 16px 80px; width: 100%; }
.site-main { flex: 1 1 auto; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  max-width: 100%;
  box-sizing: border-box;
}
.site-search { flex: 1 1 160px; min-width: 0; }
.site-header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.site-nav { flex-wrap: wrap; }
@media (max-width: 1024px) {
  .site-nav, .site-count, .site-theme-switch, .site-lib-link { display: none !important; }
  .site-search { display: none; }
  .site-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
    transform: translateX(-110%);
    transition: transform var(--dur-2, .2s) var(--ease-out, ease);
    background: var(--surface); box-shadow: var(--shadow-lg);
    padding: 20px 16px 32px;
    overflow: auto;
    width: min(300px, 86vw);
    flex-basis: auto;
  }
  .site-side.is-open { transform: none; }
  .site-body { padding: 16px 12px 64px; display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .site-side { transition: none; }
}

@media (max-width: 720px) {
  .site-header-actions .m-btn { padding-left: 8px; padding-right: 8px; font-size: 12px; }
  .site-header-actions a[href$="-components.zip"] { display: none; }
  .site-logo .word { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.m-acc-body { display: none; padding: 0 4px 10px; color: var(--muted); }
.m-acc-item.open .m-acc-body { display: block; }
.m-acc-btn { width: 100%; text-align: left; font-weight: 700; padding: 10px 0; }
