:root {
    color-scheme: light;
    --ink: #15171a;
    --muted: #606772;
    --line: #d9dee6;
    --panel: #ffffff;
    --wash: #f5f7fa;
    --brand: #2366a8;
    --brand-dark: #174775;
    --accent: #0f766e;
    --warning: #a16207;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(30, 41, 59, .12);
    --nav: #111827;
    --field: #f8fafc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--wash);
    color: var(--ink);
    font: 14px/1.45 "Segoe UI", Arial, sans-serif;
}

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

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

button,
.icon-button {
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    min-height: 38px;
    padding: 0 14px;
}

button:hover,
.icon-button:hover {
    background: var(--brand-dark);
}

.button-link {
    align-items: center;
    background: var(--brand);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    min-height: 38px;
    padding: 0 14px;
}

.button-link:hover {
    background: var(--brand-dark);
}

.secondary-button,
.text-button,
.secondary-link {
    background: #eef2f7;
    color: var(--ink);
}

.secondary-button:hover,
.text-button:hover,
.secondary-link:hover {
    background: #dfe7f1;
}

.secondary-link {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-weight: 800;
    min-height: 38px;
    padding: 0 12px;
}

.danger-button {
    background: #fee2e2;
    color: var(--danger);
}

.danger-button:hover {
    background: #fecaca;
}

.text-button {
    min-height: 28px;
    padding: 0 8px;
}

.topbar {
    align-items: center;
    background: var(--nav);
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 86px;
    padding: 18px 28px;
}

.app-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.app-nav a {
    border: 1px solid #374151;
    border-radius: 6px;
    color: #e5e7eb;
    font-weight: 800;
    padding: 8px 10px;
}

.app-nav a:hover {
    background: #1f2937;
}

.app-nav form {
    margin: 0;
}

.app-nav button {
    background: #e5e7eb;
    color: #111827;
    min-height: 36px;
}

.org-badge {
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #bfdbfe;
    font-weight: 800;
    padding: 8px 10px;
}

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

.topbar h1,
.summary h2,
.section-heading h3 {
    letter-spacing: 0;
    margin: 0;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.topbar .eyebrow {
    color: #8fc5ff;
}

.notice {
    background: #ecfdf5;
    border-bottom: 1px solid #bbf7d0;
    color: #166534;
    font-weight: 700;
    padding: 10px 28px;
}

.layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    min-height: calc(100vh - 86px);
    transition: grid-template-columns .18s ease;
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px;
}

.sidebar-toggle {
    align-items: center;
    background: #eef2f7;
    color: var(--ink);
    display: flex;
    font-size: 24px;
    height: 34px;
    justify-content: center;
    margin: 0 0 10px auto;
    min-height: 34px;
    padding: 0;
    width: 34px;
}

.layout.sidebar-collapsed {
    grid-template-columns: 52px minmax(0, 1fr);
}

.layout.sidebar-collapsed .sidebar {
    padding: 9px;
}

.layout.sidebar-collapsed .sidebar > :not(.sidebar-toggle) {
    display: none;
}

.layout.sidebar-collapsed .sidebar-toggle {
    margin: 0 auto;
}

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

.sidebar-actions button {
    min-height: 34px;
    padding: 0 8px;
}

.empty {
    color: var(--muted);
    font-weight: 700;
}

.sidebar h2 {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
    text-transform: uppercase;
}

.bucket-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 22px 0 8px;
}

.segmented {
    background: #eef2f7;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(3, 1fr);
    padding: 4px;
}

.segmented a {
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
    padding: 9px 8px;
    text-align: center;
}

.segmented .selected {
    background: #fff;
    box-shadow: 0 1px 6px rgba(15, 23, 42, .12);
    color: var(--ink);
}

.process-search {
    display: block;
    margin-top: 12px;
}

.process-search input {
    width: 100%;
}

.process-list[hidden],
.bucket-heading[hidden],
.process-link[hidden] {
    display: none;
}

.process-list {
    display: grid;
    gap: 8px;
}

.process-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    padding: 12px;
}

.process-link span {
    color: var(--muted);
    font-size: 12px;
}

.process-link.current {
    border-color: var(--brand);
    box-shadow: inset 4px 0 0 var(--brand);
}

.process-link.empty-bucket {
    background: #f8fafc;
    border-style: dashed;
    color: var(--muted);
    cursor: default;
}

.workspace {
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: 22px;
}

.summary,
.toolbar,
.flow-panel,
.data-grid,
.lower-grid > article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-width: 0;
}

[data-limited-item][hidden] {
    display: none;
}

.list-view-toggle {
    background: #eef2f7;
    color: var(--ink);
    margin: 12px 16px 16px;
    width: calc(100% - 32px);
}

.list-view-toggle:hover {
    background: #dfe7f1;
}

.summary {
    align-items: end;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 20px;
}

.migration-summary {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 16px;
}

.migration-summary div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 12px;
}

.migration-summary span,
.danger-zone p {
    color: var(--muted);
}

.danger-zone {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding: 16px;
}

.danger-zone h3,
.danger-zone p {
    margin: 0;
}

.danger-zone label {
    max-width: 360px;
}

.update-actions {
    border-top: 1px solid var(--line);
    padding: 16px;
}

.update-actions form {
    margin: 0;
}

.update-log {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    padding: 16px;
}

.update-log h3 {
    margin: 0;
}

.update-log pre {
    background: #0f172a;
    border-radius: 8px;
    color: #e5e7eb;
    margin: 8px 0 0;
    max-height: 260px;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
}

.summary-actions {
    align-self: center;
}

.summary p {
    color: var(--muted);
    margin: 8px 0 0;
    max-width: 780px;
}

dl {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    margin: 0;
}

dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

dd {
    margin: 2px 0 0;
}

.toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}

.toolbar form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 12px;
    font-weight: 800;
    gap: 5px;
    text-transform: uppercase;
}

.check-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check-row input {
    min-height: auto;
}

select,
input,
textarea {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    min-height: 38px;
    padding: 8px 10px;
    text-transform: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(35, 102, 168, .14);
    outline: none;
}

.auth-page,
.admin-page {
    display: grid;
    min-height: calc(100vh - 86px);
    padding: 28px;
    place-items: start center;
}

.auth-card,
.admin-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .08);
    width: min(100%, 460px);
}

.auth-card {
    display: grid;
    gap: 14px;
    margin-top: 7vh;
    padding: 22px;
}

.auth-card h2,
.admin-panel h2 {
    margin: 0;
}

.auth-card a {
    color: var(--brand);
    font-weight: 800;
}

.admin-panel {
    width: min(100%, 1180px);
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: var(--danger);
    font-weight: 800;
    margin: 10px 16px;
    padding: 10px;
}

.notice-inline {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #166534;
    margin: 0;
    padding: 10px;
}

.toolbar-filter {
    align-items: end;
    display: flex;
    gap: 10px;
}

.inline-form {
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form {
    margin: 0;
}

.actions button,
.inline-form button {
    background: #eef2f7;
    color: var(--ink);
    min-height: 32px;
    padding: 0 10px;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.repository-page {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.repository-hero,
.repository-layout,
.repository-results {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.repository-hero {
    align-items: end;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 20px;
}

.repository-hero h2,
.repository-toc h3 {
    margin: 0;
}

.repository-hero p {
    color: var(--muted);
    margin: 8px 0 0;
}

.repository-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 280px minmax(0, 1fr);
    padding: 16px;
}

.repository-toc {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 14px;
}

.repository-toc > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 12px;
}

.sidebar-filter {
    min-height: 34px;
}

.repository-toc a {
    align-items: center;
    border-radius: 6px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 8px;
}

.repository-toc a[hidden] {
    display: none;
}

.repository-toc a.current,
.repository-toc a:hover {
    background: #eef2f7;
    color: var(--ink);
}

.repository-toc b {
    color: var(--brand);
}

.sidebar-more {
    background: transparent;
    color: var(--brand);
    justify-content: flex-start;
    min-height: 32px;
    padding: 0 8px;
}

.sidebar-more[hidden],
.sidebar-empty[hidden] {
    display: none;
}

.sidebar-empty {
    margin: 0;
    padding: 8px;
}

.repository-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.repository-search {
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, .35fr) minmax(190px, .45fr) minmax(150px, .35fr) auto auto;
    padding: 12px;
}

.repository-results {
    overflow: hidden;
}

.repository-results .section-heading small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.pagination {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px;
}

.pagination a,
.pagination span {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 34px;
    min-width: 34px;
    padding: 0 10px;
}

.pagination a {
    background: #eef2f7;
    color: var(--ink);
}

.pagination a:hover,
.pagination .current {
    background: var(--brand);
    color: #fff;
}

.pagination .disabled {
    color: var(--muted);
    opacity: .55;
    pointer-events: none;
}

.tag-manager {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.tag-manager summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    padding: 14px 16px;
}

.tag-manager summary::-webkit-details-marker {
    display: none;
}

.tag-manager summary span:first-child {
    display: grid;
    gap: 3px;
}

.tag-manager summary small,
.tag-manager-row small {
    color: var(--muted);
}

.tag-manager[open] summary {
    border-bottom: 1px solid var(--line);
}

.tag-manager[open] summary .secondary-link {
    color: var(--muted);
}

.tag-manager[open] summary .secondary-link::before {
    content: "Close";
}

.tag-manager[open] summary .secondary-link {
    font-size: 0;
}

.tag-manager[open] summary .secondary-link::before {
    font-size: 14px;
}

.tag-manager-tools {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
}

.tag-manager-tools label {
    max-width: 420px;
}

.tag-manager-list {
    max-height: 360px;
    overflow: auto;
}

.tag-manager-row {
    align-items: center;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(140px, .5fr) minmax(220px, 1fr) auto;
    padding: 8px 12px;
}

.tag-manager-row[hidden] {
    display: none;
}

.tag-manager-list .tag-manager-row:first-child {
    border-top: 0;
}

.tag-manager-row > div {
    display: grid;
    gap: 2px;
}

.tag-manager-row form {
    align-items: center;
    display: flex;
    gap: 8px;
    margin: 0;
}

.tag-manager-row input {
    min-width: 180px;
}

.repository-empty {
    border-top: 1px solid var(--line);
    margin: 0;
    padding: 16px;
}

.artifact-card {
    align-items: start;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
}

.artifact-card-main {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.artifact-card-main p,
.artifact-card-main small {
    color: var(--muted);
    margin: 0;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-list a {
    background: #eef2f7;
    border-radius: 999px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 8px;
}

.tag-list a:hover {
    background: #dfe7f1;
}

.field-suggestions {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
}

.field-suggestions[hidden] {
    display: none;
}

.field-suggestions button {
    background: #eef2f7;
    color: var(--ink);
    min-height: 30px;
    padding: 0 9px;
}

.field-suggestions button:hover {
    background: #dfe7f1;
}

.artifact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.flow {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    padding: 0 16px 18px;
}

.flow-step {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    min-height: 238px;
    padding: 14px;
    position: relative;
}

.flow-step.changed {
    border-color: var(--warning);
    box-shadow: inset 0 4px 0 var(--warning);
}

.flow-step.added {
    border-color: var(--accent);
    box-shadow: inset 0 4px 0 var(--accent);
}

.flow-step.removed {
    border-color: var(--danger);
    box-shadow: inset 0 4px 0 var(--danger);
    opacity: .72;
}

.flow-step.exception-step {
    background: #fff7ed;
}

.flow-step[data-step-open] {
    cursor: pointer;
}

.flow-step[data-step-open]:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(35, 102, 168, .14);
    outline: none;
}

.step-number {
    align-items: center;
    background: #101317;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.role {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.flow-step h4 {
    font-size: 16px;
    margin: 5px 0;
}

.flow-step p {
    color: var(--muted);
    margin: 0;
}

.io {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.io span {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 7px;
}

.flow-step footer {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
}

.flow-step footer form {
    margin-left: auto;
}

.happy-path-inline {
    display: grid;
    gap: 12px;
    padding: 0 16px 18px;
}

.happy-path-inline > button[type="submit"] {
    justify-self: start;
}

.happy-path-card-editor {
    padding: 0;
}

.step-card-header {
    align-items: start;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.step-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.step-card-actions button {
    min-height: 32px;
    padding: 0 10px;
}

.connector {
    display: none;
}

mark {
    background: #fef3c7;
    border-radius: 5px;
    color: #854d0e;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 6px;
}

.pill {
    background: #eef2f7;
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 6px 8px;
}

.pill.good {
    background: #dcfce7;
    color: #166534;
}

.pill.wait,
.pill.risk {
    background: #fee2e2;
    color: #991b1b;
}

.table-wrap {
    overflow-x: auto;
}

.column-picker {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 0 16px 14px;
}

.column-picker .check-row {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 34px;
    padding: 0 9px;
}

table {
    border-collapse: collapse;
    min-width: 1180px;
    width: 100%;
}

th {
    background: #101317;
    color: #fff;
    font-size: 12px;
    text-align: left;
}

th:nth-child(2),
th:nth-child(4),
th:nth-child(5),
th:nth-child(10) {
    background: var(--brand);
}

td,
th {
    border: 1px solid var(--line);
    padding: 9px;
    vertical-align: top;
}

td {
    background: #fff;
}

.excel-detail-form {
    display: grid;
    gap: 12px;
}

.excel-table {
    min-width: 1560px;
}

.excel-detail-form .table-wrap {
    max-height: min(70vh, 720px);
    overflow: auto;
    scrollbar-gutter: stable;
}

.excel-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.excel-column-resizer {
    bottom: 0;
    cursor: col-resize;
    position: absolute;
    right: -4px;
    top: 0;
    touch-action: none;
    width: 8px;
    z-index: 5;
}

.excel-column-resizer::after {
    background: transparent;
    bottom: 4px;
    content: "";
    position: absolute;
    right: 3px;
    top: 4px;
    width: 2px;
}

.excel-column-resizer:hover::after,
.excel-column-resizer:focus::after,
.excel-column-resizer.resizing::after {
    background: var(--brand);
}

.excel-column-resizer:focus {
    outline: 0;
}

body.resizing-excel-column {
    cursor: col-resize;
    user-select: none;
}

.excel-table .drag-column,
.excel-table [data-column="step_no"] {
    position: sticky;
    left: 0;
    z-index: 2;
}

.excel-table[data-excel-editable] [data-column="step_no"] {
    left: 140px;
}

.excel-table thead .drag-column,
.excel-table thead [data-column="step_no"] {
    z-index: 4;
}

.excel-table [data-column="step_no"] {
    background-clip: padding-box;
}

.excel-table tbody [data-column="step_no"] {
    background-color: #fff;
}

.excel-table .drag-column {
    background-clip: padding-box;
    box-shadow: 2px 0 0 rgba(15, 23, 42, .08);
}

.excel-table[data-excel-editable] [data-column="step_no"] {
    box-shadow: 2px 0 0 rgba(15, 23, 42, .08);
}

.excel-table textarea,
.excel-table select {
    border: 0;
    border-radius: 0;
    min-height: 44px;
    width: 100%;
}

.excel-table textarea {
    min-width: 0;
    resize: vertical;
}

.excel-table [data-column="step_no"] {
    text-align: center;
    width: 58px;
}

.excel-table [data-excel-row] {
    transform: translateX(calc(var(--indent-level, 0) * 24px));
    transition: transform .15s ease;
}

.drag-column {
    text-align: center;
    min-width: 140px;
    width: 140px;
}

.row-structure-controls {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.indent-button {
    background: #eef2f7;
    color: var(--ink);
    min-height: 30px;
    padding: 0 7px;
}

.excel-delete-button {
    background: #fee2e2;
    color: var(--danger);
    min-height: 30px;
    padding: 0 8px;
}

.excel-delete-button:hover {
    background: var(--danger);
    color: #fff;
}

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

.drag-handle {
    background: #eef2f7;
    color: var(--ink);
    cursor: grab;
    font-weight: 900;
    min-height: 30px;
    padding: 0 8px;
}

.dragging {
    opacity: .55;
}

.excel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 16px;
}

.run-list {
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 14px;
}

.run-link {
    border: 1px solid var(--line);
    border-radius: 6px;
    display: grid;
    gap: 2px;
    min-width: 180px;
    padding: 9px 10px;
}

.run-link.current {
    border-color: var(--brand);
    box-shadow: inset 3px 0 0 var(--brand);
}

.run-link span {
    color: var(--muted);
    font-size: 12px;
}

.section-empty {
    border-top: 1px solid var(--line);
    margin: 0;
    padding: 0 16px 16px;
}

.run-results-form {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    padding-top: 14px;
}

.run-goal {
    align-items: center;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #9a3412;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: space-between;
    margin: 0 16px;
    padding: 12px;
}

.run-goal.complete {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.run-detail-toggle {
    display: grid;
    gap: 12px;
}

.run-detail-toggle summary {
    background: #eef2f7;
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
    justify-self: start;
    list-style: none;
    margin: 0 16px;
    min-height: 38px;
    padding: 9px 12px;
}

.run-detail-toggle summary::-webkit-details-marker {
    display: none;
}

.run-detail-toggle[open] summary {
    background: #dfe7f1;
}

.run-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0 16px;
}

.run-notes {
    padding: 0 16px;
}

.run-table {
    min-width: 1180px;
}

.run-table textarea,
.run-table input,
.run-table select {
    width: 100%;
}

.run-table textarea {
    min-height: 54px;
}

.delete-run-form {
    padding: 0 16px 16px;
}

.lower-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.list-item,
.asset {
    border-top: 1px solid var(--line);
    display: block;
    padding: 14px 16px;
}

.item-card {
    display: grid;
    gap: 4px;
}

.item-title {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.item-actions form {
    margin: 0;
}

.item-actions button {
    min-height: 32px;
}

.list-item p {
    color: var(--muted);
    margin: 8px 0;
}

.list-item small,
.asset small,
.asset span {
    color: var(--muted);
}

.asset strong {
    display: block;
    margin: 4px 0;
}

dialog {
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 620px;
    width: min(calc(100vw - 28px), 620px);
}

.wide-dialog {
    max-width: min(1280px, calc(100vw - 28px));
    width: min(1280px, calc(100vw - 28px));
}

.step-detail-dialog {
    max-width: min(1180px, calc(100vw - 28px));
}

.step-detail-shell {
    display: grid;
    gap: 18px;
    padding: 8px;
}

.step-detail-header {
    align-items: start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 0 42px 14px 0;
}

.step-detail-header h3 {
    font-size: 24px;
    margin: 0;
}

.step-detail-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.step-detail-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
}

.step-detail-main,
.step-detail-related section {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.step-detail-main {
    display: grid;
    gap: 14px;
}

.detail-block h4,
.step-detail-related h4 {
    margin: 0 0 8px;
}

.detail-block p {
    color: var(--muted);
    margin: 0;
    white-space: pre-wrap;
}

.detail-pairs {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-pairs div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
}

.detail-pairs dd {
    white-space: pre-wrap;
}

.step-detail-related {
    display: grid;
    gap: 12px;
}

.detail-related-item {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 5px;
    padding: 10px 0 0;
}

.detail-related-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.detail-related-item p,
.detail-empty {
    color: var(--muted);
    margin: 0;
}

.detail-related-item a {
    color: var(--brand);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.confirm-dialog {
    max-width: 440px;
}

.confirm-shell {
    display: grid;
    gap: 12px;
    padding: 8px;
}

.confirm-shell h3,
.confirm-shell p {
    margin: 0;
}

.confirm-shell p {
    color: var(--muted);
}

.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-toolbar {
    border: 1px solid var(--line);
    box-shadow: none;
    margin-bottom: 12px;
}

dialog::backdrop {
    background: rgba(15, 23, 42, .52);
}

dialog form {
    display: grid;
    gap: 12px;
    padding: 8px;
}

dialog h3 {
    margin: 0 42px 4px 0;
}

.close {
    background: #eef2f7;
    color: var(--ink);
    min-height: 32px;
    padding: 0;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 32px;
}

@media (max-width: 980px) {
    .layout,
    .layout.sidebar-collapsed,
    .summary,
    .repository-hero,
    .repository-layout,
    .repository-search,
    .artifact-card,
    .tag-manager-row,
    .step-detail-layout,
    .run-fields,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .repository-toc {
        position: static;
    }

    .topbar {
        align-items: stretch;
        display: grid;
        gap: 14px;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .workspace {
        padding: 12px;
    }

    .toolbar,
    .section-heading {
        align-items: stretch;
        display: grid;
    }

    .toolbar form {
        display: grid;
    }

    .flow {
        grid-template-columns: 1fr;
    }

    .detail-pairs {
        grid-template-columns: 1fr;
    }

    .connector {
        height: 18px;
        justify-self: center;
        width: 2px;
    }
}
