/* Kadr Studio v2.3 — 6-Grid Preset Background Picker, Clean Bento Hero & 5 Distinct Full-BG Poster Architectures */

:root,
html[data-ui-mode="dark"] {
  --ui-shell-bg: #18191d;
  --ui-topbar-bg: #18191d;
  --ui-sidebar-bg: #18191d;
  --ui-stage-bg: #111216;
  --ui-card: #22242a;
  --ui-control: #191b20;
  --ui-control-hover: #2c2f37;
  --ui-pill-idle: #24262d;
  --ui-border: rgba(255, 255, 255, 0.08);
  --ui-border-strong: rgba(255, 255, 255, 0.18);
  --ui-text: #f4f5f8;
  --ui-text-muted: #b9c0ce;

  --ui-primary: #d6f865;
  --ui-on-primary: #141518;
  --ui-secondary-badge-bg: #9b8aff;
  --ui-secondary-badge-ink: #12101c;
  --ui-preset-active-bg: #d6f865;
  --ui-preset-active-ink: #141518;
  --ui-ghost-bg: rgba(214, 248, 101, 0.13);
  --ui-ghost-border: rgba(214, 248, 101, 0.36);
  --ui-ghost-ink: #dcfb78;
  --ui-icon-circle-bg: #2a2d35;
  --ui-icon-circle-ink: #d6f865;
  --ui-focus: #d6f865;
  --ui-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.22);
  --ui-scrollbar: rgba(255, 255, 255, 0.18);

  --font-cjk-sans: "MiSans", "Alibaba PuHuiTi 3.0", "Alibaba PuHuiTi 2.0", "Alibaba PuHuiTi", "HarmonyOS Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-grotesque: "Archivo", "MiSans", "Alibaba PuHuiTi 3.0", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-condensed: "Barlow Condensed", "Archivo Black", "MiSans", "Noto Sans SC", sans-serif;
  --font-geometric: "Sora", "MiSans", "Alibaba PuHuiTi 3.0", "Noto Sans SC", sans-serif;
  --font-mono: "Azeret Mono", "MiSans", "Noto Sans SC", monospace;
  --font-pixel: "Silkscreen", "DotGothic16", "MiSans", monospace;
}

html[data-ui-mode="light"] {
  --ui-shell-bg: #ffffff;
  --ui-topbar-bg: #ffffff;
  --ui-sidebar-bg: #ffffff;
  --ui-stage-bg: #f1f3f6;
  --ui-card: #ffffff;
  --ui-control: #f2f4f7;
  --ui-control-hover: #e7ebf0;
  --ui-pill-idle: #f1f3f6;
  --ui-border: #e4e7ec;
  --ui-border-strong: #cdd3de;
  --ui-text: #111318;
  --ui-text-muted: #454f5e;

  --ui-primary: #0b61ec;
  --ui-on-primary: #ffffff;
  --ui-secondary-badge-bg: #eef4ff;
  --ui-secondary-badge-ink: #084ec2;
  --ui-preset-active-bg: #14161b;
  --ui-preset-active-ink: #ffffff;
  --ui-ghost-bg: #eef4ff;
  --ui-ghost-border: #bfd6ff;
  --ui-ghost-ink: #084ec2;
  --ui-icon-circle-bg: #f1f3f6;
  --ui-icon-circle-ink: #0b61ec;
  --ui-focus: #0b61ec;
  --ui-shadow-card: 0 2px 10px rgba(16, 24, 40, 0.04);
  --ui-scrollbar: rgba(17, 19, 24, 0.20);
}

*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--ui-primary); color: var(--ui-on-primary); }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ui-shell-bg);
  color: var(--ui-text);
  font-family: var(--font-grotesque);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ui-scrollbar); border-radius: 999px; }

#printDeckContainer { display: none; }

/* =========================================================
   STUDIO CHROME & 6-GRID PRESET PHOTO PICKER
   ========================================================= */
.studio-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
  background: var(--ui-shell-bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 10px 22px;
  background: var(--ui-topbar-bg);
  border-bottom: 1px solid var(--ui-border);
  gap: 10px 14px;
  z-index: 20;
}

.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ui-primary);
  color: var(--ui-on-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; color: var(--ui-text); }
.brand-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ui-secondary-badge-bg);
  color: var(--ui-secondary-badge-ink);
}
.draft-status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: var(--ui-pill-idle);
  color: var(--ui-text-muted);
  border: 1px solid var(--ui-border);
  white-space: nowrap;
}
.draft-status-pill.warn {
  background-color: #3a1919;
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
}
html[data-ui-mode="light"] .draft-status-pill.warn {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.overflow-warn-bar {
  font-size: 12px;
  line-height: 1.45;
  padding: 7px 10px;
  border-radius: 9px;
  background-color: #362712;
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}
html[data-ui-mode="light"] .overflow-warn-bar {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.overflow-warn-bar[hidden] { display: none; }

.kadr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background-color: rgba(8, 10, 16, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.kadr-modal-backdrop[hidden] { display: none !important; }
.kadr-modal-panel {
  width: 100%;
  max-width: 420px;
  background-color: var(--ui-card);
  color: var(--ui-text);
  border: 1px solid var(--ui-border-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kadr-modal-panel h3 { margin: 0; font-size: 16px; font-weight: 800; }
.kadr-modal-panel p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ui-text-muted); white-space: pre-line; }
.kadr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.toast-undo-btn {
  appearance: none;
  border: 1px solid currentColor;
  background-color: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 2px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}
.toast-undo-btn[hidden] { display: none; }

.topbar-pills { display: flex; align-items: center; gap: 6px; }
.view-tab {
  appearance: none;
  border: 1px solid transparent;
  background: var(--ui-pill-idle);
  color: var(--ui-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.view-tab:hover { color: var(--ui-text); }
.view-tab.active { background: var(--ui-primary); color: var(--ui-on-primary); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-group {
  display: inline-flex;
  background: var(--ui-pill-idle);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
}
.seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ui-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ui-text); }
.seg-btn.active { background: var(--ui-card); color: var(--ui-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.btn-primary, .btn-secondary, .btn-split-ai {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary, .btn-split-ai {
  background: var(--ui-primary);
  color: var(--ui-on-primary);
  border: 1px solid var(--ui-primary);
}
.btn-split-ai { width: 100%; border-radius: 11px; padding: 9px 14px; }
.btn-secondary { background: var(--ui-card); color: var(--ui-text); border: 1px solid var(--ui-border-strong); }

.theme-mode-dock {
  display: inline-flex;
  align-items: center;
  background: var(--ui-pill-idle);
  border: 1px solid var(--ui-border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.ui-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ui-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.ui-mode-btn.active { background: var(--ui-preset-active-bg); color: var(--ui-preset-active-ink); }

button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .img-upload-drop:focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: 424px minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ui-shell-bg);
}

.inspector {
  background: var(--ui-sidebar-bg);
  overflow-y: auto;
  padding: 14px 16px 44px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ctrl-card {
  background: var(--ui-card);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-shadow: var(--ui-shadow-card);
}
.accordion-card { padding: 0; }
.accordion-summary { list-style: none; padding: 13px 14px; cursor: pointer; user-select: none; }
.accordion-summary::-webkit-details-marker { display: none; }
.accordion-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-top: 1px solid var(--ui-border);
}

.ctrl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctrl-head-label { display: flex; align-items: center; gap: 8px; color: var(--ui-text); }
.head-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ui-icon-circle-bg);
  color: var(--ui-icon-circle-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ctrl-head-label h2 { margin: 0; font-size: 13.5px; font-weight: 600; }

.summary-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ghost-action {
  appearance: none;
  background: var(--ui-ghost-bg);
  border: 1px solid var(--ui-ghost-border);
  color: var(--ui-ghost-ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

/* Photo Upload + 6-Grid Preset Gallery */
.photo-mix-box {
  background: var(--ui-control);
  border: 1px solid var(--ui-border-strong);
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.photo-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-text);
}

.photo-quick-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.mini-link-btn {
  appearance: none;
  background: var(--ui-card);
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-text);
  border-radius: 999px;
  padding: 3px 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.mini-link-btn[hidden] { display: none; }
.mini-link-btn.danger {
  color: #ff7b74;
  border-color: rgba(255, 123, 116, 0.38);
}
html[data-ui-mode="light"] .mini-link-btn.danger {
  color: #b42318;
  border-color: #fecdca;
}

.img-upload-drop {
  border: 1.5px dashed var(--ui-border-strong);
  background: var(--ui-card);
  border-radius: 11px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.img-upload-drop:hover, .img-upload-drop.dragover {
  border-color: var(--ui-primary);
}

.img-thumb-preview {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ui-border-strong);
  flex-shrink: 0;
}
.img-thumb-preview[hidden] { display: none; }
.img-thumb-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.img-upload-copy strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ui-text); }
.img-upload-copy span { display: block; font-size: 12px; color: var(--ui-text-muted); }

/* 3x2 (6-Cell) Platform Preset Background Picker */
.preset-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.preset-bg-tile {
  appearance: none;
  position: relative;
  height: 60px;
  border-radius: 9px;
  border: 2px solid var(--ui-border);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background-color: #141720;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.preset-bg-tile:hover {
  border-color: var(--ui-border-strong);
  transform: translateY(-1px);
}

.preset-bg-tile.active {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 1px var(--ui-primary);
}

.preset-bg-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preset-bg-caption {
  position: absolute;
  inset: auto 0 0 0;
  background-color: rgba(10, 12, 18, 0.82);
  color: #f4f5f8;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrim-slider-row { display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.scrim-slider-row[hidden] { display: none; }
.scrim-label-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ui-text-muted);
  font-weight: 600;
}
.mono-val { font-family: var(--font-mono); color: var(--ui-text); }

.studio-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--ui-border-strong);
  cursor: pointer;
}
.studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ui-primary);
  border: 2px solid var(--ui-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.preset-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ui-control);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  gap: 4px;
}
.preset-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ui-text-muted);
  border-radius: 999px;
  padding: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.preset-chip.active { background: var(--ui-preset-active-bg); color: var(--ui-preset-active-ink); }

.style-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.style-tile {
  appearance: none;
  background: var(--ui-control);
  border: 1.5px solid var(--ui-border);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ui-text);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}
.style-tile.span-2 { grid-column: 1 / -1; }
.style-tile.active { border-color: var(--ui-primary); background: var(--ui-card); }

.st-swatch {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  width: 58px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  border-radius: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
  white-space: nowrap;
}
.sw-swiss { background-color: #0033ff; color: #ffffff; border-radius: 0; }
.sw-brutalist { background-color: #7cff3a; color: #080808; border: 1.5px solid #080808; border-radius: 2px; }
.sw-vintage { background-color: #f6f3ec; color: #111111; border: 1.5px solid #111111; border-radius: 0; }
.sw-bento { background-color: #14161b; color: #d6f865; }
.sw-pixel { background-color: #0018e6; color: #78ff38; border-radius: 0; font-family: var(--font-pixel); letter-spacing: -0.04em; }
.sw-editorial { background-color: #f5f4f0; color: #141517; border: 1.5px solid #c9c6bc; border-radius: 4px; }
.sw-shield { background-color: #ffffff; color: #12141a; border: 1.5px solid #12141a; border-radius: 999px; }
.sw-guizang { background-color: #0e0d0c; color: #e0ab56; border: 1.5px solid #d4a04a; border-radius: 3px; }

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.field-label-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.photo-tip-bar {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ui-text-muted);
  background: var(--ui-card);
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  padding: 6px 10px;
}

.scrim-right-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shield-mode-pills {
  display: inline-flex;
  gap: 4px;
}
.shield-mode-pills[hidden] { display: none; }
.mini-tone-btn {
  appearance: none;
  background: var(--ui-card);
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-text-muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mini-tone-btn.active {
  background: var(--ui-primary);
  color: var(--ui-on-primary);
  border-color: var(--ui-primary);
}
.st-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slide-Jump-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.jump-pill {
  appearance: none;
  background: var(--ui-control);
  border: 1px solid var(--ui-border);
  color: var(--ui-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.jump-pill.active { background: var(--ui-primary); color: var(--ui-on-primary); border-color: var(--ui-primary); }

.field-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--ui-text-muted); }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  background: var(--ui-control);
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  color: var(--ui-text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 11px;
  line-height: 1.45;
}
.mono-input { font-family: var(--font-mono) !important; }

.switch-stack { display: flex; flex-direction: column; gap: 8px; }
.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background: var(--ui-control);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  cursor: pointer;
}
.switch-copy strong { display: block; font-size: 13px; font-weight: 600; }
.switch-copy span { display: block; font-size: 12px; color: var(--ui-text-muted); }
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--ui-border-strong);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.18s ease;
}
.switch[aria-checked="true"] { background: var(--ui-primary); }
html[data-ui-mode="dark"] .switch[aria-checked="true"]::after { background: #141518; }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Stage */
.stage-wrap {
  position: relative;
  margin: 12px 16px 16px 0;
  border-radius: 24px;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ui-stage-bg);
  border: 1px solid var(--ui-border);
}
.deck-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(284px, 1fr));
  gap: 22px;
  align-items: start;
  justify-items: center;
  padding-bottom: 28px;
}
.deck-grid-view[data-wide="true"] { grid-template-columns: repeat(auto-fill, minmax(410px, 1fr)); }
.deck-grid-view[hidden], .deck-focus-view[hidden] { display: none !important; }

.grid-slide-slot {
  position: relative;
  cursor: pointer;
  border-radius: 16px;
  padding: 6px;
  border: 2px solid transparent;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.grid-slide-slot:hover { transform: translateY(-3px); }
.grid-slide-slot.selected { border-color: var(--ui-primary); }
.slot-scaler { overflow: hidden; display: flex; align-items: flex-start; justify-content: flex-start; }

.deck-focus-view {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.focus-nav-row { display: flex; align-items: center; gap: 14px; }
.focus-counter { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ui-text-muted); }

/* =========================================================
   SHARED FULL-BLEED BACKGROUND IMAGE & SCRIM PRIMITIVES
   ========================================================= */
.kadr-slide {
  position: relative;
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  font-family: var(--font-grotesque);
}
.kadr-slide[data-ratio="3:4"] { width: 450px; height: 600px; }
.kadr-slide[data-ratio="4:5"] { width: 460px; height: 575px; }
.kadr-slide[data-ratio="1:1"] { width: 520px; height: 520px; }
.kadr-slide[data-ratio="16:9"] { width: 688px; height: 387px; }

.card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.card-bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* =========================================================
   1. SWISS KLEIN KINETIC BANDS (Distinct Solid + Full-BG Mode!)
   ========================================================= */
.p-swiss {
  background-color: #0b0c10;
  color: #ffffff;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 2px solid #0b0c10;
}
.sw-ticker {
  position: relative;
  z-index: 2;
  background-color: #0b0c10;
  color: #f4f5f8;
  padding: 10px 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.18);
}
.p-swiss.has-bg .sw-ticker {
  background-color: rgba(11, 12, 16, 0.88);
}
.sw-klein-band {
  position: relative;
  z-index: 2;
  background-color: #0033ff;
  color: #ffffff;
  padding: 18px 22px 16px;
}
.p-swiss.has-bg .sw-klein-band {
  background-color: rgba(0, 51, 255, 0.90);
}
.kadr-slide[data-ratio="16:9"] .sw-klein-band { padding: 12px 24px; }
.sw-giant-h {
  margin: 0;
  font-family: var(--font-grotesque);
  font-size: 54px;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.kadr-slide[data-ratio="16:9"] .sw-giant-h { font-size: 42px; }
.sw-sub-strip {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.36;
  color: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kadr-slide[data-ratio="16:9"] .sw-sub-strip { font-size: 15.5px; margin-top: 4px; }
.sw-stage {
  position: relative;
  z-index: 2;
  background-color: #13161f;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 20px 50px 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-height: 0;
}
.p-swiss.has-bg .sw-stage {
  background-color: transparent;
  background-image: none;
  justify-content: flex-end;
  padding: 16px 22px;
}
.kadr-slide[data-ratio="16:9"] .sw-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  padding: 14px 24px;
  gap: 16px;
}
.sw-checker {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-columns: 18px 18px;
  z-index: 3;
}
.sw-checker i { width: 18px; height: 18px; display: block; }
.sw-col { display: flex; flex-direction: column; gap: 4px; }
.p-swiss.has-bg .sw-col {
  background-color: rgba(11, 13, 19, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 11px 14px;
}
.sw-col-head {
  font-family: var(--font-condensed);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #facc15;
}
.sw-col-body {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #f1f5f9;
  white-space: pre-line;
}
.kadr-slide[data-ratio="16:9"] .sw-col-body { font-size: 15px; line-height: 1.44; }
.sw-bot-band {
  position: relative;
  z-index: 2;
  background-color: #ffffff;
  color: #0b0c10;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.kadr-slide[data-ratio="16:9"] .sw-bot-band { padding: 9px 24px; }

/* =========================================================
   2. ACID HOLLOW-GLYPH BRUTALISM (Distinct Solid + Full-BG Mode!)
   ========================================================= */
.p-brutalist {
  background-color: #f3f4f6;
  color: #080808;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 3px solid #080808;
}
.ac-top {
  position: relative;
  z-index: 2;
  background-color: #f3f4f6;
  padding: 14px 22px 12px;
  border-bottom: 2.5px solid #080808;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kadr-slide[data-ratio="16:9"] .ac-top { padding: 10px 22px; }
.ac-en-stack {
  font-family: var(--font-condensed);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  color: #080808;
}
.ac-oval-arrow {
  border: 2px solid #080808;
  border-radius: 999px;
  padding: 4px 15px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 700;
  background-color: #7cff3a;
  color: #080808;
}
.ac-stage {
  position: relative;
  z-index: 2;
  background-color: #8aff47;
  background-image: linear-gradient(165deg, #98ff52 0%, #80f568 48%, #7b72ff 100%);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}
.p-brutalist.has-bg .ac-stage {
  background-color: transparent;
  background-image: none;
}
.ac-hollow-glyph {
  position: absolute;
  right: -8px;
  bottom: 24px;
  font-family: var(--font-cjk-sans);
  font-size: 180px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2.2px rgba(8, 8, 8, 0.32);
  pointer-events: none;
  z-index: 1;
}
.p-brutalist.has-bg .ac-hollow-glyph {
  -webkit-text-stroke: 2.2px rgba(124, 255, 58, 0.52);
}
.kadr-slide[data-ratio="16:9"] .ac-hollow-glyph { font-size: 132px; bottom: -4px; }
.ac-main-group {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.ac-title {
  margin: 0;
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #080808;
}
.p-brutalist.has-bg .ac-title {
  background-color: #7cff3a;
  color: #080808;
  border: 2.5px solid #080808;
  box-shadow: 4px 4px 0 #080808;
  padding: 4px 12px;
}
.kadr-slide[data-ratio="16:9"] .ac-title { font-size: 38px; }
.ac-sub {
  margin: 0;
  display: inline-block;
  background-color: #080808;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.36;
  padding: 5px 12px;
}
.ac-bottom-box {
  position: relative;
  z-index: 2;
  background-color: #ffffff;
  border: 2.5px solid #080808;
  box-shadow: 5px 5px 0 #080808;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kadr-slide[data-ratio="16:9"] .ac-bottom-box { padding: 10px 15px; gap: 5px; }
.ac-body-txt {
  margin: 0;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #111111;
  white-space: pre-line;
}
.ac-foot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: #080808;
}

/* =========================================================
   3. VINTAGE VERTICAL SPINE MONOGRAPH (Distinct Solid + Full-BG Mode!)
   ========================================================= */
.p-vintage {
  background-color: #f7f4ed;
  color: #121212;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px 18px;
  border: 2px solid #121212;
}
.kadr-slide[data-ratio="16:9"] .p-vintage { padding: 16px 22px; gap: 10px 18px; }
.vt-left-col {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
}
.vt-oval-stamp {
  align-self: flex-start;
  border: 1.8px solid #121212;
  background-color: #f7f4ed;
  color: #121212;
  border-radius: 999px;
  padding: 3px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
}
.vt-sub-lead {
  margin: 0;
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #121212;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #121212;
}
.p-vintage.has-bg .vt-sub-lead {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}
.kadr-slide[data-ratio="16:9"] .vt-sub-lead { font-size: 15.5px; }
.vt-specs-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p-vintage.has-bg .vt-specs-wrap {
  background-color: rgba(18, 16, 14, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(247, 244, 237, 0.25);
  padding: 13px 14px;
}
.kadr-slide[data-ratio="16:9"] .vt-specs-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.vt-spec-item { display: flex; flex-direction: column; gap: 2px; }
.vt-spec-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #9e2b20;
}
.p-vintage.has-bg .vt-spec-num { color: #fca5a5; }
.vt-spec-txt {
  margin: 0;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #1c1b19;
}
.p-vintage.has-bg .vt-spec-txt { color: #f7f4ed; }
.kadr-slide[data-ratio="16:9"] .vt-spec-txt { font-size: 14.5px; }
.vt-spine-title {
  position: relative;
  z-index: 2;
  writing-mode: vertical-rl;
  margin: 0;
  font-family: var(--font-cjk-sans);
  font-size: 52px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #121212;
  border-left: 1.8px solid #121212;
  padding-left: 14px;
}
.p-vintage.has-bg .vt-spine-title {
  background-color: #f7f4ed;
  color: #121212;
  padding: 14px 10px;
  border-left: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.kadr-slide[data-ratio="16:9"] .vt-spine-title { font-size: 36px; }
.vt-bottom-span {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  border-top: 1.8px solid #121212;
  padding-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: #1c1b19;
}
.p-vintage.has-bg .vt-bottom-span {
  background-color: rgba(18, 16, 14, 0.86);
  color: #f7f4ed;
  border-top-color: rgba(247, 244, 237, 0.3);
  padding: 8px 12px;
}

/* =========================================================
   4. ASYMMETRIC MULTI-CELL BENTO (Tag Deleted + Shifted Up + Full-BG Glass!)
   ========================================================= */
.p-bento {
  padding: 20px;
  border-radius: 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}
.kadr-slide[data-ratio="16:9"].p-bento { padding: 15px 20px; gap: 10px; }
.p-bento[data-bento-mode="dark"] {
  --b-bg: #18191d;
  --b-hero: #d6f865;
  --b-hero-ink: #141518;
  --b-cell: #22242a;
  --b-ink: #f4f5f8;
  --b-sec: #e2e7f2;
  --b-muted: #b9c0ce;
  --b-border: rgba(255, 255, 255, 0.1);
  background-color: var(--b-bg);
  color: var(--b-ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.p-bento[data-bento-mode="light"] {
  --b-bg: #f1f3f6;
  --b-hero: #0b61ec;
  --b-hero-ink: #ffffff;
  --b-cell: #ffffff;
  --b-ink: #111318;
  --b-sec: #1f2530;
  --b-muted: #454f5e;
  --b-border: #dfe3ec;
  background-color: var(--b-bg);
  color: var(--b-ink);
  border: 1px solid #d8dde8;
}
/* Clean Top-Aligned Bento Hero: NO top pill, Title + Subtitle shifted up! */
.bn2-hero {
  position: relative;
  z-index: 2;
  background-color: var(--b-hero);
  color: var(--b-hero-ink);
  border-radius: 18px;
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}
.p-bento.has-bg[data-bento-mode="dark"] .bn2-hero {
  background-color: rgba(214, 248, 101, 0.92);
  backdrop-filter: blur(8px);
}
.p-bento.has-bg[data-bento-mode="light"] .bn2-hero {
  background-color: rgba(11, 97, 236, 0.90);
  backdrop-filter: blur(8px);
}
.kadr-slide[data-ratio="16:9"] .bn2-hero { padding: 13px 18px 14px; }
.bn2-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bn2-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #14161b;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
.bn2-title {
  margin: -2px 0 0;
  font-family: var(--font-geometric);
  font-size: 48px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.kadr-slide[data-ratio="16:9"] .bn2-title { font-size: 36px; }
.bn2-sub { margin: 0; font-size: 16.5px; font-weight: 400; line-height: 1.36; }
.kadr-slide[data-ratio="16:9"] .bn2-sub { font-size: 15px; }
.bn2-lower-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.42fr 0.58fr;
  gap: 12px;
  min-height: 0;
}
.bn2-body-cell {
  background-color: var(--b-cell);
  border: 1px solid var(--b-border);
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.52;
  color: var(--b-sec);
  white-space: pre-line;
  display: flex;
  align-items: center;
}
.p-bento.has-bg .bn2-body-cell {
  background-color: rgba(16, 18, 24, 0.86);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f4f5f8;
}
.bn2-index-cell {
  position: relative;
  overflow: hidden;
  background-color: var(--b-cell);
  border: 1px solid var(--b-border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(128, 136, 155, 0.09),
    rgba(128, 136, 155, 0.09) 4px,
    transparent 4px,
    transparent 9px
  );
}
/* Windowed Bento Cell when Background Image is Active: lets the photo shine through! */
.p-bento.has-bg .bn2-index-cell {
  background-color: rgba(14, 16, 22, 0.28);
  background-image: none;
  border-color: rgba(255, 255, 255, 0.24);
}
.bn2-series-lbl {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--b-muted);
  word-break: break-word;
}
.p-bento.has-bg .bn2-series-lbl { color: #f4f5f8; }
.bn2-idx-num {
  font-family: var(--font-geometric);
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  color: var(--b-ink);
}
.p-bento.has-bg .bn2-idx-num {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.bn2-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--b-muted);
  padding: 0 4px;
}
.p-bento.has-bg .bn2-foot {
  background-color: rgba(14, 16, 22, 0.82);
  color: #f4f5f8;
  padding: 6px 14px;
  border-radius: 999px;
}

/* =========================================================
   5. PIXEL POSTER (Distinct Solid + Full-BG CRT Grid Mode!)
   ========================================================= */
.p-pixel {
  background-color: #0018e6;
  color: #ffffff;
  border: 3px solid #050505;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.px2-top {
  position: relative;
  z-index: 2;
  background-color: #dfe2e7;
  color: #050505;
  padding: 12px 20px;
  border-bottom: 3px solid #050505;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-pixel);
  font-size: 13.5px;
  font-weight: 700;
}
.px2-mid {
  position: relative;
  z-index: 2;
  padding: 18px 20px;
  background-image:
    linear-gradient(to right, rgba(120, 255, 56, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 255, 56, 0.25) 1px, transparent 1px);
  background-size: 26px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
}
.p-pixel:not(.has-bg) .px2-mid {
  justify-content: center;
}
.px2-title {
  margin: 0;
  font-family: var(--font-cjk-sans);
  font-size: 48px;
  font-weight: 900;
  line-height: 1.05;
  color: #78ff38;
}
.p-pixel.has-bg .px2-title {
  display: inline-block;
  background-color: #050505;
  padding: 4px 12px;
  border: 2px solid #78ff38;
}
.kadr-slide[data-ratio="16:9"] .px2-title { font-size: 36px; }
.px2-sub {
  margin: 6px 0 0;
  font-family: var(--font-cjk-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.36;
  color: #ffffff;
  background-color: #050505;
  padding: 5px 11px;
  display: inline-block;
}
.p-pixel.has-bg .px2-sub {
  background-color: #0018e6;
  border: 2px solid #050505;
}
.px2-body {
  margin: 0;
  background-color: #dfe2e7;
  color: #050505;
  border: 3px solid #050505;
  padding: 12px 14px;
  font-family: var(--font-cjk-sans);
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-line;
}
.px2-bot {
  position: relative;
  z-index: 2;
  background-color: #78ff38;
  color: #050505;
  border-top: 3px solid #050505;
  padding: 11px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.px2-bot-meta {
  font-family: var(--font-cjk-sans);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.36;
}
.px2-giant-idx {
  font-family: var(--font-pixel);
  font-size: 46px;
  font-weight: 700;
  line-height: 0.88;
  color: #0018e6;
}

/* =========================================================
   6. EDITORIAL PAPER MAT (杂志留白 — 独立画窗 × 纯净纸面文字)
   ========================================================= */
.p-editorial {
  background-color: #f5f4f0;
  color: #141517;
  padding: 22px 24px 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid #d9d7cf;
}
.ed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #141517;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #141517;
  letter-spacing: 0.03em;
}
.ed-tag-accent {
  color: #1e3a5f;
}
.ed-main {
  display: grid;
  grid-template-rows: 244px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
.kadr-slide[data-ratio="4:5"].p-editorial .ed-main {
  grid-template-rows: 228px minmax(0, 1fr);
}
.p-editorial.no-img .ed-main {
  grid-template-rows: minmax(0, 1fr);
  align-content: center;
}
.ed-photo-window {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #e9e7e0;
  border: 1px solid rgba(20, 21, 23, 0.14);
  padding: 6px;
  overflow: hidden;
}
.ed-photo-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}
.ed-copy-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.p-editorial.no-img .ed-copy-panel {
  border-top: 3px solid #141517;
  border-bottom: 1px solid #cfcdc4;
  padding: 26px 0;
  gap: 14px;
}
.ed-title {
  margin: 0;
  font-family: var(--font-grotesque);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #141517;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-editorial.no-img .ed-title {
  font-size: 46px;
  -webkit-line-clamp: 3;
}
.ed-sub {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.38;
  color: #1e3a5f;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ed-body {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.52;
  color: #3a3d45;
  white-space: pre-line;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ed-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #d5d2c9;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #4b4f58;
}
/* Editorial Ratio Overrides — Shared Deterministic Window Geometry with exporter.js */
.kadr-slide[data-ratio="1:1"].p-editorial { padding: 18px 24px 16px; gap: 12px; }
.kadr-slide[data-ratio="1:1"].p-editorial .ed-main { grid-template-rows: 204px minmax(0, 1fr); gap: 12px; }
.kadr-slide[data-ratio="1:1"].p-editorial .ed-title { font-size: 34px; }
.kadr-slide[data-ratio="1:1"].p-editorial .ed-body { -webkit-line-clamp: 3; }

.kadr-slide[data-ratio="16:9"].p-editorial { padding: 16px 24px 14px; gap: 10px; }
.kadr-slide[data-ratio="16:9"].p-editorial .ed-main {
  grid-template-rows: 274px;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
.kadr-slide[data-ratio="16:9"].p-editorial.no-img .ed-main {
  grid-template-columns: 1fr;
}
.kadr-slide[data-ratio="16:9"].p-editorial .ed-copy-panel { justify-content: center; gap: 8px; }
.kadr-slide[data-ratio="16:9"].p-editorial .ed-title { font-size: 34px; }
.kadr-slide[data-ratio="16:9"].p-editorial .ed-sub { font-size: 15px; }
.kadr-slide[data-ratio="16:9"].p-editorial .ed-body { font-size: 14.5px; -webkit-line-clamp: 4; }

/* =========================================================
   7. SUBJECT-FIRST GALLERY (主体优先 — 完整不裁主体 × 独立反差区)
   ========================================================= */
.p-subject {
  background-color: #191b1f;
  color: #121316;
  display: grid;
  grid-template-rows: minmax(0, 1.08fr) auto;
  border: 1px solid #2b2f38;
}
.p-subject.no-img {
  grid-template-rows: auto minmax(0, 1fr);
}
.sj-stage {
  position: relative;
  background-color: #191b1f;
  padding: 14px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.sj-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #cfd5df;
  flex-shrink: 0;
}
.sj-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sj-dot-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #d95d39;
  display: inline-block;
}
.sj-photo-bed {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  background-color: #111316;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sj-photo-bed img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.p-subject.no-img .sj-stage {
  padding: 20px 24px 18px;
}
.sj-noimg-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 12px;
}
.sj-noimg-num {
  font-family: var(--font-geometric);
  font-size: 54px;
  font-weight: 800;
  line-height: 0.9;
  color: #ffffff;
}
.sj-noimg-note {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #b7becb;
}
.sj-dock {
  background-color: #ffffff;
  color: #121316;
  padding: 18px 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.p-subject.no-img .sj-dock {
  padding: 24px 24px 18px;
}
.sj-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.sj-title {
  margin: 0;
  font-family: var(--font-grotesque);
  font-size: 36px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #111214;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-subject.no-img .sj-title {
  font-size: 44px;
  -webkit-line-clamp: 3;
}
.sj-sub {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.36;
  color: #3b4250;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sj-body {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.48;
  color: #2f3540;
  white-space: pre-line;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-subject.no-img .sj-body {
  -webkit-line-clamp: 5;
}
.sj-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #e3e5ea;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #4f5664;
}
/* Subject-First Ratio Overrides */
.kadr-slide[data-ratio="1:1"].p-subject .sj-dock { padding: 14px 20px 13px; gap: 8px; }
.kadr-slide[data-ratio="1:1"].p-subject .sj-title { font-size: 32px; }
.kadr-slide[data-ratio="1:1"].p-subject .sj-body { -webkit-line-clamp: 2; }

.kadr-slide[data-ratio="16:9"].p-subject {
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}
.kadr-slide[data-ratio="16:9"].p-subject.no-img {
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
}
.kadr-slide[data-ratio="16:9"].p-subject .sj-dock {
  padding: 18px 22px 14px;
}
.kadr-slide[data-ratio="16:9"].p-subject .sj-title { font-size: 32px; }
.kadr-slide[data-ratio="16:9"].p-subject .sj-sub { font-size: 14.5px; }
.kadr-slide[data-ratio="16:9"].p-subject .sj-body { font-size: 14.5px; -webkit-line-clamp: 4; }

/* =========================================================
   8. IMMERSIVE SHIELD POSTER (沉浸海报 — 满版不压黑 × 独立高对比护盾)
   ========================================================= */
.p-shield {
  background-color: #d7dce3;
  background-image: linear-gradient(155deg, #e7ebf0 0%, #cfd6e0 55%, #bcc5d2 100%);
  color: #12141a;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(18, 20, 26, 0.14);
}
.sh-bg-soft {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.sh-top-rail {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sh-pill {
  background-color: rgba(255, 255, 255, 0.94);
  color: #12141a;
  border: 1px solid rgba(18, 20, 26, 0.14);
  border-radius: 999px;
  padding: 5px 13px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.p-shield[data-shield-tone="ink"] .sh-pill {
  background-color: rgba(17, 19, 24, 0.92);
  color: #f6f7f9;
  border-color: rgba(255, 255, 255, 0.18);
}
.sh-plaque {
  position: relative;
  z-index: 2;
  background-color: #ffffff;
  color: #12141a;
  border: 1px solid rgba(18, 20, 26, 0.12);
  border-radius: 16px;
  padding: 18px 20px 15px;
  box-shadow: 0 14px 34px rgba(10, 14, 22, 0.24);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.p-shield[data-shield-tone="ink"] .sh-plaque {
  background-color: #13151b;
  color: #f7f8fa;
  border-color: rgba(255, 255, 255, 0.16);
}
.sh-accent-bar {
  width: 34px;
  height: 3.5px;
  border-radius: 999px;
  background-color: #1e3a5f;
}
.p-shield[data-shield-tone="ink"] .sh-accent-bar {
  background-color: #d6f865;
}
.sh-title {
  margin: 0;
  font-family: var(--font-grotesque);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #111317;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-shield[data-shield-tone="ink"] .sh-title {
  color: #ffffff;
}
.sh-sub {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.36;
  color: #2d3648;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-shield[data-shield-tone="ink"] .sh-sub {
  color: #dce3ee;
}
.sh-body {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: #3f4654;
  white-space: pre-line;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-shield[data-shield-tone="ink"] .sh-body {
  color: #c5cddb;
}
.sh-foot {
  margin-top: 2px;
  padding-top: 9px;
  border-top: 1px solid #e4e7ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #4f5664;
}
.p-shield[data-shield-tone="ink"] .sh-foot {
  border-top-color: rgba(255, 255, 255, 0.14);
  color: #b4bccb;
}
/* Shield Ratio Overrides */
.kadr-slide[data-ratio="1:1"].p-shield .sh-plaque { padding: 15px 18px 13px; gap: 6px; }
.kadr-slide[data-ratio="1:1"].p-shield .sh-title { font-size: 33px; }
.kadr-slide[data-ratio="1:1"].p-shield .sh-body { -webkit-line-clamp: 2; }

.kadr-slide[data-ratio="16:9"].p-shield {
  padding: 16px 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 10px 16px;
}
.kadr-slide[data-ratio="16:9"].p-shield .sh-top-rail {
  grid-column: 1 / -1;
}
.kadr-slide[data-ratio="16:9"].p-shield .sh-plaque {
  grid-column: 2 / 3;
  align-self: end;
  padding: 16px 18px 13px;
  gap: 6px;
}
.kadr-slide[data-ratio="16:9"].p-shield.no-img .sh-plaque {
  grid-column: 1 / -1;
  max-width: 540px;
  margin: auto;
}
.kadr-slide[data-ratio="16:9"].p-shield .sh-title { font-size: 32px; }
.kadr-slide[data-ratio="16:9"].p-shield .sh-sub { font-size: 14.5px; }
.kadr-slide[data-ratio="16:9"].p-shield .sh-body { font-size: 14px; -webkit-line-clamp: 3; }

/* =========================================================
   9. GUIZANG MIDNIGHT-INK E-INK EDITORIAL (归藏电纸刊)
   ========================================================= */
.p-guizang {
  background-color: #0e0d0c;
  color: #ece2cf;
  padding: 22px 26px 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid rgba(236, 226, 207, 0.16);
}
.gz-paper-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(80% 50% at 24% 16%, rgba(212, 160, 74, 0.14), transparent 64%),
    radial-gradient(70% 60% at 84% 86%, rgba(80, 56, 24, 0.22), transparent 72%);
}
.gz-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.26;
  background-image: radial-gradient(rgba(255, 244, 214, 0.14) 1px, transparent 1px);
  background-size: 12px 12px;
}
.gz-photo-bleed {
  position: absolute;
  inset: 0 0 38% 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.gz-photo-bleed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gz-photo-feather {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.gz-chrome-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(236, 226, 207, 0.22);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #ece2cf;
  letter-spacing: 0.04em;
}
.gz-chrome-accent {
  color: #e0ab56;
  font-weight: 700;
}
.gz-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  min-height: 0;
  padding-top: 12px;
}
.p-guizang.no-img .gz-main {
  justify-content: center;
  gap: 14px;
}
.gz-watermark {
  position: absolute;
  right: -4px;
  top: 8px;
  font-family: var(--font-geometric);
  font-size: 112px;
  font-weight: 800;
  line-height: 0.9;
  color: rgba(212, 160, 74, 0.11);
  pointer-events: none;
  user-select: none;
}
.gz-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e0ab56;
  text-transform: uppercase;
}
.gz-title {
  margin: 0;
  font-family: var(--font-grotesque);
  font-size: 42px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: #ece2cf;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-guizang.no-img .gz-title {
  font-size: 48px;
  -webkit-line-clamp: 3;
}
.gz-rule {
  width: 48px;
  height: 2px;
  background-color: #d4a04a;
}
.gz-sub {
  margin: 0;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.42;
  color: #e2d7c2;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gz-quote-block {
  margin: 2px 0 0;
  padding-left: 14px;
  border-left: 2px solid #d4a04a;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.54;
  color: #cfc4b0;
  white-space: pre-line;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gz-chrome-bot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(236, 226, 207, 0.2);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #c3b7a2;
}
/* Guizang Ratio Overrides */
.kadr-slide[data-ratio="1:1"].p-guizang { padding: 18px 24px 16px; gap: 10px; }
.kadr-slide[data-ratio="1:1"].p-guizang .gz-title { font-size: 36px; }
.kadr-slide[data-ratio="1:1"].p-guizang .gz-quote-block { -webkit-line-clamp: 3; }

.kadr-slide[data-ratio="16:9"].p-guizang { padding: 16px 24px 14px; gap: 10px; }
.kadr-slide[data-ratio="16:9"].p-guizang .gz-photo-bleed {
  inset: 0 46% 0 0;
}
.kadr-slide[data-ratio="16:9"].p-guizang .gz-main {
  justify-content: center;
  padding-left: 44%;
  padding-top: 0;
  gap: 8px;
}
.kadr-slide[data-ratio="16:9"].p-guizang.no-img .gz-main {
  padding-left: 0;
  max-width: 540px;
}
.kadr-slide[data-ratio="16:9"].p-guizang .gz-title { font-size: 34px; }
.kadr-slide[data-ratio="16:9"].p-guizang .gz-sub { font-size: 15px; }
.kadr-slide[data-ratio="16:9"].p-guizang .gz-quote-block { font-size: 14.5px; -webkit-line-clamp: 3; }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ui-preset-active-bg);
  color: var(--ui-preset-active-ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media print {
  html, body { height: auto; overflow: visible; background: #ffffff; }
  .studio-shell, .toast, .mob-export-backdrop { display: none !important; }
  #printDeckContainer { display: flex !important; flex-direction: column; }
  .print-page { page-break-after: always; break-after: page; display: flex; justify-content: center; }
}

/* =========================================================
   DESKTOP ISOLATION: Hide Mobile-Only Chrome Above 860px
   ========================================================= */
.mobile-top-actions,
.mobile-sheet-bar,
.mobile-ratio-strip,
.mobile-copy-tabs,
.mobile-copy-page-actions,
.mobile-stage-bar,
.mobile-tabbar,
.mob-export-backdrop {
  display: none;
}

@media (min-width: 861px) and (max-width: 1080px) {
  .workspace {
    grid-template-columns: 368px minmax(0, 1fr);
  }
}

/* =========================================================
   MOBILE-NATIVE CREATOR STUDIO UX (<= 860px ONLY)
   Zero impact on Web Desktop (> 860px)
   ========================================================= */
@media (max-width: 860px) {
  html, body {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .studio-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  /* 1. Compact Single-Row Native Mobile App Bar (52px) */
  .topbar {
    flex: 0 0 52px;
    min-height: 52px;
    height: 52px;
    padding: 0 12px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .brand-badge,
  .topbar-pills,
  .topbar-actions {
    display: none !important;
  }
  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .brand-name {
    font-size: 16px;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .mob-top-pill {
    appearance: none;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--ui-border-strong);
    background-color: var(--ui-control);
    color: var(--ui-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .mob-top-pill.active {
    background-color: var(--ui-preset-active-bg);
    color: var(--ui-preset-active-ink);
    border-color: var(--ui-preset-active-bg);
  }
  .mob-icon-btn {
    appearance: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--ui-border-strong);
    background-color: var(--ui-control);
    color: var(--ui-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
  }
  .mob-export-trigger {
    appearance: none;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--ui-primary);
    background-color: var(--ui-primary);
    color: var(--ui-on-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  /* 2. Canvas-First Workspace: Poster Stage on Top, Workbench Drawer Below */
  .workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .stage-wrap {
    order: 1;
    flex: 1 1 auto;
    min-height: 180px;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 8px 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Mobile Focus View: Clean Swipeable Stage + Page Dots */
  .focus-nav-row {
    display: none !important;
  }
  .deck-focus-view {
    width: 100%;
    min-height: 0;
    gap: 8px;
  }
  .mobile-stage-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-top: 2px;
  }
  .mob-dots-track {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    overflow-x: auto;
    padding: 3px 6px;
    border-radius: 999px;
    background-color: var(--ui-card);
    border: 1px solid var(--ui-border);
  }
  .mob-page-dot {
    appearance: none;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: none;
    background-color: transparent;
    color: var(--ui-text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  .mob-page-dot.active {
    background-color: var(--ui-primary);
    color: var(--ui-on-primary);
  }
  .mob-page-add {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px dashed var(--ui-border-strong);
    background-color: transparent;
    color: var(--ui-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
  }

  /* Mobile 2-Column Overview Grid */
  .deck-grid-view {
    width: 100%;
    height: 100%;
    align-self: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 4px 2px 14px;
  }
  .deck-grid-view[data-wide="true"] {
    grid-template-columns: 1fr;
  }
  .grid-slide-slot {
    padding: 4px;
    border-radius: 12px;
  }

  /* 3. Collapsible Bottom Workbench Sheet */
  .inspector {
    order: 2;
    flex: 0 0 auto;
    height: 41dvh;
    max-height: 360px;
    background-color: var(--ui-card);
    border-top: 1px solid var(--ui-border-strong);
    border-radius: 20px 20px 0 0;
    padding: 0 14px 16px;
    gap: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.2);
    transition: height 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .studio-shell[data-mob-collapsed="true"] .inspector {
    height: 46px;
    padding-bottom: 0;
    overflow: hidden;
  }

  .mobile-sheet-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 12;
    background-color: var(--ui-card);
    padding: 7px 0 8px;
    border-bottom: 1px solid var(--ui-border);
  }
  .mob-sheet-grabber {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background-color: var(--ui-border-strong);
    margin: 0 auto 6px;
  }
  .mob-sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mob-sheet-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ui-text);
  }
  .mob-collapse-btn {
    appearance: none;
    border: 1px solid var(--ui-border-strong);
    background-color: var(--ui-control);
    color: var(--ui-text);
    border-radius: 999px;
    padding: 4px 11px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
  }

  /* Flatten desktop card chrome inside the mobile bottom sheet */
  .ctrl-card,
  .accordion-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .ctrl-card > .ctrl-card-head,
  .accordion-card > .accordion-summary {
    display: none !important;
  }
  .accordion-body {
    padding: 0;
    border-top: none;
  }

  /* Tab Routing: Show ONLY the active mobile tool panel */
  .inspector > [data-card-role] {
    display: none !important;
  }
  .studio-shell[data-mob-tab="style"] .inspector > [data-card-role="style"] {
    display: flex !important;
  }
  .studio-shell[data-mob-tab="photo"] .inspector > [data-card-role="slide-edit"] {
    display: block !important;
  }
  .studio-shell[data-mob-tab="photo"] .slide-copy-fields {
    display: none !important;
  }
  .studio-shell[data-mob-tab="copy"] .mobile-copy-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 3px;
    border-radius: 11px;
    background-color: var(--ui-control);
    border: 1px solid var(--ui-border);
  }
  .studio-shell[data-mob-tab="copy"][data-mob-copy-mode="single"] .inspector > [data-card-role="slide-edit"] {
    display: block !important;
  }
  .studio-shell[data-mob-tab="copy"][data-mob-copy-mode="single"] .photo-mix-box {
    display: none !important;
  }
  .studio-shell[data-mob-tab="copy"][data-mob-copy-mode="ai"] .inspector > [data-card-role="ai-split"] {
    display: block !important;
  }
  .studio-shell[data-mob-tab="brand"] .inspector > [data-card-role="brand"] {
    display: block !important;
  }

  .mob-subtab {
    appearance: none;
    min-height: 34px;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: var(--ui-text-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .mob-subtab.active {
    background-color: var(--ui-card);
    color: var(--ui-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  }

  .mobile-ratio-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .mob-ratio-btn {
    appearance: none;
    min-height: 36px;
    padding: 0 6px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background-color: var(--ui-control);
    color: var(--ui-text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }
  .mob-ratio-btn.active {
    border-color: var(--ui-primary);
    background-color: var(--ui-primary);
    color: var(--ui-on-primary);
  }

  .mobile-copy-page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 4px;
  }
  .mob-cur-page-tag {
    font-size: 12.5px;
    color: var(--ui-text-muted);
  }
  .mob-cur-page-tag strong {
    color: var(--ui-text);
    font-family: var(--font-mono);
  }

  /* Touch Ergonomics & Prevent iOS Safari Input Auto-Zoom (>=16px) */
  .style-tile {
    min-height: 46px;
    padding: 9px 10px;
  }
  .slide-Jump-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .jump-pill {
    min-height: 34px;
    padding: 5px 12px;
    flex-shrink: 0;
  }
  .preset-bg-tile {
    height: 66px;
  }
  .field input,
  .field textarea {
    font-size: 16px;
    min-height: 44px;
    padding: 9px 12px;
  }
  .btn-split-ai {
    min-height: 46px;
    font-size: 14px;
  }
  .switch-card {
    min-height: 52px;
    padding: 10px 12px;
  }

  /* 4. Thumb-Zone Bottom Navigation Bar */
  .mobile-tabbar {
    order: 3;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: var(--ui-topbar-bg);
    border-top: 1px solid var(--ui-border);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    z-index: 30;
  }
  .mob-tab-btn {
    appearance: none;
    min-height: 48px;
    border: none;
    background-color: transparent;
    color: var(--ui-text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 10px;
    cursor: pointer;
  }
  .mob-tab-btn.active {
    color: var(--ui-primary);
  }
  html[data-ui-mode="light"] .mob-tab-btn.active {
    color: var(--ui-primary);
  }

  /* 5. Native Mobile Export Bottom Action Sheet */
  .mob-export-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background-color: rgba(8, 10, 15, 0.62);
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .mob-export-backdrop[hidden] {
    display: none !important;
  }
  .mob-export-panel {
    width: 100%;
    max-width: 520px;
    background-color: var(--ui-card);
    color: var(--ui-text);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid var(--ui-border-strong);
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .mob-export-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
  }
  .mob-export-head p {
    margin: 4px 0 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--ui-text-muted);
  }
  .mob-export-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }
  .mob-sheet-action {
    appearance: none;
    width: 100%;
    min-height: 48px;
    border-radius: 13px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
  }
  .mob-sheet-action.primary {
    background-color: var(--ui-primary);
    color: var(--ui-on-primary);
    border: 1px solid var(--ui-primary);
  }
  .mob-sheet-action.secondary {
    background-color: var(--ui-control);
    color: var(--ui-text);
    border: 1px solid var(--ui-border-strong);
  }
  .mob-sheet-action.cancel {
    background-color: transparent;
    color: var(--ui-text-muted);
    border: 1px solid var(--ui-border);
    font-weight: 600;
  }

  .toast {
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    text-align: center;
  }
}

/* Feedback is editor-only. Never enters the poster or its export. */
.kadr-feedback-entry { white-space: nowrap; flex-shrink: 0; }
#btnToastFeedback:not([hidden]) { min-height: 36px; flex-shrink: 0; }
.toast:has(#btnToastFeedback:not([hidden])) { flex-wrap: wrap; max-width: min(520px, calc(100vw - 32px)); }
.toast:has(#btnToastFeedback:not([hidden])) #toastText { min-width: 0; overflow-wrap: anywhere; }
.kadr-feedback-dialog {
  width: min(456px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--ui-border-strong);
  border-radius: 18px;
  background: var(--ui-card);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-card);
}
.kadr-feedback-dialog[open] { display: grid; gap: 12px; }
.kadr-feedback-dialog::backdrop { background: rgba(9, 10, 15, 0.68); }
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-head h2 { margin: 0; font-size: 19px; }
.kadr-feedback-dialog p, .feedback-questions { margin: 0; font-size: 13px; line-height: 1.55; }
.kadr-feedback-dialog p { color: var(--ui-text-muted); }
.feedback-questions { padding-inline-start: 1.5em; }
.feedback-questions li + li { margin-top: 4px; }
.feedback-details { border-top: 1px solid var(--ui-border); padding-top: 10px; font-size: 13px; }
.feedback-details summary { padding-block: 5px; cursor: pointer; }
#feedbackDiagnostic {
  display: block; width: 100%; margin: 8px 0; padding: 8px; resize: vertical;
  color: var(--ui-text); background: var(--ui-control); border: 1px solid var(--ui-border-strong);
  border-radius: 8px; font: 12px/1.45 var(--font-mono);
}
#feedbackCopyStatus { display: block; margin-top: 4px; color: var(--ui-text-muted); }
#feedbackFormLink { justify-content: center; text-decoration: none; min-height: 44px; }
#feedbackFormLink[hidden] { display: none; }
.kadr-feedback-entry:focus-visible, .kadr-feedback-dialog :focus-visible, #btnToastFeedback:focus-visible {
  outline: 2px solid currentColor; outline-offset: 2px;
}
@media (max-width: 860px) {
  .topbar .brand-lockup { min-width: 0; gap: 6px; }
  .topbar .draft-status-pill { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mobile-top-actions { flex-shrink: 0; }
  .mobile-top-actions .kadr-feedback-entry { position: relative; }
  .mobile-top-actions .kadr-feedback-entry::after { position: absolute; inset: -5px; content: ""; }
  .toast:has(#btnToastFeedback:not([hidden])) { justify-content: center; border-radius: 16px; }
  .feedback-head button, #btnFeedbackCopy { min-height: 44px; }
}
@media print { .kadr-feedback-dialog { display: none !important; } }
