/* Shared shell colors; the Python editor uses JupyterLab's native themes. */
:root {
  color-scheme: light;
  --text: #183d3a; --page: #f5f7f3; --surface: #ffffff;
  --border: #d2ded7; --control-border: #b4c6bc; --hover: #e8f0e9;
  --focus: #ad6721; --accent: #18594d; --accent-hover: #103f37;
  --on-accent: #ffffff; --muted: #49665c; --toolbar: #edf2ec;
  --help: #fff9e9; --error-text: #9c2828; --error-bg: #fff0ee;
}
:root[data-theme="dark"] {
  /* Material dark surfaces: neutral #121212 base, lighter elevated surfaces.
     https://codelabs.developers.google.com/codelabs/design-material-darktheme */
  color-scheme: dark;
  --text: #e0e0e0; --page: #121212; --surface: #1e1e1e;
  --border: #424242; --control-border: #757575; --hover: #303030;
  --focus: #8ab4f8; --accent: #8ab4f8; --accent-hover: #aecbfa;
  --on-accent: #202124; --muted: #bdbdbd; --toolbar: #242424;
  --help: #242424; --error-text: #f2b8b5; --error-bg: #2c2022;
}
:root { font-family: system-ui, sans-serif; color: var(--text); background: var(--page); font-size: 16px; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { color: var(--text); text-decoration: none; font-size: 20px; font-weight: 750; }
.brand span { font-weight: 400; margin-left: 8px; }
button, .card { font: inherit; }
button { border: 1px solid var(--control-border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 9px 14px; cursor: pointer; }
button:hover { background: var(--hover); }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); }
#welcome { max-width: 1000px; margin: 0 auto; padding: 64px 28px 28px; }
.eyebrow { letter-spacing: .12em; font-size: 13px; font-weight: 700; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.035em; margin: 12px 0; }
p { line-height: 1.65; }
#welcome > p { max-width: 660px; }
h2 { font-size: 22px; margin-top: 42px; }
.actions, .toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { margin-top: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card { display: block; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--accent); background: var(--hover); }
.card strong { display: block; font-size: 20px; margin-bottom: 18px; }
.card span, .note { font-size: 14px; color: var(--muted); }
.toolbar { padding: 10px 16px; background: var(--toolbar); border-bottom: 1px solid var(--border); }
.toolbar button { font-size: 14px; padding: 7px 11px; }
#editor { display: block; width: 100%; height: calc(100dvh - 166px); min-height: 420px; border: 0; background: var(--surface); }
#help { padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--help); }
#help p { margin: 8px 0; max-width: 1000px; }
kbd { background: var(--surface); border: 1px solid var(--control-border); border-radius: 3px; padding: 1px 4px; }
#status { margin: 0; padding: 10px 20px; font-size: 13px; }
#status.error { color: var(--error-text); background: var(--error-bg); }
@media (max-width: 600px) { header { padding: 12px; } header button { font-size: 12px; } .brand { font-size: 16px; } .brand span { display: block; margin: 0; font-size: 13px; } #welcome { padding: 32px 18px; } #editor { height: calc(100dvh - 240px); } }

/* Keep the booting editor hidden until its native theme matches the shell. */
#editor:not(.theme-ready) { visibility: hidden; }
