/* Admin adapter for Dimensoul UI 1.0. The theme tokens live in ui-system.css. */
html[data-ds-theme]{
  --bg:var(--ds-bg);--panel:var(--ds-surface);--surface:var(--ds-surface);
  --raised:var(--ds-surface-raised);--panel-strong:var(--ds-surface-raised);--surface-raised:var(--ds-surface-raised);
  --panel-raised:var(--ds-surface-raised);--panel-soft:var(--ds-surface-soft);--faint:var(--ds-subtle);
  --line:var(--ds-border);--border:var(--ds-border);--line-strong:var(--ds-border);--line-soft:var(--ds-divider);
  --text:var(--ds-text);--muted:var(--ds-muted);--accent:var(--ds-accent);--accent-soft:var(--ds-accent-soft);
  --accent-ink:var(--ds-accent-ink);--accent-strong:var(--ds-accent-strong);--blue:var(--ds-info);--warning:var(--ds-warning);
  --cyan:var(--ds-secondary);--green:var(--ds-accent);--green-bg:var(--ds-accent-soft);--amber:var(--ds-warning);
  --danger:var(--ds-danger);--success:var(--ds-success);--radius:var(--ds-radius-lg);--shadow:var(--ds-shadow);--mono:var(--ds-mono);
  font-family:var(--ds-font);font-size:14px;
}
html[data-ds-theme] body[data-ds-page]{background:var(--ds-bg);color:var(--ds-text);font-family:var(--ds-font);font-size:14px;line-height:1.55}
body[data-ds-page] :is(button,input,select,textarea){font-family:var(--ds-font)}
body[data-ds-page] :is(button,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--ds-focus);outline-offset:3px}
body[data-ds-page] :is(input,select,textarea){caret-color:var(--ds-accent)}
body[data-ds-page] :is(input,textarea)::placeholder{color:var(--ds-subtle);opacity:1}
body[data-ds-page] :is(button,.button):disabled{cursor:not-allowed;opacity:.55;transform:none}
body[data-ds-page] :is(.button,.icon-button){min-height:var(--ds-control-height);border-radius:var(--ds-radius-md);font-size:13px;white-space:nowrap}
body[data-ds-page] :is(.button.primary,.clone-audio-picker button,.preview-play-button){background:var(--ds-accent);color:var(--ds-accent-ink);border-color:var(--ds-accent);box-shadow:none}
body[data-ds-page] .button.primary:hover:not(:disabled){background:var(--ds-accent-strong);border-color:var(--ds-accent-strong);color:var(--ds-accent-ink);transform:none}
body[data-ds-page] :is(.button.secondary,.button.ghost,.button.subtle,.icon-button){background:var(--ds-surface-raised);color:var(--ds-text);border:1px solid var(--ds-border);box-shadow:none}
body[data-ds-page] :is(.button.secondary,.button.ghost,.button.subtle,.icon-button):hover:not(:disabled){background:var(--ds-accent-soft);border-color:var(--ds-accent);color:var(--ds-text)}
body[data-ds-page] :is(.button.danger,.button.withdraw){background:var(--ds-danger-soft);color:var(--ds-danger);border:1px solid var(--ds-danger)}
body[data-ds-page] :is(.text-button,.text-link){color:var(--ds-accent);font-size:12px}
body[data-ds-page] :is(.text-button,.text-link):hover{color:var(--ds-accent-strong);text-decoration:underline;text-underline-offset:3px}
body[data-ds-page] :is(.status-pill,.quiet-tag,.mode-tag,.spec-chip,.source-badge,.release-tag){border-radius:var(--ds-radius-sm);font-size:12px}
body[data-ds-page] :is(dialog,.modal){border:1px solid var(--ds-border);border-radius:var(--ds-radius-lg);background:var(--ds-surface);color:var(--ds-text);box-shadow:var(--ds-shadow)}
body[data-ds-page] :is(dialog,.modal)::backdrop{background:rgb(3 9 20 / 65%);backdrop-filter:blur(3px)}
body[data-ds-page] :is(.card,.stats-card,.note-card,.expression-policy,.project-panel,.inspector){box-shadow:none}
body[data-ds-page] :is(.eyebrow,.section-heading .eyebrow){font-size:12px;letter-spacing:.07em;font-weight:600;color:var(--ds-muted)}
body[data-ds-page] :is(.form-note,.field small,.field-note,.hint,.footnote,.caption,.quiet-tag){font-size:12px;line-height:1.65;color:var(--ds-muted)}
body[data-ds-page] :is(.field label,.field>span,.field-heading>label){font-size:13px;color:var(--ds-text)}
body[data-ds-page] :is(.field input,.field select,.field textarea){background:var(--ds-field);border-color:var(--ds-border);color:var(--ds-text);font-size:14px}
body[data-ds-page] :is(.field input,.field select,.field textarea):focus{border-color:var(--ds-focus)}
body[data-ds-page] :is(table,pre,code){font-variant-numeric:tabular-nums}
body[data-ds-page] table{font-size:14px}
body[data-ds-page] th{font-size:12px;color:var(--ds-muted);background:var(--ds-surface-raised)}
body[data-ds-page] :is(th,td){border-color:var(--ds-divider)}
body[data-ds-page] code{font-family:var(--ds-mono)}
/* Shared navigation: a compact command strip, with a clear current destination. */
workspace-header{background:var(--ds-surface);border-color:var(--ds-divider);font-family:var(--ds-font)}
.workspace-bar{height:63px;padding:0 24px;grid-template-columns:160px minmax(0,1fr) auto;gap:16px}
.workspace-bar .workspace-brand{color:var(--ds-text);gap:10px}
.workspace-mark{width:34px;height:34px;border-radius:6px;background:var(--ds-accent-soft);border-color:var(--ds-accent);color:var(--ds-accent);box-shadow:inset 2px 0 0 var(--ds-accent);font-size:25px}
.workspace-name{font-size:15px;letter-spacing:.03em}
.workspace-name small{font-size:12px;letter-spacing:0;color:var(--ds-muted);margin-top:0}
.workspace-utilities{display:flex;justify-self:end;align-items:center;gap:12px;min-width:0}
.workspace-account{height:36px;min-height:36px;border-color:var(--ds-border);border-radius:var(--ds-radius-sm);background:var(--ds-surface-raised);color:var(--ds-text);font-size:12px}
.workspace-account:hover{border-color:var(--ds-accent);background:var(--ds-accent-soft);color:var(--ds-accent)}
.page-mode-switch{width:fit-content;max-width:100%;justify-self:center;padding:0;gap:3px;border:0;border-radius:0;background:transparent}
.page-mode-switch a{min-height:36px;padding:0 10px;color:var(--ds-muted);font-size:13px;border-radius:var(--ds-radius-sm);border:1px solid transparent}
.page-mode-switch a:hover{background:var(--ds-surface-raised);color:var(--ds-text)}
.page-mode-switch a[aria-current="page"]{color:var(--ds-accent);background:var(--ds-accent-soft);border-color:var(--ds-border);box-shadow:inset 0 -2px 0 var(--ds-accent)}
body:not(.mobile-conversation-mode) .page-toolbar{min-height:60px;padding:10px 24px;background:var(--ds-surface-soft);border-color:var(--ds-divider);box-shadow:none;backdrop-filter:none}
.page-toolbar :is(.brand,.brand-link,.brand strong,.brand h1,.brand-link strong){color:var(--ds-text);font-size:17px}
.page-toolbar :is(.brand small,.brand p,.brand-link small){color:var(--ds-muted);font-size:12px}
body[data-ds-page] :is(.tabs button.active,.tabs button[aria-selected="true"],.product-switch a.active,.section-nav a.active,.section-sidebar a.active,.docs-tabs a[aria-current="page"],.expression-page-tabs button[aria-current="page"]){background:var(--ds-accent-soft);color:var(--ds-accent);border-color:var(--ds-border);box-shadow:inset 0 -2px 0 var(--ds-accent)}
/* Resource workspace: explicit folder action and a quiet empty state. */
body[data-ds-page="resources"] :is(.sidebar,.inspector){background:var(--ds-surface)}
body[data-ds-page="resources"] .workspace-header{min-height:82px;flex-wrap:wrap}
body[data-ds-page="resources"] .workspace-header>div:first-child{flex:1 1 180px;min-width:0}
body[data-ds-page="resources"] .workspace-actions{flex:1 1 330px;justify-content:flex-end;min-width:0}
body[data-ds-page="resources"] .workspace-actions :is(.button,.icon-button){flex-shrink:0}
body[data-ds-page="resources"] .search-box{flex:1 1 180px;min-width:100px;max-width:260px}
body[data-ds-page="resources"] .search-box input{min-width:0}
body[data-ds-page="resources"] .root-path{font-size:12px;max-width:100%}
.file-name{min-width:0}
.file-name .file-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-open{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:4px 9px;margin-left:auto;border:1px solid var(--ds-border);border-radius:var(--ds-radius-sm);background:var(--ds-surface-raised);color:var(--ds-accent);font-size:12px;cursor:pointer}
.file-open:hover{border-color:var(--ds-accent);background:var(--ds-accent-soft)}
.file-table tr.selected{background:var(--ds-accent-soft);box-shadow:inset 3px 0 0 var(--ds-accent)}
.file-table tbody tr:hover:not(.selected){background:var(--ds-surface-raised)}
.file-table tbody tr:focus-visible{outline-offset:-2px}
.empty-resource-mark{display:grid;place-items:center;width:48px;height:48px;margin:0 auto 18px;border:1px solid var(--ds-border);border-radius:var(--ds-radius-md);font:30px/1 var(--ds-mono);color:var(--ds-accent);background:var(--ds-accent-soft)}
/* Preview wells are neutral and stay dark in every theme, preserving image fidelity. */
body[data-ds-page] :is(.preview,.round-preview,.card-preview,.rehearsal-screen){background:#0a1019;color:#f1f5fc;border-color:var(--ds-divider)}
body[data-ds-page] :is(.preview-placeholder,.media-load-state,.round-preview>span,.preview-live){color:#e8eef8}
body[data-ds-page] .media-load-state[data-state="error"]{color:#ffb0bf}
body[data-ds-page] .preview .preview-live{background:rgb(7 17 31 / 85%)}
/* Long-form reference and log content share the same readable contrast. */
body[data-ds-page="docs"] :is(.user-doc section p,.user-doc section li,.user-doc article p,.user-doc article li,.hero-description,.section-description,.endpoint-description,.endpoint-notes){color:var(--ds-muted);font-size:14px;line-height:1.85}
body[data-ds-page="docs"] :is(.user-doc strong,.user-doc summary,.hero h1,.prompt-question>strong){color:var(--ds-text)}
body[data-ds-page="docs"] :is(.guide-shortcuts a,.prompt-flow-step,.prompt-layer-grid article,.world-card,.quick-paths>a){background:var(--ds-surface);border-color:var(--ds-border);box-shadow:none}
body[data-ds-page="docs"] :is(.code-block,.code-block pre,.base-url){background:var(--ds-field);color:var(--ds-text)}
body[data-ds-page="docs"] .code-heading{background:var(--ds-surface-raised)}
body[data-ds-page="docs"] :is(.code-block pre code,.parameter-table td,.parameter-table th){color:var(--ds-text)}
body[data-ds-page="role-api"] :is(p,li,td,dd,.lead){color:var(--ds-muted);font-size:14px}
body[data-ds-page="role-api"] :is(h1,h2,h3,strong,dt){color:var(--ds-text)}
body[data-ds-page="role-api"] :is(a,.method){color:var(--ds-accent)}
body[data-ds-page="role-api"] .layout{padding-top:30px;gap:32px}
body[data-ds-page="role-api"] aside{top:calc(var(--workspace-header-height) + 24px);max-height:calc(100dvh - var(--workspace-header-height) - 48px);overflow:auto}
body[data-ds-page="service"] .save-bar{background:var(--ds-surface);border-color:var(--ds-border);box-shadow:0 -4px 18px rgb(0 0 0 / 12%)}
body[data-ds-page="service"] :is(.save-state small,.runtime-pill,.connection-grid p,.field-origin,.provider-empty){font-size:12px}
body[data-ds-page="service"] .service-log-table{font-size:12px}
/* Login and specialist documents retain a compact appearance control. */
body[data-ds-page="login"]{background:var(--ds-bg);min-height:100dvh}
body[data-ds-page="login"] .card{border-color:var(--ds-border);border-radius:var(--ds-radius-lg);background:var(--ds-surface);box-shadow:var(--ds-shadow)}
.login-topbar{display:flex;justify-content:space-between;align-items:center;gap:12px}
.login-topbar .ds-theme-control{margin:0;color:var(--ds-muted)}
body[data-ds-page="login"] .brand{border-color:var(--ds-accent);background:var(--ds-accent-soft);color:var(--ds-accent);border-radius:var(--ds-radius-md)}
body[data-ds-page="login"] :is(input:not([type="checkbox"])){background:var(--ds-field);color:var(--ds-text);border-color:var(--ds-border)}
body[data-ds-page="login"] :is(button,.button){background:var(--ds-accent);color:var(--ds-accent-ink);border-radius:var(--ds-radius-md)}
body[data-ds-page="login"] .secondary{background:var(--ds-surface-raised);color:var(--ds-text);border:1px solid var(--ds-border)}
body[data-ds-page="login"] #message{color:var(--ds-danger)}
body[data-ds-page="ota-docs"] pre{background:var(--ds-surface);color:var(--ds-text);border-color:var(--ds-border);border-radius:var(--ds-radius-md)}
.document-appearance{display:flex;justify-content:flex-end;margin-bottom:20px}
@media(max-width:760px){body[data-ds-page="resources"] .workspace-header>div:first-child,body[data-ds-page="resources"] .workspace-actions{flex:none;width:100%}body[data-ds-page="resources"] .search-box{max-width:none}}
@media(max-width:1250px){.workspace-bar{grid-template-columns:auto minmax(0,1fr) auto;gap:10px;padding-inline:20px}.workspace-utilities{gap:8px}.workspace-account{padding-inline:9px}.workspace-account span{display:none}.workspace-utilities .ds-theme-control>span:not(.ds-theme-dot){display:none}.page-mode-switch a{padding-inline:9px}}
@media(max-width:950px){.workspace-bar{gap:8px;padding-inline:16px}.workspace-name{display:none}.workspace-utilities .ds-theme-select{max-width:118px;font-size:12px}.page-mode-switch{justify-self:stretch}.page-mode-switch a{padding-inline:9px}.workspace-account{padding:0;width:36px}}
@media(max-width:680px){.workspace-bar{grid-template-columns:auto minmax(0,1fr) auto;height:auto;min-height:64px;padding:8px 12px;gap:8px}.workspace-utilities .workspace-account{display:none}.workspace-utilities .ds-theme-dot{display:none}.workspace-utilities .ds-theme-select{max-width:108px;min-height:40px}.page-mode-switch a{font-size:12px;min-height:40px}.workspace-mark{width:30px;height:34px}.workspace-name{display:none}body:not(.mobile-conversation-mode) .page-toolbar{padding:12px 16px}.page-toolbar :is(.brand,.brand-link,.brand strong,.brand h1){font-size:16px}body[data-ds-page] .button{min-height:40px}.file-open{min-height:36px}.login-topbar .ds-theme-select{max-width:140px}body[data-ds-page="role-api"] aside{position:static;max-height:none}.role-api-toolbar nav{flex-wrap:wrap;gap:12px}}
@media(prefers-reduced-motion:reduce){body[data-ds-page] *{scroll-behavior:auto!important}}
