:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #172033;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f7fa; }
button, textarea { font: inherit; }
button { min-height: 44px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; padding: 0 14px; font-weight: 700; color: #1e293b; }
button:disabled { opacity: .5; }
button.primary { background: #111827; color: #fff; border-color: #111827; }
.app-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: rgba(255,255,255,.96); border-bottom: 1px solid #e2e8f0; backdrop-filter: blur(10px); }
.eyebrow { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 2px 0 0; font-size: 20px; }
.build-number { margin-top: 3px; font-size: 11px; color: #64748b; }
.status-pill { border-radius: 999px; padding: 7px 10px; background: #e2e8f0; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill.ok { background: #dcfce7; color: #166534; }
.status-pill.error { background: #fee2e2; color: #991b1b; }
main { width: min(100%, 980px); margin: 0 auto; padding: 12px 12px 96px; }
.toolbar { position: sticky; top: 84px; z-index: 8; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 0 12px; background: #f5f7fa; }
.notebook { display: grid; gap: 12px; }
.cell { background: #fff; border: 1px solid #dbe3ed; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.cell-head { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 10px 8px; }
.cell-index, .cell-type { font-size: 12px; font-weight: 800; color: #64748b; }
.cell-type { padding: 3px 7px; border-radius: 999px; background: #eef2ff; color: #4338ca; }
.cell-status { font-size: 12px; color: #64748b; }
.cell-status.running { color: #9a6700; }
.cell-status.success { color: #166534; }
.cell-status.error { color: #991b1b; }
.code-editor { display: block; width: 100%; min-height: 180px; resize: vertical; border: 0; border-top: 1px solid #eef2f7; outline: none; padding: 14px; background: #0f172a; color: #e2e8f0; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; line-height: 1.55; tab-size: 4; white-space: pre; overflow: auto; }
.markdown-preview { border-top: 1px solid #e2e8f0; padding: 14px; background: #fff; line-height: 1.6; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: .3em 0 .5em; }
.markdown-preview p { margin: .25em 0; white-space: pre-wrap; }
.markdown-list-item { margin: .2em 0 .2em 1em; }
.output { border-top: 1px solid #e2e8f0; padding: 12px; background: #f8fafc; }
.output-block { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.45; }
.output-block:last-child { margin-bottom: 0; }
.output-block.error { color: #991b1b; }
.output img { max-width: 100%; height: auto; display: block; }
.html-output { width: 100%; min-height: 120px; border: 0; background: #fff; }
@media (min-width: 700px) {
  main { padding-inline: 20px; }
  .toolbar { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
  .code-editor { min-height: 220px; }
}
