/* 1.1 — restrained light / mist / slate palettes; local assets only. */
:root[data-theme="light"],:root[data-theme="mist"]{
  color-scheme:light;--bg:#f4f7fc;--sidebar:#fff;--panel:#fff;--panel-hover:#f0f5ff;
  --panel-inset:#f8faff;--line:#d5deec;--line-soft:#e6ecf5;--text:#1e3049;
  --muted:#61738e;--subtle:#78879c;--cyan:#3468d8;--cyan-dark:#e7efff;
  --purple:#7656be;--green:#178462;--amber:#a46c15;--red:#bd4355;
  --shadow:0 16px 48px #23487912;--radius:16px;
}
:root[data-theme="mist"]{--bg:#edf3f8;--sidebar:#e6eef8;--panel:#fafdff;--panel-inset:#f2f6fc;--cyan:#25689b;--line:#cbd8e7}
:root[data-theme="dark"]{--bg:#172436;--sidebar:#1b2c42;--panel:#20334b;--panel-inset:#17283c;--panel-hover:#294059;--line:#38516d;--line-soft:#304760;--text:#eef5ff;--muted:#b4c6db;--subtle:#93a9c2;--shadow:0 16px 48px #09132126}
.theme-picker{width:112px;min-height:34px;padding:6px 9px;font-size:12px;background:var(--panel);border-color:var(--line);color:var(--text)}
.login-theme{position:absolute;top:26px;right:28px}.topbar-right{gap:14px}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-primary{color:#fff;background:var(--cyan);border-color:var(--cyan);box-shadow:0 5px 16px #2d64cd20}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-primary:hover:not(:disabled){background:#2457bb;border-color:#2457bb}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-secondary{background:#edf3ff;border-color:#cbdaf6;color:#2857a8}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-secondary:hover:not(:disabled){background:#dfebff}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-quiet:hover:not(:disabled),:root:is([data-theme="light"],[data-theme="mist"]) .icon-btn:hover{background:#eaf1fb;color:var(--text)}
:root:is([data-theme="light"],[data-theme="mist"]) .btn-danger{color:#a93446;background:#fff0f2;border-color:#efcad1}
:root:is([data-theme="light"],[data-theme="mist"]) .login-story{background:radial-gradient(ellipse at 55% 55%,#d5e6ff 0,transparent 65%),#edf3fc;border-color:var(--line)}
:root:is([data-theme="light"],[data-theme="mist"]) .login-form-region{background:var(--panel)}
:root:is([data-theme="light"],[data-theme="mist"]) .login-panel input{background:#f8faff}
:root:is([data-theme="light"],[data-theme="mist"]) .field-label{color:#334b6a}
:root:is([data-theme="light"],[data-theme="mist"]) .brand-mark,:root:is([data-theme="light"],[data-theme="mist"]) .orbit-center{background:linear-gradient(145deg,#ebf2ff,#d8e7ff);border-color:#bbcef0;color:var(--cyan);box-shadow:none}
:root:is([data-theme="light"],[data-theme="mist"]) .orbit{border-color:#b6cceb}
:root:is([data-theme="light"],[data-theme="mist"]) .network-label{background:#fff;border-color:#d1deef;color:var(--text);box-shadow:0 5px 22px #1d456710}
:root:is([data-theme="light"],[data-theme="mist"]) .orbit-point{background:var(--cyan);box-shadow:0 0 0 5px #3468d818}
:root:is([data-theme="light"],[data-theme="mist"]) .sidebar{background:var(--sidebar);box-shadow:3px 0 24px #16355804}
:root:is([data-theme="light"],[data-theme="mist"]) .topbar{background:#ffffffed;border-color:var(--line-soft)}
:root:is([data-theme="light"],[data-theme="mist"]) .nav-item.active,:root:is([data-theme="light"],[data-theme="mist"]) .sidebar-site.active{background:#eaf1ff;color:#2d61c6;border-color:#cbdaf7}
:root:is([data-theme="light"],[data-theme="mist"]) .nav-item:hover,:root:is([data-theme="light"],[data-theme="mist"]) .sidebar-site:hover{background:#f1f5fd;color:var(--text)}
:root:is([data-theme="light"],[data-theme="mist"]) .nav-count,:root:is([data-theme="light"],[data-theme="mist"]) .tab-count{background:#e8effc;color:var(--cyan)}
:root:is([data-theme="light"],[data-theme="mist"]) .avatar,:root:is([data-theme="light"],[data-theme="mist"]) .site-symbol{background:#edf1ff;border-color:#d8e0fb;color:#5574b8}
:root:is([data-theme="light"],[data-theme="mist"]) .account-button:hover,:root:is([data-theme="light"],[data-theme="mist"]) .logout-button:hover{background:#edf3fc;color:var(--text)}
:root:is([data-theme="light"],[data-theme="mist"]) .site-card,:root:is([data-theme="light"],[data-theme="mist"]) .stat-card,:root:is([data-theme="light"],[data-theme="mist"]) .card{background:var(--panel);border-color:var(--line-soft);box-shadow:0 4px 18px #25466807}
:root:is([data-theme="light"],[data-theme="mist"]) .site-card:hover{border-color:#acc5ee;box-shadow:0 9px 28px #25466812;background:#fff}
:root:is([data-theme="light"],[data-theme="mist"]) .card-title-icon,:root:is([data-theme="light"],[data-theme="mist"]) .stat-icon{background:#edf3fe;border-color:#d6e3fa;color:var(--cyan)}
:root:is([data-theme="light"],[data-theme="mist"]) .inset-row,:root:is([data-theme="light"],[data-theme="mist"]) .meta-list,:root:is([data-theme="light"],[data-theme="mist"]) .guidance-card,:root:is([data-theme="light"],[data-theme="mist"]) .mapping-tip{background:var(--panel-inset);border-color:var(--line-soft)}
:root:is([data-theme="light"],[data-theme="mist"]) .badge{color:#17805d;background:#eaf8f1;border-color:#c9e9d8}
:root:is([data-theme="light"],[data-theme="mist"]) .warning-badge{color:#936215;background:#fff5df;border-color:#edddb5}
:root:is([data-theme="light"],[data-theme="mist"]) .callout{background:#edf4ff;border-color:#cbdcf6;color:#455f83}
:root:is([data-theme="light"],[data-theme="mist"]) .callout.warning{background:#fff8e9;border-color:#ebddb9;color:#865f23}
:root:is([data-theme="light"],[data-theme="mist"]) .callout.danger-callout,:root:is([data-theme="light"],[data-theme="mist"]) .form-error{background:#fff0f1;border-color:#ebcbd0;color:#a33c4b}
:root:is([data-theme="light"],[data-theme="mist"]) .mapping-table thead,:root:is([data-theme="light"],[data-theme="mist"]) .activity-table thead{background:#f0f5fd;color:#4d627d}
:root:is([data-theme="light"],[data-theme="mist"]) .mapping-table input[type=text]{background:#f8faff;color:var(--text);border-color:#d5dfed}
:root:is([data-theme="light"],[data-theme="mist"]) .switch{background:#d0dbe9;border-color:#c2cfe0}
:root:is([data-theme="light"],[data-theme="mist"]) .switch:checked{background:var(--cyan);border-color:var(--cyan)}
:root:is([data-theme="light"],[data-theme="mist"]) .switch:before{background:#fff}
:root:is([data-theme="light"],[data-theme="mist"]) .activity-table-wrap{background:var(--panel);border-color:var(--line)}
:root:is([data-theme="light"],[data-theme="mist"]) .activity-table td{color:var(--text);border-color:var(--line-soft)}
:root:is([data-theme="light"],[data-theme="mist"]) .activity-table tr:hover td{background:#f3f7fe}
:root:is([data-theme="light"],[data-theme="mist"]) .activity-site{background:#edf2fd;color:#4c68a0}
:root:is([data-theme="light"],[data-theme="mist"]) .link-field,:root:is([data-theme="light"],[data-theme="mist"]) .template-editor,:root:is([data-theme="light"],[data-theme="mist"]) .code-content{background:#f6f9fe;color:#28476f;border-color:var(--line);white-space:pre-wrap;overflow-wrap:anywhere}
:root:is([data-theme="light"],[data-theme="mist"]) .modal,:root:is([data-theme="light"],[data-theme="mist"]) .modal-shell{background:#fff;border-color:var(--line);box-shadow:0 30px 90px #23456a2e}
:root:is([data-theme="light"],[data-theme="mist"]) .modal-footer{background:#f7faff;border-color:var(--line-soft)}
:root:is([data-theme="light"],[data-theme="mist"]) .toast{background:#fff;border-color:var(--line);color:var(--text);box-shadow:0 8px 35px #27497125}
:root:is([data-theme="light"],[data-theme="mist"]) .empty-icon,:root:is([data-theme="light"],[data-theme="mist"]) .step-symbol{background:#edf3fd;border-color:#d2def2;color:var(--cyan)}
:root:is([data-theme="light"],[data-theme="mist"]) .step-symbol.done{background:#edf8f2;color:var(--green);border-color:#cde7d9}
:root:is([data-theme="light"],[data-theme="mist"]) .diagnose-result{background:#f6f9ff;border-color:var(--line)}
:root:is([data-theme="light"],[data-theme="mist"]) .code-tab.active{background:#e8f0fc;color:var(--cyan)}
/* Telemetry */
.activity-controls{display:flex;align-items:center;gap:12px;margin:20px 0;flex-wrap:wrap}
.activity-controls>select{width:140px}.activity-controls>input[type=search],.diagnostic-controls>input{width:auto;min-width:180px;flex:1}
.activity-controls label{white-space:nowrap;font-size:12px;color:var(--muted)}.activity-controls input[type=checkbox]{vertical-align:middle}
.rank-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:22px 0}.rank-card{min-width:0}
.rank-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line-soft)}.rank-row:last-child{border:0}
.rank-index{width:22px;color:var(--subtle);font-size:12px;font-variant-numeric:tabular-nums}.rank-label{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.55}.rank-count{text-align:right;font-weight:600;font-variant-numeric:tabular-nums}.rank-count small{display:block;font-weight:400;color:var(--subtle);font-size:10px;white-space:nowrap}
.requests-table{min-width:1020px}.requests-table td{font-size:12px;vertical-align:top}.requests-table td:nth-child(4){max-width:250px;overflow-wrap:anywhere}.table-sub{display:block;color:var(--subtle);font-size:10px;margin-top:5px}.activity-pagination{margin:20px 0}.activity-pagination button:last-child{margin-left:auto}
.detail-row{display:grid;grid-template-columns:100px minmax(0,1fr);gap:14px;padding:13px 0;border-bottom:1px solid var(--line-soft);font-size:12px}.detail-row pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.request-detail{max-width:100%}
.tabs{overflow-x:auto;white-space:nowrap;gap:24px}.tab-button{flex-shrink:0}
@media(max-width:1100px){.rank-grid{grid-template-columns:1fr}.rank-card{padding:20px}.rank-row{padding:9px 0}.rank-grid .rank-card:nth-child(n+2){max-height:400px;overflow:auto}}
@media(max-width:680px){.theme-picker{width:86px;font-size:11px}.topbar-right{gap:6px}.session-status{display:none}.activity-controls{gap:9px}.activity-controls>input[type=search],.diagnostic-controls>input{width:100%;flex:auto;min-width:0}.activity-controls .btn{font-size:11px}.tabs{gap:19px}.tab-button{font-size:12px}.login-theme{top:15px;right:18px}.detail-row{grid-template-columns:74px minmax(0,1fr)}.requests-table td{font-size:11px}.activity-pagination button:last-child{margin-left:0}.card-title h3{font-size:15px}.field-label{font-size:12px}.callout{font-size:12px}.main{padding-bottom:50px}.toasts{top:80px;bottom:auto}}
:root:is([data-theme="light"],[data-theme="mist"]) .activity-table th{background:#edf3fc;color:#536a88;border-color:var(--line)}
:root:is([data-theme="light"],[data-theme="mist"]) .breadcrumb strong{color:var(--text)}
.activity-report .activity-table-wrap{max-height:580px;overflow:auto}.requests-table thead{position:sticky;top:0;z-index:1}
/* v1.2: progressive disclosure for IP aggregation, using the active theme. */
.ip-groups-table .button-row{gap:6px;flex-wrap:wrap}
.ip-groups-table td:first-child{min-width:150px}
.ip-expand-panel{padding:20px;white-space:normal;background:var(--panel-inset);border-radius:12px}
.ip-detail-heading{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.ip-request-details{border:1px solid var(--line);border-radius:9px;padding:10px 12px;margin:8px 0}
.ip-request-details summary{cursor:pointer;overflow-wrap:anywhere;line-height:1.7}
.ip-request-body{padding:8px 2px;line-height:1.8}
.ip-request-body pre{white-space:pre-wrap;word-break:break-word;font-size:12px}
.ip-groups-table .table-sub{white-space:normal;overflow-wrap:anywhere;max-width:270px}
.ip-groups-table .ip-detail-tr[hidden]{display:none}
@media(max-width:640px){.ip-expand-panel{padding:12px}.ip-request-details{padding:8px}.ip-detail-heading{display:block}.ip-detail-heading span{display:block;margin-top:6px}}

/* 1.3.0 per-site DNS control */
.dns-policy-card .inset-row {flex-wrap:wrap;gap:12px;}
.dns-policy-description {line-height:1.8;color:var(--muted);margin:16px 0;}
.dns-policy-muted {opacity:.55;}
.dns-policy-card .switch-label {white-space:normal;}

.geo-batch-progress {width:100%;height:12px;accent-color:#2563eb;margin:12px 0;}
.geo-batch-summary {padding:16px 0;line-height:1.8;}
.geo-batch-panel .button-row {flex-wrap:wrap;}
.geo-batch-summary p {margin:8px 0;}

.dns-policy-card {margin-bottom:24px;}
:root:is([data-theme="light"],[data-theme="mist"]) .mini-stat strong,
:root:is([data-theme="light"],[data-theme="mist"]) .meta-row dd {color:var(--text);}
:root:is([data-theme="light"],[data-theme="mist"]) .meta-row dt {color:var(--muted);}
