:root {
    --bg: #f6f7fb; --surface: #ffffff; --text: #1d2433; --muted: #6b7385; --border: #e3e6ee;
    --primary: #2f5bea; --primary-ink: #ffffff; --ok: #1f9d55; --ok-bg: #e6f6ed; --bad: #d64545; --bad-bg: #fdeaea;
    --warn: #b7791f; --warn-bg: #fdf5e6; --info-bg: #eaf0fe; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0f1320; --surface: #171c2c; --text: #e6e9f2; --muted: #98a0b3; --border: #283048;
        --primary: #5b7cff; --ok-bg: #12301f; --bad-bg: #3a1717; --warn-bg: #3a2c12; --info-bg: #1a2546; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.3rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; }
h4 { margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; word-break: break-all; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; overflow-x: auto; }
pre code { word-break: normal; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 820px; }
main { min-height: calc(100vh - 130px); padding: 20px 0 40px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav .user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer { border-top: 1px solid var(--border); padding: 16px 0; font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 8px; }
.inline { display: inline; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.row label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.grid .card { margin: 0; }
.card.highlight { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.project-card { color: var(--text); display: block; }
.project-card:hover { text-decoration: none; border-color: var(--primary); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; min-width: 220px; flex: 1; }
.input.narrow { flex: 0; min-width: 140px; }
.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--primary); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--border)); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.tiny { padding: 1px 8px; font-size: .75rem; }
.btn.link { border: none; background: none; color: var(--primary); padding: 0; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; background: var(--bg); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; }
.alert.error { background: var(--bad-bg); color: var(--bad); }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--info-bg); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-weight: 600; font-size: .85rem; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions .btn { margin-left: 4px; }
.table tr.detail td { background: var(--bg); }
.card.table, table.card { display: table; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.copy { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; }
.copy code { background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.project-head { display: flex; justify-content: space-between; align-items: flex-end; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-label { font-size: .8rem; color: var(--muted); }
.stat-value { font-size: 1.45rem; font-weight: 700; margin-top: 2px; }
.stat-hint { font-size: .78rem; color: var(--muted); }
.stat.bad .stat-value { color: var(--bad); }
.chart { width: 100%; height: 180px; display: block; }
.bar-sent { fill: color-mix(in srgb, var(--primary) 30%, transparent); }
.bar-delivered { fill: var(--primary); }
.chart-axis { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: middle; }
.legend .sw.sent { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.legend .sw.delivered { background: var(--primary); }
.chart-empty { padding: 40px 0; text-align: center; }
.timeline { list-style: none; padding: 0; margin: 6px 0 0; }
.timeline li { padding: 3px 0; }
.hero { background: linear-gradient(135deg, var(--primary), #7a4ff0); color: #fff; padding: 64px 0; margin: -20px 0 24px; }
.hero h1 { font-size: 2.2rem; }
.hero .lead { font-size: 1.1rem; max-width: 720px; opacity: .95; }
.hero .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn.primary { background: #fff; color: var(--primary); }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.features .card { margin: 0; }
.price-card { text-align: center; max-width: 420px; }
.price { font-size: 2.4rem; font-weight: 800; }
.docs ul { padding-left: 20px; }
tr.future td { background: var(--warn-bg); }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: var(--bad-bg); color: var(--bad); z-index: 1000; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
@media (max-width: 640px) {
    .grid.two { grid-template-columns: 1fr; }
    .input { min-width: 0; width: 100%; }
    .table { display: block; overflow-x: auto; }
    .hero h1 { font-size: 1.6rem; }
}
h1:focus { outline: none; }
.card { overflow-x: auto; }
.table td code { white-space: nowrap; }
.table.dns td:nth-child(3) code, .table.dns td:nth-child(4) code { white-space: normal; }
