/* SEO Audit — moeder.biz-Design (hell default, dunkel via html.dark).
   Tokens/Chrome exakt an der zentralen moeder-Linie (Arial, zinc, #fafafa). */
:root {
  --bg: #fafafa; --card: #ffffff; --card-2: #f4f4f5; --sidebar: #ffffff;
  --border: #e4e4e7; --text: #18181b; --muted: #71717a;
  --nav-fg: #71717a;                 /* Nav inaktiv = zinc-500 (light) */
  --accent: #3b82f6; --accent-weak: rgb(59 130 246 / 0.12);
  --good: #16a34a; --warn: #d97706; --err: #dc2626;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .07), 0 2px 4px -2px rgb(0 0 0 / .05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --grid: rgba(0,0,0,.06);
  --radius: 6px; --radius-sm: 5px; --side-w: 256px; --top-h: 56px;
}
html.dark {
  --bg: #0a0a0a; --card: #18181b; --card-2: #27272a; --sidebar: #18181b;
  --border: #27272a; --text: #ededed; --muted: #a1a1aa;
  --nav-fg: #a1a1aa;                 /* zinc-400 (dark) */
  --accent: #3b82f6; --accent-weak: rgb(59 130 246 / 0.22);  /* identisch zu SEO (#3b82f6 in Light UND Dark) */
  --good: #22c55e; --warn: #f59e0b; --err: #f87171;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / .4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .45), 0 2px 4px -2px rgb(0 0 0 / .4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .55), 0 4px 6px -4px rgb(0 0 0 / .45);
  --grid: rgba(255,255,255,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
a { color: var(--accent); }

/* ---------- Layout: Sidebar + Content ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: none; background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.sidebar-head { height: var(--top-h); flex: none; border-bottom: 1px solid var(--border); position: relative; }
.sidebar-main { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column;
  gap: 4px; padding: 16px 12px; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.nav-section { padding: 0 12px; font-size: 11px; line-height: 1.5; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: #a1a1aa; }
.nav { display: flex; align-items: center; gap: 12px; background: none; border: none;
  color: var(--nav-fg); padding: 8px 12px; border-radius: .28rem; cursor: pointer;
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500; text-align: left; transition: .12s; }
.nav:hover { background: var(--card-2); color: var(--text); }
/* Aktives Item zentral: Marken-Accent @ 20 % + rounded-md (in allen moeder-Apps gleich). */
.nav.active { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.nav .ic { width: 16px; height: 16px; display: inline-flex; flex: none; }
.nav .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-head { height: var(--top-h); flex: none; border-bottom: 1px solid var(--border);
  background: var(--card); display: flex; align-items: center; justify-content: flex-end;
  padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.main { flex: 1; padding: 24px; }

.page-head { margin-bottom: 20px; }
.page-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Card ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); }

/* ---------- App-Switcher (moeder) ---------- */
.brand { position: relative; height: 100%; }
.switcher-btn { display: flex; align-items: center; gap: 12px; width: 100%; height: 100%;
  padding: 0 12px; background: none; border: none; cursor: pointer; text-align: left;
  color: var(--text); font-family: inherit; transition: background .12s; }
.switcher-btn:hover { background: var(--card-2); }
.switcher-btn .brand-name { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700; letter-spacing: -.025em; }
.moeder-logo { width: 16px; height: 16px; flex: none; display: block; }
.moeder-logo.lg { width: 28px; height: 28px; }
.switcher-chev { width: 16px; height: 16px; flex: none; color: #a1a1aa;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.switcher-menu { position: absolute; left: 8px; right: 8px; top: calc(100% + 4px); z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: .28rem; padding: 4px; box-shadow: var(--shadow-lg); }
.switcher-head { padding: 6px 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: #a1a1aa; }
.switcher-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: .2rem;
  font-size: 14px; line-height: 20px; color: var(--text); text-decoration: none; transition: background .12s; }
.switcher-row:hover { background: var(--card-2); }
.switcher-row.current { background: var(--card-2); font-weight: 500; }
.switcher-row.disabled { opacity: .5; cursor: not-allowed; }
.switcher-row > span:not(.switcher-note) { flex: 1 1 auto; min-width: 0; }
.switcher-note { background: var(--card-2); color: var(--muted); font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: .2rem; }
.switcher-check { width: 16px; height: 16px; flex: none; color: var(--muted);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.switcher-dark { color: #f1f5f9; } .switcher-dark:hover { filter: brightness(1.25); }

/* ---------- User-Menü (moeder) ---------- */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  background: none; border: none; border-radius: var(--radius); cursor: pointer; color: var(--text);
  font-family: inherit; transition: background .12s; }
.user-btn:hover { background: var(--card-2); }
.user-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-name { font-size: 14px; font-weight: 500; }
.user-chev { width: 16px; height: 16px; flex: none; color: #a1a1aa;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 224px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 4px; box-shadow: var(--shadow-lg); }
.user-head { padding: 8px 12px; border-bottom: 1px solid var(--card-2); }
.user-head-name { font-size: 14px; font-weight: 500; color: var(--text); }
.user-head-email { font-size: 12px; color: var(--muted); word-break: break-all; }
.user-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  background: none; border: none; border-radius: 6px; font-size: 14px; color: var(--text);
  cursor: pointer; text-align: left; font-family: inherit; text-decoration: none; transition: background .12s; }
.user-item:hover { background: var(--card-2); }
.user-item svg, .user-logout svg { width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-logout { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  background: none; border: none; border-radius: 6px; font-size: 14px; color: #e11d48;
  cursor: pointer; text-align: left; font-family: inherit; transition: background .12s; }
.user-logout:hover { background: rgba(225,29,72,.10); }

/* ---------- Theme-Toggle (Footer) ---------- */
.settings-row { display: flex; align-items: center; justify-content: flex-end; }
.theme-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center;
  padding: 8px; border-radius: var(--radius); background: none; border: none; cursor: pointer;
  color: var(--nav-fg); transition: .12s; }
.theme-toggle:hover { background: var(--card-2); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-moon { display: block; }

/* ---------- Controls ---------- */
.controls { padding: 16px; margin-bottom: 20px; }
.controls-row { display: flex; gap: 10px; flex-wrap: wrap; }
.controls input[type="text"], .controls select {
  padding: 9px 12px; font-size: 14px; font-family: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); outline: none; }
.controls input[type="text"] { flex: 1; min-width: 240px; }
.controls-row #projectSelect { flex: 1; min-width: 240px; }
.controls input[type="text"]:focus, .controls select:focus { border-color: var(--accent); }
.controls-extra { margin-top: 10px; }
.controls-extra input { width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); outline: none; }
.controls-extra input:focus { border-color: var(--accent); }
button.primary { background: var(--accent); color: #fff; border: none; padding: 9px 18px;
  border-radius: var(--radius); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: filter .12s; }
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: .5; cursor: wait; }
button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border);
  padding: 9px 16px; border-radius: var(--radius); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
button.secondary:hover { background: var(--card-2); }

/* ---------- Progress ---------- */
.progress { display: flex; gap: 16px; align-items: center; padding: 18px; margin-bottom: 20px; }
.progress-body { flex: 1; min-width: 0; }
.spinner { width: 26px; height: 26px; flex: none; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar { height: 6px; background: var(--card-2); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .3s; }
.progress-url { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Error ---------- */
.error { padding: 14px 16px; margin-bottom: 20px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); font-size: 14px; }

/* ---------- Sitemap-Hinweis ---------- */
.notice { padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 14px; display: flex; align-items: center; gap: 12px; }
.notice button { margin-left: auto; }

/* ---------- Summary ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 16px 18px; }
.stat .num { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Viz ---------- */
.viz-row { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 20px; align-items: start; }
.sunburst-wrap { padding: 18px; display: flex; flex-direction: column; align-items: center; }
#sunburst { display: block; max-width: 100%; }
.legend { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.legend-grad { width: 120px; height: 8px; border-radius: 4px;
  background: linear-gradient(to right, #d63a2a, #f0d43e, #2eae4f); }
.legend-mid { margin: 0 6px; }
.legend-skip { margin-left: 14px; display: inline-flex; align-items: center; gap: 5px; }
.legend-skip i { width: 12px; height: 12px; border-radius: 3px; background: #4a5468; display: inline-block; }

.detail { padding: 18px; min-height: 260px; }
.detail-empty { color: var(--muted); padding-top: 40px; text-align: center; font-size: 14px; }
.detail .crumb { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail h2 { margin: 0 0 10px; font-size: 17px; line-height: 1.35; }
.detail .score-pill { display: inline-flex; align-items: center; justify-content: center; height: 22px;
  padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.detail .desc { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.detail .details-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.detail ul { margin: 0; padding: 0; list-style: none; }
.detail li { padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
  background: var(--card-2); margin-bottom: 5px; word-break: break-word; }
.detail li.clickable { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.detail li.clickable:hover { background: var(--accent-weak); color: var(--accent); }
.detail li.clickable .li-chev { margin-left: auto; color: var(--muted); }
.detail .crumb-link { color: var(--accent); cursor: pointer; }
.detail .crumb-link:hover { text-decoration: underline; }

/* ---------- Kategorienliste ---------- */
.cat-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.cat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.cat-head:hover { background: var(--card-2); }
.cat-head .cat-score { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 24px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: #fff; flex: none; }
.cat-head .cat-name { font-weight: 600; font-size: 15px; flex: 1; }
.cat-head .cat-meta { color: var(--muted); font-size: 12px; }
.cat-head .chev { color: var(--muted); transition: transform .2s; }
.cat.open .chev { transform: rotate(90deg); }
.cat-body { display: none; border-top: 1px solid var(--border); }
.cat.open .cat-body { display: block; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 14px; }
.check-row:last-child { border-bottom: none; }
.check-row:hover { background: var(--card-2); }
.check-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.check-row .check-name { flex: 1; }
.check-row .check-score { font-weight: 700; width: 42px; text-align: right; }
.check-row.skipped { opacity: .45; }

.actions { text-align: center; margin-top: 24px; }

/* ---------- Tooltip ---------- */
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px 12px; font-size: 13px; max-width: 280px; }
.tooltip .tt-name { font-weight: 600; margin-bottom: 2px; }
.tooltip .tt-score { color: var(--muted); }

@media (max-width: 900px) {
  .viz-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
}
