:root {
  --bg-light: #FAFAFC;
  --bg-dark: #0A0A0D;
  --surface-light: #FFFFFF;
  --surface-dark: #151519;
  --surface-2-light: #EFEFF4;
  --surface-2-dark: #222228;
  --ink-light: #121317;
  --ink-dark: #F7F7FA;
  --muted-light: #5F6472;
  --muted-dark: #9A9AA6;
  --border-light: #E4E6EC;
  --border-dark: rgba(255, 255, 255, 0.1);
  --accent-light: #E1306C;
  --accent-dark: #FF3B5C;
  --accent-ink-light: #FFFFFF;
  --accent-ink-dark: #FFFFFF;
  --accent-soft-light: #FDEAF1;
  --accent-soft-dark: rgba(255, 59, 92, 0.18);
  --dock-light: rgba(255, 255, 255, 0.88);
  --dock-dark: rgba(21, 21, 25, 0.88);
  --success-light: #047857;
  --success-dark: #34D399;
  --danger-light: #DC2626;
  --danger-dark: #F87171;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-2: var(--surface-2-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --border: var(--border-light);
  --accent: var(--accent-light);
  --accent-ink: var(--accent-ink-light);
  --accent-soft: var(--accent-soft-light);
  --dock-bg: var(--dock-light);
  --success: var(--success-light);
  --danger: var(--danger-light);

  --target-size: 24px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light dark;
  accent-color: var(--accent);

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }
  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }
}

@media (pointer: coarse) {
  :root { --target-size: 44px; }
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-2: var(--surface-2-dark);
    --ink: var(--ink-dark);
    --muted: var(--muted-dark);
    --border: var(--border-dark);
    --accent: var(--accent-dark);
    --accent-ink: var(--accent-ink-dark);
    --accent-soft: var(--accent-soft-dark);
    --dock-bg: var(--dock-dark);
    --success: var(--success-dark);
    --danger: var(--danger-dark);
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --surface-2: var(--surface-2-dark);
  --ink: var(--ink-dark);
  --muted: var(--muted-dark);
  --border: var(--border-dark);
  --accent: var(--accent-dark);
  --accent-ink: var(--accent-ink-dark);
  --accent-soft: var(--accent-soft-dark);
  --dock-bg: var(--dock-dark);
  --success: var(--success-dark);
  --danger: var(--danger-dark);
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-2: light-dark(var(--surface-2-light), var(--surface-2-dark));
    --ink: light-dark(var(--ink-light), var(--ink-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --accent-ink: light-dark(var(--accent-ink-light), var(--accent-ink-dark));
    --accent-soft: light-dark(var(--accent-soft-light), var(--accent-soft-dark));
    --dock-bg: light-dark(var(--dock-light), var(--dock-dark));
    --success: light-dark(var(--success-light), var(--success-dark));
    --danger: light-dark(var(--danger-light), var(--danger-dark));
  }
}

/* Theme toggle icon visibility (no JS class branching needed) */
.icon-sun { display: none; }
.icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .icon-sun { display: block; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .icon-moon { display: none; }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .icon-sun { display: block; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .icon-moon { display: none; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  scroll-padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms ease, color 220ms ease;
}

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], a) {
  min-block-size: var(--target-size);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

/* Auth */
.auth-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
}
.auth-card h1 { margin: 14px 0 4px; font-size: 1.5rem; letter-spacing: -0.03em; }
.auth-desc { margin: 0 0 20px; color: var(--muted); font-size: 0.94rem; }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
}

/* Header (Compact single-line, zero 2-line wrap on mobile) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner, .toolbar, .content {
  max-width: 960px;
  margin: 0 auto;
  padding-inline: 16px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
}
.brand { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.brand-dot {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.count-pill {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.avatar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 5px;
  min-block-size: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms var(--ease-spring);
}
.avatar-pill:active { transform: scale(0.95); }
.avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 800;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms var(--ease-spring), opacity 150ms ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-full { width: 100%; }

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 140ms var(--ease-spring);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Toolbar */
.toolbar { padding-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-block-size: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.search-icon { color: var(--muted); flex-shrink: 0; }
.search-wrap input {
  border: 0;
  background: transparent;
  width: 100%;
  min-block-size: 40px;
  outline: none;
  font-size: 0.94rem;
}

.filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-inline-size: 0;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.chip, .ghost-chip {
  flex: 0 0 auto;
  min-block-size: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms var(--ease-spring), background-color 160ms ease, color 160ms ease;
}
.chip:active, .ghost-chip:active { transform: scale(0.95); }
.chip[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.ghost-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* Quota Banner */
.quota-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.quota-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 8px;
}
.quota-head span { color: var(--muted); font-weight: 600; }
.quota-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 360ms var(--ease-spring);
}

/* Minimal 3-column poster grid: thumbnail on top, title below */
.content { padding-block: 14px calc(104px + env(safe-area-inset-bottom, 0px)); }
.reels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
}
@media (min-width: 680px) {
  .reels-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px 12px;
  }
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.reel-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-align: left;
  min-width: 0;
  animation: cardRise 240ms var(--ease-spring) both;
  animation-delay: calc(var(--i, 0) * 25ms);
  transition: transform 160ms var(--ease-spring);
}
.reel-card:active { transform: scale(0.96); }
.reel-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #18181D;
}
.reel-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tone-recipe .reel-thumb { background: #F59E0B; }
.tone-ai .reel-thumb { background: #2563EB; }
.tone-place .reel-thumb { background: #10B981; }
.tone-tip .reel-thumb { background: #6366F1; }
.tone-etc .reel-thumb { background: #E1306C; }

.reel-pill {
  position: absolute;
  left: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel-play-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
}
.reel-play-badge svg { width: 10px; height: 10px; }
.reel-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reel-foot {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floating Bottom Dock */
.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 24px));
  background: var(--dock-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.dock-btn {
  border: 0;
  background: transparent;
  border-radius: 16px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
  transition: transform 140ms var(--ease-spring), color 150ms ease;
}
.dock-btn:active { transform: scale(0.92); }
.dock-btn[aria-current="page"], .dock-btn[aria-pressed="true"] { color: var(--accent); }
.dock-fab {
  background: var(--accent);
  color: var(--accent-ink);
}
.dock-fab[aria-pressed="true"] { color: var(--accent-ink); }

/* Empty state */
.empty-state {
  max-width: 360px;
  margin: 56px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.empty-state h2 { margin: 4px 0 0; font-size: 1.12rem; }
.empty-state p { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }

/* Animated Top-Layer Bottom-Sheet Modal */
dialog.modal {
  margin: auto auto 0;
  width: min(560px, 100vw);
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  overscroll-behavior: contain;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 280ms;
  transition-timing-function: var(--ease-spring);
  transition-behavior: allow-discrete;
}
@media (min-width: 780px) {
  dialog.modal {
    margin: auto;
    border-bottom: 1px solid var(--border);
    border-radius: 22px;
    max-height: calc(100dvh - 40px);
  }
  dialog.modal-wide { width: min(900px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.modal { transform: translateY(28px); }
}
dialog.modal::backdrop {
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, display, overlay;
  transition-duration: 280ms;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
:is(dialog.modal[open]):where(:not([data-closing])) {
  opacity: 1;
  @starting-style { opacity: 0; }
  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(0);
    @starting-style { transform: translateY(28px); }
  }
  &::backdrop {
    background-color: rgba(0, 0, 0, 0.56);
    @starting-style { background-color: rgba(0, 0, 0, 0); }
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 10px auto 0;
}
@media (min-width: 780px) { .sheet-handle { display: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-head h2 { margin: 0; font-size: 1.08rem; letter-spacing: -0.02em; }
.modal-body { padding: 18px 18px max(24px, env(safe-area-inset-bottom, 0px)); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  min-block-size: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 400;
}
.field textarea { min-block-size: 86px; resize: vertical; }
.hint-text { color: var(--muted); font-size: 0.82rem; font-weight: 400; margin: 0; }
.disclosure summary { cursor: pointer; font-size: 0.88rem; color: var(--accent); font-weight: 700; padding: 4px 0; }
.caption-raw {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-line;
}
.error-text { margin: 0; color: var(--danger); font-size: 0.88rem; font-weight: 600; }

/* Detail & In-app Reels/Video Player */
.detail-head-meta, .detail-head-actions { display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-select {
  appearance: auto;
  min-block-size: 34px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.author-tag { font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 780px) {
  .detail-layout:has(.reel-stage:not([hidden]), .reel-poster-stage:not([hidden])) {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
  }
}
.reel-stage {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #000000;
}
.reel-stage video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 580px;
  border: 0;
  display: block;
  background: #000000;
}
.reel-poster-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 440px;
  background: linear-gradient(150deg, #27272F, #111116);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.reel-poster-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reel-poster-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 12%, rgba(0, 0, 0, 0.28) 60%, rgba(0, 0, 0, 0.12));
  text-align: center;
}
.reel-open-cta {
  width: 100%;
  max-width: 260px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(225, 48, 108, 0.35);
}
.reel-poster-hint {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
}
.text-link { color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }

.detail-title { margin: 0; font-size: 1.2rem; line-height: 1.35; letter-spacing: -0.02em; }
.detail-summary { margin: 0; color: var(--muted); white-space: pre-line; font-size: 0.94rem; }
.title-row { display: flex; align-items: flex-start; gap: 8px; }
.title-row .detail-title { flex: 1; min-inline-size: 0; overflow-wrap: anywhere; }
.title-row .icon-btn { flex: none; width: 36px; height: 36px; }
.inline-edit { display: flex; gap: 8px; }
.inline-edit input { flex: 1; min-inline-size: 0; }

.detail-section h3 { margin: 0 0 8px; font-size: 0.94rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; min-block-size: 36px; cursor: pointer; flex: 1; min-inline-size: 0; }
.ing-del-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-block-size: 34px;
  min-inline-size: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ing-del-btn:hover { background: var(--surface-2); color: var(--danger); }
.ing-add-form { margin-top: 10px; }
.checklist input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.checklist input[type="checkbox"]:checked + span { text-decoration: line-through; color: var(--muted); }

@supports not (accent-color: #E1306C) {
  .checklist input[type="checkbox"] {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
  }
  .checklist label { position: relative; padding-left: 30px; }
  .checklist input[type="checkbox"] + span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
  }
  .checklist input[type="checkbox"]:checked + span::before { background: var(--accent); border-color: var(--accent); }
  .checklist input[type="checkbox"]:checked + span::after {
    content: "✓";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-ink);
    font-size: 0.85rem;
    font-weight: 700;
  }
}

.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.link-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; }

.detail-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.detail-footer-left { display: flex; gap: 8px; }
.guide-block h3 { margin: 0 0 8px; font-size: 0.98rem; }
.code-box {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
  width: max-content;
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 60;
}

.save-pill {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  z-index: 59;
}
.save-pill::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pillSpin 0.8s linear infinite;
}
.save-pill::after {
  content: '열기';
  flex: none;
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  font-size: 0.8rem;
  opacity: 0.85;
}
@keyframes pillSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .reel-card { animation: none !important; }
  dialog.modal, dialog.modal::backdrop { transition-duration: 100ms; }
  .save-pill::before { animation-duration: 2.4s; }
}
