:root {
  --paper: #F6F6F3;
  --page: #EBEBE6;
  --surface: #FFFFFF;
  --ink: #141413;
  --ink-2: #4C4C47;
  --ink-3: #6E6E68;
  --rule: rgba(20, 20, 19, 0.10);
  --lime: #BDFC0E;
  --lime-hl: rgba(189, 252, 14, 0.50);
  --in-oklab: ;
  --target-size: 24px;
  --font-display: 'Anuphan', 'Noto Sans Thai', -apple-system, sans-serif;
  --font-body: 'Google Sans', 'Anuphan', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  --font: var(--font-body);
}

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

@supports (background: linear-gradient(in oklab, white, black)) {
  :root { --in-oklab: in oklab; }
}

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

html {
  scroll-padding-top: calc(7rem + env(safe-area-inset-top, 0px));
  scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  line-height: 1.5;
  overflow-wrap: break-word;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding: 16px 20px 56px;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Shared Controls & Tokens ---------- */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--lime);
  border: 1px solid rgba(20, 20, 19, 0.18);
  flex-shrink: 0;
}

.brand-title,
.dock-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}

.btn {
  background: var(--lime);
  color: var(--ink);
  border: 1px solid rgba(20, 20, 19, 0.14);
  padding: 8px 14px;
  min-block-size: 36px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter 0.15s, transform 0.15s, background-color 0.15s;
  text-decoration: none;
}

.btn:hover { filter: brightness(0.96); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--rule);
  font-weight: 600;
  color: var(--ink);
}

.btn-secondary:hover { background: var(--paper); filter: none; }

/* Lime-as-highlighter compliant highlight tool button (never lime text on black) */
.btn-hl-tool {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-weight: 700;
}

.btn-hl-tool:hover { background: var(--paper); filter: none; }

.hl-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--lime);
  border: 1px solid rgba(20, 20, 19, 0.25);
  display: inline-block;
}

.btn-full { width: 100%; }
.btn-compact { padding: 6px 10px; min-block-size: 32px; font-size: 11.5px; }
.flex-1 { flex: 1; }

.text-link-btn {
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 4px;
}

.text-link-btn:hover { color: var(--ink); text-decoration: underline; }

.segmented,
.view-switcher {
  display: flex;
  background: rgba(20, 20, 19, 0.06);
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
}

.view-switcher { width: 100%; }

.seg-btn,
.view-btn {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  color: var(--ink-2);
  padding: 6px 10px;
  min-block-size: 30px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.seg-btn.active,
.view-btn.active {
  background: var(--ink);
  color: #FFFFFF;
}

.segmented-compact .seg-btn {
  padding: 5px 10px;
  min-block-size: 28px;
  font-size: 11.5px;
}

.source-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  min-height: 150px;
}

.source-textarea:focus,
.text-input:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}

.text-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink);
}

/* ---------- Desktop App Shell & Side Dock ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "stage";
  gap: 18px;
  max-width: 1720px;
  margin: 0 auto;
}

.control-dock {
  display: none;
  grid-area: dock;
  background: rgba(246, 246, 243, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--rule);
  padding: 14px;
  border-radius: 18px;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(20, 20, 19, 0.06);
}

.workspace-stage {
  grid-area: stage;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 920px) {
  .mobile-topbar,
  .mobile-bottombar,
  .mobile-editor-panel {
    display: none !important;
  }

  .app-shell {
    grid-template-columns: 310px minmax(0, 1fr);
    grid-template-areas: "dock stage";
    align-items: start;
    gap: 24px;
  }

  body.dock-right .app-shell {
    grid-template-columns: minmax(0, 1fr) 310px;
    grid-template-areas: "stage dock";
  }

  .control-dock {
    display: flex;
    position: sticky;
    top: 16px;
    max-block-size: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.dock-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--rule);
}

.dock-section:last-child { padding-bottom: 0; border-bottom: none; }

.dock-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-mini-actions { display: flex; gap: 6px; }

.dock-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0;
}

.dock-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Mobile Shell (< 920px) ---------- */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(235, 235, 230, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  margin: -16px -12px 14px;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-slide-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.06);
}

.mobile-editor-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.mobile-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.editor-hint {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.editor-hint code {
  background: var(--lime-hl);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
}

.mobile-editor-actions { display: flex; gap: 6px; }

.mobile-slug-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slug-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.source-textarea-mobile {
  min-height: 52dvh;
  font-size: 15px; /* Prevents iOS Safari zoom on focus */
  padding: 14px;
}

.mobile-editor-footer {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.mobile-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(246, 246, 243, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--rule);
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mob-action-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 6px 4px;
  min-block-size: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.mob-action-btn:active { background: rgba(20, 20, 19, 0.06); }

.mob-action-primary {
  background: var(--lime);
  border-color: rgba(20, 20, 19, 0.14);
  font-weight: 700;
}

.mob-action-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.mob-action-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hl-swatch-icon {
  width: 20px;
  height: 11px;
  border-radius: 3px;
  background: var(--lime);
  border: 1.5px solid var(--ink);
  margin: 4px 0 5px;
}

@media (max-width: 919px) {
  body { padding: 16px 12px 92px; }

  body.mobile-tab-editor .mobile-subbar,
  body.mobile-tab-editor .workspace-stage,
  body.mobile-tab-editor .mobile-bottombar {
    display: none;
  }

  body.mobile-tab-editor .mobile-editor-panel {
    display: flex;
  }

  body.mobile-tab-preview .mobile-editor-panel {
    display: none;
  }

  .swipe-nav {
    margin-bottom: 12px;
    padding: 6px 12px;
    gap: 10px;
  }
}

/* ---------- Native <dialog> Bottom Sheets (Modern Web Guidance) ---------- */
dialog.bottom-sheet {
  margin: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 82dvh;
  border: none;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 18px max(22px, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(20, 20, 19, 0.16);
  overflow: auto;
}

dialog.bottom-sheet:modal {
  overscroll-behavior: contain;
}

dialog.bottom-sheet::backdrop {
  background: rgba(20, 20, 19, 0.42);
  backdrop-filter: blur(2px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.22);
  margin: 0 auto 12px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.sheet-close {
  min-inline-size: var(--target-size);
  min-block-size: var(--target-size);
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: 0.9375rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-divider {
  height: 1px;
  background: var(--rule);
  margin: 4px 0;
}

.sheet-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------- Swipe / Grid / Scaled Stage ---------- */
.swipe-nav {
  display: none;
  align-items: center;
  gap: 14px;
  background: rgba(246, 246, 243, 0.94);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  margin-bottom: 16px;
}

body.mode-swipe .swipe-nav { display: flex; }

.nav-arrow {
  min-inline-size: max(34px, var(--target-size));
  min-block-size: max(34px, var(--target-size));
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: 1.125rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.nav-arrow:hover:not(:disabled) { background: var(--lime); border-color: rgba(20, 20, 19, 0.14); }
.nav-arrow:disabled { opacity: 0.3; cursor: default; }

.swipe-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.swipe-dot {
  height: 7px;
  width: 7px;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.18);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.2s, background-color 0.2s;
}

.swipe-dot.active { width: 20px; background: var(--ink); }

.swipe-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.carousel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 480px));
  gap: 28px;
  justify-content: center;
  width: 100%;
  max-width: 1600px;
}

body.mode-swipe .carousel-grid { display: flex; justify-content: center; }
body.mode-swipe .slide-wrapper { display: none; }
body.mode-swipe .slide-wrapper.active-slide { display: flex; }

.slide-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.slide-scaler {
  position: relative;
  width: 480px;
  height: 600px;
  flex-shrink: 0;
}

.slide-scaler > .slide {
  transform-origin: top left;
}

.slide-btn { padding: 6px 14px; font-size: 12px; }

@media (max-width: 919px) {
  .slide-btn { display: none; }
}

/* ---------- Slide (480x600 -> 1080x1350 Studio Minimal Neon Lime CI) ---------- */
.slide {
  width: 480px;
  height: 600px;
  background: var(--paper);
  padding: 24px 36px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(20, 20, 19, 0.06);
}

[contenteditable="true"] {
  outline: none;
  border-radius: 2px;
  transition: box-shadow 0.15s;
}

[contenteditable="true"]:hover { box-shadow: 0 0 0 1px rgba(20, 20, 19, 0.08); }
[contenteditable="true"]:focus { box-shadow: 0 0 0 2px rgba(189, 252, 14, 0.85); }

/* Highlight Styles: Default = Full Pill, Optional = Half Marker */
.hl {
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
  line-height: 1.26;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--ink);
  background-color: var(--lime-hl);
}

body.hl-marker .hl {
  background-color: transparent;
  background-image: linear-gradient(transparent 56%, var(--lime-hl) 56%);
  border-radius: 0;
  padding: 0 2px;
  font-weight: 600;
}

body.hl-wrap .hl {
  display: inline;
  white-space: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.slide-top,
.slide-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.top-brand,
.top-num,
.bottom-action {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-3);
}

.top-num { font-variant-numeric: tabular-nums; }

.who { display: flex; align-items: center; gap: 6px; }

.who-avatar {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--lime);
  display: block;
  opacity: 0.85;
}

.who-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.who-name {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-3);
}

.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 0;
  position: relative;
  z-index: 2;
}

/* Cover Photo Layer & Scrim */
.cover-photo-layer {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.cover-photo-layer img {
  position: absolute;
  max-width: none;
  max-height: none;
  display: block;
  pointer-events: none;
  user-select: none;
}

.cover-scrim-layer {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.slide.has-photo { cursor: grab; }
.slide.has-photo:active { cursor: grabbing; }
.slide.has-photo [contenteditable="true"] { cursor: text; }

.slide.has-photo .cover-photo-layer,
.slide.has-photo .cover-scrim-layer { display: block; }

.slide.is-cover.has-photo.photo-pos-bottom .slide-body { justify-content: flex-end; padding-bottom: 14px; }
.slide.is-cover.has-photo.photo-pos-center .slide-body { justify-content: center; padding-bottom: 12px; }

.slide.has-photo:not(.photo-theme-light) .cover-scrim-layer {
  background: linear-gradient(
    to top var(--in-oklab),
    rgba(12, 12, 12, var(--scrim-alpha, 0.84)) 0%,
    rgba(12, 12, 12, calc(var(--scrim-alpha, 0.84) * 0.88)) calc(var(--scrim-stop, 44%) * 0.52),
    rgba(12, 12, 12, calc(var(--scrim-alpha, 0.84) * 0.34)) calc(var(--scrim-stop, 44%) * 0.82),
    rgba(12, 12, 12, 0) var(--scrim-stop, 44%)
  );
}

.slide.has-photo.photo-pos-center:not(.photo-theme-light) .cover-scrim-layer {
  background: linear-gradient(
    to bottom var(--in-oklab),
    rgba(12, 12, 12, 0) 14%,
    rgba(12, 12, 12, var(--scrim-alpha, 0.84)) 48%,
    rgba(12, 12, 12, calc(var(--scrim-alpha, 0.84) * 0.72)) 78%,
    rgba(12, 12, 12, 0) 96%
  );
}

.slide.has-photo:not(.photo-theme-light) { color: #FFFFFF; }

.slide.has-photo:not(.photo-theme-light) .top-brand,
.slide.has-photo:not(.photo-theme-light) .top-num,
.slide.has-photo:not(.photo-theme-light) .eb-text {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72), 0 1px 2px rgba(0, 0, 0, 0.65);
}

.slide.has-photo:not(.photo-theme-light) .who-name,
.slide.has-photo:not(.photo-theme-light) .bottom-action {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

.slide.has-photo:not(.photo-theme-light) .title-hook {
  color: #FFFFFF;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.76), 0 1px 4px rgba(0, 0, 0, 0.68);
}

.slide.has-photo:not(.photo-theme-light) .subtitle-hook {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.76), 0 1px 3px rgba(0, 0, 0, 0.68);
}

.slide.has-photo:not(.photo-theme-light) .hl {
  background-color: var(--lime);
  color: var(--ink);
  text-shadow: none;
}

body.hl-marker .slide.has-photo:not(.photo-theme-light) .hl {
  background-color: transparent;
  background-image: linear-gradient(transparent 56%, rgba(189, 252, 14, 0.85) 56%);
  color: #FFFFFF;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.76);
}

.slide.has-photo.photo-theme-light .cover-scrim-layer {
  background: linear-gradient(
    to top var(--in-oklab),
    rgba(246, 246, 243, var(--scrim-alpha, 0.9)) 0%,
    rgba(246, 246, 243, calc(var(--scrim-alpha, 0.9) * 0.88)) calc(var(--scrim-stop, 44%) * 0.52),
    rgba(246, 246, 243, calc(var(--scrim-alpha, 0.9) * 0.36)) calc(var(--scrim-stop, 44%) * 0.82),
    rgba(246, 246, 243, 0) var(--scrim-stop, 44%)
  );
}

.slide.has-photo.photo-theme-light.photo-pos-center .cover-scrim-layer {
  background: linear-gradient(
    to bottom var(--in-oklab),
    rgba(246, 246, 243, 0) 14%,
    rgba(246, 246, 243, var(--scrim-alpha, 0.9)) 48%,
    rgba(246, 246, 243, calc(var(--scrim-alpha, 0.9) * 0.72)) 78%,
    rgba(246, 246, 243, 0) 96%
  );
}

.slide.has-photo.photo-theme-light .title-hook,
.slide.has-photo.photo-theme-light .subtitle-hook,
.slide.has-photo.photo-theme-light .who-name,
.slide.has-photo.photo-theme-light .top-num {
  text-shadow: 0 1px 10px rgba(246, 246, 243, 0.85);
}

.slide.has-photo.photo-theme-light .hl {
  background-color: rgba(189, 252, 14, 0.86);
  color: var(--ink);
  text-shadow: none;
}

.cover-photo-bar {
  display: none;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-2);
}

.cover-photo-bar.is-visible { display: flex; }

.cp-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cp-slider {
  width: 150px;
  accent-color: var(--ink);
  cursor: pointer;
}

/* Cover Typography */
.is-cover .slide-body { justify-content: center; padding-bottom: 10px; }
.slide.is-cover .slide-bottom { justify-content: flex-end; }
.cover-mark { width: 32px; height: 4px; background: var(--lime); margin: 4px 0 18px; }

.title-hook {
  font-family: var(--font-display);
  font-size: 2.625rem;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}

.subtitle-hook {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink-2);
  margin-top: 16px;
  text-wrap: pretty;
}

/* Eyebrow + Title */
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.eb-mark { width: 7px; height: 7px; background: var(--lime); display: block; }
.eb-text { font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }

.title-standard {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 16px;
  text-wrap: balance;
}

/* Rows */
.rows { list-style: none; border-bottom: 1px solid var(--rule); }
.row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); }

.row-idx {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
  padding-top: 4px;
  min-width: 18px;
  font-variant-numeric: tabular-nums;
}

.row-main { flex: 1; min-inline-size: 0; }

.row-lead {
  font-family: var(--font-display);
  font-size: 1.09375rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink);
  margin-bottom: 4px;
  text-wrap: balance;
}

.row-text {
  font-family: var(--font-body);
  font-size: 1.09375rem;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Ledger (Case Study) */
.ledger { border-bottom: 1px solid var(--rule); }

.ledger-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}

.ledger-label { font-size: 0.875rem; font-weight: 600; color: var(--ink-3); line-height: 1.48; padding-top: 2px; }
.ledger-value { font-size: 1rem; line-height: 1.52; color: var(--ink-2); text-wrap: pretty; }
.ledger-row.total { border-top: 2px solid var(--ink); }
.ledger-row.total .ledger-label { color: var(--ink); }
.ledger-row.total .ledger-value { color: var(--ink); font-weight: 500; }

/* Verdict (A / B) */
.opts { border-bottom: 1px solid var(--rule); }
.opt { display: flex; gap: 14px; padding: 11px 0; border-top: 1px solid var(--rule); }
.opt-letter { font-size: 2rem; line-height: 1; font-weight: 300; color: var(--ink); min-width: 26px; padding-top: 2px; }
.opt:first-child .opt-letter { color: #638700; font-weight: 700; }
.opt-main { flex: 1; min-inline-size: 0; }
.opt-lead { font-family: var(--font-display); font-size: 1.03125rem; font-weight: 600; line-height: 1.45; margin-bottom: 4px; text-wrap: balance; }
.opt-reason { font-size: 0.9375rem; line-height: 1.52; color: var(--ink-2); text-wrap: pretty; }
.opt-reason + .opt-reason { margin-top: 4px; }

/* Head-to-Head Table */
.h2h-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  margin-top: 2px;
}

.h2h-table th,
.h2h-table td {
  padding: 9px 7px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.h2h-table th {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(20, 20, 19, 0.04);
  border-bottom: 1.5px solid var(--ink);
  text-wrap: balance;
}

.h2h-table td:first-child,
.h2h-table th:first-child {
  font-weight: 600;
  color: var(--ink);
  padding-left: 2px;
}

/* Footnote & CTA */
.b2b2c-footnote {
  margin-top: 12px;
  padding: 8px 11px;
  background: rgba(20, 20, 19, 0.045);
  border-left: 3px solid var(--ink);
  font-size: 0.78125rem;
  line-height: 1.48;
  color: var(--ink-2);
  font-weight: 500;
  border-radius: 0 3px 3px 0;
  text-wrap: pretty;
}

.cta-banner {
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.48;
  text-align: center;
}

.cta-banner .hl { background-color: var(--lime); color: var(--ink); }

/* ---------- Clean Mode ---------- */
body.mode-clean .slide { padding: 34px 38px 30px; }
body.mode-clean .top-brand,
body.mode-clean .top-num,
body.mode-clean .slide-top,
body.mode-clean .eyebrow,
body.mode-clean .bottom-action,
body.mode-clean .slide.is-cover .slide-bottom,
body.mode-clean .row-idx { display: none; }
body.mode-clean .title-hook { font-size: 2.375rem; line-height: 1.26; }
body.mode-clean .subtitle-hook { font-size: 1.25rem; line-height: 1.62; margin-top: 20px; }
body.mode-clean .title-standard { font-size: 1.875rem; line-height: 1.3; font-weight: 700; margin-bottom: 20px; }
body.mode-clean .rows { border-bottom: none; }
body.mode-clean .row { padding: 12px 0; border-top: none; gap: 0; }
body.mode-clean .row-lead { font-size: 1.1875rem; line-height: 1.45; margin-bottom: 4px; }
body.mode-clean .row-text { font-size: 1.21875rem; line-height: 1.55; color: var(--ink); }
body.mode-clean .ledger-label { font-size: 0.9375rem; }
body.mode-clean .ledger-value { font-size: 1.09375rem; color: var(--ink); }
body.mode-clean .opt-lead { font-size: 1.125rem; }
body.mode-clean .opt-reason { font-size: 1.03125rem; color: var(--ink); }
body.mode-clean .h2h-table th,
body.mode-clean .h2h-table td { font-size: 0.9375rem; }
body.mode-clean .cta-banner { font-size: 1rem; padding: 14px 16px; margin-top: 16px; line-height: 1.5; }

/* ---------- IG Post Preview Mockup ---------- */
.ig-mockup-container { display: none; width: 100%; max-width: 480px; margin: 0 auto 24px; }
body.mode-ig .ig-mockup-container { display: flex; flex-direction: column; }
body.mode-ig .carousel-grid,
body.mode-ig .swipe-nav { display: none; }

.ig-card {
  background: #FFFFFF;
  border: 1px solid rgba(20, 20, 19, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(20, 20, 19, 0.08);
}

.ig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(20, 20, 19, 0.06);
}

.ig-user-info { display: flex; align-items: center; gap: 10px; }

.ig-avatar-ring {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  display: grid;
  place-items: center;
}

.ig-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  object-fit: cover;
  display: block;
}

.ig-handle { font-size: 13px; font-weight: 600; color: #262626; }
.ig-subtitle { font-size: 11px; color: #8e8e8e; }
.ig-more-dots { color: #262626; font-size: 16px; font-weight: 700; }

.ig-stage-frame {
  position: relative;
  width: 100%;
  background: var(--paper);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.ig-stage-frame .slide { box-shadow: none; border-radius: 0; }

.ig-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
}

.ig-left-actions { display: flex; align-items: center; gap: 14px; }
.ig-icon-btn { display: grid; place-items: center; color: #262626; }
.ig-icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.ig-pagination-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 2px;
}

.ig-p-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
}

.ig-p-dot.active { width: 16px; background: var(--ink); }

.ig-meta-content { padding: 4px 14px 14px; font-size: 13px; line-height: 1.45; color: #262626; }
.ig-caption-user { font-weight: 700; margin-right: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #FFFFFF;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 90;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 920px) {
  .toast { bottom: 24px; }
}
