:root {
    --bg: #f5f8f0;
    --surface: #ffffff;
    --border: #e4ecd9;
    --border-strong: #d4e0c3;
    --green: #5e9440;
    --green-dark: #3f6b29;
    --green-soft: #e6f0d8;
    --green-band: #d9ebc5;
    --text: #2c3626;
    --muted: #7a8870;
    --danger: #c0533f;
    --shadow: 0 1px 2px rgba(60, 80, 40, .06), 0 2px 8px rgba(60, 80, 40, .04);
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--green-dark); text-decoration: none; }
h1 { font-size: 1.7rem; font-weight: 650; margin: 0; }
h1:focus { outline: none; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
.right { text-align: right; }

/* ---------------------------------------------------------------- shell */
.app-shell { min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.brand-mark { color: var(--green); }

.topnav { display: flex; gap: .35rem; flex: 1; }
.navlink {
    padding: .45rem .9rem;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 500;
}
.navlink:hover { background: var(--green-soft); color: var(--green-dark); }
.navlink.active { background: var(--green-soft); color: var(--green-dark); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .8rem;
    background: var(--green-soft);
    border-radius: 999px;
    font-size: .85rem;
    color: var(--green-dark);
    font-weight: 500;
}
.user-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.content { max-width: 1100px; margin: 0 auto; padding: 2rem; }

/* ---------------------------------------------------------------- bits */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }

.breadcrumb { margin-bottom: 1rem; color: var(--muted); }
.breadcrumb .sep { margin: 0 .5rem; color: var(--border-strong); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}

.repo-card { display: block; transition: border-color .15s, transform .15s; }
.repo-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.repo-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.repo-icon {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    background: var(--green-soft); color: var(--green-dark);
    border-radius: 9px;
}
.repo-name { font-weight: 600; word-break: break-all; }
.repo-card-stats { display: flex; gap: 2rem; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.25rem; font-weight: 650; }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h2 { margin-bottom: .4rem; }

/* ---------------------------------------------------------------- table */
.table-card { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    font-size: .76rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 600;
    padding: .8rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: .85rem 1.2rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }

.tag-pill {
    display: inline-block;
    background: var(--green-soft); color: var(--green-dark);
    padding: .2rem .6rem; border-radius: 7px; font-weight: 600; font-size: .85rem;
}
.perm-pill {
    display: inline-block; margin: 0 .25rem .25rem 0;
    background: var(--green-soft); color: var(--green-dark);
    padding: .15rem .55rem; border-radius: 6px; font-size: .8rem;
}
.tag-latest { background: var(--green-dark); color: #fff; }
.tag-hint {
    margin-left: .4rem; cursor: help;
    color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    border: 1px dashed var(--border-strong); border-radius: 5px; padding: .05rem .35rem;
}

/* ---------------------------------------------------------------- admin */
.admin-section { margin-bottom: 1.5rem; }
.repo-settings { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin-bottom: 1.2rem; }
.form-repo { padding: .5rem .2rem; color: var(--green-dark); }
.subpanel { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px dashed var(--border-strong); }

.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }

.input {
    padding: .5rem .7rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font: inherit;
    background: #fcfdfb;
    color: var(--text);
}
.input:focus { outline: 2px solid var(--green-soft); border-color: var(--green); }
.input.small { width: 90px; }

.check { display: inline-flex; align-items: center; gap: .4rem; }

.btn {
    padding: .5rem .95rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font: inherit; font-weight: 550;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--green-dark); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-danger { background: transparent; border-color: #e7c4ba; color: var(--danger); }
.btn-danger:hover { background: #f7eae6; }
.form-msg { color: var(--green-dark); font-size: .85rem; }

/* ---------------------------------------------------------------- disk meter */
.disk-meter { margin-bottom: 1.3rem; }
.disk-bar { height: 12px; background: var(--green-soft); border-radius: 999px; overflow: hidden; margin-bottom: .4rem; }
.disk-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.disk-fill.over { background: var(--danger); }

/* ---------------------------------------------------------------- blazor defaults */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--green); }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error occurred."; }

/* ============================================================ marketing */
.btn-lg { padding: .7rem 1.3rem; font-size: 1.02rem; border-radius: 10px; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* title + inline refresh button */
.title-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .15rem; }
.title-row h1 { margin: 0; }
.btn-refresh { display: inline-flex; align-items: center; justify-content: center; padding: .3rem .55rem; line-height: 1; }
.refresh-icon { display: inline-block; font-size: 1.15rem; }
.refresh-icon.spinning { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- confirm modal */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 30, 18, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal-card {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%; max-width: 30rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.modal-card h2 { margin: 0 0 .5rem; }
.modal-message { margin: 0 0 1.25rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* small inline delete button (table rows) */
.btn-icon-danger {
    padding: .25rem .6rem; font: inherit; font-size: .85rem;
    background: transparent; border: 1px solid #e7c4ba; color: var(--danger);
    border-radius: 8px; cursor: pointer;
    transition: background .15s;
}
.btn-icon-danger:hover { background: #f7eae6; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }

/* GitHub link/button */
.gh-link, .btn-github { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.gh-icon { display: inline-block; vertical-align: middle; }
.gh-link { color: var(--green-dark); }
.gh-link-muted { color: var(--muted); }
.gh-link-muted:hover { color: var(--green-dark); }
.btn-github {
    padding: .7rem 1.2rem; border-radius: 10px;
    background: #20271c; color: #eaf3df; border: 1px solid #20271c;
    transition: transform .12s, background .15s;
}
.btn-github:hover { background: #2c3826; transform: translateY(-1px); }

/* public chrome */
.public-shell { display: flex; flex-direction: column; min-height: 100vh; }
.public-topbar {
    display: flex; align-items: center; gap: 2rem;
    padding: 1rem 2rem; max-width: 1180px; width: 100%; margin: 0 auto;
}
.public-nav { display: flex; gap: 1.4rem; flex: 1; }
.public-nav a { color: var(--muted); font-weight: 500; }
.public-nav a:hover { color: var(--green-dark); }
.public-actions { display: flex; align-items: center; gap: .8rem; }

.public-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner {
    max-width: 1180px; margin: 0 auto; padding: 1.6rem 2rem .6rem;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-brand { font-weight: 700; color: var(--green-dark); }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--green-dark); }
.footer-meta { max-width: 1180px; margin: 0 auto; padding: 0 2rem 1.6rem; color: var(--muted); font-size: .85rem; }

/* hero */
.hero {
    background: radial-gradient(1200px 500px at 50% -120px, var(--green-band), transparent 70%), var(--bg);
    padding: 3.5rem 1.5rem 2rem;
}
.hero-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.eyebrow {
    display: inline-block; background: var(--green-soft); color: var(--green-dark);
    padding: .35rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    letter-spacing: .02em; margin-bottom: 1.4rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; font-weight: 750; letter-spacing: -.02em; }
.hero-sub { font-size: 1.18rem; color: #4d5a44; max-width: 680px; margin: 1.2rem auto 0; }
.hero-sub code { background: var(--green-soft); padding: .05em .35em; border-radius: 5px; font-size: .92em; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.8rem 0; }
.hero-code { max-width: 760px; margin: 1.2rem auto 0; text-align: left; }
.hero-note { color: var(--muted); font-size: .9rem; margin-top: .6rem; }

/* code block */
.code {
    position: relative; background: #1d241a; color: #e7efdd;
    border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9rem;
    box-shadow: var(--shadow);
}
.code code { white-space: pre-wrap; word-break: break-word; display: block; padding-right: 4.5rem; }
.copy-btn {
    position: absolute; top: .6rem; right: .6rem;
    background: #2f3c28; color: #d8e6cb; border: 1px solid #3c4a32;
    border-radius: 7px; padding: .3rem .6rem; font-size: .78rem; cursor: pointer;
}
.copy-btn:hover { background: #3a4a30; }

/* product shot (CSS mock) */
.shot {
    max-width: 820px; margin: 3rem auto 0; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 50px rgba(60,80,40,.12); overflow: hidden;
}
.shot-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem .9rem; background: #eef3e7; border-bottom: 1px solid var(--border); }
.shot-dot { width: 11px; height: 11px; border-radius: 50%; background: #cdd9bf; }
.shot-url { margin-left: .7rem; font-size: .76rem; color: #6b7a5f; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: .18rem .65rem; }
.shot-caption { color: var(--muted); font-size: .85rem; margin-top: .7rem; }
.shot-body { padding: 1.4rem; text-align: left; }
.shot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.shot-h1 { font-weight: 650; font-size: 1.2rem; }
.shot-chip { background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; }
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.shot-card { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; background: #fcfdfb; }
.shot-card-h { font-weight: 600; color: var(--green-dark); margin-bottom: .8rem; }
.shot-card-s { color: var(--muted); font-size: .9rem; }
.shot-card-s b { color: var(--text); }

/* sections */
.section { max-width: 1080px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-tint { max-width: none; background: var(--green-soft); }
.section-tint > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 700; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.feature-ic { font-size: 1.7rem; margin-bottom: .7rem; }
.feature h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.feature p { color: #55624b; margin: 0; }
.feature code { background: var(--green-soft); color: var(--green-dark); padding: .05em .3em; border-radius: 4px; font-size: .88em; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.why-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }
.why-col h4 { margin: 0 0 .5rem; color: var(--muted); }
.why-col p { margin: 0; color: #55624b; }
.why-col-hl { border-color: var(--green); box-shadow: 0 8px 24px rgba(94,148,64,.18); }
.why-col-hl h4 { color: var(--green-dark); }
.why-col-hl em { color: var(--green-dark); font-style: normal; font-weight: 600; }

.steps { list-style: none; padding: 0; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.2rem; }
.steps li { display: flex; gap: 1rem; }
.step-n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.step-body { flex: 1; }
.step-body h3 { margin: .3rem 0 .6rem; }
.center { text-align: center; margin-top: 1.5rem; }

.cta-band {
    text-align: center; padding: 4rem 1.5rem;
    background: linear-gradient(180deg, var(--green-soft), var(--green-band));
}
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 750; }
.cta-band p { color: #4d5a44; margin: .6rem 0 1.6rem; }
.byline { color: var(--muted); font-size: .9rem; margin-top: 1.4rem; }
.byline a { color: var(--green-dark); font-weight: 600; }

/* spotlight (auto-latest killer feature) */
.spotlight {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: #f3f8ec; padding: 4rem 1.5rem;
}
.spotlight-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.spotlight h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 750; color: #fff; margin: .6rem 0 0; }
.spotlight h2 code, .spotlight p code { background: rgba(255,255,255,.16); color: #fff; padding: .05em .35em; border-radius: 5px; }
.spotlight p { color: #e4efd6; max-width: 640px; margin: 1rem auto 0; font-size: 1.1rem; }
.spotlight strong { color: #fff; }
.eyebrow-light { background: rgba(255,255,255,.18); color: #fff; }
.spotlight-demo {
    display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
    margin-top: 2rem;
}
.demo-cmd {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9rem;
    background: rgba(0,0,0,.28); color: #eaf3df; padding: .7rem 1rem; border-radius: 10px;
}
.demo-arrow { font-size: 1.5rem; opacity: .85; }
.demo-chip {
    background: #fff; color: var(--green-dark); font-weight: 700;
    padding: .7rem 1.1rem; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

/* comparison table */
.compare-wrap { overflow-x: auto; }
.compare {
    width: 100%; border-collapse: collapse; min-width: 640px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.compare th, .compare td { padding: .85rem 1rem; text-align: center; border-bottom: 1px solid var(--border); }
.compare thead th { font-weight: 700; color: var(--text); background: #f3f7ec; }
.compare tbody th { text-align: left; font-weight: 500; color: var(--text); }
.compare tbody th code { background: var(--green-soft); color: var(--green-dark); padding: .05em .3em; border-radius: 4px; font-size: .88em; }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: none; }
.th-sub { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.col-hoardr { background: var(--green-soft); }
.compare thead .col-hoardr { background: var(--green); color: #fff; }
.yes { color: var(--green-dark); font-weight: 700; }
.no { color: #b06a5b; font-weight: 600; }
.no small { color: var(--muted); font-weight: 500; display: block; font-size: .72rem; }
.meh { color: var(--muted); font-weight: 600; }
.row-star .col-hoardr { background: #d9ebc5; }
.row-star th { font-weight: 700; }

/* built-for-CI points */
.ci-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.ci-point { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.ci-ic { font-size: 1.6rem; }
.ci-point h4 { margin: .6rem 0 .35rem; font-size: 1.05rem; }
.ci-point p { margin: 0; color: #55624b; }
.ci-point code { background: var(--green-soft); color: var(--green-dark); padding: .05em .3em; border-radius: 4px; font-size: .88em; }

/* docs (faq / setup) */
.doc { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem; }
.doc-head { margin-bottom: 2rem; }
.doc-head h1 { font-size: 2.1rem; }
.doc h2 { font-size: 1.35rem; margin: 2.2rem 0 .8rem; }
.doc h3 { margin: 1.4rem 0 .6rem; }
.doc p { color: #4d5a44; }
.doc .code { margin: .8rem 0; }
.doc-table { box-shadow: var(--shadow); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.doc-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 2.5rem; }

.faq { display: flex; flex-direction: column; gap: .7rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .2rem 1.1rem; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 600; padding: .9rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--green); font-weight: 700; margin-right: .6rem; }
.faq details[open] summary::before { content: "–"; }
.faq details p { margin: 0 0 1rem; color: #4d5a44; }

/* login */
.login-wrap { display: grid; place-items: center; padding: 4rem 1.5rem; min-height: 60vh; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.login-card h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.login-form .input { width: 100%; }
.form-error { background: #f7eae6; color: var(--danger); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; margin-top: 1rem; }
.login-foot { margin-top: 1.4rem; font-size: .88rem; color: var(--muted); text-align: center; }
.logout-form { display: inline; }

@media (max-width: 720px) {
    .public-nav { display: none; }
    .shot-grid { grid-template-columns: 1fr; }
}
