/* Appearance popover (theme.js; the Bible's, 2026-11-19). Same file on tools and intranet; keep them identical.
   Self-contained: only .ap-* classes, only the shared tokens (--bg --surface --surface-2 --line --fg --muted --accent
   --accent-soft --on-accent --shadow), with fallbacks. */
.ap-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; vertical-align: middle; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); flex: none; }
.ap-btn:hover, .ap-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.ap-btn[hidden] { display: none; }
.ap-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; box-sizing: border-box;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, .18)); overflow: auto; font-size: 13px; line-height: 1.45; text-align: left; }
.ap-pop button, .ap-pop input { font: inherit; color: inherit; }
.ap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ap-status { color: var(--muted); font-size: 11.5px; text-align: right; }
.ap-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 0 0; }
.ap-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ap-seg button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 4px 12px; cursor: pointer; }
.ap-seg button:last-child { border-right: 0; }
.ap-seg button[aria-pressed="true"] { background: var(--accent-soft); font-weight: 600; }
.ap-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.ap-scheme { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); cursor: pointer; text-align: left; white-space: nowrap; }
.ap-scheme:hover { border-color: var(--muted); }
.ap-scheme[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.ap-chip { display: inline-flex; flex: none; width: 24px; height: 14px; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 22%, transparent); }
.ap-chip i { flex: 1; }
.ap-chip.custom { background: conic-gradient(#d9534f, #e08a1e, #c9a400, #6b8e23, #1f9d8b, #2f7dd1, #8e5bd0, #d6457f, #d9534f); }
.ap-custom { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px; border-radius: 6px; background: var(--surface-2); }
.ap-custom label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ap-custom p { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--muted); }
.ap-pop input[type="color"] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
.ap-foot { display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.ap-gap { flex: 1; }
.ap-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 12px; }
.ap-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.ap-done { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.ap-done:hover { border-color: var(--accent); }
.ap-pop :focus-visible, .ap-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
