:root {
  color-scheme: light;
  --page: #f5f7ed;
  --panel: #fff;
  --ink: #23233b;
  --muted: #51516a;
  --line: #adafc4;
  --accent: #405525;
  --on-accent: #fff;
  --result: #eaf0dd;
  --error: #963727;
  --mono: ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #20241b;
  --panel: #252c23;
  --ink: #f3effe;
  --muted: #d5cce6;
  --line: #776b90;
  --accent: #c5de96;
  --on-accent: #291941;
  --result: #303b26;
  --error: #ffc1b0;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); font: 1rem/1.5 system-ui, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body > header { background: var(--panel); }
body > header > div, body > footer > div, body > main { width: min(100% - 2rem, 75rem); margin-inline: auto; }
body > header > div, body > footer > div:not(.app-meta) { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding-block: .8rem; }
body > header nav, body > footer nav { display: flex; flex-wrap: wrap; gap: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand img { width: 1.8rem; height: 1.8rem; }
body > footer { border-top: 1px solid var(--line); }
body > main:not(.md-path-main) { max-width: 48rem; min-height: 55vh; }
.md-path-title { padding-block: 1.4rem 1.15rem; }
.md-path-title h1 { margin: 0; font-size: 2rem; line-height: 1.18; }
.md-path-title p { color: var(--muted); margin: .4rem 0 0; }
.md-path-work { margin: 0 0 1.5rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.md-path-header { display: flex; justify-content: space-between; align-items: end; gap: .6rem; flex-wrap: wrap; }
.md-path-header > div { min-width: 0; max-width: 100%; }
.md-path-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: .8rem; }
.md-path-comparison section { min-width: 0; }
.md-path-work label { display: block; font-weight: 650; }
.md-path-work textarea { display: block; width: 100%; min-width: 0; margin: .25rem 0 .75rem; padding: .7rem; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--panel); resize: vertical; font: 1rem/1.45 var(--mono); tab-size: 2; }
.md-path-work textarea[readonly] { background: var(--result); }
.md-path-work input[type=file] { display: block; width: 100%; max-width: 17rem; font: inherit; }
.md-path-work button { min-height: 2.75rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--ink); font: 650 .93rem system-ui, sans-serif; cursor: pointer; }
.md-path-work button.md-path-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.md-path-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.md-path-controls p, .md-path-controls ul { flex-basis: 100%; margin: .1rem 0; color: var(--muted); overflow-wrap: anywhere; }
.md-path-controls [role=alert], .md-path-controls ul { color: var(--error); }
.md-path-controls p:empty, .md-path-controls ul:empty { display: none; }
.md-path-results { margin-top: .8rem; }
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) and (pointer: coarse) {
  .md-path-title { padding-block: .85rem; }
  .md-path-title h1 { font-size: 1.58rem; }
  .md-path-comparison { display: block; }
  .md-path-work textarea { min-height: 12rem; }
}
