:root { color-scheme: dark; font-family: system-ui, sans-serif; color: #e4e8ee; background: #11151c; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
header, main, footer { max-width: 1180px; margin: auto; padding: 12px 24px; }
header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #303642; }
.brand { font-weight: 750; font-size: 24px; text-decoration: none; }
.brand span { display: inline; font-size: 12px; color: #9daaba; font-weight: 400; margin-left: 12px; }
nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 8px; margin: 0 0 12px; }
nav a { display: block; text-decoration: none; padding: 10px 12px; border: 1px solid #333c4b; border-radius: 6px; background: #1a202a; font-size: 14px; }
nav span { display: block; margin-top: 4px; color: #a9b5c5; font-size: 12px; line-height: 1.4; }
nav a:hover, nav a[aria-current="page"] { border-color: #b4a9ff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 17px; margin: 0; }
#controls { margin-bottom: 12px; }
.booba-action { min-height: 42px; }
.terminal-frame { position: relative; height: clamp(320px, 62vh, 720px); border: 1px solid #333c4b; border-radius: 10px; overflow: hidden; background: #1e1e1e; padding: 8px; }
#terminal { height: 100%; width: 100%; }
#status, #help, footer { color: #a9b5c5; font-size: 13px; line-height: 1.8; }
#status[data-error] { color: #ffaaa1; }
footer { border-top: 1px solid #303642; margin-top: 24px; }
a:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid #b4a9ff; outline-offset: 2px; }

/* SVG playground */
.playground .toolbar label { font-size: 13px; color: #a9b5c5; }
.playground select, .playground button { font: inherit; font-size: 13px; color: #e4e8ee; background: #1a202a; border: 1px solid #333c4b; border-radius: 6px; padding: 6px 10px; margin-left: 6px; }
.playground button { cursor: pointer; }
.panes { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; height: clamp(320px, 66vh, 760px); }
.panes textarea { width: 100%; height: 100%; resize: none; padding: 12px; font: 14px/1.5 ui-monospace, Menlo, monospace; color: #e4e8ee; background: #1a202a; border: 1px solid #333c4b; border-radius: 10px; }
#diagram { overflow: auto; border: 1px solid #333c4b; border-radius: 10px; padding: 16px; display: grid; place-items: center; background: #fff; }
#diagram[data-theme="dark"] { background: #1e1e1e; }
#diagram svg { max-width: 100%; height: auto; }
#diagram .error { color: #b3261e; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; }
#diagram[data-theme="dark"] .error { color: #ffaaa1; }
@media (max-width: 760px) { .panes { grid-template-columns: 1fr; height: auto; } .panes textarea { min-height: 40vh; } #diagram { min-height: 40vh; } }
@media (max-width: 650px) { header, main, footer { padding: 10px 14px; } .brand span { display: none; } }

/* Run instructions */
.run { margin-top: 20px; padding-top: 4px; border-top: 1px solid #303642; }
.run h2 { font-size: 15px; margin: 12px 0 4px; }
.run p { color: #a9b5c5; font-size: 13px; line-height: 1.6; margin: 8px 0; }
.run pre { overflow-x: auto; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #333c4b; border-radius: 6px; background: #1a202a; }
.run code { font: 13px/1.5 ui-monospace, Menlo, monospace; color: #e4e8ee; }
.playground #help { color: #a9b5c5; font-size: 13px; line-height: 1.6; }
