/* Workshop: the Kids Supercar look of the dashboard's carbon theme - dark
   carbon, the brand red, Bricolage Grotesque for headings and Manrope for
   text - with monospace wherever a board talks. One dark theme on purpose:
   the editor and the board output are dark anyway. Fonts come from this
   server, not Google: Google is blocked in China and would hold the page. */
@font-face { font-family: "Manrope"; src: url("/workshop/fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/workshop/fonts/BricolageGrotesque.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
:root {
  --ground: #0b0c0e;
  --surface: #15171b;
  --sunken: #1c1f24;
  --line: #2a2e35;
  --text: #f3f5f8;
  --muted: #8d95a3;
  --accent: #e31e24;
  --accent-ink: #ffffff;
  --accent-soft: #2a1416;
  --link: #ff6b70;
  --warn: #ff9f1c;
  --warn-soft: #2b1d08;
  --bad: #ff4d6d;
  --bad-soft: #2d0f16;
  --ok: #3ddc97;
  --term-bg: #08090b;
  --term-text: #d6e3cf;
  --term-dim: #7c8590;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Manrope", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }

.top { background: var(--surface); border-bottom: 3px solid var(--accent); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mark { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.mark svg { width: 24px; height: 24px; color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { background: var(--sunken); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
.who form { margin: 0; }

.page { max-width: 1120px; margin: 0 auto; padding-block: 24px 48px; padding-inline: 16px; display: grid; gap: 20px; }
.narrow { max-width: 440px; margin: 48px auto; padding-inline: 16px; display: grid; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sub { color: var(--muted); margin: 4px 0 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.panel > h2 { margin-bottom: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }

label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
.row > .btn, .row > button, .row > form { flex: 0 0 auto; }

.btn, button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 8px 14px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn.ghost, button.ghost { background: transparent; color: var(--link); }
.btn.bad, button.bad { background: transparent; color: var(--bad); border-color: var(--bad); }
button:disabled, .btn[aria-disabled=true] { opacity: 0.5; cursor: not-allowed; }
.linkish { background: none; border: 0; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }

.note { border-radius: 6px; padding: 10px 12px; background: var(--sunken); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.ok { background: var(--accent-soft); color: var(--link); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--accent-soft); color: var(--link); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card .slug { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 0.92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.rights { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.right { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.right input { margin-top: 4px; }
.right small { display: block; color: var(--muted); }
.right.blocked { opacity: 0.55; }

.term {
  background: var(--term-bg); color: var(--term-text); font: 12.5px/1.45 var(--mono); border-radius: var(--radius);
  padding: 12px; min-height: 180px; max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0;
}
.term .t { color: var(--term-dim); }
.term .src-server { color: #9ecbff; }
.term .src-flash { color: #f2c26b; }

.bar { height: 8px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.qr { background: #fff; padding: 10px; border-radius: 6px; width: 220px; max-width: 100%; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy input { font-family: var(--mono); font-size: 0.85rem; }

@media (max-width: 560px) {
  .who span { display: none; }
}

/* The code workbench: files, editor, and the side with Claude, build, board, git. */
.page.wide, .wide .top-inner { max-width: 1480px; }
.workbench { display: grid; grid-template-columns: 220px minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .workbench { grid-template-columns: 200px minmax(0, 1fr); } .side { grid-column: 1 / -1; } }
@media (max-width: 760px) { .workbench { grid-template-columns: 1fr; } }
.files { padding: 12px; gap: 8px; }
.files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.files a { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; color: var(--text); text-decoration: none; font-size: 0.85rem; overflow-wrap: anywhere; }
.files a:hover { background: var(--sunken); }
.files a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.files i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mark-changed { background: var(--warn); }
.mark-added { background: var(--ok); }
.newfile { display: flex; gap: 6px; }
.newfile input { font-size: 0.85rem; padding: 5px 8px; }
.newfile button { padding: 5px 10px; }
.editor-wrap { padding: 0; gap: 0; overflow: hidden; }
.editor-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-head form { display: flex; align-items: center; gap: 8px; margin: 0; }
.editor-head .spacer { flex: 1; }
.editor-head button { padding: 5px 12px; }
.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; }
.editor { display: grid; grid-template-columns: auto 1fr; height: min(72vh, 900px); background: var(--term-bg); }
.gutter, #code { font: 13px/1.5 var(--mono); margin: 0; padding: 10px 8px; }
.gutter { color: var(--term-dim); text-align: right; user-select: none; overflow: hidden; min-width: 3.5em; border-right: 1px solid #2a3027; }
#code { border: 0; border-radius: 0; resize: none; background: var(--term-bg); color: var(--term-text); white-space: pre; overflow: auto; tab-size: 2; width: 100%; height: 100%; outline: none; }
#editorNote { padding: 6px 12px; margin: 0; }
.side { display: grid; gap: 16px; }
.builds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.builds li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.small-term { min-height: 0; max-height: 300px; font-size: 11.5px; }
.chat { display: grid; gap: 10px; max-height: 520px; overflow: auto; padding-right: 4px; }
.msg { padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.92rem; }
.msg.user { background: var(--accent-soft); justify-self: end; max-width: 92%; }
.msg.assistant { background: var(--sunken); }
.msg.step { font: 12px/1.4 var(--mono); color: var(--muted); padding: 2px 4px; background: none; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg .by { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
.ask { display: grid; gap: 8px; }
.ask textarea { min-height: 70px; }
.diff { font: 12px/1.45 var(--mono); background: var(--term-bg); color: var(--term-text); border-radius: 6px; padding: 10px; overflow: auto; margin: 0; white-space: pre; }
.diff .add { color: #8fdc8f; }
.diff .del { color: #f19a8f; }
.diff .hunk { color: #9ecbff; }

/* Signposts: the "how this page works" box, the tour, numbered steps. */
.guidebox { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); padding: 12px 16px; }
.guidebox-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--text); }
.guidebox-head .row { gap: 14px; }
.guidebox ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.guide-show { margin: 0; }
.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour-spot { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(10, 14, 10, 0.55); transition: all 0.2s; }
.tour-bubble { position: fixed; pointer-events: auto; width: min(360px, calc(100vw - 20px)); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); display: grid; gap: 6px; }
.tour-count { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tour-text { margin: 0; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.steps li.next { background: var(--accent-soft); }
.steps .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
  background: var(--sunken); color: var(--muted); }
.steps li.done .num { background: var(--ok); color: var(--surface); }
.steps li.next .num { background: var(--accent); color: var(--accent-ink); }
.steps li.done .what { color: var(--muted); }
.steps small { display: block; color: var(--muted); }

.next-card { background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 20px; display: grid; gap: 8px; }
.next-card .label { font-size: 0.75rem; color: var(--link); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.next-card h2 { font-size: 1.35rem; }
.next-card .btn { justify-self: start; font-size: 1.05rem; padding: 10px 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; align-content: start; }
.tile p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.tile .row { gap: 12px; }

.wizard { display: grid; gap: 0; padding: 0; }
.wizard .wstep { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.wizard .wstep:last-child { border-bottom: 0; }
.wizard .wnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.wizard .wbody { display: grid; gap: 8px; }
.wizard h2 { font-size: 1.05rem; }
.helpsteps { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

/* Claude on every page */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 900; border-radius: 999px; padding: 12px 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.dock { position: fixed; right: 18px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 950; width: min(420px, calc(100vw - 36px));
  max-height: min(70vh, 640px); display: grid; grid-template-rows: auto 1fr auto; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.dock .chat { max-height: none; overflow: auto; }
.card a.head { color: inherit; text-decoration: none; }
.card a.head:hover h2 { color: var(--accent); }
