:root { --bg:#f6f7f9; --card:#fff; --ink:#1b1f24; --muted:#667085; --line:#e4e7ec; --brand:#0b6b4b; --warn:#b54708; --bad:#b42318; --ok:#067647; }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); }
header, main, footer { max-width: 780px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 28px; }
h1 { margin:0; font-size: 28px; color: var(--brand); }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 15px; }
.tagline { color: var(--muted); margin: 4px 0 12px; }
.card { background: var(--card); border:1px solid var(--line); border-radius: 12px; padding: 18px; margin: 16px 0; }
.banner { padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.banner.sim { background:#fff4e5; color: var(--warn); border:1px solid #fed7aa; }
.banner.live { background:#e7f6ee; color: var(--ok); border:1px solid #abefc6; }
label { display:block; font-weight:600; margin: 12px 0 4px; }
input[type=url], textarea { width:100%; padding:10px; border:1px solid var(--line); border-radius:8px; font: inherit; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
button { background: var(--brand); color:#fff; border:0; border-radius:8px; padding:10px 16px; font: inherit; font-weight:600; cursor:pointer; }
button:disabled { background:#98a2b3; cursor:not-allowed; }
button.secondary { background:#fff; color: var(--brand); border:1px solid var(--brand); }
.row { display:flex; gap: 12px; align-items:center; margin-top: 12px; flex-wrap: wrap; }
.muted, .hint { color: var(--muted); font-size: 14px; }
.problems { margin-top: 12px; }
.problem { border-left: 4px solid var(--bad); background:#fef3f2; padding: 8px 12px; margin: 6px 0; border-radius: 0 8px 8px 0; }
.problem.warn { border-color: var(--warn); background:#fffaeb; }
table { border-collapse: collapse; width:100%; }
td, th { text-align:left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.v { text-align:right; font-variant-numeric: tabular-nums; }
.numbers td:first-child { color: var(--muted); }
.funding label { font-weight: 500; display:flex; gap:8px; align-items:center; padding: 8px; border:1px solid var(--line); border-radius:8px; margin: 6px 0; cursor:pointer; }
.funding label.selected { border-color: var(--brand); background:#f0faf5; }
.funding .tag { font-size: 12px; color: var(--muted); margin-left:auto; }
.approval { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.check { display:flex; gap:10px; font-weight:500; align-items:flex-start; }
.stages { display:flex; gap:8px; list-style:none; padding:0; margin: 0 0 12px; }
.stages li { flex:1; text-align:center; padding:8px; border-radius:8px; background:#eef0f3; color: var(--muted); font-weight:600; }
.stages li.active { background:#fff4e5; color: var(--warn); }
.stages li.done { background:#e7f6ee; color: var(--ok); }
.stages li.bad { background:#fef3f2; color: var(--bad); }
.headline { font-size: 20px; font-weight: 700; }
.headline.ok { color: var(--ok); } .headline.bad { color: var(--bad); } .headline.warn { color: var(--warn); }
.next { background:#f2f4f7; padding:10px 12px; border-radius:8px; }
pre { background:#101828; color:#e4e7ec; padding:12px; border-radius:8px; overflow:auto; max-height: 360px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
a { color: var(--brand); }
footer { color: var(--muted); font-size: 13px; padding-bottom: 32px; }
ol { padding-left: 20px; }

.filters { display:flex; gap:8px; margin: 8px 0; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 240px; padding:10px; border:1px solid var(--line); border-radius:8px; font: inherit; }
.filters select { padding:10px; border:1px solid var(--line); border-radius:8px; font: inherit; background:#fff; }
.cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.svc { border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:6px; background:#fff; }
.svc.off { opacity: .6; }
.svc h4 { margin:0; font-size: 15px; }
.svc p { margin:0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.svc .meta { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.badge { display:inline-block; padding:2px 8px; border-radius: 999px; font-size: 12px; font-weight:600; background:#eef0f3; color: var(--muted); }
.badge.ok { background:#e7f6ee; color: var(--ok); }
.badge.warn { background:#fffaeb; color: var(--warn); }
.badge.bad { background:#fef3f2; color: var(--bad); }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.svc button { margin-top: auto; }

/* marketplace additions */
.o-buy { background:#e3f1ff; color:#0b4f8a; }
.o-sim { background:#fff3d6; color:#8a5a00; }
.o-seller { background:#e0f5e6; color:#0b6b2a; }
.notice { background:#eef6ff; border-left:4px solid #3b82f6; padding:8px 12px; margin:6px 0; border-radius:0 8px 8px 0; }
.legend { list-style:none; padding:0; margin:8px 0; }
.legend li { margin:6px 0; }
.steps { list-style:none; padding:0; margin:6px 0; }
.step { color: var(--muted); }
.step.done { color: #0b6b2a; }
.svc.wide { grid-column: 1 / -1; }
nav.row a { font-weight:600; }
table { border-collapse: collapse; margin: 8px 0; }
th, td { text-align:left; padding:4px 12px 4px 0; }

/* Buyer / Seller tabs */
.tabs { display:flex; gap:8px; margin: 14px 0 6px; }
.tab { flex:1; display:flex; flex-direction:column; align-items:center; text-decoration:none; padding:10px 12px; border:2px solid var(--line); border-radius:12px; background:#fff; color:var(--ink); }
.tab .tab-title { font-weight:700; font-size:17px; }
.tab .tab-sub { font-size:12px; color:var(--muted); }
.tab:hover { border-color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color:#fff; }
.tab.active .tab-sub { color:#d6f1e6; }
.tab:focus-visible { outline:3px solid #7bd0b0; outline-offset:2px; }
.mode-line { margin: 4px 0 10px; font-weight:600; color: var(--brand); }
@media (max-width: 480px) { .tab .tab-sub { display:none; } .tab { padding:12px 8px; } }

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* seller dashboard */
.status-bar { position: sticky; top: 0; z-index: 5; display:flex; gap:12px; align-items:center; justify-content:space-between; padding:10px 12px; margin: 8px 0; border-radius:8px; font-weight:600; border:1px solid var(--line); background:#eef6ff; }
.status-bar.ok { background:#e7f6ee; border-color:#abefc6; color: var(--ok); }
.status-bar.bad { background:#fef3f2; border-color:#fecdca; color: var(--bad); }
.status-bar button { padding:4px 10px; }
.subtabs { display:flex; gap:8px; margin: 10px 0; flex-wrap: wrap; }
.subtab { padding:6px 14px; border-radius:999px; border:1px solid var(--line); background:#fff; color: var(--ink); text-decoration:none; font-weight:600; }
.subtab.active { background:#e7f6ee; border-color: var(--brand); color: var(--brand); }
a.btn { display:inline-block; background: var(--brand); color:#fff; padding:10px 16px; border-radius:8px; text-decoration:none; font-weight:600; }
a.btn.secondary { background:#fff; color: var(--brand); border:1px solid var(--brand); }
.badge.ok { background:#e7f6ee; color: var(--ok); }
.badge.warn { background:#fff4e5; color: var(--warn); }
.badge.bad { background:#fef3f2; color: var(--bad); }
.editor input { width:100%; padding:10px; border:1px solid var(--line); border-radius:8px; font: inherit; }

table.quote { width:100%; margin: 8px 0; }
table.quote th { font-weight:600; color: var(--muted); font-size:14px; }
table.quote td.v { text-align:right; font-variant-numeric: tabular-nums; font-weight:700; }
details > summary { cursor:pointer; padding:4px 0; }

/* development-only origin badges */
.o-sandbox { background:#efe3ff; color:#5a2a9a; }
.o-demo { background:#ffe7e0; color:#9a3412; }
