/* The data exchange prototypes. Self-contained: plain CSS, no build step, no
 * import to wire. The file is copied into each prototype folder so a page
 * stays standalone; the copies are identical, and the tail of the file adds
 * the tables, strips and badges the import and export screens need.
 *
 * The tokens are the application's own, copied from
 * projects/ores.web/packages/web/src/styles.css so a reviewer sees the
 * prototypes in the colours the real screens use. The furniture follows the
 * prototypes beside this group: the journey rail is JourneyPage.tsx's grid,
 * the card is `card p-6`, the footer is `mt-6 border-t pt-4` split by
 * justify-between. */

:root {
    --bg: #121214;
    --panel: #1a1a1e;
    --panel-2: #26262b;
    --line: #30363d;
    --line-soft: #21262d;
    --line-strong: #4a5568;
    --ink: #e3e3e6;
    --ink-dim: #a1a1aa;
    --ink-faint: #71717a;
    --accent: #58a6ff;
    --accent-bright: #8ab4f8;
    --accent-dim: #21262d;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
    --radius: 0.5rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#app { min-height: 100vh; }

/* The prototype's own chrome, deliberately unlike the design on trial. */
.proto-note {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 6px 14px;
    background: repeating-linear-gradient(45deg, #2a2113, #2a2113 10px, #241d11 10px, #241d11 20px);
    border-bottom: 1px solid #4a3a17;
    color: var(--warn);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.proto-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 7px;
    background: #0b0e13;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    font-size: 12px;
    max-width: 96vw;
    flex-wrap: wrap;
    justify-content: center;
}

.proto-bar button {
    background: none;
    border: none;
    color: var(--ink-dim);
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 999px;
}

.proto-bar button:hover { background: var(--panel-2); color: var(--ink); }
.proto-bar button.on { background: var(--accent-dim); color: var(--ink); }
.proto-bar .label { padding: 0 8px; color: var(--ink); white-space: nowrap; }
.proto-bar .label b { color: var(--accent); }
.proto-bar .sep { color: var(--line); padding: 0 2px; }

/* ------------------------------------------------------------------ */
/* Shared page furniture                                              */
/* ------------------------------------------------------------------ */

.page { padding: 78px 24px 110px; max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 720px; }
.page.wide { max-width: 1240px; }

.brand { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }
.tenant { margin-top: 6px; color: var(--ink-dim); font-size: 13px; }
.tenant b { color: var(--ink); font-weight: 600; }

.page > h1 { font-size: 22px; margin: 0 0 18px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
.lede { color: var(--ink-dim); margin: 0 0 24px; max-width: 62ch; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.25rem; }
.card .lead { margin: 0 0 1.25rem; color: var(--ink-dim); font-size: 0.875rem; }

.panel-soft {
    background: var(--panel-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
}

/* The step header: what stands above every step and does not change while
   the steps do. JourneyPage wraps it in `mb-5 border-b border-line pb-4`. */
.stepheader {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}
.stepheader .nm { font-weight: 500; }
.stepheader .sub { font-size: 0.75rem; color: var(--ink-faint); }

/* ------------------------------------------------------------------ */
/* The flat step rail, as JourneyPage.tsx draws it                     */
/* ------------------------------------------------------------------ */

.journey { display: grid; grid-template-columns: 14rem 1fr; gap: 2rem; align-items: start; }
@media (max-width: 820px) { .journey { grid-template-columns: 1fr; } }
.railnav ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.railentry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.railentry.done { color: var(--ink-dim); }
.railentry.current { background: var(--panel-2); color: var(--ink); font-weight: 500; }
.railentry.ahead { color: var(--ink-faint); }
.railmark {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 1.5rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.75rem;
}
.railmark.done { border-color: var(--ok); color: var(--ok); }
.railmark.current { border-color: var(--accent); color: var(--accent-bright); }
.railmark.ahead { border-color: var(--line); color: var(--ink-faint); }

.stepfoot {
    margin-top: 1.5rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.ml-auto { margin-left: auto; }

/* ------------------------------------------------------------------ */
/* Fields and controls                                                */
/* ------------------------------------------------------------------ */

.field { display: block; margin-bottom: 16px; }
.field > .lbl { display: block; font-size: 12px; color: var(--ink-dim); margin-bottom: 6px; }
.field input,
.field select,
.field textarea {
    width: 100%;
    background: #0e1218;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
}
.field select { cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field input:disabled,
.field select:disabled { color: var(--ink-faint); background: #101014; border-style: dashed; }
.field input::placeholder { color: var(--ink-faint); }
.field.ro { background: #16161a; border-style: dashed; }
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 6px; }
.hint b { color: var(--ink-dim); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.span2 { grid-column: 1 / -1; }

fieldset { border: none; margin: 0 0 22px; padding: 0; }
legend { font-size: 13px; font-weight: 600; margin-bottom: 10px; padding: 0; }

.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.checkline input { width: auto; }

.btn {
    display: inline-block;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 9px 16px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 600; }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-dim); }
.btn.danger { background: none; border-color: var(--line); color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: var(--panel-2); }

.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 13px; margin-bottom: 18px; }
.notice.info { background: #12161f; border: 1px solid #24344d; color: var(--ink); }
.notice.success { background: #12281d; border: 1px solid #23543a; color: #a8e6c4; }
.notice.warn { background: #2a2113; border: 1px solid #4a3a17; color: #efd39a; }
.notice.error { background: #2b1614; border: 1px solid #5c2a24; color: #f0b7ae; }
.notice .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.notice .title { font-weight: 600; display: block; margin-bottom: 4px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.faint { color: var(--ink-faint); }
.dim { color: var(--ink-dim); }

/* ------------------------------------------------------------------ */
/* The source chips: this tenant's data against a shared taxonomy.    */
/* ------------------------------------------------------------------ */

.src {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-faint);
    white-space: nowrap;
    vertical-align: middle;
}
.src.shared { border-color: #4a3a17; background: #241d11; color: #efd39a; }
.src.tenant { border-color: #24344d; background: #12161f; color: var(--accent-bright); }
.src.inherited { border-color: #23543a; background: #12281d; color: #a8e6c4; }
.src.locked { border-color: #5c2a24; background: #2b1614; color: #f0b7ae; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12px; color: var(--ink-dim); margin: 0 0 18px; }
.legend .src { margin-right: 4px; }

/* ------------------------------------------------------------------ */
/* The portfolio tree, with search                                    */
/* ------------------------------------------------------------------ */

.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.searchbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.searchbar input {
    flex: 1;
    background: #0e1218;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
}
.searchbar input:focus { outline: none; border-color: var(--accent); }

.tree { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.trow {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
}
.trow:last-child { border-bottom: none; }
.trow:hover { background: var(--panel-2); }
.trow.on { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.trow .twisty {
    flex: 0 0 1rem;
    width: 1rem;
    background: none;
    border: none;
    color: var(--ink-faint);
    font-size: 11px;
    padding: 0;
    cursor: pointer;
}
.trow .twisty.leaf { visibility: hidden; }
.trow .tname { font-weight: 500; }
.trow.bk .tname { font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.trow .tmeta { margin-left: auto; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.trow .count { color: var(--ink-faint); font-size: 11px; }
.tempty { padding: 14px 12px; color: var(--ink-faint); font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Key/value panels and tables                                        */
/* ------------------------------------------------------------------ */

.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.kv tr:last-child td { border-bottom: none; }
.kv td:first-child { color: var(--ink-faint); width: 42%; }
.kv td:last-child { color: var(--ink); }
.kv .none { color: var(--warn); }
.kv .given { color: var(--ok); }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
    text-align: left;
    font-weight: 500;
    color: var(--ink-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr.noright td { background: #1d1414; }
table.grid .sub { color: var(--ink-faint); font-size: 12px; }

.badge {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink-dim);
    background: var(--panel-2);
}
.badge.ok { border-color: #23543a; background: #12281d; color: #a8e6c4; }
.badge.warn { border-color: #4a3a17; background: #241d11; color: #efd39a; }
.badge.bad { border-color: #5c2a24; background: #2b1614; color: #f0b7ae; }
.badge.info { border-color: #24344d; background: #12161f; color: var(--accent-bright); }

.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.sectionhead h3 { font-size: 14px; margin: 0; font-weight: 600; }

.panel + .panel, .panel-soft + .panel-soft { margin-top: 14px; }

/* The taxonomy lists, read-only on the classification step. */
.taxo { display: grid; gap: 10px; }
.taxo .list {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: #16161a;
    padding: 12px 14px;
}
.taxo .list .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.taxo .list .nm { font-weight: 600; font-size: 13px; }
.taxo .list .codes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.taxo .list .codes .badge { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.taxo .list .why { margin: 8px 0 0; font-size: 12px; color: var(--ink-faint); }
.taxo a { color: var(--accent); text-decoration: none; font-size: 12px; }
.taxo a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Rights                                                             */
/* ------------------------------------------------------------------ */

.rightbox { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.rightbox .acct { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.rightbox .acct:last-child { border-bottom: none; }
.rightbox .acct .who { font-size: 13px; }
.rightbox .acct .who .mono { font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Review and outcome                                                 */
/* ------------------------------------------------------------------ */

.reviewgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; margin: 0; }
@media (max-width: 640px) { .reviewgrid { grid-template-columns: 1fr; } }
.reviewgrid dt { color: var(--ink-faint); }
.reviewgrid dd { margin: 0; color: var(--ink); }

.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.changes li { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; background: #16161a; }
.changes li .what { font-size: 13px; font-weight: 600; }
.changes li .who { font-size: 12px; color: var(--ink-faint); }
.changes li .fromto { font-size: 13px; margin-top: 6px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: baseline; }
.changes li .fromto .was { color: var(--bad); }
.changes li .fromto .now { color: var(--ok); }
.changes li .fromto .arrow { color: var(--ink-faint); }
.changes li .sub { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.outcome { text-align: center; padding: 10px 0 4px; }
.outcome .mark { font-size: 34px; line-height: 1; }
.outcome .mark.ok { color: var(--ok); }
.outcome .mark.bad { color: var(--bad); }
.outcome h2 { margin-top: 10px; }
.outcome p { color: var(--ink-dim); margin: 6px auto 0; max-width: 54ch; }

.nextcards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 22px; }
@media (max-width: 760px) { .nextcards { grid-template-columns: 1fr; } }
.nextcard {
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}
.nextcard:hover { border-color: var(--accent); }
.nextcard .nm { font-weight: 600; }
.nextcard p { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }

/* ------------------------------------------------------------------ */
/* History                                                            */
/* ------------------------------------------------------------------ */

.history { display: grid; grid-template-columns: minmax(13rem, 16rem) 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .history { grid-template-columns: 1fr; } }
.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.versions button {
    width: 100%;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    padding: 9px 11px;
    cursor: pointer;
}
.versions button:hover { border-color: var(--line-strong); }
.versions button.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2); }
.versions .v { font-weight: 600; }
.versions .m { display: block; color: var(--ink-faint); font-size: 11px; margin-top: 2px; }

.difftable { width: 100%; border-collapse: collapse; font-size: 13px; }
.difftable th { text-align: left; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.difftable td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.difftable tr:last-child td { border-bottom: none; }
.difftable td.f { color: var(--ink-faint); width: 12rem; }
.diff { display: grid; gap: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.diff .line { padding: 2px 6px; border-radius: 3px; }
.diff .old { background: rgba(248, 81, 73, 0.15); }
.diff .new { background: rgba(63, 185, 80, 0.15); }
.diff .old mark { background: rgba(248, 81, 73, 0.45); color: inherit; border-radius: 2px; }
.diff .new mark { background: rgba(63, 185, 80, 0.45); color: inherit; border-radius: 2px; }
.diff .same { color: var(--ink-dim); }

/* A note the prototype adds where the real screen would leave the page. */
.proto-hint { margin-top: 12px; font-size: 12px; color: var(--warn); }
.failtoggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #e879f9; margin-top: 16px; }
.failtoggle input { width: auto; }

/* ------------------------------------------------------------------ */
/* Data exchange prototype additions                                  */
/* ------------------------------------------------------------------ */

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.toolbar .grow { flex: 1; }
.toolbar select, .toolbar input {
    background: #0e1218;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 7px 10px;
    font: inherit;
    font-size: 12px;
}

.stepstrip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-faint); margin: 0 0 18px; }
.stepstrip .s { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-soft); border-radius: 999px; }
.stepstrip .s.done { color: var(--ink-dim); border-color: #23543a; }
.stepstrip .s.now { color: var(--ink); border-color: var(--accent); background: var(--accent-dim); }
.stepstrip .arrow { color: var(--line-strong); }

/* The scanned directory: what the scanner found, and what it ignored. */
.scan { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.scanrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.5rem 7rem 7.5rem;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
}
.scanrow:last-child { border-bottom: none; }
.scanrow.head { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.scanrow .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scanrow .fn .sub { display: block; color: var(--ink-faint); font-size: 11px; }
.scanrow.ignored { color: var(--ink-faint); background: #171412; }
.scanrow.ignored .fn { text-decoration: line-through; text-decoration-color: var(--line-strong); }

.dropzone {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    color: var(--ink-dim);
    font-size: 13px;
    background: #141418;
    margin-bottom: 14px;
}
.dropzone b { color: var(--ink); }
.dropzone .mono { font-size: 12px; }

/* The family picker: one row per dataset family. */
.famtable td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.famtable tr.off td { color: var(--ink-faint); }
.famtable tr.off .nm { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.famtable tr.pending td { background: #16161a; }
.famtable .nm { font-weight: 500; }
.famtable .nm .ent { display: block; font-weight: 400; color: var(--ink-faint); font-size: 11px; }
.famtable tr.click { cursor: pointer; }
.famtable tr.click:hover td { background: var(--panel-2); }
.famtable .chk { width: 2rem; }

.pill { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim); }
.pill.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pill.ok { border-color: #23543a; color: #a8e6c4; }
.pill.warn { border-color: #4a3a17; color: #efd39a; }
.pill.bad { border-color: #5c2a24; color: #f0b7ae; }
.pill.info { border-color: #24344d; color: var(--accent-bright); }

/* The strip that says what is staged and what is live. */
.strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 18px;
}
.strip .cell { background: var(--panel); padding: 11px 13px; }
.strip .cell .k { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.strip .cell .v { font-size: 16px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.strip .cell .s { font-size: 11px; color: var(--ink-faint); }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.progress { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--accent); }
.progress > i.bad { background: var(--bad); }
.progress > i.ok { background: var(--ok); }

.gapbanner {
    border: 1px solid #4a3a17;
    background: repeating-linear-gradient(45deg, #241d11, #241d11 10px, #211a0f 10px, #211a0f 20px);
    color: #efd39a;
    border-radius: var(--radius);
    padding: 11px 14px;
    font-size: 12px;
    margin: 0 0 18px;
}
.gapbanner b { text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; margin-right: 6px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

.makerbox { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; background: #16161a; font-size: 13px; }
.makerbox .who { font-weight: 600; }
.makerbox .what { color: var(--ink-faint); font-size: 12px; margin-top: 3px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9rem 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline .t { color: var(--ink-faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.countgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .countgrid { grid-template-columns: 1fr; } }
.countgrid .c { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 12px; background: #16161a; }
.countgrid .c .k { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.countgrid .c .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.checklist li { display: flex; gap: 9px; align-items: flex-start; }
.checklist .mk { flex: 0 0 auto; width: 1.1rem; text-align: center; }
.checklist .mk.ok { color: var(--ok); }
.checklist .mk.bad { color: var(--bad); }
.checklist .mk.warn { color: var(--warn); }

/* The live region: the workflow instance and one row per declared step. It
 * sits on the run screen because that is where the attempt is read, and it
 * shows the engine's own states rather than a progress bar the read cannot
 * support. */
.wf { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.wfhead {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 10px 13px;
    background: #16161a;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
    color: var(--ink-faint);
}
.wfhead b { color: var(--ink); font-weight: 600; }
.wfhead .mono { color: var(--ink-dim); }
.wfsteps { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.wfstep {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr) 9rem 9.5rem 15rem;
    gap: 10px;
    align-items: baseline;
    padding: 7px 13px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
}
.wfstep:last-child { border-bottom: none; }
.wfstep .ix { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.wfstep .lbl { color: var(--ink-dim); }
.wfstep .lbl .nm {
    display: block;
    color: var(--ink-faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wfstep .bud { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.wfstep .res { color: var(--ink-dim); }
.wfstep.wfcols {
    color: var(--ink-faint);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #16161a;
}
.wfstep.run { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.wfstep.run .lbl { color: var(--ink); }
.wfstep.bad { background: #2b1614; }
.wfstep.comp { background: #171412; }
.wfstep.comp .lbl { color: var(--ink-faint); }
@media (max-width: 900px) {
    .wfstep { grid-template-columns: 1.6rem minmax(0, 1fr) 9rem; }
    .wfstep .res { display: none; }
}

/* A button that is a link keeps the button's look and loses the underline. */
a.btn { text-decoration: none; }

/* ---------------------------------------------------------------
   The book tree: an import target is a sandbox node, never an
   official node. Official nodes read as read-only, a sandbox is
   selectable, and an archived sandbox is locked by the model.
   --------------------------------------------------------------- */
.trow.official { cursor: not-allowed; }
.trow.official:hover { background: none; }
.trow.official .tname { color: var(--ink-dim); font-weight: 400; }
.trow.official.bk .tname { color: var(--ink-faint); }
.trow.sandbox { background: #12161f; cursor: pointer; }
.trow.sandbox:hover { background: #172033; }
.trow.sandbox.on { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.trow.sandbox .tname { font-weight: 600; }
.trow.sandbox.locked { cursor: not-allowed; opacity: 0.62; }
.trow.sandbox.locked:hover { background: #12161f; }
.trow.bk.sandbox { background: #10141c; cursor: default; }
.trow.bk.sandbox:hover { background: #10141c; }
.trow .tag {
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 7px;
    color: var(--ink-faint);
    white-space: nowrap;
}
.trow .tag.sb { border-color: #24344d; color: var(--accent-bright); }
.trow .tag.off { border-color: var(--line-soft); }
.trow .tag.lock { border-color: #5c2a24; color: #f0b7ae; }
.tree.scroll { max-height: 460px; overflow: auto; }
.treelegend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 9px 12px;
    border-top: 1px solid var(--line-soft);
    background: #16161a;
    font-size: 11px;
    color: var(--ink-faint);
}
.sbpath { font-size: 12px; color: var(--ink-dim); }
.sbpath b { color: var(--ink); font-weight: 600; }
.sbcontents { list-style: none; margin: 8px 0 0; padding: 0; }
.sbcontents li { padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.sbcontents li:last-child { border-bottom: none; }
.sbcontents .mono { font-size: 11px; }
