:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, sans-serif; background: #10151d; color: #dce3ec; }
* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
body { margin: 0; min-width: 1080px; }
button { border: 1px solid #3b4655; border-radius: 4px; background: #242c37; color: #e9eef5; cursor: pointer; font: inherit; padding: 0.48rem 0.72rem; }
button:hover { background: #313c4a; }
button:disabled { cursor: wait; opacity: 0.65; }
button:focus-visible, select:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid #75c6ff; outline-offset: 2px; }
code { color: #a9d7ff; font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }

.workspace-container { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100vh; height: 100dvh; min-width: 0; min-height: 0; overflow: hidden; }
.application-title-bar { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid #293341; background: #171e28; padding: 0.65rem 1.4rem; }
.application-title-bar h1 { margin: 0; font-size: 1.3rem; font-weight: 750; letter-spacing: 0.01em; }
.workspace-shell { --left-panel-width: 45%; display: grid; grid-template-columns: minmax(0, var(--left-panel-width)) 1px minmax(0, 1fr); width: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.challenge-documentation { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: #161d27; }
.workspace-divider { position: relative; z-index: 1; background: #293341; cursor: col-resize; touch-action: none; user-select: none; }
.workspace-divider::before { position: absolute; top: 0; bottom: 0; left: -5px; width: 11px; content: ""; }
.workspace-divider:hover, .workspace-divider.is-dragging { background: #4b647b; }
body.workspace-resizing { cursor: col-resize; user-select: none; }
body.workspace-resizing * { cursor: col-resize !important; }
.documentation-tabs { display: flex; gap: 0.15rem; border-bottom: 1px solid #293341; padding: 0.65rem 1.4rem 0; }
.documentation-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #9daaba; padding: 0.5rem 0.7rem 0.4rem; }
.documentation-tabs button[aria-selected="true"] { border-bottom-color: #5bb7ff; color: #eef6ff; }
.documentation-tab-content { overflow-y: auto; padding: 1.5rem 1.4rem 2.5rem; }
.challenge-documentation h1 { margin: 0 0 0.6rem; font-size: 1.55rem; }
.challenge-documentation h2 { margin: 1.65rem 0 0.6rem; color: #f1f5f9; font-size: 0.96rem; }
.challenge-documentation p { color: #b7c2d0; line-height: 1.52; }
.documentation-steps { color: #b7c2d0; line-height: 1.52; padding-left: 1.4rem; }
.documentation-steps li + li { margin-top: 0.35rem; }
.documentation-example { overflow-x: auto; border: 1px solid #293341; background: #10151d; color: #dce3ec; padding: 0.8rem; white-space: pre; }
.eyebrow { margin: 0 0 0.3rem; color: #67b7ff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.method-list { margin: 0; }
.method-list dt { margin-top: 0.72rem; font-weight: 700; }
.method-list dd { margin: 0.2rem 0 0; color: #b7c2d0; line-height: 1.42; }
.local-only-note { margin-top: 1.8rem; border-left: 2px solid #4b9cd5; padding-left: 0.8rem; font-size: 0.88rem; }

.workspace-main { display: grid; grid-template-rows: minmax(260px, 1fr) minmax(200px, 31%); min-width: 0; min-height: 0; overflow: hidden; }
.toolbar-actions { display: flex; align-items: end; gap: 0.45rem; min-width: 0; }
.toolbar-field { display: grid; gap: 0.2rem; color: #aebccc; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.toolbar-field select { min-width: 8.6rem; border: 1px solid #3b4655; border-radius: 4px; background: #242c37; color: #e9eef5; font: inherit; letter-spacing: 0; padding: 0.46rem 0.55rem; text-transform: none; }
.toolbar-field select:disabled { cursor: wait; opacity: 0.65; }
.primary-button { border-color: #1c75b8; background: #1671b5; }
.primary-button:hover { background: #2586cf; }
.editor-area { grid-row: 1; min-height: 0; background: #1e1e1e; }
.monaco-editor-host { width: 100%; height: 100%; min-height: 260px; }
.workspace-loading { display: grid; min-height: 100vh; place-items: center; background: #10151d; color: #c3cedb; }

.workspace-output { grid-row: 2; display: grid; min-width: 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); border-top: 1px solid #293341; background: #131922; }
.output-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 0 0.75rem; min-width: 0; border-bottom: 1px solid #293341; background: #171e28; padding: 0 0.7rem; }
.output-tabs { display: flex; align-self: stretch; flex: 1 1 auto; min-width: 0; gap: 0.15rem; }
.output-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #9daaba; padding: 0.65rem 0.85rem 0.5rem; }
.output-tabs button.active { border-bottom-color: #5bb7ff; color: #eef6ff; }
.output-actions { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; padding: 0.35rem 0; }
.output-content { min-width: 0; min-height: 0; overflow: auto; padding: 1rem 1.25rem; color: #c3cedb; }
.output-content p { margin-top: 0; }
.output-lifecycle { margin: 0; color: #c3cedb; font: inherit; white-space: pre-wrap; }
.strategy-run-result h3 { margin: 0 0 0.55rem; font-size: 1rem; }
.strategy-run-result h4 { margin: 1.1rem 0 0.45rem; color: #eef6ff; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.result-section + .result-section { margin-top: 1.25rem; border-top: 1px solid #293341; padding-top: 0.1rem; }
.score-note { color: #d8b36c; line-height: 1.5; }
.result-status { color: #9dacbd; font-size: 0.78rem; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; }
.elapsed-time { color: #9dacbd; font-size: 0.85rem; }
.saved-scorecard { color: #88d6a5; }
.benchmark-history { margin-top: 1.5rem; border-top: 1px solid #293341; padding-top: 1rem; }
.benchmark-history h3 { margin: 0 0 0.7rem; font-size: 1rem; }
.history-list { display: grid; max-width: 52rem; gap: 0.4rem; }
.history-item { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(11rem, 1fr) minmax(12rem, 1fr); gap: 0.75rem; text-align: left; }
.history-item span { color: #b7c2d0; font-size: 0.85rem; }
.history-item.active { border-color: #5bb7ff; background: #1d3447; }
.historical-scorecard { margin-top: 1.25rem; border-top: 1px solid #293341; padding-top: 1.25rem; }
.source-snapshot { max-height: 18rem; overflow: auto; border: 1px solid #293341; background: #10151d; color: #dce3ec; padding: 0.8rem; white-space: pre-wrap; }
.benchmark-result { display: grid; grid-template-columns: max-content max-content; gap: 0.3rem 1rem; margin-top: 0.8rem; }
.benchmark-result dt { color: #94a5b8; }
.benchmark-result dd { margin: 0; color: #f0f6ff; }
.problem-list { display: grid; gap: 0.65rem; }
.problem { border: 0; border-left: 3px solid #bf4f57; border-radius: 0; background: #241b21; padding: 0.65rem 0.8rem; text-align: left; }
.problem.warning { border-left-color: #d8a53b; background: #272217; }
.problem strong { margin-right: 0.6rem; }
.problem span { color: #aebccc; font-size: 0.9rem; }
.problem p { margin: 0.35rem 0 0; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; padding: 0.75rem 1rem; background: #8a2525; color: white; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 1366px) {
  body { min-width: 1060px; }
  .output-toolbar { padding-inline: 0.5rem; }
  .toolbar-actions { gap: 0.35rem; }
  .output-actions { flex-basis: 100%; }
  button { padding: 0.43rem 0.62rem; }
}
