/* ==========================================================================
   Devisate - folha de estilo unica
   Visual inspirado no Google Colab: muito branco, cinza claro e azul de acento.
   ========================================================================== */

:root {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-2: #f1f3f4;
  --border: #dadce0;
  --border-soft: #e8eaed;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-hover: #1765cc;
  --accent-soft: #e8f0fe;
  --green: #188038;
  --green-soft: #e6f4ea;
  --red: #d93025;
  --red-soft: #fce8e6;
  --amber: #f9ab00;
  --amber-soft: #fef7e0;
  --code-bg: #f8f9fa;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow-2: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --radius: 8px;
  --radius-sm: 4px;
  --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

/*
 * O atributo `hidden` tem display:none vindo do navegador, mas qualquer regra
 * de classe com `display` (como .btn e .row) venceria por especificidade. Sem
 * isso botoes marcados como hidden no HTML continuam aparecendo.
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------------------------------- botoes -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--red); border-color: var(--border); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-icon {
  padding: 6px;
  border: none;
  background: transparent;
  border-radius: 50%;
  line-height: 0;
  color: var(--muted);
  cursor: pointer;
}
.btn-icon:hover { background: var(--panel-2); color: var(--text); }

/* --------------------------------- campos --------------------------------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* --------------------------------- cartoes -------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
}
.card h2, .card h3 { margin: 0 0 12px; font-weight: 500; }
.card h2 { font-size: 17px; }
.card h3 { font-size: 15px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  background: var(--panel-2);
  color: var(--muted);
}
.badge-ok { background: var(--green-soft); color: var(--green); }
.badge-off { background: var(--panel-2); color: var(--muted); }
.badge-warn { background: var(--amber-soft); color: #a05a00; }
.badge-err { background: var(--red-soft); color: var(--red); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-ok { background: var(--green); }
.dot-warn { background: var(--amber); }
.dot-err { background: var(--red); }

/* --------------------------------- alertas -------------------------------- */

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  margin-bottom: 14px;
}
.alert-error { background: var(--red-soft); color: #a50e0e; border-color: #f5c6c2; }
.alert-ok { background: var(--green-soft); color: #0d652d; border-color: #ceead6; }
.alert-info { background: var(--accent-soft); color: #174ea6; border-color: #d2e3fc; }
.alert-warn { background: var(--amber-soft); color: #8a5300; border-color: #feefc3; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a73e8, #188038);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); }

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

.page { max-width: 1180px; margin: 0 auto; padding: 24px 18px 60px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 400; margin: 0; }

/* ============================== tela de login ============================= */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, #e8f0fe 0%, #f8f9fa 45%, #e6f4ea 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 34px 30px;
}
.login-card h1 { font-size: 22px; font-weight: 400; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-foot { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }

/* ============================== lista de cadernos ========================= */

.nb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.nb-item {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s, border-color .15s;
}
.nb-item:hover { box-shadow: var(--shadow-1); border-color: var(--border); }
.nb-item .title { font-weight: 500; font-size: 15px; }
.nb-item .meta { font-size: 12px; color: var(--muted); }
.nb-item .actions { display: flex; gap: 6px; margin-top: 4px; }
.nb-item .open { flex: 1; text-align: center; justify-content: center; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .value { font-size: 24px; font-weight: 400; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* ================================ tabelas ================================= */

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border-soft); }
table.tbl th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  font-weight: 500;
}
table.tbl tbody tr:hover { background: var(--bg); }
table.tbl td.actions { white-space: nowrap; }

/* ============================== modal simples ============================= */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, .5);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}
.modal h2 { margin: 0 0 16px; font-size: 18px; font-weight: 500; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ============================= editor de caderno ========================== */

.editor-body {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: calc(100vh - 58px);
  overflow: hidden;
}
/*
 * Com a barra lateral oculta o painel do caderno vira o primeiro item do grid,
 * entao a coluna reservada a ela precisa sair de cena (0 1fr faria o caderno
 * ocupar a coluna de largura zero).
 */
.editor-body.sidebar-hidden { grid-template-columns: 1fr; }
.editor-body.sidebar-hidden .sidebar { display: none; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-head strong { font-weight: 500; font-size: 14px; flex: 1; }
.sidebar-scroll { overflow: auto; flex: 1; padding: 8px; }

.file-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  word-break: break-all;
}
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.file-list li:hover { background: var(--panel-2); }
.file-list li.active { background: var(--accent-soft); }
.file-list li .ico { width: 16px; text-align: center; flex: none; opacity: .75; }
.file-list li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .sz { font-size: 11px; color: var(--muted); flex: none; }

.notebook-pane { overflow: auto; padding: 16px 0 120px; }
.notebook-inner { max-width: 980px; margin: 0 auto; padding: 0 16px; }

.nb-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.nb-title {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  min-width: 180px;
  max-width: 340px;
}
.nb-title:hover { background: var(--panel-2); }
.nb-title:focus { background: #fff; border-color: var(--accent); outline: none; }
.toolbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* ------------------------------- celulas --------------------------------- */

.cell {
  position: relative;
  margin: 8px 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: border-color .12s;
}
.cell:hover { border-color: var(--border-soft); }
.cell.selected,
.cell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cell.running { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }

.cell-row { display: flex; align-items: stretch; }

.prompt {
  width: 78px;
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}
.prompt .run-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  padding: 0 2px;
  line-height: 1;
  font-size: 13px;
  border-radius: 3px;
}
.prompt .run-btn:hover { background: var(--accent-soft); }
.prompt .count { min-width: 30px; text-align: right; }
.prompt .count.busy { color: var(--amber); }

.cell-main { flex: 1; min-width: 0; padding: 8px 8px 8px 0; }

.cell-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel);
}
.cell-editor .cm-editor { min-height: 40px; }
.cell-editor .cm-scroller { font-family: var(--mono); font-size: 13px; }
.cell textarea.cell-textarea {
  width: 100%;
  min-height: 44px;
  border: none;
  outline: none;
  resize: vertical;
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 13px;
  background: transparent;
  line-height: 1.55;
}

/* ferramentas de cada celula */
.cell-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity .12s;
}
.cell:hover .cell-tools,
.cell.selected .cell-tools,
.cell:focus-within .cell-tools { opacity: 1; }
.cell-tools .cell-lang {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 11.5px;
  padding: 2px 6px;
  color: var(--muted);
  cursor: pointer;
}

/* Entradas do input(): os valores que o programa vai ler, um por linha. */
.cell-stdin {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}
.cell-stdin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
}
.cell-stdin-head span { flex: 1; }
.cell-stdin-head code {
  font-family: var(--mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 4px;
  border-radius: var(--radius-sm);
}
.cell-stdin-area {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  padding: 8px 10px;
  min-height: 46px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  resize: vertical;
}
.cell-stdin-area:focus { outline: none; background: var(--panel); }

/* Enquanto o campo de entradas esta aberto, as ferramentas ficam visiveis:
   escondidas, o botao "Entradas" sairia junto com elas. */
.cell:has(.cell-stdin:not([hidden])) .cell-tools { opacity: 1; }
.cell-tools [data-acao="stdin"].ativo {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* markdown */
.cell-md-rendered {
  padding: 6px 12px;
  cursor: text;
  min-height: 34px;
}.cell-md-rendered h1, .cell-md-rendered h2, .cell-md-rendered h3 { margin: 12px 0 8px; }
.cell-md-rendered p { margin: 8px 0; }
.cell-md-rendered code {
  background: var(--panel-2);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.cell-md-rendered pre { background: var(--code-bg); padding: 12px; border-radius: var(--radius-sm); overflow: auto; }
.cell-md-rendered pre code { background: none; padding: 0; }
.cell-md-rendered ul, .cell-md-rendered ol { padding-left: 24px; margin: 8px 0; }
.cell-md-rendered table { border-collapse: collapse; }
.cell-md-rendered th, .cell-md-rendered td { border: 1px solid var(--border); padding: 5px 9px; }
.cell-md-rendered blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.md-placeholder { color: #9aa0a6; font-style: italic; }

/* saidas */
.cell-output {
  margin-top: 8px;
  border-left: 3px solid var(--border-soft);
  padding-left: 10px;
}
.cell-output:empty { display: none; }
.out-stream {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 3px 0;
  color: var(--text);
}
.out-stderr { color: var(--red); background: var(--red-soft); padding: 7px 9px; border-radius: var(--radius-sm); }
.out-result {
  background: var(--code-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 3px 0;
}
.out-html { margin: 6px 0; overflow-x: auto; }
.out-html table { border-collapse: collapse; font-size: 12.5px; }
.out-html th, .out-html td { border: 1px solid var(--border); padding: 4px 8px; }
.out-html img { max-width: 100%; }

/* Resultado do console SQL. */
.sql-tabela { border-collapse: collapse; font-size: 12.5px; font-family: var(--mono); }
.sql-tabela th {
  background: var(--code-bg);
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 8px;
}
.sql-tabela td {
  border: 1px solid var(--border-soft);
  padding: 4px 8px;
  white-space: pre-wrap;
}
.sql-tabela tbody tr:nth-child(even) { background: var(--bg); }
.sql-tabela .sql-nulo { color: var(--muted); font-style: italic; }
.out-image { margin: 6px 0; }
.out-image img { max-width: 100%; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.out-error {
  background: var(--red-soft);
  border: 1px solid #f5c6c2;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #a50e0e;
  margin: 3px 0;
}
.out-meta { font-size: 11px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }
.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid var(--amber);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* barra de estado do kernel */
.kernel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  position: fixed;
  bottom: 0;
  left: 264px;
  right: 0;
  z-index: 30;
  transition: left .2s;
}
.editor-body.sidebar-hidden ~ .kernel-bar { left: 0; }
.kernel-bar .spacer { flex: 1; }
.kernel-bar strong { color: var(--text); font-weight: 500; }

/* ============================== console rapido ============================ */

.console-out {
  background: #202124;
  color: #e8eaed;
  font-family: var(--mono);
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 90px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.console-out .err { color: #f28b82; }

/* Dentro do console (fundo escuro) a tabela precisa de cores proprias: as
   classes .sql-tabela foram feitas para o fundo claro do caderno. */
.console-out table { white-space: normal; margin: 6px 0; }
.console-out th,
.console-out td {
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 4px 8px;
}
.console-out th { background: rgba(255, 255, 255, .08); color: #bdc1c6; }
.console-out tr:nth-child(even) td { background: rgba(255, 255, 255, .04); }
.console-out .sql-nulo { color: #9aa0a6; }

/* =============================== atividades ============================== */

.activity-banner {
  max-width: 980px;
  margin: 14px auto 0;
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid #d2e3fc;
  border-radius: var(--radius);
}
.activity-banner .alert { margin-bottom: 0; }

/* Enunciado em Markdown */
.statement {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  line-height: 1.6;
  min-height: 80px;
  overflow-wrap: anywhere;
}
.statement h1, .statement h2, .statement h3, .statement h4 { margin: 14px 0 8px; }
.statement h1 { font-size: 20px; }
.statement h2 { font-size: 17px; }
.statement h3 { font-size: 15px; }
.statement p { margin: 8px 0; }
.statement code {
  background: var(--panel-2);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.statement pre {
  background: var(--code-bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow: auto;
}
.statement pre code { background: none; padding: 0; }
.statement ul, .statement ol { padding-left: 24px; margin: 8px 0; }
.statement blockquote {
  margin: 8px 0;
  padding-left: 12px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.statement hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md-vazio { color: #9aa0a6; font-style: italic; }

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1040px) {
  .activity-layout { grid-template-columns: 1fr; }
}

/* Celulas de uma entrega, em modo leitura */
.readonly-cells {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 6px 14px;
  max-height: 520px;
  overflow: auto;
}
.readonly-cell { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.readonly-cell:last-child { border-bottom: none; }
.readonly-cell .src {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.readonly-cell .rotulo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Formulario de correcao */
.grade-box { background: var(--panel-2); border-radius: var(--radius-sm); padding: 14px; }
.grade-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* Etiqueta de pendencia no painel */
.pend-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--amber-soft);
  color: #8a5300;
}

/* ================================ prova ================================== */

.exam-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 30;
  flex-wrap: wrap;
}
.exam-page { max-width: 860px; }

.opcoes { display: flex; flex-direction: column; gap: 6px; }
.opcao {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.opcao:hover { background: var(--bg); border-color: var(--border); }
.opcao input { margin-top: 3px; }
.opcao .letra { font-family: var(--mono); color: var(--muted); flex: none; }
.opcao:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }

.questao .statement h1, .questao .statement h2, .questao .statement h3 { font-size: 15px; }

/* ================================ diversos ================================ */

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .5; }

.toast-host {
  position: fixed;
  /* Acima da barra do kernel, para nao cobrir o contador de ociosidade. */
  bottom: 64px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #202124;
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  max-width: 380px;
  animation: slide-in .2s ease-out;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ============================== responsivo =============================== */

@media (max-width: 880px) {
  .editor-body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 58px; bottom: 0;
    width: 264px;
    z-index: 35;
    box-shadow: var(--shadow-2);
  }
  .kernel-bar { left: 0; }
  .prompt { width: 54px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
