/* VM//PANEL - retro minimalista: fundo escuro, uma cor de destaque, fonte pixel so nos titulos */
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #101218;
  --bg-2: #161921;
  --panel: #1c202a;
  --panel-2: #272c38;
  --ink: #0a0b0f;
  --line: #2a2f3c;
  --text: #e8e6e3;
  --muted: #8d95a8;
  --dim: #565e72;
  --accent: #ffcd75;
  --accent-2: #6cb6ff;
  --ok: #7bd88f;
  --ok-2: #7bd88f;
  --warn: #f4b860;
  --crit: #ff6b6b;
  --magic: #73d7ef;
  --chart-bg: #12151c;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --num: "VT323", ui-monospace, monospace;
  --body: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
}
:root[data-theme="gameboy"] {
  --bg: #0e1a0e; --bg-2: #142314; --panel: #1b2e1b; --panel-2: #26402a; --ink: #071007; --line: #2c4a2c;
  --text: #e0f8d0; --muted: #9bbc0f; --dim: #5a7a2a; --accent: #c4e86a; --accent-2: #9bbc0f;
  --ok: #c4e86a; --ok-2: #c4e86a; --warn: #e0c060; --crit: #ff8a6a; --magic: #c4e86a; --chart-bg: #102010;
}
:root[data-theme="arcade"] {
  --bg: #07070d; --bg-2: #0e0e18; --panel: #15152a; --panel-2: #20203c; --ink: #000; --line: #2a2a4a;
  --text: #f4f4ff; --muted: #9a9ad0; --dim: #555580; --accent: #ff2e88; --accent-2: #00e5ff;
  --ok: #00ff9c; --ok-2: #00ff9c; --warn: #ffe600; --crit: #ff4d6d; --magic: #00e5ff; --chart-bg: #0a0a14;
}
:root[data-theme="nes"] {
  --bg: #161616; --bg-2: #1e1e1e; --panel: #262626; --panel-2: #333; --ink: #000; --line: #3a3a3a;
  --text: #fcfcfc; --muted: #bcbcbc; --dim: #7c7c7c; --accent: #f8b800; --accent-2: #3cbcfc;
  --ok: #b8f818; --ok-2: #b8f818; --warn: #f87858; --crit: #e40058; --magic: #3cbcfc; --chart-bg: #121212;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--body);
  font-size: 14px; line-height: 1.5; min-height: 100vh;
}
::selection { background: var(--accent); color: var(--ink); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; color: var(--accent); overflow-wrap: anywhere; }
.px { font-family: var(--pixel); letter-spacing: 0; }

body.crt::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,.16) 50%); background-size: 100% 3px;
}

/* ---------- estrutura ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 28px 56px; }
header.hud { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 22px 0 18px; }
.logo { font-family: var(--pixel); font-size: 16px; font-weight: normal; color: var(--accent); margin: 0; white-space: nowrap; }
.logo small { display: block; font-family: var(--body); font-size: 12px; color: var(--muted); margin-top: 8px; letter-spacing: .5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1; min-width: 240px; }
.chip { color: var(--muted); font-size: 13px; white-space: nowrap; }
.chip b { color: var(--dim); font-weight: 500; margin-right: 2px; }
.hud-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.clock { font-family: var(--num); font-size: 26px; line-height: 1; text-align: right; margin-left: 8px; }
.clock small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); margin-top: 2px; }

nav.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
nav.tabs button {
  font-family: var(--pixel); font-size: 9px; color: var(--muted); background: none; border: 0;
  padding: 14px 14px 13px; cursor: pointer; letter-spacing: .5px; box-shadow: inset 0 -2px 0 transparent;
}
nav.tabs button .k { color: var(--dim); margin-right: 6px; }
nav.tabs button:hover, nav.tabs button:focus-visible { color: var(--text); outline: none; }
nav.tabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
nav.tabs button.on .k { color: var(--accent); }

/* topicos: titulo pequeno em pixel + linha */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.section-head h3 { font-family: var(--pixel); font-size: 10px; font-weight: normal; color: var(--accent); margin: 0; letter-spacing: 1px; white-space: nowrap; }
.section-head .hint { color: var(--dim); font-size: 12px; white-space: nowrap; }
.section-head i { flex: 1; height: 1px; background: var(--line); }

#view > div > .grid, #view > div > .box, #view > div > form { margin-top: 22px; display: block; }
#view > div > .grid { display: grid; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); }
.span2 { grid-column: span 2; }
.full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .span2 { grid-column: auto; } .grid.wide { grid-template-columns: 1fr; } }

/* cartoes */
.box { background: var(--bg-2); border: 1px solid var(--line); padding: 18px; position: relative; min-width: 0; }
.box > h2 {
  font-family: var(--pixel); font-size: 8px; font-weight: normal; color: var(--muted); letter-spacing: 1.5px;
  margin: 0 0 16px; display: flex; align-items: center; gap: 8px; line-height: 1.6;
}
.box > h2::before { content: ""; width: 6px; height: 6px; background: var(--accent); flex: 0 0 auto; }

/* resumo (KPIs) */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { background: var(--bg-2); border: 1px solid var(--line); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { color: var(--muted); }
.kpi .v { font-family: var(--num); font-size: 44px; line-height: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v small { font-size: 26px; color: var(--muted); }
.kpi .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .hp { margin-top: 4px; }
button.kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.kpi:hover { border-color: var(--dim); }

.big { font-family: var(--num); font-size: 42px; line-height: 1; }
.mid { font-family: var(--num); font-size: 26px; line-height: 1.1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.ok { color: var(--ok); }
.warn { color: var(--warn) !important; }
.crit { color: var(--crit) !important; }
.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: .25 } }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row > :last-child { text-align: right; }
.stack > * + * { margin-top: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { overflow-wrap: anywhere; }
.label { font-family: var(--pixel); font-size: 7px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; line-height: 1.6; }
.sep { border: 0; border-top: 1px dashed var(--line); margin: 14px 0; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12px; list-style: none; }
details.more summary::before { content: "▸ "; color: var(--accent); }
details.more[open] summary::before { content: "▾ "; }
details.more[open] summary { margin-bottom: 10px; }

/* barras (segmentadas, retro discreto) */
.hp { position: relative; height: 8px; background: var(--panel-2); }
.hp > i { display: block; height: 100%; background: var(--ok); transition: width .5s steps(10); }
.hp::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, var(--bg-2) 6px 8px); }
.hp.warn > i { background: var(--warn); }
.hp.crit > i { background: var(--crit); }
.hp.sm { height: 6px; }
.stat { display: grid; grid-template-columns: 56px 1fr 62px; gap: 12px; align-items: center; }
.stat .label { color: var(--text); }
.stat .val { font-family: var(--num); font-size: 20px; line-height: 1; text-align: right; }
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 16px; }
.cores .stat { grid-template-columns: 30px 1fr 40px; gap: 8px; }
.cores .val { font-size: 17px; }
canvas.spark { width: 100%; height: 56px; display: block; margin: 4px 0 12px; image-rendering: pixelated; }
canvas.chart { width: 100%; height: 190px; display: block; image-rendering: pixelated; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin: -4px 0 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }

/* tabelas */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-family: var(--pixel); font-size: 7px; font-weight: normal; color: var(--muted); background: none; padding: 8px 10px 10px; white-space: nowrap; letter-spacing: 1px; border-bottom: 1px solid var(--line); }
th.sort { cursor: pointer; }
th.sort:hover { color: var(--accent); }
td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.025); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.cmd { font-size: 12.5px; color: var(--muted); max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name { font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .name { font-weight: 500; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }

/* botoes */
.btn, input, select, textarea { font-family: var(--body); font-size: 14px; color: var(--text); }
.btn {
  font-family: var(--pixel); font-size: 8px; background: none; border: 1px solid var(--line);
  padding: 9px 12px; cursor: pointer; color: var(--text); white-space: nowrap; letter-spacing: 1px; line-height: 1.4;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.btn:active { transform: translateY(1px); }
.btn.gold { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn.gold:hover { filter: brightness(1.1); color: var(--ink); }
.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.btn.danger:hover { background: var(--crit); color: var(--ink); border-color: var(--crit); }
.btn.small { font-size: 7px; padding: 6px 8px; }
.btn:disabled { opacity: .45; cursor: wait; }
.btn .badge-new { background: var(--crit); color: var(--ink); padding: 2px 4px; margin-left: 6px; }
input, select, textarea { background: var(--ink); border: 1px solid var(--line); padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 4px; }
.box .toolbar, .modal .toolbar { margin: 0 0 14px; }
label.f { display: grid; gap: 6px; margin-bottom: 14px; }
label.f span { color: var(--muted); font-size: 13px; }
label.chk { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; cursor: pointer; }
label.chk input { width: 16px; height: 16px; accent-color: var(--accent); }

.tag { display: inline-block; font-family: var(--pixel); font-size: 7px; padding: 4px 6px 3px; border: 1px solid currentColor; letter-spacing: .5px; line-height: 1.4; }
.tag.run { color: var(--ok); }
.tag.stop { color: var(--crit); }
.tag.other { color: var(--warn); }
.tag.info { color: var(--accent-2); }

pre.logs {
  font-family: var(--mono); font-size: 12px; line-height: 1.5; background: var(--ink); color: #cfd6df; border: 1px solid var(--line);
  padding: 12px; margin: 0; max-height: 64vh; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

/* manutencao */
label.chk.inline { margin: 0; align-items: flex-start; }
label.chk.inline input { margin-top: 2px; flex: 0 0 auto; }
label.chk.inline .tag { margin-left: 8px; }
.jobsteps { margin: 12px 0; display: grid; gap: 6px; }
.jobsteps .step b { display: inline-block; width: 1.2em; }
.jobsteps .step.ok b { color: var(--ok); }
.jobsteps .step.fail b { color: var(--crit); }
.jobsteps .step.run { color: var(--accent); }
.jobsteps .step.wait { color: var(--muted); }
.diag { border-left: 3px solid var(--dim); padding: 4px 0 4px 12px; }
.diag.lv-crit { border-left-color: var(--crit); }
.diag.lv-warn { border-left-color: var(--warn); }
.diag.lv-crit > div:first-child { color: var(--crit); }
.diag.lv-warn > div:first-child { color: var(--warn); }
.grid.m2 { grid-template-columns: minmax(300px, 1fr) 2fr; }
.grid.m2r { grid-template-columns: 3fr 2fr; }
@media (max-width: 1100px) { .grid.m2, .grid.m2r { grid-template-columns: 1fr; } }
#mjob .box { border-color: var(--accent); margin-top: 22px; }

/* stacks do Swarm */
.stacks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stack-card { background: var(--panel); border: 1px solid var(--line); padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack-card .px { font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* janela */
.modal { position: fixed; inset: 0; background: rgba(5,6,10,.78); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .box { width: min(1100px, 100%); max-height: 90vh; overflow: auto; background: var(--bg-2); }
.hidden { display: none !important; }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 600; display: grid; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; max-width: 420px; }
.toast.err { border-left-color: var(--crit); }

#overlay { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
#overlay .box { width: min(680px, 100%); text-align: center; }
#overlay .hp { margin: 20px 0; height: 12px; }

.term-wrap { background: #0a0b0f; border: 1px solid var(--line); padding: 8px; height: calc(100vh - 210px); min-height: 380px; }
.term-wrap .xterm { height: 100%; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: min(440px, 100%); }
.login .title { font-family: var(--pixel); font-size: 20px; font-weight: normal; color: var(--accent); text-align: center; margin: 0 0 10px; }
.login .sub { font-family: var(--pixel); font-size: 7px; text-align: center; color: var(--muted); margin-bottom: 28px; letter-spacing: 1.5px; }
.login input { width: 100%; font-size: 16px; padding: 10px 12px; }
.login .msg { min-height: 1.4em; margin: 8px 0; }
.login .btn { width: 100%; padding: 13px; font-size: 9px; }
.login .press { font-family: var(--pixel); font-size: 7px; text-align: center; color: var(--dim); margin-top: 22px; letter-spacing: 1.5px; }
.sprite { display: block; margin: 0 auto 18px; image-rendering: pixelated; width: 66px; height: 48px; }

/* ---------- icones, tiles e confirmacao ---------- */
svg.ico { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: -0.1em; }
.center { text-align: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 88px;
  font-family: var(--pixel); font-size: 7px; line-height: 1.6; letter-spacing: 1px; color: var(--text); text-align: center;
  background: var(--panel); border: 1px solid var(--line); padding: 12px 6px; cursor: pointer;
}
.tile svg.ico { width: 24px; height: 24px; color: var(--accent); }
.tile:active { transform: translateY(1px); }
.tile:hover, .tile:focus-visible { border-color: var(--accent); outline: none; }
.tile.on { border-color: var(--accent); color: var(--accent); }
.tile.gold { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.tile.gold svg.ico { color: var(--ink); }
.tile.danger svg.ico { color: var(--crit); }
.modal.confirm { z-index: 700; }
.modal.confirm .box { width: min(480px, 100%); }
.modal.confirm .choice { margin: 18px 0 0; }
.grab { display: none; }
.bnav { display: none; }
.keybar { display: none; }
.ptr { display: none; }

.key {
  font-family: var(--pixel); font-size: 9px; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  min-width: 46px; height: 40px; padding: 0 8px; flex: 0 0 auto; cursor: pointer;
}
.key.on { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.key:active { transform: translateY(1px); }
.key.paste { color: var(--accent); border-color: var(--accent); }
.paste-box { width: 100%; min-height: 120px; resize: vertical; font-family: var(--mono, monospace); font-size: 16px; }
@media (pointer: coarse), (max-width: 760px) {
  .keybar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .keybar::-webkit-scrollbar { display: none; }
}

/* ---------- celular ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; overflow-x: clip; }
  body.noscroll { overflow: hidden; }
  .wrap { padding: 0 14px 16px; }
  .hide-m { display: none !important; }

  header.hud {
    position: sticky; top: 0; z-index: 50; margin: 0 -14px; flex-wrap: nowrap; gap: 8px; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
  }
  .logo { font-size: 12px; }
  .logo small { font-size: 11px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
  .chips, .clock, #btn-logout, .btn .t { display: none; }
  .hud-right { gap: 8px; flex-wrap: nowrap; margin-left: auto; }
  .hud-right .btn { font-size: 14px; padding: 6px 11px; font-family: var(--body); }
  nav.tabs { display: none; }
  .section { margin-top: 24px; }
  .section:first-child { margin-top: 18px; }

  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px 14px; }
  .kpi .v { font-size: 38px; }
  .grid, .grid.wide { grid-template-columns: 1fr; gap: 12px; }
  .span2 { grid-column: auto; }
  .box { padding: 14px; }
  .big { font-size: 36px; }
  .toolbar { gap: 8px; margin-top: 16px; }
  .toolbar > input, .toolbar > select { flex: 1 1 100%; min-width: 0; font-size: 16px; padding: 10px; }
  .btn { padding: 10px 12px; }
  .btn.small { font-size: 7px; padding: 9px 10px; }
  .kv { grid-template-columns: minmax(96px, max-content) 1fr; gap: 6px 12px; }
  canvas.chart { height: 160px; }
  td.cmd { max-width: 46vw; }
  input, select, textarea { font-size: 16px; }

  /* tabelas viram cartoes */
  .tbl-wrap.cards { overflow: visible; }
  .cards table, .cards tbody { display: block; }
  .cards thead { display: none; }
  .cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 10px; padding: 12px; background: var(--panel); border: 1px solid var(--line); }
  .cards tr:hover td { background: none; }
  .cards td { border: 0; padding: 0; text-align: left !important; white-space: normal; max-width: none; min-width: 0; overflow-wrap: anywhere; }
  .cards td::before { content: attr(data-l); display: block; font-family: var(--pixel); font-size: 6px; color: var(--dim); margin-bottom: 5px; letter-spacing: 1px; }
  .cards td.card-title { grid-column: 1 / -1; order: -1; font-size: 15px; font-weight: 500; }
  .cards td.card-title::before { display: none; }
  .cards td.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .cards td.actions::before { display: none; }
  .cards td.actions .btn { margin: 0; }
  .cards td.cmd { font-size: 12px; white-space: normal; }
  .cards td[colspan] { grid-column: 1 / -1; }
  .cards td[colspan]::before { display: none; }

  /* menu inferior */
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
    background: var(--bg-2); border-top: 1px solid var(--line); padding: 4px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bnav button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 0 6px;
    background: none; border: 0; color: var(--dim); font-family: var(--pixel); font-size: 6px; letter-spacing: 1px; cursor: pointer;
  }
  .bnav button svg.ico { width: 20px; height: 20px; }
  .bnav button.on { color: var(--accent); }
  .bnav button.on::before { content: ""; position: absolute; top: -5px; left: 30%; right: 30%; height: 2px; background: var(--accent); }
  .bnav button:active { transform: translateY(1px); }
  body.kbd .bnav { display: none; }

  /* janelas sobem de baixo */
  .modal { align-items: flex-end; padding: 0; }
  .modal .box.sheet {
    width: 100%; max-height: 88vh; border-width: 1px 0 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom));
    animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1.05); overscroll-behavior: contain; transition: transform .18s ease-out;
  }
  .modal .box.sheet.dragging { transition: none; }
  .grab { display: flex; justify-content: center; padding: 10px 0 14px; cursor: grab; touch-action: none; }
  .grab i { display: block; width: 44px; height: 4px; background: var(--dim); }
  .modal.confirm .box.sheet { padding-top: 20px; }
  .modal.confirm .choice .btn { flex: 1; padding: 14px; font-size: 9px; }
  .modal.menu .toolbar { display: none; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  pre.logs { max-height: 58vh; font-size: 11.5px; }

  #toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  .ptr { display: flex; align-items: center; justify-content: center; height: 0; overflow: hidden; font-family: var(--pixel); font-size: 7px; color: var(--dim); transition: height .15s; }
  .ptr.show { height: 40px; }
  .ptr.ready { color: var(--accent); }

  body[data-tab="term"] .toolbar { margin: 10px 0 8px; }
  .term-wrap { height: auto; min-height: 160px; padding: 4px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .modal .box.sheet { animation: none; } }
@media (display-mode: standalone) { .login-wrap { padding-top: env(safe-area-inset-top); } }
