:root { color-scheme: light dark; --bg: #f7f8fa; --panel: #fff; --ink: #14202b; --muted: #5b6b7a; --line: #c9d2db; --accent: #2f6f00; --bad: #b3261e; }
@media (prefers-color-scheme: dark) { :root { --bg: #0e1620; --panel: #16212d; --ink: #e8eef4; --muted: #93a4b5; --line: #2c3b4a; --accent: #9ee000; --bad: #ff8a80; } }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--ink); }
header { position: sticky; top: 0; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
.spacer { flex: 1; }
#status { color: var(--muted); font-size: 12px; }
button { font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
main { padding: 12px; display: grid; gap: 12px; }
.cell { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cell textarea { display: block; width: 100%; min-height: 4.5em; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; outline: none; tab-size: 4; }
.cell .bar { display: flex; gap: 8px; align-items: center; padding: 4px 8px; border-top: 1px solid var(--line); }
.cell .count { color: var(--muted); font-size: 11px; }
.cell pre { margin: 0; padding: 8px 10px; border-top: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.cell pre.err { color: var(--bad); }
header { flex-wrap: wrap; }
#save-status { color: var(--muted); font-size: 12px; }
#notice { margin: 8px 12px 0; padding: 6px 10px; border: 1px solid var(--bad); border-radius: 6px; color: var(--bad); font-size: 12px; }
#notice.ok { border-color: var(--accent); color: var(--accent); }
#reset-confirm { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
.cell .rendered { padding: 8px 12px; cursor: text; }
.cell .rendered > :first-child { margin-top: 0; }
.cell .rendered > :last-child { margin-bottom: 0; }
.cell .rendered h1, .cell .rendered h2, .cell .rendered h3 { margin: .7em 0 .3em; line-height: 1.25; }
.cell .rendered h1 { font-size: 1.35em; } .cell .rendered h2 { font-size: 1.15em; } .cell .rendered h3 { font-size: 1.02em; }
.cell .rendered p, .cell .rendered ul, .cell .rendered ol { margin: .5em 0; }
.cell .rendered code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.cell .rendered pre { margin: .5em 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; border-top: 1px solid var(--line); }
.cell .rendered pre code { border: 0; padding: 0; background: none; }
.cell .rendered blockquote { margin: .5em 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--muted, inherit); }
.cell .rendered blockquote p { margin: .3em 0; }
.cell .rendered .tablewrap { overflow-x: auto; margin: .5em 0; }
.cell .rendered table { border-collapse: collapse; font-size: .95em; }
.cell .rendered th, .cell .rendered td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; vertical-align: top; }
.cell .rendered th { background: var(--bg); }
.cell.md textarea[hidden] { display: none; }
[hidden] { display: none !important; }
