  :root {
    --nav: 200px;
    --ink: #222;
    --muted: #6b6f75;
    --line: #f0f2f5;
    --border: #dcdfe6;
    --bg: #f3f5f7;
    --card: #fff;
    --primary: #1690ff;
    --primary-bg: #e8f4ff;
    --up: #cf1322;
    --down: #389e0d;
  }
  * { box-sizing: border-box; }
  body { margin: 0; font: 14px/1.5714 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; }
  .login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
  .login form { width: 400px; background: var(--card); border-radius: 8px; padding: 32px 28px; box-shadow: 0 6px 16px rgba(0, 0, 0, .08); }
  .mark {
    width: 32px; height: 32px; border-radius: 6px; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 600;
  }
  .login h1 { font-size: 20px; font-weight: 600; margin: 16px 0 0; }
  .login .sub { color: var(--muted); margin: 8px 0 24px; }
  .login label { display: block; color: var(--muted); font-size: 13px; margin: 0 0 6px; }
  .login input { width: 100%; height: 32px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
  .login input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .login .sms-row { display: grid; grid-template-columns: 1fr 120px; gap: 8px; margin-top: 12px; }
  .login button { margin-top: 16px; width: 100%; height: 32px; background: var(--primary); color: #fff; border: 0; border-radius: 6px; }
  .login button:hover { background: #4096ff; }
  .login button:disabled { opacity: .6; cursor: not-allowed; }
  .login .sms-btn { margin-top: 0; font-size: 13px; padding: 0 8px; }
  .login .hint { color: var(--primary); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }
  .err { color: #ff4d4f; min-height: 1.2em; margin: 8px 0 0; }
  .app { display: flex; min-height: 100vh; }
  nav {
    width: var(--nav); background: #f7f9fa; color: var(--ink); border-right: 1px solid #eef1f4;
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  }
  .brand { display: flex; gap: 10px; align-items: center; padding: 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .brand b { display: block; font-size: 14px; line-height: 1.3; font-weight: 600; }
  .brand span { color: var(--muted); font-size: 12px; }
  #navLinks { flex: 1; overflow: auto; padding: 8px 0 12px; }
  nav h2 { font-size: 12px; color: var(--muted); margin: 12px 16px 4px; font-weight: 400; }
  nav a { display: flex; align-items: center; gap: 8px; margin: 0 8px; padding: 6px 12px; color: var(--ink); text-decoration: none; border-radius: 6px; }
  nav a svg { width: 16px; height: 16px; flex: none; color: #8b939c; }
  nav a:hover { background: rgba(0, 0, 0, .04); }
  nav a:hover svg { color: var(--primary); }
  nav a.on { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
  nav a.on svg { color: var(--primary); }
  #logout {
    margin: 8px 16px 16px; height: 32px; border: 1px solid var(--border); background: #fff;
    border-radius: 6px; color: var(--ink);
  }
  #logout:hover { color: var(--primary); border-color: var(--primary); }
  main { flex: 1; min-width: 0; }
  header {
    position: sticky; top: 0; z-index: 8; background: #fff;
    border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; gap: 12px; align-items: center;
    justify-content: space-between;
  }
  .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .ctl {
    display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
  }
  .ctl:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .ctl span { color: var(--muted); font-size: 12px; white-space: nowrap; }
  .ctl select, .ctl input { border: 0; background: transparent; outline: none; padding: 0; max-width: 150px; }
  .range-bar { margin: 20px 0 0; }
  .range-bar.report {
    margin: 0 0 16px; background: #fff; border-radius: 10px; padding: 16px 20px 14px;
    display: flex; flex-direction: column; gap: 12px;
  }
  .range-bar.overview { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .filter-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .range-bar.overview .filter-line.extra { margin-left: auto; }
  .flab { color: var(--muted); font-size: 12px; margin-right: 4px; }
  .range-bar.overview .flab { display: none; }
  .time-radios { display: flex; align-items: center; flex-wrap: wrap; }
  .range-bar.overview .time-radios button {
    border: 0; background: transparent; height: 28px; padding: 0 14px; border-radius: 0; color: #333; font-size: 12px;
  }
  .range-bar.overview .time-radios button:hover { color: var(--primary); }
  .range-bar.overview .time-radios button.on { color: var(--primary); font-weight: 500; box-shadow: inset 0 -2px 0 var(--primary); }
  .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
  .seg button, .range-bar.report .time-radios button {
    border: 0; border-right: 1px solid var(--border); background: #fff; height: 32px; padding: 0 14px;
    border-radius: 0; color: #333; font-size: 12px;
  }
  .seg button:last-child, .range-bar.report .time-radios button:last-child { border-right: 0; }
  .seg button:hover, .range-bar.report .time-radios button:hover { color: var(--primary); }
  .seg button.on, .range-bar.report .time-radios button.on { background: var(--primary); color: #fff; font-weight: 500; }
  .seg button:disabled { color: #bfbfbf; cursor: not-allowed; background: #fafafa; }
  .range-bar.overview .seg button.on { background: var(--primary-bg); color: var(--primary); }
  .range-bar.overview .seg button:disabled { background: transparent; }
  .range-bar.report .time-radios { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
  #export { height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--primary); }
  #export:hover { color: #4096ff; }
  .search { position: relative; }
  .search input { width: 240px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 11px; background: #fff; }
  .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .suggest {
    position: absolute; right: 0; top: 36px; width: 280px; z-index: 9; overflow: hidden;
    background: #fff; border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  }
  .suggest div { padding: 8px 12px; }
  .suggest div:hover { background: var(--primary-bg); }
  .content { padding: 12px 20px 32px; transition: opacity .12s ease; }
  .content.is-loading { opacity: .55; pointer-events: none; }
  .page-heading {
    margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 32px;
    white-space: nowrap; flex: none;
  }
  .page-blurb {
    margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4;
    flex: 1; min-width: 120px; max-width: 560px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .page-blurb:empty { display: none; }
  .sec-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 16px; font-weight: 600; }
  .sec-title .pico { width: 24px; height: 24px; border-radius: 7px; }
  .sec-title .pico svg { width: 13px; height: 13px; }
  .metrics-panel { margin: 0 0 16px; }
  .metrics-panel .cards { margin-top: 4px; }
  .lead { margin: 6px 0 0; color: var(--muted); max-width: 720px; }
  .note, .alert { border-radius: 8px; padding: 0 0 8px; margin: 0; }
  .note { background: transparent; border: 0; color: var(--muted); font-size: 12px; }
  .note.warn, .alert { background: #fffbe6; border: 1px solid #ffe58f; color: var(--ink); padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }
  .alert a { color: #d48806; font-weight: 600; }
  .chips { display: flex; gap: 8px; margin: 0 0 12px; }
  .chips button { border: 1px solid #91caff; background: var(--primary-bg); color: var(--primary); border-radius: 4px; padding: 0 8px; height: 24px; }
  .panel { background: var(--card); border-radius: 10px; padding: 20px 24px 16px; }
  .panel-h { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 0 12px; font-weight: 600; font-size: 16px; }
  .pills { display: inline-flex; gap: 0; flex-wrap: wrap; margin: 0 0 8px; padding: 3px; background: #f2f4f7; border-radius: 6px; }
  .pills button { height: 28px; padding: 0 12px; border: 0; background: transparent; border-radius: 4px; color: #333; font-weight: 400; }
  .pills button.on { color: var(--primary); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
  .panel-h .meta { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; text-align: right; }
  .fine { margin: 0; padding: 4px 14px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
  .linkish { border: 0; background: transparent; color: #6b6f75; font-weight: 400; padding: 0; white-space: nowrap; }
  .linkish:hover, .detail:hover { color: var(--primary); }
  .detail { margin-left: 12px; border: 0; background: transparent; color: #8c8c8c; font-weight: 400; padding: 0; white-space: nowrap; font-size: 12px; }
  .panel-h > .detail { margin-left: auto; }
  .vlegend + .detail { margin-left: 12px; }
  .visit-top { display: flex; gap: 12px; align-items: stretch; }
  .live-box {
    width: 232px; flex: none; min-height: 220px; border-radius: 10px; padding: 24px 16px;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
    background:
      radial-gradient(circle at 18% 78%, rgba(22, 144, 255, .22), transparent 46%),
      radial-gradient(circle at 78% 28%, rgba(114, 46, 209, .12), transparent 42%),
      linear-gradient(180deg, #f3f8ff 0%, #fff 70%);
  }
  .visit-top .live-box {
    width: 148px; min-height: 0; padding: 14px 10px 12px;
  }
  .live-box .k { color: #222; font-size: 14px; font-weight: 700; line-height: 1.4; display: flex; align-items: center; gap: 6px; }
  .visit-top .live-box .k {
    font-size: 12px; font-weight: 600; line-height: 1.35; flex-direction: column; gap: 4px;
  }
  .live-box .k svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
  .visit-top .live-box .k svg { width: 14px; height: 14px; }
  .live-box .n { font-size: 40px; font-weight: 700; line-height: 1; margin: 12px 0; font-variant-numeric: tabular-nums; color: #222; }
  .visit-top .live-box .n { font-size: 28px; margin: 8px 0 6px; }
  .visit-top .live-box .linkish { font-size: 12px; }
  .glance-box { flex: 1; min-width: 0; min-height: 168px; background: #fff; border-radius: 10px; padding: 12px 12px 12px 6px; display: flex; gap: 6px; align-items: center; }
  .glabels, .gcard { display: grid; grid-template-rows: 18px 36px 16px 16px 16px; align-items: start; row-gap: 8px; }
  .glabels span { line-height: 16px; }
  .glabels { width: 64px; flex: none; padding: 14px 0; color: #333; font-size: 12px; }
  .glance-cards { flex: 1; min-width: 0; display: flex; gap: 10px; overflow-x: auto; }
  .gcard {
    flex: 1 1 0; min-width: 96px; border-radius: 8px; padding: 12px 10px;
    background: linear-gradient(#f2f5f9, #fff);
  }
  .gcard .gt { color: #6b6f75; font-size: 12px; white-space: nowrap; }
  .gcard .gv { justify-self: end; text-align: right; color: #333; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .gcard .gv.today { align-self: start; font-size: 16px; font-weight: 700; color: #222; line-height: 16px; }
  .gcard .rate { display: block; min-height: 14px; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--primary); text-align: right; }
  .gcard .gv.up { color: var(--up); }
  .gcard .gv.down { color: var(--down); }
  .rt-top { display: flex; gap: 16px; align-items: stretch; margin-bottom: 16px; }
  .rt-top .live-box { min-height: 140px; }
  .rt-cards { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
  .rt-cards .card { background: linear-gradient(#f2f5f9, #fff); }
  .arr { display: inline-block; width: 0; height: 0; margin-left: 4px; vertical-align: 1px; border-left: 4px solid transparent; border-right: 4px solid transparent; }
  .arr.up { border-bottom: 6px solid var(--up); }
  .arr.down { border-top: 6px solid var(--down); }
  .pico { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
  .pico svg { width: 14px; height: 14px; display: block; }
  .pico.blue { background: #1677ff; }
  .pico.green { background: #52c41a; }
  .pico.orange { background: #fa8c16; }
  .pico.soft { background: #e6f4ff; color: #1677ff; }
  .pico.soft-orange { background: #fff7e6; color: #fa8c16; }
  .pico.soft-green { background: #f6ffed; color: #52c41a; }
  /* 概况统一三列，跨行竖缝与圆角对齐 */
  .overview-stack {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: stretch;
  }
  .overview-stack > .span2 { grid-column: span 2; min-width: 0; }
  .overview-stack > .panel,
  .overview-stack > .panel.table-panel,
  .overview-stack > .panel.chart-panel {
    margin-top: 0; display: flex; flex-direction: column; min-width: 0; height: 100%;
  }
  .overview-stack > .panel .table-wrap { flex: 1; max-height: none; overflow-x: auto; overflow-y: visible; }
  .overview-stack > .panel .pager { padding: 10px 0 0; }
  .overview-stack > .panel .dev-cards { flex: 1; align-content: start; }
  .overview-stack > .panel .chart { flex: 1; }
  .overview-stack > .panel .vplot { flex: 1; }
  .trend-row, .geo-row { display: grid; gap: 16px; margin-top: 16px; align-items: stretch; }
  .trend-row { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .geo-row { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
  .trend-row > .panel, .geo-row > .panel,
  .trend-row > .panel.table-panel, .geo-row > .panel.table-panel { margin-top: 0; display: flex; flex-direction: column; min-width: 0; }
  .geo-row > .panel .table-wrap { flex: 1; max-height: none; }
  .geo-row > .panel .dev-cards { flex: 1; align-content: start; }
  .vlegend { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 400; }
  .vlegend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }
  .vlegend i.n, .vbars i.n { background: #1677ff; }
  .vlegend i.o, .vbars i.o { background: #fa8c16; }
  .vplot { flex: 1; display: grid; grid-template-columns: 32px 1fr 1fr; align-items: stretch; gap: 8px; min-height: 168px; padding: 0 0 8px; }
  .yaxis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; padding-bottom: 22px; }
  .vcol { display: flex; flex-direction: column; min-height: 0; }
  .vbars { flex: 1; min-height: 120px; display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
  .vbars i { display: block; width: 28px; border-radius: 4px 4px 0 0; min-height: 2px; }
  .vname { text-align: center; color: var(--muted); font-size: 12px; line-height: 22px; }
  .vcards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; }
  .vcard { display: flex; align-items: center; gap: 8px; background: #fafafa; border-radius: 8px; padding: 10px; min-width: 0; }
  .vcard .k { color: var(--muted); font-size: 12px; }
  .vcard b { display: inline; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .vcard em { margin-left: 8px; color: var(--muted); font-style: normal; font-size: 12px; }
  .dev-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 0 0; }
  .dev-card { background: #fafafa; border-radius: 8px; padding: 14px 8px 12px; text-align: center; }
  .dev-card .pico { margin: 0 auto 8px; }
  .dev-card .k { color: var(--muted); font-size: 12px; }
  .dev-card b { display: block; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; }
  .mix { display: flex; height: 8px; margin: 0 0 8px; border-radius: 99px; overflow: hidden; background: #f5f5f5; }
  .mix i { display: block; height: 100%; }
  .mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 0 8px; color: var(--muted); font-size: 12px; }
  .mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 4px; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; margin-top: 16px; align-items: start; }
  .home-grid .chart-panel { margin-top: 0; }
  .web-metrics { padding: 4px 0 6px; }
  .web-metrics .card { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: transparent; border-radius: 0; padding: 6px 0; }
  .web-metrics .card .k { font-size: 13px; }
  .web-metrics .card .v { font-size: 16px; margin-top: 0; }
  .card { background: var(--card); border-radius: 10px; padding: 14px 16px; }
  .cards .card { background: linear-gradient(180deg, #f3f7fb 0%, #fff 62%); border: 1px solid #eef2f6; }
  .cards .card[data-tab] { cursor: pointer; }
  .cards .card[data-tab]:hover { border-color: #91caff; box-shadow: 0 0 0 2px rgba(5, 145, 255, .08); }
  .card-top { display: flex; align-items: center; gap: 8px; min-height: 28px; }
  .card-top .pico { width: 28px; height: 28px; border-radius: 8px; }
  .card-top .pico svg { width: 14px; height: 14px; }
  .card .k { color: var(--muted); font-size: 12px; line-height: 1.3; }
  .card .v { font-size: 22px; font-weight: 600; margin-top: 10px; font-variant-numeric: tabular-nums; }
  .card .v.muted { font-size: 13px; font-weight: 400; color: var(--muted); }
  .card.pay .v { color: var(--primary); }
  .panel-h .pico { margin-right: 2px; }
  .delta { display: inline-block; margin-top: 6px; font-size: 12px; border-radius: 4px; padding: 0 6px; font-variant-numeric: tabular-nums; }
  .delta.up { color: var(--up); background: #fff1f0; }
  .delta.down { color: var(--down); background: #f6ffed; }
  .delta.flat { color: var(--muted); background: #fafafa; }
  .section { margin-top: 16px; }
  .cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .cards.few { grid-template-columns: repeat(auto-fill, 200px); }
  .cards.fill.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards.fill.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards.fill.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cards.fill.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .chart { position: relative; padding: 0; }
  .chart svg { width: 100%; height: auto; display: block; }
  .chart .tip {
    display: none; position: absolute; z-index: 2; min-width: 148px; pointer-events: none;
    background: #fff; color: var(--ink); border: 1px solid #f0f0f0; border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12); padding: 8px 10px; font-size: 12px; line-height: 1.7;
  }
  .chart .tip .row { display: flex; align-items: center; gap: 6px; }
  .chart .tip .row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
  .chart .tip .pct { color: var(--muted); }
  .chart .tip i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
  .chart svg text, .chart svg path, .chart svg line, .chart svg circle { pointer-events: none; }
  .chart svg .band { cursor: crosshair; }
  .legend { display: flex; gap: 16px; justify-content: flex-end; padding: 0 0 8px; color: var(--muted); font-size: 12px; }
  .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }
  .panel.chart-panel { margin-top: 16px; }
  .overview-stack > .panel.chart-panel { margin-top: 0; }
  .panel.table-panel { margin-top: 16px; }
  .tabs { display: flex; gap: 0; margin: 0 0 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 16px; border-radius: 0; color: var(--ink); margin-bottom: -1px; }
  .tabs button:hover { color: var(--primary); }
  .tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; background: transparent; }
  .board { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
  .board-row { display: grid; gap: 16px; align-items: stretch; min-width: 0; }
  .board-row.n1 { grid-template-columns: minmax(0, 1fr); }
  .board-row.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .board-row.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-row.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board .panel,
  .board .panel.table-panel {
    margin-top: 0; min-width: 0; height: 100%; display: flex; flex-direction: column;
  }
  .board .panel .table-wrap { flex: 1; min-height: 0; max-height: none; overflow-x: auto; overflow-y: visible; }
  .table-panel { width: auto; max-width: none; }
  .table-panel:has(.form) { width: min(880px, 100%); }
  .table-wrap { overflow-x: auto; overflow-y: visible; max-height: none; max-width: 100%; }
  .pager {
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px;
    padding: 10px 0 0; color: var(--muted); font-size: 12px;
  }
  .pager .info { margin-right: auto; }
  .pager button {
    height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--border);
    border-radius: 6px; background: #fff; color: var(--ink);
  }
  .pager button:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
  .pager button:disabled { opacity: .4; cursor: not-allowed; }
  .pager button.on { color: var(--primary); border-color: var(--primary); background: var(--primary-bg); font-weight: 600; }
  .setup-panel .pager, .spend-hist .pager { padding: 10px 16px 14px; }
  table { width: 100%; border-collapse: collapse; }
  .board-row.n2 table, .board-row.n3 table, .board-row.n4 table, .geo-row table, .overview-stack table { table-layout: fixed; }
  th, td { padding: 8px 4px; white-space: nowrap; border-bottom: 1px solid #f3f5f7; overflow: hidden; text-overflow: ellipsis; }
  th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 12px; font-weight: 500; color: #717887; z-index: 1; height: 36px; }
  th.sortable { cursor: pointer; }
  td.num, th.num { padding-left: 12px; text-align: right; font-variant-numeric: tabular-nums; }
  .board-row.n2 td.num, .board-row.n2 th.num, .board-row.n3 td.num, .board-row.n3 th.num, .board-row.n4 td.num, .board-row.n4 th.num,
  .geo-row td.num, .geo-row th.num, .overview-stack td.num, .overview-stack th.num { width: 72px; }
  tbody tr { height: 37px; }
  tbody tr:hover td { background: #fafafa; }
  tbody tr.link { cursor: pointer; }
  tbody tr.link td:first-child { color: var(--primary); }
  tbody tr.child td:first-child { color: #595959; font-weight: 400; }
  td.child-key { padding-left: 22px; }
  button.row-exp {
    position: relative; display: inline-block; box-sizing: border-box;
    width: 14px; height: 14px; margin-right: 6px; padding: 0;
    border: 1px solid #bfbfbf; border-radius: 2px; background: #fff;
    color: #595959; cursor: pointer; vertical-align: -1px; flex-shrink: 0;
  }
  button.row-exp::before, button.row-exp::after {
    content: ""; position: absolute; background: currentColor; pointer-events: none;
  }
  button.row-exp::before { left: 2px; right: 2px; top: 50%; height: 1px; margin-top: -0.5px; }
  button.row-exp::after { top: 2px; bottom: 2px; left: 50%; width: 1px; margin-left: -0.5px; }
  button.row-exp.open::after { display: none; }
  button.row-exp:hover { border-color: var(--primary); color: var(--primary); }
  tbody tr.pad { pointer-events: none; }
  tbody tr.pad td { border-bottom-color: transparent; color: transparent; }
  tbody tr.pad:hover td { background: transparent; }
  .empty { padding: 28px 16px; text-align: center; color: var(--muted); }
  .panel-h .count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
  .form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); gap: 12px; padding: 4px 0 0; align-items: end; }
  .form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
  .form input, .form textarea { border: 1px solid var(--border); border-radius: 6px; padding: 4px 11px; background: #fff; width: 100%; }
  .form input:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .form .wide { grid-column: 1 / -1; }
  .form button { height: 32px; border: 1px solid var(--primary); border-radius: 6px; background: var(--primary); color: #fff; padding: 0 15px; }
  .form button:hover { background: #4096ff; border-color: #4096ff; }
  .form button.ghost, button.ghost {
    background: #fff; color: var(--ink); border: 1px solid var(--border);
  }
  .form button.ghost:hover, button.ghost:hover { color: var(--primary); border-color: var(--primary); }
  .install-panel { margin-top: 16px; }
  .install-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
  .install-apps button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
  .snippet {
    border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; padding: 12px 14px; margin: 0 0 12px;
  }
  .snippet .sh {
    display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 600;
  }
  .snippet .sh .hint { color: var(--muted); font-weight: 400; font-size: 12px; flex: 1; }
  .snippet .sh button { height: 28px; padding: 0 10px; font-size: 12px; }
  .snippet textarea {
    width: 100%; min-height: 96px; border: 1px solid var(--border); border-radius: 6px;
    padding: 8px 10px; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5;
    resize: vertical;
  }
  .setup-page { width: 100%; max-width: none; }
  .setup-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: 0 0 12px; padding: 0;
  }
  .setup-head .sub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 720px; flex: 1; min-width: 0; }
  .setup-head .cta, .setup-empty .cta {
    flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--primary); color: #fff;
  }
  .setup-head .cta:hover, .setup-empty .cta:hover { background: #4096ff; }
  header .filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
  header .filters #appFilter { display: inline-flex; }
  .setup-panel { background: #fff; border: 1px solid #eef1f4; border-radius: 10px; overflow: hidden; width: 100%; }
  .setup-panel + .setup-panel { margin-top: 16px; }
  .setup-panel .panel-h { padding: 14px 16px; border-bottom: 1px solid var(--line); margin: 0; }
  .setup-panel .table-wrap {
    max-height: none; height: auto; max-width: none; width: 100%;
    padding: 0 12px 4px; overflow-x: auto; overflow-y: visible;
  }
  .setup-panel table { width: 100%; table-layout: fixed; }
  .setup-panel th, .setup-panel td {
    padding: 10px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .setup-panel table.apps-table { table-layout: auto; min-width: 1100px; }
  .setup-panel table.apps-table th, .setup-panel table.apps-table td { padding: 10px 10px; }
  .setup-panel table.apps-table td.act { width: 88px; text-align: right; }
  .setup-panel .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .setup-panel .panel-h .count { margin-left: auto; }
  .setup-empty {
    padding: 48px 24px; text-align: center; color: var(--muted);
  }
  .setup-empty b { display: block; color: var(--ink); font-size: 15px; margin: 0 0 6px; }
  .setup-empty .cta { margin-top: 16px; }
  .setup-status-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
  .spend-page { display: flex; flex-direction: column; gap: 16px; }
  .spend-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
    padding: 12px 16px; background: #fff; border: 1px solid #eef1f4; border-radius: 10px;
  }
  .spend-bar .day-nav { display: inline-flex; align-items: center; gap: 6px; }
  .spend-bar .day-nav button.nav {
    width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1;
  }
  .spend-bar .day-nav button.nav:hover { color: var(--primary); border-color: var(--primary); }
  .spend-bar .day-nav input[type="date"] {
    height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; background: #fff;
  }
  .spend-bar .day-nav input[type="date"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .spend-bar .seg { display: inline-flex; }
  .spend-bar .day-title { margin-left: auto; color: var(--muted); font-size: 13px; }
  .spend-bar .day-title b { color: var(--ink); font-size: 15px; font-weight: 600; margin-left: 6px; font-variant-numeric: tabular-nums; }
  .spend-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
  .spend-cards .card { margin: 0; }
  .spend-sheet { margin: 0; }
  .spend-sheet .table-wrap { max-height: none; padding-bottom: 4px; overflow-x: auto; overflow-y: visible; }
  .spend-sheet table.spend-edit { table-layout: fixed; min-width: 640px; width: 100%; }
  .spend-sheet table.spend-edit th:nth-child(1), .spend-sheet table.spend-edit td:nth-child(1) { width: 16%; }
  .spend-sheet table.spend-edit th:nth-child(2), .spend-sheet table.spend-edit td:nth-child(2) { width: 20%; }
  .spend-sheet table.spend-edit th:nth-child(3), .spend-sheet table.spend-edit td:nth-child(3) { width: 16%; }
  .spend-sheet table.spend-edit th:nth-child(4), .spend-sheet table.spend-edit td:nth-child(4) { width: 18%; }
  .spend-sheet table.spend-edit th:nth-child(5), .spend-sheet table.spend-edit td:nth-child(5) { width: 12%; }
  .spend-sheet table.spend-edit th:nth-child(6), .spend-sheet table.spend-edit td:nth-child(6) { width: 8%; }
  .spend-sheet input.cell {
    width: 100%; height: 30px; border: 1px solid transparent; border-radius: 4px;
    padding: 0 8px; background: transparent; text-align: right; font-variant-numeric: tabular-nums;
  }
  .spend-sheet input.cell:hover { border-color: var(--border); background: #fff; }
  .spend-sheet input.cell:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .spend-sheet input.cell.text { text-align: left; }
  .spend-sheet .st { font-size: 12px; color: var(--muted); }
  .spend-sheet .st.ok { color: #237804; }
  .spend-sheet .st.wait { color: #d48806; }
  .spend-sheet .row-del { border: 0; background: transparent; color: var(--muted); padding: 0 4px; }
  .spend-sheet .row-del:hover { color: #cf1322; }
  .spend-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfc;
  }
  .spend-actions .err { margin: 0 0 0 8px; }
  .spend-actions button.primary { height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--primary); color: #fff; }
  .spend-actions button.primary:hover { background: #4096ff; }
  .spend-helpers {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: start;
  }
  .spend-helpers .setup-panel { margin: 0; }
  .spend-paste .body, .spend-hist .body { padding: 14px 16px 16px; }
  .spend-paste textarea {
    width: 100%; min-height: 132px; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.5;
    resize: vertical; background: #fff;
  }
  .spend-paste textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(5, 145, 255, .1); }
  .spend-paste .tips { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
  .spend-paste .tips code { background: #f5f5f5; padding: 1px 5px; border-radius: 3px; }
  .spend-days { display: flex; flex-direction: column; gap: 6px; }
  .spend-day-item {
    display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center;
    width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; padding: 10px 12px; cursor: pointer; color: var(--ink);
  }
  .spend-day-item:hover { border-color: var(--primary); }
  .spend-day-item.on { border-color: var(--primary); background: var(--primary-bg); }
  .spend-day-item .d { font-variant-numeric: tabular-nums; font-weight: 600; }
  .spend-day-item .meta { color: var(--muted); font-size: 12px; }
  .spend-day-item .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--primary); }
  .spend-day-item.on .amt { color: var(--ink); }
  .spend-hist .empty-hint { margin: 0; color: var(--muted); font-size: 13px; padding: 12px 0; }
  @media (max-width: 1100px) {
    .spend-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spend-helpers { grid-template-columns: 1fr; }
    .spend-bar .day-title { margin-left: 0; width: 100%; }
  }
  .badge {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: 12px; font-weight: 500; background: #f0f2f5; color: var(--muted);
  }
  .badge.ok { background: #e8f8ef; color: #237804; }
  .badge.off { background: #fff1f0; color: #cf1322; }
  .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--muted); }
  .linkish-btn {
    border: 0; background: transparent; color: var(--primary); padding: 0; height: auto;
  }
  .linkish-btn:hover { color: #4096ff; }
  .check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
  .check input { width: auto; }
  .ghost { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--border) !important; }
  .ghost:hover { color: var(--primary) !important; border-color: var(--primary) !important; }
  .modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
  .modal-card { width: min(520px, calc(100vw - 32px)); background: #fff; border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .08); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
  .modal-card.wide { width: min(760px, calc(100vw - 32px)); }
  .modal-h { display: flex; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); font-weight: 600; flex: none; }
  .modal-h button { margin-left: auto; border: 0; background: transparent; color: var(--muted); }
  .modal-b { padding: 16px 24px; overflow: auto; flex: 1; }
  .modal-b.session-list > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 16px; border-top: 1px solid var(--line); flex: none; }
  .modal-f .err { margin: 0 auto 0 0; }
  .modal-b .form { grid-template-columns: 1fr 1fr; }
  .install-tabs { display: flex; gap: 0; margin: 0 0 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
  .install-tabs button {
    border: 0; border-bottom: 2px solid transparent; background: transparent;
    padding: 8px 12px; margin-bottom: -1px; border-radius: 0; color: var(--ink);
  }
  .install-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
  .install-hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; line-height: 1.5; }
  .install-code {
    width: 100%; min-height: 220px; border: 1px solid var(--border); border-radius: 6px;
    padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55;
    resize: vertical; background: #fafbfc;
  }
  @media (max-width: 780px) {
    .home-grid, .trend-row, .geo-row, .board-row.n2, .board-row.n3, .board-row.n4, .overview-stack, .cards.fill, .dev-cards, .vcards { grid-template-columns: 1fr; }
    .overview-stack > .span2 { grid-column: auto; }
    .visit-top, .rt-top, .glance-box { flex-direction: column; }
    .live-box { width: auto; }
  }
