/* QA, in the Cream style: Figtree, charcoal and white, #48ec67 green. */

/* Figtree, from Google Fonts (loaded in views/layout.php). */

:root {
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #f6f6f4; --line: #e6e6e2; --line-strong: #d4d4cf;
  --text: #262626; --muted: #6f6f6c; --faint: #a3a3a0;
  --primary: #48ec67; --primary-hover: #34dc55; --primary-ink: #262626; --primary-soft: #e3fbe8;
  --pass: #48ec67; --warn: #ffc23d; --fail: #ff5c4d; --info: #9ec5ff; --none: #e8e8e4;
  --pass-ink: #13852d; --warn-ink: #9a6000; --fail-ink: #d1372a; --info-ink: #2e62b0; --manual-ink: #262626;
  --pass-bg: #e3fbe8; --warn-bg: #fff3d6; --fail-bg: #ffe8e5; --info-bg: #e8f1ff; --manual-bg: #ececea;
  --side-bg: #262626; --side-text: #a8a8a5; --side-hover: #333333; --side-line: #3a3a3a;
  --shadow: none;
  --radius: 4px; --radius-sm: 3px;
  --topbar: 72px; --sidebar: 268px;
  color-scheme: light;
}
/* Dark theme: follows the system unless the sidebar switch picks one (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1c; --surface: #242424; --surface-2: #2b2b2b; --line: #333333; --line-strong: #444444;
    --text: #f0f0ee; --muted: #a6a6a3; --faint: #737370;
    --primary-soft: #1f3a26;
    --pass-ink: #6cf487; --warn-ink: #ffd36e; --fail-ink: #ff8a7e; --info-ink: #a9cbff; --manual-ink: #f0f0ee;
    --pass-bg: #1f3a26; --warn-bg: #3d3115; --fail-bg: #43221e; --info-bg: #1e2c43; --manual-bg: #333333;
    --none: #3a3a3a;
    --side-bg: #141414; --side-hover: #262626; --side-line: #2c2c2c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #1c1c1c; --surface: #242424; --surface-2: #2b2b2b; --line: #333333; --line-strong: #444444;
    --text: #f0f0ee; --muted: #a6a6a3; --faint: #737370;
    --primary-soft: #1f3a26;
    --pass-ink: #6cf487; --warn-ink: #ffd36e; --fail-ink: #ff8a7e; --info-ink: #a9cbff; --manual-ink: #f0f0ee;
    --pass-bg: #1f3a26; --warn-bg: #3d3115; --fail-bg: #43221e; --info-bg: #1e2c43; --manual-bg: #333333;
    --none: #3a3a3a;
    --side-bg: #141414; --side-hover: #262626; --side-line: #2c2c2c;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 300 16px/1.5 Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
b, strong { font-weight: 500; }
a { color: inherit; }
h1 { font-size: 2rem; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; line-height: 1.1; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
code { font: .85em ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.ti { line-height: 1; }

/* Controls */
input, textarea, button { font: inherit; color: inherit; }
input[type=text], input:not([type]), input[type=search], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button { cursor: pointer; }
button, .btn-primary { background: var(--primary); color: var(--primary-ink); border: 0; border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 500; white-space: nowrap; }
button:hover { background: var(--primary-hover); }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); }
button.secondary:hover { background: var(--surface-2); }
button:disabled { opacity: .6; cursor: progress; }
.icon-btn { background: transparent; color: var(--muted); padding: 6px; border-radius: 7px; font-size: 17px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
form.inline { display: inline; }
label { display: block; font-weight: 500; }
label input, label textarea { margin-top: 4px; font-weight: 400; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 24px; padding: 0 28px 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: .85rem; line-height: 1.15; width: calc(var(--sidebar) - 24px); flex: none; }
.logo { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 20px; }
.top-scan { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.search-pill { display: flex; align-items: center; gap: 6px; width: 100%; max-width: 620px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 16px; }
.search-pill > .ti { color: var(--muted); font-size: 18px; }
.search-pill input[name=domain] { border: 0; background: transparent; padding: 8px 4px; min-width: 0; flex: 1; }
.search-pill input[name=domain]:focus-visible { outline: none; }
.search-pill:focus-within { border-color: var(--primary); }
.search-pill .btn-primary { border-radius: 999px; padding: 8px 20px; }
.prelaunch { position: relative; }
.prelaunch summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; padding: 6px 10px; border-radius: 999px; }
.prelaunch summary::-webkit-details-marker { display: none; }
.prelaunch summary:hover, .prelaunch[open] summary { background: var(--surface); color: var(--text); }
.prelaunch-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(16, 24, 40, .12); z-index: 30; }
.prelaunch-pop p { margin: 8px 0 0; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 28px 16px 20px; display: flex; flex-direction: column; gap: 18px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; font-size: .88rem; }
.nav-item .ti { font-size: 19px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary); color: var(--primary-ink); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label small { display: block; font-size: .72rem; font-weight: 400; color: var(--faint); }
.count { font-size: .72rem; font-weight: 600; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.count.bad { background: var(--fail-bg); color: var(--fail-ink); }
.count.accent { background: var(--manual-bg); color: var(--manual-ink); }
.nav-item.active .count { background: rgba(255, 255, 255, .2); color: inherit; }
.nav-group summary { list-style: none; cursor: pointer; padding: 0 14px 6px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); display: flex; justify-content: space-between; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '–'; }
.nav-group:not([open]) summary::after { content: '+'; }
.nav-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.nav-item.as-form { padding: 0; }
.nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; background: transparent; color: var(--muted); text-align: left; font-weight: 500; font-size: .88rem; border-radius: var(--radius-sm); white-space: normal; }
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn .ti { font-size: 19px; }

.main { padding: 32px 36px 60px; min-width: 0; }
.wrap { max-width: 960px; margin: 0 auto; padding: 32px 16px 60px; }

/* Panels */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.filter-pill { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; max-width: 240px; }
.filter-pill .ti { color: var(--muted); }
.filter-pill input { border: 0; background: transparent; padding: 7px 0; }
.filter-pill input:focus-visible { outline: none; }
.filter-pill:focus-within { border-color: var(--primary); }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 16px; }
.flash.error, .error { color: var(--fail-ink); }
.flash.error { background: var(--fail-bg); }
.flash.notice, .notice { color: var(--pass-ink); }
.flash.notice { background: var(--pass-bg); }
.empty { text-align: center; padding: 48px 20px; }
.empty .ti { font-size: 40px; color: var(--faint); }

/* Home layout */
.home-grid.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 0; }
.greeting { font-size: 1.75rem; line-height: 1.25; }
.greeting span { font-weight: 500; font-size: 1.05rem; color: var(--muted); }

.home-aside { display: flex; flex-direction: column; gap: 12px; }
.home-aside > h2 { margin: 4px 0 4px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); text-decoration: none; transition: transform .12s; }
.stat:hover { transform: translateY(-1px); }
.stat small { display: block; font-size: .78rem; color: var(--muted); }
.stat b { display: block; font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; font-size: 19px; flex: none; }
.stat.mint { background: var(--mint); } .stat.mint .stat-icon { color: var(--pass-ink); }
.stat.rose { background: var(--rose); } .stat.rose .stat-icon { color: var(--fail-ink); }
.stat.lilac { background: var(--lilac); } .stat.lilac .stat-icon { color: var(--manual-ink); }
.stat.cream { background: var(--cream); } .stat.cream .stat-icon { color: var(--warn-ink); }
.home-aside .panel { margin: 0; padding: 18px; }
.home-aside .panel p { margin: 2px 0 0; }
.progress { text-align: center; }
.donut { --p: 0; width: 120px; height: 120px; margin: 16px auto 4px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--primary-soft) 0); }
.donut span { width: 94px; height: 94px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: 1.2rem; }
.bars { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; font-size: .8rem; }
.bar-label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.bar { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--fail); }
.bars b { text-align: right; font-weight: 600; }

/* Matrix */
.matrix { --cols: minmax(0, 1fr) repeat(9, 28px) 58px 106px; }
.mrow { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 4px; min-height: 48px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.mbody .mrow:hover { background: var(--surface-2); }
.mhead { min-height: 38px; color: var(--muted); font-size: .78rem; font-weight: 500; border-bottom-color: var(--line-strong); position: sticky; top: var(--topbar); background: var(--surface); z-index: 2; }
.mhead .ti { font-size: 17px; }
.mcell-site { min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.domain { font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
a.domain:hover { color: var(--primary); }
span.domain { color: var(--muted); }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: .68rem; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.accent { background: var(--manual-bg); color: var(--manual-ink); border-color: transparent; }
.mcell-sq { display: grid; place-items: center; text-decoration: none; }
.sq { display: inline-block; width: 18px; height: 18px; border-radius: 5px; background: var(--none); }
.sq.pass { background: var(--pass); } .sq.warn { background: var(--warn); } .sq.fail { background: var(--fail); } .sq.info { background: var(--info); }
a.mcell-sq:hover .sq { transform: scale(1.18); }
.mcell-score { text-align: right; padding-right: 6px; font-variant-numeric: tabular-nums; }
.score { font-weight: 600; }
.s-good { color: var(--pass-ink); } .s-ok { color: var(--warn-ink); } .s-bad { color: var(--fail-ink); }
.mcell-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: .35; }
.mrow:hover .mcell-actions, .mcell-actions:focus-within { opacity: 1; }
.mgroup { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 8px; border-bottom: 1px solid var(--line); }
.mgroup-toggle { display: flex; align-items: center; gap: 8px; background: transparent; color: var(--text); padding: 0; font-weight: 600; }
.mgroup-toggle:hover { background: transparent; color: var(--primary); }
.mgroup-toggle .ti { font-size: 16px; color: var(--muted); transition: transform .15s; }
.mgroup-toggle[aria-expanded=false] .ti { transform: rotate(-90deg); }
.mgroup-toggle .muted { font-weight: 400; }
.mbody[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; align-items: center; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sq { width: 12px; height: 12px; border-radius: 3px; }
.legend-icons { display: flex; flex-wrap: wrap; gap: 4px 12px; flex-basis: 100%; }
.legend-icons span { display: inline-flex; align-items: center; gap: 4px; }

/* Scanning overlay */
.scanning-overlay, .scanning { display: flex; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 18px; background: var(--primary-soft); border-radius: var(--radius); }
.scanning-overlay[hidden], .scanning[hidden] { display: none; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Report page */
.crumbs { margin: 0 0 14px; } .crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--primary); }
.summary { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.summary h1 { margin: 0 0 2px; word-break: break-word; }
.summary p { margin: 0 0 8px; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.ring { --c: var(--pass); width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--none) 0); }
.ring.s-ok { --c: var(--warn); } .ring.s-bad { --c: var(--fail); }
.ring span { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: 1.15rem; color: var(--text); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions form, .actions button { width: 100%; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.pill.pass { background: var(--pass-bg); color: var(--pass-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.fail { background: var(--fail-bg); color: var(--fail-ink); }
.pill.manual { background: var(--manual-bg); color: var(--manual-ink); }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.jump a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .8rem; }
.jump a:hover { border-color: var(--primary); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--none); flex: none; }
.dot.pass { background: var(--pass); } .dot.warn { background: var(--warn); } .dot.fail { background: var(--fail); } .dot.info { background: var(--info); } .dot.manual { background: var(--manual-ink); }
.filters { display: flex; gap: 6px; margin-bottom: 16px; }
.chip { background: var(--surface); color: var(--muted); border: 1px solid var(--line); padding: 5px 14px; font-size: .8rem; border-radius: 999px; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
body.issues-only .check.pass, body.issues-only .check.info { display: none; }
body.issues-only .section.clean { display: none; }
.section h2 { margin-bottom: 10px; }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; margin-top: 1px; }
.check.pass .icon { background: var(--pass-bg); color: var(--pass-ink); }
.check.warn .icon { background: var(--warn-bg); color: var(--warn-ink); }
.check.fail .icon { background: var(--fail-bg); color: var(--fail-ink); }
.check.info .icon { background: var(--info-bg); color: var(--info-ink); }
.check.manual .icon { background: var(--manual-bg); color: var(--manual-ink); }
.label { font-weight: 500; }
.detail { color: var(--muted); font-size: .84rem; margin-top: 2px; overflow-wrap: anywhere; }
.manual-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.manual-list li:first-child { border-top: 0; }
.manual-list label { font-weight: 400; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.manual-list input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.notes-label { margin: 14px 0 12px; }
.notes { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.saved { color: var(--pass-ink); font-weight: 500; margin-left: 8px; }
.plugins { columns: 2; padding-left: 18px; margin: 0; }
.history { width: 100%; border-collapse: collapse; }
.history td { padding: 8px; border-bottom: 1px solid var(--line); }
.history tr.current td { font-weight: 600; }
.foot { text-align: center; margin-top: 20px; }
.narrow { max-width: 420px; margin: 40px auto; }
.narrow button { margin-top: 12px; }

/* Responsive */
@media (max-width: 1240px) {
  .home-grid.with-aside { grid-template-columns: minmax(0, 1fr); }
  .home-aside { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); order: -1; }
  .home-aside > h2, .home-aside .panel { display: none; }
}
@media (max-width: 900px) {
  :root { --topbar: auto; }
  .topbar { position: static; height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .brand { width: auto; }
  .top-scan { flex-basis: 100%; }
  .search-pill { max-width: none; }
  .prelaunch summary span { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; gap: 6px; }
  .sidebar .nav { flex-direction: row; gap: 6px; }
  .nav-item, .nav-btn { padding: 8px 12px; white-space: nowrap; }
  .nav-label { overflow: visible; }
  .nav-label small { display: none; }
  .nav-group { display: none; }
  .nav-bottom { margin: 0; padding: 0; border: 0; }
  .main { padding: 20px 16px 48px; }
  .mhead { top: 0; }
  .home-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .matrix { --cols: minmax(0, 1fr) repeat(9, 17px) 44px; }
  .sq { width: 13px; height: 13px; border-radius: 3px; }
  .mhead .ti { font-size: 13px; }
  .mcell-actions { display: none; }
  .mrow { padding: 0 2px; column-gap: 3px; }
  .domain { font-size: .85rem; }
  .stat { padding: 12px; gap: 10px; } .stat b { font-size: 1.2rem; } .stat-icon { width: 32px; height: 32px; }
  .greeting { font-size: 1.35rem; }
  .summary { grid-template-columns: auto 1fr; gap: 14px; }
  .summary h1 { font-size: 1.15rem; }
  .ring { width: 64px; height: 64px; } .ring span { width: 50px; height: 50px; font-size: .95rem; }
  .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .actions form, .actions button { width: auto; flex: 1; }
  .plugins { columns: 1; }
  .panel, .card { padding: 16px; }
}
@media print {
  .topbar, .sidebar, .actions, .jump, .filters, .crumbs, form button { display: none !important; }
  .shell { display: block; } body { background: #fff; } .panel, .card { border: 0; box-shadow: none; padding: 8px 0; break-inside: avoid; }
}

/* ---------- Cream brand overrides ---------- */
button, .btn-primary { font-weight: 500; letter-spacing: .01em; }
.brand { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.logo { width: 40px; height: 40px; border-radius: 0; background: var(--primary); color: #262626; font-size: 22px; }
.brand-dot { color: var(--primary); }
.search-pill, .filter-pill, .search-pill .btn-primary { border-radius: var(--radius); }
.search-pill { padding-left: 14px; }
.prelaunch summary { border-radius: var(--radius); }
.prelaunch-pop { box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }

/* Charcoal sidebar like the cream.ie hero */
.sidebar { background: var(--side-bg); border-right: 0; }
.nav-item, .nav-btn { color: var(--side-text); font-weight: 400; font-size: 1rem; border-radius: var(--radius); }
.nav-item:hover, .nav-btn:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #262626; font-weight: 500; }
.count { background: var(--side-hover); color: #d8d8d5; font-weight: 500; }
.count.bad { background: #ff5c4d; color: #fff; }
.count.accent { background: #fff; color: #262626; }
.nav-item.active .count { background: rgba(38, 38, 38, .14); color: #262626; }
.nav-group summary { color: #7d7d7a; font-weight: 500; }
.nav-bottom { border-top-color: var(--side-line); }
.nav-label small { color: #7d7d7a; }

/* Panels: flat, crisp */
.panel, .card { border-radius: var(--radius); }
.greeting { font-size: 2.4rem; line-height: 1.05; }
.greeting span { display: inline-block; margin-top: 6px; font-weight: 300; font-size: 1.25rem; color: var(--muted); }
.domain { font-weight: 400; }
.mgroup-toggle { font-weight: 600; font-size: 1.02rem; }
.mhead { font-weight: 500; }
.sq { border-radius: 2px; }
.score { font-weight: 500; }
.tag { border-radius: 2px; font-weight: 400; font-size: .75rem; }
.tag.accent { background: var(--primary); color: #262626; }
.icon-btn { border-radius: var(--radius); }

/* Stat cards: one green hero card, the rest white */
.stat { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.stat small { font-size: .9rem; }
.stat b { font-size: 2rem; font-weight: 600; line-height: 1; margin-top: 2px; }
.stat-icon { border-radius: 0; background: var(--surface-2); color: var(--text); }
.stat.mint { background: var(--primary); border-color: var(--primary); color: #262626; }
.stat.mint small { color: rgba(38, 38, 38, .7); }
.stat.mint .stat-icon { background: rgba(255, 255, 255, .45); color: #262626; }
.stat.rose, .stat.lilac, .stat.cream { background: var(--surface); }
.stat.rose b { color: var(--fail-ink); }
.stat.rose .stat-icon { color: var(--fail-ink); }
.stat.lilac .stat-icon, .stat.cream .stat-icon { color: var(--text); }
.donut { background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--none) 0); }
.donut span { font-size: 1.6rem; }
.bar { border-radius: 0; } .bar i { border-radius: 0; }

/* Report page */
.pill { border-radius: 2px; font-weight: 400; }
.pill.manual { background: var(--manual-bg); color: var(--text); }
.jump a, .chip { border-radius: var(--radius); }
.chip.active { color: #262626; }
.icon { border-radius: 2px; }
.dot.manual { background: var(--text); }
.ring span { font-size: 1.4rem; }
.scanning-overlay, .scanning { background: var(--primary-soft); }

@media (max-width: 900px) {
  .sidebar { background: var(--side-bg); }
}
@media (max-width: 640px) {
  .greeting { font-size: 1.8rem; }
  .stat b { font-size: 1.5rem; }
}

/* ---------- Notifications bell ---------- */
.notif { position: relative; flex: none; }
.notif summary { list-style: none; cursor: pointer; position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); font-size: 22px; color: var(--text); }
.notif summary::-webkit-details-marker { display: none; }
.notif summary:hover, .notif[open] summary { background: var(--surface-2); }
.notif-badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #262626; font-size: .7rem; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.notif-badge.urgent { background: var(--fail); color: #fff; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .16); z-index: 40; padding: 6px 0; }
.notif-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.notif-group { padding: 10px 16px 4px; font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.notif-item { display: flex; gap: 12px; padding: 9px 16px; text-decoration: none; align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .ti { font-size: 20px; margin-top: 2px; flex: none; }
.notif-item.fail .ti { color: var(--fail-ink); }
.notif-item.warn .ti { color: var(--warn-ink); }
.notif-item strong { display: block; font-weight: 500; }
.notif-item small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.3; }
.notif-empty { padding: 18px 16px; margin: 0; display: flex; gap: 8px; align-items: center; }
.notif-empty .ti { color: var(--pass-ink); font-size: 20px; }
.tag.bad { background: var(--fail-bg); color: var(--fail-ink); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.plugin-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.plugin-table th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
.plugin-table td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .notif { margin-left: auto; order: 1; }
  .brand { order: 0; }
  .top-scan { order: 2; }
  .notif-pop { width: min(360px, calc(100vw - 32px)); }
}

/* ---------- Login, account and users ---------- */
.no-shell .wrap { max-width: 1100px; }
.auth-card { max-width: 400px; margin: 8vh auto 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > p { margin: 0 0 20px; }
.auth-card .tiny { margin: 18px 0 0; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack label { font-weight: 400; font-size: .95rem; }
.form-stack h3 { margin-top: 10px; }
.form-stack p { margin: -6px 0 0; }
.form-stack .flash { margin: 0; }
.form-stack .btn-primary { align-self: flex-start; padding: 11px 26px; }
input[type=email] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
input[type=email]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.narrow-panel { max-width: 520px; }
.narrow-panel h2 { margin-bottom: 6px; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line-strong); }
.user-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.row-actions { text-align: right; white-space: nowrap; }
.link-like { background: none; border: 0; padding: 4px 6px; color: var(--muted); font-weight: 400; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; list-style: none; display: inline; }
.link-like::-webkit-details-marker { display: none; }
.link-like:hover { background: none; color: var(--text); }
.link-like.danger:hover { color: var(--fail-ink); }
.inline-pop { display: inline-block; position: relative; }
.pop-form { position: absolute; right: 0; top: calc(100% + 6px); display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); z-index: 10; width: 300px; }
.pop-form .btn-primary { padding: 8px 14px; }
.me { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--side-line); }
.me-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius); text-decoration: none; color: #e9e9e6; }
.me-link:hover, .me-link.active { background: var(--side-hover); }
.me-link small { color: #7d7d7a; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--primary); color: #262626; font-weight: 600; }
.me-out { color: var(--side-text); }
.me-out:hover { background: var(--side-hover); color: #fff; }
@media (max-width: 900px) {
  .me { margin: 0; padding: 0; border: 0; }
  .me-link .nav-label small { display: none; }
}
@media (max-width: 640px) {
  .user-table th:nth-child(3), .user-table td:nth-child(3) { display: none; }
  .auth-card { padding: 22px; margin-top: 4vh; }
}

/* Domain expiry tag: green → yellow → amber → red as the date approaches */
.tag.exp-ok, .tag.exp-soon, .tag.exp-near, .tag.exp-expired { display: inline-flex; align-items: center; gap: 4px; border-color: transparent; font-variant-numeric: tabular-nums; }
.tag .ti { font-size: 12px; }
.tag.exp-ok { background: var(--pass-bg); color: var(--pass-ink); }
.tag.exp-soon { background: #fff8d6; color: #7a6200; }
.tag.exp-near { background: #ffe7cc; color: #b35400; font-weight: 500; }
.tag.exp-expired { background: var(--fail); color: #fff; font-weight: 500; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tag.exp-soon { background: #3a3414; color: #f5de6b; }
  :root:not([data-theme="light"]) .tag.exp-near { background: #43290f; color: #ffb066; }
}
:root[data-theme="dark"] .tag.exp-soon { background: #3a3414; color: #f5de6b; }
:root[data-theme="dark"] .tag.exp-near { background: #43290f; color: #ffb066; }

/* ---------- Security pages ---------- */
.setup-steps { padding-left: 20px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.setup-steps code, .auth-card code { word-break: break-all; }
.code-input { font-size: 1.4rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; max-width: 240px; }
.status-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.pill:not(.pass):not(.warn):not(.fail):not(.manual) { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.btn-link { display: inline-block; background: var(--primary); color: #262626; text-decoration: none; padding: 9px 18px; border-radius: var(--radius); font-weight: 500; }
.btn-link:hover { background: var(--primary-hover); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-btn:hover { border-color: var(--fail); color: var(--fail-ink); }
.qr { width: 200px; height: 200px; margin: 8px 0 12px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-size: .95rem; letter-spacing: .08em; }
.recovery { border-color: var(--primary); }
.codes { columns: 2; padding-left: 22px; margin: 10px 0 16px; }
.codes li { margin: 4px 0; }
.codes code { font-size: 1rem; }
select { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; }
.form-stack select { width: 100%; padding: 10px 12px; margin-top: 4px; }
.me form.inline { display: inline-flex; }
.code-input { display: block; }

/* ---------- One-click fixes ---------- */
.check.has-fix { grid-template-columns: 28px 1fr auto; align-items: start; }
.fix-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; font-size: .85rem; font-weight: 500; padding: 6px 12px; border-radius: var(--radius); background: var(--primary); color: #262626; }
.fix-btn:hover { background: var(--primary-hover); }
.fix-panel h2 { margin-bottom: 8px; }
.fix-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.fix-list li { display: flex; gap: 8px; align-items: flex-start; }
.fix-list .ti { margin-top: 3px; color: var(--pass-ink); }
.fix-notes { background: var(--warn-bg); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.fix-notes p { margin: 4px 0; display: flex; gap: 8px; color: var(--text); }
.fix-notes .ti { color: var(--warn-ink); margin-top: 3px; }
.btn-plain { padding: 10px 14px; color: var(--muted); text-decoration: none; }
.btn-plain:hover { color: var(--text); }
.fix-steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.fix-steps li { display: flex; gap: 10px; align-items: center; color: var(--faint); }
.fix-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.fix-steps li.is-active { color: var(--text); font-weight: 500; }
.fix-steps li.is-active .fix-dot { border-color: var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.fix-steps li.is-done { color: var(--text); }
.fix-steps li.is-done .fix-dot { background: var(--primary); border-color: var(--primary); }
.fix-steps li.is-failed .fix-dot { background: var(--fail); border-color: var(--fail); }
.fix-message { margin: 0 0 12px; }
[data-state="failed"] .fix-message { color: var(--fail-ink); }
@media (max-width: 640px) {
  .check.has-fix { grid-template-columns: 28px 1fr; }
  .check.has-fix .fix-btn { grid-column: 2; justify-self: start; }
}

/* ---------- SSH access + fix output ---------- */
.ssh-panel { margin-bottom: 16px; }
.ssh-panel h2 { display: flex; align-items: center; gap: 10px; }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #262626; font-size: .8rem; font-weight: 600; }
.keybox, .fix-output pre { background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: .78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }
.key-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.key-list label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.key-list input { margin-top: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.fix-output { margin: 0 0 14px; }
.fix-output summary { cursor: pointer; font-size: .9rem; margin-bottom: 8px; }

/* Brand: wordmark only */
.logo { display: none; }
.brand-name { font-size: 2.15rem; }

/* ---------- Fix form fields + cookie template ---------- */
.fix-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 4px; margin: 0 0 14px; display: grid; gap: 10px; }
.fix-fields legend { font-weight: 600; padding: 0 6px; }
.fix-fields label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.tpl-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tpl-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 12px 6px 0; width: 40%; vertical-align: top; }
.tpl-table td { padding: 6px 0; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 6px; }

/* Roll back */
.btn-danger { background: var(--fail-ink); color: #fff; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger-link { color: var(--fail-ink); font-size: .875rem; white-space: nowrap; text-decoration: none; }
.btn-danger-link:hover { text-decoration: underline; }
.history-action { text-align: right; }
.rollback-form .check-row { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fail-bg); }
.rollback-form .check-row input { margin-top: 3px; flex: none; }
.rollback-form .confirm-label { display: block; margin: 16px 0 12px; }
.rollback-form .confirm-label input { display: block; width: 100%; margin-top: 6px; }

/* Alerts */
.alert-day { font-size: .95rem; margin: 18px 0 8px; }
.alert-day:first-child { margin-top: 0; }
.alert-list { list-style: none; margin: 0 0 12px; padding: 0; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-item .ti { flex: none; font-size: 1.1rem; margin-top: 2px; }
.alert-item.fail .ti { color: var(--fail-ink); } .alert-item.warn .ti { color: var(--warn-ink); }
.alert-item.pass .ti { color: var(--pass-ink); } .alert-item.info .ti { color: var(--info-ink); }
.alert-item a { color: inherit; }

/* Bulk updates */
.bulk-server { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bulk-sites { list-style: none; margin: 0; padding: 0; columns: 2 280px; }
.bulk-sites li { break-inside: avoid; }
.bulk-sites .check-row { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.bulk-sites .pill { margin-left: 4px; }
.bulk-table td:first-child { white-space: nowrap; }

/* Before/after look of an update */
.look { margin: 14px 0; }
.flash.warn-flash { background: var(--warn-bg); color: var(--warn-ink); }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.shots figure { margin: 0; }
.shots figcaption { font-size: .8rem; color: var(--muted, inherit); margin-bottom: 4px; }
.shots img { width: 100%; height: 360px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }

/* Activity */
.activity-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.activity-filters select { max-width: 100%; }
.activity-item .ti { color: var(--muted, inherit); }
.activity-item .pill { margin-left: 4px; }

/* Monthly client report */
.monthly-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.monthly { max-width: 760px; }
.monthly-head h1 { margin: 2px 0; }
.monthly-month { font-size: 1.15rem; margin: 0 0 18px; }
.monthly-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.monthly-tiles .tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-num { font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.tile-label { font-size: .82rem; color: var(--muted, inherit); }
.monthly-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.monthly-section h2 { font-size: 1.05rem; margin: 0 0 10px; }
.monthly-work { margin: 0; padding-left: 0; list-style: none; }
.monthly-work > li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.monthly-work > li:last-child { border-bottom: 0; }
.monthly-work ul { margin: 4px 0 0 18px; padding: 0; font-size: .9rem; }
@media print { .no-print { display: none !important; } .monthly-section, .monthly-tiles .tile { break-inside: avoid; } }

/* Bulk updates, per server */
.head-tools { display: flex; align-items: center; gap: 8px; }
.bulk-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.bulk-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: inherit; font-size: .9rem; }
.bulk-tabs a.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.bulk-server-list { list-style: none; margin: 8px 0 0; padding: 0; columns: 2 220px; }
.bulk-server-list li { padding: 4px 0; break-inside: avoid; }
.bulk-server-list a { display: inline-flex; gap: 6px; align-items: center; }
.head-tools a.btn-primary { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* Lock a site against bulk updates */
.mcell-actions .lock-on { color: var(--warn-ink); }
.mrow:has(.lock-on) .mcell-actions { opacity: 1; }
.mrow:has(.lock-on) .mcell-actions .icon-btn:not(.lock-on) { opacity: .35; }
.mrow:hover .mcell-actions .icon-btn { opacity: 1; }

/* Up to four row icons (check, hide, delete, lock) in the same space as three. */
.mcell-actions .icon-btn { padding: 4px; }
