/* ============================================================
   Mensis — midnight scriptorium theme
   ============================================================ */

:root {
  /* surfaces */
  --bg-void:    #090b12;
  --bg-deep:    #0c0f1a;
  --bg-panel:   #11151f;
  --bg-raise:   #161b28;
  --bg-editor:  #0d111c;
  --bg-inset:   #0a0d16;

  /* hairlines */
  --line:       rgba(168, 184, 230, 0.10);
  --line-soft:  rgba(168, 184, 230, 0.06);
  --line-strong:rgba(168, 184, 230, 0.18);

  /* ink (text) */
  --ink:        #e7e4d8;   /* warm ivory  */
  --ink-dim:    #a6acbd;
  --ink-faint:  #6b7488;
  --ink-ghost:  #49506180;

  /* the blue moon + warm counterlight */
  --moon:       #9fb6ff;   /* luminous periwinkle */
  --moon-soft:  #7e95e0;
  --moon-glow:  rgba(159, 182, 255, 0.30);
  --amber:      #e6b667;   /* candle / ink-pot warmth */
  --amber-soft: #c8964a;
  --good:       #8fcf9b;
  --warn:       #e6c168;
  --bad:        #f08a8a;

  /* syntax */
  --syn-comment:#5a6478;
  --syn-todo:   #e6b667;
  --syn-knot:   #9fb6ff;
  --syn-stitch: #7fa0d8;
  --syn-choice: #e6b667;
  --syn-gather: #b6a3e8;
  --syn-divert: #74cdbd;
  --syn-logic:  #e88bb0;
  --syn-keyword:#b6a3e8;
  --syn-tag:    #8fbf86;
  --syn-string: #d8c79a;
  --syn-number: #e0a26a;
  --syn-brace:  #74cdbd;
  --syn-bracket:#c89a6a;
  --syn-glue:   #f08a8a;
  --syn-var:    #cdd6f4;
  --syn-op:     #92a0bf;
  --syn-builtin:#e88bb0;
  --syn-atom:   #74cdbd;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui:      "Spectral", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;

  --radius: 9px;
  --radius-sm: 6px;
  --topbar-h: 54px;
  --status-h: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; }
::selection { background: rgba(159, 182, 255, 0.28); }

/* faint starfield / grain backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 18% 24%, rgba(207,214,244,.35), transparent),
    radial-gradient(1px 1px at 72% 12%, rgba(207,214,244,.25), transparent),
    radial-gradient(1px 1px at 44% 68%, rgba(207,214,244,.20), transparent),
    radial-gradient(1px 1px at 88% 52%, rgba(207,214,244,.22), transparent),
    radial-gradient(1px 1px at 28% 86%, rgba(207,214,244,.18), transparent),
    radial-gradient(900px 600px at 85% -10%, rgba(159,182,255,.06), transparent 70%);
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-deep));
  border-bottom: 1px solid var(--line);
}

/* brand */
.brand { display: flex; align-items: center; gap: 11px; user-select: none; }
.brand .moon {
  width: 26px; height: 26px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, #fdfbf2, #cdd6f4 42%, #7e95e0 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 0 16px var(--moon-glow),
              inset -6px -5px 9px rgba(40,55,110,.55);
  position: relative;
}
.brand .moon::after { /* crescent shadow for a 'blue moon' feel */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 78% 50%, transparent 52%, rgba(9,11,18,.85) 60%);
}
.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 23px;
  letter-spacing: .01em;
  color: var(--ink);
}
.brand .wordmark b { color: var(--moon); font-weight: 600; }
.brand .tagline {
  font-size: 11px; color: var(--ink-faint); letter-spacing: .22em;
  text-transform: uppercase; margin-top: 2px;
}

.topbar .spacer { flex: 1 1 auto; }

.filename {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-dim);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-inset);
}
.filename .dot { color: var(--amber); margin-right: 6px; }
.filename.saved .dot { color: var(--good); }

/* buttons */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--ink-dim);
  font-size: 13px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: .14s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: var(--line-strong); background: #1b2130; }
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn.primary {
  background: linear-gradient(180deg, #2a3b78, #20305f);
  border-color: #3a4d8c;
  color: #eef1ff;
  box-shadow: 0 0 14px rgba(159,182,255,.16);
}
.btn.primary:hover { background: linear-gradient(180deg, #324788, #25386f); color:#fff; }
.btn.ghost { background: transparent; border-color: transparent; padding: 7px 9px; }
.btn.ghost:hover { background: var(--bg-raise); }
.btn:disabled { opacity: .4; cursor: default; }

.btn-group { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   Workspace
   ============================================================ */
.workspace {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* ---- sidebar ---- */
.sidebar {
  width: 236px;
  flex: 0 0 auto;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width .18s ease, opacity .18s ease;
}
.sidebar.collapsed { width: 0; opacity: 0; overflow: hidden; border-right: 0; }

.side-section { display: flex; flex-direction: column; min-height: 0; }
.side-section.grow { flex: 1 1 auto; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
}
.side-head .add {
  cursor: pointer; color: var(--ink-faint); width: 18px; height: 18px;
  display: grid; place-items: center; border-radius: 4px;
}
.side-head .add:hover { color: var(--moon); background: var(--bg-raise); }

.file-list, .outline-list { overflow-y: auto; padding: 0 8px 10px; }

.file-item, .outline-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-dim);
  font-size: 13.5px; line-height: 1.3;
}
.file-item:hover, .outline-item:hover { background: var(--bg-raise); color: var(--ink); }
.file-item.active { background: linear-gradient(90deg, rgba(159,182,255,.14), rgba(159,182,255,.02)); color: var(--ink); }
.file-item .ico { color: var(--moon-soft); flex: 0 0 auto; }
.file-item .nm { font-family: var(--font-mono); font-size: 12.5px; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .x { opacity: 0; color: var(--ink-faint); padding: 0 2px; }
.file-item:hover .x { opacity: .7; }
.file-item .x:hover { color: var(--bad); opacity: 1; }
.file-item.main .nm::after { content: "main"; font-family: var(--font-ui); font-size: 9px; letter-spacing:.1em; text-transform: uppercase; color: var(--amber); margin-left: 8px; opacity:.8;}

.outline-item { font-family: var(--font-ui); }
.outline-item .kind {
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px; flex: 0 0 auto;
}
.outline-item .kind.knot { color: var(--syn-knot); background: rgba(159,182,255,.12); }
.outline-item .kind.stitch { color: var(--syn-stitch); background: rgba(127,160,216,.12); }
.outline-item .kind.fn { color: var(--syn-logic); background: rgba(232,139,176,.12); }
.outline-item .lbl { font-family: var(--font-mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-item.indent { padding-left: 22px; }
.outline-empty { padding: 10px 14px; color: var(--ink-faint); font-size: 12.5px; font-style: italic; }

/* ---- editor pane ---- */
.editor-pane {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-editor);
}
.editor-host { flex: 1 1 auto; min-height: 0; position: relative; }
.CodeMirror { height: 100% !important; }

/* ---- splitter ---- */
.splitter {
  flex: 0 0 auto;
  width: 6px;
  cursor: col-resize;
  background: var(--bg-void);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
}
.splitter::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 2px; height: 34px; border-radius: 2px;
  background: var(--line-strong);
}
.splitter:hover::after { background: var(--moon-soft); }

/* ---- player pane ---- */
.player-pane {
  width: 460px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  min-width: 280px;
}
.tabs {
  display: flex; gap: 2px; padding: 8px 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-deep);
}
.tab {
  padding: 8px 14px; cursor: pointer; font-size: 12.5px;
  color: var(--ink-faint); border-radius: 7px 7px 0 0;
  border: 1px solid transparent; border-bottom: none;
  display: flex; align-items: center; gap: 7px;
  letter-spacing: .02em;
}
.tab:hover { color: var(--ink-dim); }
.tab.active { color: var(--ink); background: var(--bg-panel); border-color: var(--line); }
.tab .count {
  font-family: var(--font-mono); font-size: 10px; min-width: 16px; text-align:center;
  padding: 1px 5px; border-radius: 999px; background: var(--bg-raise); color: var(--ink-faint);
}
.tab .count.bad { background: rgba(240,138,138,.18); color: var(--bad); }
.tab .count.warn { background: rgba(230,193,104,.16); color: var(--warn); }

.tab-body { flex: 1 1 auto; min-height: 0; position: relative; }
.panel {
  position: absolute; inset: 0; overflow-y: auto;
  display: none; flex-direction: column;
}
.panel.active { display: flex; }

/* player toolbar */
.player-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.player-toolbar .turn {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
}

/* the story stage */
.stage {
  flex: 1 1 auto;
  padding: 22px 26px 30px;
  font-family: var(--font-ui);
  font-size: 16.5px;
  line-height: 1.62;
  overflow-y: auto;
}
.stage .para {
  margin: 0 0 0.85em;
  color: var(--ink);
  animation: rise .35s ease both;
}
.stage .para.dim { color: var(--ink-dim); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tagline-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.chip {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--syn-tag); background: rgba(143,191,134,.10);
  border: 1px solid rgba(143,191,134,.18);
  padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
}

.choices { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.choice {
  text-align: left;
  font-family: var(--font-ui);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-left: 2px solid var(--moon-soft);
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .14s ease;
  display: flex; gap: 11px; align-items: baseline;
  animation: rise .35s ease both;
}
.choice:hover { background: #1d2434; border-color: var(--moon-soft); transform: translateX(2px); }
.choice .num {
  font-family: var(--font-mono); font-size: 11px; color: var(--moon);
  flex: 0 0 auto; opacity: .8;
}
.story-end {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line);
  color: var(--ink-faint); font-style: italic; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}

.empty-state {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; color: var(--ink-faint);
  gap: 14px; padding: 30px;
}
.empty-state .moon-lg {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #fdfbf2, #cdd6f4 42%, #6b82d0 100%);
  box-shadow: 0 0 28px var(--moon-glow), inset -10px -8px 14px rgba(40,55,110,.55);
  opacity: .7;
}
.empty-state h3 { font-family: var(--font-display); font-weight: 500; color: var(--ink-dim); margin: 0; font-size: 19px; }
.empty-state p { margin: 0; max-width: 280px; line-height: 1.55; font-size: 14px; }
.empty-state kbd {
  font-family: var(--font-mono); font-size: 11px; background: var(--bg-raise);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; color: var(--ink-dim);
}

/* problems panel */
.problem {
  display: flex; gap: 11px; padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--line-soft); align-items: flex-start;
}
.problem:hover { background: var(--bg-raise); }
.problem .sev { flex: 0 0 auto; margin-top: 1px; }
.problem.error .sev { color: var(--bad); }
.problem.warning .sev { color: var(--warn); }
.problem.todo .sev { color: var(--amber); }
.problem .msg { font-size: 13.5px; line-height: 1.45; color: var(--ink-dim); }
.problem .loc { font-family: var(--font-mono); font-size: 11px; color: var(--moon-soft); }
.problems-clean {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--good); gap: 10px; opacity: .85;
}
.problems-clean svg { width: 28px; height: 28px; }

/* ============================================================
   Status bar
   ============================================================ */
.statusbar {
  height: var(--status-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.statusbar .stat { display: flex; align-items: center; gap: 6px; }
.statusbar .dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px var(--good); }
.statusbar .dot-bad { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.statusbar .dot-busy { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.statusbar .spacer { flex: 1 1 auto; }
.statusbar a { color: var(--ink-faint); text-decoration: none; }
.statusbar a:hover { color: var(--moon); }

/* ============================================================
   Menus & modals
   ============================================================ */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-raise); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px; min-width: 210px;
  box-shadow: 0 18px 44px rgba(0,0,0,.55); z-index: 50;
  display: none;
}
.menu.open { display: block; animation: rise .14s ease both; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-dim); font-size: 13.5px;
}
.menu-item:hover { background: #20283a; color: var(--ink); }
.menu-item svg { width: 15px; height: 15px; color: var(--ink-faint); }
.menu-item:hover svg { color: var(--moon); }
.menu-item .kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-label { padding: 7px 11px 4px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }

.overlay {
  position: fixed; inset: 0; background: rgba(5,7,12,.66);
  backdrop-filter: blur(3px); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.overlay.open { display: flex; animation: rise .16s ease both; }
.modal {
  background: var(--bg-panel); border: 1px solid var(--line-strong);
  border-radius: 14px; width: min(760px, 100%); max-height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-family: var(--font-display); font-weight: 500; margin: 0; font-size: 21px; }
.modal-head .close { margin-left: auto; cursor: pointer; color: var(--ink-faint); padding: 4px; border-radius: 6px; }
.modal-head .close:hover { color: var(--ink); background: var(--bg-raise); }
.modal-body { padding: 20px 22px; overflow-y: auto; }

/* reference cheatsheet */
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.ref-block h4 {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--moon); margin: 0 0 9px; letter-spacing: .02em;
}
.ref-row { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 12px; margin-bottom: 7px; align-items: baseline; }
.ref-row code {
  font-family: var(--font-mono); font-size: 12px; color: var(--syn-divert);
  background: var(--bg-inset); border: 1px solid var(--line-soft);
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.ref-row span { font-size: 13px; color: var(--ink-dim); line-height: 1.4; }
.ref-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-faint); }
.ref-foot a { color: var(--moon-soft); }
.ref-credits { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-faint); }
.ref-credits h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--moon-soft); font-weight: 600; }
.ref-credits p { margin: 0 0 8px; line-height: 1.55; }
.ref-credits p:last-child { margin-bottom: 0; }
.ref-credits a { color: var(--moon-soft); }
.ref-credits a:hover { text-decoration: underline; }

.examples-list { display: flex; flex-direction: column; gap: 8px; }
.example-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  background: var(--bg-deep); transition: .14s ease;
}
.example-row:hover { border-color: var(--moon-soft); background: var(--bg-raise); }
.example-row .ico { color: var(--moon-soft); }
.example-row .meta b { font-family: var(--font-ui); font-weight: 600; display: block; color: var(--ink); font-size: 14.5px; }
.example-row .meta small { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

/* small inputs (rename/new file prompt is native; toast for feedback) */
.toast {
  position: fixed; bottom: 42px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-raise); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; z-index: 200;
  opacity: 0; pointer-events: none; transition: .25s ease; box-shadow: 0 12px 30px rgba(0,0,0,.5);
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(240,138,138,.5); }
.toast .ico { color: var(--moon); }
.toast.err .ico { color: var(--bad); }

/* scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #232b3d; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #2e3850; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   CodeMirror — "mensis" theme for the ink mode
   ============================================================ */
.cm-s-mensis.CodeMirror {
  background: var(--bg-editor);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.62;
}
.cm-s-mensis .CodeMirror-gutters {
  background: var(--bg-editor);
  border-right: 1px solid var(--line-soft);
}
.cm-s-mensis .CodeMirror-linenumber { color: #3a4358; font-size: 11.5px; }
.cm-s-mensis .CodeMirror-cursor { border-left: 2px solid var(--moon); }
.cm-s-mensis .CodeMirror-selected { background: rgba(159,182,255,.16) !important; }
.cm-s-mensis .CodeMirror-activeline-background { background: rgba(159,182,255,.045); }
.cm-s-mensis .CodeMirror-activeline-gutter .CodeMirror-linenumber { color: var(--moon-soft); }
.cm-s-mensis .CodeMirror-matchingbracket { color: var(--moon) !important; border-bottom: 1px solid var(--moon); }
.cm-s-mensis .CodeMirror-gutter-elt .err-marker { color: var(--bad); cursor: pointer; }

.cm-s-mensis .cm-comment   { color: var(--syn-comment); font-style: italic; }
.cm-s-mensis .cm-ink-todo  { color: var(--syn-todo); font-weight: 600; }
.cm-s-mensis .cm-ink-knot  { color: var(--syn-knot); font-weight: 700; }
.cm-s-mensis .cm-ink-stitch{ color: var(--syn-stitch); font-weight: 600; }
.cm-s-mensis .cm-ink-choice{ color: var(--syn-choice); font-weight: 700; }
.cm-s-mensis .cm-ink-gather{ color: var(--syn-gather); font-weight: 700; }
.cm-s-mensis .cm-ink-divert{ color: var(--syn-divert); font-weight: 600; }
.cm-s-mensis .cm-ink-logic { color: var(--syn-logic); font-weight: 700; }
.cm-s-mensis .cm-keyword   { color: var(--syn-keyword); font-weight: 600; }
.cm-s-mensis .cm-ink-tag   { color: var(--syn-tag); font-style: italic; }
.cm-s-mensis .cm-string    { color: var(--syn-string); }
.cm-s-mensis .cm-number    { color: var(--syn-number); }
.cm-s-mensis .cm-ink-brace { color: var(--syn-brace); font-weight: 600; }
.cm-s-mensis .cm-ink-bracket { color: var(--syn-bracket); }
.cm-s-mensis .cm-ink-glue  { color: var(--syn-glue); }
.cm-s-mensis .cm-variable-2{ color: var(--syn-var); }
.cm-s-mensis .cm-operator  { color: var(--syn-op); }
.cm-s-mensis .cm-builtin   { color: var(--syn-builtin); }
.cm-s-mensis .cm-atom      { color: var(--syn-atom); }

.cm-s-mensis .line-error-bg { background: rgba(240,138,138,.10); }
.cm-s-mensis .cm-flash { background: rgba(159,182,255,.16); transition: background .5s ease; }

/* dialog (search) styling */
.cm-s-mensis .CodeMirror-dialog {
  background: var(--bg-raise); color: var(--ink); border-bottom: 1px solid var(--line);
  font-family: var(--font-ui); font-size: 13px;
}
.cm-s-mensis .CodeMirror-dialog input { font-family: var(--font-mono); color: var(--ink); background: var(--bg-inset); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }

/* responsive */
@media (max-width: 900px) {
  .player-pane { width: 360px; }
  .brand .tagline { display: none; }
}
@media (max-width: 720px) {
  .sidebar { position: absolute; z-index: 40; height: calc(100% - var(--topbar-h) - var(--status-h)); box-shadow: 12px 0 30px rgba(0,0,0,.5); }
}
