/* Perusall Page Builder — what this app adds to the styles copied from
   d2l-content (styles.css), loaded after them.

   The look is the clean card style of the Feedback Builder and the Context
   Case Study app: a pale grey page, white cards with a hairline border and a
   soft shadow, Lato, black text, and gold (with dark text) only for the main
   action. Reid chose it on 2026-11-21 over the Open Workshop look, after
   asking for "fewer all caps, more like my other tools". The colour tokens
   themselves are set by app.js (UI_THEMES.card). */

@font-face { font-family: Lato; src: url("fonts/Lato-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Lato; src: url("fonts/Lato-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Lato; src: url("fonts/Lato-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: Lato; src: url("fonts/Lato-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --ui-font: Lato, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gold: #FBAE3D; --on-gold: #1a1a2a;
  --page: #ECECED; --rule: #E4E4EA; --hover: #F4F4F6; --picked: #FFF6E3;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: dark) {
  :root { --page: #17181C; --rule: #2C2D35; --hover: #2A2B33; --picked: #3A3121; --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }
}

/* ---- the page ---- */
html, body { background: var(--page); }
body { font-size: 14px; }
#app { background: transparent; }

/* ---- toolbar: a white bar across the top ---- */
.toolbar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 16px; gap: 6px; color: var(--text); }
.toolbar__title { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--strong); letter-spacing: 0; margin-right: 12px; }
.pb-mark { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; flex: 0 0 auto; }
.pb-mark svg { width: 14px; height: 14px; fill: none; stroke: #17151f; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toolbar__sep { background: var(--border); }
.toolbar__btn { color: var(--text); font-size: 13.5px; font-weight: 700; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); padding: 5px 12px; }
.toolbar__btn:hover { background: var(--hover); color: var(--strong); border-color: var(--border); }
.toolbar__kbd { color: var(--muted); opacity: 1; font-weight: 400; }
/* The one action that matters on a screen: gold with dark text. P4's
   Download button uses it. */
.pb-primary { background: var(--gold) !important; color: var(--on-gold) !important; border-color: var(--gold) !important; }
.pb-primary:hover { filter: brightness(.96); }

/* ---- sidebar, editor and preview: three white cards on the grey page ---- */
.main { padding: 14px 14px 0; gap: 0; }
.sidebar, .pane--editor, .pane--preview {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--card-shadow);
}
.pane--editor { border-right: 1px solid var(--border); }
.pane__header {
  background: transparent; border-bottom: 1px solid var(--rule); padding: 9px 16px;
  font-size: 15px; font-weight: 700; color: var(--strong); text-transform: none; letter-spacing: 0; align-items: center;
}
.pane__header #cursor-pos { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.om-wrap, .se-wrap { background: var(--bg); }
.preview-stage { background: var(--hover); }
.preview-chip { border-radius: 8px; font-weight: 700; font-size: 13px; padding: 4px 12px; background: transparent; color: var(--muted); border-color: var(--border); }
.preview-chip.active { background: var(--strong); color: var(--bg); border-color: var(--strong); }
.resizer { background: transparent; }
.cheatsheet { border-radius: 12px; margin-left: 8px; }

.sidebar__name { font-size: 16px; color: var(--strong); }
.sidebar__glyph { color: var(--muted); }
.sidebar__glyph:hover { color: var(--strong); background: var(--hover); }
.sidebar__glyph--accent { width: 26px; height: 26px; border-radius: 8px; background: var(--gold); color: var(--on-gold); font-weight: 900; display: inline-grid; place-items: center; padding: 0; }
.sidebar__glyph--accent:hover { color: var(--on-gold); background: var(--gold); filter: brightness(.96); }
.sidebar__search { border-radius: 8px; font-size: 13.5px; }
.sidebar__search:focus { border-color: var(--gold); }
.sidebar__divider { background: var(--rule); }
.sidebar__label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.sidebar__card { border-radius: 8px; padding: 9px 11px; margin-bottom: 3px; }
.sidebar__card-title, .sidebar--collapsed .sidebar__card-title { color: var(--strong); font-size: 14px; font-weight: 700; }
.sidebar__card-meta { color: var(--muted); font-size: 12px; }
.sidebar__card:hover { background: var(--hover); }
.sidebar__card.active { background: var(--picked); border-color: transparent; box-shadow: inset 3px 0 0 var(--gold); }
.sidebar__footer { border-top: 1px solid var(--rule); }
.sidebar__footer button { font-size: 13.5px; }

.statusbar { background: transparent; border-top: none; color: var(--muted); font-size: 12.5px; padding: 6px 16px 8px; }
.diag-state { color: var(--c3); }

/* ---- sentence case in place of small spaced capitals ---- */
.insert-menu__label, .cheatsheet__label, .info-pop__label, .be-eyebrow, .be-pill, .be-callout__label, .om-fedge::after, .om-hr::after, .source-toggle {
  text-transform: none; letter-spacing: 0;
}
.insert-menu__label, .cheatsheet__label, .info-pop__label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.be-pill { font-size: 12px; }
.om-fedge::after, .om-hr::after { font-size: 12px; font-weight: 700; }
.om-hr::after { content: 'Page break'; }

/* ---- menus and dialogs: rounder, as the other tools' cards ---- */
.insert-menu, .toolbar__dropdown-menu, .palette, .form-card, .info-pop, #card-menu { border-radius: 12px; }
.form-card__done { background: var(--gold); color: var(--on-gold); border-color: var(--gold); border-radius: 8px; font-weight: 700; }

/* Perusall shows an uploaded page in an iframe inside a white div with 21px
   of padding (Findings, perusall-frames-uploaded-pages-in-white). The
   preview draws the same frame, so the page's white background meets it as
   it will in Perusall. */
.preview-page { padding: 21px; background: #fff; border-radius: 10px; box-shadow: var(--card-shadow); }
.preview-page--mobile { width: 417px; }            /* 375px of page inside the frame */

/* The picture dialog's file button sits beside the address field (P3). */
.img-dialog__pick { display: flex; gap: 8px; align-items: stretch; }
.img-dialog__pick .img-dialog__input { flex: 1; min-width: 0; }
.img-dialog__file { flex: 0 0 auto; font: inherit; font-size: 13px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--app-border); background: var(--panel); color: var(--app-text); cursor: pointer; }
.img-dialog__file:hover { border-color: var(--accent); }

/* ---- the Download menu (P4) ---- */
.pb-download { min-width: 380px; }
.pb-download .toolbar__dropdown-item { font-weight: 700; }
.pb-download .toolbar__dropdown-item small { font-weight: 400; }
.pb-size { float: right; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 12px; }
.pb-download__note { padding: 10px 14px 12px; font-size: 12.5px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--rule); }
.pb-download__note strong { color: var(--text); }

/* ---- Help (P5) ---- */
.help-dialog{position:fixed;z-index:410;left:50%;top:6vh;transform:translateX(-50%);width:min(720px,calc(100vw - 32px));max-height:88vh;display:flex;flex-direction:column}
.help-dialog[hidden]{display:none}
.help-dialog .form-card__head{display:flex;justify-content:space-between;align-items:center}
.help-dialog__title{font-size:17px;font-weight:700;margin:0;color:var(--strong)}
.help-dialog__close{font:inherit;font-size:13px;font-weight:700;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:5px 12px;cursor:pointer;min-height:30px}
.help-dialog__body{overflow-y:auto;font-size:14px;line-height:1.55;color:var(--text)}
.help-dialog__body section{margin:0 0 18px}
.help-dialog__body h3{font-size:15px;margin:0 0 6px;color:var(--strong)}
.help-dialog__body ol,.help-dialog__body ul{padding-left:20px;margin:4px 0}
.help-dialog__body li{margin:3px 0}
.help-dialog__body dt{font-weight:700;color:var(--strong);margin-top:10px}
.help-dialog__body dd{margin:2px 0 0}
.help-dialog__body code{font-family:var(--ui-mono);font-size:12.5px;background:var(--panel);border-radius:4px;padding:1px 4px}

/* ---- Hide more syntax (Reid, 2026-11-21) ----
   Off the caret line, a block's fence lines collapse to its name and a thin
   end rule, and field names show as labels (editor.js omFieldLine). The caret
   line shows the raw Markdown, so every character can still be edited. */
.om-fedge:not(.om-active) .om-tick,
.om-fm-edge:not(.om-active) .om-tick { display: none; }
.om-fedge--open:not(.om-active)::after { position: static; display: inline-block; font-size: 11px; letter-spacing: .02em; text-transform: none; padding: 6px 0 2px; }
.om-fedge:not(.om-fedge--open):not(.om-active),
.om-fm-edge:not(.om-active) { min-height: 10px; line-height: 10px; font-size: 0; }
.om-fk::before { content: attr(data-k); display: inline-block; margin-right: .55em; padding: 0 6px; border-radius: 4px;
  font-family: var(--ui-font); font-size: 11px; font-weight: 700; line-height: 1.7; vertical-align: 1px;
  color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.om-fk--opt::before { min-width: 1.4em; text-align: center; }
.om-fk--right::before { color: color-mix(in srgb, #1f7a4d 85%, var(--strong)); background: color-mix(in srgb, #1f7a4d 13%, transparent); }
.om-fk--fb::before { content: "→ " attr(data-k); margin-left: .45em; }
.om-fk--callout::before { color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.om-active .om-fk::before { display: none; }
.om-active .om-fk .om-syn { opacity: .7; }
