/* MathIDE product preview: the extension running in VS Code, Dark Modern theme.
   The product is a separate entity from the landing page, so nothing here uses the page's tokens
   (pine accent, Geist, pills, bezels). Colours come from VS Code's dark_modern.json and dark_plus.json
   and its built-in dark defaults; UI and editor fonts are VS Code's default stacks.
   Icons: Codicons subset (CC BY 4.0, icons/codicons/LICENSE.txt).
   Lean symbols missing from system mono fonts: JuliaMono subset (fonts/LeanSymbols-LICENSE.txt).
   Sizing: every length is calc(N * var(--u)), where N is the size in px in a native VS Code window
   820px wide (wide frames) or 420px wide (narrow frames), so the window scales like a screenshot.
   Under 620px the editor is hidden and the MathIDE side bar fills the window. */

@font-face { font-family: "codicon"; src: url("icons/codicons/codicon.woff2") format("woff2"); font-display: block; }
@font-face {
  font-family: "MathIDE Lean Symbols"; src: url("fonts/LeanSymbols.woff2") format("woff2");
  unicode-range: U+2115, U+211A, U+211D, U+2223, U+27E8-27E9; font-display: swap;
}

.shot-frame { container: shot / inline-size; }

.vsc {
  --u: 0.85px;
  --vsc-editor: #1f1f1f;
  --vsc-chrome: #181818;
  --vsc-border: #2b2b2b;
  --vsc-fg: #cccccc;
  --vsc-muted: #9d9d9d;
  --vsc-dim: #868686;
  --vsc-blue: #0078d4;
  --vsc-line-no: #6e7681;
  --vsc-error: #f14c4c;
  --vsc-pass: #73c991;
  --vsc-ui: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, Ubuntu, "Droid Sans", sans-serif;
  --vsc-mono: "MathIDE Lean Symbols", Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace;

  aspect-ratio: auto;
  display: flex; flex-direction: column;
  font-family: var(--vsc-ui); font-size: calc(13 * var(--u)); line-height: 1.4; letter-spacing: 0;
  color: var(--vsc-fg); text-align: left; white-space: nowrap;
  background: var(--vsc-chrome);
  box-shadow: 0 0 0 1px rgba(15, 42, 35, 0.16);
  -webkit-font-smoothing: antialiased;
}
@supports (width: 1cqi) { .vsc { --u: clamp(0.8px, 0.238cqi, 1px); } }
.vsc ul, .vsc ol { list-style: none; margin: 0; padding: 0; }
.vsc b { font-weight: 400; }

/* Codicons */
.vsc .ci {
  flex: none; display: inline-block; width: 1em; height: 1em;
  font: normal normal normal calc(16 * var(--u)) / 1 codicon;
  text-align: center; text-decoration: none; text-rendering: auto; user-select: none;
}

/* ---------- Title bar ---------- */
.vsc-title {
  position: relative; flex: none;
  display: flex; align-items: center;
  height: calc(35 * var(--u)); padding: 0 calc(10 * var(--u)) 0 calc(13 * var(--u));
  border-bottom: 1px solid var(--vsc-border);
}
.vsc-lights { display: flex; gap: calc(8 * var(--u)); }
.vsc-lights i { width: calc(12 * var(--u)); height: calc(12 * var(--u)); border-radius: 50%; background: #ff5f57; }
.vsc-lights i:nth-child(2) { background: #febc2e; }
.vsc-lights i:nth-child(3) { background: #28c840; }
.vsc-nav, .vsc-layout { display: none; gap: calc(6 * var(--u)); color: var(--vsc-fg); }
.vsc-nav .ci:last-child { color: var(--vsc-dim); }
.vsc-cc {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: calc(6 * var(--u));
  width: 46%; height: calc(22 * var(--u));
  font-size: calc(12 * var(--u)); color: var(--vsc-fg);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(204, 204, 204, 0.2); border-radius: calc(6 * var(--u));
}
.vsc-cc .ci { font-size: calc(14 * var(--u)); }

/* ---------- Activity bar, side bar, editor ---------- */
.vsc-main { flex: 1; min-height: 0; overflow: hidden; display: grid; grid-template-columns: calc(48 * var(--u)) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }

.vsc-activity { display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--vsc-border); }
.vsc-activity > .ci, .vsc-act-end .ci, .vsc-act-mathide {
  display: grid; place-items: center;
  width: calc(48 * var(--u)); height: calc(48 * var(--u));
  font-size: calc(24 * var(--u)); color: var(--vsc-dim);
}
.vsc-act-mathide { position: relative; color: #d7d7d7; box-shadow: inset calc(2 * var(--u)) 0 0 var(--vsc-blue); }
.vsc-act-mathide svg { width: calc(26 * var(--u)); height: calc(26 * var(--u)); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vsc-badge {
  position: absolute; right: calc(8 * var(--u)); bottom: calc(8 * var(--u));
  min-width: calc(16 * var(--u)); height: calc(16 * var(--u)); padding: 0 calc(4 * var(--u));
  border-radius: calc(8 * var(--u));
  font: 600 calc(9 * var(--u)) / calc(16 * var(--u)) var(--vsc-ui); text-align: center;
  color: #fff; background: var(--vsc-blue);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.vsc-badge.is-hidden { opacity: 0; transform: scale(0.6); }
.vsc-act-end { margin-top: auto; display: flex; flex-direction: column; }

.vsc-side { min-width: 0; overflow: hidden; }
.vsc-side-title {
  display: flex; align-items: center; justify-content: space-between;
  height: calc(35 * var(--u)); padding: 0 calc(8 * var(--u)) 0 calc(20 * var(--u));
  font-size: calc(11 * var(--u)); text-transform: uppercase;
}
.vsc-side-title span { display: flex; gap: calc(6 * var(--u)); }
.vsc-pane + .vsc-pane .vsc-pane-head { border-top: 1px solid var(--vsc-border); }
.vsc-pane-head {
  display: flex; align-items: center; gap: calc(2 * var(--u));
  height: calc(22 * var(--u)); padding-left: calc(2 * var(--u));
  font-size: calc(11 * var(--u)); font-weight: 700; text-transform: uppercase;
}
.vsc-count {
  margin-left: calc(6 * var(--u)); min-width: calc(18 * var(--u)); padding: 0 calc(5 * var(--u));
  border-radius: calc(11 * var(--u));
  font-size: calc(11 * var(--u)); line-height: calc(18 * var(--u)); text-align: center;
  color: #f8f8f8; background: #616161;
}
.vsc-tree li {
  display: flex; align-items: center; gap: calc(6 * var(--u));
  height: calc(22 * var(--u)); padding: 0 calc(12 * var(--u)) 0 calc(20 * var(--u));
}
.vsc-label { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vsc-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: calc(12 * var(--u)); color: var(--vsc-muted); }
.vsc .is-ok { color: var(--vsc-pass); }

#run-plan li { padding-left: calc(4 * var(--u)); transition: opacity 500ms ease-out; }
#run-plan li.is-sub { padding-left: calc(34 * var(--u)); }
#run-plan .vsc-label, .vsc-inbox .vsc-label { font-family: var(--vsc-mono); font-size: calc(12 * var(--u)); }
#run-plan li.is-hidden, .vsc-inbox.is-hidden { opacity: 0; }
.vsc-inbox { transition: opacity 500ms ease-out; }
[data-status="planned"] .vsc-status-ico, [data-status="waiting"] .vsc-status-ico, [data-status="idle"] .vsc-status-ico { color: var(--vsc-muted); }
[data-status="rejected"] .vsc-status-ico { color: var(--vsc-error); }
[data-status="verified"] .vsc-status-ico { color: var(--vsc-pass); }
[data-status="rejected"] .vsc-desc { color: var(--vsc-error); }

/* ---------- Editor ---------- */
.vsc-editor { display: none; min-width: 0; min-height: 0; flex-direction: column; background: var(--vsc-editor); }
.vsc-tabs { flex: none; display: flex; height: calc(35 * var(--u)); background: var(--vsc-chrome); border-bottom: 1px solid var(--vsc-border); }
.vsc-tab {
  display: flex; align-items: center; gap: calc(10 * var(--u));
  margin-bottom: -1px; padding: 0 calc(10 * var(--u)) 0 calc(14 * var(--u));
  color: #fff; background: var(--vsc-editor);
  border-right: 1px solid var(--vsc-border); box-shadow: inset 0 1px 0 var(--vsc-blue);
}
.vsc-tab-actions { margin-left: auto; display: flex; align-items: center; gap: calc(8 * var(--u)); padding-right: calc(12 * var(--u)); }
.vsc-crumbs {
  flex: none; display: flex; align-items: center; gap: calc(2 * var(--u));
  height: calc(22 * var(--u)); padding-left: calc(20 * var(--u));
  font-size: calc(12 * var(--u)); color: #a9a9a9;
}
.vsc-crumbs .ci { font-size: calc(14 * var(--u)); }
.vsc-code-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.vsc-code {
  position: relative; padding-bottom: calc(18 * var(--u));
  font-family: var(--vsc-mono); font-size: calc(12 * var(--u)); line-height: calc(18 * var(--u));
  transition: transform 900ms cubic-bezier(0.32, 0.72, 0, 1);
}
.vsc .ln { display: grid; grid-template-columns: calc(18 * var(--u)) calc(48 * var(--u)) minmax(0, 1fr); white-space: pre; }
.vsc .ln .gm { display: grid; place-items: center; color: var(--vsc-muted); }
.vsc .ln .gm .ci { font-size: calc(13 * var(--u)); }
.vsc .ln .g { padding-right: calc(22 * var(--u)); text-align: right; color: var(--vsc-line-no); }
.vsc .ln .t { overflow-x: clip; }
.vsc .ln.is-cur .g { color: var(--vsc-fg); }
.vsc .ln.is-cur .t { box-shadow: inset 0 0 0 1px #282828; }
.vsc .ln.is-cur .t::after {
  content: ""; display: inline-block; width: calc(2 * var(--u)); height: calc(17 * var(--u));
  margin-left: 1px; vertical-align: text-bottom; background: #aeafad;
}
.vsc .ln .k { color: #569cd6; }
.vsc .ln .f { color: #dcdcaa; }
.vsc .ln .c { color: #6a9955; }
.vsc .ln .s { color: #f44747; }
.vsc .ln .n { color: #b5cea8; }
.vsc .ln.is-err .k {
  text-decoration: underline wavy var(--vsc-error); text-decoration-thickness: 1px;
  text-underline-offset: calc(2 * var(--u)); text-decoration-skip-ink: none;
}
.vsc-hover {
  position: absolute; top: calc(3 * var(--u)); left: calc(80 * var(--u));
  width: max-content; max-width: calc(320 * var(--u)); padding: calc(4 * var(--u)) calc(8 * var(--u));
  font-size: calc(13 * var(--u)); line-height: 1.45; white-space: normal; color: var(--vsc-fg);
  background: #202020; border: 1px solid #454545; border-radius: calc(3 * var(--u));
  box-shadow: 0 calc(2 * var(--u)) calc(8 * var(--u)) rgba(0, 0, 0, 0.36);
  opacity: 0; pointer-events: none; transition: opacity 200ms ease-out;
}
.vsc-hover.is-on { opacity: 1; }
.vsc-hover span { margin-left: calc(4 * var(--u)); color: var(--vsc-muted); }
/* Notification toast, bottom right of the editor like VS Code's */
.vsc-toast {
  position: absolute; right: calc(10 * var(--u)); bottom: calc(10 * var(--u));
  display: flex; align-items: flex-start; gap: calc(8 * var(--u));
  width: calc(340 * var(--u)); padding: calc(10 * var(--u)) calc(8 * var(--u)) calc(10 * var(--u)) calc(12 * var(--u));
  font-size: calc(13 * var(--u)); line-height: 1.45; white-space: normal; color: var(--vsc-fg);
  background: #202020; border: 1px solid #303031; border-radius: calc(4 * var(--u));
  box-shadow: 0 0 calc(8 * var(--u)) calc(2 * var(--u)) rgba(0, 0, 0, 0.36);
  opacity: 0; transform: translateY(calc(14 * var(--u)));
  transition: opacity 300ms ease-out, transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.vsc-toast.is-on { opacity: 1; transform: none; }
.vsc-toast .ci { margin-top: calc(2 * var(--u)); }
.vsc-toast b { font-family: var(--vsc-mono); font-size: calc(12 * var(--u)); }

/* ---------- Status bar ---------- */
.vsc-status {
  flex: none; display: flex; align-items: stretch;
  height: calc(22 * var(--u)); padding-right: calc(6 * var(--u));
  font-size: calc(12 * var(--u)); border-top: 1px solid var(--vsc-border);
}
.vsc-status > * { display: inline-flex; align-items: center; gap: calc(3 * var(--u)); padding: 0 calc(5 * var(--u)); }
.vsc-status > .ci { padding: 0; width: calc(26 * var(--u)); justify-content: center; }
.vsc-status .ci { font-size: calc(14 * var(--u)); }
.vsc-remote { padding: 0 calc(9 * var(--u)) !important; margin-right: calc(3 * var(--u)); color: #fff; background: var(--vsc-blue); }
#run-problems .ci + .ci { margin-left: calc(4 * var(--u)); }
.vsc-grow { flex: 1; padding: 0 !important; }
.vsc-pos, .vsc-lang { display: none !important; }

/* ---------- Wide frames: the full window with the editor ---------- */
@container shot (min-width: 620px) {
  .vsc { aspect-ratio: 16 / 10; --u: clamp(0.62px, 0.122cqi, 1px); }
  .vsc-main { grid-template-columns: calc(48 * var(--u)) calc(272 * var(--u)) minmax(0, 1fr); }
  .vsc-side { border-right: 1px solid var(--vsc-border); }
  .vsc-editor { display: flex; }
  .vsc-nav, .vsc-layout { display: flex; }
  .vsc-nav { position: absolute; right: calc(50% + 17% + 10 * var(--u)); }
  .vsc-layout { margin-left: auto; }
  .vsc-cc { width: 34%; }
  .vsc-pos, .vsc-lang { display: inline-flex !important; }
}

/* ---------- Motion (VS Code's own spinner timing); still under reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .vsc .spin { animation: vsc-spin 1.5s steps(30) infinite; }
  .vsc .ln.is-new { animation: vsc-new 1600ms ease-out both; }
  .vsc .ln.is-cur .t::after { animation: vsc-blink 1.1s steps(1) infinite; }
}
@keyframes vsc-spin { to { transform: rotate(360deg); } }
@keyframes vsc-new {
  from { opacity: 0; background-color: rgba(38, 79, 120, 0.65); }
  15% { opacity: 1; }
  to { background-color: rgba(38, 79, 120, 0); }
}
@keyframes vsc-blink { 50% { opacity: 0; } }

/* Codicon glyphs used above (codepoints from @vscode/codicons@0.0.46-24 dist/codicon.css) */
.ci-files:before { content: "\eaf0"; }
.ci-search:before { content: "\ea6d"; }
.ci-source-control:before { content: "\ea68"; }
.ci-extensions:before { content: "\eae6"; }
.ci-account:before { content: "\eb99"; }
.ci-settings-gear:before { content: "\eb51"; }
.ci-arrow-left:before { content: "\ea9b"; }
.ci-arrow-right:before { content: "\ea9c"; }
.ci-layout-sidebar-left:before { content: "\ebf3"; }
.ci-layout-panel:before { content: "\ebf2"; }
.ci-close:before { content: "\ea76"; }
.ci-split-horizontal:before { content: "\eb56"; }
.ci-ellipsis:before { content: "\ea7c"; }
.ci-chevron-right:before { content: "\eab6"; }
.ci-chevron-down:before { content: "\eab4"; }
.ci-debug-pause:before { content: "\ead1"; }
.ci-debug-stop:before { content: "\ead7"; }
.ci-loading:before { content: "\eb19"; }
.ci-pass-filled:before { content: "\ebb3"; }
.ci-circle-large-outline:before { content: "\ebb5"; }
.ci-error:before { content: "\ea87"; }
.ci-warning:before { content: "\ea6c"; }
.ci-lock:before { content: "\ea75"; }
.ci-git-branch:before { content: "\ec6f"; }
.ci-credit-card:before { content: "\eac9"; }
.ci-bell:before { content: "\eaa2"; }
.ci-remote:before { content: "\eb3a"; }
.ci-check:before { content: "\eab2"; }
