/* WP SEO App - main stylesheet */
:root {
  --ink: #1e2430; --muted: #64748b; --line: #e3e8ef; --bg: #f5f7fa; --card: #fff;
  --brand: #2557d6; --brand-dark: #1b44ad; --brand-soft: #e8efff;
  --ok: #157f3b; --ok-soft: #e6f6ec; --err: #b42318; --err-soft: #fdecea;
  --warn: #a15c07; --warn-soft: #fff4e0; --info: #1e5aa8; --info-soft: #e8f1fc;
  --radius: 12px; --shadow: 0 1px 2px rgba(30,36,48,.06), 0 8px 24px rgba(37,87,214,.06);
  --sidebar: 240px; --topbar: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand); }
h1, h2 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
code { background: #eef2f7; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; margin: 0; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem; background: var(--ink); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 650; font-size: 1.05rem; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #4f7cff, #2557d6); color: #fff; font-weight: 800; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; color: #e5e9f0; text-decoration: none; }
.user-chip:hover .user-name { text-decoration: underline; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #3b4458; font-weight: 700; color: #fff; }
.nav-toggle, .nav-burger { display: none; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - var(--topbar)); }
.sidebar { position: sticky; top: var(--topbar); align-self: flex-start; width: var(--sidebar); flex: 0 0 var(--sidebar);
  height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 1rem .75rem; background: #fff; border-right: 1px solid var(--line); }
.nav-heading { margin: 1.1rem .75rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav-link:hover { background: var(--bg); }
.nav-link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.nav-icon { width: 1.3rem; text-align: center; }
/* Stage 1.5c: expandable site menu */
.nav-group, .nav-site { margin: 0; }
.nav-summary { list-style: none; cursor: pointer; user-select: none; }
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary:focus-visible, .nav-sublink:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.nav-chevron { margin-left: auto; width: .5rem; height: .5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .2s ease; flex: 0 0 auto; }
details[open] > .nav-summary > .nav-chevron { transform: rotate(45deg); }
.nav-children { margin: .15rem 0 .35rem 1.15rem; padding-left: .55rem; border-left: 1px solid var(--line); }
.nav-sublink { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; border-radius: 7px; color: var(--ink);
  text-decoration: none; font-size: .9rem; min-height: 2rem; }
.nav-sublink:hover { background: var(--bg); }
.nav-sublink.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.nav-sublink.current { font-weight: 650; }
.nav-site-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.nav-site-pages { margin-left: .6rem; }
.nav-sublink.muted-link { color: var(--muted); }
.badge-soon { margin-left: auto; font-size: .68rem; padding: .05rem .45rem; border-radius: 99px; background: #eef2f7; color: var(--muted); }
.content { flex: 1; min-width: 0; padding: 2rem 2.25rem; max-width: 1200px; }
.footer { margin-top: 3rem; color: var(--muted); font-size: .8rem; }
.page-head { margin-bottom: 1.5rem; }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.grid { display: grid; gap: 1.25rem; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .2rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
.stat-note { font-size: .75rem; color: var(--muted); }
.checklist, .module-list { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child, .module-list li:last-child a { border-bottom: 0; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); font-size: .75rem; color: #fff; flex: none; }
.checklist .done .tick { background: var(--ok); border-color: var(--ok); }
.module-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.module-list a:hover { color: var(--brand); }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.details { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: .8rem; font-weight: 600; }

/* Forms and buttons */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.field input, .field select, .field textarea { width: 100%; padding: .7rem .85rem; border: 1px solid #cdd5df; border-radius: 8px; font: inherit; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.has-error input { border-color: var(--err); }
.field-error { color: var(--err); font-size: .85rem; margin: .3rem 0 0; }
.check { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 1.25rem; font-size: .92rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.25rem; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .9; }
.topbar .btn-ghost { color: #fff; border-color: #4b5568; }
.topbar .btn-ghost:hover { background: #2c3446; }
.btn-sm { padding: .4rem .85rem; font-size: .88rem; }
.btn-block { width: 100%; }

/* Sites (Stage 0.3) */
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; margin-bottom: 1rem; }
.narrow { max-width: 640px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.table td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.actions-col { text-align: right; }
.actions-col .btn { color: var(--ink); border-color: var(--line); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.pill-warn { background: var(--warn-soft); color: var(--warn); margin-left: .35rem; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.actions-col .btn-danger-text { color: var(--err); }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
.field-hint { margin: -.6rem 0 1rem; font-size: .82rem; color: var(--muted); }
.tips { margin: 0; padding-left: 1.1rem; display: grid; gap: .5rem; font-size: .92rem; }
.stat-link { color: inherit; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.stat-link:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.stat-link .stat-note { color: var(--brand); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Flash messages */
.flashes { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.flash { padding: .75rem 1rem; border-radius: 8px; border-left: 4px solid; font-size: .95rem; }
.flash-success { background: var(--ok-soft); border-color: var(--ok); color: #0e5a29; }
.flash-error { background: var(--err-soft); border-color: var(--err); color: #8a1c13; }
.flash-info { background: var(--info-soft); border-color: var(--info); color: #174a8c; }
.flash-warning { background: var(--warn-soft); border-color: var(--warn); color: #7a4505; }

/* Login page */
body.auth { background: linear-gradient(135deg, #1e2430 0%, #22305a 55%, #2557d6 100%); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 3rem; max-width: 1080px; margin: 0 auto; padding: 2rem; }
.auth-wrap.single { grid-template-columns: minmax(0, 480px); justify-content: center; }
.auth-intro { color: #e5e9f0; }
.auth-intro h1 { font-size: 2.4rem; margin: 2rem 0 1rem; color: #fff; letter-spacing: -.02em; }
.auth-intro p { font-size: 1.1rem; color: #c3cbe0; max-width: 32rem; }
.brand-lg { font-size: 1.3rem; }
.auth-card { background: #fff; border-radius: 16px; padding: 2.25rem; box-shadow: 0 30px 60px rgba(10, 20, 50, .35); }
.auth-card h2 { font-size: 1.5rem; }

/* Responsive */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .nav-burger { display: block; font-size: 1.5rem; cursor: pointer; padding: 0 .25rem; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); z-index: 25; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
  .nav-toggle:checked ~ .layout .sidebar { transform: none; }
  .nav-toggle:checked ~ .layout .nav-backdrop { display: block; }
  .nav-backdrop { display: none; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(15,20,30,.35); z-index: 20; }
  .content { padding: 1.25rem; }
  .user-name { display: none; }
  .auth-wrap { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.25rem; align-content: center; }
  .auth-intro h1 { font-size: 1.6rem; margin: 1rem 0 .5rem; }
  .auth-intro p { display: none; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .auth-card { padding: 1.5rem; }
}

/* WordPress login (Stage 0.4) */
.cred-box { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem .25rem; margin: 1.25rem 0 0; }
.cred-box legend { font-weight: 700; padding: 0 .35rem; }
.cred-box .flash { margin-bottom: 1rem; }
.cred-state { font-size: .9rem; margin: 0 0 1rem; }
.cred-state.ok { color: #0e5a29; }
.pill-ok { background: var(--ok-soft); color: #0e5a29; }
.pill-muted { background: #eef1f5; color: var(--muted); }
.mt { margin-top: 1.5rem; }

/* Stage 0.5: connection test */
.pill-err { background: var(--err-soft); color: #8a1c13; }
.inline-form { display: inline; margin: 0; }
.conn-result { border-left: 4px solid var(--line); padding: .6rem .9rem; border-radius: 6px; margin: .5rem 0 1rem; }
.conn-result p { margin: .2rem 0; }
.conn-result.ok { border-color: var(--ok); background: var(--ok-soft); }
.conn-result.bad { border-color: var(--err); background: var(--err-soft); }
.conn-result.warn { border-color: var(--warn); background: var(--warn-soft); }

/* Stage 1.1: sitemap URLs page */
.summary-pad { padding: 14px 18px; cursor: pointer; }
p.summary-pad { cursor: auto; margin: 0; }
.break { word-break: break-all; }
.num { text-align: right; width: 1%; white-space: nowrap; }
.url-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid #d1d5db; font-size: .85rem; color: inherit; text-decoration: none; }
.chip span { color: #6b7280; margin-left: 2px; }
.chip:hover { border-color: #9ca3af; }
.chip.active { background: #1f2937; border-color: #1f2937; color: #fff; }
.chip.active span { color: #d1d5db; }
.url-search { display: flex; gap: 6px; align-items: center; }
.url-search input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px; min-width: 220px; font: inherit; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.conn-result ul { margin: 6px 0 0; padding-left: 20px; }

/* Stage 1.2: page crawler */
.conn-result.running { border-color: var(--info); background: var(--info-soft); }
.progress { height: 8px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; margin: .5rem 0; max-width: 480px; }
.progress span { display: block; height: 100%; background: var(--info); transition: width .4s ease; }
.slow { color: #b45309; font-weight: 600; }
.redirect { color: var(--muted); font-size: .85rem; }
.htag { display: inline-block; font-size: .7rem; font-weight: 700; background: #eef1f5; color: var(--muted); border-radius: 4px; padding: 0 4px; margin-right: 4px; vertical-align: 1px; }
.crawl-table td { vertical-align: top; }
.crawl-page { min-width: 240px; max-width: 360px; }
.crawl-table ul { margin: 0; padding-left: 0; list-style: none; }
.crawl-table details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }

/* Stage 1.2a: Sites page as cards (no sideways scrolling) with a homepage picture */
.site-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 1rem; }
.site-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; min-width: 0; }
.site-card-head { display: flex; gap: .9rem; align-items: flex-start; min-width: 0; }
.site-thumb { position: relative; flex: none; width: 96px; height: 60px; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, #4f7cff, #2557d6); border: 1px solid var(--line); }
.site-initials { color: #fff; font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; }
.site-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.site-thumb img.is-icon { object-fit: contain; padding: 6px; }
.site-id { min-width: 0; flex: 1; }
.site-name { font-size: 1.05rem; margin: 0 0 .15rem; overflow-wrap: anywhere; }
.site-url { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-size: .92rem; }
.site-url:hover { text-decoration: underline; }
.site-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem .9rem; margin: 0; padding: .85rem 0 0; border-top: 1px solid var(--line); font-size: .92rem; }
.site-facts dt { color: var(--muted); }
.site-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; min-width: 0; overflow-wrap: anywhere; }
.site-facts dd a { text-decoration: none; font-weight: 600; }
.site-facts dd a:hover { text-decoration: underline; }
.site-facts .pill-warn { margin-left: 0; }
.site-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.site-actions-main { margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--line); }
.site-actions-more { gap: .4rem; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: #d6e2ff; }
.btn-xs { padding: .25rem .65rem; font-size: .8rem; }
.site-actions-more .btn-ghost { color: var(--ink); border-color: var(--line); }
.site-actions-more .btn-ghost:hover { background: var(--bg); }
.site-actions-more .btn-danger-text { color: var(--err); }
.site-actions-more .btn-danger-text:hover { background: var(--err-soft); border-color: var(--err); }
.btn:disabled { opacity: .6; cursor: progress; }


/* Stage 1.3: issues report (lists, not tables, so nothing scrolls sideways) */
.issue-summary { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); margin: 0 0 1.25rem; }
.issue-stat { min-width: 0; }
.issue-stat .stat-label { color: var(--ink); font-weight: 600; }
.issue-stat .stat-note .pill { margin-left: 0; margin-right: .2rem; font-size: .72rem; }
.issue-stat.is-clear .stat-value { color: var(--ok); }
.issue-section { margin-bottom: 1rem; min-width: 0; scroll-margin-top: calc(var(--topbar) + 1rem); }
.issue-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.issue-head h2 { margin: 0; font-size: 1.15rem; }
.issue-head .pill-warn { margin-left: 0; }
.issue-why { background: var(--bg); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0 .4rem; }
.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-item { padding: .65rem 0; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.issue-item:last-child { border-bottom: 0; }
.issue-item .break { display: inline-block; max-width: 100%; }
.issue-text { overflow-wrap: anywhere; }
.issue-urls { margin: .25rem 0 0; padding-left: 1.1rem; }
.issue-more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; padding: .5rem 0; }
.site-facts .pill-err, .site-facts .pill-ok { margin-left: 0; }

/* Stage 1.3a: AI connection settings (existing colours only) */
.field textarea { resize: vertical; min-height: 5rem; }
.ai-reply { white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; margin: .5rem 0; background: #fff; }
.model-list { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .9rem; }

/* Stage 1.3f: ignore issues */
.ignore-box { display: inline-block; vertical-align: top; }
.ignore-box > summary { list-style: none; cursor: pointer; display: inline-block; }
.ignore-box > summary::-webkit-details-marker { display: none; }
.ignore-box[open] > summary { margin-bottom: .4rem; }
.ignore-box form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ignore-box input[type="text"] { min-width: 14rem; flex: 1 1 14rem; }
#ignored > details > summary { cursor: pointer; }
.inline-h2 { display: inline; font-size: 1.15rem; }


/* Stage 1.4b: image fixes */
.img-preview { position: fixed; z-index: 60; display: none; pointer-events: none; max-width: 240px; max-height: 240px;
  padding: .35rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.img-preview.is-shown { display: block; }
.img-preview img { display: block; max-width: 228px; max-height: 228px; width: auto; height: auto; }
.img-preview span { display: none; padding: .25rem .4rem; }
.img-preview.is-broken img { display: none; }
.img-preview.is-broken span { display: block; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 .75rem; }
.fix-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .2rem; }
.fix-advice { margin: .3rem 0; padding: .4rem .6rem; border-radius: 8px; background: var(--info-soft); }
.size-default input { width: 5.5rem; }
input.pick { vertical-align: middle; }
.alt-list { list-style: none; margin: 0; padding: 0; }
.alt-row { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 0; border-top: 1px solid var(--line); }
.alt-thumb { flex: 0 0 120px; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; text-decoration: none; }
.alt-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.alt-thumb .thumb-fallback { display: none; text-align: center; padding: .3rem; }
.alt-thumb.is-broken img { display: none; }
.alt-thumb.is-broken .thumb-fallback { display: block; }
.alt-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.alt-text { width: 100%; }
@media (max-width: 640px) { .alt-row { flex-direction: column; } }

/* Stage 1.5: links report */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.tabs .pill { margin-left: .25rem; }
.table.small td, .table.small th { padding: .55rem .75rem; vertical-align: top; }
.link-fix-form { display: grid; gap: .4rem; margin-top: .4rem; min-width: 16rem; }
.link-fix-form input[type=url] { width: 100%; }

/* Stage 1.5d: page cache notice */
.cache-tip p { margin: 0 0 .5rem; }
.cache-tip .btn { margin-top: .25rem; }
.public-note { margin: .75rem 0; }

/* Stage 1.6f: user access */
.user-role { margin-left: .4rem; font-size: .7rem; }
.owner-filter { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.owner-filter select, .site-move select { padding: .35rem .5rem; border: 1px solid #cdd5df; border-radius: 6px; font: inherit; background: #fff; }
.site-owner { margin: .1rem 0; }
.site-move { display: flex; align-items: center; gap: .4rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.invite-link { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.invite-link input { flex: 1 1 22rem; padding: .6rem .75rem; border: 1px solid #cdd5df; border-radius: 8px; font: inherit; font-size: .88rem; background: #f8fafc; }

/* Stage 1.7: per-site dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.dash-card { margin: 0; }
.dash-card h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.dash-wide { grid-column: span 2; }
#dash-security.dash-wide { grid-column: 1 / -1; }
.dash-empty { grid-column: 1 / -1; margin-bottom: 1rem; }
.dash-big { font-size: 2.2rem; font-weight: 750; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.dash-facts { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: .5rem 0; font-size: .9rem; }
.dash-facts dt { color: var(--muted); }
.dash-facts dd { margin: 0; }
.dash-list { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .35rem; }
.dash-sev { grid-template-columns: repeat(3, 1fr); margin-bottom: .75rem; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .5rem 0; }
.dash-table th, .dash-table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.dash-table th { color: var(--muted); font-weight: 600; }
.dash-links a { white-space: nowrap; }
.dash-security { list-style: none; padding: 0; margin: .75rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.dash-sec-row { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; display: grid; gap: .25rem; }
.dash-sec-row.is-missing { border-left: 3px solid #d9a400; }
.dash-sec-row.is-present { border-left: 3px solid #2e9d5b; }
.dash-sec-value { font-family: ui-monospace, monospace; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .dash-grid, .dash-security { grid-template-columns: 1fr; }
  .dash-wide { grid-column: auto; }
}

/* Stage 1.8: Schema page */
.schema-intro p { margin: 0 0 .5rem; }
.schema-intro p:last-child { margin-bottom: 0; }
.schema-stats { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.schema-stats li { font-size: .9rem; }
.schema-stats .stat-num { font-weight: 700; font-size: 1.25rem; margin-right: .25rem; }
.schema-stats .text-err { color: #b42318; }
.schema-types { columns: 2; padding-left: 1rem; }
.schema-table .pill { margin: 0 .15rem .2rem 0; }
@media (max-width: 700px) { .schema-types { columns: 1; } }

/* Stage 1.9: security headers and homepage redirects */
.sec-redirect { margin: 0 0 .75rem; }
.sec-chain { margin: .35rem 0 .35rem 1.25rem; padding: 0; display: grid; gap: .2rem; }
.sec-chain li { word-break: break-all; }
#dash-homepage { border-bottom: 1px solid var(--line); margin-bottom: .75rem; padding-bottom: .5rem; }
.security-table td { vertical-align: top; }

/* Stage 2.0: schema drafts */
.schema-draft .issue-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.schema-draft h2.h3 { font-size: 1.05rem; margin: 0; }
.code-box { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.45; box-sizing: border-box; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.btn-row form { margin: 0; }
.fill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem .9rem; margin: .4rem 0 .6rem; }
.fill-grid label { display: flex; flex-direction: column; gap: .2rem; }
#draft-new select { max-width: 100%; }
