/* =========================================================================
   misawq Board Studio — 9 Board Materials, Rich Fasteners, Decor,
   Direct Board Drawing, Red String & Backdrop/Label Customizer
   ========================================================================= */

/* ---- 1. PHYSICAL OVERHANG ARCHITECTURE (ITEMS CAN OVERHANG BOARD EDGES!) ---- */
.board-surface {
  position: relative;
  width: 1600px;
  height: 900px;
  background: none !important;
  border: none !important;
  clip-path: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.board-surface[data-variant="mobile"] {
  width: 450px;
  height: 800px;
}

.board-plate {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Drawing canvases: under cards (clipped to board) and over cards (allows overhang) */
.board-draw-canvas {
  position: absolute;
  pointer-events: none;
  touch-action: none;
}
.board-draw-canvas--under {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}
.board-draw-canvas--over {
  top: -120px;
  left: -120px;
  width: calc(100% + 240px);
  height: calc(100% + 240px);
  z-index: 28;
}
.board-surface.is-drawing-under .board-draw-canvas--under {
  pointer-events: auto;
  cursor: crosshair;
  z-index: 35;
}
.board-surface.is-drawing-over .board-draw-canvas--over {
  pointer-events: auto;
  cursor: crosshair;
  z-index: 35;
}

.board-items {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: visible;
}

/* Red String SVG Overlay */
.board-strings-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 22;
  pointer-events: none;
}
.board-strings-svg .bs-string-hit {
  pointer-events: stroke;
  cursor: pointer;
}
.board-strings-svg .bs-pin-handle {
  pointer-events: all;
  cursor: grab;
}
.board-strings-svg .bs-pin-handle:active { cursor: grabbing; }
.topic-reader:not(.is-admin) .board-strings-svg .bs-string-hit,
.topic-reader:not(.is-admin) .board-strings-svg .bs-pin-handle {
  pointer-events: none !important;
  cursor: default !important;
}

/* Corner labels positioning */
.board-label { z-index: 5; }
.board-label[data-pos="tc"] { left: 50%; right: auto; transform: translateX(-50%); top: 22px; }
.board-label[data-pos="tr"] { left: auto; right: 32px; top: 24px; }
.board-label[data-pos="bl"] { top: auto; bottom: 22px; left: 32px; }
.board-dims { z-index: 5; }
.board-dims[data-pos="bl"] { right: auto; left: 26px; bottom: 16px; }
.board-dims[data-pos="tr"] { bottom: auto; top: 18px; right: 26px; }
.board-dims[data-pos="tl"] { bottom: auto; right: auto; top: 18px; left: 26px; }

/* ---- 2. NINE BOARD MATERIALS (applied on .board-plate & .inline-board-plate) ---- */

/* 2.1 DEFAULT — Editorial Dark Chamfered */
.board-plate[data-board-type="default"] {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.055) 1px, transparent 0) 0 0 / 32px 32px,
    radial-gradient(ellipse 92% 84% at 50% 44%, rgba(30, 27, 36, 0.96), rgba(14, 12, 18, 0.99));
  border: 12px solid #1d1a22;
  clip-path: polygon(
    22px 0, calc(100% - 22px) 0,
    100% 22px, 100% calc(100% - 22px),
    calc(100% - 22px) 100%, 22px 100%,
    0 calc(100% - 22px), 0 22px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 22px 54px rgba(0, 0, 0, 0.56);
}
.board-surface[data-variant="mobile"] .board-plate[data-board-type="default"] {
  border-width: 9px;
  clip-path: polygon(
    14px 0, calc(100% - 14px) 0,
    100% 14px, 100% calc(100% - 14px),
    calc(100% - 14px) 100%, 14px 100%,
    0 calc(100% - 14px), 0 14px
  );
}

/* 2.2 CORK — Warm Natural Corkboard in Oak Frame */
.board-plate[data-board-type="cork"] {
  background-color: #b48453;
  background-image:
    radial-gradient(rgba(74, 42, 16, 0.24) 1px, transparent 0),
    radial-gradient(rgba(255, 228, 190, 0.22) 1.5px, transparent 0),
    radial-gradient(rgba(96, 56, 22, 0.18) 2px, transparent 0),
    radial-gradient(ellipse 90% 80% at 50% 45%, rgba(215, 165, 112, 0.45), rgba(118, 76, 40, 0.58)),
    repeating-linear-gradient(127deg, rgba(84, 48, 18, 0.05) 0 3px, transparent 3px 11px);
  background-size: 13px 13px, 19px 19px, 27px 27px, 100% 100%, 100% 100%;
  background-position: 0 0, 7px 9px, 14px 4px, 0 0, 0 0;
  border: 18px solid #593a21;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px #3b2412,
    inset 0 12px 34px rgba(40, 22, 8, 0.55),
    inset 0 -8px 24px rgba(40, 22, 8, 0.35),
    0 0 0 2px #7a5230;
}
.board-surface[data-variant="mobile"] .board-plate[data-board-type="cork"] { border-width: 12px; }

/* 2.3 CHALKBOARD — Classic Green Study Chalkboard with Wooden Frame & Chalk Tray */
.board-plate[data-board-type="chalkboard"] {
  background-color: #1c3a2c;
  background-image:
    radial-gradient(ellipse 68% 58% at 32% 38%, rgba(255, 255, 255, 0.065), transparent 64%),
    radial-gradient(ellipse 55% 48% at 74% 62%, rgba(255, 255, 255, 0.045), transparent 60%),
    radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.025) 1px, transparent 0),
    linear-gradient(160deg, #214534 0%, #173326 52%, #132a1f 100%);
  background-size: 100% 100%, 100% 100%, 24px 24px, 100% 100%;
  border: 16px solid #6b4628;
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 2px #462b16,
    inset 0 18px 46px rgba(0, 0, 0, 0.5),
    0 0 0 2px #8a5e39;
}
.board-plate[data-board-type="chalkboard"]::after {
  content: "";
  position: absolute;
  left: 12%; right: 12%; bottom: 0; height: 10px;
  background: linear-gradient(180deg, #8b603b, #53351d);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.45);
  border-radius: 2px 2px 0 0;
}
.board-surface[data-variant="mobile"] .board-plate[data-board-type="chalkboard"] { border-width: 11px; }

/* 2.4 GLASS — Frosted Tempered Glass Board with Diagonal Reflection & Steel Corner Bolts */
.board-plate[data-board-type="glass"] {
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 28%, rgba(255, 255, 255, 0.01) 52%, rgba(255, 255, 255, 0.08) 76%, rgba(255, 255, 255, 0.02) 100%),
    rgba(220, 232, 248, 0.08);
  backdrop-filter: blur(14px) saturate(1.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 42px rgba(255, 255, 255, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.45);
}
.board-plate[data-board-type="glass"]::before,
.board-plate[data-board-type="glass"]::after {
  content: "";
  position: absolute;
  inset: 20px;
  pointer-events: none;
  background:
    radial-gradient(circle 8px at 10px 10px, #f2f4f8 0%, #9fa6b4 55%, #484e5a 85%, transparent 100%),
    radial-gradient(circle 8px at calc(100% - 10px) 10px, #f2f4f8 0%, #9fa6b4 55%, #484e5a 85%, transparent 100%),
    radial-gradient(circle 8px at 10px calc(100% - 10px), #f2f4f8 0%, #9fa6b4 55%, #484e5a 85%, transparent 100%),
    radial-gradient(circle 8px at calc(100% - 10px) calc(100% - 10px), #f2f4f8 0%, #9fa6b4 55%, #484e5a 85%, transparent 100%);
}
.board-plate[data-board-type="glass"]::after { display: none; }

/* 2.5 WHITEBOARD — Glossy Magnetic Whiteboard in Brushed Aluminum Frame */
.board-plate[data-board-type="whiteboard"] {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 246, 250, 0.98) 54%, rgba(235, 239, 245, 0.96) 100%);
  border: 13px solid #cfd4dc;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.14),
    inset 0 10px 30px rgba(0, 0, 0, 0.06),
    0 0 0 1px #8c939e;
}
.board-plate[data-board-type="whiteboard"]::after {
  content: "";
  position: absolute;
  left: 18%; right: 18%; bottom: 0; height: 9px;
  background: linear-gradient(180deg, #dde2ea, #a2aab6);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15);
  border-radius: 3px 3px 0 0;
}
.board-surface[data-board-type="whiteboard"] .board-label__title,
.board-surface[data-board-type="scrapbook"] .board-label__title {
  color: #1c1921;
}
.board-surface[data-board-type="whiteboard"] .board-label__title em,
.board-surface[data-board-type="scrapbook"] .board-label__title em {
  color: #9e2d48;
}
.board-surface[data-board-type="whiteboard"] .board-label__chalk,
.board-surface[data-board-type="scrapbook"] .board-label__chalk {
  color: #822b42;
}
.board-surface[data-board-type="whiteboard"] .board-dims,
.board-surface[data-board-type="scrapbook"] .board-dims {
  color: rgba(28, 25, 33, 0.42);
}

/* 2.6 WIREGRID — Chic Black/Rose-Gold Metal Moodboard Mesh */
.board-plate[data-board-type="wiregrid"] {
  background-color: rgba(10, 9, 14, 0.36);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-image:
    linear-gradient(to right, rgba(235, 193, 194, 0.30) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(235, 193, 194, 0.30) 2px, transparent 2px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  border: 5px solid rgba(235, 193, 194, 0.62);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    0 18px 50px rgba(0, 0, 0, 0.65);
}

/* 2.7 VELVET — Burgundy Velvet Showcase in Gold/Rose Trim */
.board-plate[data-board-type="velvet"] {
  background:
    radial-gradient(ellipse 76% 68% at 50% 42%, rgba(128, 26, 52, 0.94), rgba(52, 9, 22, 0.98) 72%, rgba(28, 4, 12, 1) 100%);
  border: 14px solid #2d1219;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 2px rgba(232, 207, 160, 0.55),
    inset 0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(232, 207, 160, 0.45);
}

/* 2.8 SCRAPBOOK — Warm Cream Craft Album Paper */
.board-plate[data-board-type="scrapbook"] {
  background-color: #ece3d2;
  background-image:
    radial-gradient(rgba(62, 46, 36, 0.18) 1px, transparent 0),
    radial-gradient(ellipse 90% 85% at 50% 46%, rgba(255, 250, 240, 0.55), rgba(212, 196, 170, 0.55));
  background-size: 26px 26px, 100% 100%;
  border: 12px solid #d5c7b2;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(84, 62, 42, 0.22),
    inset 0 10px 30px rgba(84, 62, 42, 0.14);
}

/* 2.9 SLATE — Matte Charcoal Black Slate for Neon Chalks */
.board-plate[data-board-type="slate"] {
  background-color: #101116;
  background-image:
    radial-gradient(ellipse 64% 52% at 38% 36%, rgba(255, 255, 255, 0.045), transparent 64%),
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0),
    linear-gradient(155deg, #17181f 0%, #0d0e13 60%, #14151b 100%);
  background-size: 100% 100%, 18px 18px, 100% 100%;
  border: 14px solid #22232c;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 22px 54px rgba(0, 0, 0, 0.72);
}

/* Inline board material support */
.inline-board-canvas {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.inline-board-canvas .board-plate {
  border-radius: 6px;
}

/* ---- 3. RICH FASTENERS (TAPES, PUSHPINS, MAGNETS, CLIPS) ---- */
.board-fastener {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board-surface[data-variant="mobile"] .board-fastener {
  transform: translateX(-50%) scale(0.78);
  top: -10px;
}
.board-fastener--none { display: none; }

/* Tapes */
.board-fastener--tape {
  width: 74px; height: 23px;
  border-left: 1px dashed rgba(255, 255, 255, 0.25);
  border-right: 1px dashed rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(1px);
}
.board-fastener--tape-top    { background: rgba(244, 234, 206, 0.48); transform: translateX(-50%) rotate(-2deg); }
.board-fastener--tape-left   { background: rgba(244, 234, 206, 0.48); transform: translateX(-50%) rotate(-7deg); }
.board-fastener--tape-right  { background: rgba(244, 234, 206, 0.48); transform: translateX(-50%) rotate(6deg); }
.board-fastener--tape-rose   { background: rgba(238, 178, 186, 0.54); transform: translateX(-50%) rotate(-3deg); }
.board-fastener--tape-black  { background: rgba(22, 20, 28, 0.78); border-color: rgba(255, 255, 255, 0.16); transform: translateX(-50%) rotate(2deg); }
.board-fastener--tape-stripe {
  background: repeating-linear-gradient(45deg, rgba(245, 210, 214, 0.65) 0 6px, rgba(255, 255, 255, 0.55) 6px 12px);
  transform: translateX(-50%) rotate(-2deg);
}
.board-fastener--tape-corners {
  width: 100%; height: 22px; top: -8px; left: 0; transform: none;
  background: none; border: none; box-shadow: none; backdrop-filter: none;
}
.board-fastener--tape-corners::before,
.board-fastener--tape-corners::after {
  content: "";
  position: absolute;
  top: 0; width: 46px; height: 17px;
  background: rgba(244, 234, 206, 0.52);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.board-fastener--tape-corners::before { left: -12px; transform: rotate(-34deg); }
.board-fastener--tape-corners::after  { right: -12px; transform: rotate(34deg); }

/* 3D Pushpins (кнопки-гвоздики для пробковой доски) */
.board-fastener--pin {
  top: -11px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.72) 0%, var(--pin-c, #e63946) 34%, var(--pin-d, #7f141e) 100%);
  box-shadow:
    0 5px 10px rgba(0, 0, 0, 0.55),
    0 2px 3px rgba(0, 0, 0, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.55);
}
.board-fastener--pin::after {
  content: "";
  position: absolute;
  bottom: -6px; right: -4px;
  width: 10px; height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(2px);
  z-index: -1;
}
.board-fastener--pin-red   { --pin-c: #eb3b4b; --pin-d: #7d101b; }
.board-fastener--pin-rose  { --pin-c: #f4b6be; --pin-d: #9e5a64; }
.board-fastener--pin-gold  { --pin-c: #f0cf85; --pin-d: #8c6a24; }
.board-fastener--pin-black { --pin-c: #3c3a44; --pin-d: #0e0d12; }
.board-fastener--pin-white { --pin-c: #ffffff; --pin-d: #a8a6b0; }
.board-fastener--pin-mint  { --pin-c: #84dec2; --pin-d: #297a63; }

/* Glossy Magnets */
.board-fastener--mag-round {
  top: -12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.8) 0%, var(--mag-c, #ebc1c2) 40%, var(--mag-d, #98656a) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.48), inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}
.board-fastener--mag-round-rose  { --mag-c: #f5c2c8; --mag-d: #9c5b64; }
.board-fastener--mag-round-black { --mag-c: #32303a; --mag-d: #0b0a0e; }
.board-fastener--mag-round-gold  { --mag-c: #f5d898; --mag-d: #9c7a30; }

.board-fastener--svg {
  top: -16px;
  width: 34px; height: 34px;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.48));
}
.board-fastener--svg svg { width: 100%; height: 100%; display: block; }
.board-fastener--clip-wood { top: -24px; width: 22px; height: 42px; }
.board-fastener--clip-metal { top: -18px; width: 24px; height: 38px; }

/* ---- 4. DECOR ITEMS ON BOARD ---- */
.board-item--decor {
  user-select: none;
}
.topic-reader:not(.is-admin) .board-item--decor,
.inline-board-canvas:not(.is-admin) .board-item--decor {
  pointer-events: none;
}
.board-decor-wrap {
  width: 100%;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.50));
}
.board-decor-wrap svg,
.board-decor-wrap img.board-decor-img {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  pointer-events: none;
}

/* ---- 5. BOARD STUDIO FLOATING PANELS (SETTINGS / DECOR / DRAW / STRING) ---- */
.bs-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  bottom: 74px;
  width: 356px;
  max-width: calc(100vw - 24px);
  z-index: 42;
  display: none;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(13, 11, 18, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(235, 193, 194, 0.28);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.82);
  font-family: "Inter", sans-serif;
  color: #f6eff1;
  overflow: hidden;
}
.topic-reader.is-admin .bs-panel.is-open { display: flex; }

.bs-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.bs-panel__head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #ffe2e3;
}
.bs-panel__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.bs-panel__tab {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-family: "Inter", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 4px;
  border-radius: 7px;
  cursor: pointer;
}
.bs-panel__tab.is-active {
  background: rgba(235, 193, 194, 0.22);
  border-color: rgba(235, 193, 194, 0.5);
  color: #ffe2e3;
}
.bs-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}

/* Material swatch grid */
.bs-mat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.bs-mat-card {
  appearance: none;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  padding: 6px;
  cursor: pointer;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 10.5px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.16s ease, transform 0.14s ease;
}
.bs-mat-card:hover { border-color: rgba(235, 193, 194, 0.6); transform: translateY(-1px); }
.bs-mat-card.is-active { border-color: #ffe2e3; background: rgba(235, 193, 194, 0.16); }
.bs-mat-swatch {
  width: 100%;
  height: 36px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Decor catalog grid */
.bs-decor-cat {
  font-size: 11px;
  font-weight: 600;
  color: #ebc1c2;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.bs-decor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.bs-decor-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  padding: 8px 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Inter", sans-serif;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.14s ease;
}
.bs-decor-btn:hover {
  border-color: #ebc1c2;
  background: rgba(235, 193, 194, 0.14);
  transform: translateY(-2px);
}
.bs-decor-btn__prev {
  width: 62px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bs-decor-btn__prev svg,
.bs-decor-btn__prev img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Floating Draw & String Sub-bars (right above Admin Dock) */
.bs-subbar {
  position: fixed;
  left: 50%;
  bottom: 66px;
  transform: translateX(-50%);
  z-index: 40;
  display: none;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(13, 11, 18, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(235, 193, 194, 0.36);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.82);
  font-family: "Inter", sans-serif;
  color: #fff;
  max-width: calc(100vw - 24px);
}
.topic-reader.is-admin .bs-subbar.is-open { display: flex; }

/* Fastener Picker Popover */
.bs-fastener-modal {
  position: fixed;
  inset: 0;
  z-index: 192;
  background: rgba(5, 4, 9, 0.72);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.bs-fastener-modal.is-open { display: flex; }
.bs-fastener-box {
  width: min(560px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #13101a;
  border: 1px solid rgba(235, 193, 194, 0.32);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  font-family: "Inter", sans-serif;
  color: #fff;
}
.bs-fastener-grid {
  padding: 14px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.bs-fast-opt {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  padding: 10px 6px 8px;
  cursor: pointer;
  color: #f3eaec;
  font-family: "Inter", sans-serif;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bs-fast-opt:hover, .bs-fast-opt.is-active {
  border-color: #ebc1c2;
  background: rgba(235, 193, 194, 0.18);
}
.bs-fast-opt__icon {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dock-btn.is-active-tool {
  background: rgba(235, 193, 194, 0.25);
  border-color: #ffe2e3;
  color: #ffe2e3;
}
