:root {
    color-scheme: light;
    --ink: #182e42;
    --muted: #506579;
    --line: #d7e2e9;
    --brand: #185d78;
    --canvas: #f5f8fa;
    --bs-body-font-family: "Malgun Gothic", system-ui, sans-serif;
    --bs-body-color: var(--ink);
    --bs-link-color: #155e82;
}
body { margin: 0; background: var(--canvas); line-height: 1.6; }
.ai-site-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; padding: .75rem clamp(1rem, 3vw, 2.25rem);
    background: #142e40; color: white;
}
.ai-site-brand { display: inline-flex; align-items: center; gap: .7rem; color: white; font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.ai-site-brand:hover { color: white; }
.ai-site-brand img { border-radius: .45rem; }
.ai-site-header .btn { margin-inline-start: .65rem; }
.ai-side { background: #1d394c; }
.page-content { min-width: 0; padding: clamp(.9rem, 2.5vw, 2.5rem); }
.page-breadcrumb { display: flex; flex-wrap: wrap; list-style: none; gap: .5rem; align-items: center; padding: 0; margin: 0 0 1rem; color: var(--muted); font-size: .875rem; }
.portlet { background: white; border: 1px solid var(--line); border-radius: .85rem; }
.portlet-title { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.portlet-title, .portlet-body { padding: clamp(.85rem, 2vw, 1.6rem); }
.portlet-title .caption { display: flex; flex-wrap: wrap; gap: .65rem; align-items: baseline; }
.portlet-title .caption h1.ai-page-heading { font-size: clamp(1.3rem, 2vw, 1.75rem); color: var(--ink); }
.caption-helper { color: var(--muted); }
.portlet:fullscreen, .expanded-panel { overflow: auto; }
.expanded-panel { position: fixed; inset: 0; z-index: 1030; }
.btn-default, .btn-outline { color: #264961; background: white; border: 1px solid #adbdc9; }
.btn-default:hover, .btn-outline:hover { background: #eef5f8; border-color: var(--brand); }
.btn-default.active, .btn-primary { color: white; background: var(--brand); border-color: var(--brand); }
.btn-group { flex-wrap: wrap; vertical-align: middle; }
.btn-group input[type="radio"] { accent-color: #166f8c; }
.btn-group label { cursor: pointer; }
.btn-xs { padding: .2rem .5rem; font-size: .875rem; }
.form-group { margin-block: .8rem; }
.form-group label { margin-block-end: .3rem; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form-inline .form-control { width: auto; max-width: 100%; }
.badge, .label { display: inline-block; background: #e2ebf0; color: #25455c; border-radius: .4rem; padding: .25em .5em; font-weight: 600; }
.alert-warning { color: #6c490a; background: #fff7e8; }
.hidden, [hidden] { display: none !important; }
.pull-right { float: right; }
.pull-left { float: left; }
.text-right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.modal .modal-header { align-items: flex-start; gap: 1rem; }
.modal-header .close, .modal-header .btn-close { order: 2; margin-inline-start: auto; flex: none; }
.modal-header .close:empty::before { content: "×"; }
.modal-footer { gap: .35rem; flex-wrap: wrap; }
.fa, i[class^="icon-"] { font-style: normal; }
.fa-angle-right::before { content: "›"; }
.fa-angle-left::before { content: "‹"; }
.fa-bars::before { content: "☰"; }
.fa-refresh::before { content: "↻"; }
.fa-plus::before { content: "+"; }
.fa-question-circle::before { content: "?"; }
.fa-code::before { content: "‹›"; }
.fa-pencil-square-o::before { content: "✎"; }
.fa-play-circle-o::before { content: "▷"; }
.fa-list::before, .fa-sitemap::before { content: "☷"; }
.fa-history::before { content: "◷"; }
.bi-arrow-clockwise::before { content: "↻"; }
.bi-list-ul::before { content: "☷"; }
.bi-search::before { content: "⌕"; }
.bi-chevron-down::before { content: "⌄"; }
.bi-chevron-up::before { content: "⌃"; }
:focus-visible { outline: 3px solid #227da8; outline-offset: 2px; }
@media (max-width: 767px) {
    .page-content { padding: .7rem; }
    .portlet-title, .portlet-body { padding: .8rem; }
    .form-inline .form-control { width: 100%; }
}

/* Shared shell and working surfaces in the standalone client. */
:root {
    --ink: #182e32;
    --muted: #52656a;
    --line: #dbe3e1;
    --canvas: #f4f6f5;
    --brand: #11645c;
    --bs-link-color: #11645c;
    --ai-text-link: #11645c;
    --ai-text-muted: #52656a;
    --bs-body-font-family: Inter, "Malgun Gothic", system-ui, sans-serif;
}
.ai-site-header {
    min-height: 64px; background: white; color: var(--ink);
    border-bottom: 1px solid var(--line); padding-inline: clamp(1rem, 2vw, 2rem);
}
.ai-site-brand, .ai-site-brand:hover { color: var(--ink); letter-spacing: -.035em; }
.ai-side { background: #fff; }
.ai-side { border-inline-end: 1px solid var(--line); }
.page-container {
    --breadcrumb-height: max(3rem, calc(1.6em + 21px));
    --page-gutter: clamp(.675rem, 1.875vw, 1.875rem);
}
.ai-side .nav-item { margin: .18rem .45rem; }
.ai-side .nav-item > a { padding: .7rem .8rem; border-radius: .55rem; color: #384c50; }
.ai-side .nav-item > a:hover { background: #f0f5f3; }
.ai-side .nav-item.active > a, .ai-side .nav-item > a[aria-current="page"] {
    background: #e5f2ed; box-shadow: inset 3px 0 #168574; color: #0f594e;
}
.page-content { width: 100%; }
.page-container:has(> .ai-side) .page-content-wrapper .page-content {
    padding-inline: var(--page-gutter);
    padding-block-start: 0;
}
.page-content > .page-bar {
    display: flex;
    gap: .5rem;
    align-items: center;
    box-sizing: border-box;
    min-block-size: var(--breadcrumb-height);
    margin-inline: calc(-1 * var(--page-gutter));
    margin-block-end: .8rem;
    padding: .15rem var(--page-gutter);
    border-block-end: 1px solid var(--line);
}
.page-breadcrumb { margin: 0; font-size: .82rem; }
@media (max-width: 767px) {
    .page-container { --page-gutter: 9px; }
}
.portlet { border: 0; background: transparent; }
.portlet-title, .portlet-body { padding: 0; }
.portlet-title {
    position: relative; isolation: isolate; padding: clamp(1.2rem, 2.2vw, 2.2rem);
    margin-bottom: 1.1rem; border: 1px solid #1e4e50; border-radius: 1rem;
    background: linear-gradient(108deg,#192f35 12%,#204649 66%,#285958);
    box-shadow: 0 4px 14px #16383212;
}
.portlet-title::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: repeating-radial-gradient(ellipse at 100% 170%, transparent 0 30px, #c3e6d80d 31px 32px, transparent 33px 59px);
    mask-image: linear-gradient(90deg,transparent 27%,#000 85%); pointer-events: none;
}
.portlet-title .caption { display: grid; gap: .2rem; }
.portlet-title .caption > i:empty { display: none; }
.portlet-title .caption h1.ai-page-heading { color: #fff; font-size: clamp(1.65rem, 2.2vw, 2.3rem); letter-spacing: -.04em; font-weight: 700; }
.page-content .portlet > .portlet-title > .caption > .caption-helper {
    color: color-mix(in srgb, var(--menu-accent) 32%, white);
    padding-inline-start: .65rem; border-inline-start: 3px solid currentColor;
    line-height: 1.55; margin-block-start: .2rem;
}
.portlet-title .actions .btn { background: #fff; color: #244344; border-color: transparent; }
.portlet:fullscreen, .portlet.expanded-panel { background: var(--canvas); padding: 1rem; }
.page-content .btn, .modal .btn { border-radius: .5rem; }
.btn-primary { --bs-btn-hover-bg: #0a504a; --bs-btn-hover-border-color: #0a504a; }
.ai-service-flow, .page-content .ai-service-flow { background: white; border: 1px solid var(--line); border-radius: .85rem; }
.ai-service-nav .ai-flow-link { border-radius: .55rem; }
.ai-service-nav .ai-flow-link[aria-current="page"] { background: #ebf6f0; border-color: #76a99c; color: #175b50; }
.modal-content { border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 20px 70px #20243730; }
.modal .modal-header { position: relative; display: block; padding: 1.05rem 4rem 1.05rem 1.25rem; }
.modal .modal-header .modal-title { margin: 0; color: var(--ink); font-weight: 700; }
.modal .modal-header > :is(.close, .btn-close) {
    position: absolute; inset-inline-end: .7rem; top: .55rem; margin: 0; width: 40px; height: 40px;
}
.modal .modal-footer { background: #f8f9fc; border-radius: 0 0 1rem 1rem; }
.ai-infer-result:empty { display: none; }
/* Reserve a full target beside the title, including in the asset and design dialogs. */
.modal .modal-header > button.close,
#ai-asset-modal .modal-header > .ai-asset-close,
#ai-new-modal .modal-header > .ai-design-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    inset-block-start: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    line-height: 1;
}
.modal .modal-header > button.close:hover { background-color: #edf4f2; }

/* One reading surface for a result. A warning within it keeps its own emphasis. */
.ai-infer-result:not(:empty) {
    min-width: 0;
    margin: 0 0 1.25rem;
    padding: 0 0 1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}
.ai-infer-result > .ai-asset-h {
    margin: 0 0 .75rem;
    font-weight: 700;
    color: var(--brand);
}
.ai-infer-result > .ai-prediction-summary {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.ai-infer-result .ai-prediction-summary > strong {
    margin-block: .25rem .5rem;
    line-height: 1.4;
}
.ai-infer-result .ai-prediction-summary .table {
    width: 100%;
    table-layout: fixed;
    margin-block: .75rem;
    --bs-table-bg: transparent;
}
.ai-infer-result .ai-prediction-summary .table thead {
    --bs-table-bg: #f0f5f4;
}
.ai-infer-result .ai-prediction-summary .table :is(th, td):last-child {
    text-align: end;
    font-variant-numeric: tabular-nums;
}
.ai-infer-result .ai-prediction-summary p,
.ai-infer-result > .ai-help {
    margin: .75rem 0 0;
    overflow-wrap: anywhere;
}

/* Inside a panel, keep the disclosure marker and focus ring on a plain text row. */
:is(.modal-body, .page-content) :is(
    .ai-infer-result > details,
    details.ai-warn-box,
    .ai-warn-box details.ai-step-details,
    .ai-asset-warn > details,
    .ai-version-manager > details,
    .ai-definition-unit,
    .ai-definition-review-detail
) > summary {
    margin: 0;
    padding: .55rem .2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: .2em;
}
#ai-definition-functions > .ai-definition-unit {
    margin: 0;
    padding: .35rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
}

/* Let the explanation wrap below its own column as the guide narrows. */
.ai-guide-use {
    display: grid;
    grid-template-columns: minmax(3em, auto) minmax(4em, auto) minmax(0, 1fr);
    align-items: baseline;
    gap: .25rem .65rem;
}
.ai-guide-use > :is(.ai-guide-at, .ai-guide-mark, .ai-guide-say) {
    width: auto;
    margin: 0;
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .ai-guide-use { grid-template-columns: auto 1fr; }
    .ai-guide-use > .ai-guide-say { grid-column: 1 / -1; }
}

/* Keep search, results and operations as separate destinations in the reading order. */
.model-workspace {
    display: grid; align-items: start; gap: 1rem 1.25rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "status" "filter" "results" "insights";
}
.model-workspace > #ai-model-status { grid-area: status; margin: 0; }
.model-workspace > .ai-filter {
    grid-area: filter; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1.15rem .75rem;
    margin: 0; padding: clamp(.85rem, 2vw, 1.35rem); border: 1px solid var(--line);
    border-radius: .95rem; background: white;
}
.ai-filter .ai-model-search { margin: 0; grid-column: 1; gap: .5rem; }
.ai-model-search label { font-weight: 700; color: var(--ink); }
.ai-model-search input.form-control { background: #f8faf9; border-color: #9baea7; border-radius: .5rem; min-height: 42px; }
.portlet-title .actions:has(.ai-model-shortcuts), .portlet-title .ai-model-shortcuts {
    display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; align-items: center;
}
.portlet-title .ai-model-shortcuts a { color: #e0f3ec; font-weight: 600; text-underline-offset: .25em; }
.portlet-title .ai-model-shortcuts a:hover { text-decoration: underline; }
.page-content .ai-service-flow details.workflow-guide > summary { color: var(--menu-accent); cursor: pointer; font-weight: 700; }
.ai-context-picker { padding: 1rem; max-width: none; background: white; border: 1px solid var(--line); border-radius: .85rem; }
.ai-step, .ai-kind { border-radius: .75rem; background-color: white; }
.ai-step-jump, .ai-kind-head { border-radius: .65rem; }
.ai-step-jump[aria-current="step"] { background: #edf7f3; border-color: #74a899; box-shadow: inset 0 -2px var(--brand); }
.ai-kind.is-open { border-color: #90afa7; }
.ai-kind.is-open .ai-kind-head { background: #f1f8f5; }
.ai-filter .clearfix { display: none; }
.ai-filter .btn-group:has([data-state]) {
    grid-column: 1/-1; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .35rem;
}
.ai-filter .btn-group > label.btn[data-state] {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .25rem;
    position: relative; margin: 0; min-height: 56px; padding: .5rem .8rem;
    color: #455a59; background: #f4f7f6; border: 1px solid transparent; border-radius: .55rem;
    word-break: keep-all; overflow-wrap: anywhere;
}
.ai-filter label[data-state] input { position: absolute; opacity: 0; }
.ai-filter label[data-state]:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.ai-filter .btn-group > label[data-state]:hover { border-color: #88a69c; }
.ai-filter .btn-group > label.active[data-state] { background: #19554e; color: white; font-weight: 600; }
.ai-filter .btn[data-state] .badge {
    order: -1; margin: 0; padding: 0; background: transparent; color: var(--ink);
    font-size: 1.4rem; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.ai-filter .btn.active[data-state] .badge { color: white; }
.ai-filter .pull-right { grid-column: 2; align-self: center; justify-self: end; gap: .4rem; }
.model-results { grid-area: results; min-width: 0; }
.model-insights { grid-area: insights; min-width: 0; display: grid; gap: 1rem; }
.model-health-title { margin: 0 0 -.5rem; color: var(--menu-accent); font-size: 1rem; font-weight: 700; }
.model-insights #ai-model-health > *, .model-insights .ai-service-flow { margin: 0; overflow-wrap: anywhere; }
.model-insights .ai-health { padding: 1rem; border-radius: .8rem; background: white; }
.model-insights .ai-service-nav { grid-template-columns: 1fr; }
.model-insights .ai-service-nav .ai-flow-link {
    margin: 0; padding: .65rem .8rem; border: 0; border-inline-start: 2px solid #d9e3de;
    background: transparent; border-radius: 0 .4rem .4rem 0;
}
.model-insights .ai-service-nav .ai-flow-link:is([aria-current="page"],:hover) {
    border-inline-start-color: var(--brand); background: #eff7f3;
}
.model-insights .ai-service-flow .workflow-guide > summary {
    padding: .2rem 0; color: var(--menu-accent); border: 0; background: transparent; font-size: 1rem;
}
.model-result-tools { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin: 0 0 .65rem; }
.model-result-tools .ai-list-help { margin: 0; }
.model-result-tools .ai-list-help[open] { width: 100%; }
.model-result-tools .ai-list-help > summary { border: 0; background: transparent; padding: .25rem 0; color: var(--muted); }
.model-results .ai-card {
    padding: clamp(1rem, 1.5vw, 1.5rem); margin-bottom: 1rem; border-radius: .9rem;
    border-left-width: 1px; box-shadow: 0 3px 12px #23372e09;
}
.model-results .ai-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem 1.25rem; margin-bottom: .85rem; }
.model-identity, .model-state { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; }
.model-identity { flex: 2 1 16rem; }
.ai-card-head .ai-card-name { width: 100%; font-size: clamp(1.1rem,1.3vw,1.35rem); line-height: 1.4; font-weight: 700; letter-spacing: -.025em; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.model-results .ai-field dd { word-break: keep-all; overflow-wrap: anywhere; }
.model-identity .ai-card-id { font-family: ui-monospace, Consolas, monospace; color: #586a69; }
.model-identity .ai-card-ver { padding: .1rem .45rem; background: #edf2ef; color: #38574f; font-weight: 600; }
.model-state { flex: 1 1 14rem; justify-content: flex-end; text-align: end; }
.model-state > * { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ai-card-head .model-state .ai-elapsed { width: 100%; margin: 0; font-variant-numeric: tabular-nums; }
.ai-card-head .ai-state, .ai-card-head .ai-latest-badge { border-radius: .4rem; }
.model-results .ai-card-info > summary, .model-results .ai-model-versions > summary {
    background: transparent; color: var(--ai-text-link); border: 0; padding: .35rem 0; line-height: 1.5;
}
.model-results .ai-model-versions { margin-top: .8rem; padding-top: .55rem; }
.model-results .ai-next:not(.is-warn) {
    background: #f4f7f5; color: #3e5550; border: 0; border-radius: .45rem;
    padding: .6rem .8rem; word-break: keep-all; overflow-wrap: anywhere;
}
.model-results .ai-actions { gap: .4rem; }
.model-results .ai-actions .btn { margin: 0; }
.model-results .ai-actions .btn-default { border-color: #c3d1ca; color: #36574c; }
.model-results .ai-actions .btn-primary { font-weight: 650; }
@media (max-width: 950px) {
    .ai-filter .btn-group:has([data-state]) { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1190px) {
    .model-insights #ai-model-health .ai-health.is-ok {
        display: flex; flex-wrap: wrap; gap: .65rem; align-items: center;
    }
    .model-insights #ai-model-health .is-ok > :is(b, span, details) { flex-basis: 100%; word-break: keep-all; }
    .model-insights #ai-model-health .is-ok > p:last-child { margin-inline-start: auto; }
    .model-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(16rem, 23%);
        grid-template-areas: "status status" "filter insights" "results insights";
        grid-template-rows: auto auto 1fr;
    }
}
@media (max-width: 1189px) {
    .model-workspace:has(#ai-model-health :is(.is-error, .is-watch, .is-bad)) {
        grid-template-areas: "status" "filter" "insights" "results";
    }
    .model-insights { grid-template-columns: minmax(0, 1fr); }
    .model-insights .ai-service-nav { grid-template-columns: repeat(auto-fit,minmax(min(10rem,100%),1fr)); }
}
@media (max-width: 767px) {
    .model-workspace { gap: .75rem; }
    .model-workspace > .ai-filter { grid-template-columns: minmax(0,1fr); gap: .7rem; }
    .ai-filter .pull-right { grid-column: 1; justify-self: start; }
    .model-state { justify-content: flex-start; text-align: start; }
    .ai-filter .ai-model-search label { width: 100%; }
    .ai-filter .ai-model-search input.form-control { flex-basis: 100%; max-width: none; }
    .ai-filter .btn-group > label.btn[data-state] { padding: .45rem; font-size: .82rem; }
    .ai-filter .btn[data-state] .badge { font-size: 1.1rem; }
}

/* Page identity follows the sidebar's current route even on a direct detail link. */
:root { --menu-accent: #19665c; --menu-wash: #e5f2ed; --menu-deep: #285958; }
.ai-side .nav-item > a[aria-current="page"] {
    color: var(--menu-accent); background: var(--menu-wash);
    box-shadow: inset 3px 0 var(--menu-accent); font-weight: 700;
}
.portlet-title, .ai-progress-title {
    background: linear-gradient(108deg, #192f35 12%, var(--menu-deep) 96%);
}
.ai-progress-title {
    color: white; padding: clamp(1.2rem, 2.2vw, 2.2rem); margin: 0 0 1.1rem;
    font-size: clamp(1.65rem, 2.2vw, 2.3rem); font-weight: 700; letter-spacing: -.04em;
    border-radius: 1rem;
}
.ai-service-nav .ai-flow-link[aria-current="page"], .ai-step-jump[aria-current="step"] {
    color: var(--menu-accent); background: var(--menu-wash); border-color: var(--menu-accent);
}
.ai-step-jump[aria-current="step"] { box-shadow: inset 0 -2px var(--menu-accent); }
.ai-context-picker { padding: clamp(1rem, 2vw, 1.5rem); }
.ai-context-picker label { color: var(--ink); font-weight: 600; }
.ai-context-picker select { min-height: 2.8rem; border-radius: .5rem; }
.ai-subject {
    padding: 1rem 1.25rem; border-radius: .65rem; border-inline-start-color: var(--menu-accent);
    background: var(--menu-wash);
}
.ai-subject-name, .ai-kind-label { color: var(--menu-accent); font-size: 1.08rem; letter-spacing: -.025em; }
.ai-subject-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.ai-subject-meta span { margin-right: 0; }
.ai-step-head, .ai-kind-head { min-height: 3rem; }
.ai-kind-head { padding: 1rem 1.2rem; line-height: 1.55; overflow-wrap: anywhere; }
.ai-kind-head code { white-space: normal; overflow-wrap: anywhere; }
.ai-kind-mark { margin-top: .4rem; }
.ai-kind-two h5, .ai-step-name, .ai-definition h3, .ai-definition h4,
#ai-action-heading, .modal .modal-header .modal-title {
    color: var(--menu-accent);
}
.ai-kind.is-open { border-color: var(--menu-accent); }
.ai-kind.is-open .ai-kind-head { background: var(--menu-wash); }
.ai-kind-body { padding: clamp(1rem, 2vw, 1.5rem); }
.ai-template-option:has(input[type="radio"]:checked) { outline: 2px solid var(--menu-accent); outline-offset: -2px; }
.ai-definition, section.portlet[aria-labelledby="ai-action-heading"] {
    padding: clamp(1rem, 2.3vw, 2rem); margin-bottom: 1rem;
    background: white; border: 1px solid var(--line); border-radius: .85rem;
}
.ai-definition-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.ai-definition-grid article { background: var(--menu-wash); border-radius: .6rem; }
.ai-action-controls { padding-block: .85rem; border-block: 1px solid var(--line); }
@media (max-width: 767px) {
    .ai-subject-name, .ai-subject-id { display: block; margin-inline: 0; }
    .ai-context-picker { gap: .8rem; }
    .ai-kind-head, .ai-kind-body { padding-inline: .9rem; }
}

/* Preserve layout measurements while the first view is assembling. */
#theme-view[hidden] { display: block !important; visibility: hidden; }
body:has(#theme-view[hidden]) { overflow: hidden; }
body:has(#theme-view[hidden]) > .modal:not(.theme-auth-dialog),
body:has(#theme-view[hidden]):not(:has(.theme-auth-dialog)) > .modal-backdrop { visibility: hidden; }
#theme-start:not([hidden]) {
    position: fixed; inset: 0; z-index: 1000; overflow: auto;
    display: grid; align-content: center; justify-items: center; gap: .75rem;
    padding: 1.5rem; background: var(--canvas); color: var(--muted); text-align: center;
}
#theme-start a { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
