/* ==========================================================================
   Réplica da interface do VS Code, tema "Dark Modern".
   Medidas e cores seguem o editor: título 30px, atividades 48px, linhas 22px, status 22px.
   ========================================================================== */
:root {
  --bg-editor: #1f1f1f;
  --bg-side: #181818;
  --bg-input: #313131;
  --bg-widget: #202020;
  --bg-menu: #1f1f1f;
  --fg: #cccccc;
  --fg-strong: #ffffff;
  --fg-dim: #9d9d9d;
  --fg-faint: #868686;
  --border: #2b2b2b;
  --border-widget: #454545;
  --blue: #0078d4;
  --blue-link: #4daafc;
  --list-active: #04395e;
  --list-inactive: #37373d;
  --list-hover: #2a2d2e;
  --selection: #264f78;
  --line-number: #6e7681;
  --find-match: rgb(234 92 0 / 0.33);
  --find-current: #515c6a;
  --error-bg: #5a1d1d;
  --error-border: #be1100;
  --shadow: 0 0 8px 2px rgb(0 0 0 / 0.36);

  /* Cores de sintaxe (Dark+) */
  --tok-comment: #6a9955;
  --tok-string: #ce9178;
  --tok-keyword: #c586c0;
  --tok-heading: #569cd6;
  --tok-number: #b5cea8;
  --tok-function: #dcdcaa;
  --tok-type: #4ec9b0;
  --tok-variable: #9cdcfe;
  --tok-punct: #6796e6;
  --tok-quote: #6a9955;

  --font-ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Ubuntu, sans-serif;
  --font-editor: Consolas, "Courier New", ui-monospace, Menlo, monospace;
  --editor-size: 14px;
  --editor-lh: 19px;
  --gutter: 66px;
  --sidebar-w: 300px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--bg-side);
  color: var(--fg);
  font: 13px/1.4 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, p, dl, dd { margin: 0; }
a { color: var(--blue-link); }
kbd { font: inherit; }
.codicon { font-size: 16px; line-height: 1; }

/* Barras de rolagem finas, como no VS Code */
* { scrollbar-width: thin; scrollbar-color: rgb(121 121 121 / 0.4) transparent; }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-thumb { background: rgb(121 121 121 / 0.4); }
::-webkit-scrollbar-thumb:hover { background: rgb(100 100 100 / 0.7); }
::-webkit-scrollbar-corner { background: transparent; }

:focus { outline: none; }
:focus-visible { outline: 1px solid var(--blue); outline-offset: -1px; }

.workbench {
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr) 22px;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ==========================================================================
   Barra de título
   ========================================================================== */
.titlebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  background: var(--bg-side);
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.tb-left { display: flex; align-items: center; height: 100%; min-width: 0; }
.tb-logo { width: 48px; text-align: center; color: #3794ff; font-size: 18px; }

.menubar { display: flex; height: 100%; }
.menubar-item { padding: 0 8px; height: 100%; border-radius: 5px; font-size: 13px; }
.menubar-item:hover, .menubar-item.open { background: rgb(255 255 255 / 0.1); }

.tb-center { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; }
.tb-btn, .winctl { display: inline-grid; place-items: center; width: 28px; height: 22px; border-radius: 5px; color: var(--fg-dim); }
.tb-btn:hover { background: rgb(255 255 255 / 0.1); color: var(--fg); }
.cmd-center {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 22px;
  padding: 0 12px;
  border: 1px solid var(--border-widget);
  border-radius: 6px;
  background: #1f1f1f;
  color: var(--fg-dim);
}
.cmd-center:hover { background: #2b2b2b; border-color: #555; }
.cmd-center h1 { overflow: hidden; font-size: 12px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.cmd-center .codicon { font-size: 14px; }

.tb-right { display: flex; align-items: center; justify-content: flex-end; height: 100%; padding-left: 8px; }
.page-switch { display: none; }
.lang-switch { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.lang-btn { display: grid; place-items: center; width: 28px; height: 22px; border-radius: 5px; opacity: 0.5; }
.lang-btn img { display: block; border-radius: 2px; }
.lang-btn:hover { opacity: 1; background: rgb(255 255 255 / 0.1); }
.lang-btn[aria-pressed="true"] { opacity: 1; background: rgb(255 255 255 / 0.14); }
.winctl { width: 46px; height: 100%; border-radius: 0; color: var(--fg); }
.winctl:hover { background: rgb(255 255 255 / 0.1); }
.winctl.close:hover { background: #e81123; color: #fff; }

/* ==========================================================================
   Barra de atividades e barra lateral
   ========================================================================== */
.main { display: flex; min-height: 0; position: relative; }

.activitybar { display: flex; flex: none; flex-direction: column; justify-content: space-between; width: 48px; background: var(--bg-side); border-right: 1px solid var(--border); }
.ab-btn { position: relative; display: grid; place-items: center; width: 48px; height: 48px; color: var(--fg-faint); }
.ab-btn .codicon { font-size: 24px; }
.ab-avatar { width: 26px; height: 26px; border-radius: 50%; background: url("https://github.com/victorelisiario.png?size=64") center / cover, url("/img/avatar.jpg") center / cover; opacity: 0.8; }
.ab-btn:hover .ab-avatar { opacity: 1; }
.ab-btn:hover { color: var(--fg-strong); }
.ab-btn.active { color: var(--fg-strong); }
.ab-btn.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--blue); }

.sidebar { flex: none; width: var(--sidebar-w); min-width: 170px; background: var(--bg-side); border-right: 1px solid var(--border); overflow: hidden; }
.sidebar.collapsed, .sidebar.collapsed + .sash { display: none; }
.sash { position: absolute; top: 0; bottom: 0; left: calc(48px + var(--sidebar-w) - 2px); z-index: 20; width: 4px; cursor: ew-resize; }
.sash:hover, .sash.dragging { background: var(--blue); }

.view { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow-y: auto; }
.view-header { display: flex; flex: none; align-items: center; justify-content: space-between; height: 35px; padding: 0 12px 0 20px; font-size: 11px; letter-spacing: 0; text-transform: uppercase; color: var(--fg); }
.view-actions { opacity: 0; color: var(--fg); }
.view:hover .view-actions { opacity: 1; }

.section { display: flex; flex-direction: column; min-height: 0; }
#section-files { flex: 1 1 auto; }
#section-links { flex: none; margin-top: auto; }
.section-header { display: flex; flex: none; align-items: center; height: 22px; padding-right: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; cursor: pointer; border-top: 1px solid transparent; }
.section:not(:first-of-type) .section-header { border-top-color: var(--border); }
.section-header:focus-visible { outline-offset: -1px; }
.twistie { width: 16px; margin: 0 2px 0 2px; font-size: 16px; text-align: center; }
.section-title { flex: 1; letter-spacing: 0; }
.section-actions { display: flex; opacity: 0; }
.section:hover .section-actions, .section-header:focus-within .section-actions { opacity: 1; }
.act-btn { display: grid; place-items: center; width: 22px; height: 22px; margin-left: 2px; border-radius: 5px; color: var(--fg); }
.act-btn:hover { background: rgb(90 93 94 / 0.31); }
.act-btn .codicon { font-size: 16px; }
.section.collapsed .section-body { display: none; }
.section.collapsed .twistie::before { content: "\eab6"; } /* chevron-right */

/* Árvore e linhas de lista */
.tree { display: flex; flex-direction: column; min-height: 22px; outline: none; }
.row { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; height: 22px; padding: 0 8px 0 22px; color: var(--fg); text-decoration: none; text-align: left; cursor: pointer; white-space: nowrap; }
.row:hover { background: var(--list-hover); }
.row.selected { background: var(--list-inactive); color: var(--fg-strong); }
.tree:focus-within .row.selected { background: var(--list-active); outline: 1px solid var(--blue); outline-offset: -1px; }
.row.cut { opacity: 0.6; }
.row-icon { flex: none; width: 16px; font-size: 16px; text-align: center; }
.row-icon.markdown { color: #519aba; }
.row-icon.json { color: #cbcb41; }
.row-icon.shell { color: #89e051; }
.row-icon.bib { color: #e0a96d; }
.row-icon.log { color: #7fc4b1; }
.row-icon.env { color: #b980e0; }
.row-icon.html { color: #e37933; }
.row-icon.text { color: #9cb2c4; }
.row-label { overflow: hidden; text-overflow: ellipsis; }
.links .row { color: var(--fg); padding-left: 22px; }
.links .row:hover { color: var(--fg-strong); }
.links .codicon { width: 16px; flex: none; }
.brand-icon { flex: none; width: 16px; height: 16px; background-color: currentColor; -webkit-mask: var(--icon) center / 14px no-repeat; mask: var(--icon) center / 14px no-repeat; }
.brand-icon.linkedin { --icon: url("/img/linkedin.svg"); }
.brand-icon.orcid { --icon: url("/img/orcid.svg"); }
.brand-icon.lattes { --icon: url("/img/lattes.svg"); }

/* Entrada embutida (novo arquivo / renomear) */
.row-input { display: flex; flex-direction: column; padding: 0 8px 0 22px; }
.row-input .editing { display: flex; align-items: center; gap: 6px; height: 22px; }
.row-input input { flex: 1; min-width: 0; height: 20px; padding: 0 4px; border: 1px solid var(--blue); border-radius: 0; background: var(--bg-input); color: var(--fg-strong); font-size: 13px; user-select: text; }
.row-input input.invalid { border-color: var(--error-border); }
.input-error { margin: 0 0 0 22px; padding: 4px 6px; border: 1px solid var(--error-border); border-top: 0; background: var(--error-bg); color: #fff; font-size: 12px; line-height: 1.3; white-space: normal; }

/* Campos de busca (Pesquisar, Extensões, Localizar) */
.search-box { padding: 4px 12px 8px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { width: 100%; height: 26px; padding: 0 70px 0 6px; border: 1px solid transparent; border-radius: 2px; background: var(--bg-input); color: var(--fg-strong); font-size: 13px; user-select: text; }
.input-wrap input:focus { border-color: var(--blue); outline: none; }
.input-wrap input.invalid { border-color: var(--error-border); }
.input-wrap input::placeholder { color: var(--fg-faint); }
#ext-input { padding-right: 6px; }
.input-toggles { position: absolute; right: 2px; display: flex; gap: 1px; }
.tgl { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid transparent; border-radius: 3px; color: var(--fg); }
.tgl:hover { background: rgb(90 93 94 / 0.31); }
.tgl[aria-pressed="true"] { border-color: var(--blue); background: rgb(0 120 212 / 0.4); color: var(--fg-strong); }
.tgl .codicon { font-size: 16px; }
.search-summary { padding: 6px 2px 0; color: var(--fg-dim); font-size: 12px; }

.results { flex: 1; min-height: 0; overflow-y: auto; }
.result-file { display: flex; align-items: center; gap: 4px; width: 100%; height: 22px; padding: 0 8px 0 4px; font-weight: 400; }
.result-file:hover, .result-line:hover { background: var(--list-hover); }
.result-file .badge { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 11px; background: #616161; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.result-line { display: block; width: 100%; height: 22px; padding: 0 8px 0 36px; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: pre; color: var(--fg); }
.result-line mark { background: rgb(234 92 0 / 0.33); color: inherit; }

.welcome-view { padding: 12px 20px; color: var(--fg-dim); line-height: 1.5; }
.welcome-view p + p, .welcome-view .primary-btn + p { margin-top: 12px; }
.primary-btn, .secondary-btn { display: inline-grid; place-items: center; min-height: 26px; padding: 0 14px; border-radius: 2px; font-size: 13px; }
.primary-btn { background: var(--blue); color: #fff; }
.primary-btn:hover { background: #026ec1; }
.secondary-btn { background: var(--bg-input); border: 1px solid var(--border-widget); color: var(--fg-strong); }
.secondary-btn:hover { background: #3c3c3c; }
.primary-btn.wide { width: 100%; }

/* ==========================================================================
   Área do editor
   ========================================================================== */
.editor-area { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-editor); }

.tabs-row { display: flex; flex: none; height: 35px; background: var(--bg-side); border-bottom: 1px solid var(--border); }
.tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs-nav { display: none; flex: none; width: 26px; padding: 0; border: 0; background: var(--bg-side); color: var(--fg-dim); cursor: pointer; align-items: center; justify-content: center; }
.tabs-nav:hover { color: var(--fg); background: var(--hover, rgb(255 255 255 / 0.08)); }
.tabs-row.overflow .tabs-nav { display: flex; }
.tab { position: relative; display: flex; flex: none; align-items: center; gap: 6px; max-width: 200px; height: 35px; padding: 0 8px 0 10px; border-right: 1px solid var(--border); background: var(--bg-side); color: var(--fg-dim); cursor: pointer; }
.tab:hover { color: var(--fg-strong); }
.tab.active { background: var(--bg-editor); color: var(--fg-strong); }
.tab.active::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--blue); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--bg-editor); }
.tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-close { position: relative; display: grid; place-items: center; width: 20px; height: 20px; margin-left: 2px; border-radius: 5px; color: inherit; opacity: 0; }
.tab.active .tab-close, .tab:hover .tab-close { opacity: 1; }
.tab-close:hover { background: rgb(90 93 94 / 0.31); }
.tab-close .codicon { font-size: 16px; }
.tab-close .dirty { display: none; font-size: 10px; }
.tab.dirty .tab-close { opacity: 1; }
.tab.dirty .tab-close .dirty { display: block; }
.tab.dirty .tab-close .x { display: none; }
.tab.dirty .tab-close:hover .dirty { display: none; }
.tab.dirty .tab-close:hover .x { display: block; }
.tab-actions { display: flex; align-items: center; gap: 12px; padding: 0 12px; color: var(--fg); }

.breadcrumbs { display: flex; flex: none; align-items: center; gap: 2px; height: 22px; padding: 0 12px; color: #a9a9a9; font-size: 13px; overflow: hidden; white-space: nowrap; }
.breadcrumbs .codicon { font-size: 16px; }
.breadcrumbs .crumb { display: inline-flex; align-items: center; gap: 4px; padding: 0 2px; }
.breadcrumbs .crumb:last-child { color: var(--fg); }

.editor-body { position: relative; flex: 1; min-height: 0; }
.editor-scroll { position: absolute; inset: 0; overflow: auto; }

/* Documento: camada colorida + textarea transparente empilhados na mesma célula */
.surface { display: grid; min-height: 100%; min-width: 100%; width: max-content; }
.surface.wrap { width: 100%; }
.hl, .ta {
  grid-area: 1 / 1;
  margin: 0;
  padding: 0 134px 40px var(--gutter);
  border: 0;
  font-family: var(--font-editor);
  font-size: var(--editor-size);
  line-height: var(--editor-lh);
  font-variant-ligatures: none;
  tab-size: 4;
  white-space: pre;
}
.surface.wrap .hl, .surface.wrap .ta { white-space: pre-wrap; overflow-wrap: anywhere; }
.hl { counter-reset: ln; pointer-events: none; color: var(--fg); user-select: none; }
.ta {
  align-self: stretch;
  width: 100%;
  height: auto;
  resize: none;
  overflow: hidden;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #aeafad;
  user-select: text;
}
.ta::selection { background: var(--selection); }

.line { position: relative; min-height: var(--editor-lh); counter-increment: ln; }
.line::before {
  content: counter(ln);
  position: absolute;
  left: calc(-1 * var(--gutter));
  width: 42px;
  color: var(--line-number);
  text-align: right;
}
.line.active { box-shadow: inset 0 0 0 2px #282828; margin-left: -2px; padding-left: 2px; }
.line.active::before { color: var(--fg); left: calc(-1 * var(--gutter) - 2px); }

.find-match { background: var(--find-match); }
.find-current { background: var(--find-current); box-shadow: 0 0 0 1px #ea5c00 inset; }

/* Sintaxe */
.t-head { color: var(--tok-heading); font-weight: 700; }
.t-mark { color: var(--tok-punct); }
.t-str { color: var(--tok-string); }
.t-key { color: var(--tok-variable); }
.t-quote { color: var(--tok-quote); }
.t-bold { color: var(--tok-heading); font-weight: 700; }
.t-em { font-style: italic; }
.t-link { color: var(--blue-link); text-decoration: underline; }
.t-add { color: #73c991; }
.t-del { color: #f14c4c; }
.t-tag { color: var(--tok-type); }
.t-comment { color: var(--tok-comment); }
.t-kw { color: var(--tok-keyword); }
.t-fn { color: var(--tok-function); }
.t-num { color: var(--tok-number); }

/* Minimapa */
.minimap { position: absolute; top: 0; right: 14px; bottom: 0; z-index: 5; width: 120px; overflow: hidden; background: var(--bg-editor); }
.minimap canvas { display: block; width: 120px; }
.minimap-slider { position: absolute; left: 0; right: 0; background: rgb(121 121 121 / 0.2); }
.minimap:hover .minimap-slider { background: rgb(121 121 121 / 0.35); }
.editor-body.no-minimap .minimap { display: none; }
.editor-body.no-minimap .hl, .editor-body.no-minimap .ta { padding-right: 24px; }

/* Widget de localizar */
.find-widget { position: absolute; top: 0; right: 28px; z-index: 10; display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 2px; border: 1px solid var(--border-widget); border-top: 0; background: var(--bg-widget); box-shadow: var(--shadow); }
.find-toggle { width: 18px; text-align: center; color: var(--fg-dim); }
.find-main { width: 220px; }
.find-count { min-width: 76px; padding: 0 4px; color: var(--fg); font-size: 12px; text-align: center; }
.find-btn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--fg); }
.find-btn:disabled { opacity: 0.4; pointer-events: none; }
.find-btn:hover { background: rgb(90 93 94 / 0.31); }

/* Marca d'água quando não há arquivo aberto */
.watermark { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 28px; user-select: none; }
.watermark .logo { font-size: 160px; color: #fff; opacity: 0.06; }
.shortcuts { display: grid; gap: 8px; min-width: 300px; }
.shortcuts > div { display: flex; justify-content: space-between; gap: 24px; color: var(--fg-dim); }
.shortcuts kbd { padding: 0 5px; border: 1px solid #454545; border-bottom-width: 2px; border-radius: 3px; background: #2b2b2b; color: var(--fg); font-size: 11px; }

/* ==========================================================================
   Barra de status
   ========================================================================== */
.statusbar { display: flex; justify-content: space-between; align-items: stretch; overflow: hidden; background: var(--bg-side); border-top: 1px solid var(--border); color: var(--fg); font-size: 12px; }
.sb-left, .sb-right { display: flex; align-items: stretch; min-width: 0; }
.sb-item { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; white-space: nowrap; cursor: default; }
.sb-item:hover { background: rgb(255 255 255 / 0.12); }
.sb-item .codicon { font-size: 14px; }
.sb-remote { width: 38px; justify-content: center; background: var(--blue); color: #fff; }
.sb-remote:hover { background: #026ec1; }
.sb-text { overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Menus, paleta de comandos, notificações e diálogo
   ========================================================================== */
.menu { position: fixed; z-index: 100; min-width: 220px; padding: 4px 0; border: 1px solid var(--border-widget); border-radius: 5px; background: var(--bg-menu); box-shadow: var(--shadow); color: var(--fg); }
.menu-item { position: relative; display: flex; align-items: center; width: calc(100% - 8px); height: 26px; margin: 0 4px; padding: 0 8px 0 24px; border-radius: 4px; text-align: left; white-space: nowrap; }
.menu-item:hover:not(.disabled), .menu-item.focused:not(.disabled) { background: var(--blue); color: #fff; }
.menu-item.disabled { color: #6e6e6e; cursor: default; }
.menu-label { flex: 1; }
.menu-shortcut { margin-left: 32px; color: inherit; opacity: 0.7; }
.menu-check { position: absolute; left: 6px; font-size: 14px; }
.menu-arrow { margin-left: 24px; font-size: 14px; }
.menu-sep { height: 1px; margin: 4px 8px; background: var(--border-widget); }

.quick { position: fixed; top: 30px; left: 50%; z-index: 90; width: 600px; max-width: calc(100vw - 16px); padding-top: 6px; transform: translateX(-50%); border: 1px solid var(--border-widget); border-top: 0; border-radius: 0 0 6px 6px; background: var(--bg-widget); box-shadow: var(--shadow); }
.quick input { display: block; width: calc(100% - 12px); height: 28px; margin: 0 6px 6px; padding: 0 6px; border: 1px solid #3c3c3c; border-radius: 3px; background: var(--bg-input); color: var(--fg-strong); font-size: 13px; user-select: text; }
.quick input:focus { border-color: var(--blue); outline: none; }
.quick-list { max-height: 330px; overflow-y: auto; padding-bottom: 6px; }
.quick-row { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 12px 0 14px; cursor: pointer; white-space: nowrap; }
.quick-row.selected { background: var(--list-active); color: #fff; }
.quick-row:hover:not(.selected) { background: var(--list-hover); }
.quick-row .row-icon { width: 16px; }
.quick-row .q-label { overflow: hidden; text-overflow: ellipsis; }
.quick-row .q-label b { color: #2aaaff; font-weight: 700; }
.quick-row .q-desc { margin-left: 8px; overflow: hidden; color: var(--fg-dim); font-size: 12px; text-overflow: ellipsis; }
.quick-row .q-key { margin-left: auto; padding-left: 12px; color: var(--fg-dim); font-size: 11px; }
.quick-empty { padding: 4px 14px; color: var(--fg-dim); }

.notifications { position: fixed; right: 8px; bottom: 30px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: 450px; max-width: calc(100vw - 16px); }
.toast { padding: 8px 8px 8px 12px; border: 1px solid var(--border-widget); border-radius: 4px; background: var(--bg-menu); box-shadow: var(--shadow); color: var(--fg); }
.toast-row { display: flex; align-items: flex-start; gap: 8px; }
.toast-icon { margin-top: 2px; font-size: 16px; }
.toast.info .toast-icon { color: #3794ff; }
.toast.error .toast-icon { color: #f14c4c; }
.toast.warning .toast-icon { color: #cca700; }
.toast-msg { flex: 1; line-height: 1.5; user-select: text; }
.toast-close { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--fg); opacity: 0.8; }
.toast-close:hover { background: rgb(90 93 94 / 0.31); opacity: 1; }
.toast-actions { display: flex; justify-content: flex-end; margin-top: 8px; }


.noscript { position: fixed; inset: 0; z-index: 200; margin: 0; padding: 24px; background: var(--bg-editor); }

/* ==========================================================================
   Telas estreitas: a barra lateral vira uma gaveta sobre o editor
   ========================================================================== */
/* ==========================================================================
   Modo leitura (celular e tablet): sem a interface da IDE, só a página do navegador interno.
   A mesma condição existe em js/main.js (LITE_QUERY).
   ========================================================================== */
@media (max-width: 800px), (pointer: coarse) and (max-width: 1024px) {
  .workbench { display: block; }
  .main, .editor-area, .browser { height: 100%; }
  .activitybar, .sidebar, .sash, .statusbar, .tabs-row, .breadcrumbs, .browser-bar, .editor-body, .quick, .notifications { display: none !important; }
  .browser { display: flex; }
  .titlebar { position: fixed; top: 10px; right: 10px; left: auto; z-index: 50; display: block; border: 0; background: transparent; }
  .tb-left, .tb-center, .tb-right > :not(.lang-switch):not(.page-switch) { display: none; }
  .titlebar .tb-right { gap: 8px; }
  .page-switch:not(:empty) { display: flex; gap: 2px; padding: 3px; border: 1px solid #232a3b; border-radius: 10px; background: rgb(15 18 25 / 0.85); backdrop-filter: blur(8px); }
  .page-switch button { padding: 3px 10px; border-radius: 7px; color: #98a2b8; font-size: 12px; }
  .page-switch button[aria-pressed="true"] { background: rgb(255 255 255 / 0.14); color: #fff; }
  .lang-switch { margin: 0; padding: 3px; border: 1px solid #232a3b; border-radius: 10px; background: rgb(15 18 25 / 0.85); backdrop-filter: blur(8px); }
}

/* ==========================================================================
   Navegador interno (Simple Browser)
   ========================================================================== */
.tab-action { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--fg); }
.tab-action:hover { background: rgb(90 93 94 / 0.31); }
.tab-action[hidden] { display: none; }
.tab-action .codicon { font-size: 16px; }
.row-icon.browser { color: #3794ff; }
.browser { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.browser[hidden] { display: none; }
.browser-bar { display: flex; flex: none; align-items: center; gap: 4px; height: 35px; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--bg-editor); }
.browser-url { flex: 1; min-width: 0; height: 24px; margin: 0 4px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: #313131; color: var(--fg); font: inherit; font-size: 13px; }
.browser-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #090b10; }
.editor-area.browsing .breadcrumbs, .editor-area.browsing .editor-body { display: none; }

/* Diálogo de confirmação */
dialog.modal { width: 450px; max-width: calc(100vw - 16px); margin: 10vh auto auto; padding: 0; border: 1px solid var(--border-widget); border-radius: 6px; background: var(--bg-menu); box-shadow: 0 0 20px rgb(0 0 0 / 0.5); color: var(--fg); }
dialog.modal::backdrop { background: rgb(0 0 0 / 0.4); }
.modal-body { display: flex; gap: 12px; padding: 20px 20px 12px; }
.modal-icon { color: #3794ff; font-size: 28px; }
.modal-title { margin-bottom: 8px; color: var(--fg-strong); font-size: 15px; font-weight: 600; }
.modal-detail { color: var(--fg); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 20px 20px; }
