:root { color-scheme: light dark; --line: #8884; --accent: #2457d6; }
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 1200px; padding: 1.25rem; font: 16px/1.55 system-ui, sans-serif; }
nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
nav a:first-child { font-weight: 700; margin-right: auto; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 .25rem; }
.lede { margin: 0 0 1rem; }
.tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
button, .file { font: inherit; font-weight: 600; padding: .55rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: none; color: inherit; cursor: pointer; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.file input { position: absolute; opacity: 0; width: 1px; }
.file:focus-within, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#output { height: 50vh; }
#status { min-height: 1.5rem; font-size: .9rem; }
.work { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
textarea, #preview { width: 100%; height: 65vh; overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 6px; }
textarea { font: 14px/1.5 ui-monospace, monospace; resize: vertical; background: none; color: inherit; }
#preview img { max-width: 100%; }
#preview table { border-collapse: collapse; }
#preview th, #preview td { border: 1px solid var(--line); padding: .3rem .6rem; }
#preview pre { overflow: auto; padding: .75rem; background: #8882; border-radius: 6px; }
.about { max-width: 70ch; margin-top: 2rem; }
#mark { display: none; }
@media (max-width: 760px) { .work { grid-template-columns: 1fr; } textarea, #preview { height: 45vh; } }
@media print {
  body { max-width: none; padding: 0; color: #000; background: #fff; }
  nav, h1, .lede, .tools, #status, textarea, .about { display: none; }
  .work { display: block; }
  #preview { height: auto; overflow: visible; border: 0; padding: 0; }
  body.watermark #mark { display: block; margin-top: 2rem; font-size: 10pt; color: #666; }
}
