/* White cell dashboard (T3, tool whitecell). Charts are inline SVG; series-1 blue, series-2 orange; status colours
   (good/warning/critical) always come with an icon and a word. */
/* P9 scheme tokens: light = the colours these rules always used, dark = the shell's dark surfaces. */
:root {
  --whitecell-blue-text: #1b5aa6;
  --whitecell-green-text: #076807;
  --whitecell-green-text-2: #0b6e0b;
  --whitecell-orange-text: #a62626;
  --whitecell-orange-text-2: #9a3d12;
  --whitecell-red-line: #e7b0b0;
  --whitecell-shade: rgba(0,0,0,.04);
  --whitecell-surface: #f7f7f4;
  --whitecell-surface-2: #eff9ef;
  --whitecell-surface-3: #fdf1f1;
  --whitecell-surface-4: #fdeee6;
  --whitecell-surface-5: #e8f1fb;
  --whitecell-surface-6: #f0f0ec;
  --whitecell-tint-green: #e7f6e7;
  --whitecell-tint-red: #fbe5e5;
  --whitecell-tint-yellow: #fffbe9;
  --whitecell-tint-yellow-2: #fff4d6;
  --whitecell-yellow-text: #7a5300;
}
[data-scheme="dark"] {
  --whitecell-blue-text: #75adf8;
  --whitecell-green-text: #76c071;
  --whitecell-green-text-2: #74c16f;
  --whitecell-orange-text: #fa8279;
  --whitecell-orange-text-2: #eb906d;
  --whitecell-red-line: #685151;
  --whitecell-shade: rgba(255, 255, 255, 0.048);
  --whitecell-surface: #252523;
  --whitecell-surface-2: #222822;
  --whitecell-surface-3: #2d2626;
  --whitecell-surface-4: #312824;
  --whitecell-surface-5: #272d32;
  --whitecell-surface-6: #2c2c29;
  --whitecell-tint-green: #252e25;
  --whitecell-tint-red: #3a2d2d;
  --whitecell-tint-yellow: #242217;
  --whitecell-tint-yellow-2: #2e2714;
  --whitecell-yellow-text: #caa469;
}
.wc-app { --wc-s1: #2a78d6; --wc-s2: #eb6834; --wc-good: #0ca30c; --wc-warn: #fab219; --wc-crit: #d03b3b; --wc-grid: #e7e7e3; display: flex; flex-direction: column; gap: 14px; }
.wc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.wc-head h1 { font-size: 26px; margin: 2px 0; }
.wc-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 8px; }
.wc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wc-aar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; }
.wc-aar .btn { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; }
.wc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.wc-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.wc-tabs button.is-active { color: var(--text); border-bottom-color: var(--brand); }
.wc-body { display: flex; flex-direction: column; gap: 14px; }
.wc-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.wc-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.wc-tile span { font-size: 12px; color: var(--muted); }
.wc-tile b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.wc-tile small { font-size: 11.5px; color: var(--faint, var(--muted)); }
.wc-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.wc-filter { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.wc-filter select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font: inherit; }
.wc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.wc-card h3 { font-size: 15px; margin: 0 0 2px; }
.wc-gap { margin-top: 18px !important; }
.wc-chart { width: 100%; height: 180px; display: block; overflow: visible; }
.wc-grid { stroke: var(--wc-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.wc-grid.is-zero { stroke: #b9b9b3; }
.wc-ax { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.wc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.wc-line.s1 { stroke: var(--wc-s1); } .wc-line.s2 { stroke: var(--wc-s2); }
.wc-dot { stroke: var(--surface); stroke-width: 2; } .wc-dot.s1 { fill: var(--wc-s1); } .wc-dot.s2 { fill: var(--wc-s2); }
.wc-hit { fill: transparent; } .wc-hit:hover { fill: var(--whitecell-shade); }
.wc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.wc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wc-key { width: 14px; height: 3px; border-radius: 2px; display: inline-block; } .wc-key.s1 { background: var(--wc-s1); } .wc-key.s2 { background: var(--wc-s2); }
.wc-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.wc-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); padding: 6px 8px; }
.wc-table td { border-bottom: 1px solid var(--border); padding: 7px 8px; vertical-align: top; }
.wc-table tr:last-child td { border-bottom: 0; }
.wc-table small { color: var(--muted); }
.wc-link { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.wc-sentcell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.wc-div { position: relative; width: 70px; height: 8px; background: var(--whitecell-surface-6); border-radius: 4px; flex: none; }
.wc-div::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: #9a9a94; }
.wc-div i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.wc-div i.pos { background: var(--wc-s1); } .wc-div i.neg { background: var(--wc-s2); }
.wc-bars { display: flex; flex-direction: column; gap: 6px; }
.wc-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 56px; gap: 8px; align-items: center; font-size: 12.5px; }
.wc-bar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-bar-track { height: 12px; }
.wc-bar-track i { display: block; height: 100%; background: var(--wc-s1); border-radius: 0 4px 4px 0; }
.wc-bar b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.wc-narr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wc-ncard header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wc-ncard header h3 { flex: 1; min-width: 160px; }
.wc-truth { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 4px; padding: 2px 6px; border: 1px solid; }
.wc-truth.is-false { color: var(--whitecell-orange-text); border-color: var(--whitecell-red-line); background: var(--whitecell-surface-3); }
.wc-truth.is-true { color: var(--whitecell-green-text-2); border-color: #a8dca8; background: var(--whitecell-surface-2); }
.wc-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; text-transform: capitalize; }
.wc-status.is-good { background: var(--whitecell-tint-green); color: var(--whitecell-green-text); } .wc-status.is-warning { background: var(--whitecell-tint-yellow-2); color: var(--whitecell-yellow-text); }
.wc-status.is-critical { background: var(--whitecell-tint-red); color: var(--whitecell-orange-text); } .wc-status.is-muted { background: var(--whitecell-surface-6); color: var(--muted); }
.wc-nstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0 0 10px; }
.wc-nstats div { background: var(--whitecell-surface); border-radius: 8px; padding: 6px 10px; }
.wc-nstats dt { font-size: 11px; color: var(--muted); } .wc-nstats dd { margin: 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wc-ncard .wc-chart { height: 130px; }
.wc-apps { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.wc-apps span { background: var(--whitecell-surface-6); border-radius: 999px; padding: 2px 8px; } .wc-apps b { color: var(--text); }
.wc-top summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.wc-top ol { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.wc-top li { font-size: 13px; border-left: 3px solid var(--border); padding-left: 10px; }
.wc-top li p { margin: 2px 0 0; color: var(--muted); }
.wc-stance { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 1px 6px; margin-right: 6px; background: var(--whitecell-surface-6); color: var(--muted); }
.wc-stance.is-spread { background: var(--whitecell-surface-4); color: var(--whitecell-orange-text-2); } .wc-stance.is-counter { background: var(--whitecell-surface-5); color: var(--whitecell-blue-text); } .wc-stance.is-support { background: var(--whitecell-surface-2); color: var(--whitecell-green-text-2); }
.wc-resp { display: flex; flex-direction: column; gap: 14px; }
.wc-resp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.wc-resp-head b { font-size: 15px; } .wc-resp-head small { color: var(--muted); flex: 1; }
.wc-ttfr { font-weight: 700; background: var(--whitecell-surface-5); color: var(--whitecell-blue-text); border-radius: 999px; padding: 2px 10px; }
.wc-chip { display: inline-block; background: var(--whitecell-surface-6); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; margin: 0 4px 3px 0; }
.wc-feed { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.wc-feed li { display: grid; grid-template-columns: 64px 100px 150px minmax(0, 1fr); gap: 4px 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.wc-feed li:last-child { border-bottom: 0; }
.wc-feed li.is-inject { background: var(--whitecell-tint-yellow); }
.wc-feed time { font-variant-numeric: tabular-nums; color: var(--muted); }
.wc-feed .wc-app { font-size: 12px; font-weight: 600; color: var(--muted); }
.wc-feed b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-ftext { color: var(--text); grid-column: 4; }
.wc-feed .wc-stance { grid-column: 4; justify-self: start; }
.wc-livebadge { font-size: 10px; font-weight: 800; text-transform: uppercase; color: #fff; background: #d03b3b; border-radius: 3px; padding: 0 5px; grid-column: 2; justify-self: start; }
.wc-none { color: var(--muted); padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; }
@media (max-width: 1180px) { .wc-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .wc-grid2, .wc-narr { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .wc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wc-tile b { font-size: 21px; }
  .wc-head h1 { font-size: 21px; }
  .wc-chart { height: 150px; }
  .wc-table { display: block; overflow-x: auto; white-space: nowrap; }
  .wc-feed li { grid-template-columns: 54px minmax(0, 1fr); }
  .wc-feed .wc-app, .wc-feed b, .wc-ftext, .wc-feed .wc-stance { grid-column: 2; }
  .wc-livebadge { grid-column: 1; }
  .wc-bar { grid-template-columns: 84px minmax(0, 1fr) 48px; }
}
/* P8-G1: narrative momentum gauge (0.2..3, the 1.0 mark = neutral) */
.wc-mom { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f7f7f4); }
.wc-mom-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.wc-mom-head b { font-size: 17px; color: var(--text, #1b1b1b); font-variant-numeric: tabular-nums; }
.wc-mom-track { position: relative; display: block; height: 8px; margin: 6px 0 4px; border-radius: 4px; background: linear-gradient(90deg, #2e7d32 0%, #d9d9d2 28.6%, #c62828 100%); }
.wc-mom-one { position: absolute; left: 28.6%; top: -3px; bottom: -3px; width: 2px; background: var(--faint, #555); }
.wc-mom-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--surface, #fff); border: 2px solid var(--text, #1b1b1b); }
.wc-mom .wc-sub { margin: 0; }

/* P9 dark scheme: the module tokens above, the shell's dark surfaces */
[data-scheme="dark"] .wc-app {
  --wc-s1: #5ca0f7;
  --wc-crit: #f56e67;
  --wc-grid: #353532;
}
[data-scheme="dark"] .wc-mom-track { background: linear-gradient(90deg, #4caf50 0%, #4d5765 28.6%, #ef5350 100%); }
