/* =============================================================
   LIBRARY-CHROME.CSS
   Preview library UI only. Never ships in client output.
   Contains: topbar, block label bars, theme/font switcher.

   All colors here are hardcoded neutrals — not theme tokens.
   This is intentional: chrome must look the same across all themes.
   ============================================================= */

/* ── Top bar ──────────────────────────────────────────────── */
.lib-topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: #0d0d0d;
  border-bottom: 1px solid #222;
  height: 52px;
}
.lib-topbar-inner {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 1.5rem;
  gap: 0;
}
.lib-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: 2rem;
  flex-shrink: 0;
}
.lib-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent, #C75B1A);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
  transition: background 0.3s;
}
.lib-logo-text {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.04em;
}
.lib-nav {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.lib-nav::-webkit-scrollbar { display: none; }
.lib-nav a {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #666;
  padding: 0 1rem;
  height: 52px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.lib-nav a:hover { color: #ccc; }
.lib-nav a.current { color: var(--accent, #C75B1A); border-color: var(--accent, #C75B1A); }

/* ── Block label bars ─────────────────────────────────────── */
.block-label {
  background: #111;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  padding: 0.75rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.block-label-name {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #C75B1A);
}
.block-label-desc {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.7rem;
  color: #555;
  letter-spacing: 0.03em;
  flex: 1;
  text-align: center;
}
.block-label-tag {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  color: #555;
  padding: 0.2em 0.7em;
  border-radius: 2px;
}

/* ── Theme / font switcher ────────────────────────────────── */
#theme-switcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}
.ts-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}
.ts-group { position: relative; }
.ts-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1.5px solid #333;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ts-btn:hover, .ts-btn.active {
  background: var(--accent, #C75B1A);
  border-color: var(--accent, #C75B1A);
  color: white;
  transform: scale(1.08);
}
.ts-panel {
  position: absolute;
  bottom: 52px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  padding: 0.75rem;
  min-width: 280px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.ts-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.ts-panel-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #444;
  padding: 0.25rem 0.5rem 0.75rem;
  border-bottom: 1px solid #2e2e2e;
  margin-bottom: 0.5rem;
}

/* Swatch rows */
.swatch-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.swatch-row:hover { background: #252525; }
.swatch-row.active { background: #222; }
.swatch-dots { display: flex; gap: 4px; }
.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.swatch-name {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: #bbb;
  flex: 1;
}
.swatch-check {
  font-size: 0.75rem;
  color: var(--accent, #C75B1A);
  opacity: 0;
  transition: opacity 0.15s;
}
.swatch-row.active .swatch-check { opacity: 1; }

/* Font rows */
.font-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  border-bottom: 1px solid #222;
  transition: background 0.15s;
}
.font-row:last-child { border-bottom: none; }
.font-row:hover { background: #252525; }
.font-row.active { background: #222; }
.font-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}
.fp-display {
  font-size: 1.05rem;
  color: #e8e8e8;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-flair {
  font-size: 0.82rem;
  color: var(--accent, #C75B1A);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-body {
  font-size: 0.72rem;
  color: #555;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.font-check {
  font-size: 0.75rem;
  color: var(--accent, #C75B1A);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.font-row.active .font-check { opacity: 1; }

/* ── Surface switcher widget ──────────────────────────────── */
/*    Injected per-block by js/blocks/surface-switcher.js      */
/*    All colors hardcoded — chrome must be theme-independent  */

.sv-widget {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 200;
  pointer-events: auto;
}

.sv-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 0.35rem 0.6rem 0.35rem 0.45rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: opacity 0.2s;
}

/* Dimmed state for fixed-surface blocks */
.sv-widget--fixed .sv-inner {
  opacity: 0.35;
  cursor: not-allowed;
}

/* The three surface dots */
.sv-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.sv-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #444;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.sv-dot:hover {
  transform: scale(1.25);
  border-color: #888;
}

/* Light dot — open circle, white-ish fill */
.sv-dot[data-surface="surface-light"] {
  background: #e8e4dc;
  border-color: #888;
}

/* Mid dot — medium fill */
.sv-dot[data-surface="surface-mid"] {
  background: #8a8070;
  border-color: #666;
}

/* Dark dot — near-black fill */
.sv-dot[data-surface="surface-dark"] {
  background: #1e1e1e;
  border-color: #555;
}

/* Active state — accent ring */
.sv-dot--active {
  outline: 2px solid var(--accent, #C75B1A);
  outline-offset: 2px;
  transform: scale(1.1);
}

.sv-dot:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

/* Surface label */
.sv-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  white-space: nowrap;
  min-width: 2.5rem;
}

.sv-label--active {
  color: #888;
}
