/* aChiral Catalyst — orchestration screens. One local stylesheet: no framework, no build step,
   no external resource. Light and dark follow the system; usable at phone width.
   The page's Content-Security-Policy forbids inline style: everything is a class here. */
:root {
    color-scheme: light dark;
    --bg: #f6f7f9; --surface: #ffffff; --text: #1c2330; --muted: #5d6878; --line: #d9dee6;
    --accent: #1f5fae; --accent-text: #ffffff; --soft: #eaf0f8;
    --ok: #1d6b3f; --warn: #8a5a00; --bad: #a12a2a; --bad-soft: #fbeaea;
    --radius: 6px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12161c; --surface: #1a2029; --text: #e4e8ee; --muted: #9aa5b5; --line: #2e3744;
        --accent: #6aa5ee; --accent-text: #0e1319; --soft: #222c3a;
        --ok: #6fcf97; --warn: #e2b45a; --bad: #f08c8c; --bad-soft: #3a2224;
    }
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 0.9375rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
h1 { font-size: 1.375rem; margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }

.top {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.top form { margin: 0; }
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.brand-sub { font-weight: 400; color: var(--muted); margin-left: 0.25rem; }
.spacer { flex: 1 1 auto; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.who-name { font-weight: 600; }
.who-roles { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.badge {
    display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 999px;
    background: var(--soft); color: var(--text); font-size: 0.75rem; line-height: 1.5; white-space: nowrap;
}
.badge.muted { color: var(--muted); }
.badge.env { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; border: 1px solid currentColor; background: transparent; }
.badge.env-test { color: var(--warn); }
.badge.env-live { color: var(--bad); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }

.frame { display: flex; align-items: flex-start; min-height: calc(100vh - 3.25rem); }
.side { flex: 0 0 13rem; padding: 1rem 0.5rem; border-right: 1px solid var(--line); align-self: stretch; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 0.375rem 0.75rem; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.side a:hover { background: var(--soft); }
.side a[aria-current="page"] { background: var(--soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.content { flex: 1 1 auto; min-width: 0; padding: 1.25rem 1.5rem 3rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.narrow { max-width: 24rem; margin: 2rem auto; }
.notice { padding: 0.625rem 0.75rem; border-radius: var(--radius); background: var(--soft); margin: 0 0 1rem; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.hint { color: var(--muted); font-size: 0.8125rem; }

label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 600; font-size: 0.8125rem; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
    width: 100%; padding: 0.5rem 0.625rem; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.button {
    display: inline-block; margin-top: 1rem; padding: 0.5rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
    color: var(--accent-text); background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); text-decoration: none;
}
.button.quiet { margin-top: 0; padding: 0.25rem 0.75rem; font-weight: 400; color: var(--text); background: transparent; border-color: var(--line); }
.button.danger { background: var(--bad); border-color: var(--bad); }
.button:hover { filter: brightness(1.08); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.75rem; }
.tile { display: block; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 600; }
.tile:hover { border-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 0.4375rem 0.625rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; }

@media (max-width: 40rem) {
    .frame { display: block; min-height: 0; }
    .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 0.5rem; }
    .side ul { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .side a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
    .content { padding: 1rem; }
    .who-roles { display: none; }
}
