/* mocks.css - the look every xseed mock shares (tokens, header, panels, tables, badges, forms) and the
   navigation bar between the mocks. Source: shared/mockui in xseed-mocks; `make sync-ui` copies it into
   every app, CI checks the copies did not drift. Served at /mock/ui/mocks.css. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9; --panel: #ffffff; --border: #e3e6eb; --text: #1b1f24; --muted: #6b7280; --accent: #2563eb;
  --ok: #16a34a; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --err: #dc2626; --err-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe; --gray-bg: #eef0f3; --code: #f3f4f6; --row-hover: #f9fafb;
  --nav-bg: #111827; --nav-text: #d1d5db; --nav-active: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --panel: #171a21; --border: #2a2f3a; --text: #e6e8eb; --muted: #9aa3af; --accent: #60a5fa;
    --ok: #4ade80; --ok-bg: #14321f; --warn: #fbbf24; --warn-bg: #3a2c0b; --err: #f87171; --err-bg: #3b1515;
    --info: #93c5fd; --info-bg: #172554; --gray-bg: #252a34; --code: #11141a; --row-hover: #1c2029;
    --nav-bg: #05070a; --nav-text: #9aa3af; --nav-active: #ffffff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }

/* ---- the bar between the mocks (nav.js fills #mx-nav from /mock/nav.json) */
.mx-nav { display: flex; align-items: center; gap: .3rem 1rem; flex-wrap: wrap; min-height: 2.4rem; padding: .3rem 1.2rem;
  background: var(--nav-bg); color: var(--nav-text); font: 13px/1.4 system-ui, -apple-system, Segoe UI, sans-serif; }
.mx-brand { color: var(--nav-active); font-weight: 700; text-decoration: none; white-space: nowrap; }
.mx-env { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 .4rem; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; }
.mx-links { display: flex; gap: .15rem; flex-wrap: wrap; overflow-x: auto; }
.mx-link { color: var(--nav-text); text-decoration: none; padding: .2rem .6rem; border-radius: 5px; white-space: nowrap; }
.mx-link:hover { color: var(--nav-active); background: rgba(255, 255, 255, .08); }
.mx-link.mx-current { color: var(--nav-active); background: rgba(255, 255, 255, .14); font-weight: 600; }

/* ---- the page header of one mock: its name, facts as chips, actions */
.mx-header { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.05rem; }
.brand small { font-weight: 400; color: var(--muted); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; }
.chip { background: var(--gray-bg); border-radius: 999px; padding: .15rem .65rem; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.chip b { color: var(--text); font-weight: 600; }
main { padding: 1rem 1.2rem 4rem; max-width: 1600px; margin: 0 auto; }

/* ---- building blocks */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.panel h2 .muted { font-weight: 400; }
.panel h3 { font-size: .9rem; margin: 1rem 0 .5rem; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; padding: .4rem .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.row { cursor: pointer; } tr.row:hover td { background: var(--row-hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--muted); }
.b-ok { background: var(--ok-bg); color: var(--ok); } .b-warn { background: var(--warn-bg); color: var(--warn); }
.b-err { background: var(--err-bg); color: var(--err); } .b-info { background: var(--info-bg); color: var(--info); }
button, .btn { font: inherit; font-size: .82rem; padding: .3rem .7rem; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.ok { background: var(--ok); border-color: var(--ok); color: white; }
button.danger { background: var(--err); border-color: var(--err); color: white; }
button.ghost { border-color: transparent; background: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.actions form { display: contents; }
input, select, textarea { font: inherit; font-size: .85rem; padding: .3rem .45rem; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); font-size: .85rem; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem .8rem; align-items: end; }
.form .wide { grid-column: span 2; }
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.toolbar .grow { flex: 1; }
pre { background: var(--code); border: 1px solid var(--border); border-radius: 6px; padding: .6rem; overflow: auto; max-height: 420px; margin: .3rem 0; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; font-size: .83rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
details > summary { cursor: pointer; }
.pill { display: inline-flex; align-items: center; gap: .3rem; background: var(--gray-bg); border-radius: 999px; padding: .1rem .2rem .1rem .65rem; font-size: .8rem; margin: .15rem; }
.pill button { border: 0; background: none; padding: 0 .35rem; color: var(--muted); }
.pill button:hover { color: var(--err); }
.empty { color: var(--muted); padding: 1.2rem; text-align: center; }
.hint { font-size: .8rem; color: var(--muted); margin: .2rem 0 .8rem; }
.toast { position: fixed; bottom: 1rem; right: 1rem; background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; opacity: 0; transition: opacity .3s; z-index: 50; max-width: 40rem; }
.toast.show { opacity: .95; } .toast.err { background: var(--err); color: white; }
