:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d2320; --muted: #66706b; --line: #e2e0d8;
  --accent: #1f7a5a; --accent-ink: #ffffff;
  --good: #1f8a4c; --warn: #c27a00; --bad: #c6352b; --info: #3b6ea8;
  --good-bg: #e6f4ea; --warn-bg: #fdf1dc; --bad-bg: #fbe7e5; --info-bg: #e7eef8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614; --panel: #1b201d; --ink: #e8ece9; --muted: #98a39d; --line: #2c332f;
    --accent: #3fb489; --accent-ink: #0d1411;
    --good: #4cc27c; --warn: #e6a935; --bad: #ff6b5e; --info: #7aa7e0;
    --good-bg: #183323; --warn-bg: #352a12; --bad-bg: #3a1c19; --info-bg: #1a2638;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .02em; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
nav a.on { background: var(--bg); color: var(--ink); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; text-align: center; }
.badge:empty { display: none; }
main { padding: 16px; margin: 0 auto; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.login { max-width: 420px; margin: 10vh auto; }
.login .row { display: flex; gap: 8px; margin-top: 12px; }
.login input { flex: 1; letter-spacing: .3em; font-size: 20px; text-align: center; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.switch button { border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.switch button.on { background: var(--accent); color: var(--accent-ink); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.site { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.site:hover { border-color: var(--accent); }
.site .name { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.s-up, .sev-good { background: var(--good-bg); color: var(--good); }
.s-challenge, .s-unknown, .sev-warning { background: var(--warn-bg); color: var(--warn); }
.s-down, .s-blank, .s-error, .s-suspended, .s-nosite, .sev-critical { background: var(--bad-bg); color: var(--bad); }
.sev-info { background: var(--info-bg); color: var(--info); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }
.note { font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.warn { color: var(--warn); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.steps { display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list { display: flex; flex-direction: column; gap: 8px; }
.ev { display: grid; grid-template-columns: 130px auto 1fr; gap: 10px; align-items: start; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .ev { grid-template-columns: 1fr; gap: 2px; } }
.ev .msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.chart svg { width: 100%; height: auto; display: block; }
.q .choices { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.q .free { display: flex; gap: 8px; margin-top: 8px; }
.q .free input { flex: 1; min-width: 0; }
.editor-title { width: 100%; font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar button { padding: 4px 10px; }
.doc { min-height: 50vh; padding: 20px; line-height: 1.7; font-size: 17px; outline: none; overflow-wrap: anywhere; }
.doc:focus { border-color: var(--accent); }
.doc img { max-width: 100%; height: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; }
.tbl td:first-child { overflow-wrap: anywhere; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; white-space: nowrap; }
details { margin-top: 8px; }
details summary { cursor: pointer; font-weight: 600; }
details ul { margin: 6px 0; padding-left: 20px; font-size: 14px; overflow-wrap: anywhere; }

/* Full-width site panels, alert bar, renewal colors (2026-Oct-20) */
:root { --d-green: #1f8a4c; --d-yellow: #a88a00; --d-orange: #d4670b; --d-red: #c6352b; }
@media (prefers-color-scheme: dark) { :root { --d-green: #4cc27c; --d-yellow: #e2c33b; --d-orange: #ff9a3d; --d-red: #ff6b5e; } }
.grow { flex: 1; }
.small { font-size: 12px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
button.tiny { padding: 2px 8px; font-size: 12px; }
.up { color: var(--good); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }
.toolbar2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar2 .switch { margin: 0; }
.toolbar2 input { min-width: 200px; }
.wides { display: flex; flex-direction: column; gap: 12px; }
.site.wide { gap: 10px; }
.head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head .dom { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--ink); }
.head .dom:hover { color: var(--accent); }
.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 20px; font-size: 14px; }
.blocks > div { min-width: 0; }
.dchip { padding: 1px 8px; border-radius: 10px; color: #fff; font-size: 12px; white-space: nowrap; }
.d-green { background: var(--d-green); } .d-yellow { background: var(--d-yellow); } .d-orange { background: var(--d-orange); } .d-red { background: var(--d-red); }
.score { padding: 1px 8px; border-radius: 10px; color: #fff; font-size: 12px; text-transform: none; letter-spacing: 0; }
.chks { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chk { font-size: 13px; white-space: nowrap; }
.chk.yes { color: var(--good); } .chk.no { color: var(--bad); }
.spark { width: 160px; height: 34px; display: block; margin-top: 4px; }
.alertbar { background: var(--bad-bg); border: 1px solid var(--bad); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.alertbar.calm { background: var(--good-bg); border-color: var(--good); color: var(--good); font-weight: 600; }
.alertbar .al { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; font-weight: 600; }
.alertbar .al a { color: inherit; }
.bill-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.idea .row { margin-top: 8px; }
.copy { font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; background: var(--bg); padding: 6px 8px; border-radius: 8px; display: inline-block; max-width: 100%; }
.tblwrap { overflow-x: auto; }

/* Publishing calendar (calendar.js + FullCalendar) */
:root { --fc-border-color: var(--line); --fc-page-bg-color: var(--panel); --fc-neutral-bg-color: var(--bg); --fc-today-bg-color: var(--info-bg);
  --fc-button-bg-color: var(--panel); --fc-button-border-color: var(--line); --fc-button-text-color: var(--ink);
  --fc-button-hover-bg-color: var(--bg); --fc-button-hover-border-color: var(--line); --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent); }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: var(--accent-ink); }
.fc .fc-toolbar-title { font-size: 19px; }
.fc .fc-daygrid-day-number, .fc .fc-col-header-cell-cushion { color: var(--ink); text-decoration: none; }
.fc .fc-event { cursor: pointer; }
.fc .is-sched { opacity: .88; } .fc .is-draft { opacity: .5; border-style: dashed; }
.calhead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.calnote { margin: 0 0 10px; }
.calmonth { font-size: 12px; line-height: 1.3; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.calweek { display: flex; flex-direction: column; gap: 2px; padding: 5px 6px; color: #fff; white-space: normal; font-size: 13px; line-height: 1.3; }
.calweek .t { font-weight: 600; }
.calweek .m { opacity: .9; font-size: 12px; }
.calchip { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 6px; margin-left: 6px; }
.calchip.sched { background: var(--info-bg); color: var(--info); } .calchip.live { background: var(--good-bg); color: var(--good); } .calchip.draft { background: var(--warn-bg); color: var(--warn); }
.calweek .calchip { margin: 2px 0; align-self: flex-start; }
.calnav { display: flex; gap: 6px; flex-wrap: wrap; }
a.ghostlink { background: transparent; color: var(--ink); border-color: var(--line); }
.caltabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.caltabs a { padding: 8px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--panel); cursor: pointer; }
.caltabs a.on { background: var(--bg); box-shadow: inset 0 0 0 1px var(--accent); }
.caltabs.small a { border-left-width: 1px; padding: 6px 10px; font-weight: 600; }
.calart { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calform { display: flex; flex-direction: column; gap: 10px; }
.calbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.calf { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.calf > span { font-weight: 600; font-size: 13px; }
.calf input, .calf select, .calf textarea { width: 100%; }
.calf textarea[name="body"] { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.calrow { display: flex; gap: 10px; flex-wrap: wrap; }
.calcheck { display: flex; gap: 8px; align-items: center; }
.calsave { display: flex; gap: 12px; align-items: center; position: sticky; bottom: 0; background: var(--panel); padding: 8px 0; }
.calside { position: sticky; top: 64px; }
.calside .pane { max-height: calc(100vh - 140px); overflow: auto; }
.calprev img { max-width: 100%; height: auto; border-radius: 8px; }
.calprev h1 { font-size: 24px; } .calprev .lead { font-weight: 600; }
.calpre { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.serp { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.serp .u { font-size: 12px; color: var(--muted); } .serp .t { color: var(--info); font-size: 18px; } .serp .d { font-size: 13px; }
td.good { color: var(--good); } td.warn { color: var(--warn); }
.calauth { display: flex; gap: 14px; margin-bottom: 16px; } .calauth img, .calauth .nophoto { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--bg); flex: none; }
.calauth h2 { margin: 0 0 4px; }
@media (max-width: 900px) { .calart { grid-template-columns: 1fr; } .calside { position: static; } .calside .pane { max-height: none; } }
.good { color: var(--good); }

/* Queue: fast approval of written articles */
.qwriter .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qcard { margin: 14px 0; }
.qcard h2 { margin: 6px 0; }
.qtop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qtop .grow { flex: 1; }
.qsum { font-weight: 600; }
.qlead img, .qbody img { max-width: 100%; height: auto; display: block; border-radius: 6px; }
img.ai-img { outline: 5px solid #ff1a1a; outline-offset: 3px; }
.qcard img[data-img] { cursor: context-menu; }
.qdone { opacity: .8; }
.qmenu { position: absolute; z-index: 50; display: flex; flex-direction: column; gap: 6px; width: min(320px, calc(100vw - 16px)); padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.qmenu textarea, .qmenu input { width: 100%; box-sizing: border-box; }
.small { font-size: 13px; }
#calCap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#calCap label { flex-direction: row; align-items: center; gap: 6px; display: flex; }
.qlead img, .qbody img { max-height: 380px; width: auto; }

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.vcard label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.vcard input, .vcard textarea { width: 100%; box-sizing: border-box; font: inherit; }
.qvideo img{max-width:100%;max-height:380px;border:3px solid #c00}

/* SEO + GEO dashboards (2026-Oct-22). Chart colors: validated categorical slots c1-c5 (AI channels, groups) and a
   one-hue ramp r1-r5 for position bands (darkest = best). */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4;
  --r1: #184f95; --r2: #256abf; --r3: #5598e7; --r4: #86b6ef; --r5: #d3d1c8; }
@media (prefers-color-scheme: dark) { :root { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181;
  --r1: #9ec5f4; --r2: #5598e7; --r3: #2a78d6; --r4: #1c5cab; --r5: #3a413d; } }
.dash { margin-bottom: 14px; }
.dash h2 { font-size: 15px; margin: 18px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile .big { font-size: 24px; font-weight: 700; line-height: 1.2; }
.tile .sk { width: 100%; height: 30px; margin-top: 4px; }
.chart.hov { position: relative; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .lab { font-size: 11px; fill: var(--ink); }
.chart .xh { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .mk { stroke: var(--muted); stroke-opacity: .5; stroke-dasharray: 2 3; }
.chart .mkf { fill: var(--muted); }
.chart .tip { position: absolute; top: 4px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); white-space: nowrap; z-index: 2; }
.chart .tip i, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sk { display: block; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.mini { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-decoration: none; color: inherit; min-width: 0; }
.mini:hover { border-color: var(--accent); }
.mini .sk { width: 100%; }
.heatmap td.hm, .geogrid td.gc, .heatmap th:not(:first-child), .geogrid th:not(:first-child) { text-align: center !important; font-weight: 600; }
.geogrid td:first-child { max-width: 380px; }
.gc-cited { background: var(--good-bg); } .gc-cited button { color: var(--good); }
.gc-named { background: var(--info-bg); } .gc-named button { color: var(--info); }
.gc-none button { color: var(--muted); }
button.linkish { background: none; border: 0; padding: 2px 4px; font-weight: 600; color: inherit; cursor: pointer; }
.sitetabs a { padding: 6px 14px; text-decoration: none; color: var(--muted); font-weight: 600; }
.sitetabs a.on { background: var(--accent); color: var(--accent-ink); }
.sortable th { cursor: pointer; user-select: none; }
.answer { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.anstext { white-space: pre-wrap; font-size: 14px; max-height: 480px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
mark.us { background: var(--good-bg); color: var(--good); font-weight: 700; }
mark.them { background: var(--warn-bg); color: var(--warn); }
.sitetabs { flex-wrap: wrap; }

/* Changes at a glance (2026-Oct-22): green = went up, light red = went down. Text keeps its own color and arrow. */
.chg-up { background: var(--good-bg) !important; } .chg-down { background: var(--bad-bg) !important; }
.tile.chg-up { border-color: var(--good); } .tile.chg-down { border-color: var(--bad); }
.mini.chg-up { border-color: var(--good); } .mini.chg-down { border-color: var(--bad); }
.key { padding: 0 6px; border-radius: 4px; color: var(--ink); }

/* Compact per-site keyword page */
.narrow { max-width: 980px; }
.narrow h2 { margin: 18px 0 4px; }
.narrow p.small { margin: 0 0 6px; }
.card.tight { padding: 6px 10px; }
.card.tight .tbl td, .card.tight .tbl th { padding: 3px 6px; }
button.x { background: transparent; border: none; color: var(--muted); padding: 0 6px; font-size: 16px; line-height: 1; cursor: pointer; }
button.x:hover { color: var(--bad); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
details.add { margin: 6px 0 4px; font-size: 13px; }
details.add summary { cursor: pointer; color: var(--muted); }
details.add[open] { display: grid; gap: 8px; }
label.row { flex-direction: row; gap: 8px; align-items: center; } label.row input { width: auto; }

/* Heat-map steps (AI share of voice): one blue hue, pale = low, strong = high */
.hm0 { background: #e7f0fc; color: #0b0b0b; } .hm1 { background: #cde2fb; color: #0b0b0b; } .hm2 { background: #9ec5f4; color: #0b0b0b; }
.hm3 { background: #6da7ec; color: #0b0b0b; } .hm4 { background: #3987e5; color: #fff; } .hm5 { background: #256abf; color: #fff; }
.hm6 { background: #184f95; color: #fff; } .hm7 { background: #0d366b; color: #fff; }
@media (prefers-color-scheme: dark) {
  .hm0 { background: #15233a; color: #dde7f5; } .hm1 { background: #1b3050; color: #dde7f5; } .hm2 { background: #213f69; color: #dde7f5; }
  .hm3 { background: #2a5288; color: #fff; } .hm4 { background: #3468aa; color: #fff; } .hm5 { background: #4a82cc; color: #0b0b0b; }
  .hm6 { background: #6fa0e0; color: #0b0b0b; } .hm7 { background: #9ec5f4; color: #0b0b0b; }
}
.hm .small { opacity: .85; }
/* Chart flags written out under the chart */
ul.marks { list-style: none; padding: 0; margin: 4px 0 0; color: var(--muted); }
ul.marks li { margin: 1px 0; } .mkdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
button.x.sure { color: var(--bad); font-size: 12px; border: 1px solid var(--bad); border-radius: 6px; padding: 1px 6px; }
.tbl th.grp { text-align: center !important; border-bottom: 2px solid var(--line); color: var(--ink); }

/* Split tests */
.abcard { margin-bottom: 10px; }
.abdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.abbar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 6px 0; } .abbar i { display: block; height: 100%; background: var(--accent); }
.abv { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; } .abv input { flex: 1 1 140px; min-width: 0; }
a.btn { display: inline-block; text-decoration: none; }
.abwide { max-width: 1240px; } .tbl td.abname { min-width: 170px; overflow-wrap: normal; }
