/* OST Saver — interface (local e web)
   Paleta Ingegno Labs: quase-preto sobre papel claro, botões pretos, detalhes em bege.
   As cores do mapa seguem a lógica de um perfil litológico: dados = areia, comprimido = oliva,
   estrutura = folhelho, índices = tons de petróleo, mapas de alocação = violeta, livre = vazio. */

:root {
  color-scheme: light dark;
  --paper: #F8F7F4;
  --surface: #FFFFFF;
  --sunken: #EFECE5;
  --ink: #1A1A1A;
  --ink-2: #4A4946;
  --ink-3: #6B6A66;
  --line: #E3DFD6;
  --line-strong: #C9C3B6;
  --accent: #1A1A1A;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECE8DE;
  --warn: #9A6414;
  --warn-soft: #FBF1DF;
  --error: #B83A2E;
  --error-soft: #F9E5E2;
  --ok: #2E7D4F;
  --ok-soft: #E2F2E8;

  --map-free: #E8E4DB;
  --map-header: #1A1A1A;
  --map-maps: #8A6FB0;
  --map-nbt: #0E6B74;
  --map-bbt: #5FA9AE;
  --map-data: #C9A227;
  --map-struct: #9C5B3B;
  --map-comp: #7D8F3A;

  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --ui-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 6px;
  --topbar: 52px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161614;
    --surface: #1E1E1B;
    --sunken: #10100E;
    --ink: #F2F0EA;
    --ink-2: #BDB9AF;
    --ink-3: #8E8A80;
    --line: #2E2D29;
    --line-strong: #45433D;
    --accent: #F2F0EA;
    --accent-ink: #161614;
    --accent-soft: #2A2823;
    --warn: #E0A54A;
    --warn-soft: #2E2414;
    --error: #EE7A6C;
    --error-soft: #3A1E1A;
    --ok: #6CC38F;
    --ok-soft: #16301F;
    --map-free: #222B35;
    --map-header: #F2F0EA;
    --map-nbt: #4DB3BB;
    --map-bbt: #2E7F86;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: var(--topbar) 1fr;
  overflow: hidden;
}

h1, h2, h3 { font-family: var(--ui-display); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 15px; }
p { margin: 0; }
.lede { color: var(--ink-2); max-width: 68ch; margin-top: 8px; font-size: 15px; }
.mono, code { font-family: var(--mono); font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------------------------------------------------------------- botões e campos */

.btn {
  font: inherit; font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  padding: 7px 14px; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); background: var(--sunken); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

input[type=text] {
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 8px 10px; width: 100%;
}
input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[readonly] { background: var(--sunken); color: var(--ink-2); }

/* ---------------------------------------------------------------- barra superior */

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 14px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--ui-display); font-weight: 650; font-size: 15px; }
.current-file { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; border-left: 1px solid var(--line); padding-left: 18px; }
.file-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36ch; }
.file-facts { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

.modes { display: flex; gap: 2px; margin-left: 8px; align-self: stretch; }
.modes a {
  display: flex; align-items: center; padding: 0 12px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.modes a:hover { color: var(--ink); }
.modes a[aria-current=page] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; gap: 4px; }

main { min-height: 0; overflow: hidden; }
.view { height: 100%; }

/* ---------------------------------------------------------------- tela inicial */

.view-start {
  display: grid; grid-template-rows: auto 1fr;
  max-width: 1120px; margin: 0 auto; padding: 40px 32px 24px;
  gap: 28px; overflow: hidden;
}
.path-form { display: flex; gap: 8px; margin-top: 20px; max-width: 760px; }
.path-form input { font-family: var(--mono); font-size: 13px; }
.form-error { color: var(--error); margin-top: 10px; max-width: 760px; }

.start-body { display: grid; grid-template-columns: 250px 1fr; gap: 24px; min-height: 0; }
.places { overflow: auto; }
.places-group + .places-group { margin-top: 22px; }
.places h2 { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.places ul, .browser-list { list-style: none; margin: 0; padding: 0; }
.place {
  display: flex; align-items: center; gap: 8px; width: 100%;
  font: inherit; color: var(--ink); text-align: left;
  background: none; border: 0; padding: 6px 8px; border-radius: var(--radius); cursor: pointer;
}
.place svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.place:hover { background: var(--sunken); }
.place .sub { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.place.recent { flex-direction: column; align-items: flex-start; gap: 0; }
.place.recent .path { color: var(--ink-3); font-size: 12px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.browser {
  display: grid; grid-template-rows: auto 1fr auto; min-height: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.browser-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.browser-path { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.browser-list { overflow: auto; padding: 4px; }
.entry {
  display: grid; grid-template-columns: 18px 1fr auto auto; align-items: center; gap: 10px;
  width: 100%; font: inherit; color: var(--ink); text-align: left;
  background: none; border: 0; border-radius: var(--radius); padding: 7px 10px; cursor: pointer;
}
.entry:hover { background: var(--sunken); }
.entry svg { width: 16px; height: 16px; color: var(--ink-3); }
.entry.mailbox { font-weight: 600; }
.entry.mailbox svg { color: var(--accent); }
.entry .meta { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.entry .kind { font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px; }
.browser-note { color: var(--ink-3); font-size: 12px; padding: 8px 12px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- explorar */

.view-explore {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(300px, 400px) 1fr;
  min-height: 0;
}
.pane { min-height: 0; overflow: hidden; border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }

.folders { background: var(--paper); overflow: auto; padding: 8px 6px 20px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 14px; }
.node-row {
  display: grid; grid-template-columns: 16px 16px 1fr auto; align-items: center; gap: 4px;
  width: 100%; font: inherit; color: var(--ink); text-align: left;
  background: none; border: 0; border-radius: 5px; padding: 4px 6px 4px 2px; cursor: pointer;
}
.node-row:hover { background: var(--sunken); }
.node-row[aria-selected=true] { background: var(--accent-soft); color: var(--ink); }
.node-row[aria-selected=true] .n-icon { color: var(--accent); }
.node-row .twisty { width: 16px; height: 16px; color: var(--ink-3); transition: transform .12s; }
.node-row .twisty.open { transform: rotate(90deg); }
.node-row .twisty.none { visibility: hidden; }
.node-row .n-icon { width: 15px; height: 15px; color: var(--ink-3); }
.node-row .n-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-row.unread .n-name { font-weight: 650; }
.node-row.search .n-name { color: var(--ink-2); font-style: italic; }
.node-row .n-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.node-row.unread .n-count { color: var(--accent); font-weight: 650; }
.node-row.broken .n-name { color: var(--error); }

.messages { display: grid; grid-template-rows: auto 1fr; background: var(--surface); }
.pane-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.pane-head h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head .count { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.msg-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.msg {
  display: grid; grid-template-columns: 1fr auto; gap: 1px 10px;
  padding: 9px 16px 10px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative;
}
.msg:hover { background: var(--paper); }
.msg[aria-selected=true] { background: var(--accent-soft); }
.msg[aria-selected=true]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.msg .from { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .date { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg .subject { color: var(--ink-2); grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.msg .subject svg { width: 13px; height: 13px; flex: none; color: var(--ink-3); }
.msg.unread .from, .msg.unread .subject { font-weight: 650; color: var(--ink); }
.msg.unread::after { content: ""; position: absolute; left: 7px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.msg .cls { color: var(--ink-3); font-size: 11.5px; }
.msg-more { padding: 14px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.empty { color: var(--ink-3); padding: 24px 16px; }
.reader { background: var(--surface); display: flex; flex-direction: column; overflow: hidden; }
.reader-empty { margin: auto; }
.reader-content { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.msg-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.msg-head h2 { font-size: 20px; line-height: 1.3; margin-bottom: 10px; overflow-wrap: anywhere; }
.msg-from strong { font-weight: 600; }
.msg-from span { color: var(--ink-2); }
.msg-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: 13px; }
.msg-meta dt { color: var(--ink-3); }
.msg-meta dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.attachments { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.attachments a {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 4px 10px; color: var(--ink); text-decoration: none; font-size: 13px; background: var(--paper);
}
.attachments a:hover { border-color: var(--accent); }
.attachments svg { width: 14px; height: 14px; color: var(--ink-3); }
.attachments .size { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.attachments .nolink { opacity: .6; cursor: default; }

.tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs button {
  font: inherit; color: var(--ink-2); background: none; border: 0;
  padding: 9px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { flex: 1; min-height: 0; overflow: auto; }
#bodyFrame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.body-text { margin: 0; padding: 20px 24px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 var(--ui); max-width: 90ch; }

table.props { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.props th { position: sticky; top: 0; background: var(--surface); text-align: left; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.props td { padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.props td:first-child, .props td:nth-child(3) { font-family: var(--mono); white-space: nowrap; color: var(--ink-2); }
.props td:last-child { overflow-wrap: anywhere; word-break: break-word; font-family: var(--mono); font-size: 12px; }
.props tr.error td { color: var(--error); }

/* ---------------------------------------------------------------- mapa */

.view-map { overflow: auto; padding: 32px 32px 40px; }
.map-head { max-width: 1240px; margin: 0 auto 22px; }
.map-layout { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.map-figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px 18px 14px; }
.map-canvas-wrap { position: relative; }
#mapCanvas { width: 100%; display: block; cursor: crosshair; }
.map-figure figcaption { color: var(--ink-3); font-size: 12.5px; margin-top: 10px; }
.map-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--paper); border-radius: 6px;
  padding: 8px 10px; font-size: 12px; line-height: 1.5; min-width: 200px;
  box-shadow: 0 6px 20px rgba(15, 25, 35, .25);
}
.map-tip .off { font-family: var(--mono); font-size: 11.5px; opacity: .8; display: block; margin-bottom: 4px; }
.map-tip .row { display: flex; align-items: center; gap: 6px; }
.map-tip .row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.legend { width: 100%; border-collapse: collapse; font-size: 13px; }
.legend td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.legend td:nth-child(2) { padding-left: 8px; }
.legend td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; padding-left: 10px; }
.legend .what { color: var(--ink-3); font-size: 12px; display: block; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.swatch.free { box-shadow: inset 0 0 0 1px var(--line-strong); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 22px 0 0; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts .bad { color: var(--error); font-weight: 600; }
.facts .good { color: var(--ok); }
.loading { text-align: center; color: var(--ink-3); padding: 30px; }

/* ---------------------------------------------------------------- verificar */

.view-verify { overflow: auto; padding: 32px; }
.verify-head, .verify-result { max-width: 1040px; margin: 0 auto; }
.verify-head .btn { margin-top: 18px; }
.verify-result { margin-top: 28px; }
.verdict { font-family: var(--ui-display); font-size: 20px; font-weight: 600; padding: 14px 16px; border-radius: 8px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.verdict.error { background: var(--error-soft); color: var(--error); }
.verdict.info { background: var(--sunken); color: var(--ink-2); }
.verify-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin-top: 22px; align-items: start; }
.verify-grid h2 { margin-bottom: 8px; }
.findings { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.findings li { display: grid; grid-template-columns: 64px 150px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.findings .sev { font-weight: 650; font-size: 12px; }
.findings .sev.error { color: var(--error); }
.findings .sev.warning { color: var(--warn); }
.findings .sev.info { color: var(--ink-3); }
.findings code { color: var(--ink-2); }
.findings .none { grid-template-columns: 1fr; color: var(--ink-3); }

/* ---------------------------------------------------------------- converter */

.view-convert { overflow: auto; padding: 32px; }
.convert-col { max-width: 680px; margin: 0 auto; }
.convert-col h2 { font-size: 18px; margin-bottom: 6px; }
.convert-col > p { color: var(--ink-2); }
.stack { display: grid; gap: 14px; margin-top: 20px; justify-items: start; }
.stack label { display: grid; gap: 6px; width: 100%; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.stack label input { font-weight: 400; }
#convDest, #emptyPath, #convSource { font-family: var(--mono); font-size: 13px; }
.note { color: var(--ink-2); font-size: 13px; background: var(--sunken); border-left: 3px solid var(--line-strong); padding: 10px 12px; border-radius: 0 6px 6px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0 28px; }
.merge { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 14px; width: 100%; display: grid; gap: 10px; justify-items: start; margin: 0; }
.merge legend { font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 0 4px; }
.opt { font-weight: 400; color: var(--ink-3); }
.merge-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; width: 100%; }
.merge-list:empty { display: none; }
.merge-list li { font-size: 13px; }
.merge-list .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.merge-list .row span { overflow-wrap: anywhere; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; }
.hint { color: var(--ink-3); font-size: 12px; margin: 0; }
.stack label.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 400; color: var(--ink); }
.stack label.inline input { width: 90px; text-align: right; }
input[type=number] { font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.pick-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); color: var(--ink); padding: 10px 12px; border-radius: 6px; margin-top: 14px; max-width: 760px; }
.stack label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; color: var(--ink); }
.stack label.check input { margin-top: 3px; accent-color: var(--accent); }
.conv-progress, .conv-result { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; gap: 10px; justify-items: start; }
.conv-phase { display: flex; justify-content: space-between; width: 100%; gap: 12px; }
.conv-phase span, .conv-counts { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar { width: 100%; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.bar.indeterminate span { width: 30%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { margin-left: -30%; } to { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bar.indeterminate span { animation: none; width: 100%; opacity: .5; } }
.conv-result h2 { margin: 0; }
.conv-result .facts { margin-top: 4px; width: 100%; }
.conv-result details { font-size: 13px; width: 100%; }
.conv-result details li { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; overflow-wrap: anywhere; }
.conv-result .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-result { font-size: 13px; padding: 10px 12px; border-radius: 6px; width: 100%; }
.form-result.ok { background: var(--ok-soft); color: var(--ok); }
.form-result.error { background: var(--error-soft); color: var(--error); }

/* ---------------------------------------------------------------- avisos */

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  max-width: min(640px, calc(100vw - 32px));
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(15, 25, 35, .3); z-index: 10;
}
.toast.error { background: var(--error); color: #fff; }

/* ---------------------------------------------------------------- telas menores */

.narrow-only { display: none; }
.msg-head .back { margin: -6px 0 8px -10px; }

@media (max-width: 1100px) {
  .view-explore { grid-template-columns: 220px 1fr; }
  .view-explore .reader { display: none; }
  .msg-head .narrow-only { display: inline-block; }
  .view-explore.reading .messages { display: none; }
  .view-explore.reading .reader { display: flex; }
  .map-layout, .verify-grid { grid-template-columns: 1fr; }
  .file-facts { display: none; }
}
@media (max-width: 760px) {
  body { grid-template-rows: auto 1fr; }
  .topbar { flex-wrap: wrap; padding: 8px 16px; gap: 8px 14px; }
  .modes { order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
  .modes a { padding: 8px 10px; }
  .current-file { display: none; }
  .view-start { padding: 24px 16px; }
  .start-body { grid-template-columns: 1fr; overflow: auto; }
  .path-form { flex-direction: column; }
  .view-explore { grid-template-columns: 1fr; }
  .view-explore .folders { display: none; }
  .view-explore.folders-open .folders { display: block; }
  .view-explore.folders-open .messages, .view-explore.folders-open .reader { display: none; }
  .pane-head .narrow-only { display: inline-block; margin-left: -10px; }
  .view-map, .view-verify, .view-convert { padding: 20px 16px; }
  .findings li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.small-btn { padding: 4px 10px; font-size: 12.5px; min-height: 0; }
.pane-head .small-btn { margin-left: auto; white-space: nowrap; }
.msg-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ==== Tema Ingegno Labs (padrão do hub) — acrescentado pelo montar_site.py; não edite no web-pronto ==== */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/plex-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/plex-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "JBMono"; src: url("/fonts/mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --paper: #F3EEE4; --surface: #FBF8F2; --sunken: #ECE5D7;
  --ink: #1E2732; --ink-2: #4A535E; --ink-3: #6E737A; --line: #DDD5C6; --line-strong: #C4BAA6;
  --accent: #1E2732; --accent-ink: #F3EEE4; --accent-soft: #ECE5D7;
  --ok: #2B7049; --ok-soft: #E1EEE4; --warn: #9C5A0C; --warn-soft: #F7E9D2;
  --map-free: #E6DECF; --map-header: #1E2732;
  --ui: "Plex", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JBMono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141A21; --surface: #1B232C; --sunken: #10151B;
    --ink: #EDE6D8; --ink-2: #C3BBAD; --ink-3: #969089; --line: #2E3741; --line-strong: #3D4854;
    --accent: #EDE6D8; --accent-ink: #141A21; --accent-soft: #232C36;
    --ok: #74C493; --ok-soft: #17301F; --warn: #E3A955; --warn-soft: #33260F;
    --map-free: #232C36; --map-header: #EDE6D8;
  }
}
.brand { gap: 8px; color: var(--ink); text-decoration: none; font: italic 600 19px/1 "Fraunces", Georgia, serif; letter-spacing: -0.01em; }
.brand .moka { width: 17px; height: 21px; flex: none; }
.brand small { font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); }
@media (max-width: 560px) { .brand small { display: none; } }
h1, h2 { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 600; letter-spacing: -0.01em; }
.brand { min-height: 32px; }
