/* UpRankers SEO Portal — dense, readable, light/dark. Modules use these classes; no per-module CSS files. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #16181d; --muted: #667085; --line: #e3e6ea;
  --accent: #0f5fd7; --accent-ink: #ffffff; --ok: #1a7f4b; --warn: #b7791f; --bad: #c0392b; --off: #8a94a6;
  --p0: #c0392b; --p1: #d97706; --p2: #2563eb; --p3: #6b7280;
  --live: #1a7f4b; --public: #2563eb; --estimate: #b7791f;
  --radius: 8px; --font: -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --panel: #171b21; --ink: #e8ebf0; --muted: #98a2b3; --line: #262c35;
    --accent: #5b9cff; --accent-ink: #0b1220; --ok: #3ccf7a; --warn: #e3a94a; --bad: #ff6b5c; --off: #6b7280;
    --p0: #ff6b5c; --p1: #f0b25a; --p2: #7fb0ff; --p3: #9aa3b2; --live: #3ccf7a; --public: #7fb0ff; --estimate: #e3a94a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #171b21; --ink: #e8ebf0; --muted: #98a2b3; --line: #262c35;
  --accent: #5b9cff; --accent-ink: #0b1220; --ok: #3ccf7a; --warn: #e3a94a; --bad: #ff6b5c; --off: #6b7280;
  --p0: #ff6b5c; --p1: #f0b25a; --p2: #7fb0ff; --p3: #9aa3b2; --live: #3ccf7a; --public: #7fb0ff; --estimate: #e3a94a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 12px; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 12px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 6px 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.dim { color: var(--muted); } .bad { color: var(--bad); } .ok { color: var(--ok); } .warn { color: var(--warn); }
.small { font-size: 12px; }

/* layout */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand a { font-weight: 700; font-size: 16px; color: var(--ink); display: block; padding: 4px 8px; }
.brand span { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.side nav a:hover { background: var(--bg); text-decoration: none; }
.side nav a.on { background: var(--accent); color: var(--accent-ink); }
.banner { margin: 10px 20px 0; padding: 10px 14px; border-radius: var(--radius); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); background: var(--panel); }
.banner.action { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.banner.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
@media (max-width: 760px) { .banner { margin: 8px 12px 0; } }
.nav-simple a { font-size: 15px; padding: 9px 10px; }
.nav-simple .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; text-align: center; }
.nav-simple a.on .count { background: var(--accent-ink); color: var(--accent); }
.nav-adv { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.nav-adv summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 10px; text-transform: uppercase; letter-spacing: .05em; list-style: none; }
.nav-adv summary::-webkit-details-marker { display: none; }
.nav-adv summary::after { content: " ▸"; } .nav-adv[open] summary::after { content: " ▾"; }
.nav-adv nav a { font-size: 13px; padding: 5px 10px; }
/* simple-mode building blocks: decision cards, plain feed, traffic lights */
.decision { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; margin-bottom: 12px; }
.decision.high { border-left-color: var(--bad); } .decision.low { border-left-color: var(--off); }
.decision h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.decision .why { color: var(--muted); margin: 0 0 8px; }
.decision ul { margin: 6px 0 10px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.decision .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.feed { list-style: none; margin: 0; padding: 0; } .feed li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.feed li .when { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 86px; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--off); margin-right: 6px; vertical-align: middle; }
.light.green { background: var(--ok); } .light.amber { background: var(--warn); } .light.red { background: var(--bad); }
.big { font-size: 28px; font-weight: 700; line-height: 1.1; }
.lead { font-size: 15px; color: var(--ink); max-width: 820px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 12px; padding: 0 8px; }
.main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.crumbs { color: var(--muted); font-size: 12.5px; }
.strip { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); } .strip b { color: var(--ink); }
.content { padding: 18px 20px 40px; }
.flash { margin: 12px 20px 0; padding: 10px 12px; background: color-mix(in srgb, var(--ok) 12%, var(--panel)); border: 1px solid var(--ok); border-radius: var(--radius); }

/* cards, grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; min-width: 0; overflow-x: auto; }
.grid { display: grid; gap: 14px; } .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand a { padding: 2px 4px; font-size: 14px; } .brand span { display: none; }
  .side nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 2px; min-width: 0; flex: 1; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a { white-space: nowrap; padding: 6px 9px; }
  .side-foot { display: none; }
  .top { position: static; padding: 6px 12px; flex-wrap: wrap; gap: 4px; }
  .crumbs { display: none; } .strip { gap: 10px; font-size: 12px; flex-wrap: wrap; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .chat-fab { bottom: 12px; right: 12px; }
}
.kpi { display: flex; flex-direction: column; gap: 2px; } .kpi .v { font-size: 24px; font-weight: 700; } .kpi .l { color: var(--muted); font-size: 12px; } .kpi .d { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }

/* tables */
.table-wrap { overflow: auto; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
.table.sortable th { cursor: pointer; user-select: none; } .table.sortable th.asc::after { content: " ▲"; } .table.sortable th.desc::after { content: " ▼"; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.table .url { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* pills, badges */
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); color: var(--muted); background: transparent; white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: var(--ok); } .pill.warn { color: var(--warn); border-color: var(--warn); } .pill.bad { color: var(--bad); border-color: var(--bad); } .pill.off { color: var(--off); }
.pill.P0 { color: var(--p0); border-color: var(--p0); } .pill.P1 { color: var(--p1); border-color: var(--p1); } .pill.P2 { color: var(--p2); border-color: var(--p2); } .pill.P3 { color: var(--p3); border-color: var(--p3); }
.pill.LIVE { color: var(--live); border-color: var(--live); } .pill.PUBLIC { color: var(--public); border-color: var(--public); } .pill.ESTIMATE { color: var(--estimate); border-color: var(--estimate); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }

/* forms, buttons */
.btn { display: inline-block; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); } .btn.small { padding: 3px 8px; font-size: 12px; } .btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
textarea { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
label > input, label > select, label > textarea { color: var(--ink); }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow: auto; padding-bottom: 6px; }
.kanban .col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.kanban .col h3 { margin: 2px 0 8px; }
.kanban .item { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; font-size: 12.5px; }

/* chat box (evolve module) */
.chat-fab { position: fixed; right: 16px; bottom: 16px; z-index: 40; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); border: 0; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.chat { position: fixed; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px)); z-index: 45; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-head .btn { margin-left: auto; }
.chat-log { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-log .msg { padding: 8px 10px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; font-size: 13px; }
.chat-log .msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.chat-log .msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.chat-log .msg a { color: inherit; text-decoration: underline; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; }

/* misc */
.empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; z-index: 50; }
details > summary { cursor: pointer; color: var(--accent); }
.chart { position: relative; height: 220px; }
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login { width: 320px; display: flex; flex-direction: column; gap: 12px; } .login h1 span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; font-size: 12px; }
.prose { max-width: 820px; } .prose h2 { margin-top: 18px; } .prose table { font-size: 13px; }

/* "Handled automatically by Claude" note on Advanced pages */
.auto-note { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid #2f9e5b; border-radius: var(--radius); background: var(--panel); }
.auto-note summary { cursor: pointer; line-height: 1.5; }
.auto-note ul { margin: 8px 0 4px 18px; }
.auto-note .auto-jobs { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.86em; }
.auto-note .auto-jobs th, .auto-note .auto-jobs td { text-align: left; padding: 4px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.auto-note .auto-you { margin: 6px 0 0; font-weight: 600; }
.auto-note .bad { color: #c0392b; }
@media (max-width: 760px) { .auto-note .auto-jobs th:nth-child(4), .auto-note .auto-jobs td:nth-child(4) { display: none; } }

/* "Manual override (optional — Claude already does this)": collapsed, quiet */
details.manual-override { margin: 10px 0; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: transparent; }
details.manual-override > summary { cursor: pointer; font-size: 0.85em; opacity: 0.75; }
details.manual-override[open] { background: var(--panel); }
details.manual-override[open] > summary { margin-bottom: 8px; }
