/* app.css — the editor chrome. The poster itself is drawn as SVG and takes
   none of its styling from here. */

:root {
  --bg: #171a1f;
  --bg-2: #1e2229;
  --bg-3: #262b33;
  --line: #333a45;
  --line-soft: #2b313a;
  --ink: #e7ecf3;
  --ink-2: #a3aebd;
  --ink-3: #717d8c;
  --accent: #4d95ea;
  --accent-ink: #ffffff;
  --warn: #e0a33a;
  --danger: #e0614f;
  --ok: #4bbf87;
  --radius: 7px;
  --topbar-h: 46px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%; margin: 0;
  background: var(--bg); color: var(--ink);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: var(--accent); }

/* ------------------------------------------------------------- boot ---- */

#boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #202631, var(--bg));
}
#boot.is-gone { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.boot-card { text-align: center; max-width: 340px; padding: 24px; }
.boot-mark { margin-bottom: 14px; }
.boot-card h1 { font-size: 20px; letter-spacing: -.01em; margin-bottom: 6px; }
#boot-status { color: var(--ink-2); margin: 0 0 16px; min-height: 2.6em; }
.boot-bar { height: 3px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }
.boot-note { color: var(--ink-3); font-size: 11.5px; margin: 14px 0 0; }
.boot-error { color: var(--danger); }

/* ----------------------------------------------------------- layout ---- */

#app { height: 100%; display: flex; flex-direction: column; }

main {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr) 400px;
}

.panel {
  background: var(--bg-2);
  display: flex; flex-direction: column; min-height: 0;
}
#left { border-right: 1px solid var(--line); }
#right { border-left: 1px solid var(--line); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ----------------------------------------------------------- topbar ---- */

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -.01em; padding-right: 8px; }
.tb-group { display: flex; gap: 4px; align-items: center; padding: 0 6px; border-left: 1px solid var(--line-soft); }
.tb-group:first-of-type { border-left: 0; }
.tb-spacer { flex: 1; }

.tb {
  background: var(--bg-3); border: 1px solid transparent; color: var(--ink);
  padding: 5px 11px; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
}
.tb:hover:not(:disabled) { background: #303743; }
.tb:disabled { opacity: .4; cursor: default; }
.tb.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tb.primary:hover { background: #5da2f2; }
#save-state { color: var(--ink-3); font-size: 11.5px; border: 0; }
#save-label.is-dirty { color: var(--warn); }

/* ------------------------------------------------------------- tabs ---- */

.tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tab {
  flex: 1; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-2); padding: 10px 2px; cursor: pointer; font-size: 11.5px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tabpane { display: none; padding: 14px; }
.tabpane.is-active { display: block; }

/* ------------------------------------------------------------ forms ---- */

.field { margin-bottom: 12px; }
.field > label, .field-label {
  display: block; margin-bottom: 5px;
  color: var(--ink-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
}
.hint { color: var(--ink-3); font-size: 11.5px; margin: 5px 0 0; }

input[type=text], input[type=number], input[type=email], textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 9px; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
input[type=color] {
  width: 34px; height: 30px; padding: 2px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
input[type=range] { width: 100%; accent-color: var(--accent); }
select { cursor: pointer; }

.row { display: flex; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.check { display: flex; align-items: center; gap: 7px; cursor: pointer; margin-bottom: 7px; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; }

.btn {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--ink);
  padding: 6px 11px; border-radius: var(--radius); cursor: pointer;
}
.btn:hover { background: #303743; }
.btn.wide { width: 100%; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.subtle { background: none; border-color: var(--line-soft); color: var(--ink-2); }
.btn.danger:hover { background: #4a2723; border-color: #6b3730; color: #ffb4a8; }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 9px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.section-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.section-head h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }

/* ---------------------------------------------------------- authors ---- */

.author {
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 9px; margin-bottom: 8px;
}
.author.is-presenting { border-color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.author-top { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
.author-drag { cursor: grab; color: var(--ink-3); padding: 0 3px; user-select: none; }
.author-affils { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 20px; padding: 2px 9px; font-size: 11.5px; cursor: pointer; user-select: none;
}
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.present { background: none; border-style: dashed; }
.chip.present.is-on { background: #2f6a4a; border-color: #3d8a60; border-style: solid; color: #fff; }
.affil-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.affil-num {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-3); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11px;
}

/* --------------------------------------------------------- sections ---- */

.seclist { display: flex; flex-direction: column; gap: 5px; }
.secitem {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 8px 9px; cursor: pointer;
}
.secitem:hover { border-color: var(--line); }
.secitem.is-selected { border-color: var(--accent); background: #1b2530; }
.secitem.is-dragging { opacity: .4; }
.secitem.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.secitem.drop-after { box-shadow: 0 2px 0 var(--accent); }
.secitem .grip { color: var(--ink-3); cursor: grab; user-select: none; }
.secitem .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secitem .meta { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.secitem .kind { font-size: 11px; color: var(--ink-3); }
.col-badge {
  flex: none; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 4px;
  background: var(--bg-3); color: var(--ink-2);
  display: grid; place-items: center; font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.secitem.is-free .col-badge { background: #3a3050; color: #c9b4f0; }

/* ---------------------------------------------------------- figures ---- */

.figgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.figcard {
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
}
.figcard:hover { border-color: var(--accent); }
.figcard .thumb {
  height: 88px; display: grid; place-items: center;
  background: repeating-conic-gradient(#20242b 0% 25%, #262b33 0% 50%) 50% / 14px 14px;
}
.figcard .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.figcard .cap { padding: 6px 7px; font-size: 11px; }
.figcard .cap b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.figcard .cap span { color: var(--ink-3); }
.badge {
  display: inline-block; padding: 0 5px; border-radius: 3px;
  font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
}
.badge.vec { background: #234a34; color: #7fe0ac; }
.badge.ras { background: #4a3d23; color: #e6c67f; }

.dropbox {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 20px 14px; text-align: center; color: var(--ink-2); cursor: pointer;
}
.dropbox:hover, .dropbox.is-over { border-color: var(--accent); color: var(--ink); background: #1b222c; }
.dropbox b { display: block; margin-bottom: 3px; }
.dropbox small { color: var(--ink-3); }

/* ----------------------------------------------------------- canvas ---- */

#stagewrap {
  position: relative; min-width: 0; overflow: hidden;
  background: radial-gradient(900px 500px at 50% 0%, #1c2129, #14171c);
  cursor: default;
}
#stagewrap.is-panning { cursor: grabbing; }
#stagewrap.is-space { cursor: grab; }

/* Anchored at the wrapper's top-left: pan/zoom maths assumes that origin. */
#stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
#poster {
  display: block;
  background: #fff;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .07);
}
#overlay { position: absolute; inset: 0; overflow: visible; }

.canvasbar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  background: rgba(26, 30, 37, .92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 9px; padding: 4px 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.cb {
  background: none; border: 0; color: var(--ink-2); cursor: pointer;
  padding: 3px 8px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.cb:hover { background: var(--bg-3); color: var(--ink); }
.cb-sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.cb-check { display: flex; align-items: center; gap: 5px; color: var(--ink-2); cursor: pointer; padding: 0 5px; }
.cb-check input { accent-color: var(--accent); }
.cb-info { color: var(--ink-3); padding: 0 6px; font-variant-numeric: tabular-nums; }

#dropzone {
  position: absolute; inset: 0; z-index: 5; display: none;
  place-items: center; background: rgba(20, 24, 30, .82);
  border: 2px dashed var(--accent); pointer-events: none;
}
#dropzone.is-active { display: grid; }
#dropzone div { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600; }

.warnings {
  position: absolute; left: 12px; bottom: 12px; max-width: 380px;
  background: rgba(46, 36, 20, .95); border: 1px solid #5f4a22; color: #f0d5a4;
  border-radius: 8px; padding: 9px 11px; font-size: 11.5px;
}
.warnings ul { margin: 0; padding-left: 15px; }
.warnings li + li { margin-top: 4px; }
.warnings b { display: block; margin-bottom: 4px; color: #ffd98a; }

/* overlay decorations */
.ov-sel { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov-hover { fill: none; stroke: rgba(77, 149, 234, .45); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ov-hit { fill: transparent; cursor: pointer; }
.ov-hit.is-free { cursor: move; }
.ov-guide { stroke: rgba(77, 149, 234, .5); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 7 7; }
.ov-margin { fill: none; stroke: rgba(77, 149, 234, .55); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 9 7; }
.ov-overflow { fill: rgba(224, 97, 79, .13); stroke: rgba(224, 97, 79, .6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ov-handle { fill: #fff; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ov-drop { fill: var(--accent); opacity: .8; }
.ov-dropcol { fill: rgba(77, 149, 234, .1); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
.ov-label { fill: #fff; font: 600 11px var(--font); paint-order: stroke; stroke: rgba(20,24,30,.8); stroke-width: 3px; }

/* ----------------------------------------------------- bibliography ---- */

.citechip {
  display: inline-block; background: #2b2a3d; border: 1px solid #443f5e;
  border-radius: 4px; padding: 0 .3em; font-size: .9em; color: #c3b7f0;
  cursor: pointer; user-select: none;
}
.citechip:hover { border-color: #6d5fb0; }
.citechip.is-missing { border-color: var(--danger); color: #ffb4a8; }

.biblist { display: flex; flex-direction: column; gap: 4px; }
.bibitem {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 7px 8px; cursor: pointer;
}
.bibitem:hover { border-color: var(--accent); }
.bibitem.is-cited { border-left: 2px solid var(--accent); }
.bibnum {
  flex: none; min-width: 18px; height: 18px; border-radius: 4px;
  background: var(--bg-3); color: var(--ink-3);
  display: grid; place-items: center; font-size: 10.5px; font-variant-numeric: tabular-nums;
}
.bibitem.is-cited .bibnum { background: var(--accent); color: #fff; }
.bibmeta { min-width: 0; font-size: 11.5px; line-height: 1.35; }
.bibmeta b { display: block; color: var(--ink); font-weight: 600; }
.bibmeta span {
  display: block; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bibmeta code { color: var(--ink-3); font: 10.5px var(--mono); }

.warnbox {
  background: #38301d; border: 1px solid #5f4a22; color: #f0d5a4;
  border-radius: var(--radius); padding: 7px 9px; font-size: 11.5px; margin-bottom: 8px;
}
.warnbox b { color: #ffd98a; }

/* -------------------------------------------------------- inspector ---- */

.insp-empty { padding: 40px 22px; text-align: center; color: var(--ink-3); }
.insp-empty svg { margin-bottom: 12px; opacity: .5; }
.insp-head {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}
.insp-body { padding: 14px; }
.insp-title { display: flex; gap: 7px; align-items: center; margin-bottom: 9px; }
.insp-title input { font-weight: 600; }

.modeswitch { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.modeswitch button {
  flex: 1; background: none; border: 0; color: var(--ink-2);
  padding: 5px; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.modeswitch button.is-active { background: var(--bg-3); color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 7px; }
.toolbar button {
  background: var(--bg-3); border: 1px solid transparent; color: var(--ink-2);
  min-width: 27px; height: 27px; padding: 0 6px; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.toolbar button:hover { background: #343c48; color: var(--ink); }
.toolbar .tb-sep { width: 1px; background: var(--line); margin: 3px 3px; }

/* Simple (WYSIWYG) editor surface */
.rich {
  min-height: 240px; max-height: 46vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px; line-height: 1.55;
}
.rich:focus { outline: none; border-color: var(--accent); }
.rich > *:first-child { margin-top: 0; }
.rich > *:last-child { margin-bottom: 0; }
.rich p { margin: 0 0 .65em; }
.rich h3, .rich h4, .rich h5 { margin: 1em 0 .35em; font-size: 1.02em; color: #cddcf0; }
.rich ul, .rich ol { margin: 0 0 .65em; padding-left: 1.35em; }
.rich li { margin-bottom: .18em; }
.rich blockquote {
  margin: 0 0 .65em; padding: .4em .7em; border-left: 3px solid var(--accent);
  background: #1b222c; border-radius: 0 5px 5px 0; color: var(--ink);
}
.rich code { background: #2a3039; padding: .08em .32em; border-radius: 3px; font: .9em var(--mono); }
.rich pre { background: #14171c; padding: .6em .7em; border-radius: 5px; font: 11.5px var(--mono); overflow-x: auto; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.rich table { border-collapse: collapse; width: 100%; margin-bottom: .65em; font-size: .94em; }
.rich th, .rich td { border: 1px solid var(--line); padding: .28em .5em; text-align: left; }
.rich th { background: var(--bg-3); }
.rich sup, .rich sub { font-size: .7em; }
.rich .mfig { background: #1b222c; border: 1px dashed var(--line); border-radius: 5px; padding: .4em .6em; color: var(--ink-2); }

.mchip {
  display: inline-block; background: #26313f; border: 1px solid #37475c;
  border-radius: 4px; padding: 0 .3em; font: .92em var(--mono); color: #9dd0ff;
  cursor: pointer; user-select: none; white-space: pre-wrap;
}
.mchip:hover { border-color: var(--accent); }
.mchip.mchip-display { display: block; text-align: center; padding: .35em .5em; margin: .3em 0; }
.mchip.is-bad { border-color: var(--danger); color: #ffb4a8; }

/* Pro (source) editor */
.source {
  width: 100%; min-height: 300px; max-height: 52vh;
  font: 12.5px/1.6 var(--mono); tab-size: 2;
  background: #14171c; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.syntax-help { font-size: 11px; color: var(--ink-3); margin-top: 7px; line-height: 1.7; }
.syntax-help code { background: var(--bg-3); padding: .1em .35em; border-radius: 3px; font: 11px var(--mono); color: var(--ink-2); }

.matherr { color: #ffb4a8; font-size: 11.5px; margin-top: 6px; }

/* ---------------------------------------------------------- toasts ---- */

#toasts {
  position: fixed; bottom: 16px; right: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 9px 13px; max-width: 380px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  animation: toast-in .18s ease;
}
.toast.err { border-color: #6b3730; background: #38211d; color: #ffcfc6; }
.toast.ok { border-color: #2f6a4a; background: #1e3229; color: #b6f0d2; }
.toast.busy { border-color: var(--line); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------- modal ---- */

.modal-back {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(10, 12, 16, .7);
}
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 18px; width: min(460px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.modal h2 { font-size: 15px; margin-bottom: 8px; }
.modal p { color: var(--ink-2); margin: 0 0 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal .checkline {
  align-items: flex-start; gap: 8px; margin: -4px 0 14px;
  color: var(--ink-2); line-height: 1.45; cursor: pointer;
}
.modal .checkline input { margin-top: 2px; }

/* ------------------------------------------------------ responsive ---- */

@media (max-width: 1500px) {
  main { grid-template-columns: 300px minmax(0, 1fr) 350px; }
}
@media (max-width: 1180px) {
  main { grid-template-columns: 270px minmax(0, 1fr); }
  #right { position: fixed; right: 0; top: var(--topbar-h); bottom: 0; width: 350px; z-index: 20;
           border-left: 1px solid var(--line); box-shadow: -12px 0 34px rgba(0,0,0,.4);
           transform: translateX(100%); transition: transform .2s ease; }
  #right.is-open { transform: none; }
}

/* ------------------------------------------------------------- tour ---- */

.tour { position: fixed; inset: 0; z-index: 80; }
.tour-mask { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: auto; }
.tour-ring {
  position: absolute; border: 2px solid var(--accent); border-radius: 9px;
  box-shadow: 0 0 0 3px rgba(77, 149, 234, .22);
  pointer-events: none; transition: all .22s cubic-bezier(.4, 0, .2, 1);
}
.tour-pop {
  position: absolute; width: min(360px, calc(100vw - 24px));
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  padding: 15px 16px 13px; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  transition: left .22s cubic-bezier(.4, 0, .2, 1), top .22s cubic-bezier(.4, 0, .2, 1);
}
.tour-pop.is-moving { opacity: .55; }
.tour-step { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; }
.tour-pop h3 { font-size: 15px; margin: 5px 0 7px; letter-spacing: -.01em; }
.tour-pop p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.55; }
.tour-dots { display: flex; gap: 5px; margin-bottom: 11px; }
.tour-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--bg-3);
  cursor: pointer; transition: background .15s, transform .15s;
}
.tour-dot:hover { transform: scale(1.35); }
.tour-dot.is-done { background: #37536f; }
.tour-dot.is-on { background: var(--accent); }
.tour-actions { display: flex; gap: 7px; align-items: center; }

/* A small pointer towards the highlighted element. */
.tour-pop::after {
  content: ''; position: absolute; width: 10px; height: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  transform: rotate(45deg);
}
.tour-pop[data-arrow="none"]::after { display: none; }
.tour-pop[data-arrow="bottom"]::after { top: -6px; left: 26px; border-right: 0; border-bottom: 0; }
.tour-pop[data-arrow="top"]::after { bottom: -6px; left: 26px; border-left: 0; border-top: 0; }
.tour-pop[data-arrow="right"]::after { left: -6px; top: 22px; border-right: 0; border-top: 0; }
.tour-pop[data-arrow="left"]::after { right: -6px; top: 22px; border-left: 0; border-bottom: 0; }

/* ------------------------------------------------- help menu & privacy ---- */

.tb-icon { width: 30px; padding: 5px 0; font-weight: 700; }

.menu {
  position: fixed; z-index: 75; min-width: 232px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 5px; box-shadow: 0 16px 42px rgba(0, 0, 0, .55);
}
.menu-item {
  display: block; width: 100%; text-align: left; text-decoration: none;
  background: none; border: 0; color: var(--ink);
  padding: 7px 9px; border-radius: 6px; cursor: pointer;
}
.menu-item:hover { background: var(--bg-3); }
.menu-item b { display: block; font-weight: 500; }
.menu-item span { display: block; color: var(--ink-3); font-size: 11px; margin-top: 1px; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }

.privacy-modal { width: min(620px, 94vw); }
.privacy-body { max-height: min(52vh, 520px); overflow-y: auto; padding-right: 6px; margin-bottom: 12px; }
.privacy-body p { color: var(--ink-2); margin: 0 0 11px; line-height: 1.6; }
.privacy-body ul { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); line-height: 1.6; }
.privacy-body li { margin-bottom: 4px; }
.privacy-body b { color: var(--ink); font-weight: 600; }
.privacy-body code { background: var(--bg-3); padding: .1em .35em; border-radius: 3px; font: 11.5px var(--mono); }
.privacy-h {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin: 16px 0 7px;
}
.privacy-toggle {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px; margin-bottom: 8px; align-items: flex-start;
}
.privacy-toggle span { line-height: 1.45; }

.shortcuts { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.shortcuts td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.shortcuts td:first-child { width: 42%; }
kbd {
  background: var(--bg-3); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; font: 11.5px var(--mono); color: var(--ink);
}
