/* Onboard a counterparty journey prototype. Self-contained: plain CSS, no
 * build step, no import to wire.
 *
 * The tokens are the application's own, copied verbatim from
 * new-party/prototype.css, which took them from
 * projects/ores.web/packages/web/src/styles.css so a reviewer sees the
 * prototype in the colours the real screens use. The furniture follows the
 * journey prototypes beside this one: the 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: 780px; }

.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;
}
.panel-soft h3 { font-size: 13px; margin: 0 0 10px; font-weight: 600; }

.stack { display: grid; gap: 1.25rem; }

/* 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 .crest {
    display: grid;
    place-items: center;
    height: 2.25rem;
    width: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: 0.375rem;
    background: var(--panel-2);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-bright);
}
.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 > .lbl .req { color: var(--warn); }
.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 textarea { min-height: 64px; resize: vertical; }
.field select { cursor: pointer; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field input:disabled { color: var(--ink-faint); background: #101014; border-style: dashed; }
.field input::placeholder { color: var(--ink-faint); }
.field input.bad { border-color: var(--bad); }
.field .flagpick { display: flex; gap: 8px; }
.field .flagpick input { flex: 1; }
.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); }
.btn:hover:not(:disabled) { border-color: var(--line-strong); }

.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 13px; margin-bottom: 18px; }
.notice:last-child { margin-bottom: 0; }
.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 h3 { margin: 0 0 6px; font-size: 13px; }
.notice ul { margin: 8px 0 0; padding-left: 18px; }
.notice li { margin: 3px 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ------------------------------------------------------------------ */
/* The landing list                                                   */
/* ------------------------------------------------------------------ */

.lhead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.lhead h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.lhead .desc { margin: 4px 0 0; color: var(--ink-dim); font-size: 13px; }
.lhead .actions { display: flex; flex: none; gap: 8px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.toolbar .grow { flex: 1; min-width: 220px; }
.toolbar input,
.toolbar select {
    background: #0e1218;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: 8px 11px;
    font: inherit;
    font-size: 13px;
}
.toolbar input { width: 100%; }
.tabs { display: flex; gap: 2px; }
.tabs button {
    background: none;
    border: 1px solid transparent;
    color: var(--ink-dim);
    border-radius: var(--radius);
    padding: 7px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.tabs button:hover { color: var(--ink); background: var(--panel-2); }
.tabs button.on { background: var(--panel-2); border-color: var(--line); color: var(--ink); }

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;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.grid td {
    padding: 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: var(--panel-2); }
table.grid tr.on td { background: #16202c; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .nm { font-weight: 500; }
table.grid .sub { display: block; font-size: 12px; color: var(--ink-faint); }
.empty { padding: 28px 10px; text-align: center; color: var(--ink-faint); font-size: 13px; }

.tag {
    display: inline-block;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 11px;
    color: var(--ink-dim);
    white-space: nowrap;
}
.tag.ok { border-color: rgba(63, 185, 80, 0.45); background: rgba(63, 185, 80, 0.1); color: var(--ok); }
.tag.warn { border-color: rgba(210, 153, 34, 0.5); background: rgba(210, 153, 34, 0.1); color: var(--warn); }
.tag.bad { border-color: rgba(248, 81, 73, 0.5); background: rgba(248, 81, 73, 0.1); color: var(--bad); }
.tag.accent { border-color: rgba(88, 166, 255, 0.5); background: rgba(88, 166, 255, 0.1); color: var(--accent-bright); }

/* ------------------------------------------------------------------ */
/* Identifier, contact, agreement and netting-set rows                */
/* ------------------------------------------------------------------ */

.rowlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rowlist > li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
}
.rowlist > li.on { border-color: var(--accent); }
.rowlist .id { flex: 0 0 auto; }
.rowlist .val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rowlist .meta { font-size: 12px; color: var(--ink-faint); }
.rowlist .grow { flex: 1; min-width: 0; }

.datatable { width: 100%; border-collapse: collapse; font-size: 13px; }
.datatable th {
    text-align: left;
    font-weight: 500;
    color: var(--ink-faint);
    padding: 6px 10px 6px 0;
    font-size: 12px;
    white-space: nowrap;
    vertical-align: top;
    width: 1%;
}
.datatable td { padding: 6px 0; vertical-align: top; }

.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); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sets > li { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; }
.sets > li.on { border-color: var(--accent); }
.sets .sethead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sets .sethead .code { font-weight: 600; }
.sets .sethead .grow { flex: 1; min-width: 0; }
.sets .setbody { margin-top: 10px; }

.centerpick { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
@media (max-width: 640px) { .centerpick { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ */
/* The history panel and the field diff                               */
/* ------------------------------------------------------------------ */

.hist { display: grid; grid-template-columns: 15rem 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 760px) { .hist { grid-template-columns: 1fr; } }
.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.versions button {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--panel-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
}
.versions button:hover { border-color: var(--line-strong); }
.versions button.on { border-color: var(--accent); }
.versions .v { font-weight: 600; }
.versions .who { display: block; font-size: 12px; color: var(--ink-faint); }

.difftable { width: 100%; border-collapse: collapse; font-size: 13px; }
.difftable th {
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-faint);
    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 .fld { color: var(--ink-dim); }
.difftable .from { color: var(--bad); text-decoration: line-through; }
.difftable .to { color: var(--ok); }
.difftable .mrow { margin: 0 0 8px; }

/* ------------------------------------------------------------------ */
/* Handoff cards                                                      */
/* ------------------------------------------------------------------ */

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

.failtoggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #e879f9; margin-top: 16px; }
.failtoggle input { width: auto; }

/* A note the prototype adds where the real screen would leave the page. */
.proto-hint { margin-top: 12px; font-size: 12px; color: var(--warn); }
.proto-hint b { color: var(--warn); }
