:root {
  --bg: #22252a;
  --panel: #2a2d33;
  --panel-2: #33373d;
  --panel-3: #3d4249;
  --line: #383c42; /* borders and dividers: a soft grey, only a little lighter than the panels */
  --text: #eef0f4;
  --muted: #b8bdc7;
  --faint: #979ca8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --code-bg: #0b0d11; /* the code editor: near black, matching the Monaco "bsb-black" theme in codedock.js */
  --orange: #f97316;
  --danger: #ef4444;
  --radius: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }

.app {
  display: grid;
  grid-template-columns: var(--left-w, 300px) 1fr var(--right-w, 300px);
  grid-template-rows: 42px 1fr;
  grid-template-areas: "top top top" "left stage right";
  height: 100vh;
}

/* ---------- toolbar ---------- */
.toolbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  -webkit-app-region: no-drag;
}
.tb-group { display: flex; gap: 2px; padding-right: 10px; border-right: 1px solid var(--line); }
.tb-group:last-child { border-right: 0; padding-right: 0; }
.tb-group.seg { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.tb-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; }
.size-label { color: var(--muted); font-size: 12px; min-width: 90px; font-variant-numeric: tabular-nums; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; min-width: 30px; padding: 0 7px;
  justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text); cursor: pointer;
}
.tb-btn:hover:not(:disabled) { background: var(--panel-3); }
.tb-btn:disabled { opacity: 0.35; cursor: default; }
.tb-btn.active { background: var(--accent-soft); color: #fff; }
.tb-btn.text { padding: 0 10px; }
.tb-btn.primary { background: var(--accent); color: #fff; }
.tb-btn.primary:hover { background: #2f6fde; }

/* ---------- panels ---------- */
.panel { background: var(--panel); display: flex; flex-direction: column; min-height: 0; position: relative; }
/* handles to resize the side panels (see splitters.js) */
.splitter { flex: none; height: 6px; margin: -3px 0; position: relative; z-index: 5; cursor: row-resize; touch-action: none; }
.splitter:hover, .splitter.dragging { background: var(--accent, #4c8dff); opacity: .55; }
.vsplitter { position: absolute; top: 0; bottom: 0; width: 6px; z-index: 6; cursor: col-resize; touch-action: none; }
.vsplitter.edge-right { right: -3px; }
.vsplitter.edge-left { left: -3px; }
.vsplitter:hover, .vsplitter.dragging { background: var(--accent, #4c8dff); opacity: .55; }
body.resizing { user-select: none; }
body.resizing iframe { pointer-events: none; }
.panel.left { grid-area: left; border-right: 1px solid var(--line); }
.panel.right { grid-area: right; border-left: 1px solid var(--line); }
.pane { display: flex; flex-direction: column; min-height: 0; }
.lib-pane { flex: 1.6; }
.pages-pane { flex: 1; border-top: 2px solid var(--line); }
.props-pane { flex: 1.6; }
.pages-pane .pane-body { padding-bottom: 6px; }
.layers-pane { flex: 1; border-top: 2px solid var(--line); }
.pane-head {
  padding: 9px 12px 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.pane-body { overflow: auto; overflow-x: hidden; min-height: 0; flex: 1; }
/* thin scrollbars everywhere in the app chrome */
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb { background: #4a5260; border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: #5f6a7c; }

.search { padding: 0 10px 8px; display: flex; gap: 6px; }
.search input { flex: 1; min-width: 0; }
.search .btn-sm { padding: 0 9px; font-weight: 700; }
.search input {
  width: 100%; height: 30px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.search input:focus { border-color: var(--accent); }

/* library */
.lib-cat { padding: 0 8px 6px; }
.lib-cat-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 4px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.lib-cat-head:hover { color: var(--text); }
.chev { display: inline-block; transition: transform 0.15s; font-size: 10px; }
.lib-cat.closed .chev { transform: rotate(-90deg); }
.lib-cat.closed .lib-grid { display: none; }
.lib-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.lib-item {
  min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 7px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid transparent;
  cursor: grab;
}
.lib-item:hover { border-color: var(--accent); background: var(--panel-3); }
.lib-item:active { cursor: grabbing; }
.lib-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-icon {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 20px; border-radius: 4px;
  background: #3b3f46; color: #b3c3de;
  font: 700 9.5px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.02em;
}
.lib-icon.big { width: 38px; height: 28px; font-size: 11px; }

/* layers */
.layer-row {
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding-right: 8px;
  cursor: pointer; white-space: nowrap;
  border-top: 2px solid transparent; border-bottom: 2px solid transparent;
}
.layer-row:hover, .layer-row.hover { background: var(--panel-2); }
.layer-row.selected { background: var(--accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.layer-row.selected .layer-name { font-weight: 700; }
.layer-row.pulse { animation: layerPulse 1.1s ease-out; }
@keyframes layerPulse { 0% { background: rgba(59, 130, 246, .75); } 100% { background: var(--accent-soft); } }
.layer-row.drop-before { border-top-color: var(--orange); }
.layer-row.drop-after { border-bottom-color: var(--orange); }
.layer-row.drop-inside { background: rgba(249, 115, 22, 0.18); }
.caret { width: 14px; text-align: center; color: var(--muted); font-size: 10px; transition: transform 0.12s; flex: none; }
.caret.closed { transform: rotate(-90deg); }
.caret.none { visibility: hidden; }
.layer-icon { font: 700 8.5px/1 ui-monospace, Consolas, monospace; color: #9ec1ff; width: 24px; flex: none; }
.layer-name { flex: none; }
.layer-hint { color: var(--faint); overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- code dock ---------- */
.dock { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); background: var(--panel); }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.dock-head .tab { padding: 6px 12px; }
.dock-note { color: var(--faint); font-size: 11.5px; }
.dock .code-view { border-radius: 0; }
.status-row { display: flex; align-items: center; background: var(--panel); border-top: 1px solid var(--line); }
.status-row .breadcrumb { flex: 1; min-width: 0; border-top: 0; }
.dock-toggle { height: 26px; margin-right: 6px; font-size: 12px; }

/* ---------- properties filter ---------- */
.props-filter { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.props-filter input {
  flex: 1; min-width: 0; height: 29px; padding: 0 8px; user-select: text;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.props-filter input:focus { border-color: var(--accent); }
.props-filter .btn-sm { padding: 0 9px; font-weight: 700; }

/* ---------- breakpoint bar ---------- */
.bp-bar {
  display: flex; align-items: center; justify-content: center; gap: 14px; position: relative;
  height: 38px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.bp-group { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.bp-btn {
  display: flex; align-items: baseline; gap: 5px; height: 26px; padding: 0 10px;
  background: none; border: 0; border-radius: 4px; color: var(--muted); cursor: pointer;
}
.bp-btn b { font-size: 12px; font-weight: 700; }
.bp-btn i { font-style: normal; font-size: 10.5px; color: var(--faint); }
.bp-btn:hover { color: var(--text); background: var(--panel-3); }
.bp-btn.active { background: #5a606a; color: #fff; } /* the chosen breakpoint is a lighter grey, not blue */
.bp-btn.active i { color: rgba(255, 255, 255, 0.75); }
.bp-bar .size-label { position: absolute; right: 12px; min-width: 0; }

/* ---------- stage ---------- */
.stage { grid-area: stage; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.canvas-wrap {
  flex: 1; min-height: 0; overflow: auto;
  display: flex; justify-content: center;
  padding: 14px;
  background-image: radial-gradient(#1d2128 1px, transparent 1px);
  background-size: 16px 16px;
}
.frame-holder {
  height: 100%; max-width: 100%;
  transition: width 0.25s ease;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #262b33, 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
#canvas { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.breadcrumb {
  display: flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 10px; overflow: hidden; white-space: nowrap;
  background: var(--panel); border-top: 1px solid var(--line);
}
.crumb { background: none; border: 0; padding: 3px 6px; border-radius: 4px; color: var(--muted); cursor: pointer; }
.crumb:hover { background: var(--panel-3); color: var(--text); }
.crumb.active { color: #fff; background: var(--accent-soft); }
.crumb-sep { color: var(--faint); }

/* ---------- right panel ---------- */
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); }
.tabs.inline { border: 0; padding: 0; }
.tab {
  background: none; border: 0; padding: 7px 12px; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); }

.props { padding-bottom: 30px; }
.props-head { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.props-titles { flex: 1; min-width: 0; }
.props-title { font-weight: 600; font-size: 14px; color: #fff; }
.props-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: grid; place-items: center; width: 28px; height: 28px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-3); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

.psec { border-bottom: 1px solid var(--line); }
.psec summary {
  list-style: none; cursor: pointer; padding: 10px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.psec summary::-webkit-details-marker { display: none; }
.psec summary::before { content: "▾"; display: inline-block; margin-right: 6px; transition: transform 0.12s; }
.psec:not([open]) summary::before { transform: rotate(-90deg); }
.psec-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 9px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { color: var(--muted); font-size: 12px; }
.field input[type="text"], .field select, .field textarea, .psec-body > input[type="text"], .util select {
  width: 100%; padding: 5px 8px; min-height: 29px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
  user-select: text;
}
.field textarea { resize: vertical; line-height: 1.45; }
.mono { font-family: ui-monospace, Consolas, monospace !important; font-size: 12px !important; }
.field input:focus, .field select:focus, .field textarea:focus, .psec-body > input:focus, .util select:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.img-field { display: flex; gap: 4px; }
.img-field input { flex: 1; min-width: 0; }
.btn-sm {
  padding: 0 10px; height: 29px; border-radius: var(--radius);
  background: var(--panel-3); border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
}
.btn-sm:hover { border-color: var(--accent); }

.util-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.util { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.util select { min-height: 27px; padding: 3px 5px; font-size: 12px; }
.util select.set { border-color: rgba(59, 130, 246, 0.6); color: #fff; }
.hint { color: var(--faint); font-size: 11.5px; }
.hint.pad { padding: 8px 12px; }
.hint code { color: var(--muted); }

.styles-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.css-editor {
  flex: 1; width: 100%; resize: none; border: 0; outline: none; padding: 12px;
  background: #15181d; color: #e6edf3;
  font: 12.5px/1.55 ui-monospace, Consolas, monospace; tab-size: 2; user-select: text;
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; z-index: 50; }
.modal-card {
  width: min(1000px, 92vw); height: min(720px, 86vh);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.spacer { flex: 1; }
.code-view {
  flex: 1; margin: 0; overflow: auto; padding: 14px 16px;
  background: #111317; color: #d6e2f0; border-radius: 0 0 10px 10px;
  font: 12.5px/1.55 ui-monospace, Consolas, monospace; user-select: text; white-space: pre;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 46px; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; border-radius: 8px;
  background: #2b313c; color: #fff; border: 1px solid #454a53;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: 70vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: var(--accent); border: 0; color: #fff; padding: 4px 10px; border-radius: 5px; cursor: pointer; }

/* ---------- pages ---------- */
.pane-head { display: flex; align-items: center; }
.head-btn {
  margin-left: auto; display: grid; place-items: center; width: 22px; height: 22px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; color: var(--text);
}
.head-btn:hover { border-color: var(--accent); color: #fff; }
.head-btn svg { width: 13px; height: 13px; }
.page-row {
  display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px 0 10px; cursor: pointer; white-space: nowrap;
}
.page-row:hover { background: var(--panel-2); }
.page-row.active { background: var(--accent-soft); color: #fff; }
.page-ico { width: 14px; text-align: center; color: #9ec1ff; flex: none; }
.page-name { flex: none; }
.page-title { color: var(--faint); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.page-actions { display: none; gap: 1px; flex: none; }
.page-row:hover .page-actions { display: flex; }
.page-row:hover .page-title { display: none; }
.page-actions button {
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  background: none; border: 0; border-radius: 4px; cursor: pointer; color: var(--muted);
}
.page-actions button:hover:not(:disabled) { background: var(--panel-3); color: #fff; }
.page-actions button.danger:hover:not(:disabled) { color: var(--danger); }
.page-actions button:disabled { opacity: 0.3; cursor: default; }
.page-row.renaming { background: var(--panel-2); }
.page-rename {
  flex: 1; min-width: 0; height: 22px; padding: 0 6px; user-select: text;
  background: var(--bg); border: 1px solid var(--accent); border-radius: 4px; outline: none;
}
.page-ext { color: var(--muted); }
.page-label {
  padding: 2px 8px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); font-size: 12px;
}

/* ---------- JavaScript tab ---------- */
.js-pane .css-editor { flex: 2; min-height: 120px; }
.js-pane .css-editor.small { flex: 1; min-height: 70px; }
.code-head {
  padding: 7px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--panel);
}
.code-head code, .code-head .muted { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); margin-left: 6px; }

/* ---------- Bootstrap Studio-style chrome ---------- */
.toolbar { gap: 4px; padding: 0 6px; }
.toolbar .tb-group { border-right: 0; padding-right: 0; margin-right: 8px; }
.toolbar .tb-btn.text { height: 34px; font-weight: 600; font-size: 12px; padding: 0 10px; }
.pane-head { padding: 0 12px; height: 34px; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; color: #fff; border-bottom: 1px solid var(--line); background: var(--panel); }
.tabs { padding: 0; height: 34px; background: var(--panel); }
.tab { font-size: 12px; padding: 0 14px; }
.doc-tabs { display: flex; align-items: flex-end; height: 30px; padding: 0; background: var(--bg); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tab { display: flex; flex: none; align-items: center; gap: 7px; height: 30px; max-width: 220px; padding: 0 8px 0 14px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line); }
.doc-tab:hover { color: #fff; background: var(--panel-2); }
.doc-tab.active { background: var(--panel); color: #fff; box-shadow: inset 0 2px 0 var(--accent); }
.doc-tab-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.doc-dirty { white-space: pre; font-size: 9px; color: var(--orange); }
.doc-close, .doc-add { flex: none; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 4px; font-size: 15px; line-height: 1; padding: 2px 6px; }
.doc-close { opacity: 0; }
.doc-tab:hover .doc-close, .doc-tab.active .doc-close { opacity: .7; }
.doc-close:hover, .doc-add:hover { background: var(--panel-3); color: #fff; opacity: 1; }
.doc-add { height: 30px; padding: 0 12px; color: var(--muted); font-size: 17px; }
.bp-bar { height: 34px; justify-content: flex-start; padding: 0 10px; background: var(--panel-2); border-bottom: 0; }
.bp-bar .size-label { position: static; font-size: 11px; color: #cbd2dc; }
.bp-bar .spacer { flex: 1; }
.page-select { height: 26px; padding: 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); outline: none; }
.canvas-wrap { padding: 24px; background-image: none; }
.frame-holder { border-radius: 0; box-shadow: none; }
.status-row { background: var(--bg); border-top: 0; height: 26px; }
.dock-tab { align-self: flex-end; height: 24px; padding: 0 14px; background: var(--panel); color: #fff; border: 0; font-size: 12px; font-weight: 600; cursor: pointer; }
.dock-tab:hover { background: var(--panel-2); }
.status-row .breadcrumb { height: 26px; background: transparent; }
.psec summary, .code-head { color: #cfd5de; }

/* ---------- script files ---------- */
.js-pane { overflow-y: auto; }
.script-files { display: flex; flex-direction: column; flex: none; }
.script-bar { display: flex; gap: 4px; padding: 8px 12px 0; }
.script-bar select { flex: 1; min-width: 0; height: 29px; padding: 0 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; }
.script-meta { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.script-meta .field input[type="text"] { width: 100%; padding: 5px 8px; min-height: 29px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; }
.script-code { flex: none; height: 260px; }

.tbl-tools { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Monaco code editors ---------- */
.code-host { flex: 1; min-height: 0; width: 100%; overflow: hidden; background: var(--code-bg); }
.js-pane .code-host { flex: 2; min-height: 120px; }
.js-pane .code-host.small { flex: 1; min-height: 70px; }
.js-pane .code-host.script-code { flex: none; height: 260px; min-height: 0; }
.code-host .monaco-editor, .code-host .monaco-editor * { user-select: text; }

/* ---------- code dock (tabbed editor) ---------- */
.dock { position: relative; height: 340px; }
.dock-resize { position: absolute; left: 0; right: 0; top: -3px; height: 6px; cursor: ns-resize; z-index: 5; }
.dock-resize:hover { background: var(--accent); opacity: .5; }
body.dock-resizing { user-select: none; cursor: ns-resize; }
body.dock-resizing #canvas { pointer-events: none; }
.dock-head { padding: 0; align-items: stretch; background: var(--bg); gap: 0; }
.dock-tabs { display: flex; overflow-x: auto; min-width: 0; }
.dock-tabs::-webkit-scrollbar { height: 0; }
.dock-file { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; flex: none; cursor: pointer; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); background: var(--panel); }
.dock-file:hover { color: var(--text); background: var(--panel-2); }
.dock-file.active { color: #fff; background: var(--code-bg); box-shadow: inset 0 2px 0 var(--accent); }
.dock-file-x { background: none; border: 0; color: inherit; font-size: 15px; line-height: 1; padding: 0 3px; border-radius: 3px; cursor: pointer; opacity: .6; }
.dock-file-x:hover { opacity: 1; background: var(--panel-3); }
.dock-settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dock-field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.dock-field input { height: 26px; width: 150px; padding: 0 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; }
.dock-field input.narrow { width: 56px; }
.dock-field input:focus { border-color: var(--accent); }
.dock-check { align-self: flex-end; height: 26px; font-size: 12px; }
.dock-editor { flex: 1; min-height: 0; position: relative; overflow: hidden; background: var(--code-bg); }
.dock-editor .css-editor { position: absolute; inset: 0; width: 100%; height: 100%; }
.dock-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 6px; padding: 20px; color: var(--faint); font-size: 12.5px; line-height: 1.6; background: var(--code-bg); }

/* ---------- sidebar: file list ---------- */
.tabs .head-btn { margin: auto 8px auto auto; }
.files { padding: 4px 0 10px; }
.file-group-head { display: flex; align-items: center; padding: 8px 12px 3px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.file-group-head .head-btn { margin-left: auto; }
.file-row { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px 0 14px; cursor: pointer; white-space: nowrap; }
.file-row:hover { background: var(--panel-2); }
.file-row.open { background: rgba(59, 130, 246, 0.08); }
.file-row.active { background: var(--accent-soft); color: #fff; }
.file-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.file-ico { flex: none; min-width: 26px; padding: 2px 4px; text-align: center; border-radius: 4px; background: #3b3f46; color: #b3c3de; font: 700 9px/1 ui-monospace, Consolas, monospace; }
.file-del { display: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.file-row:hover .file-del { display: block; }
.file-del:hover { background: var(--panel-3); color: var(--danger); }

/* ---------- code dock: full window ---------- */
.dock.full { position: fixed; left: 0; right: 0; bottom: 0; top: 42px; height: auto !important; z-index: 40; border-top: 0; }
.dock.full .dock-resize { display: none; }
.dock-full-btn { font-size: 16px; }
.dock-full-btn.active { background: var(--accent-soft); color: #fff; }

/* delete buttons are always visible (dimmed) so unused JavaScript files are easy to remove */
.file-del { display: block; opacity: .45; }
.file-row:hover .file-del, .file-del:hover { opacity: 1; }
.export-opts { margin-top: 6px; border-top: 1px solid var(--line); }
.export-opt { padding: 4px 14px; font-size: 12px; }

.file-empty { padding: 4px 14px 6px; color: var(--faint); font-size: 12px; }

/* ---------- settings window ---------- */
.settings-card { width: min(720px, 94vw); height: min(680px, 90vh); background: var(--bg); }
.settings-card .set-field input[type="text"], .settings-card .set-field select, .settings-card .set-color input[type="color"], .settings-card .set-thumb, .settings-card .set-urls { background: var(--panel); }
.settings-card .modal-head { gap: 14px; }
.settings-title { padding: 0 6px; }
.settings-body { flex: 1; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.settings-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.settings-foot .muted { flex: 1; color: var(--faint); }
.set-field { display: flex; flex-direction: column; gap: 5px; }
.set-label { font-size: 12px; font-weight: 600; color: var(--text); }
.set-help { font-size: 11.5px; color: var(--faint); line-height: 1.45; }
.set-field input[type="text"], .set-field select { width: 100%; height: 30px; padding: 0 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; }
.set-field input:focus, .set-field select:focus { border-color: var(--accent); }
.set-check { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 12.5px; cursor: pointer; }
.set-check input { accent-color: var(--accent); align-self: center; margin: 0; }
.set-check em { flex-basis: 100%; margin-left: 22px; font-style: normal; font-size: 11.5px; color: var(--faint); }
.set-color { display: flex; gap: 8px; }
.set-color input[type="color"] { width: 40px; height: 30px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.set-image { display: flex; gap: 12px; align-items: center; }
.set-thumb { flex: none; width: 120px; height: 72px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--faint); font-size: 11.5px; }
.set-thumb img { width: 100%; height: 100%; object-fit: contain; }
.set-image-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.set-btns { display: flex; gap: 6px; }
.set-path { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-urls { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--panel-2); border-radius: var(--radius); }
.set-url { display: flex; gap: 12px; font-size: 12px; }
.set-url span { flex: none; width: 140px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.set-url code { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-sm.full { width: 100%; }
.sec-tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; grid-column: 1 / -1; }
.sec-tools .btn-sm { padding: 1px 10px; font-size: 11px; }
.sec-tools .btn-sm:disabled { opacity: .45; cursor: default; }

/* ---------- utilities: breakpoint switch + counts ---------- */
.bp-strip { display: flex; align-items: center; gap: 3px; padding: 9px 12px 6px; border-top: 1px solid var(--line); }
.bp-strip-label { margin-right: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bp-chip { position: relative; height: 22px; padding: 0 7px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.bp-chip:hover { color: var(--text); border-color: var(--accent); }
.bp-chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.bp-chip.used::after { content: ''; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); border: 1px solid var(--panel); }
.psec-count { margin-left: 8px; padding: 0 6px; font-size: 10px; letter-spacing: 0; font-weight: 700; color: #9ec1ff; background: var(--accent-soft); border-radius: 8px; }

/* color field: picker + text + clear */
.color-field { display: flex; gap: 4px; }
.color-field input[type="color"] { flex: none; width: 36px; height: 29px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.color-field input[type="text"] { flex: 1; min-width: 0; }

/* ---------- icon picker + icon field ---------- */
.icon-card { width: min(860px, 94vw); height: min(680px, 90vh); }
.icon-search { padding: 10px 14px 4px; }
.icon-search input { width: 100%; height: 34px; padding: 0 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; }
.icon-search input:focus { border-color: var(--accent); }
.icon-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; padding: 10px 14px 14px; align-content: start; }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 7px; background: var(--panel-2); border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; color: var(--text); }
.icon-cell:hover { border-color: var(--accent); background: var(--panel-3); }
.icon-cell.active { border-color: var(--accent); background: var(--accent-soft); }
.icon-glyph { display: grid; place-items: center; height: 28px; }
.icon-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.icon-more { grid-column: 1 / -1; justify-self: center; }
.icon-none { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--faint); }
.icon-field { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); cursor: pointer; }
.icon-field:hover { border-color: var(--accent); }
.icon-field-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.icon-field-go { color: var(--accent); font-size: 12px; }
.util-full { grid-column: 1 / -1; }

/* ---------- fonts tab ---------- */
.font-card { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.font-head { display: flex; align-items: center; gap: 8px; }
.font-name { flex: 1; min-width: 0; font-weight: 600; }
.font-badge { flex: none; padding: 1px 8px; font-size: 11px; color: #9ec1ff; background: var(--accent-soft); border-radius: 9px; }
.font-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.font-files { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.font-file { display: flex; gap: 6px; align-items: center; width: 100%; }
.font-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.font-file select { height: 28px; padding: 0 6px; width: auto; }
.font-add { display: flex; gap: 6px; }
.font-add input { height: 30px; padding: 0 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; }
.font-add input:first-child { flex: 1; }
.font-add input:nth-child(2) { width: 110px; }
.font-card .set-help code { color: var(--text); }

.font-host { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.font-subsets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.font-host-row { display: flex; gap: 6px; flex-wrap: wrap; }
.font-host-row .btn-sm:disabled { opacity: .5; cursor: default; }

.dt-controls { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }

/* ---------- Monaco's right-click menu ----------
   The menu is drawn in a shadow root that gets none of the editor theme's colors, so it had no background and black text.
   CSS custom properties inherit into a shadow root, so the colors it asks for are defined here, on the page. */
:root {
  --vscode-foreground: #d4d7dc;
  --vscode-descriptionForeground: #b4bccb;
  --vscode-disabledForeground: #6b7280;
  --vscode-menu-background: #11151b;
  --vscode-menu-foreground: #d4d7dc;
  --vscode-menu-selectionBackground: #1b3a63;
  --vscode-menu-selectionForeground: #ffffff;
  --vscode-menu-selectionBorder: transparent;
  --vscode-menu-separatorBackground: #3a3e45;
  --vscode-menu-border: #3a3e45;
  --vscode-widget-shadow: rgba(0, 0, 0, 0.6);
  --vscode-shadow-lg: rgba(0, 0, 0, 0.6);
  --vscode-scrollbar-shadow: transparent;
}

/* ---------- right-click menu and name prompt ---------- */
.ctx-menu {
  position: fixed; z-index: 100; min-width: 160px; padding: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.ctx-item {
  display: block; width: 100%; text-align: left; padding: 6px 10px;
  background: none; border: 0; border-radius: 5px; color: var(--text); cursor: pointer; font-size: 12px;
}
.ctx-item:hover { background: var(--accent-soft); color: #fff; }
.ctx-item.danger { color: #f87171; }
.ctx-item.danger:hover { background: rgba(248, 113, 113, 0.18); }
.ctx-sep { height: 1px; margin: 4px 2px; background: var(--line); }
.ask-card { width: min(380px, 92vw); height: auto; }
.ask-card .modal-head { padding: 10px 12px; }
.ask-body { padding: 12px; }
.ask-body input {
  width: 100%; height: 30px; padding: 0 10px; user-select: text;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.ask-body input:focus { border-color: var(--accent); }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 12px 12px; }
.ask-actions .btn-sm { padding: 5px 14px; }
.ask-actions .btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- template picker ---------- */
.tpl-card { width: min(520px, 92vw); height: min(560px, 86vh); }
.tpl-list { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.tpl-row { display: flex; align-items: center; gap: 6px; }
.tpl-use {
  flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); cursor: pointer; text-align: left;
}
.tpl-use:hover { border-color: var(--accent); background: var(--panel-3); }
.tpl-use span { color: var(--muted); font-size: 11px; }
.tpl-empty { color: var(--muted); font-size: 12px; padding: 6px 2px; }

/* ---------- save-as-block dialog ---------- */
.blk-card { width: min(560px, 94vw); max-height: 88vh; }
.blk-body { overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.blk-field { display: flex; flex-direction: column; gap: 5px; }
.blk-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); }
.blk-code {
  width: 100%; resize: vertical; padding: 8px 10px; user-select: text;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
  color: var(--text); font: 12px/1.5 ui-monospace, Consolas, monospace;
}
.blk-code:focus { border-color: var(--accent); }
.blk-images { display: flex; flex-wrap: wrap; gap: 6px; }
.blk-img { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px 3px 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.blk-img img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.blk-none, .blk-note { font-size: 11px; color: var(--muted); }
.blk-list { max-height: 130px; overflow: auto; display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; }
.blk-item { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 4px; font-size: 12px; cursor: pointer; font-weight: 400; color: var(--text); }
.blk-item:hover { background: var(--panel-3); }
.blk-item-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.blk-item-label.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.blk-item-label em { color: var(--muted); font-style: normal; }
.blk-pic { display: flex; align-items: center; gap: 6px; }
.blk-pic img { width: 24px; height: 24px; object-fit: cover; border-radius: 4px; flex: none; }

/* ---------- blog generator ---------- */
.head-btn.txt { width: auto; padding: 0 9px; font-size: 11px; font-weight: 700; }
.blog-card { width: min(460px, 94vw); }
.blog-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.blog-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.blog-check .blk-note { flex-basis: 100%; }
.ask-body input[type="checkbox"] { width: auto; height: auto; }
.ask-body input[type="number"], .ask-body input[type="date"] { color-scheme: dark; }
.ask-area { font-family: inherit; }
.blog-image { display: flex; align-items: center; gap: 10px; }
.tabs .head-btn.txt { margin: auto 6px auto auto; }
.tabs .head-btn.txt + .head-btn { margin-left: 0; }

/* ---------- export options: image optimizer ---------- */
.export-sub { display: flex; gap: 10px; padding: 2px 0 8px 22px; }
.export-sub label { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 10.5px; color: var(--muted); }
.export-sub input { width: 100%; height: 24px; padding: 0 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; color-scheme: dark; }
.export-sub input:focus { border-color: var(--accent); }

/* ---------- optimize images dialog ---------- */
.export-btn { margin: 2px 0 6px 22px; }
.imgopt-card { width: min(760px, 94vw); height: min(640px, 88vh); }
.imgopt-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 10px 14px 6px; }
.imgopt-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.imgopt-field input { width: 120px; height: 28px; padding: 0 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; color-scheme: dark; user-select: text; }
.imgopt-field input:focus { border-color: var(--accent); }
.imgopt-master { display: flex; align-items: center; gap: 7px; margin-left: auto; height: 28px; font-size: 12px; cursor: pointer; }
.imgopt-summary { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 12.5px; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.imgopt-summary span { color: #6ee7a0; font-weight: 600; }
.imgopt-list { flex: 1; overflow: auto; padding: 6px 8px; }
.imgopt-row { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.imgopt-row:hover { background: var(--panel-2); }
.imgopt-row.off { cursor: default; }
.imgopt-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; background: #fff; border: 1px solid var(--line); }
.imgopt-name { display: flex; flex-direction: column; min-width: 0; }
.imgopt-name b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; }
.imgopt-name small { color: var(--muted); font-size: 11px; }
.imgopt-good { color: #6ee7a0; font-weight: 600; font-size: 12px; white-space: nowrap; }
.imgopt-note { color: var(--muted); font-size: 11.5px; text-align: right; }
.imgopt-foot { padding: 8px 14px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- images in the Files panel ---------- */
.image-list { max-height: 240px; overflow: auto; }
.image-row { display: flex; align-items: center; gap: 8px; }
.image-thumb { width: 24px; height: 24px; flex: none; object-fit: cover; border-radius: 3px; background: #fff; border: 1px solid var(--line); }
.image-meta { margin-left: auto; flex: none; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.image-row.missing .image-thumb { opacity: .35; }
.image-row.missing .file-name::after { content: ' (not found)'; color: #f87171; font-size: 10.5px; }

/* image details */
.imgd-card { width: min(680px, 94vw); height: auto; max-height: 90vh; }
.imgd-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 70%; }
.imgd-preview { display: grid; place-items: center; padding: 14px; max-height: 46vh; overflow: auto; border-bottom: 1px solid var(--line);
  background: repeating-conic-gradient(#2b313b 0 25%, #232830 0 50%) 0 0 / 18px 18px; }
.imgd-img { max-width: 100%; max-height: 40vh; object-fit: contain; }
.imgd-img.broken { min-width: 80px; min-height: 80px; outline: 1px dashed #f87171; }
.imgd-info { padding: 10px 16px 14px; overflow: auto; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.imgd-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.imgd-row > span:first-child, .imgd-label { color: var(--muted); }
.imgd-val { overflow-wrap: anywhere; user-select: text; }
.imgd-label { margin-top: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.imgd-use { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 8px; background: var(--panel-2); border-radius: var(--radius); }

/* ---------- canvas zoom ---------- */
.canvas-wrap { justify-content: safe center; }
.zoom-group { display: flex; align-items: center; gap: 1px; padding: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.zoom-btn, .zoom-val { height: 24px; background: none; border: 0; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 13px; }
.zoom-btn { width: 24px; font-size: 16px; line-height: 1; }
.zoom-val { min-width: 46px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.zoom-btn:hover:not(:disabled), .zoom-val:hover { color: #fff; background: var(--panel-3); }
.zoom-btn:disabled { opacity: .35; cursor: default; }

/* ---------- find elements ---------- */
.find-bar { display: flex; align-items: center; gap: 3px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.find-field { position: relative; flex: 1; min-width: 0; }
.find-field input { width: 100%; height: 26px; padding: 0 64px 0 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; user-select: text; font-size: 12px; }
.find-field input:focus { border-color: var(--accent); }
.find-field input.none { border-color: #7f2d2d; }
.find-count { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.find-btn { flex: none; min-width: 24px; height: 26px; padding: 0 5px; background: none; border: 1px solid transparent; border-radius: 4px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.find-btn:hover { color: #fff; background: var(--panel-3); }
.find-btn.on { color: #fff; background: var(--accent-soft); border-color: var(--accent); }
.layer-row.found .layer-name { color: #f59e0b; }
.layer-row.found::after { content: ''; width: 6px; height: 6px; margin-left: auto; margin-right: 6px; border-radius: 50%; background: #f59e0b; flex: none; }
.frame-holder { flex: none; } /* zoomed in, the frame keeps its width and the area scrolls instead of squeezing it */

/* ---------- show / hide panels ---------- */
.tb-btn.icon { width: 30px; padding: 0; display: grid; place-items: center; }
.tb-btn.icon svg { display: block; }
.panel-toggles { gap: 1px; }
.app.hide-left { grid-template-columns: 0 1fr var(--right-w, 300px); }
.app.hide-right { grid-template-columns: var(--left-w, 300px) 1fr 0; }
.app.hide-left.hide-right { grid-template-columns: 0 1fr 0; }
.app.hide-left .panel.left, .app.hide-right .panel.right { display: none; }

/* ---------- Theme tab ---------- */
.theme-pane { padding: 4px 12px 14px; overflow: auto; }
.theme-section { padding: 10px 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.theme-section:last-child { border-bottom: 0; }
.theme-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.theme-pane select { height: 28px; padding: 0 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.theme-status { font-size: 12.5px; color: var(--muted); }
.theme-status.on { color: var(--text); font-weight: 600; }
.theme-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-btns .btn-sm.danger { color: #f87171; }
.theme-help { font-size: 11px; line-height: 1.45; color: var(--muted); }

/* ---------- Attributes panel ---------- */
.attr-panel { max-height: 230px; overflow: auto; padding: 8px 14px 12px; background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.attr-head { overflow: hidden; }
.attr-tag { display: block; padding: 5px 8px; background: #111317; border-radius: var(--radius); color: #8fc5ff; font: 11.5px/1.5 ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; }
.attr-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.attr-field { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 11px; }
.attr-panel input { height: 26px; padding: 0 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; color: var(--text); user-select: text; min-width: 0; }
.attr-panel input:focus { border-color: var(--accent); }
.attr-label { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 2px; }
.attr-rows { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.attr-row { display: grid; grid-template-columns: 1fr 2fr 26px; gap: 6px; width: 100%; }
.attr-row .icon-btn { height: 26px; font-size: 16px; line-height: 1; }
.attr-empty { color: var(--muted); }

/* ---------- choose an image ---------- */
.imgpick-card { width: min(780px, 94vw); height: min(620px, 88vh); }
.imgpick-tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.imgpick-tab { padding: 7px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.imgpick-tab:hover { color: var(--text); }
.imgpick-tab.active { color: #fff; border-bottom-color: var(--accent); }
.imgpick-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.imgpick-bar input { width: 100%; height: 30px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; color: var(--text); user-select: text; }
.imgpick-bar input:focus { border-color: var(--accent); }
.imgpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.imgpick-tile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 6px; background: var(--panel-2); border: 2px solid transparent; border-radius: 8px; cursor: pointer; min-width: 0; }
.imgpick-tile:hover { border-color: var(--line); }
.imgpick-tile.picked { border-color: var(--accent); background: var(--accent-soft); }
.imgpick-thumb { height: 100px; display: grid; place-items: center; border-radius: 5px; overflow: hidden; background: repeating-conic-gradient(#2b313b 0 25%, #232830 0 50%) 0 0 / 14px 14px; }
.imgpick-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.imgpick-tile.missing .imgpick-thumb { opacity: .4; }
.imgpick-name { font-size: 11.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.imgpick-meta { font-size: 10.5px; color: var(--muted); min-height: 13px; }
.imgpick-badge { position: absolute; top: 10px; left: 10px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; }
.imgpick-empty, .imgpick-note { color: var(--muted); font-size: 12.5px; padding: 18px 4px; }
.imgpick-drop { flex: 1; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); }
.imgpick-drop.over { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.imgpick-drop-title { font-size: 15px; font-weight: 600; color: var(--text); }
.imgpick-drop-sub { font-size: 11.5px; }
.imgpick-web { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.imgpick-web input { width: 100%; height: 32px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); outline: none; color: var(--text); user-select: text; }
.imgpick-web input:focus { border-color: var(--accent); }
.imgpick-webprev { width: 100%; min-height: 160px; display: grid; place-items: center; background: repeating-conic-gradient(#2b313b 0 25%, #232830 0 50%) 0 0 / 14px 14px; border-radius: 8px; color: var(--muted); font-size: 12px; padding: 10px; }
.imgpick-webprev img { max-width: 100%; max-height: 300px; }
.imgpick-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.imgpick-hint { font-size: 11px; color: var(--muted); }
.imgpick-foot .btn-sm { padding: 6px 16px; }
.imgpick-foot .btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.imgpick-foot .btn-sm:disabled { opacity: .4; cursor: default; }

/* ---------- Properties: the image field (name only) ---------- */
.img-field { display: flex; gap: 4px; align-items: stretch; }
.img-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; }
.img-box:hover { border-color: var(--accent); }
.img-thumb { width: 22px; height: 22px; flex: none; object-fit: cover; border-radius: 3px; background: #fff; border: 1px solid var(--line); }
.img-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.img-name.none { color: var(--muted); }

/* folders of pictures (Files panel and the chooser) */
.image-folder-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.image-folder-head:hover { color: var(--text); }
.image-folder-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.image-folder-count { font-weight: 600; font-size: 10.5px; }
.image-folder.closed .chev { transform: rotate(-90deg); }
.image-folder .image-row { padding-left: 18px; }
.imgpick-folder { display: flex; flex-direction: column; gap: 6px; }
.imgpick-folder-head { display: flex; justify-content: space-between; gap: 10px; padding: 4px 2px; color: var(--muted); font-size: 11.5px; font-weight: 700; border-bottom: 1px solid var(--line); }
.imgpick-folder-head em { font-style: normal; font-weight: 600; }
.imgpick-opt { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; cursor: pointer; }

.imgopt-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.imgopt-foot .btn-sm { flex: none; padding: 6px 14px; }
.imgopt-foot .btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.imgopt-foot .btn-sm:disabled { opacity: .5; cursor: default; }

/* page folders */
.page-row.folder-row { color: var(--text); font-weight: 600; }
.page-row.folder-row .page-ico { color: #f0c36d; }
.page-row.folder-row .page-title { font-weight: 400; }
.page-row.drop { background: var(--accent-soft); outline: 1px dashed var(--accent); outline-offset: -2px; }
.pages.drop-root { outline: 1px dashed var(--accent); outline-offset: -3px; }
.page-row[draggable="true"] { cursor: grab; }

.head-btn.txt { white-space: nowrap; }

.ask-message p { margin: 0 0 6px; line-height: 1.45; user-select: text; }
.ask-actions .btn-sm.primary.danger { background: #dc3545; border-color: #dc3545; }

/* Markdown editor of the blog post dialog */
.blog-wide { width: min(780px, 95vw); max-height: 92vh; }
.blog-wide .ask-body { overflow: auto; max-height: calc(92vh - 110px); }
.md-editor { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.md-bar { display: flex; align-items: center; gap: 3px; padding: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.md-tool { min-width: 30px; height: 26px; padding: 0 8px; background: none; border: 1px solid transparent; border-radius: 4px; color: var(--text); cursor: pointer; font-size: 12px; }
.md-tool:hover:not(:disabled) { background: var(--panel-3); border-color: var(--line); }
.md-tool:disabled { opacity: .35; cursor: default; }
.md-tool.md-b { font-weight: 800; }
.md-tool.md-i { font-style: italic; }
.md-tool.md-switch.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.ask-body .md-input { display: block; width: 100%; height: auto; min-height: 230px; padding: 10px; border: 0; border-radius: 0; resize: vertical; font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--bg); color: var(--text); }
.md-preview { display: block; width: 100%; height: 340px; border: 0; background: transparent; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: .8em 0 .35em; }
.md-preview p, .md-preview ul, .md-preview ol, .md-preview blockquote, .md-preview pre { margin: 0 0 .8em; }
.md-preview blockquote { padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md-preview img { max-width: 100%; }
.md-preview code { background: var(--panel-3); padding: 1px 4px; border-radius: 3px; }

.md-lang { height: 26px; max-width: 120px; background: var(--panel-3); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.md-bar .md-lang:disabled { opacity: .35; }

.api-row { display: flex; gap: 8px; }
.api-row input { flex: 1; min-width: 0; }
.ask-body input[type="radio"] { width: auto; height: auto; }

/* Google Fonts picker (Settings → Fonts) */
.font-add .gf-picker { flex: 1; min-width: 0; position: relative; }
.gf-box { display: flex; gap: 6px; }
.gf-box .gf-input { flex: 1; min-width: 0; }
.gf-cat { max-width: 130px; height: 30px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); }
.gf-list { position: absolute; left: 0; right: 0; top: 34px; z-index: 30; max-height: 270px; overflow: auto; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.gf-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; cursor: pointer; }
.gf-item.active { background: var(--accent-soft); color: #fff; }
.gf-name { font-weight: 600; }
.gf-meta { color: var(--faint); font-size: 11px; white-space: nowrap; }
.gf-none { padding: 10px; color: var(--muted); }
.gf-preview { position: sticky; top: 0; z-index: 1; padding: 8px 10px; font-size: 20px; line-height: 1.3; background: #fff; color: #212529; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* open from the web */
.webopen-card { width: min(460px, 94vw); }
.webopen-card .ask-body { display: flex; flex-direction: column; gap: 8px; }
.webopen-status { color: var(--muted); font-size: 12px; min-height: 16px; }
.webopen-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.webopen-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); cursor: pointer; }
.webopen-item:hover { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.webopen-ext { color: var(--faint); font-size: 11px; }

.field-section { margin: 12px 0 2px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* text align buttons in the properties */
.seg { display: flex; gap: 4px; }
.seg .btn-sm { flex: 1; display: flex; justify-content: center; padding: 5px 0; }
.seg .btn-sm.active { background: var(--accent, #4f7cff); border-color: var(--accent, #4f7cff); color: #fff; }

/* ---------- site checker ---------- */
.chk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chk-chip { border: 1px solid var(--line); background: transparent; color: var(--muted, #8b949e); border-radius: 999px; padding: 3px 12px; cursor: pointer; font: inherit; opacity: .6; }
.chk-chip.on { opacity: 1; color: var(--text, #e6edf3); }
.chk-chip.sev-error.on { border-color: #e5534b; } .chk-chip.sev-warn.on { border-color: #d29922; } .chk-chip.sev-info.on { border-color: #539bf5; }
.chk-ok { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; }
.chk-page { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chk-page-head { display: flex; justify-content: space-between; padding: 7px 12px; background: rgba(127,127,127,.1); }
.chk-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-top: 1px solid var(--line); }
.chk-item.go { cursor: pointer; } .chk-item.go:hover { background: rgba(127,127,127,.09); }
.chk-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
.sev-error .chk-dot { background: #e5534b; } .sev-warn .chk-dot { background: #d29922; } .sev-info .chk-dot { background: #539bf5; }
.chk-text { flex: 1; min-width: 0; } .chk-hint { font-size: 11.5px; opacity: .65; margin-top: 2px; }
.chk-hide { border: 0; background: transparent; color: inherit; opacity: 0; cursor: pointer; font-size: 11px; }
.chk-item:hover .chk-hide { opacity: .6; } .chk-hide:hover { opacity: 1 !important; text-decoration: underline; }

/* device presets and typed width in the breakpoint bar */
.width-box { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.width-box input { width: 58px; padding: 2px 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit; text-align: right; }
#deviceSelect { max-width: 150px; }
#rotateBtn:disabled { opacity: .35; }
#deviceSelect { max-width: 112px; }
.bp-bar .size-label { display: none; }
@media (max-width: 1750px) { .bp-btn i { display: none; } }

/* Theme tab: style colors */
.style-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; }
.style-row > span { width: 64px; color: var(--muted); flex: none; }
.style-row input[type="color"] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; flex: none; }
.style-row .style-hex { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.style-row select { flex: 1; min-width: 0; }

/* find and replace */
.fr-fields { display: flex; gap: 8px; }
.fr-fields input { flex: 1; min-width: 0; }
.fr-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.fr-results { display: flex; flex-direction: column; gap: 10px; }
.fr-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--line); }
.fr-row.go { cursor: pointer; } .fr-row.go:hover { background: rgba(127,127,127,.09); }
.fr-kind { flex: none; width: 150px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-snip { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-snip mark { background: rgba(255, 200, 0, .35); color: inherit; border-radius: 2px; }
.fr-more { padding: 6px 2px; }

/* page settings table */
.pt-card { width: min(1180px, 96vw); }
.pt-row { display: grid; grid-template-columns: 150px minmax(180px, 1fr) minmax(260px, 1.6fr) 54px 54px; gap: 10px; align-items: start; padding: 8px 4px; border-top: 1px solid var(--line); }
.pt-row.pt-head { border-top: 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; position: sticky; top: -16px; background: var(--panel); z-index: 1; }
.pt-row.off { opacity: .6; }
.pt-name { color: var(--accent); text-decoration: none; padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-name:hover { text-decoration: underline; }
.pt-cell input, .pt-cell textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.pt-meta { display: flex; gap: 8px; font-size: 11px; min-height: 16px; margin-top: 2px; }
.pt-note { color: #d29922; }
.pt-count.ok { color: #3fb950; } .pt-count.warn { color: #d29922; } .pt-count.bad { color: #e5534b; }
.pt-lang { width: 100%; box-sizing: border-box; text-align: center; }
.pt-noindex { margin: 8px auto 0; }

/* version history */
.hs-row { display: grid; grid-template-columns: 120px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.hs-row:first-child { border-top: 0; }
.hs-when { display: flex; flex-direction: column; }
.hs-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* keyboard shortcuts */
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 12px; border-top: 1px solid var(--line); }
.kb-what { flex: 1; min-width: 0; }
.kb-keys, .kb-combo { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.kb-keys { gap: 8px; }
.kb-or, .kb-plus, .kb-words { color: var(--muted); font-size: 11.5px; }
kbd { font: 600 11.5px ui-monospace, Consolas, monospace; padding: 2px 7px; min-width: 18px; text-align: center; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); color: var(--text); }
#kbFilter { width: 100%; box-sizing: border-box; }
.settings-body > .chk-page, #kbBody > * { flex: none; }

.icon-sets { padding: 0 14px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* image import options */
.imgpick-options { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 10px; font-size: 12px; }
.imgpick-optsel { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.imgpick-optsel select { font: inherit; }

/* publish */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.pb-key { display: flex; gap: 6px; } .pb-key input { flex: 1; min-width: 0; }
.pb-remember { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pb-saved { font-size: 12px; color: var(--muted); }
.pb-opts { display: flex; flex-direction: column; gap: 2px; }
.pb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pb-actions progress { width: 200px; height: 10px; }
.pb-log { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto; font-size: 12.5px; }
.pb-line.ok { color: #3fb950; } .pb-line.bad { color: #e5534b; } .pb-line.warn { color: #d29922; }
.pb-extra { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pb-files { max-height: 140px; overflow: auto; font-family: ui-monospace, Consolas, monospace; font-size: 12px; opacity: .85; }

/* languages */
.lang-list { display: flex; flex-direction: column; gap: 6px; }
.lang-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.lang-def { display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer; }
.lang-def em { font-style: normal; color: var(--muted); font-size: 12px; }
.lang-count { font-size: 12px; }
.lang-add { display: flex; gap: 8px; align-items: center; }
.tr-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.tr-row strong { width: 70px; flex: none; } .tr-row .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-lang { font-size: 10px; text-transform: uppercase; padding: 0 5px; border-radius: 4px; background: var(--panel-3); color: var(--muted); flex: none; }
.pg-lang.def { opacity: .5; }

/* translation view */
.tv-card { width: min(1180px, 96vw); height: min(860px, 92vh); }
.tv-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tv-bar { width: 160px; height: 10px; } .tv-sum { font-weight: 600; }
.tv-chips { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.tv-chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 2px 11px; cursor: pointer; font: inherit; font-size: 12px; }
.tv-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tv-search { width: 200px; }
.tv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 6px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tv-list { flex: 1; overflow: auto; }
.tv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tv-label { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.tv-show { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 11px; padding: 0; }
.tv-text { white-space: pre-wrap; word-break: break-word; opacity: .85; }
.tv-input { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; }
.tv-meta { display: flex; align-items: center; gap: 12px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.tv-mark { width: 9px; height: 9px; border-radius: 50%; background: #8b949e; flex: none; }
.tv-mark.todo { background: #d29922; } .tv-mark.done { background: #3fb950; } .tv-mark.kept { background: #539bf5; }
.tv-keep { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.tv-empty { padding: 30px; text-align: center; color: var(--muted); }

.tv-mark.mt { background: #a371f7; }
.lang-deepl { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.lang-key-ok { font-size: 12.5px; } .lang-key-bad { font-size: 12.5px; color: #e5534b; }

/* the selector bar of the code panel */
.dock-cssbar { align-items: center; }
.dock-cssbar-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dock-cssbar-select { max-width: 320px; font: 12px ui-monospace, Consolas, monospace; }
.bsb-rule-hl { background: rgba(88, 166, 255, .22); }

/* the code panel in a window of its own */
.dock-detach-btn { font-size: 15px; }
body.dock-window { margin: 0; height: 100vh; overflow: hidden; background: var(--bg); }
body.dock-window #dock { position: fixed; inset: 0; height: auto !important; border-top: 0; }
body.dock-window .dock-openfile { margin: 3px 8px; max-width: 240px; font-size: 12px; }

/* list editor (rowseditor.js): one box per item */
.rows-editor { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.rows-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.rows-head { display: flex; align-items: center; justify-content: space-between; }
.rows-n { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rows-btns { display: flex; gap: 3px; }
.rows-btns .btn-sm { min-width: 26px; padding: 0 6px; }
.rows-btns .btn-sm:disabled { opacity: .35; cursor: default; }

/* grid editor (rowseditor.js): the Table and Chart data */
.grid-bar { display: flex; gap: 6px; margin: 8px 0; }
.grid-wrap { overflow: auto; max-height: 56vh; border: 1px solid var(--line); border-radius: var(--radius); }
.grid-ed { border-collapse: collapse; width: 100%; }
.grid-ed td, .grid-ed th { padding: 2px; border: 1px solid var(--line); background: var(--panel-2); }
.grid-ed thead th { position: sticky; top: 0; z-index: 1; text-align: center; background: var(--panel-3); }
.grid-rowtools { width: 1%; white-space: nowrap; background: var(--panel-3); }
.grid-cell { width: 100%; min-width: 90px; padding: 5px 7px; background: transparent; border: 0; outline: 0; user-select: text; }
.grid-cell:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.grid-head { font-weight: 700; }

/* the Components list: the selected component's entry is marked, and a group of suggestions comes first */
.lib-item.current { outline: 1px solid color-mix(in srgb, var(--accent) 65%, var(--panel-3)); outline-offset: -1px; background: var(--accent-soft); }
.lib-cat.has-current.closed .lib-cat-head::after { content: '●'; margin-left: 8px; color: var(--accent); font-size: 10px; }
.lib-cat.suggested .lib-cat-head { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.lib-cat.suggested .lib-item { border-color: #4b515c; }

/* the buttons of the page list (SEO, Blog, folder, new page) sit in a row of their own under the tabs, so the tabs never run out of room */
.pages-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pages-bar[hidden] { display: none; }
.pages-bar .head-btn { margin: 0; }
.pages-bar-gap { flex: 1; }

/* the Page settings window */
.ps-section { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ps-code { width: 100%; font-family: var(--mono, monospace); font-size: 12px; resize: vertical; white-space: pre; }


.grid-bad { color: var(--danger); }

/* the blog category editor */
.cat-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cat-row { display: flex; flex-direction: column; gap: 2px; }
.cat-main { display: flex; align-items: center; gap: 8px; }
.cat-main input { flex: 1; }
.cat-count { min-width: 64px; color: var(--muted); font-size: 12px; }
.cat-row.gone input { text-decoration: line-through; opacity: .5; }

/* the saved servers row of the Publish window */
.pb-servers { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.pb-servers .field { flex: 1; }
.pb-srv-btns { display: flex; gap: 6px; }

/* the Style section of the Theme tab: light and dark page colors */
.style-group { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.style-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* My themes in the Theme tab */
.theme-mine { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.theme-mine-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-swatches { display: inline-flex; flex: none; }
.theme-swatches i { width: 12px; height: 18px; display: block; }
.theme-swatches i:first-child { border-radius: 4px 0 0 4px; }
.theme-swatches i:last-child { border-radius: 0 4px 4px 0; }

/* the Theme builder window */
.theme-window { width: min(1180px, 96vw); height: min(820px, 92vh); display: flex; flex-direction: column; }
.theme-window .modal-head { display: flex; align-items: center; gap: 8px; }
.tw-modes { display: inline-flex; gap: 4px; }
.tw-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; }
.tw-controls { overflow: auto; padding: 4px 12px 12px; border-right: 1px solid var(--line); }
.tw-preview { width: 100%; height: 100%; border: 0; background: #fff; }
.theme-window .ask-actions { display: flex; align-items: center; gap: 8px; }
.tw-modes .btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.theme-window .ask-actions { padding: 12px 16px; border-top: 1px solid var(--line); }
/* the Publish window: nothing in it may be squeezed to nothing when the window is short (the result lines of Test and Publish were) */
#pbBody > * { flex-shrink: 0; }

/* several elements selected (see multiselect.js) */
.multi-note { padding: 6px 12px; font-size: 12px; color: var(--muted); }
.multi-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.multi-row input { flex: 1; min-width: 0; }
.multi-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.multi-chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--text, #fff); border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.multi-chip:hover { border-color: var(--accent); }
.multi-chip.partial { opacity: .7; border-style: dashed; }

/* dialog windows can be resized (see winresize.js) */
.modal-card { position: relative; }
.modal-card.wr-sized { max-width: none; max-height: none; }
.modal-card.wr-sized > :not(.modal-head):not(.ask-actions):not(.wr-h) { max-height: none; min-height: 0; }
.modal-card.wr-sized > .ask-body { flex: 1 1 auto; overflow: auto; }
.modal-card.wr-sized .ask-body { max-height: none; }
.wr-h { position: absolute; z-index: 30; touch-action: none; }
.wr-n, .wr-s { left: 10px; right: 10px; height: 8px; cursor: ns-resize; }
.wr-e, .wr-w { top: 10px; bottom: 10px; width: 8px; cursor: ew-resize; }
.wr-n { top: -4px; } .wr-s { bottom: -4px; } .wr-e { right: -4px; } .wr-w { left: -4px; }
.wr-ne, .wr-nw, .wr-se, .wr-sw { width: 16px; height: 16px; }
.wr-ne { top: -6px; right: -6px; cursor: nesw-resize; } .wr-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.wr-se { bottom: -6px; right: -6px; cursor: nwse-resize; } .wr-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }

/* a tab of a website folder project */
.doc-site { display: inline-flex; align-items: center; color: var(--accent); margin-right: -2px; }
.doc-site svg { display: block; }

/* the Markdown editor window: once the window has been resized, the text area (or the preview) fills it */
.modal-card.wr-sized > .ask-body.md-dialog { display: flex; flex-direction: column; overflow: hidden; }
.modal-card.wr-sized > .ask-body.md-dialog > .md-editor { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wr-sized .md-dialog .md-editor .md-input { flex: 1 1 auto; min-height: 120px; height: auto; resize: none; }
.wr-sized .md-dialog .md-editor .md-preview { flex: 1 1 auto; min-height: 120px; height: auto; }

/* the Markdown text area has no focus ring (it showed as a white line around the text); the blinking caret shows where you are */
.md-input:focus, .md-input:focus-visible { outline: none; box-shadow: none; }

/* every text area in the app has the background the Markdown editor has */
textarea, .field textarea, .blk-code, .css-editor, .md-input { background: var(--bg); }

/* no browser focus ring (a white line) around any text area; the caret shows where you are, and fields with a frame keep their accent border */
textarea:focus, textarea:focus-visible { outline: none; box-shadow: none; }
/* a text area with no frame of its own gets the app's thin dark one, not the browser's grey-white one */
:where(textarea) { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; }

/* every text field and dropdown has the same background as the text areas (and the Markdown editor); not check boxes, radio buttons, sliders, color pickers, file and button inputs */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]), select { background-color: var(--bg); }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]), select) { border: 1px solid var(--line); border-radius: var(--radius); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus, select:focus, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus-visible, select:focus-visible { outline: none; }
/* the dropdowns are styled in many places with their own backgrounds: this one rule is the strongest of them (the :not(#x) only raises its weight) */
select:not(#bsb-select) { background-color: var(--bg); }
