@import url("ui-tokens.css");
:root, html[data-ui-preset] {
  --ps-bg:var(--vo-surface-0); --ps-panel:var(--vo-surface-1); --ps-card:var(--vo-surface-2); --ps-border:var(--vo-border-subtle);
  --ps-text:var(--vo-text-1); --ps-muted:var(--vo-text-3); --ps-accent:var(--vo-accent); --ps-blue:var(--vo-info);
  --ps-green:var(--vo-success); --ps-red:var(--vo-danger); --ps-shadow:var(--vo-shadow-3);
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--ps-bg); color:var(--ps-text); font: 14px/1.5 var(--vo-font-ui); }
button,input,select { font: inherit; }
.ps-header { display:flex; align-items:center; gap:18px; padding:18px 24px; border-bottom:1px solid var(--ps-border); background:color-mix(in srgb,var(--ps-panel) 92%,transparent); position:sticky; top:0; z-index:3; backdrop-filter:blur(14px); }
.ps-header h1 { margin:0; font-size: 20px; }
.ps-header p,.ps-provider-heading p { margin:3px 0 0; color:var(--ps-muted); }
.ps-back { color:var(--ps-accent); text-decoration:none; font-weight:700; }
.ps-header-actions,.ps-actions { display:flex; gap:8px; margin-left:auto; flex-wrap:wrap; }
.ps-shell { display:grid; grid-template-columns:250px minmax(0,1fr); min-height:calc(100vh - 82px); }
.ps-provider-list { padding:14px; border-right:1px solid var(--ps-border); background:var(--ps-panel); }
.ps-provider-tab { width:100%; display:flex; align-items:center; gap:10px; padding:11px 12px; margin-bottom:7px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--ps-text); text-align:left; cursor:pointer; }
.ps-provider-tab:hover { background:var(--ps-card); }
.ps-provider-tab.active { background:var(--ps-card); border-color:var(--ps-blue); }
.ps-provider-tab .dot { width:8px; height:8px; margin-left:auto; border-radius:50%; background:var(--ps-red); }
.ps-provider-tab .dot.ok { background:var(--ps-green); }
.ps-content { padding:24px; max-width:1050px; width:100%; }
.ps-empty { color:var(--ps-muted); padding:36px; border:1px dashed var(--ps-border); border-radius:12px; }
.ps-provider-heading { display:flex; gap:16px; align-items:flex-start; margin-bottom:12px; }
.ps-title-row { display:flex; align-items:center; gap:9px; }
.ps-title-row h2 { margin:0; font-size: 23px; }
/* R-08: pixel icon per built-in provider kind (16 px in the tabs, 24 px in the heading). */
.ps-kind-icon { display:block; width:16px; height:16px; fill:currentColor; shape-rendering:crispEdges; }
.ps-tab-icon { display:inline-flex; align-items:center; justify-content:center; width:20px; flex:none; color:var(--ps-text); }
.ps-provider-tab.active .ps-tab-icon { color:var(--ps-blue); }
#ps-icon { display:inline-flex; align-items:center; color:var(--ps-blue); }
#ps-icon .ps-kind-icon { width:24px; height:24px; }
.ps-health { padding:3px 8px; border-radius:999px; background:rgba(255,107,120,.13); color:var(--ps-red); font-size: 12px; font-weight:700; }
.ps-health.ok { color:var(--ps-green); background:rgba(68,209,122,.13); }
.ps-capabilities { display:flex; flex-wrap:wrap; gap:6px; margin:14px 0 18px; }
.ps-capability { padding:3px 8px; border:1px solid var(--ps-border); border-radius:999px; color:var(--ps-muted); font-size: 12px; }
.ps-section { padding:18px; margin-bottom:14px; border:1px solid var(--ps-border); border-radius:14px; background:var(--ps-card); box-shadow:var(--ps-shadow); }
.ps-section h3 { margin:0 0 3px; font-size: 16px; }
.ps-section-description,.ps-help { color:var(--ps-muted); font-size: 12px; }
.ps-field { display:grid; grid-template-columns:minmax(180px,280px) minmax(220px,1fr); gap:14px; align-items:center; padding:12px 0; border-top:1px solid color-mix(in srgb,var(--ps-border) 65%,transparent); }
.ps-field:first-of-type { margin-top:10px; }
.ps-label { font-weight:650; }
.ps-control input:not([type="checkbox"]),.ps-control select { width:100%; padding:9px 10px; color:var(--ps-text); background:var(--ps-bg); border:1px solid var(--ps-border); border-radius:8px; }
.ps-control input:focus,.ps-control select:focus { outline:2px solid color-mix(in srgb,var(--ps-blue) 55%,transparent); border-color:var(--ps-blue); }
.ps-check { display:flex; align-items:center; gap:9px; }
.ps-check input { width:18px; height:18px; accent-color:var(--ps-blue); }
.ps-button { border:1px solid var(--ps-border); border-radius:8px; padding:8px 12px; cursor:pointer; text-decoration:none; color:var(--ps-text); background:var(--ps-card); }
.ps-button:hover { border-color:var(--ps-blue); }
.ps-button.primary { color:#07101d; background:var(--ps-accent); border-color:var(--ps-accent); font-weight:750; }
.ps-button.danger { color:var(--ps-red); }
.ps-button:disabled { opacity:.55; cursor:wait; }
.ps-status { min-height:22px; margin-bottom:8px; color:var(--ps-muted); }
.ps-status.ok { color:var(--ps-green); }.ps-status.error { color:var(--ps-red); }
.ps-connection-list { display:grid; gap:10px; }
.ps-connection { padding:12px; border:1px solid var(--ps-border); border-radius:10px; background:var(--ps-panel); }
.ps-connection-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.ps-connection-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ps-connection-grid label { display:grid; gap:4px; color:var(--ps-muted); font-size: 12px; }
.ps-connection-grid input:not([type="checkbox"]) { width:100%; padding:8px; color:var(--ps-text); background:var(--ps-bg); border:1px solid var(--ps-border); border-radius:7px; }
.ps-link { color:var(--ps-blue); font-weight:650; }
.ps-integration-subtitle { margin:20px 0 8px; font-size: 14px; }
.ps-integration-list { display:grid; gap:8px; margin-top:10px; }
.ps-integration-row { display:grid; grid-template-columns:minmax(160px,230px) minmax(170px,auto) minmax(220px,1fr); gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--ps-border); border-radius:9px; background:var(--ps-panel); }
.ps-integration-title { font-weight:700; }
.ps-integration-tags { display:flex; gap:5px; flex-wrap:wrap; }
.ps-integration-tag { padding:2px 7px; border:1px solid var(--ps-border); border-radius:999px; color:var(--ps-muted); font-size: 11px; }
.ps-integration-tag.ok { color:var(--ps-green); border-color:color-mix(in srgb,var(--ps-green) 45%,var(--ps-border)); }
.ps-integration-tag.danger { color:var(--ps-red); border-color:color-mix(in srgb,var(--ps-red) 45%,var(--ps-border)); }
.ps-integration-paths { min-width:0; overflow-wrap:anywhere; color:var(--ps-muted); font: 12px/1.45 var(--vo-font-mono); }
.ps-integration-row .ps-help { grid-column:1/-1; }
@media(max-width:760px){ .ps-header{align-items:flex-start;flex-wrap:wrap;padding:14px}.ps-header-actions{width:100%;margin-left:0}.ps-shell{display:block}.ps-provider-list{display:flex;overflow-x:auto;border-right:0;border-bottom:1px solid var(--ps-border);position:sticky;top:126px;z-index:2}.ps-provider-tab{min-width:170px;margin:0 7px 0 0}.ps-content{padding:14px}.ps-provider-heading{display:block}.ps-actions{margin:12px 0}.ps-field{grid-template-columns:1fr;gap:6px}.ps-connection-grid{grid-template-columns:1fr}}
@media(max-width:760px){ .ps-integration-row{grid-template-columns:1fr;gap:5px} }
