@import url("/static/vendor/highlightjs/vs2015.min.css");

:root {
    --bg: #f6f7f3;
    --surface: #ffffff;
    --surface-soft: #eef2ea;
    --ink: #1e2722;
    --muted: #647067;
    --line: #d9ded6;
    --primary: #246b55;
    --primary-strong: #174938;
    --accent: #b75d38;
    --warning: #a66a05;
    --danger: #a43f42;
    --shadow: 0 10px 30px rgba(31, 45, 38, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 247, 243, 0.94);
    backdrop-filter: blur(12px);
}

.brand {
    font-weight: 800;
    letter-spacing: 0;
}

.topbar-actions,
.action-row,
.meta-row,
.card-head,
.study-states {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions {
    justify-content: flex-end;
}

.user-chip,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    border: 1px solid var(--line);
    background: var(--surface);
    white-space: nowrap;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 36px;
    align-items: start;
    min-height: calc(100vh - 150px);
    padding-top: 32px;
}

.k12-landing {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 430px);
}

.k12-landing .auth-copy {
    padding-top: 18px;
}

.auth-copy {
    padding-top: 32px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 14px;
    font-size: clamp(2.3rem, 6vw, 4.7rem);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: 1.1rem;
}

h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.lede {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.6;
}

.lede.small {
    font-size: 1rem;
}

.study-states {
    flex-wrap: wrap;
    margin-top: 28px;
}

.study-states span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 700;
}

.auth-panels,
.stack,
.task-list,
.turn-list {
    display: grid;
    gap: 16px;
}

.panel,
.task-card,
.library-card,
.empty-state,
.turn-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 22px;
}

.task-card,
.library-card,
.turn-card {
    padding: 18px;
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.task-card p,
.library-card p,
.library-task-row p,
.turn-card p,
.empty-state p,
.description {
    color: var(--muted);
    line-height: 1.55;
}

.card-head {
    justify-content: space-between;
    align-items: flex-start;
}

.card-head h2,
.card-head h3 {
    margin-bottom: 0;
}

.meta-row {
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.task-library-tree {
    display: grid;
    gap: 10px;
}

.library-folder {
    min-width: 0;
}

.library-folder summary {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 42px;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    list-style: none;
}

.library-folder summary::-webkit-details-marker {
    display: none;
}

.library-folder-name {
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-folder-icon,
.library-file-icon {
    position: relative;
    width: 18px;
    height: 15px;
    flex: 0 0 auto;
}

.library-folder-icon::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 4px;
    width: 16px;
    height: 11px;
    border: 1px solid #c2b47e;
    border-radius: 2px;
    background: #f1d98b;
}

.library-folder-icon::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 1px;
    width: 8px;
    height: 5px;
    border: 1px solid #c2b47e;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    background: #f6e1a2;
}

.library-file-icon::before {
    content: "";
    position: absolute;
    inset: 1px 3px 1px 4px;
    border: 1px solid #aeb7b0;
    border-radius: 2px;
    background: #fbfcfa;
}

.library-file-icon::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 1px;
    width: 5px;
    height: 5px;
    border-left: 1px solid #aeb7b0;
    border-bottom: 1px solid #aeb7b0;
    background: #eef2ea;
}

.library-count {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.library-folder-contents {
    display: grid;
    gap: 8px;
    margin: 8px 0 0 16px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.library-type > summary {
    background: #fbfcfa;
}

.library-repo > summary {
    min-height: 38px;
    box-shadow: none;
}

.library-task-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.library-task-main {
    min-width: 0;
}

.library-task-title {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.library-task-title h4 {
    overflow: hidden;
    margin: 0;
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-task-row p {
    margin: 6px 0 8px;
    font-size: 0.9rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--primary-strong);
}

.button-danger {
    border-color: rgba(164, 63, 66, 0.36);
    background: #fbebeb;
    color: var(--danger);
}

.button-danger:hover {
    border-color: rgba(164, 63, 66, 0.55);
    background: #f5d9d9;
    color: var(--danger);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface-soft);
}

.button-secondary:hover,
.button-ghost:hover {
    border-color: #b9c2b8;
    background: #e5ebe0;
}

.button-ghost {
    border-color: transparent;
    background: transparent;
}

.button-github {
    width: 100%;
    margin-top: 14px;
    border-color: #24292f;
    background: #24292f;
    color: #ffffff;
}

.task-actions {
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
}

.task-actions form {
    margin: 0;
}

.button-external {
    gap: 8px;
}

.test-code-page {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.test-code-page h1 {
    max-width: 980px;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.test-code-source {
    display: grid;
    gap: 6px;
    margin: 18px 0 14px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.test-code-source code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: none;
}

.test-code-window {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: calc(100vh - 340px);
    min-height: 360px;
    margin: 0 0 18px;
    padding: 16px;
    overflow: auto;
    border: 1px solid rgba(36, 107, 85, 0.2);
    border-radius: 8px;
    background: #1d2a23;
    color: #eff8f0;
    font-size: 0.9rem;
    line-height: 1.55;
}

.test-code-window code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre;
}

.test-code-window.numbered {
    padding: 0;
}

.test-code-lines {
    min-width: 0;
    margin: 0;
    padding: 12px 0;
    list-style: none;
    counter-reset: code-line;
}

.test-code-lines li {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    min-height: 22px;
    padding: 0 14px;
}

.test-code-lines li.is-error-line {
    background: rgba(164, 63, 66, 0.32);
    box-shadow: inset 4px 0 0 var(--danger);
}

.code-line-number {
    color: #9fb3a9;
    user-select: none;
    text-align: right;
}

.test-code-lines code {
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.test-code-window.compact {
    max-height: 320px;
    min-height: 180px;
}

.assertion-error-panel {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    border: 1px solid rgba(164, 63, 66, 0.32);
    border-radius: 8px;
    background: #fbebeb;
}

.assertion-error-panel h2 {
    margin: 0;
    color: var(--danger);
}

.assertion-error-panel pre {
    max-height: 280px;
    margin: 0;
    overflow: auto;
    color: #762d30;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.test-run-details-page {
    width: min(1000px, 100%);
    margin: 0 auto;
}

.test-run-detail-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 16px;
    margin: 18px 0;
}

.test-run-detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.test-run-detail-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.base-tests-page {
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    overflow-x: hidden;
}

.base-test-list {
    display: grid;
    gap: 16px;
}

.base-test-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.base-test-card.is-failed {
    border-color: rgba(164, 63, 66, 0.3);
    background: rgba(164, 63, 66, 0.08);
}

.test-result-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.result-pass {
    border-color: rgba(36, 107, 85, 0.28);
    background: rgba(36, 107, 85, 0.1);
    color: var(--primary);
}

.result-fail,
.result-failed {
    border-color: rgba(164, 63, 66, 0.28);
    background: rgba(164, 63, 66, 0.1);
    color: var(--danger);
}

.base-test-error {
    color: var(--danger);
    overflow-wrap: anywhere;
}

.base-test-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.base-test-media-grid figure {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.base-test-media-grid figcaption {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.base-test-media-grid video,
.base-test-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
}

.base-test-placeholder strong,
.base-test-placeholder span {
    display: block;
}

.external-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1;
}

.action-menu {
    position: relative;
}

.action-menu summary {
    list-style: none;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.menu-button {
    width: 40px;
    min-width: 40px;
}

.menu-button span,
.menu-button span::before,
.menu-button span::after {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.menu-button span {
    position: relative;
}

.menu-button span::before,
.menu-button span::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-button span::before {
    top: -7px;
}

.menu-button span::after {
    top: 7px;
}

.action-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.action-menu-panel a,
.action-menu-panel button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

.action-menu-panel a:hover,
.action-menu-panel button:hover:not(:disabled) {
    background: var(--surface-soft);
}

.action-menu-panel button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.action-menu-error {
    display: block;
    max-width: 230px;
    padding: 6px 10px;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: normal;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfa;
    color: var(--ink);
    outline: none;
}

input {
    height: 42px;
    padding: 0 12px;
}

select {
    width: auto;
    min-width: 150px;
    height: 40px;
    padding: 0 34px 0 12px;
}

textarea {
    min-height: 150px;
    resize: vertical;
    padding: 12px;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 107, 85, 0.14);
}

.field-note {
    min-height: 20px;
    color: var(--muted);
    font-size: 0.86rem;
}

.field-note-good {
    color: var(--primary);
}

.field-note-bad {
    color: var(--danger);
}

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.notice-error {
    border: 1px solid rgba(164, 63, 66, 0.26);
    background: #fbebeb;
    color: var(--danger);
}

.page-title {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-title h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.split-title {
    align-items: start;
}

.content-grid,
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
    gap: 22px;
    align-items: start;
}

.main-column,
.side-column {
    display: grid;
    gap: 16px;
}

.empty-state {
    padding: 26px;
}

.empty-state.compact {
    padding: 18px;
}

.backend-state {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.backend-state div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.backend-state span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.backend-state strong {
    display: block;
    overflow-wrap: anywhere;
}

.status-not_started {
    color: #4b5563;
}

.status-running {
    border-color: rgba(166, 106, 5, 0.3);
    background: #fff6df;
    color: var(--warning);
}

.status-creating_repo {
    border-color: rgba(166, 106, 5, 0.3);
    background: #fff6df;
    color: var(--warning);
}

.status-repo_ready {
    border-color: rgba(36, 107, 85, 0.3);
    background: #e6f2ed;
    color: var(--primary);
}

.status-repo_creation_failed {
    border-color: rgba(164, 63, 66, 0.26);
    background: #fbebeb;
    color: var(--danger);
}

.status-agent_failed {
    border-color: rgba(164, 63, 66, 0.26);
    background: #fbebeb;
    color: var(--danger);
}

.status-ready_for_review {
    border-color: rgba(36, 107, 85, 0.3);
    background: #e6f2ed;
    color: var(--primary);
}

.status-completed {
    border-color: rgba(42, 82, 126, 0.24);
    background: #e8eef7;
    color: #2a527e;
}

.turn-note {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.turn-result {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.turn-result span:first-child {
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.dictation-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.mic-button {
    position: relative;
    color: var(--ink);
}

.mic-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.mic-button.is-listening {
    border-color: rgba(183, 93, 56, 0.36);
    background: #fff0e9;
    color: var(--accent);
}

.mic-button.is-error {
    border-color: rgba(164, 63, 66, 0.26);
    background: #fbebeb;
    color: var(--danger);
}

.mic-button.is-unavailable {
    color: var(--muted);
}

.dictation-clear {
    min-height: 40px;
}

.narrow {
    width: min(680px, 100%);
    margin: 60px auto;
}

.code-block {
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    background: #1f2723;
    color: #eef7f1;
}

.code-title h1 {
    font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.vscode-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.vscode-breadcrumbs a {
    color: var(--primary);
    font-weight: 800;
}

.vscode-shell {
    display: grid;
    grid-template-columns: 48px minmax(220px, 300px) minmax(0, 1fr);
    grid-template-rows: minmax(620px, calc(100vh - 260px)) 28px;
    overflow: hidden;
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    background: #1e1e1e;
    color: #cccccc;
    box-shadow: var(--shadow);
}

.vscode-activity {
    grid-row: 1 / span 2;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 10px 7px;
    background: #333333;
}

.vscode-activity span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: transparent;
    position: relative;
}

.vscode-activity span::before {
    content: "";
    width: 18px;
    height: 20px;
    border: 2px solid #c5c5c5;
    border-top-width: 5px;
    border-radius: 2px;
}

.vscode-activity .is-active {
    background: #414141;
}

.vscode-sidebar {
    min-width: 0;
    overflow: hidden;
    border-right: 1px solid #2b2b2b;
    background: #252526;
}

.vscode-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid #2b2b2b;
    color: #bbbbbb;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vscode-sidebar-head span {
    color: #858585;
}

.vscode-repo-name {
    overflow: hidden;
    padding: 9px 12px;
    color: #dddddd;
    font-size: 0.84rem;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.vscode-tree {
    display: block;
    max-height: calc(100vh - 470px);
    overflow: auto;
    padding-bottom: 10px;
}

.vscode-tree-item {
    display: grid;
    grid-template-columns: 16px 18px minmax(0, 1fr) 24px;
    align-items: center;
    width: 100%;
    min-height: 28px;
    border: 0;
    padding-right: 8px;
    padding-left: calc(8px + (var(--tree-depth) * 14px));
    background: transparent;
    color: #cccccc;
    cursor: pointer;
    font-size: 0.88rem;
    text-align: left;
}

.vscode-tree-item:hover,
.vscode-tree-item.is-active {
    background: #37373d;
}

.vscode-tree-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
}

.vscode-tree-icon.is-folder::before {
    content: "";
    position: absolute;
    left: 1px;
    top: 5px;
    width: 14px;
    height: 9px;
    border-radius: 2px;
    background: #dcb67a;
}

.vscode-tree-icon.is-folder::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 3px;
    width: 7px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: #e3c38a;
}

.vscode-tree-icon.is-file::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 2px;
    width: 10px;
    height: 12px;
    border-radius: 2px;
    background: #c5c5c5;
}

.vscode-tree-icon.is-file::after {
    content: "";
    position: absolute;
    right: 3px;
    top: 2px;
    width: 4px;
    height: 4px;
    background: #8f8f8f;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.vscode-tree-twist {
    color: #858585;
    font-size: 0.64rem;
    text-align: center;
}

.vscode-folder-toggle[aria-expanded="true"] .vscode-tree-twist::before {
    content: "v";
}

.vscode-folder-toggle[aria-expanded="false"] .vscode-tree-twist::before {
    content: ">";
}

.vscode-tree-children[hidden] {
    display: none;
}

.vscode-tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vscode-tree-item.status-M .vscode-tree-label,
.vscode-tree-item.status-A .vscode-tree-label,
.vscode-tree-item.status-R .vscode-tree-label,
.vscode-tree-item.status-C .vscode-tree-label,
.vscode-tree-item.status-D .vscode-tree-label,
.vscode-tree-item.has-git-child .vscode-tree-label {
    color: #d7ba7d;
}

.vscode-tree-note,
.vscode-changes-empty {
    padding: 8px 12px;
    color: #858585;
    font-size: 0.82rem;
}

.vscode-git-badge,
.vscode-tab-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #3a3d41;
    color: #cccccc;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.vscode-tree-item .vscode-git-badge,
.vscode-tree-item .vscode-git-dot {
    justify-self: end;
}

.vscode-git-dot {
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    background: #d7ba7d;
}

.vscode-git-badge.git-A,
.vscode-tab-status.git-A {
    background: #164b2b;
    color: #89d185;
}

.vscode-git-badge.git-M,
.vscode-git-badge.git-R,
.vscode-git-badge.git-C,
.vscode-git-badge.git-T,
.vscode-tab-status.git-M,
.vscode-tab-status.git-R,
.vscode-tab-status.git-C,
.vscode-tab-status.git-T {
    background: #4a3b16;
    color: #d7ba7d;
}

.vscode-git-badge.git-D,
.vscode-tab-status.git-D {
    background: #5a1d1d;
    color: #f48771;
}

.vscode-changes {
    border-top: 1px solid #2b2b2b;
    padding-bottom: 10px;
}

.vscode-section-title {
    min-height: 30px;
    padding: 8px 12px 5px;
    color: #bbbbbb;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vscode-change-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    color: #cccccc;
    font-size: 0.82rem;
}

.vscode-change-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vscode-change-item:hover {
    background: #37373d;
}

.vscode-change-item.is-deleted {
    cursor: default;
    color: #858585;
}

.vscode-editor {
    min-width: 0;
    overflow: hidden;
    background: #1e1e1e;
}

.vscode-tabs {
    display: flex;
    overflow-x: auto;
    min-height: 38px;
    border-bottom: 1px solid #2b2b2b;
    background: #252526;
}

.vscode-tab {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    max-width: 240px;
    min-width: 132px;
    min-height: 38px;
    padding: 0 14px;
    border-right: 1px solid #2b2b2b;
    color: #cccccc;
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vscode-tab span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.vscode-tab.is-active {
    background: #1e1e1e;
    color: #ffffff;
}

.vscode-path {
    min-height: 32px;
    padding: 7px 14px;
    border-bottom: 1px solid #2b2b2b;
    color: #9cdcfe;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vscode-list {
    display: grid;
    align-content: start;
    height: calc(100% - 70px);
    overflow: auto;
    padding: 8px 0;
}

.vscode-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 90px;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    color: #cccccc;
    font-size: 0.9rem;
}

.vscode-row > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vscode-row > span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    color: #858585;
}

.vscode-row:hover {
    background: #2a2d2e;
}

.vscode-row-kind {
    color: #858585;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.vscode-file-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 6px 12px;
    border-bottom: 1px solid #2b2b2b;
    background: #1e1e1e;
    color: #858585;
    font-size: 0.84rem;
}

.vscode-file-actions .button {
    min-height: 32px;
    border-color: #3c3c3c;
    background: #2d2d30;
    color: #cccccc;
}

.vscode-preview {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
    height: calc(100% - 114px);
    min-height: 500px;
    margin: 0;
    overflow: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
    line-height: 1.55;
}

.code-gutter {
    position: sticky;
    left: 0;
    z-index: 1;
    display: block;
    min-height: 100%;
    padding-bottom: 18px;
    background: #1e1e1e;
    color: #858585;
    text-align: right;
    user-select: none;
}

.code-gutter span {
    display: block;
    min-height: 22px;
    padding: 0 12px;
}

.code-highlight {
    display: block;
    min-width: max-content;
    padding-right: 18px;
    padding-bottom: 18px;
    color: #d4d4d4;
    white-space: pre;
}

.vscode-preview.hljs {
    padding: 0;
    background: #1e1e1e;
}

.vscode-empty-editor {
    display: grid;
    place-items: center;
    min-height: 500px;
    color: #858585;
    font-size: 0.95rem;
}

.code-line {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 22px;
}

.code-line span {
    padding: 0 12px;
    color: #858585;
    text-align: right;
    user-select: none;
}

.code-line code {
    padding-right: 18px;
    white-space: pre;
}

.vscode-status {
    grid-column: 2 / span 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 0 10px;
    background: #246b55;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0 24px;
}

.summary-tile {
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.summary-tile span,
.summary-tile small {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-tile strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 2rem;
    line-height: 1;
}

.video-grid {
    display: grid;
    gap: 18px;
}

.video-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.video-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.video-card h3 {
    overflow-wrap: anywhere;
    margin-bottom: 0;
}

.video-card video {
    display: block;
    width: 100%;
    max-height: min(68vh, 720px);
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101511;
}

.ide-loading-panel {
    display: grid;
    gap: 16px;
}

.ide-loading-panel h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.ide-loading-panel.is-error .ide-loading-meter span {
    animation: none;
    background: var(--danger);
}

.ide-loading-meter {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-soft);
}

.ide-loading-meter span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -35%;
    width: 35%;
    border-radius: inherit;
    background: var(--primary);
    animation: ide-loading-sweep 1.25s ease-in-out infinite;
}

@keyframes ide-loading-sweep {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(390%);
    }
}

@media (max-width: 860px) {
    .auth-layout,
    .content-grid,
    .detail-grid,
    .summary-grid,
    .vscode-shell {
        grid-template-columns: 1fr;
    }

    .vscode-shell {
        grid-template-rows: auto auto minmax(560px, 70vh) 28px;
    }

    .vscode-activity {
        grid-row: auto;
        display: flex;
    }

    .vscode-status {
        grid-column: 1;
    }

    .auth-copy {
        padding-top: 0;
    }

    .task-card,
    .library-task-row {
        grid-template-columns: 1fr;
    }

    .backend-state {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .topbar {
        padding: 0 16px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .shell {
        width: min(100% - 22px, 1180px);
        padding-top: 22px;
    }

    .panel,
    .task-card,
    .library-card,
    .library-task-row,
    .turn-card,
    .empty-state {
        padding: 16px;
    }

    .page-title,
    .split-title,
    .card-head,
    .video-card-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .task-actions {
        align-items: stretch;
    }

    .task-actions .action-menu {
        justify-self: end;
    }

    .task-actions .menu-button {
        width: 40px;
    }
}
