:root { --ink:#1b2430; --muted:#667085; --line:#d9dee7; --bg:#f4f6f9; --card:#fff; --brand:#1f5fbf; --brand-dark:#174a96; --warn:#b45309; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
a { color:var(--brand); text-decoration:none; } a:hover { text-decoration:underline; }
h1 { font-size:1.5rem; margin:0 0 .5rem; } h2 { font-size:1.05rem; margin:0 0 .5rem; }
.muted { color:var(--muted); } .grow { flex:1; }
.top { display:flex; align-items:center; justify-content:space-between; padding:.6rem 1.25rem; background:var(--ink); color:#fff; }
.top a, .top .link { color:#fff; } .brand { font-weight:700; letter-spacing:.02em; }
.top nav { display:flex; align-items:center; gap:1rem; } .top form { margin:0; } .who { color:#aab4c4; font-size:.9rem; }
main { max-width:1100px; margin:1.5rem auto; padding:0 1.25rem; } body.wide main { max-width:none; margin:1rem 0; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:1.1rem 1.25rem; }
.narrow { max-width:420px; margin:2rem auto; } .empty { text-align:center; padding:2.5rem 1rem; }
.btn { display:inline-block; background:var(--brand); color:#fff; border:1px solid var(--brand); border-radius:6px; padding:.5rem 1rem; font:inherit; font-weight:600; cursor:pointer; }
.btn:hover { background:var(--brand-dark); text-decoration:none; }
.btn.ghost { background:#fff; color:var(--brand); } .btn.ghost:hover { background:#eef3fb; }
.btn.small { padding:.25rem .65rem; font-size:.85rem; }
.link { background:none; border:0; padding:0; font:inherit; cursor:pointer; text-decoration:underline; }
.field { display:block; margin:0 0 .9rem; } .field span { display:block; font-weight:600; margin-bottom:.2rem; }
.field input { width:100%; padding:.5rem .6rem; border:1px solid var(--line); border-radius:6px; font:inherit; }
.field input:focus { outline:2px solid #9dbcf0; border-color:var(--brand); }
.field .error { color:#b42318; display:block; } .check { display:block; margin:0 0 .9rem; }
form.inline { margin-top:.75rem; }
.flashes { max-width:1100px; margin:1rem auto 0; padding:0 1.25rem; }
.flash { padding:.6rem .9rem; border-radius:6px; margin-bottom:.5rem; border:1px solid var(--line); background:#fff; overflow-wrap:anywhere; }
.flash.success { border-color:#a6d8b5; background:#edf9f0; } .flash.error { border-color:#f1b0a8; background:#fdf0ee; }
.flash.dev { border-color:#f2d28b; background:#fff8e6; font-family:ui-monospace, Consolas, monospace; font-size:.85rem; }
.hero { padding:2.5rem 0 1.5rem; max-width:720px; } .hero h1 { font-size:2rem; line-height:1.2; } .hero p { font-size:1.05rem; }
.three { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:1rem; }
.row { display:flex; align-items:center; gap:1rem; } .between { justify-content:space-between; margin-bottom:1rem; } .row form { margin:0; }
table.list { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
table.list th, table.list td { text-align:left; padding:.6rem .9rem; border-bottom:1px solid var(--line); }
table.list th { background:#eef1f6; font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
/* project page */
.project-head { display:flex; justify-content:space-between; align-items:flex-end; padding:0 1.25rem .5rem; gap:1rem; }
.version select { font:inherit; padding:.3rem .4rem; margin-left:.4rem; }
.tabs { display:flex; align-items:center; gap:.35rem; padding:0 1.25rem; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.tab { padding:.5rem .9rem; border:1px solid transparent; border-bottom:0; border-radius:6px 6px 0 0; color:var(--muted); font-weight:600; }
.tab.on { background:#fff; border-color:var(--line); color:var(--ink); margin-bottom:-1px; }
.workspace { display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:1rem; padding:1rem 1.25rem; }
@media (max-width: 900px) { .workspace { grid-template-columns:1fr; } }
.viewer-wrap { background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden; display:flex; flex-direction:column; min-width:0; }
.toolbar { display:flex; align-items:center; gap:.5rem; padding:.45rem .7rem; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.draft { color:var(--warn); font-weight:700; font-size:.85rem; background:#fff4e0; border:1px solid #f2d28b; border-radius:4px; padding:.15rem .5rem; }
.layers { display:flex; gap:.7rem; font-size:.85rem; flex-wrap:wrap; } .layers label { white-space:nowrap; cursor:pointer; }
.viewer { height:calc(100vh - 235px); min-height:420px; background:#1e2430; cursor:grab; touch-action:none; user-select:none; position:relative; }
.viewer.dragging { cursor:grabbing; } .viewer svg { width:100%; height:100%; display:block; }
.viewer.light { background:#fff; } .viewer.light svg { filter:invert(1) hue-rotate(180deg) contrast(1.5) brightness(.82); }
.viewer .loading { color:#aab4c4; padding:2rem; margin:0; }
.tip { position:fixed; z-index:20; background:var(--ink); color:#fff; padding:.25rem .55rem; border-radius:4px; font-size:.85rem; pointer-events:none; white-space:nowrap; }
.side { display:flex; flex-direction:column; gap:1rem; } .side input[type=file] { display:block; margin:.5rem 0; max-width:100%; }
.facts { display:grid; grid-template-columns:auto 1fr; gap:.25rem .9rem; margin:0; } .facts dt { color:var(--muted); } .facts dd { margin:0; }
.working { text-align:center; padding:4rem 1rem; color:var(--muted); }
.spinner { width:34px; height:34px; margin:0 auto 1rem; border:3px solid var(--line); border-top-color:var(--brand); border-radius:50%; animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
/* templates */
.badge { display:inline-block; font-size:.75rem; font-weight:700; padding:.1rem .5rem; border-radius:999px; vertical-align:middle; letter-spacing:.02em; }
.badge.ok { background:#e3f5e8; color:#1d6b35; border:1px solid #a6d8b5; }
.badge.bad { background:#fdeceb; color:#a02a1d; border:1px solid #f1b0a8; }
.badge.wait { background:#eef1f6; color:var(--muted); border:1px solid var(--line); }
.badge.info { background:#e8f0fc; color:var(--brand-dark); border:1px solid #b9cdf0; }
.issue { border-left:4px solid var(--line); padding:.45rem .7rem; margin:.5rem 0; background:#fafbfc; border-radius:0 6px 6px 0; }
.issue.error { border-color:#d9402e; background:#fdf3f2; }
.issue.warning { border-color:#d99a20; background:#fffaf0; }
.issue.info { border-color:#9aaccc; }
.issue .fix { color:var(--muted); margin-top:.2rem; font-size:.92rem; }
.good { color:#1d6b35; font-weight:600; } .bad { color:#a02a1d; font-weight:600; }
.stack { display:flex; flex-direction:column; gap:1rem; min-width:0; }
.viewer.short { height:min(62vh, 640px); min-height:360px; }
.medium { max-width:640px; margin:1.5rem auto; }
.field textarea { width:100%; padding:.5rem .6rem; border:1px solid var(--line); border-radius:6px; font:inherit; }
.field small { display:block; }
.btn.danger { background:#fff; color:#a02a1d; border-color:#e5a39a; } .btn.danger:hover { background:#fdeceb; }
.row.wrap { flex-wrap:wrap; gap:.5rem; justify-content:flex-end; } .row.wrap form { margin:0; }
.small { font-size:.85rem; } .spaced { margin-top:1.5rem; } .narrowtext { max-width:640px; }
.notes { margin:.4rem 0 0; white-space:pre-line; } .checks { margin:.5rem 0 0; padding-left:1.2rem; } .checks li { margin:.25rem 0; }
.guide ol { padding-left:1.3rem; margin:.25rem 0 0; } .guide li { margin:.45rem 0; }
.guide .card { margin-top:1rem; } .guide code { background:#eef1f6; padding:0 .25rem; border-radius:3px; font-size:.9em; }
.guide table.list td { vertical-align:top; } .guide table.list td:first-child { white-space:nowrap; font-weight:600; }
.guide table.list td:last-child { white-space:nowrap; }

/* Billing and admin */
.big { font-size: 1.6rem; font-weight: 600; margin: .2rem 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: #a33; }
.pill { display: inline-flex; gap: .35rem; align-items: center; border: 1px solid #ccd; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; }
.top a.balance { font-variant-numeric: tabular-nums; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .1rem .6rem; }
table.list.money tr.total td { font-weight: 600; border-bottom: 2px solid #ccd; }
table.list tr.quiet td { color: #999; }
.admin-tabs { margin-bottom: 1rem; }
table.list.small td, table.list.small th { font-size: .85rem; padding: .3rem .45rem; }
table.list th.num, table.list td.num { text-align:right; }
.page h2 { margin-top:1.75rem; }
.card h2 { margin-top:0; }
.row.wrap.start, .card .row.wrap.start { justify-content:flex-start; }
.field select { width:100%; padding:.5rem .6rem; border:1px solid var(--line); border-radius:6px; font:inherit; background:#fff; }
form.row.wrap .field { flex:1 1 180px; }
.nowrap { white-space:nowrap; }
