:root {
  --bg: #ffffff; --fg: #1f2328; --muted: #59636e; --line: #d1d9e0; --panel: #f6f8fa;
  --accent: #6d3b8e; --accent-fg: #ffffff; --focus: #0969da;
  --ok-bg: #dafbe1; --ok: #1a7f37; --warn-bg: #ffebe9; --warn: #cf222e; --pend-bg: #fff8c5; --pend: #9a6700;
  --cell: 44px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1f22; --fg: #e6edf3; --muted: #9198a1; --line: #3d444d; --panel: #2a2c30;
    --accent: #b48bd4; --accent-fg: #14161a; --focus: #4493f8;
    --ok-bg: #12301b; --ok: #3fb950; --warn-bg: #3a1a1d; --warn: #f85149; --pend-bg: #33290f; --pend: #d29922;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.4 -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--fg); background: var(--bg); }
main { display: flex; flex-direction: column; height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.sm { font-family: "SlideMarks Preview"; font-variant-ligatures: none; line-height: 1; }

.top { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); }
.search { flex: 1; }
.search input, .family select { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.family { flex: 0 0 38%; }

.results { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.shelf h2, .group h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.grid, .shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); gap: 4px; }
.cell { height: var(--cell); font-size: 26px; display: flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 1px solid transparent; }
.cell:hover { background: var(--panel); border-color: var(--line); }
.cell[aria-selected="true"] { background: var(--panel); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.empty { color: var(--muted); padding: 16px 4px; }

.preview { display: flex; gap: 10px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.preview-glyph { font-size: 52px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; flex: none; }
.preview-info { flex: 1; min-width: 0; }
.preview-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.preview-meta { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.preview-meta code { font: 11px ui-monospace, Menlo, monospace; }
.icon-btn { border: none; background: none; padding: 0 2px; font-size: 16px; color: var(--muted); }
.icon-btn[aria-pressed="true"] { color: #d4a72c; }
.opt { display: block; font-size: 12px; margin-bottom: 6px; }
.actions { display: flex; gap: 6px; }
.actions button { flex: 1; }
body[data-mode="browser"] #pv-insert { display: none; }
.paste-tip { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 7px 10px; text-align: left; font-size: 12px;
  background: var(--pend-bg); border: 1px solid var(--pend); border-left-width: 4px; border-radius: 6px; color: var(--fg); }
.paste-tip:hover { filter: brightness(1.05); }
.paste-tip-fix { color: var(--accent); font-weight: 600; text-decoration: underline; }
/* Drawn like the missing-glyph box people actually see after a bad paste. */
.tofu { display: inline-flex; align-items: center; justify-content: center; width: 1.05em; height: 1.35em; border: 1.5px solid currentColor;
  border-radius: 2px; font: 700 .8em/1 ui-monospace, Menlo, monospace; flex: none; }
.paste-tip > .tofu { font-size: 16px; }
.paste-help { position: fixed; inset: auto 8px 8px 8px; max-height: calc(100% - 16px); overflow-y: auto; background: var(--bg); border: 2px solid var(--accent);
  border-radius: 10px; padding: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); z-index: 10; }
.paste-help h2 { font-size: 15px; margin: 0 0 6px; }
.paste-help ol { margin: 0 0 8px; padding-left: 20px; }
.paste-help img { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 8px; border: 1px solid var(--line); margin: 4px 0 8px; }
body[data-mode="office"] .paste-tip, body[data-mode="office"] .paste-help { display: none; } /* in Office, Insert sets the font itself */

.toast { position: fixed; left: 8px; right: 8px; bottom: 8px; padding: 8px 10px; border-radius: 6px; background: var(--fg); color: var(--bg); opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.toast.hint { background: var(--pend-bg); color: var(--fg); border: 1px solid var(--pend); } /* a next step, not a failure */
.toast.error { background: var(--warn); color: #fff; }

/* Setup checklist */
.setup { padding: 8px; border-bottom: 1px solid var(--line); }
.status-line { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 2px 0; }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.pending, .dot.unknown { background: var(--pend); }
.check-item { border-radius: 8px; padding: 10px; margin: 6px 0; }
.check-item.ok { background: var(--ok-bg); } .check-item.warn { background: var(--warn-bg); } .check-item.pending, .check-item.unknown { background: var(--pend-bg); }
.check-item h3 { margin: 0 0 2px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.check-item p { margin: 4px 0; }
.badge { width: 20px; height: 20px; border-radius: 10px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.badge.ok { background: var(--ok); } .badge.warn { background: var(--warn); } .badge.pending, .badge.unknown { background: var(--pend); }
.row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Step-by-step walkthrough */
.walk { margin-top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.walk .step-count { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.walk .step-text { margin: 4px 0 8px; }
.walk .nav { display: flex; justify-content: space-between; margin-top: 8px; }

/* Mock-ups of Office UI, drawn in HTML so they can show the user's own file name */
.mock { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px; font-size: 12px; }
.mock .title { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.mock .lights { display: inline-flex; gap: 4px; } .mock .lights i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); display: inline-block; }
.mock .menu { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); width: 70%; }
.mock .menu div { padding: 3px 8px; } .mock .menu .sep { border-top: 1px solid var(--line); padding: 0; margin: 2px 0; }
.mock .icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.mock .icons div { padding: 6px 2px; border-radius: 6px; }
.mock .group-label { font-weight: 600; margin: 4px 0; }
.mock .field { display: flex; justify-content: space-between; gap: 6px; align-items: center; margin: 4px 0; }
.mock .select { border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; background: var(--bg); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock .tick::before { content: "☑ "; } .mock .untick::before { content: "☐ "; } .mock i { color: var(--muted); } .mock .radio::before { content: "◉ "; } .mock .radio.off::before { content: "○ "; }
.mock .hl { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 14%, transparent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .mock .hl { animation: none; } }
.kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font: 11px ui-monospace, Menlo, monospace; }

/* Real screenshots with a highlight box over the control to click */
.shot { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; }
.shot-hl { position: absolute; border: 3px solid #f0b400; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); animation: shot-pulse 1.6s ease-in-out infinite; }
.shot-hl.multi { box-shadow: none; } /* several boxes on one shot: no dimming, which would darken the other boxes */
@keyframes shot-pulse { 50% { border-color: rgba(240, 180, 0, .25); } }
@media (prefers-reduced-motion: reduce) { .shot-hl { animation: none; } }
