:root{
  color-scheme:light;--bg:#f5f8ff;--surface:#fff;--ink:#182235;--muted:#647086;--line:#dce5f3;
  --primary:#2f63d2;--primary-hover:#2458c4;--accent:#e4edff;--success:#27704e;--warning:#aa5713;--danger:#b93838;
  --blue:#356fe5;--radius:8px;--nav-height:74px;--safe-bottom:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;letter-spacing:0}
[hidden]{display:none!important}
html{min-height:100%;background:var(--bg);scroll-behavior:smooth}
body{margin:0;color:var(--ink);font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
button{border:0;background:none}
button,a{touch-action:manipulation}
a{color:var(--blue)}
button:focus-visible,a:focus-visible{outline:3px solid #245bc4;outline-offset:3px}
input:focus,select:focus,textarea:focus{outline:0;border-color:var(--blue);box-shadow:0 0 0 3px #245bc426}
button,select,input,textarea{transition:background .15s,border-color .15s,box-shadow .15s}
svg{width:20px;height:20px;flex-shrink:0;vertical-align:middle}
h1,h2,h3,p{margin:0}
h1{font-size:26px;line-height:1.3;font-weight:720}
h2{font-size:17px;line-height:1.4;font-weight:680}
h3{font-size:15px}
small{font-size:12px}
.skip-link{position:fixed;top:12px;left:20px;z-index:100;background:white;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.skip-link:focus-visible{width:auto;height:auto;padding:12px;clip-path:none;overflow:visible}
.app-shell{max-width:1600px;margin:auto}
.main{min-width:0;min-height:100dvh;padding-bottom:calc(var(--nav-height) + var(--safe-bottom) + 20px)}
.desktop-rail{display:none}
.page{padding:0 20px 28px;animation:page-in .18s ease-out}
@keyframes page-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;height:66px;border-bottom:1px solid var(--line);margin-bottom:24px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{width:32px;height:32px;background:var(--primary);color:white;display:grid;place-items:center;border-radius:8px;flex-shrink:0}
.brand-mark svg{width:18px;height:18px}
.brand-copy strong{display:block;font-size:14px;font-weight:700}
.brand-copy span{font-size:10px;color:var(--muted);display:block}
.topbar-meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.sync-indicator{width:6px;height:6px;background:var(--success);border-radius:50%}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:24px}
.page-head>div{min-width:0}
.page-head p{color:var(--muted);font-size:13px;margin-top:7px}
.page-head .primary{flex-shrink:0}
.primary,.secondary,.danger-btn{min-height:44px;padding:10px 16px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:13px;font-weight:650;text-decoration:none;line-height:1.4}
.primary{background:var(--primary);color:white;border:1px solid var(--primary)}
.primary:hover:not(:disabled){background:var(--primary-hover)}
.secondary{background:var(--surface);border:1px solid #d5d5dc}
.secondary:hover:not(:disabled){background:#f4f4f6}
.danger-btn{background:#fff2f3;color:var(--danger);border:1px solid #f0d4d8}
.danger-btn:hover:not(:disabled){background:#fbe8eb}
.primary svg,.secondary svg,.danger-btn svg{width:17px;height:17px}
.icon-btn,.back-btn{width:40px;height:40px;border:1px solid var(--line);border-radius:6px;background:var(--surface);display:inline-grid;place-items:center;flex-shrink:0}
.icon-btn:hover,.back-btn:hover{background:#efeff2}
.text-btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px;color:var(--blue);padding:6px 4px;font-size:13px;font-weight:650}
.text-btn svg{width:16px;height:16px}
.wide{width:100%}
.button-spinner,.spinner{border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
.button-spinner{width:16px;height:16px}
.spinner{width:26px;height:26px;color:var(--primary);margin:0 auto 16px}
@keyframes spin{to{transform:rotate(360deg)}}
.nav{position:fixed;bottom:0;left:0;right:0;height:calc(var(--nav-height) + var(--safe-bottom));padding:6px 8px calc(6px + var(--safe-bottom));background:#fffffffa;border-top:1px solid var(--line);z-index:20;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));backdrop-filter:blur(14px)}
.nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;position:relative;color:var(--muted);font-size:11px;min-width:0;border-radius:6px}
.nav button svg{width:21px;height:21px}
.nav button.active{color:var(--blue);font-weight:700}
.nav button.active:before{content:"";position:absolute;top:0;width:20px;height:2px;background:var(--blue);border-radius:2px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:26px 0 12px;min-height:32px}
.section-head h2{font-size:15px}
.section-head>span{font-size:12px;color:var(--muted)}
.section-head:first-child{margin-top:0}
.eyebrow{font-size:11px;font-weight:700;color:var(--muted)}
.health-overview{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:22px 0}
.health-title{display:flex;align-items:center;gap:10px}
.health-title>svg{color:var(--success);width:22px;height:22px}
.health-title.warning>svg{color:var(--warning)}
.health-title.danger>svg{color:var(--danger)}
.health-title h2{font-size:19px}
.health-overview p{color:var(--muted);font-size:13px;margin-top:6px}
.health-track{display:flex;gap:4px;height:5px;margin-top:22px;overflow:hidden;background:#e8e8ec}
.health-track span{min-width:0;background:var(--success)}
.health-track .down{background:#cfa35d}
.health-track .failed{background:#c6606b}
.health-legend{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted);margin-top:10px}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:24px 0;gap:18px;border-bottom:1px solid var(--line)}
.stat{min-width:0}
.stat+.stat{border-left:1px solid var(--line);padding-left:18px}
.stat strong{display:block;font-size:30px;line-height:1.2;font-weight:650;font-variant-numeric:tabular-nums}
.stat span{display:block;margin-top:6px;font-size:12px;color:var(--muted)}
.stat .stat-unit{display:inline;font-size:12px;font-weight:400;margin-left:5px}
.home-columns{display:grid;gap:0}
.policy-line{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:18px 0;width:100%;text-align:left}
.policy-line .row-body strong{font-size:14px}
.list{border-top:1px solid var(--line);background:transparent}
.row{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:17px 0;border-bottom:1px solid var(--line);min-width:0;background:transparent}
button.row:hover{background:#f0f0f380}
.row-body{flex:1;min-width:0}
.row-title{display:flex;align-items:center;gap:8px;justify-content:space-between;min-width:0;font-size:14px;font-weight:650}
.row-title>span:first-child{min-width:0;overflow-wrap:anywhere}
.row-sub{font-size:12px;color:var(--muted);margin-top:5px;overflow-wrap:anywhere}
.row-icon{width:38px;height:38px;display:grid;place-items:center;background:#eeeef2;color:#686875;flex-shrink:0;border-radius:8px}
.row-icon.accent{background:#eef3ff;color:var(--blue)}
.account-avatar{width:40px;height:40px;background:#eeeef2;color:#686875;border-radius:8px;display:grid;place-items:center;flex-shrink:0;font-size:16px;font-weight:650}
.account-avatar.online{background:#eef3ff;color:var(--blue)}
.account-meta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;margin-top:5px;min-width:0}
.account-meta .row-sub{margin:0}
.account-rule-count{font-size:11px;color:var(--muted);border-left:1px solid var(--line);padding-left:10px}
.chevron{width:16px;height:16px;color:#96969f}
.badge{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:550;line-height:1.5;background:#eeeef2;color:#6b6b75;padding:3px 7px;border-radius:4px;flex-shrink:0;white-space:nowrap}
.badge:before{content:"";width:4px;height:4px;background:currentColor;border-radius:50%}
.badge.online,.badge.good{background:#edf6ed;color:var(--success)}
.badge.error{background:#fbecef;color:var(--danger)}
.account-status{min-width:54px;min-height:24px;justify-content:center;align-self:center}
.badge.warning{background:#fff4df;color:var(--warning)}
.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px}
.search,.log-search{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:0 12px;min-width:0}
.search svg,.log-search svg{width:17px;height:17px;color:var(--muted)}
.search .input,.log-search .input{border:0;background:none;padding-left:0;min-height:42px;box-shadow:none}
.search{flex:1;min-width:140px}
.search:focus-within,.log-search:focus-within{border-color:var(--blue)}
.segmented{display:flex;background:#eeeef2;border-radius:6px;padding:3px;gap:2px;min-width:0}
.segmented button{flex:1;min-height:36px;font-size:12px;white-space:nowrap;padding:6px 13px;color:var(--muted);border-radius:4px}
.segmented button.active{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #18181b0b;font-weight:650}
.result-label{display:flex;justify-content:space-between;align-items:center;padding:0 0 10px;font-size:11px;color:var(--muted)}
.field{display:block;min-width:0;margin-bottom:18px}
.field>span{display:block;font-weight:600;font-size:12px;margin-bottom:8px}
.input,.select,.textarea{width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1px solid #d5d5dc;border-radius:6px;background:var(--surface);font-size:14px}
.input::placeholder,.textarea::placeholder{color:#74747f;font-size:13px}
.select{padding-right:30px;text-overflow:ellipsis}
.textarea{resize:vertical;min-height:120px;line-height:1.7}
.hint{font-size:12px;color:var(--muted);line-height:1.65;margin-top:7px}
.filter-select{max-width:260px;margin:0}
.filter-select .select{font-size:12px}
.empty{padding:48px 12px;text-align:center}
.empty-icon{color:#777781;margin:0 auto 18px}
.empty-icon svg{width:34px;height:34px;stroke-width:1.4}
.empty h3{font-size:16px;font-weight:600}
.empty p{font-size:13px;color:var(--muted);max-width:330px;margin:9px auto 20px}
.route{padding:20px 0;align-items:center}
.route-line{display:grid;grid-template-columns:minmax(0,1fr) 28px minmax(0,1fr);grid-template-rows:auto auto;gap:5px 12px;align-items:center}
.route-line .channel{display:contents}
.channel>span{display:block;font-size:10px;color:var(--muted);grid-row:1;min-width:0}
.channel strong{font-size:14px;display:block;overflow-wrap:anywhere;font-weight:600;grid-row:2;min-width:0}
.channel:first-child>span,.channel:first-child>strong{grid-column:1}
.channel:last-child>span,.channel:last-child>strong{grid-column:3}
.route-arrow{color:var(--blue);grid-area:2/2;display:grid;place-items:center;min-height:24px;line-height:0}
.route-arrow svg{width:18px;height:18px}
.route-meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px;margin-top:12px}
.route-meta svg{width:12px;height:12px}
.route-meta .rule-label{margin-left:auto;color:var(--blue)}
.keyword-layout{display:grid;gap:24px}
.keyword-mode{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.keyword-mode strong{font-size:14px}
.keyword-mode p{font-size:12px;color:var(--muted);margin-top:5px}
.scope-box{margin-top:18px}
.switch{width:44px;height:26px;border-radius:20px;background:#cacad2;padding:3px;flex-shrink:0;position:relative}
.switch>span{display:block;width:20px;height:20px;background:white;border-radius:50%;box-shadow:0 1px 3px #18181b18;transition:transform .18s}
.switch.on{background:var(--blue)}
.switch.on>span{transform:translateX(18px)}
.keyword-entry-form{display:flex;align-items:stretch;gap:8px;margin-bottom:20px}
.keyword-entry{min-height:78px;resize:vertical;font-size:14px}
.keyword-entry-form button{width:44px;padding:0;flex-shrink:0}
.keyword-library{min-width:0;padding-bottom:70px}
.chips{display:flex;flex-wrap:wrap;gap:8px;align-content:flex-start;min-height:130px;padding:4px 0 24px}
.chip{display:inline-flex;align-items:center;gap:4px;background:#fff;border:1px solid var(--line);padding:3px 3px 3px 11px;border-radius:5px;max-width:100%;overflow-wrap:anywhere;font-size:13px}
.chip button{width:32px;height:32px;display:grid;place-items:center;flex-shrink:0;color:var(--muted);border-radius:3px}
.chip button:hover{background:#fbecef;color:var(--danger)}
.chip svg{width:14px;height:14px}
.keyword-savebar{position:fixed;left:20px;right:20px;bottom:calc(var(--nav-height) + var(--safe-bottom));z-index:19;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding:14px 0;background:var(--bg)}
.keyword-savebar strong{font-size:12px;display:block;color:var(--muted)}
.keyword-savebar.dirty strong{color:var(--warning)}
.keyword-savebar span{font-size:11px;display:block;color:var(--muted);margin-top:3px}
.keyword-save-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.keyword-save-actions .primary span{color:white;margin:0;font-size:12px}
.profile-layout{display:grid;gap:28px}
.profile-head{display:flex;align-items:center;gap:16px;padding:20px 0 26px;border-bottom:1px solid var(--line)}
.avatar{width:58px;height:58px;border-radius:8px;background:#eeeef2;color:var(--primary);display:grid;place-items:center;font-size:25px;flex-shrink:0;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.profile-head h2{font-size:20px}
.profile-head p{font-size:12px;color:var(--muted);margin-top:5px}
.license-line{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid var(--line);font-size:13px}
.license-line>span{color:var(--muted)}
.license-line strong{font-weight:600;overflow-wrap:anywhere}
.inline-form{display:flex;gap:8px;margin-top:16px}
.admin-grid{display:grid;grid-template-columns:1fr}
.module{display:flex;align-items:center;text-align:left;gap:16px;border-bottom:1px solid var(--line);padding:20px 0;min-width:0}
.module>svg:first-child{width:22px;height:22px;color:var(--primary)}
.module .module-copy{flex:1}
.module strong,.module span{display:block}
.module strong{font-size:15px;font-weight:600}
.module span{color:var(--muted);font-size:12px;margin-top:4px}
.module:hover{background:#f0f0f380}
.admin-context{display:flex;align-items:center;gap:12px;margin-bottom:20px;color:var(--muted);font-size:12px}
.admin-context .back-btn{width:34px;height:34px}
.settings-layout{display:grid;gap:22px}
.settings-section{border-top:1px solid var(--line);padding-top:22px;min-width:0}
.settings-section h2{font-size:14px;margin-bottom:18px}
.settings-actions{border-top:1px solid var(--line);padding-top:20px}
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:21px 0;border-bottom:1px solid var(--line)}
.toggle-row strong{font-size:14px;font-weight:600}
.toggle-row p{font-size:12px;color:var(--muted);margin-top:6px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.log-settings{display:grid;gap:14px;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line);padding-top:18px}
.log-settings .field{margin:0}
.log-settings button{grid-column:1/-1}
.file-date{font-size:14px;font-weight:600}
.file-name{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;color:var(--muted);overflow-wrap:anywhere;margin-top:5px}
.sheet-backdrop{position:fixed;inset:0;background:#18181b45;z-index:50;opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}
.sheet-backdrop.open{opacity:1;visibility:visible}
.sheet{position:fixed;bottom:0;left:0;right:0;z-index:51;background:var(--surface);padding:0 22px calc(22px + var(--safe-bottom));max-height:92dvh;overflow-y:auto;border-radius:12px 12px 0 0;overscroll-behavior:contain;transform:translateY(102%);visibility:hidden;transition:transform .22s,visibility .22s;box-shadow:0 10px 50px #18181b22}
.sheet.open{transform:translateY(0);visibility:visible}
.sheet[data-variant="full"],.sheet[data-variant="detail"]{top:0;border-radius:0;max-height:100dvh}
.sheet-grip{height:4px;width:30px;border-radius:4px;background:#dadae1;margin:10px auto 18px}
.sheet[data-variant="full"] .sheet-grip,.sheet[data-variant="detail"] .sheet-grip{display:none}
.sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 0;margin-bottom:24px;border-bottom:1px solid var(--line);background:var(--surface)}
.sheet-head>div{min-width:0}
.sheet-head h2{font-size:20px;overflow-wrap:anywhere}
.sheet-head p{font-size:12px;color:var(--muted);margin-top:7px;overflow-wrap:anywhere}
.sheet-actions{display:grid;gap:10px;margin-top:24px}
.sheet .stats{padding-top:4px}
.sheet .keyword-savebar{background:var(--surface)}
.action-list{margin-top:18px}
.action-item{display:flex;align-items:center;gap:12px;text-align:left;min-height:58px;padding:12px 0;width:100%;border-bottom:1px solid var(--line)}
.action-item span{flex:1;font-size:13px;font-weight:550}
.action-item>svg:last-child{width:16px;color:var(--muted)}
.action-item.danger{color:var(--danger)}
.detail-identity{display:flex;gap:14px;align-items:center;margin-bottom:24px}
.detail-identity h3{font-size:17px}
.detail-identity p{font-size:12px;color:var(--muted);margin-top:4px}
.detail-facts{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:20px 0;border-block:1px solid var(--line)}
.detail-facts span{font-size:11px;color:var(--muted);display:block}
.detail-facts strong{font-size:16px;font-weight:600;margin-top:6px;display:block}
.route-preview{background:#f4f4f6;padding:18px;border-left:2px solid var(--primary);margin-bottom:24px}
.replacement-grid{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr) 36px;gap:8px;align-items:center;margin-bottom:10px}
.replacement-grid>svg{width:16px;color:var(--muted)}
.replacement-grid .icon-btn{width:36px;height:40px;border:0;color:var(--danger)}
.replacement-grid .input{font-size:13px;padding:10px}
.form-footer{display:flex;gap:10px;justify-content:space-between;margin-top:28px;padding-top:20px;border-top:1px solid var(--line)}
.form-footer .danger-btn{width:44px;padding:0}
.channel-search{margin-bottom:18px}
.channel-summary{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;font-size:11px;color:var(--muted)}
.login-steps{display:flex;gap:8px;margin-bottom:24px}
.login-step{height:3px;flex:1;background:#e8e8ec}
.login-step.active{background:var(--primary)}
.log-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;padding:0 0 22px;border-bottom:1px solid var(--line)}
.log-summary strong{font-size:26px;font-weight:600;display:block}
.log-summary span{font-size:11px;color:var(--muted)}
.log-summary>div:nth-child(2) strong{color:var(--warning)}
.log-summary>div:nth-child(3) strong{color:var(--danger)}
.log-tools{display:grid;gap:12px;margin:18px 0}
.log-stream{border-top:1px solid var(--line)}
.log-entry{display:grid;grid-template-columns:26px minmax(0,1fr);gap:8px;padding:16px 0;border-bottom:1px solid var(--line)}
.log-symbol{color:var(--blue)}
.log-symbol svg{width:17px;height:17px}
.log-entry.warn .log-symbol{color:var(--warning)}
.log-entry.error .log-symbol{color:var(--danger)}
.log-meta{display:flex;align-items:center;flex-wrap:wrap;gap:9px;font-size:10px;margin-bottom:6px}
.log-level{font-weight:650}
.log-time{font-variant-numeric:tabular-nums;color:var(--muted)}
.log-module{margin-left:auto;color:var(--muted);background:#eeeef2;padding:2px 5px;border-radius:3px}
.log-message{font-size:12px;line-height:1.75;overflow-wrap:anywhere}
.log-extra{font:11px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;background:#f4f4f6;color:var(--muted);border-left:2px solid var(--line)}
.log-empty{text-align:center;color:var(--muted);padding:50px 12px;font-size:13px}
.loading{min-height:55dvh;display:grid;place-items:center;text-align:center;color:var(--muted);font-size:13px}
.fatal{min-height:85dvh;display:grid;place-items:center;padding:28px;text-align:center}
.fatal>div{max-width:390px}
.fatal h1{font-size:22px;margin-top:22px}
.fatal p{color:var(--muted);font-size:13px;margin:14px 0 24px}
.toast-region{position:fixed;bottom:calc(var(--nav-height) + var(--safe-bottom) + 14px);left:20px;right:20px;z-index:100;pointer-events:none}
.toast{max-width:500px;margin:auto;display:flex;align-items:center;gap:10px;background:#27272b;color:white;box-shadow:0 5px 20px #18181b25;padding:14px 17px;border-radius:8px;font-size:13px;animation:page-in .18s}
.toast.error{background:#8c3542}
.toast svg{width:18px;height:18px}
.connection-banner{position:fixed;top:0;left:0;right:0;display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;background:#fff4df;color:#93600d;z-index:110;font-size:12px}
.generated-keys{min-height:240px;font-family:ui-monospace,Consolas,monospace}
@media(min-width:760px){
 .page{padding:0 36px 36px}.main{padding-bottom:90px}
 .home-columns{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:36px}
 .health-overview{padding:28px 0}.stats{padding:30px 0}
 .keyword-layout{grid-template-columns:230px minmax(0,1fr);gap:36px}
 .keyword-layout .section-head{margin-top:0}
 .keyword-library{padding-bottom:0}.keyword-savebar{position:sticky;left:auto;right:auto}
 .profile-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:40px}
 .settings-layout{grid-template-columns:1fr 1fr;gap:36px}
 .sheet{left:auto;right:0;top:0;bottom:0;width:480px;max-height:100dvh;border-radius:0;transform:translateX(102%);padding:0 28px 28px}
 .sheet-grip{display:none}.sheet.open{transform:translateX(0)}
 .sheet[data-variant="full"]{width:560px}.sheet-head{padding-top:28px}
 .admin-grid{grid-template-columns:1fr 1fr;gap:0 32px}
 .log-settings{grid-template-columns:1fr 1fr auto;align-items:end}.log-settings button{grid-column:auto}
}
@media(min-width:1040px){
 .app-shell{display:grid;grid-template-columns:216px minmax(0,1fr)}
 .desktop-rail{display:flex;flex-direction:column;position:sticky;top:0;height:100dvh;background:#fff;border-right:1px solid var(--line);padding:26px 16px 20px}
 .desktop-rail:empty{visibility:hidden}
 .rail-brand{display:flex;align-items:center;gap:10px;padding:0 12px;margin-bottom:42px}
 .rail-brand strong{font-size:14px;display:block}.rail-brand small{font-size:10px;color:var(--muted)}
 .rail-label{color:#73737d;font-size:10px;padding:0 14px;margin:0 0 10px;font-weight:600}
 .rail-links{display:grid;gap:4px}.rail-links button{display:flex;align-items:center;gap:11px;border-radius:6px;min-height:44px;padding:10px 14px;color:var(--muted);text-align:left;font-size:13px}
 .rail-links button.active{background:#eef3ff;color:var(--blue);font-weight:650}
 .rail-links button:hover{background:#f4f4f6}.rail-links svg{width:17px;height:17px}
 .rail-admin{margin-top:32px}.rail-profile{margin-top:auto;border-top:1px solid var(--line);padding:20px 10px 0;display:flex;gap:10px;align-items:center;min-width:0}
 .rail-profile .avatar{width:32px;height:32px;font-size:14px}.rail-profile strong{font-size:12px;display:block}.rail-profile span{font-size:10px;color:var(--muted)}
 .rail-profile>div:last-child{min-width:0;overflow-wrap:anywhere}
 .nav{display:none!important}
 .main{padding:0 0 28px}
 .page{max-width:1180px;margin:auto;padding:0 44px 36px}
 .topbar{height:74px;margin-bottom:32px}
 .topbar .brand-mark,.topbar .brand-copy span{display:none}
 .topbar .brand-copy strong{font-size:12px;color:var(--muted);font-weight:500}
 .page-head{margin-bottom:30px}h1{font-size:28px}
 .toolbar .search{max-width:360px}
 .toast-region{left:236px;bottom:24px}
 .home-columns{gap:44px}.stats{max-width:720px}
 .keyword-layout{grid-template-columns:250px minmax(0,1fr);gap:48px}
 .keyword-savebar{position:sticky;bottom:0}
}
@media(max-width:400px){
 .page{padding-inline:16px}.page-head{gap:8px}h1{font-size:24px}
 .page-head .primary{padding:10px 12px;font-size:12px}
 .segmented button{padding:6px 10px}.toolbar{gap:10px}
 .route-line{gap:8px;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr)}
 .row{gap:9px}.account-rule-count{display:none}
 .keyword-savebar span{max-width:160px}.keyword-save-actions{gap:8px}
 .sheet{padding-inline:18px}.replacement-grid{gap:5px;grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr) 30px}
}
body,.app-shell{background:var(--bg)}
.topbar{border-color:var(--line)}
.brand-mark{background:var(--blue);border-radius:10px;box-shadow:0 5px 14px #356fe529}
.brand-copy span{letter-spacing:0;color:#71809a}
.topbar-meta{color:#65738a}
.sync-indicator{width:8px;height:8px;box-shadow:0 0 0 4px #4fce9128}
.topbar-meta[data-connection="connecting"] .sync-indicator,.topbar-meta[data-connection="retrying"] .sync-indicator{background:var(--warning);box-shadow:0 0 0 4px #aa571318}
.topbar-meta[data-connection="offline"] .sync-indicator,.topbar-meta[data-connection="unavailable"] .sync-indicator,.topbar-meta[data-connection="timeout"] .sync-indicator{background:var(--danger);box-shadow:0 0 0 4px #b9383818}
.connection-label{white-space:nowrap}
.connection-banner>span{min-width:0}
.connection-banner .text-btn{flex-shrink:0;color:inherit;padding:0 5px;min-height:28px}
.primary{background:var(--primary);border-color:var(--primary);border-radius:10px;box-shadow:0 4px 12px #2f63d21c}
.primary:hover:not(:disabled){background:var(--primary-hover)}
.secondary{background:#fff;border-color:#d5e0f1;border-radius:10px}
.secondary:hover:not(:disabled){background:#f2f6ff}
.danger-btn{border-radius:10px}
.icon-btn,.back-btn{background:#fff;border-color:#dce5f3;border-radius:10px}
.icon-btn:hover,.back-btn:hover{background:#edf3ff}
.text-btn{color:var(--primary)}
.nav{background:#fffffffa;border-top-color:#e2e9f4;box-shadow:0 -5px 22px #1d31520b;padding-inline:12px}
.nav button{border-radius:12px;color:#6c7a91;gap:3px}
.nav button.active{color:var(--primary)}
.nav button.active:before{display:none}
.nav button.active svg{width:34px;height:34px;padding:6px;border-radius:11px;background:var(--accent);stroke-width:2.2}
.section-head{margin-top:30px;margin-bottom:14px}
.section-head h2{color:#1c2a40}
.health-overview{position:relative;overflow:hidden;background:#2f63d2;color:#fff;border:0;border-radius:18px;padding:23px 22px;margin:0 0 16px;box-shadow:0 12px 25px #2f63d226}
.health-title>svg,.health-title.warning>svg,.health-title.danger>svg{color:#a9d5ff;width:25px;height:25px}
.health-title h2{font-size:19px;color:#fff}
.health-overview p{color:#e2ebff;margin-top:8px}
.health-track{background:#ffffff42;border-radius:8px;height:6px;margin-top:20px}
.health-track span{background:#55d89b;border-radius:8px}
.health-track .down{background:#ffc66e}
.health-track .failed{background:#ff9292}
.health-legend{color:#dce7ff;margin-top:11px}
.stats{gap:10px;padding:0 0 22px;border:0}
.stat{background:#fff;border:1px solid #e1e9f6;border-radius:14px;padding:14px 12px;box-shadow:0 4px 10px #253a5b08}
.stat+.stat{border-left:1px solid #e1e9f6;padding-left:12px}
.stat strong{font-size:25px;color:#1c2b42}
.stat span{color:#64738b;font-size:11px}
.home-columns{gap:28px}
.section-head .text-btn{white-space:nowrap}
.list{border:1px solid #e0e8f5;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 4px 12px #253a5b08}
.row{padding:14px 15px;border-color:#edf1f8;background:#fff}
.row:last-child{border-bottom:0}
button.row:hover{background:#f7faff}
.row-icon,.account-avatar{background:#eef3fc;color:#64738b;border-radius:11px}
.row-icon.accent,.account-avatar.online{background:#e4edff;color:var(--primary)}
.badge{background:#edf1f7;color:#63738c;border-radius:6px}
.badge.online,.badge.good{background:#e5f7ee;color:#27704e}
.badge.warning{background:#fff2db;color:#92520d}
.badge.error{background:#ffebeb;color:#a32934}
.account-rule-count{border-color:#e1e8f2}
.policy-line{background:#fff;border:1px solid #e1e9f6;border-radius:13px;padding:14px 15px;margin:0 0 9px;box-shadow:0 3px 10px #253a5b07}
.policy-line:hover{background:#f8faff}
.policy-line .row-icon{width:42px;height:42px}
.search,.log-search{border-color:#dce5f3;border-radius:10px;background:#fff}
.search:focus-within,.log-search:focus-within{border-color:var(--blue)}
.segmented{background:#e9effa;border-radius:10px}
.segmented button{border-radius:8px}
.segmented button.active{color:var(--primary);box-shadow:0 2px 6px #253a5b12}
.input,.select,.textarea{border-color:#d5e0ef;border-radius:9px;background:#fff}
.input::placeholder,.textarea::placeholder{color:#74829a}
.switch.on{background:var(--blue)}
.chip{border-color:#dce5f3;background:#fff;border-radius:8px}
.keyword-savebar{border-color:#e1e8f2;background:#f5f8ff}
.profile-head .avatar{background:#e4edff;color:var(--primary);border-radius:14px}
.module{border-color:#e2e9f4}
.module:hover{background:#f7faff}
.admin-context .back-btn{background:#fff}
.sheet-backdrop{background:#10213c60}
.sheet{background:#faffff;border:1px solid #dce5f3;border-bottom:0;border-radius:18px 18px 0 0;box-shadow:0 12px 50px #12294a26}
.sheet-head{background:#faffff}
.sheet-grip{background:#cbd8ec}
.route-preview{background:#eff4ff;border-color:var(--blue);border-radius:10px}
.login-step.active{background:var(--blue)}
.log-module{background:#edf2fa}
.log-extra{background:#f2f6fd;border-color:#dce5f3}
.toast{background:#1b2b45;border-radius:11px;box-shadow:0 8px 24px #12294a30}
.connection-banner{background:#fff3dc;color:#8a510d}
.desktop-rail{background:#fbfdff;border-color:#e0e8f5}
.rail-links button{border-radius:10px}
.rail-links button.active{background:#e6eeff;color:var(--primary)}
.rail-links button:hover{background:#f0f5ff}
.rail-label{color:#73819a}
.rail-profile{border-color:#e2e9f4}
.link-filter-panel{background:transparent;border:0;border-radius:0;padding:0;margin:0 0 26px;box-shadow:none}
.filter-tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin-bottom:24px}
.filter-tabs button{display:flex;align-items:center;gap:7px;min-height:48px;background:none;border:0;border-bottom:2px solid transparent;color:var(--muted);font:inherit;font-weight:600;padding:8px 0}
.filter-tabs button svg{width:18px;height:18px}
.filter-tabs button[aria-selected="true"]{color:var(--primary);border-bottom-color:var(--primary)}
.filter-test{border-top:1px solid var(--line);padding-top:4px}
.filter-test>label{display:block;font-size:13px;margin-bottom:8px;color:var(--muted)}
.filter-test-result{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;font-size:13px}
.filter-test-result output{min-width:0;overflow-wrap:anywhere}
.filter-test-result button{flex-shrink:0}
.filter-blocked{color:var(--danger)}.filter-passed{color:var(--success)}
.link-filter-heading{display:flex;align-items:center;gap:12px;min-width:0}
.link-filter-mark{width:42px;height:42px;display:grid;place-items:center;flex-shrink:0;border-radius:12px;background:#e4edff;color:var(--primary)}
.link-filter-mark svg{width:21px;height:21px}
.link-filter-title{flex:1;min-width:0}
.link-filter-title h2{font-size:16px;color:#1b2b42}
.link-filter-title p{font-size:12px;color:#64738b;margin-top:3px;overflow-wrap:anywhere}
.link-filter-limit{display:flex;align-items:center;gap:9px;margin:16px 0;padding:13px 0;border-block:1px solid #e8eef7;font-size:13px}
.link-filter-limit label{font-weight:600;white-space:nowrap}
.link-filter-limit .input{width:74px;min-height:40px;text-align:center;padding:7px}
.link-filter-limit>span{color:#64738b;min-width:0}
.link-rule-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px;font-size:13px}
.link-rule-heading span{color:#71809a;font-size:11px}
.link-rule-heading .text-btn{margin-left:auto;font-size:12px}
.link-rule-list{display:grid;gap:8px}
.link-rule-row{display:grid;grid-template-columns:minmax(0,1fr) auto 40px;gap:7px;align-items:center}
.link-rule-row .input{min-height:40px;padding:8px 10px;font:12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace}
.link-rule-row textarea{resize:vertical;overflow-wrap:anywhere;min-width:0}
.regex-toggle{display:inline-flex;align-items:center;gap:5px;color:#64738b;font-size:11px;white-space:nowrap;cursor:pointer}
.regex-toggle input{accent-color:var(--primary);width:15px;height:15px;margin:0}
.link-rule-remove{width:40px;height:40px;color:#708099}
.link-rule-remove:hover{color:var(--danger);background:#fff0f0}
.link-rule-add{display:grid;grid-template-columns:minmax(0,1fr) auto 42px;gap:8px;align-items:center;margin-top:12px}
.link-rule-add .secondary{width:42px;height:42px;min-height:42px;padding:0}
.link-rule-add .secondary svg{width:18px;height:18px}
.link-rule-section .hint{margin-top:9px}
.link-filter-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #e8eef7;margin-top:17px;padding-top:14px}
.link-filter-footer strong,.link-filter-footer span{display:block;font-size:11px}
.link-filter-footer strong{color:#64738b}
.link-filter-footer span{color:#7b899f;margin-top:3px}
.link-filter-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.link-filter-actions .primary{min-height:40px;padding:8px 12px;font-size:12px}
.link-filter-actions .primary svg{width:15px;height:15px}
@media(min-width:760px){
 .page{padding-inline:36px}
 .health-overview{padding:28px 30px}
 .stats{gap:14px;padding-bottom:28px}
 .stat{padding:17px 18px}
 .stat+.stat{padding-left:18px}
 .link-filter-panel{padding:0}
 .link-filter-limit{max-width:440px}
 .link-rule-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:1040px){
 .desktop-rail{background:#f9fbff}
 .main{background:var(--bg)}
 .health-overview{border-radius:20px}
 .list,.policy-line,.stat{box-shadow:0 5px 14px #253a5b08}
}
@media(max-width:400px){
 .link-filter-panel{padding:0}
 .link-filter-limit{gap:6px;font-size:12px}
 .link-filter-limit .input{width:62px}
 .link-rule-row{grid-template-columns:minmax(0,1fr) auto 36px;gap:5px}
 .link-rule-remove{width:36px;height:38px}
 .link-rule-row .input{font-size:11px;padding-inline:8px}
 .link-rule-add{grid-template-columns:minmax(0,1fr) auto 38px;gap:5px}
 .link-rule-add .secondary{width:38px;height:40px;min-height:40px}
 .link-filter-actions{gap:5px}
 .link-filter-actions .primary{padding-inline:9px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
