:root {
    --bg: #0f172a; --panel: #ffffff; --ink: #1e293b; --muted: #64748b;
    --accent: #2563eb; --accent-dark: #1d4ed8; --ok: #059669; --err: #dc2626;
    --line: #e2e8f0; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: #f8fafc; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.5rem; background: var(--bg); color: #fff; position: relative; flex-wrap: wrap; }
.site-header .brand { color: #fff; font-weight: 700; font-size: 1.15rem; }

/* Hamburger toggle (works without JavaScript) */
.nav-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 38px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.nav-toggle:hover { background: rgba(255,255,255,.1); }
.nav-toggle span { display: block; height: 2px; background: #e2e8f0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle-input:focus-visible + .nav-toggle { outline: 2px solid #60a5fa; outline-offset: 2px; }
.nav-toggle-input:checked + .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-input:checked + .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-toggle-input:checked + .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-header nav { display: none; position: absolute; top: 100%; right: 1rem; z-index: 900;
    min-width: 210px; flex-direction: column; gap: 0; padding: .35rem 0;
    background: var(--bg); border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.nav-toggle-input:checked ~ nav { display: flex; }
.site-header nav a, .site-header nav .linkbtn { color: #cbd5e1; padding: .55rem 1rem; text-align: left; display: block; }
.site-header nav a + a, .site-header nav .inline { border-top: 1px solid rgba(255,255,255,.08); }
.site-header nav a:hover, .site-header nav .linkbtn:hover { color: #fff; text-decoration: none; }
.inline { display: block; margin: 0; }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; width: 100%; }
.container { max-width: 960px; margin: 2rem auto; padding: 0 1.25rem; }
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 { font-size: 2.1rem; margin-bottom: 0.5rem; }
.cta { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }
.button { display: inline-block; background: var(--accent); color: #fff; padding: 0.6rem 1.1rem; border-radius: var(--radius); border: 0; cursor: pointer; font: inherit; }
.button:hover { background: var(--accent-dark); text-decoration: none; }
.button-secondary { background: #475569; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.card h3 { margin-top: 0; }
.form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; max-width: 520px; display: grid; gap: 0.9rem; }
.form-inline { max-width: 100%; }
.form label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
.form input, .form select { padding: 0.55rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.inline-fields { border: 0; padding: 0; margin: 0; display: flex; gap: 1rem; }
.table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
.table thead th { background: #f1f5f9; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.flash { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #e0f2fe; color: #075985; }
.muted { color: var(--muted); }
.record { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.warnings { color: #92400e; }
.explain dt { font-weight: 700; font-family: monospace; margin-top: 0.5rem; }
.site-footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: 0.85rem; }

/* Dashboard DNS status */
.dns-badge { display:inline-block; padding:.15rem .55rem; border-radius:999px; font-size:.8rem; font-weight:600; }
.dns-ok { background:#dcfce7; color:#166534; }
.dns-warn { background:#fef9c3; color:#854d0e; }
.dns-bad { background:#fee2e2; color:#991b1b; }
.dns-unknown { background:#e2e8f0; color:#475569; }
.dns-fresh { margin-left:.4rem; font-size:.9rem; cursor:help; }
.dns-fresh-cached { color:#94a3b8; }
.dns-fresh-live { color:#059669; }
.dns-fresh-changed { color:#d97706; }
.dns-spf { color:#475569; font-size:.85rem; }

/* Reports */
.period a { margin-right:.6rem; }
.period a.active { font-weight:700; text-decoration:underline; }
.res-pass { color:#166534; font-weight:600; }
.res-fail { color:#991b1b; font-weight:600; }
ul.plain { line-height:1.7; }

/* Plain-language verdict */
.verdict { display:flex; gap:1rem; align-items:flex-start; padding:1.15rem 1.25rem; border-radius:12px; margin:1.25rem 0 1.5rem; border:1px solid; }
.verdict-good    { background:#ecfdf5; border-color:#a7f3d0; }
.verdict-watch   { background:#fffbeb; border-color:#fde68a; }
.verdict-concern { background:#fef2f2; border-color:#fecaca; }
.verdict-unknown { background:#f1f5f9; border-color:#e2e8f0; }
.verdict-icon { font-size:1.5rem; line-height:1.2; font-weight:700; }
.verdict-good .verdict-icon    { color:#059669; }
.verdict-watch .verdict-icon   { color:#b45309; }
.verdict-concern .verdict-icon { color:#b91c1c; }
.verdict-unknown .verdict-icon { color:#64748b; }
.verdict-headline { margin:0 0 .35rem; font-size:1.25rem; }
.verdict-summary { margin:0; }
.verdict-points { margin:.7rem 0 0; padding-left:1.1rem; line-height:1.6; }
.verdict-points li { margin-bottom:.35rem; }
.tech-heading { margin-top:2rem; padding-top:1.25rem; border-top:1px solid var(--line); color:var(--muted); font-size:1.05rem; text-transform:uppercase; letter-spacing:.04em; }

/* Copy-to-clipboard (icon only) */
.record-wrap { position:relative; }
.record-wrap .record { padding-right:3rem; }
.copy-icon-btn { position:absolute; top:.5rem; right:.5rem; display:inline-flex; align-items:center; justify-content:center;
    width:32px; height:32px; padding:0; background:transparent; border:0; border-radius:6px;
    color:#94a3b8; cursor:pointer; transition:color .15s, background .15s; }
.copy-icon-btn:hover { color:#e2e8f0; background:rgba(255,255,255,.08); }
.copy-icon-btn:focus-visible { outline:2px solid #60a5fa; outline-offset:2px; }
.copy-icon-btn svg { pointer-events:none; display:block; }
.copy-icon-btn .ico-done { display:none; }
.copy-icon-btn.copied { color:#34d399; }
.copy-icon-btn.copied .ico-copy { display:none; }
.copy-icon-btn.copied .ico-done { display:block; }
.copy-icon-btn.copy-failed { color:#fbbf24; }

/* Checkbox row (login etc.) */
.check-row { display:flex; flex-direction:row; align-items:center; gap:.5rem; font-weight:400; }
.check-row input { width:auto; }

/* Plans & checkout */
.plan-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:1rem; margin:1.5rem 0; align-items:stretch; }
@media (min-width:880px) { .plan-grid { grid-template-columns:repeat(4,1fr); } }
.plan-current { display:block; text-align:center; color:var(--muted); font-size:.85rem; padding:.6rem 0; }
.plan-card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem; display:flex; flex-direction:column; }
.plan-card h2 { margin:0 0 .5rem; font-size:1.2rem; }
.plan-free { background:#f8fafc; }
.plan-price { font-size:1.1rem; margin:.25rem 0 1rem; }
.plan-price .per { color:var(--muted); font-size:.85rem; }
.plan-features { list-style:none; padding:0; margin:0 0 1rem; font-size:.9rem; line-height:1.8; }
.plan-features li { border-bottom:1px solid var(--line); padding:.1rem 0; }
.plan-actions { margin-top:auto; display:flex; flex-direction:column; gap:.5rem; }
.plan-actions .button { text-align:center; }
.checkout-summary { max-width:460px; }
.checkout-summary th { width:45%; }

/* Modal (payment window) */
.modal-overlay { position:fixed; inset:0; background:rgba(15,23,42,.6); display:flex; align-items:center;
    justify-content:center; padding:1rem; z-index:1000; }
.modal-overlay[hidden] { display:none; }
.modal { background:var(--panel); border-radius:12px; box-shadow:0 20px 50px rgba(0,0,0,.3);
    max-width:440px; width:100%; max-height:92vh; overflow:auto; }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:.85rem 1.1rem;
    border-bottom:1px solid var(--line); }
.modal-head h2 { margin:0; font-size:1.05rem; }
.modal-close { font-size:1.5rem; line-height:1; color:var(--muted); text-decoration:none; padding:0 .25rem; }
.modal-close:hover { color:var(--ink); text-decoration:none; }
.modal #payment-div { padding:.75rem; min-height:120px; }
body.modal-open { overflow:hidden; }

/* Billing form */
.field-row { display:grid; grid-template-columns:1fr 1fr; gap:.9rem; }
@media (max-width:520px) { .field-row { grid-template-columns:1fr; } }
.vat-status { padding:.55rem .75rem; border-radius:8px; font-size:.9rem; }
.vat-checking { background:#f1f5f9; color:#475569; }
.vat-ok { background:#dcfce7; color:#166534; }
.vat-info { background:#e0f2fe; color:#075985; }

/* Account */
.account-table { max-width:620px; }
.account-table th { width:35%; vertical-align:top; }
.plan-active { border-color:var(--accent); box-shadow:0 0 0 2px rgba(37,99,235,.15); }
.plan-badge { display:inline-block; background:var(--accent); color:#fff; font-size:.65rem; font-weight:700;
    padding:.15rem .4rem; border-radius:999px; vertical-align:middle; margin-left:.35rem; text-transform:uppercase; }

/* Quota / suspended domains */
.quota-notice { line-height:1.6; }
.row-suspended { opacity:.6; }
.tag-paused { display:inline-block; margin-left:.4rem; padding:.1rem .45rem; border-radius:999px;
    background:#fee2e2; color:#991b1b; font-size:.7rem; font-weight:700; text-transform:uppercase; }

/* Field hints */
.field-hint { display:block; font-weight:400; font-size:.8rem; color:var(--muted); margin-top:.15rem; }

/* Account actions */
.account-actions { display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
.inline-form { display:inline; margin:0; }
.button-danger { background:#b91c1c; }
.button-danger:hover { background:#991b1b; }
.button-quiet { background:transparent; color:var(--muted); border:1px solid var(--line); }
.button-quiet:hover { background:#f1f5f9; color:var(--ink); }

/* Contacts */
.contact-card { margin-bottom:1rem; }
.contact-card h3 { margin:0 0 .6rem; font-size:1rem; }
.contact-card h3 .muted { font-weight:400; font-size:.85rem; }
.perm-set { border:1px solid var(--line); border-radius:8px; padding:.7rem .9rem; margin:0 0 .8rem; }
.perm-set legend { font-size:.8rem; font-weight:700; color:var(--muted); padding:0 .3rem; }
.linkbtn-danger { background:none; border:0; color:#b91c1c; cursor:pointer; font:inherit; padding:0; font-size:.85rem; }
.linkbtn-danger:hover { text-decoration:underline; }

/* Admin */
.admin-nav { display:flex; gap:1rem; flex-wrap:wrap; padding:.6rem 0; margin:0 0 1.2rem;
    border-bottom:1px solid var(--line); font-size:.9rem; }
.admin-nav a.active { font-weight:700; }
.tag-admin { display:inline-block; margin-left:.35rem; padding:.05rem .4rem; border-radius:999px;
    background:#1e293b; color:#fff; font-size:.65rem; text-transform:uppercase; font-weight:700; }
.small { font-size:.85rem; color:var(--muted); }
.tiny-input { width:5rem; padding:.2rem .35rem; }
.linkbtn-action { background:none; border:0; color:var(--accent); cursor:pointer; font:inherit; padding:0; font-size:.85rem; }
.linkbtn-action:hover { text-decoration:underline; }

/* Impersonation */
.impersonation-bar { display:flex; align-items:center; justify-content:space-between; gap:1rem;
    flex-wrap:wrap; background:#fef3c7; color:#78350f; padding:.6rem 1.5rem;
    border-bottom:1px solid #fcd34d; font-size:.9rem; }
.impersonation-bar .button-quiet { background:#fff; border-color:#fcd34d; color:#78350f; }

/* Danger zone */
.danger-zone { border:1px solid #fecaca; background:#fef2f2; border-radius:var(--radius);
    padding:1.1rem 1.25rem; margin-top:.75rem; }
.danger-zone .form { background:transparent; border:0; padding:0; max-width:420px; }
.danger-zone ul.plain { margin:.5rem 0 1rem; padding-left:1.1rem; }

/* VAT threshold */
.threshold-bar { height:10px; background:#e2e8f0; border-radius:999px; overflow:hidden; margin:.6rem 0 .4rem; max-width:460px; }
.threshold-fill { height:100%; background:var(--accent); }
.verdict-concern .threshold-fill { background:#b91c1c; }
.verdict-watch .threshold-fill { background:#d97706; }
.verdict-good .threshold-fill { background:#059669; }

/* Front page secondary actions */
.cta-secondary { margin-top:.75rem; }

/* Dashboard concerns and row actions */
.stat-num.stat-good { color:#059669; }
.stat-num.stat-bad { color:#b91c1c; }
.concern { display:inline-block; padding:.1rem .45rem; border-radius:999px; font-size:.75rem; font-weight:700; margin-right:.25rem; }
.concern-critical { background:#fee2e2; color:#991b1b; }
.concern-warning { background:#fef9c3; color:#854d0e; }
.concern-none { background:#f1f5f9; color:#64748b; font-weight:400; }
.row-action { text-align:right; width:2.5rem; }
.row-action a { display:inline-block; font-size:1.6rem; line-height:1; color:var(--muted); text-decoration:none; padding:0 .35rem; }
.row-action a:hover { color:var(--accent); text-decoration:none; }

/* Footer links */
.footer-links { display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; margin-top:.35rem; }
.footer-links a { color:var(--muted); }
.footer-links a:hover { color:var(--ink); }
.linkbtn-footer { background:none; border:0; color:var(--muted); cursor:pointer; font:inherit; padding:0; }
.linkbtn-footer:hover { color:var(--ink); text-decoration:underline; }

/* Terms */
.terms-body { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius);
    padding:1.5rem 1.75rem; line-height:1.7; }
.terms-heading { font-size:1.05rem; margin:1.5rem 0 .5rem; padding-bottom:.3rem; border-bottom:1px solid var(--line); }
.terms-heading:first-child { margin-top:0; }
.terms-list { margin:.4rem 0 .9rem; padding-left:1.2rem; }
.terms-list li { margin-bottom:.2rem; }
.terms-overlay { align-items:flex-start; padding-top:3vh; }
.terms-modal { max-width:720px; }
.terms-modal-body { padding:1.1rem 1.35rem 1.4rem; }
.terms-scroll { max-height:40vh; overflow-y:auto; border:1px solid var(--line); border-radius:8px;
    padding:1rem 1.15rem; margin:.9rem 0; background:#f8fafc; font-size:.9rem; line-height:1.6; }
.terms-scroll .terms-heading { font-size:.95rem; }
.form-wide { max-width:900px; }
.form-wide textarea { width:100%; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.85rem;
    padding:.6rem; border:1px solid var(--line); border-radius:8px; line-height:1.5; }

/* Front-page domain check */
.check { max-width: 640px; margin: 2rem auto 0; text-align: center; }
.check h2 { margin-bottom: .25rem; }
.check-form { display: flex; gap: .6rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.check-form input { flex: 1 1 260px; max-width: 340px; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.check-results { display: grid; gap: .6rem; margin-top: 1.25rem; text-align: left; }
.check-row { display: flex; align-items: center; gap: .75rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; }
.check-row strong { display: block; }
.check-detail { color: var(--muted); font-size: .85rem; }
.check-badge { flex: 0 0 auto; min-width: 92px; text-align: center; }
.check-error { margin-top: 1rem; color: var(--err); }

/* Admin visitor log */
.visitor-filter { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.visitor-filter label { font-size: .9rem; color: var(--muted); }
.visitor-filter input[type="date"] { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.visitor-filter .checkbox { display: inline-flex; align-items: center; gap: .35rem; }
.visitor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem 1.5rem; }
.visitor-grid h2 { font-size: 1.05rem; margin-bottom: .3rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }

/* Front-page check: grades and findings */
.check-body { flex: 1; }
.check-grade { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; }
.grade-good { background: #dcfce7; color: #166534; }
.grade-weak { background: #fef9c3; color: #854d0e; }
.grade-bad  { background: #fee2e2; color: #991b1b; }
.check-findings { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; }
.check-findings .finding { font-size: .82rem; padding: .4rem .6rem; border-radius: 8px; border-left: 3px solid var(--line); background: #f8fafc; color: var(--ink); }
.finding-error { border-left-color: #dc2626; background: #fef2f2; }
.finding-warn  { border-left-color: #d97706; background: #fffbeb; }
.finding-tip   { border-left-color: #2563eb; background: #eff6ff; }

/* Front-page test-email confirmation + MX row */
.email-check { margin-top: 1.5rem; text-align: center; }
.email-check-panel { margin-top: 1rem; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.email-steps { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .4rem; }
.email-check-address, #email-check-address { display: inline-block; margin-top: .3rem; padding: .3rem .5rem; background: #f1f5f9; border-radius: 6px; font-family: ui-monospace, monospace; word-break: break-all; }
.email-check-status { margin-top: .75rem; color: var(--muted); }
.email-check-result { margin-top: .75rem; }
.ec-verdicts { display: flex; gap: 1rem; flex-wrap: wrap; margin: .5rem 0; }
.ec-verdict { display: inline-flex; align-items: center; gap: .4rem; }
