/* Caboodle Spreadsheet – Copyright (C) 2026 the Caboodle authors – GNU GPL v3, see LICENSE.txt
   SPDX-License-Identifier: GPL-3.0-only */
/* Command chrome: slim top bar, left bar, mega menu, command search and drag-and-drop (see shared/chrome.js). */
#workspace { flex: 1; min-height: 0; display: flex; }
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- top bar: row 1 = program, file, title, status; row 2 = Menu and your top bar ---------- */
.cmd-header {
  flex: none; position: relative; z-index: 20; display: flex; flex-direction: column;
  background: var(--surface); border-top: 3px solid var(--prog); border-bottom: 1px solid var(--line);
}
.cmd-row1 { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 6px; }
.cmd-row2 { display: flex; align-items: flex-start; gap: 6px; min-height: 42px; padding: 5px 8px 5px 6px; border-top: 1px solid var(--line-soft); }
.cmd-switch, .cmd-files-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px; flex: none;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--text);
}
.cmd-switch { gap: 8px; }
.cmd-switch:hover, .cmd-files-btn:hover, .cmd-files-btn.open { background: var(--hover); }
.cmd-switch > .material-symbols-outlined, .cmd-files-btn > .material-symbols-outlined:last-child { font-size: 18px; color: var(--muted); }
.cmd-files-btn { padding: 0 4px 0 8px; font-weight: 500; }
.cmd-files-btn > .material-symbols-outlined:first-child { font-size: 20px; color: var(--prog-strong); }
.cmd-prog { width: 28px; height: 28px; border-radius: 8px; background: var(--prog-soft); color: var(--prog-strong); display: inline-flex; align-items: center; justify-content: center; }
.cmd-prog .material-symbols-outlined { font-size: 18px; }
.cmd-vd { width: 1px; height: 20px; background: var(--line); flex: none; margin: 0 2px; }
.cmd-title {
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text); background: transparent; flex: 0 1 auto;
  border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; min-width: 120px; max-width: 420px;
  field-sizing: content; text-overflow: ellipsis;
}
.cmd-header #doc-title { width: auto; font-size: 15px; }
.cmd-header .cmd-context#doc-title, .cmd-header .cmd-context#doc-title:hover { border-color: transparent; background: transparent; width: auto; }
.cmd-context { flex: 0 1 auto; min-width: 0; padding: 4px 6px; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-title::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
.cmd-title:hover { border-color: var(--line); }
.cmd-title:focus { outline: none; border-color: var(--prog); background: var(--surface); }
.cmd-status {
  flex: none; width: 112px; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px;
  font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; cursor: default;
}
.cmd-status .material-symbols-outlined { font-size: 16px; flex: none; }
.cmd-status-word { overflow: hidden; text-overflow: ellipsis; }
.cmd-status.st-saving .material-symbols-outlined { animation: cmd-spin 1.2s linear infinite; }
.cmd-status.st-error { color: var(--danger); background: var(--danger-soft); }
.cmd-status.st-busy { color: var(--text); }
@keyframes cmd-spin { to { transform: rotate(-360deg); } }
.cmd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmd-local {
  flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; margin-left: 2px;
  border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden;
}
.cmd-local:hover { background: var(--hover); color: var(--text); }
.cmd-local .material-symbols-outlined { font-size: 16px; color: var(--prog-strong); flex: none; }
.cmd-local-text { overflow: hidden; text-overflow: ellipsis; }
.cmd-grow { flex: 1 1 0; min-width: 0; }
.cmd-cloud {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.cmd-cloud:hover { border-color: var(--prog); background: var(--prog-soft); }
.cmd-cloud .material-symbols-outlined { font-size: 18px; color: var(--prog-strong); }
.cmd-cloud-badge { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; padding: 1px 6px; border-radius: 8px; background: var(--prog-soft); color: var(--prog-strong); }
.cmd-feedback {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px; margin-right: 6px;
  border: 0; border-radius: 15px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.cmd-feedback:hover { background: var(--hover); color: var(--text); }
.cmd-feedback .material-symbols-outlined { font-size: 18px; color: var(--prog-strong); }
.cmd-info { width: 320px; display: flex; flex-direction: column; gap: 8px; padding: 6px 6px 4px; font-size: 13px; line-height: 1.45; }
.cmd-info h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cmd-info h3 .material-symbols-outlined { font-size: 18px; color: var(--prog-strong); }
.cmd-info p { margin: 0; color: var(--text); }
.cmd-info .link-btn { align-self: flex-start; padding: 2px 0; text-align: left; color: var(--prog-strong); }
.cmd-cloud-info { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.cmd-cloud-info p { margin: 0; }
.cmd-cloud-lead { font-size: 14.5px; }
.cmd-cloud-info ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cmd-cloud-info li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.cmd-cloud-info li .material-symbols-outlined { font-size: 20px; color: var(--prog-strong); }
/* feedback and Cloud sync forms (shared/site.js) */
.cb-modal .modal-body { max-height: min(72vh, 680px); overflow: auto; }
.cb-form { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; line-height: 1.45; }
.cb-form p { margin: 0; }
.cb-lead { font-size: 14.5px; }
.cb-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cb-points li { display: flex; gap: 10px; align-items: flex-start; }
.cb-points .material-symbols-outlined { font-size: 20px; color: var(--prog-strong); flex: none; }
.cb-soon { padding: 10px 12px; border-radius: 10px; background: var(--prog-soft); color: var(--text); }
.cb-field { display: flex; flex-direction: column; gap: 5px; }
.cb-label { font-weight: 600; font-size: 13px; color: var(--text); }
.cb-opt { font-weight: 400; color: var(--muted); }
.cb-field input, .cb-field textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; box-sizing: border-box; }
.cb-field textarea { resize: vertical; min-height: 44px; }
.cb-field input:focus, .cb-field textarea:focus { outline: 2px solid var(--prog); outline-offset: -1px; border-color: transparent; }
.cb-set { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cb-set legend { padding: 0; margin-bottom: 6px; }
.cb-seg, .cb-prices { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; cursor: pointer; font-size: 13px; background: var(--surface); user-select: none; }
.cb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cb-chip .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.cb-chip:hover { border-color: var(--prog); }
.cb-chip:has(input:checked) { border-color: var(--prog); background: var(--prog-soft); color: var(--prog-strong); font-weight: 600; }
.cb-chip:has(input:checked) .material-symbols-outlined { color: var(--prog-strong); }
.cb-chip:has(input:focus-visible) { outline: 2px solid var(--prog); outline-offset: 1px; }
.cb-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; }
.cb-check input { margin: 2px 0 0; flex: none; accent-color: var(--prog-strong); }
.cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cb-human:empty { display: none; }
.cb-error { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 10px; }
.cb-note { font-size: 12px; color: var(--muted); }
.cb-note a { color: var(--prog-strong); }
.cb-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 8px 10px; font-size: 14px; line-height: 1.5; }
.cb-done .material-symbols-outlined { font-size: 40px; color: var(--prog-strong); }
.cb-done h3 { margin: 0; font-size: 18px; }
.cb-done p { margin: 0; max-width: 420px; }
.cmd-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; flex: none;
  border: 0; border-radius: 8px; background: var(--prog-soft); color: var(--prog-strong); font-weight: 600; cursor: pointer;
}
.cmd-menu-btn > .material-symbols-outlined:last-child { font-size: 17px; opacity: .75; }
.cmd-menu-btn:hover { box-shadow: inset 0 0 0 1px var(--prog); }
.cmd-menu-btn.open { background: var(--prog-strong); color: #fff; }
.cmd-kbd {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; flex: none;
}

/* ---------- bars (labels off | beside | below | above; top bar 1–3 rows, left bar 1–3 columns) ---------- */
.cmd-bar { display: flex; align-items: center; }
.cmd-top {
  flex: 1 1 auto; min-width: 40px; height: 32px; gap: 1px; row-gap: 4px; padding: 0 2px; overflow: hidden; border-radius: 10px;
  flex-wrap: wrap; align-content: flex-start;
}
.cmd-row2 > .cmd-menu-btn { margin-top: calc((var(--itemh, 32px) - 32px) / 2); }
.cmd-row2 > .cmd-vd { margin-top: calc((var(--itemh, 32px) - 20px) / 2); }
.cmd-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none;
  min-width: 32px; height: 32px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  cursor: pointer; font-size: 13px; white-space: nowrap;
}
.cmd-btn:hover { background: var(--hover); }
.cmd-btn.active { background: var(--prog-soft); color: var(--prog-strong); }
.cmd-btn.disabled { opacity: .35; cursor: default; }
.cmd-btn.disabled:hover { background: transparent; }
.cmd-btn:focus-visible, .cmd-switch:focus-visible, .cmd-menu-btn:focus-visible { outline: 2px solid var(--prog); outline-offset: 1px; }
.cmd-btn.has-text { padding: 0 8px 0 6px; gap: 6px; }
.cmd-btn.has-caret { padding-right: 0; }
.cmd-lab { overflow: hidden; text-overflow: ellipsis; max-width: 140px; font-size: 12.5px; line-height: 1.15; }
.cmd-caret { display: inline-flex; }
.cmd-caret .material-symbols-outlined { font-size: 18px; margin-left: -4px; color: var(--muted); }
.cmd-mono {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 3px; flex: none;
  border-radius: 6px; background: var(--line-soft); font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
/* a separator's box fills the gap between its neighbours (easy to right-click or drag); the line is drawn in the middle */
.cmd-sep { position: relative; flex: none; align-self: center; width: 11px; height: 32px; margin: 0 -1px; border-radius: 4px; }
.cmd-sep::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.cmd-sep:hover { background: var(--hover); }
/* a separator that pushes what follows to the right end (its line at its right edge) */
.cmd-top .cmd-sep.cmd-push { flex: 1 1 11px; min-width: 11px; }
.cmd-top .cmd-sep.cmd-push::before { left: auto; right: 5px; }
.cmd-sep:hover::before { background: #8e8e99; }
.cmd-over { display: none !important; }
.cmd-more { margin-left: 2px; }

/* labels below or above the icon */
.lab-below .cmd-btn, .lab-above .cmd-btn { flex-direction: column; gap: 2px; height: 50px; min-width: 50px; max-width: 80px; padding: 5px 5px 4px; }
.lab-below .cmd-lab, .lab-above .cmd-lab { font-size: 11px; max-width: 72px; }
.lab-above .cmd-lab { order: -1; }
.lab-below .cmd-btn .cmd-caret, .lab-above .cmd-btn .cmd-caret { position: absolute; right: 1px; top: 4px; }
.lab-above .cmd-btn .cmd-caret { top: auto; bottom: 4px; }
.lab-below .cmd-btn .cmd-caret .material-symbols-outlined, .lab-above .cmd-btn .cmd-caret .material-symbols-outlined { font-size: 15px; margin: 0; }
.lab-below .cmd-sep, .lab-above .cmd-sep { height: 50px; }
.lab-below .cmd-sep::before, .lab-above .cmd-sep::before { top: 8px; bottom: 8px; }
/* controls that show their own value keep their normal shape */
.lab-below .cmd-font, .lab-above .cmd-font { flex-direction: row; height: 32px; max-width: none; padding: 0 0 0 8px; }
.lab-below .cmd-size .cmd-btn, .lab-above .cmd-size .cmd-btn { flex-direction: row; height: 32px; min-width: 22px; padding: 0; }

.cmd-left {
  flex: none; width: max-content; display: grid; grid-template-columns: 36px; justify-content: center; align-content: start; gap: 2px;
  padding: 6px; background: var(--surface); border-right: 1px solid var(--line); overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
}
.cmd-left::-webkit-scrollbar { display: none; }
.cmd-left.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
.cmd-left.more-above { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 32px), transparent); }
.cmd-left.more-above.more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.cmd-left.empty { display: block; width: 8px; padding: 0; background: var(--bg); }
.cmd-left .cmd-btn { width: 36px; min-width: 36px; height: 36px; padding: 0; }
.cmd-left .cmd-btn .cmd-caret { position: absolute; right: 0; bottom: 1px; }
.cmd-left .cmd-btn .cmd-caret .material-symbols-outlined { font-size: 14px; margin: 0; }
.cmd-left .cmd-sep { grid-column: 1 / -1; width: auto; height: 11px; margin: -2px 0; }
.cmd-left .cmd-sep::before { left: 6px; right: 6px; top: 5px; bottom: auto; width: auto; height: 1px; }
.cmd-left .cmd-mono { min-width: 26px; }
.cmd-left.lab-below .cmd-btn, .cmd-left.lab-above .cmd-btn { width: 64px; min-width: 0; max-width: 64px; height: 52px; }
.cmd-left.lab-below .cmd-lab, .cmd-left.lab-above .cmd-lab { max-width: 58px; }
.cmd-left.lab-beside .cmd-btn { width: 164px; justify-content: flex-start; padding: 0 8px; gap: 8px; }
.cmd-left.lab-beside .cmd-lab { max-width: 120px; }
.cmd-left.lab-beside .cmd-btn .cmd-caret { position: static; margin-left: auto; }

/* program controls on the bars */
.cmd-font { width: 108px; justify-content: space-between; padding: 0 0 0 8px; font-size: 13px; }
.cmd-font-name { overflow: hidden; text-overflow: ellipsis; }
.cmd-size { display: inline-flex; align-items: center; flex: none; }
.cmd-size .cmd-btn { min-width: 22px; width: 22px; }
.cmd-size .cmd-btn .material-symbols-outlined { font-size: 16px; }
.cmd-size input {
  width: 32px; height: 24px; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font-family: var(--mono); font-size: 12px; color: var(--text); padding: 0;
}
.cmd-size input:focus { outline: 2px solid var(--prog); outline-offset: -1px; }
.cmd-colorstack { display: inline-flex; flex-direction: column; align-items: center; }
.cmd-color .cmd-colorstack .material-symbols-outlined { font-size: 19px; margin-top: 1px; height: 0.8em; overflow: hidden; } /* the icon's own (black) bar is cut off: the colour bar below takes its place */
.cmd-colorbar { display: block; width: 18px; height: 3px; border-radius: 2px; margin-top: 1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.cmd-select { height: 32px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; padding: 0 4px; cursor: pointer; color: var(--text); flex: none; }
.cmd-select:hover { background: var(--hover); }

/* ---------- History: the last section of every right panel ---------- */
#workspace { position: relative; }
.cmd-hist-pane { display: flex; flex-direction: column; min-height: 0; }
/* the Tool section: the active tool's settings, first in the right panel */
.cmd-tool-pane { display: flex; flex-direction: column; min-height: 0; }
.cmd-tool-pane .cmd-tool-body { overflow: auto; padding-top: 8px; }
.cmd-tool-pane .pane-head .cmd-tool-icon { color: var(--accent-strong); }
.cmd-hist { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 1px; }
.cmd-hrow {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 4px 8px; border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; flex: none;
}
.cmd-hrow:hover { background: var(--hover); }
.cmd-hrow.static { cursor: default; }
.cmd-hrow.static:hover { background: none; }
.cmd-hrow > .material-symbols-outlined { font-size: 16px; color: var(--muted); flex: none; }
.cmd-hrow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-hrow .when { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmd-hrow.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.cmd-hrow.active > .material-symbols-outlined { color: var(--accent-strong); }
.cmd-hrow.future, .cmd-hrow.future .when { color: var(--faint); }
/* what an empty list says: the same everywhere */
.empty-state, .cmd-hist-empty { padding: 14px 10px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }


/* ---------- File › Download a copy… (shared/download.js) ---------- */
.dl { display: flex; flex-direction: column; gap: 8px; }
.dl-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.dl-name { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.dl-name-wrap { display: flex; align-items: center; gap: 6px; }
.dl-name-wrap .inp { flex: 1; min-width: 0; }
.dl-ext { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.dl-formats { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; max-height: 46vh; overflow-y: auto; }
.dl-format { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; border-top: 1px solid var(--line-soft); }
.dl-format:first-child { border-top: 0; }
.dl-format:hover { background: var(--hover); }
.dl-format.on { background: var(--accent-soft); }
.dl-format input { margin: 3px 0 0; accent-color: var(--accent-strong); flex: none; }
.dl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.dl-badge { font: 500 11px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--sunk); color: var(--text-2); }
.dl-format.on .dl-badge { background: var(--surface); }
.dl-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dl-options { padding: 10px 12px; border-radius: var(--radius); background: var(--sunk); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13px; }
.dl-options label { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Help › Keyboard shortcuts and About ---------- */
.kh { display: flex; flex-direction: column; gap: 12px; }
.kh-search { height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; font-size: 13.5px; background: var(--surface); color: var(--text); }
.kh-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.kh-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; align-items: start; max-height: min(62vh, 640px); overflow: auto; padding-right: 4px; }
.kh-groups > .kh-none { grid-column: 1 / -1; }
@media (max-width: 700px) { .kh-groups { grid-template-columns: minmax(0, 1fr); } }
.kh-group { margin-bottom: 16px; }
.kh-title { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kh-table td { padding: 4px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.kh-what { padding-right: 12px !important; }
.kh-keys { text-align: right; white-space: nowrap; }
.kh-keys kbd { margin: 0 1px; }
.kh-plus, .kh-dot, .kh-or { color: var(--muted); font-size: 11px; margin: 0 2px; }
.kh-or { margin: 0 5px; }
.kh-none { color: var(--muted); }
.about { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; line-height: 1.5; }
.about-head { display: flex; gap: 14px; align-items: flex-start; }
.about-tile { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.about-tile .material-symbols-outlined { font-size: 26px; }
.about-name { font-size: 17px; font-weight: 600; }
.about-intro { color: var(--text-2); }
.about-files { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--sunk); }
.about-files dt { font-weight: 600; color: var(--muted); }
.about-files dd { margin: 0; }
.about h3 { margin: 6px 0 2px; font-size: 13px; font-weight: 600; }
.about ul.feat { margin: 0; }
.about-foot { margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.about-foot a { color: var(--accent-strong); }

/* ---------- mega menu ---------- */
.cmd-mega {
  position: fixed; z-index: 1100; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop-shadow); transition: opacity .15s;
}
.cmd-mega.faded, .cmd-fly.faded { opacity: .14; pointer-events: none; }
.cmd-mega-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 14px 6px; }
.cmd-mega-search {
  flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--line); color: var(--muted); cursor: text;
}
.cmd-mega-search .material-symbols-outlined { font-size: 20px; }
.cmd-mega-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text); padding: 0; }
.cmd-mega-search input::placeholder { color: var(--muted); opacity: 1; }
.cmd-mega-search input::-webkit-search-cancel-button { display: none; }
.cmd-cols { column-width: 250px; column-gap: 18px; }
.cmd-col { break-inside: avoid; display: flow-root; padding-bottom: 14px; }
.cmd-col-head { margin: 0 0 4px; padding: 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cmd-row {
  display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 4px 0 8px; border-radius: 6px;
  font-size: 13px; white-space: nowrap; cursor: default; user-select: none; color: var(--text);
}
.cmd-row.hover, .cmd-row:hover { background: var(--hover); }
.cmd-row.disabled { opacity: .45; }
.cmd-row-icon { width: 20px; flex: none; display: inline-flex; justify-content: center; color: var(--muted); }
.cmd-row-icon .material-symbols-outlined { font-size: 18px; }
.cmd-row-label { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; text-overflow: ellipsis; }
.cmd-row-path { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cmd-row-hint { font-size: 12px; color: var(--muted); }
.cmd-row-short { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cmd-row-arrow { display: inline-flex; color: var(--muted); }
.cmd-row-arrow .material-symbols-outlined { font-size: 18px; }
.cmd-row-sep { height: 1px; background: var(--line-soft); margin: 4px 8px; }
.cmd-star {
  flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; opacity: 0;
}
.cmd-star .material-symbols-outlined { font-size: 17px; }
.cmd-row:hover .cmd-star, .cmd-row.hover .cmd-star, .cmd-star.on, .cmd-star:focus-visible { opacity: 1; }
.cmd-star:hover { background: rgba(24, 24, 27, .07); color: var(--text); }
.cmd-star.on { color: var(--prog-strong); }
.cmd-star.on .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
.cmd-results { display: flex; flex-direction: column; max-width: 780px; }
.cmd-empty { padding: 18px 8px; color: var(--muted); }
.cmd-mega-foot {
  flex: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 16px; border-top: 1px solid var(--line);
  background: var(--bg); font-size: 12px; color: var(--muted);
}
.cmd-mega-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.cmd-mega-foot .material-symbols-outlined { font-size: 16px; }
.cmd-fly {
  position: fixed; z-index: 1110; min-width: 230px; max-height: calc(100vh - 12px); overflow: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop-shadow); transition: opacity .15s;
}

/* ---------- files saved in this browser ---------- */
.cmd-files {
  position: fixed; z-index: 1100; width: 380px; max-width: calc(100vw - 16px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop-shadow);
}
.cmd-files-head { flex: none; display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line-soft); }
.cmd-files-act {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.cmd-files-act:hover { background: var(--hover); }
.cmd-files-act .material-symbols-outlined { font-size: 18px; color: var(--prog-strong); }
.cmd-files-filter {
  flex: none; margin: 8px 10px 0; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
}
.cmd-files-filter:focus { outline: 2px solid var(--prog); outline-offset: -1px; }
.cmd-files-list { flex: 1; min-height: 0; overflow: auto; padding: 6px; }
.cmd-file { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 4px 4px 8px; border-radius: 8px; cursor: pointer; }
.cmd-file:hover, .cmd-file:focus-visible { background: var(--hover); outline: none; }
.cmd-file.active { background: var(--prog-soft); }
.cmd-file.active > .material-symbols-outlined { color: var(--prog-strong); font-size: 18px; }
.cmd-file.unsaved { cursor: default; }
.cmd-file-icon { width: 28px; height: 28px; flex: none; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--line-soft); color: var(--prog-strong); }
.cmd-file-icon .material-symbols-outlined { font-size: 18px; }
.cmd-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmd-file-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-file-when { font-size: 12px; color: var(--muted); }
.cmd-file.unsaved .cmd-file-title { font-style: italic; }
.cmd-file-more {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.cmd-file-more:hover { background: rgba(24, 24, 27, .08); color: var(--text); }
.cmd-files-empty { padding: 16px 10px; color: var(--muted); font-size: 13px; }
.cmd-files-foot {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-soft);
  background: var(--bg); font-size: 12px; color: var(--muted);
}
.cmd-files-foot .material-symbols-outlined { font-size: 16px; }
.cmd-toast { display: flex; align-items: center; gap: 14px; }
.cmd-toast-btn { border: 0; background: transparent; color: color-mix(in srgb, var(--prog) 45%, #fff); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.cmd-toast-btn:hover { background: rgba(255, 255, 255, .12); }

/* ---------- drag and drop ---------- */
body.cmd-dragging, body.cmd-dragging * { cursor: grabbing !important; user-select: none; }
.cmd-ghost {
  position: fixed; left: 0; top: 0; z-index: 4000; pointer-events: none; display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 8px; border-radius: 8px; background: #18181b; color: #fff; font-size: 13px; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(24, 24, 27, .3);
}
.cmd-ghost .material-symbols-outlined { font-size: 18px; }
.cmd-ghost.remove { background: var(--danger); }
.cmd-ghost.remove::after { content: "Release to remove"; font-size: 12px; opacity: .85; }
.cmd-dragsrc { opacity: .3; }
.cmd-drop-ind { position: fixed; z-index: 3999; display: none; pointer-events: none; background: var(--prog-strong); border-radius: 2px; }
.cmd-drop-ind.v { width: 3px; }
.cmd-drop-ind.h { height: 3px; }
.cmd-left-drop {
  position: fixed; z-index: 3998; pointer-events: none; box-sizing: border-box; border: 2px dashed var(--line-strong); border-radius: 10px;
  background: rgba(250, 250, 251, .55); transition: background .12s, border-color .12s;
}
.cmd-left-drop.over { border-color: var(--prog); background: color-mix(in srgb, var(--surface) 75%, transparent); }
body.cmd-dragging .cmd-top { outline: 1.5px dashed var(--line-strong); outline-offset: -6px; }
body.cmd-dragging .cmd-top.drop-over { outline: 2px dashed var(--prog); }

@media (max-width: 1100px) {
  .cmd-prog-name, .cmd-cloud-text, .cmd-feedback-text { display: none; }
}
@media (max-width: 900px) {
  .cmd-local-text { display: none; }
}
@media (max-width: 700px) {
  /* phones: the left bar keeps to icons, whatever its label setting */
  .cmd-left.lab-beside, .cmd-left.lab-below, .cmd-left.lab-above { grid-template-columns: repeat(var(--cols, 1), 36px) !important; }
  .cmd-left.lab-beside .cmd-btn, .cmd-left.lab-below .cmd-btn, .cmd-left.lab-above .cmd-btn { width: 36px; min-width: 36px; max-width: 36px; height: 36px; padding: 0; flex-direction: row; justify-content: center; }
  .cmd-left.lab-beside .cmd-lab, .cmd-left.lab-below .cmd-lab, .cmd-left.lab-above .cmd-lab { display: none; }
  .cmd-left.lab-beside .cmd-btn .cmd-caret { position: absolute; margin: 0; }
  .cmd-files-label, .cmd-menu-label, .cmd-cloud-badge { display: none; }
  .cmd-cloud { padding: 0 6px; }
  .cmd-feedback { padding: 0 6px; margin-right: 2px; }
  .cmd-status { width: 30px; padding: 0 6px; }
  .cmd-status-word { display: none; }
  .cmd-title { min-width: 60px; }
}
@media (prefers-reduced-motion: reduce) { .cmd-mega, .cmd-fly, .cmd-left-drop { transition: none; } .cmd-status.st-saving .material-symbols-outlined { animation: none; } }

/* ---------- the status bar: hint (or a tip) · facts · zoom – the same in every document program ---------- */
.cmd-statusbar {
  flex: none; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px 0 4px; position: relative; z-index: 5;
  background: var(--panel); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.sb-tipbtn { flex: none; width: 24px; height: 22px; border: 0; border-radius: var(--radius-s); background: none; color: var(--faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sb-tipbtn .material-symbols-outlined { font-size: 16px; }
.sb-tipbtn:hover { background: var(--hover); color: var(--text-2); }
.cmd-statusbar.tip .sb-tipbtn { color: var(--accent-strong); }
.sb-hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sb-hint b { font-weight: 600; color: var(--accent-strong); margin-right: 3px; }
.sb-facts { flex: none; display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.sb-fact { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; color: var(--muted); }
.sb-fact + .sb-fact { box-shadow: inset 1px 0 0 var(--line); }
.sb-fact .material-symbols-outlined { font-size: 15px; }
button.sb-fact { border: 0; background: none; font: inherit; border-radius: var(--radius-s); cursor: pointer; }
button.sb-fact:hover { background: var(--hover); color: var(--text); box-shadow: none; }
button.sb-fact:hover + .sb-fact { box-shadow: none; }
.sb-fact.warn { color: var(--warn); }
.sb-zoom { flex: none; display: flex; align-items: center; gap: 1px; padding-left: 6px; border-left: 1px solid var(--line); }
.sb-zbtn { width: 24px; height: 22px; border: 0; border-radius: var(--radius-s); background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sb-zbtn .material-symbols-outlined { font-size: 16px; }
.sb-zbtn:hover, .sb-zlevel:hover { background: var(--hover); color: var(--text); }
.sb-zlevel { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0; min-width: 62px; height: 22px; padding: 0 2px 0 6px; border: 0; border-radius: var(--radius-s); background: none; font: inherit; color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.sb-zlevel .material-symbols-outlined { font-size: 16px; color: var(--muted); }
@media (max-width: 760px) { .sb-hint { visibility: hidden; } .cmd-statusbar .sb-tipbtn { display: none; } }
@media (max-width: 520px) { .sb-facts .sb-fact:not(:first-child):not(.keep) { display: none; } }

/* ---------- Find: the first section of the right panel while it is open (shared/find.js) ---------- */
.cmd-find-pane { display: flex; flex-direction: column; min-height: 0; }
.cmd-find-pane .pane-head .material-symbols-outlined:first-child { color: var(--accent-strong); }
.cf-count { font-variant-numeric: tabular-nums; }
.cmd-find-pane .cf-close { margin-left: auto; }
.cf-body { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; overflow: auto; min-height: 0; font-size: 12.5px; }
.cf-field { display: flex; align-items: center; gap: 2px; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); padding: 0 2px 0 0; }
.cf-field:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.cf-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0 8px; font: 12.5px var(--mono); color: var(--text); }
.cf-ib { flex: none; width: 24px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cf-ib .material-symbols-outlined { font-size: 17px; }
.cf-ib:hover { background: var(--hover); color: var(--text); }
.cf-toggles { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.cf-tog { height: 26px; min-width: 30px; padding: 0 5px; border: 1px solid transparent; border-radius: var(--radius-s); background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: 600 11.5px var(--mono); }
.cf-tog .material-symbols-outlined { font-size: 19px; }
.cf-tog:hover { background: var(--hover); color: var(--text); }
.cf-tog.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-strong); }
.cf-tog:disabled { cursor: default; opacity: 0.7; }
.cf-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.cf-check input { margin: 0; accent-color: var(--accent-strong); }
.cf-toggles .cf-check { margin-left: 6px; }
.cf-where { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-scope { height: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); font: inherit; font-size: 12.5px; padding: 0 6px; color: var(--text); min-width: 0; max-width: 100%; }
.cf-scopefields { display: flex; flex-direction: column; gap: 6px; }
.cf-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.cf-buttons .pf-btn { padding: 0 9px; }
.cf-buttons .cf-more { padding: 0 4px; margin-left: auto; }
.cf-msg { min-height: 16px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.cf-msg:empty { display: none; }
.cf-msg.bad { color: var(--danger); }
.cf-msg.warn { color: var(--warn); }
.cf-msg.ok { color: var(--ok); }
.cf-results { display: flex; flex-direction: column; margin: 0 -10px; }
.cf-results:empty { display: none; }
.cf-group { position: sticky; top: -8px; z-index: 1; padding: 5px 10px 3px; background: var(--panel); font-size: 11.5px; font-weight: 600; color: var(--text-2); border-top: 1px solid var(--line-soft); }
.cf-hit { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 3px 10px; border: 0; background: none; text-align: left; font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer; min-width: 0; }
.cf-hit:hover { background: var(--hover); }
.cf-hit.on { background: var(--sel-soft); color: var(--text); }
.cf-wh { flex: none; min-width: 34px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.cf-tx mark { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
.cf-help { font-size: 12px; color: var(--text-2); }
.cf-help summary { cursor: pointer; color: var(--muted); padding: 2px 0; }
.cf-help summary:hover { color: var(--text); }
.cf-help table { border-collapse: collapse; margin-top: 4px; width: 100%; }
.cf-help th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 6px 0 2px; }
.cf-help td { padding: 2px 6px 2px 0; vertical-align: top; }
.cf-help td:first-child { white-space: nowrap; }
.cf-help code { font: 11.5px var(--mono); background: var(--sunk); border-radius: 3px; padding: 0 3px; }
.cf-foldername { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.cf-labeled { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cf-input { height: 28px; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); padding: 0 8px; font: 12px var(--mono); color: var(--text); }
.cf-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ---------- the record programs' sections: a labelled group at the top of the left bar (not part of its layout) ---------- */
.cmd-nav { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; }
.cmd-nav-label { padding: 4px 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-left.lab-off .cmd-nav-label, .cmd-left.lab-below .cmd-nav-label, .cmd-left.lab-above .cmd-nav-label { padding: 2px 0; text-align: center; font-size: 10.5px; }
.cmd-nav-item { text-decoration: none; }
.cmd-nav-item.active { font-weight: 600; }
.cmd-left .cmd-nav-item { width: auto; }
.cmd-left.lab-off .cmd-nav-item .cmd-lab { display: none; }
.cmd-nav-n { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--prog-soft); color: var(--prog-strong); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cmd-left.lab-off .cmd-nav-n { position: absolute; top: 1px; right: 1px; min-width: 14px; height: 14px; padding: 0 3px; font-size: 9.5px; }
.cmd-nav-sep { display: block; height: 1px; margin: 5px 6px 4px; background: var(--line); }
.cmd-nav-row { position: relative; display: flex; }
.cmd-nav-row > .cmd-nav-item { flex: 1; min-width: 0; padding-right: 28px; }
.cmd-nav-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cmd-nav-x .material-symbols-outlined { font-size: 15px; }
.cmd-nav-x:hover { background: var(--hover); color: var(--text); }
.cmd-left.lab-off .cmd-nav-x { display: none; }

/* ---------- the Files list: this program's files, then the other programs' (shared/chrome.js renderFiles) ---------- */
.cmd-files-kinds { flex: none; display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 10px 2px; }
.cmd-files-kind { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 7px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer; }
.cmd-files-kind .material-symbols-outlined { font-size: 15px; }
.cmd-files-kind:hover { background: var(--hover); }
.cmd-files-kind.on { background: var(--prog-soft); border-color: transparent; color: var(--prog-strong); font-weight: 500; }
.cmd-files-group { padding: 10px 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* a font size box on a bar (− 12 +): Slide show, PDF editor */
.w-size { display: inline-flex; align-items: center; gap: 1px; }
.w-size-inp { width: 40px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); text-align: center; font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; }
