/* Appearance palettes. Ocean retains Horizon's existing colors and geometry. */
:root{--appearance-shadow:0 24px 80px #0005}
:root[data-theme="graphite"]{
  color-scheme:dark;
  --bg:#141517;--bg-deep:#101113;--panel:#1d1f23;--panel-2:#272a30;--field:#17191d;
  --line:#343840;--line-strong:#525b68;--text:#eef0f4;--text-sub:#bac1cc;--text-muted:#9aa5b5;
  --primary:#9dbcf6;--primary-hover:#c6d8fc;--primary-ink:#15233b;--primary-plain:#29364a;--primary-border:#536b8c;
  --success:#81dfba;--success-plain:#183c30;--success-border:#36745b;
  --danger:#ff9ba8;--danger-plain:#41262e;--danger-border:#83505b;
  --warning:#edcc95;--warning-plain:#3c3325;--warning-border:#7b694a;
  --purple:#c5b8ff;--info:#acb8c9;
  --sidebar-bg:#17191d;--sidebar-text:var(--text-sub);--sidebar-text-active:var(--text);--sidebar-active:#29364a;
  --theme-hero-start:#292e37;--theme-hero-end:#1d2026;--theme-hover:#303640;
  --appearance-shadow:0 24px 80px #0006;
}
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f6f7f9;--bg-deep:#eef0f3;--panel:#ffffff;--panel-2:#f7f8fa;--field:#ffffff;
  --line:#e4e7ec;--line-strong:#cbd1da;--text:#202938;--text-sub:#495465;--text-muted:#697586;
  --primary:#2563eb;--primary-hover:#1d4ed8;--primary-ink:#ffffff;--primary-plain:#edf4ff;--primary-border:#b5cdfb;
  --success:#116849;--success-plain:#e7f5ed;--success-border:#9dceb5;
  --danger:#aa263e;--danger-plain:#fff0f2;--danger-border:#e8a8b4;
  --warning:#805400;--warning-plain:#fff5dc;--warning-border:#dbbf7d;
  --purple:#6755af;--info:#536984;
  --sidebar-bg:#ffffff;--sidebar-text:var(--text-sub);--sidebar-text-active:var(--primary);--sidebar-active:#edf4ff;
  --theme-hero-start:#f7f9fc;--theme-hero-end:#ffffff;--theme-hover:#f7f9fc;
  --appearance-shadow:0 24px 80px #1a355a22;
}
:root[data-theme]:not([data-theme="ocean"]){--page-bg:var(--bg);--card-bg:var(--panel);--border:var(--line)}

/* Small, keyboard-accessible picker; theme samples stay literal by design. */
.appearance-trigger{height:35px;display:flex;align-items:center;gap:8px;padding:0 11px;background:var(--panel);border:1px solid var(--line-strong);border-radius:8px;color:var(--text-sub);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
.appearance-trigger svg{width:17px;height:17px;color:var(--primary)}
.appearance-trigger:hover{color:var(--text);border-color:var(--primary)}
.appearance-open{overflow:hidden}
.appearance-dialog{margin:auto;padding:0;width:min(550px,calc(100vw - 28px));max-height:85dvh;overflow:auto;border:1px solid var(--line-strong);border-radius:15px;background:var(--panel);color:var(--text);box-shadow:var(--appearance-shadow)}
.appearance-dialog::backdrop{background:#09132180;backdrop-filter:blur(5px)}
.appearance-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:25px 25px 20px}
.appearance-heading h2{font-size:20px;font-weight:600;margin:0 0 7px;color:var(--text)}
.appearance-heading p{font-size:12px;color:var(--text-muted);line-height:1.7}
.appearance-options{border:0;margin:0;padding:0 25px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.appearance-option{position:relative;display:flex;flex-direction:column;gap:7px;min-width:0;border:1px solid var(--line-strong);border-radius:10px;padding:10px;background:var(--panel);cursor:pointer}
.appearance-option:has(input:checked){border-color:var(--primary);box-shadow:0 0 0 1px var(--primary);background:var(--primary-plain)}
.appearance-option:focus-within{outline:2px solid var(--primary);outline-offset:4px}
.appearance-option>input{position:absolute;right:12px;bottom:27px;width:14px;height:14px;accent-color:var(--primary)}
.appearance-choice-title{font-size:13px;font-weight:600;color:var(--text);padding-right:22px}
.appearance-option>small{font-size:10px;color:var(--text-muted)}
.appearance-preview{height:78px;position:relative;display:block;border-radius:5px;background:var(--sample-bg);border:1px solid var(--sample-line);overflow:hidden;margin-bottom:4px}
.preview-ocean{--sample-bg:#080f1c;--sample-panel:#172d43;--sample-line:#365373;--sample-accent:#70d8fa}
.preview-graphite{--sample-bg:#141517;--sample-panel:#2a2d33;--sample-line:#535a66;--sample-accent:#9dbcf6}
.preview-light{--sample-bg:#f3f6fb;--sample-panel:#fff;--sample-line:#c5d2e4;--sample-accent:#1463b0}
.appearance-preview>i{position:absolute;inset:0 auto 0 0;width:22%;background:var(--sample-panel);border-right:1px solid var(--sample-line)}
.appearance-preview>b{position:absolute;left:31%;right:9%;top:12px;height:18px;background:var(--sample-panel);border:1px solid var(--sample-line);border-radius:3px}
.appearance-preview>em{position:absolute;left:31%;top:40px;width:29%;height:21px;border-radius:3px;background:var(--sample-accent);opacity:.8}
.appearance-status{padding:19px 25px 16px;font-size:11px;color:var(--text-muted);line-height:1.7;min-height:50px}
.appearance-foot{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 25px;border-top:1px solid var(--line);background:var(--panel-2)}
.appearance-foot>span{font-size:11px;color:var(--text-muted);line-height:1.8}
.appearance-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:768px){.appearance-trigger{width:35px;padding:0;justify-content:center}.appearance-trigger>span{display:none}}
@media(max-width:460px){.appearance-heading{padding:22px 18px 18px}.appearance-options{padding:0 18px;gap:9px}.appearance-option{padding:8px}.appearance-preview{height:67px}.appearance-choice-title{font-size:12px}.appearance-option>small{font-size:9px}.appearance-status{padding:17px 18px}.appearance-foot{padding:15px 18px;gap:12px}.appearance-option>input{right:8px;bottom:25px}}

/* Shared surfaces. All overrides are palette-scoped, so Ocean stays unchanged. */
html[data-theme]:not([data-theme="ocean"]) body{background:var(--bg);color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) ::selection{background:var(--primary);color:var(--primary-ink)}
html[data-theme]:not([data-theme="ocean"]) ::-webkit-scrollbar-thumb{background-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.sidebar,.header){background:var(--sidebar-bg);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) .logo{border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(.logo-text,.breadcrumb b,.user-name){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.logo-text small,.breadcrumb,.breadcrumb-context,.breadcrumb-divider,.header-context,.user-company,.account-chevron){color:var(--text-muted);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(.menu-title,.menu-title>.menu-ico,.menu-sub a,.menu-sub a .sub-ico,.menu-title .menu-arrow){color:var(--sidebar-text)}
html[data-theme]:not([data-theme="ocean"]) :is(.menu-title:hover,.menu-sub a:hover,.menu>.menu-item.open:not(.active)>.menu-title){background:var(--panel-2);color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.menu-item.active>.menu-title,.menu-item.active>.menu-title:hover,.menu-sub a.active){background:var(--sidebar-active);color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) :is(.menu-item.active>.menu-title>.menu-ico,.menu-sub a.active .sub-ico){color:var(--primary)}
html[data-theme] .menu>.menu-item.active:has(>.menu-sub)>.menu-title{background:transparent;color:var(--text);box-shadow:none;font-weight:600}
html[data-theme] .menu>.menu-item.active:has(>.menu-sub)>.menu-title>.menu-ico{color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) .menu-sub{border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(.sidebar-footer,.account-panel,.table-card,.card,.agency-resources,.stat-card,.dml-stat-card,.filter-bar,.conversation-stat,.conversation-status,.workspace-navigation,.login-card){background:var(--panel);border-color:var(--line);box-shadow:none;color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.sidebar-footer strong,.account-panel>strong,.account-panel dd,.conversation-scope-title>strong,.conversation-stat>strong,.conversation-section-title>strong){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.sidebar-footer small,.account-panel>small,.account-panel dt,.conversation-scope-title>span,.conversation-stat>small,.conversation-stat-index,.conversation-metric-note,.conversation-section-title>span){color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) :is(.sidebar-help,.account-panel-eyebrow){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .sidebar-help:hover{color:var(--primary-hover)}
html[data-theme]:not([data-theme="ocean"]) :is(.account-panel dl,.conversation-tabs,.reply-detail-head){border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(.user-chip:hover,.account-menu[open]>summary,.account-panel>button:hover){background:var(--panel-2);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) .account-panel>button{color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) .account-panel>button.account-signout{color:var(--danger)}
html[data-theme]:not([data-theme="ocean"]) :is(.avatar,.stat-ico,.record-avatar,.navigation-result-icon){background:var(--primary-plain);border-color:var(--primary-border);color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) :is(.agency-heading,.customer-timeline-hero,.navigation-heading){background:linear-gradient(110deg,var(--theme-hero-start),var(--theme-hero-end));border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) #page-head h1,
html[data-theme]:not([data-theme="ocean"]) :is(.agency-heading h1,.customer-timeline-hero h3,.customer-timeline-event-head h4,.navigation-heading h2){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) #page-head p,
html[data-theme]:not([data-theme="ocean"]) :is(.agency-heading p,.customer-timeline-hero p,.page-eyebrow,.navigation-heading span){color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) :is(.agency-eyebrow,.horizon-orbit span,.card-tag){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .agency-scope{background:var(--panel);border-color:var(--line-strong);color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority{background:var(--panel);border-color:var(--line);box-shadow:none;--metric:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority:nth-child(2){--metric:var(--purple)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority:nth-child(3){--metric:var(--success)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority:nth-child(4){--metric:var(--warning)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority:hover{background:var(--panel-2);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.agency-priority strong,.pager-summary strong,.record-copy strong,.record-quota strong,.card-head h2){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.agency-section-label,.agency-priority-top,.agency-resources summary,.conversation-stat>span:not(.conversation-stat-index)){color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) :is(.agency-section-label span,.agency-priority-bottom,.agency-metric-note,.stat-card .lbl,.dml-stat-label,.dml-stat-sub,.pagination,.pager-summary,.pager-position,.pager-ellipsis,.empty,.desc-label){color:var(--text-muted);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) .agency-priority-index{border-color:var(--line-strong)}

/* Tables, status colors, filters, popups and controls share the same palette. */
html[data-theme]:not([data-theme="ocean"]) :is(th,.card-head,.modal-head,.desc-label,.navigation-foot){background:var(--panel-2);color:var(--text-sub);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) td{color:var(--text-sub);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(tbody tr:hover,tbody tr:focus-within){background:var(--theme-hover)}
html[data-theme]:not([data-theme="ocean"]) tbody tr:has(input[type=checkbox]:checked){background:var(--primary-plain)}
html[data-theme]:not([data-theme="ocean"]) .table-card{scrollbar-color:var(--line-strong) var(--panel)}
html[data-theme]:not([data-theme="ocean"]) :is(.table-card:has(#lu-tbody),.table-card:has(#lp-tbody)) th:last-child{background:var(--panel-2);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(#lu-tbody,#lp-tbody) td:last-child:not([colspan]){background:var(--panel);border-color:var(--line);box-shadow:none}
html[data-theme]:not([data-theme="ocean"]) :is(.record-copy small,.record-muted,.record-contact small,.record-contact i,.record-handle,.record-time small,.record-export>small,.record-counts small,.record-quota small,.record-quota>small,.acc-cell span,.toolbar .hint,.form-row .hint){color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) :is(.record-time,.record-counts>span+span strong,.acc-cell,.content-snap,.desc-value,.reply-message-preview,.customer-timeline-event>p){color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) :is(.record-file .record-copy>a,.record-counts strong,.reply-message-preview>span){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) #lu-tbody .record-note{color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) .record-quota progress{background:var(--line);color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .record-quota progress::-webkit-progress-bar{background:var(--line)}
html[data-theme]:not([data-theme="ocean"]) .record-quota progress::-webkit-progress-value{background:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .record-quota progress::-moz-progress-bar{background:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .record-quota.quota-full progress::-webkit-progress-value{background:var(--warning)}
html[data-theme]:not([data-theme="ocean"]) .record-quota.quota-full progress::-moz-progress-bar{background:var(--warning)}
html[data-theme]:not([data-theme="ocean"]) :is(.record-status,.tag-info,.tag-muted,.dm-badge.pending,.dm-badge.canceled){color:var(--text-muted);background:var(--panel-2);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.status-ready,.customer-timeline-readonly,.kw-chip){color:var(--primary);background:var(--primary-plain);border-color:var(--primary-border)}
html[data-theme]:not([data-theme="ocean"]) :is(.status-success,.dm-badge.success,.dm-badge.sent){color:var(--success);background:var(--success-plain);border-color:var(--success-border)}
html[data-theme]:not([data-theme="ocean"]) :is(.status-warn,.dm-badge.sending){color:var(--warning);background:var(--warning-plain);border-color:var(--warning-border)}
html[data-theme]:not([data-theme="ocean"]) :is(.dm-badge.failed,.dm-op-btn.cancel){color:var(--danger);background:var(--danger-plain);border-color:var(--danger-border)}
html[data-theme]:not([data-theme="ocean"]) .dm-dot{background:currentColor;box-shadow:none}
html[data-theme]:not([data-theme="ocean"]) .dml-stat-num.green{color:var(--success)}
html[data-theme]:not([data-theme="ocean"]) :is(.dml-stat-num.orange,.record-quota.quota-full>small){color:var(--warning)}
html[data-theme]:not([data-theme="ocean"]) :is(.dml-stat-num.red,.fail-reason){color:var(--danger)}
html[data-theme]:not([data-theme="ocean"]) :is(.stat-card.cyan .num,.stat-card.cyan .stat-ico){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .conversation-error{color:var(--warning)!important}
html[data-theme]:not([data-theme="ocean"]) :is(.toolbar strong,.modal-head){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.filter-bar label,.form-row label){color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){color:var(--text);background-color:var(--field);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(input,textarea)::placeholder{color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) :is(input,select,textarea):focus{border-color:var(--primary);box-shadow:none}
html[data-theme]:not([data-theme="ocean"]) :is(input,select,textarea):disabled{color:var(--text-muted)!important;background-color:var(--panel-2)!important}
html[data-theme]:not([data-theme="ocean"]) :is(input[type=checkbox],input[type=radio]){accent-color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) :is(.btn,.page-btn,.icon-btn,.workspace-search-trigger){background:var(--panel);color:var(--text-sub);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.btn,.page-btn,.icon-btn,.workspace-search-trigger):hover:not(:disabled){background:var(--theme-hover);color:var(--text);border-color:var(--primary-border)}
html[data-theme]:not([data-theme="ocean"]) .conversation-presets .btn[aria-pressed="true"],html[data-theme]:not([data-theme="ocean"]) .conversation-presets .btn[aria-pressed="true"]:hover{background:var(--primary);border-color:var(--primary);color:var(--primary-ink);font-weight:600}
html[data-theme]:not([data-theme="ocean"]) :is(.btn-primary,.page-btn.active,.login-btn){background:var(--primary);border-color:var(--primary);color:var(--primary-ink);box-shadow:none}
html[data-theme]:not([data-theme="ocean"]) :is(.btn-primary,.page-btn.active,.login-btn):hover:not(:disabled){background:var(--primary-hover);color:var(--primary-ink);border-color:var(--primary-hover)}
html[data-theme]:not([data-theme="ocean"]) :is(.btn-primary-plain,.fab){background:var(--primary-plain);color:var(--primary);border-color:var(--primary-border)}
html[data-theme]:not([data-theme="ocean"]) .btn-link{background:none;border:0;color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .btn-link.danger{color:var(--danger)}
html[data-theme]:not([data-theme="ocean"]) .btn-danger-plain{background:var(--danger-plain);color:var(--danger);border-color:var(--danger-border)}
html[data-theme]:not([data-theme="ocean"]) .btn-success-plain{background:var(--success-plain);color:var(--success);border-color:var(--success-border)}
html[data-theme]:not([data-theme="ocean"]) .btn-warning-plain{background:var(--warning-plain);color:var(--warning);border-color:var(--warning-border)}
html[data-theme]:not([data-theme="ocean"]) :is(.btn,.page-btn,.login-btn):disabled{background:var(--panel-2);color:var(--text-muted);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) .alert{background:var(--primary-plain);color:var(--primary);border-color:var(--primary-border)}
html[data-theme]:not([data-theme="ocean"]) .modal{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--appearance-shadow)}
html[data-theme]:not([data-theme="ocean"]) .modal-foot{background:var(--panel-2);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) .modal-close{color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) .modal-close:hover{color:var(--text);background:var(--theme-hover)}
html[data-theme]:not([data-theme="ocean"]) input[type=file]::file-selector-button,
html[data-theme]:not([data-theme="ocean"]) kbd{background:var(--panel-2);color:var(--text-sub);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.navigation-search,.reply-message-body){background:var(--field);color:var(--text);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) :is(.navigation-search svg,.workspace-search-trigger svg){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .navigation-result{color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) .navigation-result:hover,
html[data-theme]:not([data-theme="ocean"]) .navigation-result:focus-visible{background:var(--theme-hover);border-color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) :is(.navigation-caption,.navigation-result-copy small,.navigation-result-tail,.navigation-empty p,.customer-timeline-status,.customer-timeline-event-head .time-cell,.customer-timeline-meta,.customer-timeline-empty){color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) .conversation-tabs>button{color:var(--text-sub)}
html[data-theme]:not([data-theme="ocean"]) .conversation-tabs>button>span{color:var(--text-muted)}
html[data-theme]:not([data-theme="ocean"]) .conversation-tabs>button:hover{background:var(--theme-hover);color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) .conversation-tabs>button[aria-selected=true]{color:var(--primary);background:transparent}
html[data-theme]:not([data-theme="ocean"]) .conversation-tabs>button[aria-selected=true]::after{background:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .customer-timeline-event{border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) .customer-timeline-event:last-child{border-color:transparent}
html[data-theme]:not([data-theme="ocean"]) .customer-timeline-node{background:var(--primary);box-shadow:0 0 0 5px var(--panel)}
html[data-theme]:not([data-theme="ocean"]) #login-page{background:var(--bg);color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.login-brand-name,.login-intro h2,.login-card h1){color:var(--text)}
html[data-theme]:not([data-theme="ocean"]) :is(.login-brand-name small,.login-intro p,.login-metrics,.login-card .sub,.login-foot,.login-corner){color:var(--text-muted);border-color:var(--line)}
html[data-theme]:not([data-theme="ocean"]) :is(.login-intro h2 strong,.login-kicker){color:var(--primary)}
html[data-theme]:not([data-theme="ocean"]) .login-card .form-row input:not([type=radio]):not([type=checkbox]):not([type=file]){background:var(--field);color:var(--text);border-color:var(--line-strong)}
html[data-theme]:not([data-theme="ocean"]) .login-card .form-row label svg{color:var(--text-muted)}

/* Capability policy editor: compact settings cards across every palette. */
.tp-panel{margin-bottom:20px;padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.tp-panel-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:18px;margin-bottom:20px}
.tp-panel-title{display:flex;flex-direction:column;gap:5px}
.tp-panel-title strong{color:var(--text);font-size:17px;font-weight:600;line-height:1.4}
.tp-panel-title>span{color:var(--text-muted);font-size:11px;line-height:1.5}
.tp-panel-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tp-panel-actions>label{color:var(--text-sub);font-size:12px;white-space:nowrap}
.tp-panel-actions>select{width:190px;max-width:100%;height:36px;padding:0 10px;border:1px solid var(--line-strong);border-radius:7px;background:var(--field);color:var(--text);font:inherit;font-size:12px}
.tp-policy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.tp-policy-card{min-width:0;padding:17px 18px 13px;border:1px solid var(--line);border-radius:10px;background:var(--panel-2);transition:border-color .15s ease,box-shadow .15s ease}
.tp-policy-card:hover,.tp-policy-card:focus-within{border-color:var(--line-strong)}
.tp-policy-card:focus-within{box-shadow:0 0 0 2px var(--primary-border)}
.tp-policy-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-height:47px}
.tp-policy-identity{display:flex;flex-direction:column;gap:2px;min-width:0}
.tp-policy-identity strong{font-size:13px;font-weight:600;color:var(--text);line-height:1.5;overflow-wrap:anywhere}
.tp-policy-identity code{font-family:var(--font-num);font-size:10px;color:var(--text-muted);overflow-wrap:anywhere}
.tp-toggle{display:flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;color:var(--text-muted);font-size:11px;line-height:1.4}
.tp-toggle:has(input:disabled){cursor:default}
.tp-toggle input.tp-enabled{appearance:none;-webkit-appearance:none;position:relative;width:34px;height:20px;margin:0;border:1px solid var(--line-strong);border-radius:20px;background:var(--line-strong);cursor:inherit;transition:background .15s ease,border-color .15s ease}
.tp-toggle input.tp-enabled::before{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:var(--panel);box-shadow:0 1px 2px #0003;transition:transform .15s ease}
.tp-toggle input.tp-enabled:checked{background:var(--primary);border-color:var(--primary)}
.tp-toggle input.tp-enabled:checked::before{transform:translateX(14px);background:var(--primary-ink)}
.tp-toggle input.tp-enabled:focus-visible{outline:2px solid var(--primary);outline-offset:3px}
.tp-toggle-text::after{content:"未启用"}
.tp-toggle:has(input:checked){color:var(--text-sub)}
.tp-toggle:has(input:checked) .tp-toggle-text::after{content:"已启用"}
.tp-policy-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 14px}
.tp-policy-field{display:flex;flex-direction:column;gap:7px;min-width:0;color:var(--text-sub);font-size:11px}
.tp-number-wrap{display:flex;align-items:center;min-width:0;height:36px;border:1px solid var(--line-strong);border-radius:7px;background:var(--field);overflow:hidden}
.tp-number-wrap:focus-within{border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-border)}
.tp-number-wrap input{width:100%;min-width:0;height:100%;padding:0 9px;border:0!important;border-radius:0;background:transparent!important;color:var(--text)!important;outline:0;box-shadow:none!important;font:inherit;font-size:13px;font-variant-numeric:tabular-nums}
.tp-number-wrap input:disabled{color:var(--text-muted)!important;cursor:not-allowed}
.tp-number-wrap input::-webkit-outer-spin-button,.tp-number-wrap input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.tp-number-wrap input[type=number]{appearance:textfield;-moz-appearance:textfield}
.tp-number-wrap small{flex-shrink:0;padding:0 10px;border-left:1px solid var(--line);color:var(--text-muted);font-size:10px;white-space:nowrap}
.tp-policy-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:11px;border-top:1px solid var(--line);font-size:10px;color:var(--text-muted);font-variant-numeric:tabular-nums}
.tp-policy-meta span:last-child{text-align:right;overflow-wrap:anywhere}
.tp-panel-note{margin:16px 0 0;color:var(--text-muted);font-size:11px;line-height:1.6}
.tp-empty{grid-column:1/-1;margin:0;padding:28px 15px;text-align:center;color:var(--text-muted);font-size:12px}
html[data-theme="light"] .tp-policy-card{background:var(--panel);box-shadow:0 2px 10px #1a355a08}
@media(min-width:1800px){.tp-policy-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1120px){.tp-policy-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.tp-panel{padding:16px}.tp-policy-grid{grid-template-columns:1fr}.tp-panel-actions{width:100%}.tp-panel-actions>select{width:auto;flex:1;min-width:100px}.tp-policy-card{padding:16px}}
