/* The coding workbench: task panel, editor, console, test results. */

.wb { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wb-top { display: flex; align-items: center; gap: 10px; padding: 5px 12px; border-bottom: 1px solid var(--line); background: var(--sidebar); min-height: 46px; flex: none; min-width: 0; }
.wb-top .crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; min-width: 0; }
.wb-top .crumbs a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.wb-top .crumbs a:hover { color: var(--ink); }
.wb-top .crumbs svg { width: 12px; height: 12px; flex: none; }
.wb-top .crumbs { line-height: 1.2; font-size: 11.5px; }
.wb-top .title { font-family: var(--font-display); font-size: 16.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(260px, var(--wb-left, 36%), 70%) 5px minmax(0, 1fr); }
.wb-body.solo { grid-template-columns: minmax(0, 1fr); }
.wb-body > .ide { min-width: 0; }
.wb.no-task .wb-body { grid-template-columns: minmax(0, 1fr); }
.wb.no-task .wb-left, .wb.no-task .wb-body > .gutter { display: none; }
.wb.narrow .wb-body { grid-template-columns: minmax(0, 1fr); }
.wb.narrow .wb-body > .gutter { display: none; }
.wb.narrow.no-code .wb-body > .ide { display: none; }
.wb.narrow .wb-left { border-right: 0; }
.wb.narrow .wb-chips, .wb.narrow .wb-top .crumbs { display: none; }
.wb-switch { flex: none; }
.wb-switch button { padding: 3px 11px; font-size: 12.5px; }
.wb-chips { display: flex; align-items: center; gap: 10px; flex: none; }
.wb-top .icon-btn.on { color: var(--accent); }
.wb-top .icon-btn { flex: none; }
.wb-top .btn { flex: none; }
.pg-switch span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: 12px; }
.pg-switch svg:last-child { width: 11px; height: 11px; color: var(--muted); }
.wb.pg.tight-top .wb-top .btn span { display: none; }
.wb-left { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.wb-right { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) 5px var(--wb-bottom, 34%); }
.gutter { background: transparent; position: relative; z-index: 2; }
.gutter.col { cursor: col-resize; margin-left: -3px; }
.gutter.row { cursor: row-resize; margin-top: -3px; }
.gutter:hover, .gutter.drag { background: color-mix(in srgb, var(--accent) 55%, transparent); }

.pane-tabs { display: flex; align-items: center; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); min-height: 40px; flex: none; }
.pane-tabs button.tab { background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.pane-tabs button.tab:hover { color: var(--ink); }
.pane-tabs button.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.pane-tabs .badge { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: 10px; background: var(--selected); color: var(--ink-soft); }
.pane-tabs .badge.bad { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.pane-tabs .badge.good { background: color-mix(in srgb, var(--good) 25%, transparent); color: var(--good); }
.pane-tabs .badge.warn { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 40px; min-width: 0; }
.pane-body .codeblock pre { font-size: 12.5px; }
.pane-body .codeblock.plain pre, .pane-body .codeblock.diagram pre { font-size: 12px; line-height: 1.4; }
.pane-body .table-wrap { font-size: 13px; }
.wb-left .pane-tabs { background: var(--sidebar); }
.pane-body .prose { font-size: calc(14.5px * var(--text-scale)); max-width: none; }

.task-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; }
.example { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px; background: var(--code-bg); }
.example .cols { display: grid; grid-template-columns: 1fr 1fr; }
.example .cols > div + div { border-left: 1px solid var(--line); }
.example .cap { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); padding: 7px 12px 0; }
.example pre { margin: 0; padding: 6px 12px 10px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; min-height: 30px; }
.reqs { list-style: none; padding: 0; margin: 0 0 1em; }
.reqs li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; }
.reqs li svg { width: 15px; height: 15px; margin-top: 4px; flex: none; color: var(--faint); }
.reqs li.ok svg { color: var(--good); } .reqs li.no svg { color: var(--bad); }
.reqs li label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.reqs li input { margin-top: 5px; accent-color: var(--accent); }
.hint-box { border: 1px dashed var(--line-hover); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.hint-box .n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); margin-bottom: 4px; }

/* editor */
.ed-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--sidebar); min-height: 44px; }
.file-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; flex: 1; align-items: center; }
.file-tab { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; border: 1px solid transparent; background: none; }
.file-tab:hover { color: var(--ink); background: var(--hover); }
.file-tab.on { color: var(--ink); background: var(--panel); border-color: var(--line); }
.file-tab .x { opacity: 0; width: 14px; height: 14px; display: grid; place-items: center; border-radius: 4px; }
.file-tab:hover .x { opacity: .7; } .file-tab .x:hover { background: var(--selected); opacity: 1; }
.file-tab .x svg { width: 10px; height: 10px; }
.ed-host { min-height: 0; min-width: 0; position: relative; }
.ed-host > .monaco { position: absolute; inset: 0; }
.io-grid { container-type: inline-size; }
@container (max-width: 520px) { .io-box { grid-column: 1 / -1; } }
.ed-fallback { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; resize: none; font-family: var(--font-mono); font-size: 13.5px; padding: 14px; background: var(--code-bg); tab-size: 4; }

/* bottom panel */
.wb-bottom { min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--bg); }
.console { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--code-bg); }
.console-out { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 12px 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.console-out .err { color: var(--bad); }
.console-out .sys { color: var(--muted); font-style: italic; }
.console-out .in { color: var(--accent); }
.console-out .ok { color: var(--good); }
.console-in { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 6px 10px 6px 16px; }
.console-in span { font-family: var(--font-mono); color: var(--accent); }
.console-in input { flex: 1; border: 0; background: none; font-family: var(--font-mono); font-size: 13px; padding: 4px 0; outline: none; }
.console-in.idle { opacity: .5; }
.console.mini .console-out { max-height: 260px; min-height: 44px; flex: none; }

.result-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.result-banner.passed { background: color-mix(in srgb, var(--good) 11%, transparent); }
.result-banner.failed, .result-banner.compile-error { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.result-banner .big { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.result-banner.passed .big { background: var(--good); color: #0c1a10; }
.result-banner.failed .big, .result-banner.compile-error .big { background: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.result-banner .big svg { width: 16px; height: 16px; }
.result-banner .msg b { display: block; font-size: 14.5px; }
.result-banner .msg span { font-size: 12.5px; color: var(--muted); }
.result-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 24px; }
.result-banner.reviewed { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.result-banner.reviewed .big { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent); }

/* project review */
.review-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 14px 2px 8px; }
.review-head:first-child { margin-top: 2px; }
.review-row { display: flex; gap: 11px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); margin-bottom: 6px; }
.review-row .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.review-row .mark svg { width: 11px; height: 11px; }
.review-row.ok .mark { background: color-mix(in srgb, var(--good) 28%, transparent); color: var(--good); }
.review-row.no .mark { background: color-mix(in srgb, var(--bad) 26%, transparent); color: var(--bad); }
.review-row.part .mark { background: color-mix(in srgb, var(--warn) 28%, transparent); color: var(--warn); }
.review-row.ask .mark { background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--muted); }
.review-row .req { font-size: 13.5px; line-height: 1.45; }
.review-row .detail { font-size: 12px; color: var(--muted); margin-top: 3px; }
.review-row code, .review-note code { font-family: var(--font-mono); font-size: .9em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.review-note { border: 1px solid var(--line); border-left: 3px solid var(--c, var(--info)); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; background: var(--panel); }
.review-note.warn { --c: var(--bad); } .review-note.tip { --c: var(--warn); } .review-note.good { --c: var(--good); }
.review-note:hover { border-color: var(--line-hover); border-left-color: var(--c, var(--info)); }
.review-note .top { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.review-note .tag { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--info)); }
.review-note .where { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.review-note .text { font-size: 13px; line-height: 1.55; color: var(--ink-soft); margin-top: 5px; }
.review-foot { font-size: 12px; color: var(--faint); line-height: 1.55; margin: 16px 2px 0; }

.test { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--panel); overflow: hidden; }
.test-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.test-head .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.test-head .mark svg { width: 11px; height: 11px; }
.test.ok .mark { background: color-mix(in srgb, var(--good) 28%, transparent); color: var(--good); }
.test.no .mark { background: color-mix(in srgb, var(--bad) 28%, transparent); color: var(--bad); }
.test-head .ms { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.test-body { display: none; border-top: 1px solid var(--line); padding: 12px; font-size: 13px; }
.test.open .test-body { display: block; }
.test-note { color: var(--ink-soft); margin-bottom: 10px; white-space: pre-wrap; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.io-box { border: 1px solid var(--line); border-radius: 7px; background: var(--code-bg); overflow: hidden; min-width: 0; }
.io-box.full { grid-column: 1 / -1; }
.io-box .cap { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 0; display: flex; }
.io-box pre { margin: 0; padding: 5px 10px 9px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow-y: auto; }
.io-box pre .diff { background: color-mix(in srgb, var(--bad) 22%, transparent); border-radius: 3px; display: inline-block; min-width: 8px; }
.io-box pre .same { opacity: .75; }
.io-box pre .ws { color: var(--faint); }

.problem { border: 1px solid var(--line); border-left: 3px solid var(--c, var(--bad)); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; background: var(--panel); cursor: pointer; }
.problem.warning { --c: var(--warn); } .problem.note { --c: var(--info); }
.problem:hover { border-color: var(--line-hover); border-left-color: var(--c, var(--bad)); }
.problem .where { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.problem .where b { color: var(--c, var(--bad)); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.problem .raw { font-family: var(--font-mono); font-size: 12.5px; margin: 5px 0 0; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.problem .help { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--ink-soft); }
.problem .help b { color: var(--ink); }

.solution-lock { text-align: center; padding: 30px 16px; color: var(--muted); }
.solution-lock svg { width: 26px; height: 26px; margin-bottom: 8px; }

.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.celebrate i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.5s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

