.icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.icon--small { width: 16px; height: 16px; }
.icon--tiny { width: 13px; height: 13px; }

.meta-label,
.document-path {
    color: var(--muted);
    font-size: 11px;
}

.document-path {
    padding-bottom: 7px;
    border-bottom: 1px dotted var(--muted);
}

.placeholder-note {
    color: var(--orange-dark);
    font-style: italic;
}

.pixel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--inset-raised);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.pixel-button:hover { background: var(--surface-sunk); }
.pixel-button:active { box-shadow: var(--inset-sunk); transform: translate(1px, 1px); }
.pixel-button--primary { background: var(--orange); }
.pixel-button:disabled { cursor: not-allowed; opacity: 0.5; }

.readme-document {
    width: min(690px, 100%);
    min-height: 100%;
    padding: clamp(22px, 4vw, 42px);
    background: var(--surface-raised);
}

.readme-document h1 {
    max-width: 620px;
    margin: 30px 0 10px;
    font-size: clamp(29px, 5vw, 52px);
    line-height: 0.98;
}

.readme-lead {
    max-width: 590px;
    margin-bottom: 28px;
    font-size: 17px;
}

.readme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin: 26px 0;
    padding: 20px 0;
    border-block: 2px solid var(--border);
}

.readme-grid h3 { margin-bottom: 10px; font-size: 13px; }
.plain-list { margin: 0; padding-left: 18px; }
.file-links { margin: 0; padding: 0; list-style: none; }
.file-links button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 3px;
    border: 0;
    background: transparent;
    text-align: left;
    text-decoration: underline;
}
.file-links button:hover { background: var(--orange); }

.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.guided-route {
    margin-top: 28px;
    border: 2px solid var(--border);
}

.guided-route__intro {
    position: relative;
    padding: 12px 14px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-sunk);
}

.guided-route__intro > span {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 5px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 9px;
}

.guided-route__intro h3,
.guided-route__intro p {
    margin-bottom: 2px;
}

.guided-route__intro p {
    color: var(--muted);
    font-size: 11px;
}

.guided-route ol {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.guided-route li {
    min-width: 0;
    border-right: 1px solid var(--border);
}

.guided-route li:last-child {
    border-right: 0;
}

.guided-route button {
    display: grid;
    width: 100%;
    min-height: 78px;
    padding: 8px;
    border: 0;
    background: var(--surface-raised);
    text-align: left;
}

.guided-route button:hover,
.guided-route li.is-current button {
    background: var(--orange);
}

.guided-route button > span {
    color: var(--muted);
    font-size: 10px;
}

.guided-route button small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.approach-document {
    min-height: 100%;
    padding: clamp(22px, 4vw, 40px);
    background: var(--surface-raised);
}

.approach-document > header {
    position: relative;
    max-width: 760px;
}

.approach-document > header h3 {
    max-width: 680px;
    margin: 24px 0 10px;
    font-size: clamp(25px, 4vw, 42px);
    line-height: 1.02;
}

.approach-document > header > p:last-child {
    max-width: 690px;
    font-size: 15px;
}

.route-counter {
    display: inline-block;
    padding: 4px 6px;
    border: 2px solid var(--border);
    background: var(--orange);
    font-size: 10px;
    font-weight: 700;
}

.approach-document > header .route-counter {
    position: absolute;
    top: 34px;
    right: 0;
}

.route-counter--toolbar {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.problem-inbox {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 30px;
    padding: 12px;
    border: 2px solid var(--border);
    background: var(--surface-sunk);
}

.problem-inbox .meta-label {
    grid-column: 1 / -1;
    margin-bottom: 4px;
}

.problem-inbox button {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    min-height: 46px;
    padding: 6px;
    border: 1px solid var(--border);
    background: var(--surface-raised);
    text-align: left;
}

.problem-inbox button span {
    color: var(--orange-dark);
    font-size: 10px;
}

.problem-inbox button:hover,
.problem-inbox button.is-active {
    background: var(--orange);
}

.problem-response {
    padding: 14px;
    border: 2px solid var(--border);
    border-top: 0;
    background: var(--surface-dark);
    color: var(--surface);
}

.problem-response .meta-label {
    margin-bottom: 4px;
    color: var(--orange);
}

.problem-response p:last-child {
    margin: 0;
}

.method-flow {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin: 28px 0;
    padding: 0;
    border: 2px solid var(--border);
    list-style: none;
}

.method-flow li {
    position: relative;
    min-width: 0;
    border-right: 1px solid var(--border);
}

.method-flow li:last-child {
    border-right: 0;
}

.method-flow li:not(:last-child)::after {
    position: absolute;
    z-index: 2;
    top: 16px;
    right: -7px;
    width: 12px;
    height: 12px;
    border: solid var(--border);
    border-width: 2px 2px 0 0;
    background: var(--surface-raised);
    content: "";
    transform: rotate(45deg);
}

.method-flow button {
    display: grid;
    width: 100%;
    min-height: 150px;
    align-content: start;
    gap: 6px;
    padding: 11px;
    border: 0;
    background: var(--surface-raised);
    text-align: left;
}

.method-flow button:hover,
.method-flow button.is-active {
    background: var(--surface-sunk);
}

.method-flow button span {
    color: var(--orange-dark);
    font-size: 10px;
}

.method-flow button small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.approach-document blockquote {
    margin: 0;
    padding: 15px 18px;
    border-left: 7px solid var(--orange);
    background: var(--surface-sunk);
    font-size: 17px;
    font-weight: 700;
}

.next-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 2px solid var(--border);
}

.next-route div {
    display: grid;
}

.next-route span {
    color: var(--muted);
    font-size: 10px;
}

.tabbar {
    display: flex;
    gap: 2px;
    padding: 8px 8px 0;
    border-bottom: 2px solid var(--border);
    background: var(--surface-sunk);
    overflow: auto hidden;
}

.tab {
    min-height: 34px;
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-bottom: 0;
    background: var(--bg);
    white-space: nowrap;
}

.tab.is-active {
    position: relative;
    bottom: -2px;
    background: var(--surface);
    font-weight: 700;
}

.tab-panel {
    padding: clamp(18px, 4vw, 34px);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-header h3 { margin: 0; font-size: 26px; }
.profile-header p { margin-bottom: 3px; }

.profile-avatar,
.machine-icon {
    display: grid;
    width: 80px;
    height: 80px;
    flex: 0 0 auto;
    border: 3px solid var(--border);
    background: var(--orange);
    box-shadow: 5px 5px 0 var(--border);
    font-size: 29px;
    font-weight: 700;
    place-items: center;
}

.system-properties {
    display: grid;
    margin: 0 0 25px;
    border: 2px solid var(--border);
}

.system-properties div,
.case-meta div {
    display: grid;
    grid-template-columns: 140px 1fr;
    border-bottom: 1px solid var(--border);
}

.system-properties div:last-child,
.case-meta div:last-child { border-bottom: 0; }
.system-properties dt,
.system-properties dd,
.case-meta dt,
.case-meta dd { margin: 0; padding: 7px 10px; }
.system-properties dt,
.case-meta dt { border-right: 1px solid var(--border); background: var(--surface-sunk); font-weight: 700; }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    background: var(--green);
}

.body-copy { max-width: 620px; }

.process-list {
    display: grid;
    margin-top: 28px;
    border-block: 2px solid var(--border);
}

.process-list span {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 4px;
    border-bottom: 1px dotted var(--muted);
}
.process-list em { color: var(--orange-dark); }
.history-log { padding: 0; list-style: none; }
.history-log li { display: grid; grid-template-columns: 42px 1fr; padding: 10px 0; border-bottom: 1px dotted var(--muted); }
.terminal-list { padding-left: 18px; }

.explorer-toolbar {
    display: flex;
    gap: 6px;
    padding: 7px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-sunk);
}

.tool-button {
    width: 34px;
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: var(--inset-raised);
}

.address-bar {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    border: 2px solid var(--border);
    background: var(--surface-raised);
    box-shadow: var(--inset-sunk);
}
.address-bar span { align-self: stretch; padding: 5px 7px; border-right: 2px solid var(--border); background: var(--surface-sunk); font-size: 10px; }
.address-bar code { padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.explorer-layout {
    display: grid;
    grid-template-columns: 205px 1fr;
    min-height: 100%;
}

.folder-tree {
    padding: 12px 7px;
    border-right: 2px solid var(--border);
    background: var(--surface-sunk);
}
.folder-tree p { padding: 0 6px 6px; font-weight: 700; }
.tree-item { display: block; width: 100%; padding: 5px 6px; border: 0; background: transparent; text-align: left; }
.tree-item:hover,
.tree-item.is-current { background: var(--orange); }
.tree-item--nested { padding-left: 18px; }

.file-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    align-content: start;
    gap: 8px;
    padding: 14px;
}

.file-entry {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 76px;
    padding: 8px;
    border: 2px solid transparent;
    background: transparent;
    text-align: left;
}
.file-entry:hover,
.file-entry:focus-visible { border-color: var(--border); background: var(--surface-sunk); }
.file-entry__icon { grid-row: 1 / 3; width: 38px; height: 38px; }
.file-entry__name { align-self: end; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-entry__meta { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-entry--proof { border-color: var(--orange); background: rgba(255, 90, 0, 0.09); }

.case-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-raised);
}
.case-header h3 { margin: 9px 0 2px; font-size: 25px; }
.case-header p { max-width: 590px; margin-bottom: 0; }
.case-type { max-width: 240px; padding: 5px 7px; border: 2px solid var(--border); background: var(--orange); font-size: 10px; font-weight: 700; }

.case-layout {
    display: grid;
    grid-template-columns: 190px 1fr;
    min-height: calc(100% - 122px);
}
.case-files { padding: 8px; border-right: 2px solid var(--border); background: var(--surface-sunk); }
.case-file { display: block; width: 100%; padding: 8px; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 11px; text-align: left; text-decoration: none; }
.case-file:hover,
.case-file.is-active { border-color: var(--border); background: var(--orange); }
.case-document { min-width: 0; padding: clamp(18px, 4vw, 35px); background: var(--surface-raised); }
.case-document h4 { margin-bottom: 24px; font-size: 22px; }
.case-document h5 { margin: 24px 0 7px; font-size: 12px; }
.case-meta { margin: 0 0 25px; border: 2px solid var(--border); }
.stack-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; list-style: none; }
.stack-list li { padding: 6px 8px; border: 2px solid var(--border); background: var(--surface-sunk); }

.developer-note,
.folder-note {
    margin-top: 28px;
    padding: 14px;
    border: 2px solid var(--border);
    background: var(--surface-sunk);
}

.developer-note > span {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 5px;
    background: var(--orange);
    font-size: 9px;
    font-weight: 700;
}

.folder-note b {
    font-size: 11px;
}

.folder-note p {
    margin: 5px 0 0;
}

.empty-media img { border: 2px solid var(--border); image-rendering: auto; }
.empty-media p { margin-top: 12px; }
.screenshot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.screenshot-thumb { padding: 0; border: 2px solid var(--border); background: var(--surface); text-align: left; }
.screenshot-thumb img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.screenshot-thumb span { display: block; padding: 7px; }

.system-info-head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-raised);
}
.system-info-head h3 { margin: 2px 0 4px; }
.capability-list { padding: 8px 20px 20px; }
.capability-row { display: grid; grid-template-columns: 145px 150px 1fr; align-items: start; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.capability-label h4 { margin: 0; }
.capability-label span { color: var(--muted); font-size: 10px; }
.capability-state { margin-top: 2px; color: var(--muted); font-size: 10px; }
.capability-state span { color: var(--orange); }
.capability-row ul { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; padding: 0; list-style: none; font-size: 11px; }
.capability-row li::before { color: var(--orange); content: "■ "; }

.proof-links {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 18px;
}

.proof-links > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 10px;
}

.proof-links button {
    padding: 7px 9px;
    border: 2px solid var(--border);
    background: var(--surface-raised);
    box-shadow: var(--inset-raised);
    font-size: 10px;
}

.window--experiments .window-body,
.window--trash .window-body,
.window--private .window-body { padding: 24px; }
.experiment-list { display: grid; margin-top: 24px; border: 2px solid var(--border); }
.experiment-list > div { display: grid; grid-template-columns: 44px 1fr; padding: 10px; border-bottom: 1px solid var(--border); }
.experiment-list > div:last-child { border-bottom: 0; }
.experiment-list span { grid-row: 1 / 3; }
.experiment-list p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.contact-console,
.document-viewer { min-height: 100%; padding: clamp(24px, 6vw, 48px); background: var(--surface-raised); }
.contact-console h3 { margin: 6px 0; font-size: 32px; }
.contact-details { margin: 30px 0 22px; border-block: 2px solid var(--border); }
.contact-details div { display: grid; grid-template-columns: 110px 1fr; padding: 10px 0; border-bottom: 1px dotted var(--muted); }
.contact-details div:last-child { border-bottom: 0; }
.contact-details dt { font-weight: 700; }
.contact-details a { color: inherit; }
.copy-status { min-height: 20px; margin-top: 8px; color: var(--orange-dark); }

.document-viewer { text-align: center; }
.document-viewer__icon { width: 94px; height: 94px; margin: 0 auto 14px; }
.document-viewer h3 { font-size: 25px; }
.system-notice { display: inline-block; margin: 8px auto 14px; padding: 9px; border: 2px solid var(--border); background: var(--orange); }

.terminal {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 100%;
    padding: 16px;
    overflow: hidden;
    background: var(--surface-dark);
    color: #ddd9cf;
}
.terminal-output { overflow: auto; scrollbar-color: var(--orange) #292929; }
.terminal-output p { margin-bottom: 6px; white-space: pre-wrap; }
.terminal-output b,
.terminal-accent { color: var(--orange); }
.terminal-muted { color: #8e8b84; }
.terminal-form { display: flex; align-items: center; gap: 8px; padding-top: 7px; border-top: 1px solid #454545; }
.terminal-form label { color: var(--orange); white-space: nowrap; }
.terminal-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--surface); caret-color: var(--orange); }

.trash-list { display: grid; margin-top: 20px; border: 2px solid var(--border); }
.trash-list span { display: flex; align-items: center; gap: 8px; padding: 9px; border-bottom: 1px solid var(--border); background: var(--surface-raised); }
.trash-list span:last-child { border-bottom: 0; }
.trash-footnote { margin-top: 18px; color: var(--muted); }

.settings-list { padding: 16px; }
.settings-list label { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 10px; border-bottom: 1px solid var(--border); }
.settings-list label span { display: grid; }
.settings-list small { color: var(--muted); }
.settings-list input { width: 44px; height: 24px; accent-color: var(--orange); }

.private-files details { border-bottom: 1px solid var(--border); }
.private-files summary { display: flex; align-items: center; gap: 7px; padding: 10px; font-weight: 700; }
.private-files details[open] summary { background: var(--orange); }
.private-files details p { padding: 14px; background: var(--surface-raised); white-space: pre-line; }

.system-dialog,
.image-viewer {
    position: fixed;
    z-index: 9500;
    inset: 0;
    display: grid;
    padding: 20px;
    background: rgba(22, 22, 22, 0.55);
    place-items: center;
}

.dialog-window {
    width: min(430px, 100%);
    border: 2px solid var(--border);
    background: var(--surface);
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.35);
}
.dialog-window header { padding: 8px; border-bottom: 2px solid var(--border); background: var(--orange); }
.dialog-window h2 { margin: 0; font-size: 12px; }
.dialog-window p { min-height: 70px; padding: 22px; white-space: pre-line; }
.dialog-window button { margin: 0 22px 20px; min-width: 80px; }

.image-viewer { background: rgba(22, 22, 22, 0.9); color: var(--surface); }
.image-viewer__toolbar { position: absolute; top: 12px; right: 12px; left: 12px; display: flex; justify-content: space-between; padding: 7px 10px; border: 2px solid var(--surface); background: var(--surface-dark); }
.image-viewer__toolbar div { display: flex; gap: 5px; }
.image-viewer__toolbar button { width: 28px; border: 1px solid var(--surface); background: transparent; color: inherit; }
.image-viewer figure { max-width: min(1100px, 95vw); margin-top: 38px; }
.image-viewer img { max-height: 78vh; margin: auto; border: 2px solid var(--surface); }
.image-viewer figcaption { margin-top: 8px; text-align: center; }

.crash-screen {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: grid;
    padding: 30px;
    background: #0718a8;
    color: white;
    font-size: clamp(15px, 2vw, 24px);
    place-items: center;
}
.crash-screen div { max-width: 760px; }
