/* MA2 -> MA3 macro converter: console-style look, light and dark.
 * Own design; no fonts or images from elsewhere. */
:root {
  --bg: #eef0f2;
  --surface: #ffffff;
  --panel: #f7f8f9;
  --panel-2: #e4e7ea;
  --text: #1b1f23;
  --muted: #5b646d;
  --line: #c9ced3;
  --accent: #0b6e70;
  --accent-text: #ffffff;
  --cursor-bg: #f2c14e;
  --cursor-text: #1b1f23;
  --mark: #0b6e70;
  --ok: #1d6b33;
  --warn: #8a5a00;
  --bad: #a3242a;
  --info-bg: #dff0ef;
  --warn-bg: #fbecd0;
  --cat-translated: #2e7d4a;
  --cat-changed: #1f5fa8;
  --cat-check: #9a6400;
  --cat-disabled: #6b7178;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "DejaVu Sans Mono", "Menlo", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Roboto", "Noto Sans", sans-serif;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101315;
    --surface: #171b1e;
    --panel: #1c2124;
    --panel-2: #262c30;
    --text: #e3e7ea;
    --muted: #97a1a9;
    --line: #333b40;
    --accent: #3fb6b2;
    --accent-text: #0c1214;
    --cursor-bg: #f2c14e;
    --cursor-text: #111416;
    --mark: #5fd1cc;
    --ok: #6fcf8d;
    --warn: #e7b04a;
    --bad: #f07a7f;
    --info-bg: #15302f;
    --warn-bg: #3a2c10;
    --cat-translated: #6fcf8d;
    --cat-changed: #7fb2f0;
    --cat-check: #e7b04a;
    --cat-disabled: #9aa3aa;
  }
}
:root[data-theme="dark"] {
  --bg: #101315;
  --surface: #171b1e;
  --panel: #1c2124;
  --panel-2: #262c30;
  --text: #e3e7ea;
  --muted: #97a1a9;
  --line: #333b40;
  --accent: #3fb6b2;
  --accent-text: #0c1214;
  --cursor-bg: #f2c14e;
  --cursor-text: #111416;
  --mark: #5fd1cc;
  --ok: #6fcf8d;
  --warn: #e7b04a;
  --bad: #f07a7f;
  --info-bg: #15302f;
  --warn-bg: #3a2c10;
  --cat-translated: #6fcf8d;
  --cat-changed: #7fb2f0;
  --cat-check: #e7b04a;
  --cat-disabled: #9aa3aa;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
}
a { color: var(--accent); }
code, pre, .code, .mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 4px 8px; z-index: 10; }

.top {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  font: 700 14px/1 var(--mono); background: var(--accent); color: var(--accent-text);
  padding: 9px 8px; border-radius: var(--radius); letter-spacing: 0.5px;
}
.brand h1 { font-size: 18px; margin: 0; }
.brand .sub { margin: 0; color: var(--muted); font-size: 13px; }
.topnav { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.topnav a { text-decoration: none; font-weight: 600; }
.topnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.chip {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }

.banner { margin: 12px 16px 0; padding: 8px 12px; border-radius: var(--radius); font-size: 14px; }
.banner.info { background: var(--info-bg); }
.banner.warn { background: var(--warn-bg); }

.console {
  margin: 12px 16px; display: grid; gap: 10px;
  grid-template-columns: minmax(0, 1fr);
}
.window {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; min-width: 0;
}
.window-bar {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center;
  background: var(--panel-2); padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.window-bar h2 { margin: 0; font: 700 14px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 1px; }
.engine { font: 12px/1.4 var(--mono); color: var(--muted); }
.engine[data-state="ok"] { color: var(--ok); }
.engine[data-state="bad"] { color: var(--bad); }
.engine[data-state="busy"] { color: var(--warn); }
.pathline { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.pathline .label { color: var(--muted); font-family: var(--mono); }
.pathline code { font-weight: 700; }

.list-wrap { position: relative; max-height: 52vh; min-height: 160px; overflow: auto; }
.sdlist { width: 100%; border-collapse: collapse; font: 14px/1.35 var(--mono); }
.sdlist th {
  position: sticky; top: 0; background: var(--panel); text-align: left; font-weight: 600;
  color: var(--muted); padding: 4px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.sdlist td { padding: 4px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sdlist td.no, .sdlist th.no { width: 3.5em; text-align: right; color: var(--muted); }
.sdlist tbody:focus { outline: none; }
.sdlist tbody:focus tr.cursor td { outline: 2px solid var(--accent); outline-offset: -2px; }
.sdlist tr { cursor: pointer; }
.sdlist tr.cursor td { background: var(--cursor-bg); color: var(--cursor-text); }
.sdlist tr.marked td:nth-child(2) { color: var(--mark); font-weight: 700; }
.sdlist tr.cursor.marked td:nth-child(2) { color: var(--cursor-text); text-decoration: underline; }
.sdlist tr.row-dir td:nth-child(2)::after, .sdlist tr.row-drive td:nth-child(2)::after { content: "/"; color: var(--muted); }
.empty { padding: 16px 10px; color: var(--muted); margin: 0; }
.drop-overlay {
  position: absolute; inset: 6px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--panel); font-weight: 700;
}
.hint { margin: 0; padding: 6px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

.cmd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.log {
  margin: 0; padding: 6px 10px; height: 8.5em; overflow: auto; font: 13px/1.35 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid var(--line);
}
.log .echo { color: var(--muted); }
.cmdline { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.prompt { font: 700 14px/1 var(--mono); color: var(--accent); white-space: nowrap; }
.cmdline input {
  flex: 1; min-width: 0; font: 15px/1.4 var(--mono); color: var(--text); background: transparent;
  border: 0; outline: none; padding: 4px 0;
}
.cmdline:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }

.softkeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.softkeys button {
  font: 600 13px/1.2 var(--sans); color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-bottom-width: 3px; border-radius: var(--radius);
  padding: 10px 6px; cursor: pointer; min-height: 44px;
}
.softkeys button:hover { border-color: var(--accent); }
.softkeys button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.softkeys button:focus-visible, .chip:focus-visible { outline: 2px solid var(--cursor-bg); outline-offset: 2px; }

.report #report-body { padding: 10px; }
.report h3 { margin: 0 0 6px; font: 700 15px/1.3 var(--mono); overflow-wrap: anywhere; }
.report h4 { margin: 16px 0 6px; font-size: 15px; }
.report p { margin: 4px 0; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table.rep { border-collapse: collapse; width: 100%; font-size: 13px; }
table.rep th, table.rep td { border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; text-align: left; }
table.rep th { background: var(--panel-2); }
table.rep td.code { font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 10em; }
table.rep td.why { min-width: 14em; }
table.rep td.no { white-space: nowrap; color: var(--muted); }
.chip-s { display: inline-block; font: 600 12px/1.2 var(--sans); padding: 2px 6px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.category-translated { color: var(--cat-translated); }
.category-changed { color: var(--cat-changed); }
.category-needs_manual_check { color: var(--cat-check); }
.category-disabled { color: var(--cat-disabled); }
.status-verified_from_docs { color: var(--ok); }
.status-inferred { color: var(--cat-changed); }
.status-requires_runtime_test { color: var(--warn); }
.status-unsupported { color: var(--bad); }
pre.xml {
  font-size: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; overflow: auto; max-height: 50vh; white-space: pre;
}
.notes { margin: 4px 0; padding-left: 18px; font-size: 13px; }

.prose { max-width: 60rem; margin: 20px 16px; }
.prose h2 { font-size: 20px; margin: 24px 0 8px; }
.prose h3 { font-size: 16px; margin: 18px 0 6px; }
.prose p { margin: 6px 0; }
.foot { margin: 24px 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* learning page */
.learn-toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.topic { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.topic h3 { margin-top: 0; }
.pairs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px 8px; align-items: center; margin-top: 6px; }
.pairs code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; overflow-wrap: anywhere; }
.pairs .arrow { color: var(--muted); font-family: var(--mono); }
.pairs .h { font: 600 12px/1 var(--mono); color: var(--muted); }
dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
dl.defs dt { font-weight: 600; }
dl.defs dd { margin: 0; }
.rules-filter { font: inherit; padding: 6px 8px; width: 100%; max-width: 24rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .sdlist th:nth-child(4), .sdlist td:nth-child(4) { display: none; }
  .list-wrap { max-height: 45vh; }
  .log { height: 6.5em; }
  dl.defs { grid-template-columns: 1fr; }
  .pairs { grid-template-columns: 1fr; }
  .pairs .arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.drivemap { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.drivemap code { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.settings > summary { cursor: pointer; list-style: none; }
.settings-grid { display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(6rem, 1fr); gap: 8px 12px; padding: 10px 12px; align-items: center; }
.settings-grid input[type="number"] { max-width: 8rem; }
.settings-grid input[type="text"] { width: 100%; font-family: var(--mono); }
.settings-grid input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; font: inherit; }
.settings > p { margin: 6px 12px; }
.checklist table td.cmd { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.checklist #checklist-body { padding: 8px 12px; }
.checklist ul { margin: 4px 0 8px 18px; padding: 0; }
.checklist h3 { margin: 12px 0 4px; font-size: 14px; }
@media (max-width: 40rem) { .settings-grid { grid-template-columns: 1fr; } }
.group-head th { text-align: left; font-weight: 600; background: var(--surface-2, var(--surface)); }
