/* BrontoPDF web: same dark palette as the apps (shared/theme.json). */
:root {
  --bg: #1b1b1f;
  --panel: #222228;
  --panel2: #26262c;
  --bar: #111114;
  --border: #44444f;
  --border-soft: #34343c;
  --text: #ffffff;
  --muted: #8c8c96;
  --faint: #5c5c66;
  --blue: #2f6fdb;
  --btn: #2e2e36;
  --btn-hover: #3c3c47;
  --active: #ffbe3f;
  --active-text: #111114;
  --keycap: #1b1b1f;
  --drop: #6495ed;
  --selection: #2b3e5f;
  --timer-idle: #9a9aa4;
  --end-label: #6c6c76;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
}
[hidden] { display: none !important; }
button {
  font: inherit;
  color: var(--text);
  background: var(--btn);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
button:hover { background: var(--btn-hover); }
button:disabled { opacity: .35; cursor: default; }
button:disabled:hover { background: var(--btn); }
button:focus-visible { outline: 2px solid var(--drop); outline-offset: 2px; }
button.primary { background: var(--blue); border-color: var(--blue); }
button.primary:hover { background: #3b7cea; }
button.big { font-size: 16px; padding: 10px 22px; }
input[type=text] {
  font: inherit;
  color: var(--text);
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.caption { color: var(--muted); margin-bottom: 6px; display: block; }

/* ------------------------------------------------------------ slide view */
.slide-view {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.slide-host {
  position: absolute;
  background: #fff;
  visibility: hidden;
}
.slide-host.shadow { box-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.slide-host canvas { display: block; width: 100%; height: 100%; }
.slide-dot {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 30, 30, .9);
  box-shadow: 0 0 16px 4px rgba(255, 0, 0, .75);
  pointer-events: none;
  display: none;
}

/* ------------------------------------------------------------ presentation */
body.pres-body { background: #000; overflow: hidden; cursor: default; }
.pres { position: fixed; inset: 0; background: #000; }
.pres .black { position: absolute; inset: 0; background: #000; display: none; }
.pres.is-black .black { display: block; }
.pres.fullscreen { cursor: none; }
.pres-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 18px;
  background: rgba(30, 30, 36, .94);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  max-width: calc(100% - 32px);
  cursor: default;
}
.pres.fullscreen .pres-hint { display: none; }

/* ------------------------------------------------------------ console (shared/SPEC.md §3)
   Positions and sizes of the slides, timer and strip are set by ConsoleView.layout(). */
body.console-body { overflow: hidden; }
.console { position: fixed; inset: 0; display: flex; flex-direction: column; }
.console-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #3a3010;
  color: #ffe9a8;
  font-size: 14px;
}
.console-tip span { flex: 1; }
.console-tip button { padding: 2px 10px; }
.console-main { flex: 1; min-height: 0; position: relative; }
.console-main > .caption { position: absolute; top: 15px; margin: 0; font-size: 14px; white-space: nowrap; }
.cap-current { left: 24px; }
.exit-button { position: absolute; top: 10px; right: 24px; font-size: 14px; padding: 4px 14px; }
.box { position: absolute; }
.end-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--end-label);
  font-size: 22px;
}
.timer-block { position: absolute; text-align: right; }
.timer { font-weight: 700; font-size: 84px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer.idle { color: var(--timer-idle); }
.timer-sub { color: var(--muted); font-size: 14px; margin-top: -4px; }

/* strip of thumbnails: current framed in amber, past ones dimmed, number in the corner */
.strip {
  position: absolute;
  display: flex;
  gap: 13px;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip-item { position: relative; flex: none; height: 90px; cursor: pointer; }
.strip-item .page { width: 100%; height: 100%; background: #fff; }
.strip-item canvas { display: block; width: 100%; height: 100%; }
.strip-item.past .page { opacity: .4; }
.strip-item:hover { outline: 2px solid var(--border); }
.strip-item.current { outline: 3px solid var(--active); }
.strip-item .num {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(17, 17, 20, .9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.strip-item.current .num { background: var(--active); color: var(--active-text); }

/* bottom bar: key buttons (lit while their mode is on), navigation */
.console-bar {
  flex: none;
  height: 140px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: var(--bar);
}
.keys { display: flex; gap: 10px; min-width: 0; }
.keys.right { justify-content: flex-end; }
.key {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 1 159px;
  min-width: max-content;
  height: 48px;
  padding: 0 14px 0 12px;
  font-size: 15px;
  text-align: left;
}
.key kbd {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--keycap);
  color: #fff;
  font: 700 13px system-ui, sans-serif;
}
.key.lit { background: var(--active); border-color: var(--active); color: var(--active-text); font-weight: 700; }
.key.lit:hover { background: #f2b232; }
.key.lit kbd { border-color: var(--keycap); }
.nav { display: flex; align-items: center; gap: 14px; }
.nav button { font-size: 28px; width: 81px; height: 61px; padding: 0; }
.counter { font-size: 40px; font-weight: 600; min-width: 110px; text-align: center; }

/* ------------------------------------------------------------ empty console (shared/SPEC.md §2) */
.console.is-empty .console-main > .caption,
.console.is-empty .exit-button,
.console.is-empty .box,
.console.is-empty .timer-block,
.console.is-empty .strip { display: none; }
.console:not(.is-empty) .empty,
.console:not(.is-empty) .web-info { display: none; }
.empty {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: var(--panel);
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.empty.over { background: var(--panel2); border: 2px solid var(--drop); }
.empty-center { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 20px 24px; }
.empty-icon { color: var(--muted); margin-bottom: 14px; line-height: 0; }
.empty-hint { font-size: 22px; text-align: center; }
.ready { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; cursor: default; }
.ready-name { font-size: 22px; font-weight: 600; text-align: center; word-break: break-word; }
.ready .primary { margin-top: 10px; }
.ready:not([hidden]) + .empty-hint { font-size: 15px; color: var(--muted); }
.recent { width: min(420px, 100%); margin-top: 28px; cursor: default; }
.recent .caption { padding-left: 10px; font-size: 13px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.recent-list li { display: flex; align-items: center; gap: 10px; }
.recent-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 10px;
  background: none;
  border: none;
  text-align: left;
}
.recent-open:hover { background: var(--selection); }
.recent-open .name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.recent-open .when { color: var(--muted); font-size: 12px; }
.recent-remove {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--muted);
  font-size: 14px;
}
.recent-remove:hover { background: var(--btn-hover); color: var(--text); }
.web-info { position: absolute; }
.web-info p { margin: 18px 0 0; }
.screens-status { margin-bottom: 8px; }
.screens-status .ok { color: #6fd08a; }
.screens-status .warn { color: #ffb030; }

/* ------------------------------------------------------------ overlays */
.overview {
  position: absolute;
  inset: 12px 16px;
  background: rgba(20, 20, 23, .96);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
.overview-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}
.thumb { width: 232px; padding: 6px; border-radius: 4px; cursor: pointer; text-align: center; }
.thumb .thumb-page { background: #fff; display: flex; align-items: center; justify-content: center; }
.thumb canvas { display: block; max-width: 100%; max-height: 100%; }
.thumb .thumb-label { margin-top: 4px; }
.thumb:hover { background: #2a2a32; }
.thumb.sel { background: var(--blue); }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.dark { background: rgba(0, 0, 0, .88); }
.modal-box { background: var(--panel2); border-radius: 8px; padding: 24px 28px; max-width: 100%; max-height: 100%; overflow: auto; }
.modal-box h2 { margin: 0 0 14px; font-size: 24px; font-weight: 600; }
.goto-box { min-width: 320px; }
.goto-box input { font-size: 28px; width: 100%; padding: 6px; background: var(--bg); }
.help-text { font: 16px/24px Consolas, "SF Mono", Menlo, monospace; white-space: pre; margin: 0; }
