/* ===== Curation Studio — Apple-clean block editor ===== */
:root {
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --hair: rgba(0, 0, 0, 0.08);
  --accent: #0a84ff;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body.studio {
  font-family: system-ui, -apple-system, "SF Pro Text", sans-serif;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- top bar: translucent material, content scrolls under --- */
.studio-bar {
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--hair);
  z-index: 20;
}
.studio-brand { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.studio-brand span { color: var(--ink-soft); }
.studio-actions { display: flex; gap: 8px; }

.sbtn {
  font: inherit;
  font-size: 13px;
  font-weight: 590;
  padding: 7px 15px;
  border-radius: 980px;
  border: 1px solid var(--hair);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 90ms ease, background 140ms ease, opacity 140ms ease;
}
.sbtn:hover { background: #fafafa; }
.sbtn:active { transform: scale(0.96); }
.sbtn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.sbtn.primary:hover { background: #0a78e8; }

/* --- body: canvas + inspector --- */
.studio-body { flex: 1; display: flex; min-height: 0; }

.studio-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 48px 24px 160px;
  display: flex;
  justify-content: center;
}

/* --- the document: a centred column that reads like the published topic --- */
.doc { width: 100%; max-width: 680px; }
.doc-title {
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}
.doc-title::placeholder { color: #c7c7cc; }
.doc-byline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 28px;
  font-size: 14px;
  font-weight: 590;
  color: var(--ink-soft);
}
.doc-byline-dot { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, rgb(132, 165, 165), rgb(75, 82, 93), rgb(17, 15, 18)); }

/* --- blocks --- */
.blocks { display: flex; flex-direction: column; }
.block {
  position: relative;
  padding: 6px 0;
  border-radius: 8px;
  transition: box-shadow 140ms ease, transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 140ms ease;
}
.block.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.block.is-dragging {
  position: fixed;
  z-index: 50;
  width: var(--drag-w);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  background: var(--panel);
  cursor: grabbing;
  opacity: 0.97;
}
.block-placeholder {
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.07);
  border: 1px dashed rgba(10, 132, 255, 0.4);
}

/* hover affordances: drag handle (left) + delete (right) */
.block-handle,
.block-del {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px;
  background: transparent;
  color: #b0b0b5;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.block-handle { left: -40px; cursor: grab; font-size: 15px; }
.block-del { right: -38px; font-size: 18px; }
.block:hover .block-handle,
.block:hover .block-del,
.block.is-selected .block-handle,
.block.is-selected .block-del { opacity: 1; }
.block-handle:hover, .block-del:hover { background: #ececec; color: var(--ink); }
.block-del:hover { color: #ff3b30; }

/* text block */
.b-text {
  font-size: 17px;
  line-height: 1.6;
  color: #333;
  outline: 0;
  min-height: 1.6em;
}
.b-text.is-empty::before {
  content: attr(data-ph);
  color: #c7c7cc;
}
.b-text.b-head { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }

/* image + video blocks */
.b-media {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: repeating-linear-gradient(135deg, #efeff1, #efeff1 12px, #e7e7ea 12px, #e7e7ea 24px);
  display: flex; align-items: center; justify-content: center;
  color: #b4b4b8; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
}
.b-media.has-src { background: none; cursor: default; }
.b-media img, .b-media video, .b-media iframe { width: 100%; height: 100%; display: block; border: 0; object-fit: cover; }
.b-image .b-media { aspect-ratio: 1 / 1; }
.b-image.w-inset .b-media { max-width: 420px; margin-inline: auto; }
.b-video .b-media { aspect-ratio: 16 / 9; }

/* add-block rail */
.add-rail { display: flex; justify-content: center; padding: 18px 0; }
.add-block {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--hair); background: #fff; color: var(--ink-soft);
  font-size: 20px; line-height: 1; cursor: pointer;
  transition: transform 90ms ease, background 140ms ease, color 140ms ease;
}
.add-block:hover { background: #fafafa; color: var(--ink); }
.add-block:active { transform: scale(0.92); }

/* --- inspector: translucent side panel --- */
.studio-inspector {
  flex: none;
  width: 300px;
  overflow-y: auto;
  padding: 22px 20px 60px;
  background: rgba(250, 250, 252, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-left: 1px solid var(--hair);
}
/* sections read as distinct groups: a divider + a heavier, high-contrast
   title (Apple inspector style — semibold, not all-caps, full ink colour) */
.insp-section + .insp-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--hair); }
.insp-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink); margin-bottom: 13px;
}
.insp-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); cursor: pointer; }
.insp-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.insp-field { margin-bottom: 14px; }
.insp-label { display: block; font-size: 12px; font-weight: 590; color: var(--ink-soft); margin-bottom: 6px; }
.insp-input, .insp-select {
  width: 100%; font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--hair); background: #fff; color: var(--ink); outline: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.insp-input:focus, .insp-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15); }
.insp-seg { display: flex; gap: 6px; }
.insp-seg button {
  flex: 1; font: inherit; font-size: 12px; font-weight: 590;
  padding: 7px 0; border-radius: 8px; border: 1px solid var(--hair);
  background: #fff; color: var(--ink); cursor: pointer; transition: background 120ms ease;
}
.insp-seg button[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; }
.insp-empty { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* --- block picker popover --- */
.picker {
  position: fixed; z-index: 60;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--hair);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 6px;
  display: flex; flex-direction: column; min-width: 180px;
  transform-origin: top center;
  animation: pop-in 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.picker[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.picker-item {
  display: flex; align-items: center; gap: 12px;
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 12px; border: 0; border-radius: 9px; background: none; color: var(--ink);
  cursor: pointer; text-align: left; transition: background 100ms ease;
}
.picker-item:hover { background: rgba(10, 132, 255, 0.1); }
.picker-ico { width: 20px; text-align: center; color: var(--ink-soft); }

/* --- preview mode: hide editor chrome, read like the real topic --- */
body.is-preview .studio-inspector,
body.is-preview .block-handle,
body.is-preview .block-del,
body.is-preview .add-rail { display: none; }
body.is-preview .doc-title { pointer-events: none; }
body.is-preview .block.is-selected { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* caption under an image or video */
.b-cap {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ===== Board block — a square you fill with free-placed images ===== */
.b-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}
/* the block wrapper shares the b-board class — keep it unclipped so its drag handle + delete show */
.block.b-board { overflow: visible; aspect-ratio: auto; border-radius: 8px; }
.board-item { position: absolute; cursor: grab; touch-action: none; }
.board-item img {
  width: 100%; height: auto; display: block; border-radius: 3px;
  pointer-events: none; user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.board-item.is-sel { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.board-item.is-dragging { cursor: grabbing; }
.board-resize {
  position: absolute; right: -9px; bottom: -9px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1px solid var(--hair);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
  cursor: nwse-resize;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-soft);
  opacity: 0; transition: opacity 120ms ease;
  touch-action: none;
}
.board-item:hover .board-resize,
.board-item.is-sel .board-resize { opacity: 1; }
.board-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #b4b4b8; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  pointer-events: none;
}
body.is-preview .board-resize { display: none; }
body.is-preview .board-item { cursor: default; }
body.is-preview .board-item.is-sel { outline: none; }

/* inspector: board image list + add */
.insp-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.insp-item { display: flex; align-items: center; gap: 10px; }
.insp-item .thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; background: #e8e8ea; flex: none; }
.insp-item .iname { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-item .irm { margin-left: auto; border: 0; background: none; color: #ff3b30; cursor: pointer; font-size: 16px; line-height: 1; }
.insp-color { display: flex; align-items: center; gap: 10px; }
.insp-color input[type="color"] { width: 40px; height: 30px; border: 1px solid var(--hair); border-radius: 8px; background: #fff; cursor: pointer; padding: 2px; }
.insp-swatches { display: flex; gap: 6px; }
.insp-swatches button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--hair); cursor: pointer; }
/* "no background": white with a red slash */
.insp-swatches .sw-none { background: linear-gradient(to top right, #fff calc(50% - 1px), #ff3b30 calc(50% - 1px), #ff3b30 calc(50% + 1px), #fff calc(50% + 1px)); }
/* a board with no backdrop shows the room's grey, its bounds dashed */
.b-board.is-clear { background: #e6e4e6; outline: 1px dashed rgba(0, 0, 0, 0.14); outline-offset: -1px; }
body.is-preview .b-board.is-clear { outline: none; }

/* board drag affordances: hover lift, "picked up" state, active board ring */
.board-item img { transition: transform 150ms cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 150ms ease; }
.board-item:hover img,
.board-item.is-sel img { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2); }
.board-item.is-dragging { z-index: 999 !important; }
.board-item.is-dragging img { transform: scale(1.05); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.b-board.is-arranging { box-shadow: inset 0 0 0 2px rgba(10, 132, 255, 0.45); }
body.is-preview .b-board.is-arranging { box-shadow: none; }

/* smart guides while arranging (Figma-style alignment lines) */
.board-guides { position: absolute; inset: 0; pointer-events: none; z-index: 1000; }
.board-guide { position: absolute; background: #ff2d6f; }
.board-guide.v { width: 1px; margin-left: -0.5px; }
.board-guide.h { height: 1px; margin-top: -0.5px; }
/* drop the "picked up" scale while snapped so the item's edges sit exactly on the guide */
.board-item.is-dragging.is-snapped img,
.board-item.is-dragging.is-snapped video { transform: none; }

/* dropping files from Finder */
.b-board { position: relative; }
.b-board.is-dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.b-board.is-dropping::after {
  content: "Drop images here";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent); font-weight: 600; font-size: 14px; letter-spacing: 0.03em;
  pointer-events: none; z-index: 5;
}
.b-media.is-dropping { box-shadow: inset 0 0 0 3px var(--accent); color: var(--accent); }

/* board video items — mirror the image styling + drag feedback */
.board-item video {
  width: 100%; height: auto; display: block; border-radius: 3px;
  pointer-events: none; user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 150ms cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 150ms ease;
  background: transparent;
}
.board-item:hover video,
.board-item.is-sel video { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2); }
.board-item.is-dragging video { transform: scale(1.05); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }

/* editable caption under media, with inline colour emphasis */
.b-cap { margin-top: 10px; font-size: 14px; outline: 0; }
.b-cap.is-empty::before { content: attr(data-ph); color: #c7c7cc; }
body.is-preview .b-cap.is-empty { display: none; }

/* format bar — pinned at the bottom of the canvas while text is selected (dark, Apple-style) */
.fmt-bar {
  position: fixed; z-index: 70; bottom: 24px;
  display: flex; gap: 2px; align-items: center;
  background: rgba(30, 30, 32, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  animation: fmt-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fmt-bar[hidden] { display: none; }
@keyframes fmt-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .fmt-bar { animation: none; } }
.fmt-btn {
  height: 30px; min-width: 32px; padding: 0 9px; border: 0; border-radius: 8px;
  background: none; color: #fff; font: inherit; font-size: 13px; font-weight: 590;
  cursor: pointer; opacity: 0.85; display: inline-flex; align-items: center; justify-content: center;
}
.fmt-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }
.fmt-btn.is-on { opacity: 1; background: rgba(255, 255, 255, 0.2); }
.fmt-btn:disabled { opacity: 0.3; cursor: default; background: none; }
.fmt-bold { font-weight: 800; font-size: 14px; }
.fmt-italic { font-style: italic; font-family: Georgia, "Times New Roman", serif; font-size: 15px; }
.fmt-grad::before, .fmt-mark::before { content: ""; display: block; width: 26px; height: 14px; border-radius: 5px; }
.fmt-grad::before { background: linear-gradient(90deg, rgb(132, 165, 165), rgb(75, 82, 93), rgb(17, 15, 18)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.fmt-mark::before { background: rgba(132, 165, 165, 0.75); }
.fmt-sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.18); margin: 0 4px; }
.fmt-bar.is-link > .fmt-btn, .fmt-bar.is-link > .fmt-sep { display: none; }
.fmt-url { display: flex; align-items: center; gap: 4px; }
.fmt-url[hidden] { display: none; }
.fmt-url input {
  width: 260px; height: 30px; border: 0; border-radius: 8px; padding: 0 10px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; font-size: 13px; outline: 0;
}
.fmt-url input::placeholder { color: rgba(255, 255, 255, 0.5); }

/* emphasis styles inside text blocks + captions (mirrored in /styles.css for the site) */
.b-text a, .b-cap a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, 0.35); text-underline-offset: 3px; }
.txt-mark {
  background: linear-gradient(transparent 55%, rgba(132, 165, 165, 0.35) 55%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* caption centred, a bit further below the media */
.b-cap { margin-top: 16px; text-align: center; }
/* gradient emphasis — the btbr signature gradient, as a text fill */
.cap-grad {
  background: linear-gradient(90deg, rgb(132, 165, 165), rgb(75, 82, 93), rgb(17, 15, 18));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ===== publish panel ===== */
.pub-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pub-modal[hidden] { display: none; }
.pub-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.pub-panel {
  position: relative; width: 100%; max-width: 440px;
  background: var(--panel); border-radius: 16px; padding: 28px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.pub-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; color: var(--ink-soft); cursor: pointer; }
.pub-title { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 6px; }
.pub-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 18px; }
.pub-panel .insp-label { margin-top: 4px; }
.pub-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin: 12px 0 18px; cursor: pointer; }
.pub-remember input { accent-color: var(--accent); width: 15px; height: 15px; }
.pub-go { width: 100%; padding: 11px; font-size: 14px; }
.pub-log { margin-top: 16px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); white-space: pre-wrap; max-height: 180px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pub-log[hidden] { display: none; }

/* --- language switch (EN / FR): same layout, per-language text --- */
.lang-seg {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--hair); border-radius: 980px; background: #fff;
  margin-right: 4px;
}
.lang-seg button {
  font: inherit; font-size: 12px; font-weight: 590; letter-spacing: 0.02em;
  padding: 5px 11px; border: 0; border-radius: 980px;
  background: none; color: var(--ink-soft); cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.lang-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ===== Studio tabs + Topics view ===== */
.studio-tabs { display: flex; gap: 2px; background: #ececef; border-radius: 9px; padding: 2px; }
.studio-tab {
  font: inherit; font-size: 13px; font-weight: 590; color: var(--ink-soft);
  border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.studio-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.topics-view { flex: 1; overflow-y: auto; padding: 40px 24px 120px; display: flex; flex-direction: column; align-items: center; }
.topics-view[hidden] { display: none; }
body.view-topics .studio-canvas,
body.view-topics .studio-inspector { display: none; }

.topics-head { width: 100%; max-width: 680px; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.topics-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.topics-list { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 10px; }
.topic-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px; border: 1px solid var(--hair); border-radius: 12px; background: #fff;
}
.topic-thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; background: #ececef; flex: none; }
.topic-meta { flex: 1; min-width: 0; }
.topic-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.topic-acts { display: flex; gap: 6px; flex: none; }
.topic-acts button, .topic-acts a {
  font: inherit; font-size: 12px; font-weight: 590; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--hair); background: #fff; color: var(--ink); cursor: pointer;
}
.topic-acts .del { color: #ff3b30; }
.topic-acts a { text-decoration: none; display: inline-flex; align-items: center; }
.topic-acts button:hover, .topic-acts a:hover { background: #fafafa; }
.topics-empty, .topics-loading { color: var(--ink-soft); font-size: 14px; padding: 30px 0; text-align: center; }

/* resume-draft banner */
.draft-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  background: rgba(30, 30, 32, 0.95); color: #fff;
  padding: 9px 10px 9px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); font-size: 13px;
}
.draft-banner .sbtn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); color: #fff; }
.draft-banner .sbtn:hover { background: rgba(255,255,255,0.2); }

/* cover / thumbnail picker in the Topic inspector */
.cover-thumb {
  width: 120px; aspect-ratio: 3 / 5; border-radius: 8px;
  border: 1px dashed var(--hair); background: #f4f4f6;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 12px; cursor: pointer; overflow: hidden;
}
.cover-thumb.has { border-style: solid; }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-thumb.drop { border-color: var(--accent); background: rgba(10,132,255,0.06); }
.cover-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cover-btns .sbtn { font-size: 12px; padding: 6px 12px; }

/* cover composer — a mini 3:5 board (max 4 images) */
.cover-board { position: relative; width: 150px; aspect-ratio: 3 / 5; border-radius: 8px; overflow: hidden; background: #ebebef; border: 1px solid var(--hair); }
.cover-board.cover-static img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b4b4b8; font-size: 11px; text-align: center; padding: 8px; }
.cover-item { position: absolute; cursor: grab; touch-action: none; }
.cover-item img { width: 100%; height: auto; display: block; border-radius: 2px; pointer-events: none; user-select: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16); }
.cover-resize { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--hair); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); font-size: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); cursor: nwse-resize; opacity: 0; transition: opacity 0.12s ease; touch-action: none; }
.cover-del { position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--hair); color: #ff3b30; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.12s ease; padding: 0; }
.cover-item:hover .cover-resize, .cover-item:hover .cover-del { opacity: 1; }

.insp-textarea { resize: vertical; min-height: 58px; line-height: 1.45; }

/* ===== Mac windows (assets/macwin.js): framed board items + video frames ===== */
.board-item.is-win { container-type: inline-size; }
.board-item.is-win img,
.board-item.is-win .macwin {
  box-shadow: none; border-radius: 0;
  filter: drop-shadow(0 2.2cqw 3cqw rgba(0, 0, 0, 0.3));
}
.board-item.is-win:hover img, .board-item.is-win.is-sel img,
.board-item.is-win.is-dragging img { box-shadow: none; }
.board-item.is-sel.is-win { outline-offset: 4px; border-radius: 10px; }
.macwin { position: relative; width: 100%; }
.macwin-hole { position: absolute; overflow: hidden; background: #000; }
.macwin-hole > iframe, .macwin-hole > video, .macwin-hole > img {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  border: 0; border-radius: 0 !important; box-shadow: none !important; transform: none !important;
  object-fit: cover; display: block;
}
.macwin-chrome { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.board-item .macwin-chrome { box-shadow: none !important; transform: none !important; border-radius: 0 !important; }
.b-media.has-win { background: none; aspect-ratio: auto; height: auto; padding: 4px 0 14px; }
.b-media.has-win .macwin { filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28)); }
.insp-sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.insp-subtitle { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 8px; }
.insp-seg-wrap { flex-wrap: wrap; }
.insp-seg-wrap button { flex: 0 0 auto; }
.insp-item { cursor: pointer; }
.insp-item.is-sel { background: rgba(10, 132, 255, 0.1); }
.b-image .b-media.is-framed { aspect-ratio: auto; background: none; overflow: visible; padding: 4px 0 14px; }
.b-media.is-framed img { height: auto; object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28)); }
.insp-seg-wrap button { padding-left: 10px; padding-right: 10px; }
.cover-item.is-win { container-type: inline-size; }
.cover-item.is-win img { box-shadow: none; border-radius: 0; filter: drop-shadow(0 2.2cqw 3cqw rgba(0, 0, 0, 0.3)); }
.insp-check { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; font-size: 13px; color: var(--ink-soft); }

/* quote block: the line large, like wall text; the source small underneath */
.bq-text { font-size: 28px; line-height: 1.16; letter-spacing: -0.022em; color: #111; outline: none; }
.bq-text:not(.is-empty)::before { content: "\201C"; }
.bq-text:not(.is-empty)::after { content: "\201D"; }
.bq-cite { margin-top: 10px; font-size: 13px; color: #8a888b; outline: none; }
.bq-cite:not(.is-empty)::before { content: "— "; }
.bq-text.is-empty::before, .bq-cite.is-empty::before { content: attr(data-ph); color: #c4c4c8; pointer-events: none; }

/* room tone: the chosen swatch */
.insp-swatches button.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent, #0a84ff); }

/* the soundtrack line under the byline (as on the site's label card) */
.doc-tune { display: flex; align-items: center; gap: 8px; margin: -16px 0 26px; font-size: 13px; color: #8a888b; }
.doc-tune[hidden] { display: none; }
.doc-tune i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); display: inline-flex; align-items: center; justify-content: center; font-size: 7px; font-style: normal; padding-left: 1px; color: #111; }
.studio-canvas.is-dark-room .doc-tune { color: #9c968f; }
.studio-canvas.is-dark-room .doc-tune i { border-color: rgba(255, 255, 255, 0.25); color: #f4f1ed; }
.insp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }

/* the canvas wears the topic's room tone; dark tones flip the writing to light */
.studio-canvas { transition: background-color 0.35s ease; }
.studio-canvas .b-board.is-clear { background: rgba(255, 255, 255, 0.3); }
.studio-canvas.is-dark-room .doc-title { color: #f4f1ed; }
.studio-canvas.is-dark-room .doc-title::placeholder { color: rgba(255, 255, 255, 0.25); }
.studio-canvas.is-dark-room .doc-byline { color: #9c968f; }
.studio-canvas.is-dark-room .b-text { color: #dedad5; }
.studio-canvas.is-dark-room .b-text.b-head,
.studio-canvas.is-dark-room .bq-text { color: #f4f1ed; }
.studio-canvas.is-dark-room .b-cap,
.studio-canvas.is-dark-room .bq-cite { color: #9c968f; }
.studio-canvas.is-dark-room .b-text.is-empty::before,
.studio-canvas.is-dark-room .b-cap.is-empty::before,
.studio-canvas.is-dark-room .bq-text.is-empty::before,
.studio-canvas.is-dark-room .bq-cite.is-empty::before { color: rgba(255, 255, 255, 0.25); }
.studio-canvas.is-dark-room .b-board.is-clear { background: rgba(255, 255, 255, 0.035); outline-color: rgba(255, 255, 255, 0.14); }
.studio-canvas.is-dark-room .block-handle,
.studio-canvas.is-dark-room .block-del { color: rgba(255, 255, 255, 0.5); }

/* handwriting blocks: Isaac's own hand */
@font-face { font-family: "My Hand"; src: url("/assets/fonts/MyHand.ttf") format("truetype"); font-display: swap; }
.bh-text, .bsg-text { font-family: "My Hand", Charter, Georgia, serif; color: #1f1d20; outline: none; white-space: pre-wrap; }
.bh-text { font-size: 25px; line-height: 1.4; min-height: 1.4em; }
.bsg-text { font-size: 40px; line-height: 1.15; text-align: center; min-height: 1.15em; }
.bh-text.is-empty::before, .bsg-text.is-empty::before { content: attr(data-ph); color: #c4c4c8; pointer-events: none; }
.studio-canvas.is-dark-room .bh-text, .studio-canvas.is-dark-room .bsg-text { color: #f4f1ed; }
/* the trailing note is the article's sign-off: centred under a hairline, as on the site */
.block.b-hand:not(:has(~ .block:not(.b-hand, .b-sign))) .bh-text { text-align: center; }
.block.b-hand:not(:has(~ .block:not(.b-hand, .b-sign))) .bh-text::after { content: ""; position: absolute; top: -14px; left: 50%; width: 56px; height: 1px; margin-left: -28px; background: #a9adb3; }
.block.b-hand:not(:has(~ .block:not(.b-hand, .b-sign))) .bh-text { position: relative; margin-top: 14px; }
.studio-canvas.is-dark-room .bh-text.is-empty::before, .studio-canvas.is-dark-room .bsg-text.is-empty::before { color: rgba(255, 255, 255, 0.25); }

/* ===== prints (assets/prints.js): board and cover pictures hang as polaroids, as on the site ===== */
.print { position: relative; display: block; container-type: inline-size; transform: rotate(var(--tilt, 0deg)); }
.print-in { display: block; padding: 4.8cqw 4.8cqw 0; background: #fdfcf9; box-shadow: 0 1px 2px rgba(30, 25, 30, 0.14), 0 12px 26px -10px rgba(30, 25, 30, 0.32); }
.print-photo { display: block; position: relative; overflow: hidden; background: #e6e3de; aspect-ratio: 4 / 3; }
.board-item .print-photo img, .cover-item .print-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; object-fit: cover; opacity: 0;
  border-radius: 0; box-shadow: none !important; filter: none !important; transform: none !important;
}
.board-item .print-photo img.is-in, .cover-item .print-photo img.is-in { inset: auto; object-fit: fill; opacity: 1; }
.print-note { text-transform: none; letter-spacing: 0; font-weight: 400; display: block; height: 21cqw; padding-top: 2.6cqw; overflow: hidden; font: 5.8cqw/1.12 "My Hand", Charter, Georgia, serif; color: #1f1d20; text-align: left; }
.print::before, .print::after { content: ""; position: absolute; width: 30cqw; height: 8cqw; background: rgba(235, 228, 205, 0.82); z-index: 1; pointer-events: none; }
.print.tape-top::before { top: -3cqw; left: 35cqw; transform: rotate(-3deg); }
.print.tape-corner::before { top: -0.5cqw; left: -8cqw; transform: rotate(-40deg); }
.print.tape-both::before { top: -1cqw; left: -6cqw; transform: rotate(-34deg); }
.print.tape-both::after { top: -1cqw; right: -6cqw; transform: rotate(34deg); }
.print:not(.tape-both)::after { display: none; }
.board-item.is-print, .cover-item.is-print { container-type: normal; }
.board-item.is-print.is-sel { outline-offset: 6px; border-radius: 4px; }
.board-item.is-print.is-dragging .print { transform: rotate(var(--tilt, 0deg)) scale(1.04); }
.board-item.is-print .print { transition: transform 150ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.b-media.has-vprint { background: none; aspect-ratio: auto; height: auto; overflow: visible; padding: 10px 0 18px; }
.vprint { position: relative; width: 100%; box-sizing: border-box; container-type: inline-size; padding: 2.2cqw 2.2cqw 0; background: #fdfcf9; transform: rotate(-0.6deg);
  box-shadow: 0 1px 2px rgba(30, 25, 30, 0.14), 0 16px 34px -12px rgba(30, 25, 30, 0.32); }
.vprint::before { content: ""; position: absolute; top: -1.4cqw; left: 41cqw; width: 18cqw; height: 4.2cqw; transform: rotate(-2deg); background: rgba(235, 228, 205, 0.82); z-index: 1; }
.vprint-hole { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.vprint-hole > iframe, .vprint-hole > video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover; border-radius: 0; }
.vprint-note { text-transform: none; letter-spacing: 0; font-weight: 400; text-align: left; min-height: 9cqw; padding: 2cqw 0.4cqw 2.4cqw; font: 3.4cqw/1.15 "My Hand", Charter, Georgia, serif; color: #1f1d20; }

/* feed photo: the picture hung in the frame on the curation page */
.feed-pics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feed-pic { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #eee; cursor: pointer; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12); }
.feed-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-pic span { position: absolute; left: 3px; bottom: 3px; font-size: 9px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.55); padding: 1px 5px; border-radius: 6px; }
.feed-pic[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--accent); }

/* Topic · Block tabs at the top of the panel */
.insp-head { position: sticky; top: -22px; z-index: 5; margin: -22px -20px 16px; padding: 14px 20px 10px; background: #f8f8fa; border-bottom: 1px solid var(--hair); }
.insp-tabs { display: flex; padding: 2px; border-radius: 9px; background: rgba(0, 0, 0, 0.06); }
.insp-tabs button { flex: 1; border: 0; background: none; padding: 6px 0; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.insp-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.insp-crumb { margin-top: 9px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
