/* ===========================================================================
   VS Code — Dark Modern. Colours, metrics and spacing follow the real theme
   so the workbench reads as the editor rather than as a drawing of one.
   =========================================================================== */

:root {
  --bg:            #1f1f1f;   /* editor */
  --chrome:        #181818;   /* title bar, sidebar, panel, status bar */
  --border:        #2b2b2b;
  --text:          #cccccc;
  --dim:           #9d9d9d;
  --faint:         #6e7681;
  --accent:        #0078d4;
  --accent-hi:     #1f8ad2;
  --hover:         #2a2d2e;
  --selected:      #04395e;
  --input:         #313131;
  --input-border:  #3c3c3c;
  --live:          #16825d;

  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --h-title: 35px;
  --h-status: 22px;
  --h-tabs: 35px;
  --h-crumbs: 22px;
  --w-activity: 48px;
  --w-sidebar: 262px;
  --row: 22px;
  --code-lh: 20px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: grid;
  grid-template-rows: var(--h-title) minmax(0, 1fr) var(--h-status);
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* A default size as well as a default stroke: an <svg> with neither renders
   at 300x150, which is what a stray giant icon on a slow load actually is. */
svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-thumb { background: #4f4f4f80; border: 4px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #64646480; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── title bar ──────────────────────────────────────────────────────────── */

.titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.traffic { display: flex; gap: 8px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.traffic .r { background: #ff5f57; }
.traffic .y { background: #febc2e; }
.traffic .g { background: #28c840; }

.tb-menu { display: flex; gap: 14px; color: var(--text); font-size: 12.5px; opacity: .85; }
.tb-menu span { padding: 2px 0; cursor: default; }
.tb-menu span:hover { opacity: 1; }

.tb-title {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-actions { display: flex; gap: 12px; color: var(--dim); }
.tb-actions svg { width: 16px; height: 16px; }

@media (max-width: 900px) { .tb-menu { display: none; } }

/* ── workbench frame ────────────────────────────────────────────────────── */

.workbench {
  position: relative;
  display: grid;
  grid-template-columns: var(--w-activity) var(--w-sidebar) minmax(0, 1fr);
  min-height: 0;
}

/* The sash: a wide grab target over a hairline, the way VS Code does it. */
.sash {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--w-activity) + var(--w-sidebar) - 3px);
  width: 7px;
  z-index: 15;
  cursor: col-resize;
  touch-action: none;
}
.sash::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: transparent;
  transition: background .12s ease .1s;
}
.sash:hover::after,
.sash:focus-visible::after,
.sash.dragging::after { background: var(--accent); transition-delay: 0s; }
.sash:focus { outline: none; }

body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing .editor, body.col-resizing .term { pointer-events: none; }

/* ── activity bar ───────────────────────────────────────────────────────── */

.activitybar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  background: var(--chrome);
  border-right: 1px solid var(--border);
}
.act {
  position: relative;
  width: var(--w-activity);
  height: 48px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  color: #868686;
  cursor: pointer;
  transition: color .12s ease;
}
.act svg { width: 24px; height: 24px; }
.act:hover { color: #d7d7d7; }
.act.active { color: #d7d7d7; border-left-color: var(--accent); }
.act-badge {
  position: absolute;
  right: 8px; bottom: 8px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 500 9px/16px var(--ui);
  text-align: center;
}
.act-spacer { flex: 1; }

/* ── sidebar ────────────────────────────────────────────────────────────── */

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chrome);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.sb-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 35px;
  padding: 0 20px;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}
.sb-dots { color: var(--dim); cursor: pointer; letter-spacing: 0; }

.view { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.hidden { display: none !important; }

.sb-section {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--row);
  padding: 0 8px;
  font: 600 11px/var(--row) var(--ui);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.sb-section:hover { background: #ffffff08; }
.chev {
  width: 16px; height: 16px;
  flex: none;
  background: currentColor;
  transition: transform .1s ease;
  -webkit-mask: var(--chev) center/16px no-repeat;
          mask: var(--chev) center/16px no-repeat;
  /* codicon chevron-right, verbatim from microsoft/vscode-codicons —
     rotated 90deg when the folder is open, exactly as the tree does it. */
  --chev: url("data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='%23000'><path%20d='M6.14601%203.14579C5.95101%203.34079%205.95101%203.65779%206.14601%203.85279L10.292%207.99879L6.14601%2012.1448C5.95101%2012.3398%205.95101%2012.6568%206.14601%2012.8518C6.34101%2013.0468%206.65801%2013.0468%206.85301%2012.8518L11.353%208.35179C11.548%208.15679%2011.548%207.83979%2011.353%207.64478L6.85301%203.14479C6.65801%202.94979%206.34101%202.95079%206.14601%203.14579Z'/></svg>");
}
.sb-section.open .chev,
.tree li.folder.open .chev { transform: rotate(90deg); }

/* file tree */

/* The tree takes the slack so Outline and Timeline stay pinned at the foot
   of the panel, the way collapsed sections sit in the real explorer. */
#view-explorer { overflow: hidden; }
#view-explorer .tree { flex: 1 1 auto; overflow-y: auto; }
.sb-foot { flex: none; margin-top: auto; border-top: 1px solid var(--border); }

.tree { list-style: none; margin: 0; padding: 0 0 8px; }
.tree li {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--row);
  padding-right: 12px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}
.tree li:hover { background: var(--hover); }
.tree li.active { background: var(--selected); color: #fff; }
.tree li.folder { font-weight: 500; }
.tree li.depth-1 { padding-left: 12px; }
.tree li.depth-2 { padding-left: 32px; }
/* indent guide under an open folder */
.tree li.depth-2::before {
  content: "";
  position: absolute;
  left: 19px; top: 0; bottom: 0;
  border-left: 1px solid #ffffff14;
}
.tree .chev { color: var(--dim); margin-left: -2px; }

/* file-type glyphs */
.fi {
  flex: none;
  width: 17px;
  font: 700 8.5px/17px var(--mono);
  text-align: center;
  letter-spacing: -.02em;
}
.fi.md   { color: #6ea8fe; }
.fi.json { color: #d9b25f; }
.fi.ts   { color: #4f9dd9; }
.fi.js   { color: #d9c15f; }
.fi.py   { color: #4b8bbe; }
.fi.html { color: #e2703a; }
.fi.css  { color: #5b9dd9; }
.fi.env  { color: #d9c15f; }
.fi.txt, .fi.text { color: #9d9d9d; }

/* folder glyphs — tinted the way an icon theme would */
.fo { flex: none; width: 17px; height: 17px; display: grid; place-items: center; color: #9aa2ad; }
.fo svg { width: 16px; height: 16px; stroke-width: 1.25; }
.fo.front { color: #e2a03a; }
.fo.back  { color: #5aa9e6; }
.tree li.folder .chev { color: var(--dim); }

/* search / scm / run / extensions */

.sb-pad { padding: 8px 12px 14px; }
.input {
  width: 100%;
  padding: 5px 8px;
  background: var(--input);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  color: var(--text);
  font: 13px var(--ui);
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #8b8b8b; }

.results { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.res-file {
  display: flex; align-items: center; gap: 6px;
  height: var(--row); padding: 0 12px;
  font-size: 12px; color: var(--text); background: #ffffff06;
}
.res-file .n { margin-left: auto; color: var(--dim); }
.res-hit {
  height: var(--row);
  padding: 0 12px 0 32px;
  font: 12px/var(--row) var(--mono);
  color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.res-hit:hover { background: var(--hover); }
.res-hit b { color: #fff; background: #623315; font-weight: 400; }

.scm-head { margin: 14px 0 4px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.scm-head .count { color: var(--text); }
.scm-row { display: flex; align-items: center; gap: 6px; height: var(--row); font-size: 13px; }
.badge { margin-left: auto; font: 700 11px var(--mono); }
.badge.m { color: #e2c08d; }
.badge.u { color: #73c991; }
.hint { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--dim); }
.hint b { color: var(--text); font-weight: 500; }

.run-btn {
  width: 100%;
  padding: 6px 10px;
  background: var(--accent);
  border: 0; border-radius: 2px;
  color: #fff;
  font: 500 13px var(--ui);
  cursor: pointer;
}
.run-btn:hover { background: var(--accent-hi); }

.ext { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #ffffff0d; }
.ext-icon {
  flex: none; width: 38px; height: 38px; border-radius: 4px;
  display: grid; place-items: center;
  background: #2b2b2b; color: #cfcfcf;
  font: 700 13px var(--mono);
}
.ext-name { font-size: 13px; font-weight: 500; }
.ext-desc { font-size: 12px; color: var(--dim); line-height: 1.4; }
.ext-pub { font-size: 11px; color: var(--faint); margin-top: 2px; }

.card-row { margin-top: 12px; }
.card-key { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.card-val { font-size: 13px; word-break: break-word; }
.card-val a { color: #4daafc; text-decoration: none; }
.card-val a:hover { text-decoration: underline; }

/* ── editor area ────────────────────────────────────────────────────────── */

.editor-area {
  /* The panel gets its own explicit track. With an `auto` track its height
     would be negotiated against the length of the open file, which is what
     made the terminal drift as you switched files. */
  --panel-h: 264px;

  display: grid;
  grid-template-rows: var(--h-tabs) var(--h-crumbs) minmax(0, 1fr) var(--panel-h);
  /* Both min-* are required: a grid item's automatic minimum size is its
     content, which would otherwise push the panel off the bottom of the app. */
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.editor-area.no-panel { --panel-h: 0px; }

.tabs {
  display: flex;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: var(--h-tabs);
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--border);
  border-top: 1px solid transparent;
  color: var(--dim);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { background: #1f1f1f80; }
.tab.active {
  background: var(--bg);
  border-top-color: var(--accent);
  color: #fff;
}
.tab .x {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 3px;
  color: transparent;
  font-size: 14px; line-height: 1;
}
.tab:hover .x, .tab.active .x { color: var(--dim); }
.tab .x:hover { background: #ffffff1a; color: #fff; }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 20px;
  font-size: 12px;
  color: #a9a9a9;
  white-space: nowrap;
  overflow: hidden;
}
.breadcrumbs .sep { color: var(--faint); }

.editor-body { position: relative; display: flex; min-height: 0; overflow: hidden; }

/* ── minimap ────────────────────────────────────────────────────────────── */

.minimap-wrap {
  position: relative;
  flex: none;
  width: 82px;
  background: var(--bg);
  border-left: 1px solid #ffffff08;
  cursor: pointer;
}
.minimap { display: block; width: 82px; }

/* The slider showing which slice of the file is on screen. */
.minimap-view {
  position: absolute;
  left: 0;
  right: 0;
  background: #ffffff0f;
  pointer-events: none;
  transition: opacity .2s ease;
}
.minimap-wrap:hover .minimap-view { background: #ffffff1a; }

@media (max-width: 1000px) { .minimap-wrap { display: none; } }

/* ── résumé call to action ──────────────────────────────────────────────── */

.tabstrip {
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}
.tabstrip .tabs { flex: 1; min-width: 0; border-bottom: 0; }

/* The one thing a recruiter should find without looking for it. */
.resume-cta {
  flex: none;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 10px;
  padding: 5px 13px 5px 11px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: 500 12.5px var(--ui);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 0 0 #0078d480;
  animation: ctaAttention 3.4s ease-in-out 1.6s 3;
  transition: background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.resume-cta svg { width: 15px; height: 15px; stroke-width: 1.5; }
.resume-cta:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px #0078d466;
}
.resume-cta:active { transform: none; }

/* Three slow rings on arrival, then it settles down and stays put. */
@keyframes ctaAttention {
  0%, 100% { box-shadow: 0 0 0 0 #0078d400; }
  22%      { box-shadow: 0 0 0 6px #0078d400, 0 0 0 2px #0078d4cc; }
  45%      { box-shadow: 0 0 0 0 #0078d400; }
}

@media (prefers-reduced-motion: reduce) { .resume-cta { animation: none; } }

@media (max-width: 640px) {
  .resume-cta span { display: none; }
  .resume-cta { padding: 5px 9px; margin: 0 6px; }
}

.editor {
  flex: 1;
  display: flex;
  align-items: flex-start;   /* let .code define its own height, not the box */
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 0 40px;
}
.gutter {
  flex: none;
  padding: 0 22px 0 24px;
  text-align: right;
  color: var(--faint);
  font: 13px/var(--code-lh) var(--mono);
  user-select: none;
}
.gutter span { display: block; }
.gutter span.cur { color: var(--text); }

.code {
  flex: 1;
  margin: 0;
  min-width: 0;
  font: 13px/var(--code-lh) var(--mono);
  tab-size: 2;
}
.code .line {
  display: block;
  padding: 0 24px 0 0;
  white-space: pre;
  min-height: var(--code-lh);
}
.code .line:hover { background: #ffffff07; }
.code .line.cur { background: #ffffff0a; box-shadow: inset 0 0 0 1px #ffffff12; }




/* syntax — VS Code Dark+ token colours */
.t-kw    { color: #569cd6; }
.t-ctl   { color: #c586c0; }
.t-str   { color: #ce9178; }
.t-num   { color: #b5cea8; }
.t-key   { color: #9cdcfe; }
.t-fn    { color: #dcdcaa; }
.t-type  { color: #4ec9b0; }
.t-com   { color: #6a9955; }
.t-h1    { color: #569cd6; font-weight: 700; }
.t-bold  { color: #ce9178; font-weight: 700; }
.t-quote { color: #6a9955; font-style: italic; }
.t-bullet{ color: #6796e6; }
.t-link  { color: #4daafc; text-decoration: underline; }
.t-code  { color: #ce9178; }
.t-rule  { color: #6e7681; }

/* ── panel / terminal ───────────────────────────────────────────────────── */

.panel {
  position: relative;
  display: grid;
  grid-template-rows: 35px minmax(0, 1fr);
  height: 100%;              /* fills the --panel-h track */
  min-height: 0;
  background: var(--chrome);
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.panel.closed { display: none; }

.panel-resize {
  position: absolute;
  top: -4px; left: 0; right: 0;
  height: 9px;
  cursor: row-resize;
  z-index: 20;
  touch-action: none;          /* let pointermove drive the drag, not scrolling */
}
.panel-resize::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 4px;
  height: 1px;
  background: transparent;
  transition: background .12s ease;
}
.panel-resize:hover::after,
.panel-resize.dragging::after { background: var(--accent); }

/* While dragging, nothing else should take the pointer or select text. */
body.resizing { cursor: row-resize; user-select: none; }
body.resizing .editor, body.resizing .term { pointer-events: none; }

.panel-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px 0 20px;
  border-bottom: 1px solid transparent;
}
.ptab {
  height: 35px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--dim);
  font: 400 11px/35px var(--ui);
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: #fff; border-bottom-color: var(--text); }
.pill {
  display: inline-block;
  min-width: 15px; padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 500 9px/15px var(--ui);
  vertical-align: 2px;
}
.panel-spacer { flex: 1; }
.shell-chip {
  padding: 2px 8px;
  border-radius: 3px;
  background: #ffffff0d;
  color: var(--dim);
  font: 11px var(--mono);
}
.picon {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 4px;
  color: var(--dim);
  cursor: pointer;
}
.picon svg { width: 16px; height: 16px; }
.picon:hover { background: #ffffff12; color: #fff; }

.term {
  min-height: 0;
  padding: 4px 20px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font: 12.5px/1.55 var(--mono);
  color: var(--text);
  outline: none;
}
.term-out { white-space: pre-wrap; word-break: break-word; }
.term-out .l { display: block; min-height: 1.55em; }

.term-out .hd    { color: #fff; font-weight: 700; }
.term-out .muted { color: var(--dim); }
.term-out .err   { color: #f14c4c; }
.term-out .ok    { color: #23d18b; }
.term-out .dir   { color: #3b8eea; font-weight: 700; }
.term-out .file  { color: #b5cea8; }
.term-out .kv    { color: #d7ba7d; }
.term-out .cmd-row { color: var(--dim); }
.term-out .cmd-row::first-line { color: var(--dim); }
.term-out .echo  { color: #fff; }
.term-out a { color: #3b8eea; text-decoration: underline; text-underline-offset: 2px; }
.term-out a:hover { color: #6cb6ff; }

.term-line { display: flex; align-items: baseline; flex-wrap: wrap; }
.term-line::after { content: ""; flex: 1 1 auto; min-width: 0; }
.prompt { white-space: pre; margin-right: 8px; }
/* cmd renders its prompt in the same ink as the output — no colour coding. */
.p-path { color: var(--text); }
.p-arrow { color: var(--text); }
.term-input {
  /* Must shrink to its content: with flex:1 it filled the row and shoved the
     block caret out to the right margin, away from the text being typed. */
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 2px;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  caret-color: transparent;
}
.caret {
  width: 7.5px; height: 1.15em;
  margin-left: -1px;
  background: #cccccc;
  animation: blink 1.05s steps(1) infinite;
}
.term.away .caret { background: transparent; box-shadow: inset 0 0 0 1px #cccccc; animation: none; }
@keyframes blink { 50% { opacity: 0; } }

/* ── status bar ─────────────────────────────────────────────────────────── */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 4px;
  background: var(--chrome);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  user-select: none;
}
.sb-left, .sb-right { display: flex; align-items: center; height: 100%; }
.st {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 7px;
  background: none;
  border: 0;
  color: inherit;
  font: 12px var(--ui);
  white-space: nowrap;
  cursor: pointer;
}
.st:hover { background: #ffffff1a; }
.st .i { width: 14px; height: 14px; }
.st.remote { background: var(--accent); color: #fff; padding: 0 10px; }
.st.remote:hover { background: var(--accent-hi); }

.golive { position: relative; }
/* Before it has been used, the button sits a shade above the bar — enough to
   find, not enough to blink at you. */
.golive.pulse { background: #ffffff14; }
.golive.pulse:hover { background: #ffffff26; }
.golive.live { background: var(--live); color: #fff; }
.golive.live:hover { background: #1a9c70; }

/* ── "click here" callout — a nudge, not a billboard ────────────────────── */

.callout {
  position: fixed;
  right: 116px;
  bottom: 30px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  pointer-events: none;
  opacity: 0;
  animation: calloutIn .45s ease forwards 1.1s;
}
.callout.gone { animation: calloutOut .3s ease forwards; }

.callout-bubble {
  padding: 6px 10px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #252526;
  color: var(--text);
  box-shadow: 0 4px 14px #0000004d;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
}
.callout-bubble b { font-weight: 600; color: #fff; }
.callout-bubble span { color: var(--dim); }

.callout-arrow { width: 34px; height: 26px; margin-bottom: -4px; }
.callout-arrow path { stroke: #6e7681; stroke-width: 1.6; fill: none; }
.callout-arrow .head { fill: #6e7681; stroke: none; }

@keyframes calloutIn  { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes calloutOut { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .callout { animation: none; opacity: 1; }
  .golive.pulse, .caret { animation: none; }
}

/* ── quick open ─────────────────────────────────────────────────────────── */

.palette-back {
  position: fixed; inset: 0;
  z-index: 60;
  background: #0000004d;
  display: flex; justify-content: center;
  padding-top: 6px;
}
.palette {
  width: min(600px, 92vw);
  background: #202020;
  border: 1px solid #454545;
  border-radius: 6px;
  box-shadow: 0 8px 32px #00000073;
  overflow: hidden;
}
.palette input {
  width: 100%;
  padding: 8px 10px;
  background: var(--input);
  border: 0; border-bottom: 1px solid var(--input-border);
  color: var(--text);
  font: 13px var(--ui);
  outline: none;
}
.palette ul { list-style: none; margin: 0; padding: 4px 0; max-height: 45vh; overflow-y: auto; }
.palette li {
  display: flex; align-items: center; gap: 7px;
  height: var(--row); padding: 0 10px;
  font-size: 13px; cursor: pointer;
}
.palette li.sel { background: var(--selected); color: #fff; }
.palette li .dim { margin-left: auto; color: var(--faint); font-size: 12px; }

/* ── narrow screens ─────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  :root { --w-sidebar: 200px; --w-activity: 44px; }
  .tb-title { display: none; }
  .callout { right: 12px; bottom: 52px; }
}

/* ── boot splash ────────────────────────────────────────────────────────── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--bg);
  /* Safety net: if the script never runs, the splash still gets out of the way. */
  /* Failsafe only — it must outlast the scripted sequence, never race it. */
  animation: splashFail .5s ease 7s forwards;
}
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
}
.splash-mark {
  font: 600 44px/1 var(--mono);
  color: var(--accent);
  letter-spacing: -2px;
  animation: splashPulse 1.6s ease-in-out infinite;
}
.splash-name { font-size: 22px; font-weight: 300; color: #e6e6e6; letter-spacing: .02em; }
.splash-role {
  font-size: 12px;
  color: #8c8c8c;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.splash-bar {
  width: 220px;
  max-width: 60vw;
  height: 2px;
  margin-top: 16px;
  background: #333;
  overflow: hidden;
}
.splash-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .18s linear;
}
.splash-log { font: 11px/1.4 var(--mono); color: #6f6f6f; min-height: 16px; }
.splash-skip { margin-top: 14px; font-size: 10px; color: #4a4a4a; letter-spacing: .08em; }

.splash.done {
  opacity: 0;
  visibility: hidden;
  animation: none;
  transition: opacity .45s ease, visibility 0s .45s;
}

@keyframes splashPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes splashFail  { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .splash-mark { animation: none; }
  .splash-bar i { transition: none; }
}

@media (max-width: 640px) {
  .splash-name { font-size: 18px; }
  .splash-role { font-size: 10px; letter-spacing: .1em; }
  .splash-mark { font-size: 36px; }
  .splash-log { font-size: 10px; padding: 0 16px; word-break: break-all; }
}

/* ===========================================================================
   Phones: the workbench is a desktop idea. A 48px activity bar, a sidebar, a
   minimap and a code pane do not survive a 390px screen, so below 760px the
   whole thing collapses to the one part that does work with thumbs — the
   terminal, full height, driven by tappable commands.
   =========================================================================== */

.term-chips { display: none; }

@media (max-width: 760px) {
  /* Not a small editor — a terminal. Everything that exists to make this
     look like VS Code goes, including the boot splash. */
  .splash,
  .titlebar,
  .activitybar,
  .sidebar,
  .sash,
  .tabstrip,
  .breadcrumbs,
  .editor-body,
  .panel-tabs,
  .panel-resize,
  .statusbar,
  .callout { display: none !important; }

  /* console black, not editor grey */
  :root { --chrome: #0c0c0c; --bg: #0c0c0c; --border: #1e1e1e; }

  body {
    grid-template-rows: minmax(0, 1fr);
    background: #0c0c0c;
  }

  .workbench { grid-template-columns: minmax(0, 1fr); }

  /* the terminal is the whole app now */
  .editor-area { grid-template-rows: minmax(0, 1fr); }
  .panel {
    --panel-h: auto;
    grid-row: 1;
    height: 100%;
    border-top: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    background: #0c0c0c;
  }
  .panel.closed { display: grid; }        /* nothing to close it into */

  .term {
    padding: calc(12px + env(safe-area-inset-top)) 14px 4px;
    font-size: 12.5px;
    line-height: 1.6;
    background: #0c0c0c;
    -webkit-overflow-scrolling: touch;
  }

  /* Typing on a phone is miserable, so the commands are buttons. */
  .term-chips {
    display: flex;
    gap: 7px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #232323;
    background: #0c0c0c;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .term-chips::-webkit-scrollbar { display: none; }

  .chip {
    flex: none;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid #333;
    border-radius: 17px;
    background: #1a1a1a;
    color: var(--text);
    font: 500 12.5px var(--mono);
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .chip:active { background: #333; transform: scale(.97); }

  .chip-go {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
  }
  .chip-go:active { background: var(--accent-hi); }

  /* the caret should not chase a keyboard that is not open */
  .term-line { padding-bottom: 4px; }

  /* While the intro types, the prompt is just noise beside it. */
  .term.booting .term-line { display: none; }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .chip:active { transform: none; }
}
