/* Zea light workspace: petrol actions, iris navigation, a white diagram canvas. */
:root {
    --zea-primary: #126b68;
    --zea-primary-hover: #0c5553;
    --zea-primary-soft: #e8f4f1;
    --zea-secondary: #6945a5;
    --zea-secondary-hover: #533584;
    --zea-secondary-soft: #f1ecf8;
    --zea-secondary-border: #d3c6e7;
    --zea-text: #263936;
    --zea-muted: #60736f;
    --zea-border: #dce6e2;
    --zea-control-border: #b5c7c0;
    --zea-surface: #fff;
    --zea-surface-soft: #f5f8f6;
    --zea-conversation-background: #e9edf1;
    --zea-sidebar: #edf4f0;
    --zea-tree-selected: #d7e9e3;
    --zea-folder: #936719;
    --zea-error: #a23248;
    --zea-error-soft: #fff0f3;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--zea-text);
    background: var(--zea-surface);
    color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; }
html, body, #main, #content { height: 100%; width: 100%; overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: #cce8df; color: #173f37; }
h1 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1rem; font-weight: 650; margin: 1.5rem 0 .8rem; }
h3 { font-size: .95rem; margin: 1.2rem 0 .6rem; }
a { color: var(--zea-primary); text-underline-offset: 3px; }

/* Field focus stays inside its box; support both wrapping labels and for/id. */
button, input, select, textarea { font: inherit; border-radius: 5px; }
input, select, textarea {
    display: block;
    width: 100%; max-width: 100%;
    padding: .48rem .65rem;
    border: 1px solid var(--zea-control-border);
    background: var(--zea-surface); color: var(--zea-text);
    line-height: 1.4;
    outline: none;
}
/* Single-choice selects share an inset arrow across desktop platforms. */
select:not([multiple]):not([size]), select:not([multiple])[size="1"], select:not([multiple])[size="0"] {
    appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23263936' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 14px;
}
input:hover, select:hover, textarea:hover { border-color: #8da99e; }
input:focus, select:focus, textarea:focus {
    border-color: var(--zea-primary);
    box-shadow: inset 0 0 0 1px var(--zea-primary);
}
input[readonly], textarea[readonly] { background: var(--zea-surface-soft); color: #4e635c; }
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #73847d; }
label { display: block; margin: .85rem 0 .35rem; font-size: .88rem; font-weight: 550; }
label > input, label > select, label > textarea { margin-top: .35rem; font-weight: 400; }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; accent-color: var(--zea-primary); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--zea-primary); outline-offset: 2px; box-shadow: none; }
button { padding: .48rem .85rem; margin: .6rem 0; border: 1px solid transparent; background: var(--zea-primary); color: #fff; font-weight: 550; line-height: 1.4; cursor: pointer; }
.has-button-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-icon { display: inline-block; flex-shrink: 0; vertical-align: -.15em; }
.has-button-icon > .button-icon { margin-right: 2px; }
button:hover { background: var(--zea-primary-hover); }
button.secondary { background: var(--zea-surface); border-color: var(--zea-secondary-border); color: var(--zea-secondary); }
button.secondary:hover { background: var(--zea-secondary-soft); border-color: var(--zea-secondary); color: var(--zea-secondary-hover); }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--zea-secondary); outline-offset: 2px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .5; cursor: default; }
hr { border: 0; border-top: 1px solid var(--zea-border); margin: 1.2rem 0; }
.muted { color: var(--zea-muted); font-size: .85rem; line-height: 1.5; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; margin: 0; flex-shrink: 0; }
.row-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-actions button { margin: .2rem 0; }
.compact-form { max-width: 480px; }
.inline-form { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; }
.inline-form > label { flex: 1 1 160px; }
.inline-form button { margin-bottom: .35rem; }
fieldset { border: 1px solid var(--zea-border); border-radius: 6px; margin-top: 1rem; }
legend { font-size: .85rem; color: var(--zea-muted); padding: 0 .3rem; }
details { margin-top: .7rem; }
summary { cursor: pointer; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--zea-border); }
th { font-weight: 600; color: var(--zea-muted); background: var(--zea-surface-soft); }
tbody tr:hover { background: #f8faf9; }
td select { min-width: 140px; }
[data-notice] { padding: .75rem .85rem; background: var(--zea-primary-soft); color: var(--zea-primary-hover); border-left: 3px solid var(--zea-primary); border-radius: 4px; margin-bottom: 1rem; }
.error, [data-notice].error { color: var(--zea-error); background: var(--zea-error-soft); border-color: var(--zea-error); }

/* Identity belongs to application chrome; the diagram canvas stays white. */
.application-shell { --sidebar-width: 238px; display: flex; width: 100%; height: 100dvh; min-height: 0; overflow: hidden; }
.application-shell.sidebar-collapsed { --sidebar-width: 56px; }
.sidebar { position: relative; display: flex; flex-direction: column; flex: 0 0 var(--sidebar-width); width: var(--sidebar-width); height: 100%; background: var(--zea-sidebar); border-right: 1px solid #d4e3db; box-shadow: inset 3px 0 var(--zea-primary); transition: width .15s, flex-basis .15s; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--zea-muted); border: 0; width: 32px; height: 32px; padding: 0; margin: 0; font-size: 1.4rem; }
.icon-button:hover { background: var(--zea-primary-soft); color: var(--zea-primary); }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; min-height: 60px; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--zea-primary); font-size: 1.5rem; font-weight: 700; letter-spacing: -.04em; }
.sidebar-brand img { object-fit: contain; flex-shrink: 0; }
.sidebar-toggle { flex-shrink: 0; color: var(--zea-primary); }
.sidebar-collapsed .sidebar-brand { display: none; }
.sidebar-reserved { display: flex; flex: 1; min-height: 0; min-width: 0; }
.account-button { display: flex; gap: 10px; align-items: center; text-align: left; color: var(--zea-text); background: transparent; border: 0; border-top: 1px solid #d4e3db; border-radius: 0; padding: 14px 12px; margin: 0; min-height: 72px; width: 100%; overflow: hidden; }
.account-button:hover, .account-button[aria-expanded=true] { background: #e0ede5; }
.account-avatar { display: flex; align-items: center; justify-content: center; background: var(--zea-secondary-soft); border: 1px solid var(--zea-secondary-border); border-radius: 9px; width: 30px; height: 30px; font-size: .75rem; font-weight: 650; flex-shrink: 0; color: var(--zea-secondary); }
.account-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.account-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#accountName { font-size: .88rem; font-weight: 600; }
#accountOrganization { font-size: .76rem; color: var(--zea-muted); }
.account-chevron { color: var(--zea-secondary); font-size: 1.2rem; }
.sidebar-collapsed .account-copy, .sidebar-collapsed .account-chevron { display: none; }
.sidebar-collapsed .account-button { padding-left: 12px; padding-right: 12px; }
.diagram-column { display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; }
.project-titlebar { height: 42px; min-height: 42px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--zea-border); background: #fafcfb; color: var(--zea-muted); padding: 0 16px 0 0; }
.project-title-group { flex:1; min-width:0; display:flex; align-items:center; justify-content:center; gap:8px; margin:0 8px; }
.project-titlebar #projectTitle { min-width: 0; font-size: .86rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.project-titlebar #projectUnsavedLabel { flex:none; font-size:.86rem; font-weight:700; color:var(--zea-error); white-space:nowrap; }
.project-titlebar #projectTitle[aria-disabled=true] { color: var(--zea-muted); text-decoration: none; cursor: default; }
.project-titlebar #projectTitle:focus-visible { outline: 2px solid var(--zea-primary); outline-offset: 2px; border-radius: 3px; }
.project-titlebar .project-settings-button { flex: 0 0 42px; height: 40px; border-radius: 0; color: var(--zea-primary); }
.diagram-canvas { flex: 1; min-width: 0; min-height: 0; background: var(--zea-surface); }
.account-menu { position: fixed; left: calc(var(--sidebar-width) + 8px); bottom: 12px; z-index: 100; min-width: 215px; max-width: calc(100vw - var(--sidebar-width) - 16px); max-height: calc(100dvh - 24px); overflow: auto; }
.account-menu, .explorer-context-menu { background: var(--zea-surface); border: 1px solid var(--zea-border); border-top: 3px solid var(--zea-secondary); border-radius: 7px; padding: 5px; box-shadow: 0 8px 28px #243c3426; }
.account-menu button, .explorer-context-menu button { display: block; width: 100%; background: transparent; color: var(--zea-text); text-align: left; border: 0; padding: .6rem .75rem; margin: 0; font-size: .86rem; font-weight: 450; }
.account-menu button { white-space: nowrap; }
.account-menu button.has-button-icon, .explorer-context-menu button.has-button-icon { display: flex; justify-content: flex-start; gap: 8px; }
.account-menu button:hover, .explorer-context-menu button:hover { background: var(--zea-secondary-soft); color: var(--zea-secondary-hover); }
.explorer-context-menu button:disabled { opacity: .45; cursor: default; background: transparent; color: var(--zea-text); }
.account-menu button:focus-visible, .explorer-context-menu button:focus-visible { outline-offset: -2px; background: var(--zea-secondary-soft); }
.account-menu hr { margin: 5px 0; }
.workspace-notice { position: fixed; right: 16px; bottom: 16px; z-index: 300; max-width: min(480px, calc(100vw - 32px)); background: var(--zea-primary-soft); color: var(--zea-primary-hover); padding: .85rem 1rem; border: 1px solid #b9d9cb; border-radius: 6px; }
.workspace-notice.error { background: var(--zea-error-soft); color: var(--zea-error); border-color: #e6b9c3; }

/* Native modal containers retain the reusable ZVC component lifecycle. */
.workspace-dialog, .zvc-editor-dialog { border: 1px solid #cadbd2; border-radius: 9px; padding: 0; color: var(--zea-text); background: var(--zea-surface); box-shadow: 0 16px 64px #1c393526; }
.workspace-dialog { width: min(560px, calc(100vw - 40px)); max-height: calc(100dvh - 48px); }
.workspace-dialog.dialog-small { width: min(440px, calc(100vw - 40px)); }
.workspace-dialog.dialog-large { width: min(800px, calc(100vw - 40px)); }
.workspace-dialog.dialog-explorer { width: min(1080px, calc(100vw - 40px)); }
.zvc-editor-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.zvc-editor-dialog.dialog-large { width: min(720px, calc(100vw - 32px)); }
.zvc-editor-dialog.dialog-component { width: min(960px, calc(100vw - 32px)); }
.zvc-editor-dialog.dialog-component .property-panel textarea { min-height: 6rem; }
.zvc-editor-dialog.dialog-requirements { width: min(1280px, calc(100vw - 40px)); }
.workspace-dialog::backdrop { background: #203c342b; }
.zvc-editor-dialog::backdrop { background: #203c343b; }
.dialog-header, .editor-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 13px 20px; border-bottom: 1px solid var(--zea-border); background: var(--zea-surface-soft); box-shadow: inset 3px 0 var(--zea-primary); }
.editor-header { box-shadow: inset 3px 0 var(--zea-secondary); }
.dialog-content { padding: 20px; max-height: calc(100dvh - 120px); overflow: auto; }
.editor-body { padding: 16px 20px 20px; max-height: calc(100dvh - 100px); overflow: auto; }
.editor-body form > label:first-child { margin-top: .25rem; }
.editor-actions { display: flex; justify-content: flex-end; margin-top: 1rem; padding-top: .5rem; border-top: 1px solid var(--zea-border); }
.editor-actions button { margin-bottom: 0; }
#dialogs-container:empty { display: none; }
.section-toolbar, .explorer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-toolbar h2 { margin: .5rem 0; }
.explorer-toolbar { padding-bottom: 10px; border-bottom: 1px solid var(--zea-border); margin-bottom: 12px; }
.project-browser { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(250px, 1fr); gap: 24px; }
.explorer-layout { grid-template-columns: minmax(230px, .8fr) minmax(340px, 1.5fr); gap: 20px; min-height: 430px; }
.folder-tree { min-width: 0; min-height: 360px; max-height: calc(100dvh - 220px); overflow: auto; border-right: 1px solid var(--zea-border); padding: 4px 14px 4px 0; }
.folder-tree ul { list-style: none; padding: 0; margin: 0; }
.folder-tree ul[role=group] { padding-left: 14px; }
.explorer-tree-row { display: flex; align-items: center; min-height: 32px; border-radius: 4px; }
.tree-label { display: flex; align-items: center; justify-content: flex-start; gap: 6px; flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--zea-text); padding: 6px 4px; margin: 0; font-size: .86rem; font-weight: 450; }
.tree-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-label:hover { background: var(--zea-surface-soft); color: var(--zea-primary); }
.tree-label[aria-selected=true] { background: var(--zea-secondary-soft); color: var(--zea-secondary-hover); box-shadow: inset 2px 0 var(--zea-secondary); font-weight: 600; }
.tree-label:focus-visible { outline-offset: -2px; }
.tree-icon { color: var(--zea-folder); width: 16px; height: 16px; flex-shrink: 0; }
.tree-label[data-node-key^="project:"] .tree-icon { color: var(--zea-secondary); }
.tree-label[data-node-key^="space:"] { font-weight: 650; color: var(--zea-primary-hover); }
.tree-label[data-node-key^="space:"] .tree-icon { color: var(--zea-primary); }
.tree-disclosure { flex: 0 0 18px; width: 18px; height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 0; background: transparent; color: var(--zea-muted); border: 0; }
.tree-disclosure .button-icon { width: 12px; height: 12px; }
.tree-disclosure.is-expanded .button-icon { transform: rotate(90deg); }
.tree-disclosure:hover { background: var(--zea-primary-soft); color: var(--zea-primary); }
.tree-disclosure[hidden] { display: inline-flex !important; visibility: hidden; }
.tree-more { flex-shrink: 0; width: 25px; height: 26px; font-size: 1.1rem; }
.inspector-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 16px; }
.inspector-header h2 { margin: 0; }
.inspector-header p { margin: 0 0 5px; }
.browser-inspector { min-width: 0; }
.browser-inspector h2 { margin-top: .5rem; }
.folder-contents { table-layout: fixed; }
.folder-contents th, .folder-contents td { padding: 5px 8px; }
.folder-contents th:last-child, .folder-contents td:last-child { width: 90px; text-align: right; white-space: nowrap; color: var(--zea-muted); }
.folder-content-link { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--zea-text); text-decoration: none; border-radius: 3px; line-height: 20px; }
.folder-content-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-content-link .button-icon { width: 14px; height: 14px; color: var(--zea-secondary); }
.folder-content-link[data-entry-kind=folder] .button-icon { color: var(--zea-folder); }
.folder-content-link:hover > span { color: var(--zea-primary); text-decoration: underline; text-underline-offset: 3px; }
.folder-content-link:focus-visible { outline: 2px solid var(--zea-secondary); outline-offset: 1px; }
.description-hint { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.description-hint p { margin: 5px 0; }
.description-hint span { white-space: nowrap; margin-top: 5px; }
#projectPropertiesForm textarea { min-height: 220px; }
.project-section-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--zea-border); }
.explorer-context-menu { position: fixed; z-index: 1000; width: 220px; max-height: calc(100dvh - 16px); overflow: auto; }

/* Sign-in shares the palette without decorating the diagram area. */
#content.login-content { overflow: auto; background: var(--zea-sidebar); }
.login-shell { max-width: 430px; margin: min(8vh, 40px) auto; background: var(--zea-surface); padding: 2rem; border: 1px solid #cadbd2; border-top: 4px solid var(--zea-primary); border-radius: 10px; box-shadow: 0 12px 40px #203c3412; }
.login-shell .brand { display: flex; align-items: center; gap: .7rem; font-size: 1.6rem; font-weight: 700; letter-spacing: -.04em; color: var(--zea-primary); }
.login-shell h1 { font-size: 1.5rem; margin-top: 1.5rem; }
.login-shell form > button { width: 100%; margin-top: 1rem; }
.external-providers { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.external-providers button { background: var(--zea-secondary-soft); color: var(--zea-secondary-hover); border-color: var(--zea-secondary-border); font-size: .85rem; }
#error { padding: .8rem; background: var(--zea-error-soft); color: var(--zea-error); border-radius: 5px; }

@media (max-width: 720px) {
    .explorer-layout { grid-template-columns: 1fr; }
    .folder-tree { max-height: 240px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--zea-border); padding: 0 0 16px; }
    .description-hint { flex-direction: column; gap: 0; }
    .editor-body { padding: 16px; }
}
@media (max-width: 650px) {
    .application-shell { --sidebar-width: 190px; }
    .application-shell.sidebar-collapsed { --sidebar-width: 56px; }
    .project-browser { grid-template-columns: 1fr; }
    .workspace-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
    .dialog-content { padding: 16px; }
    .login-shell { margin: 16px; }
    .account-menu { min-width: 0; }
    .account-menu button { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media (forced-colors: active) {
    select:not([multiple]):not([size]), select:not([multiple])[size="1"], select:not([multiple])[size="0"] { appearance: auto; background-image: none; padding-right: .65rem; }
    input:focus, select:focus, textarea:focus { outline: 2px solid Highlight; outline-offset: -2px; box-shadow: none; }
    .tree-label[aria-selected=true] { border-left: 2px solid Highlight; }
}

/* Shared review inbox and project work responsibilities. */
.notification-button { position: relative; flex-shrink: 0; margin-left: 12px; color: var(--zea-primary); }
.notification-button .notification-badge { position: absolute; top: -2px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--zea-secondary); color: #fff; border: 1px solid var(--zea-surface); font-size: .67rem; line-height: 1; font-weight: 650; }
.work-role-option { display: flex; align-items: start; gap: 9px; margin: .7rem 0; cursor: pointer; }
.work-role-option input { margin-top: 3px; flex-shrink: 0; }
.work-role-option span { display: flex; flex-direction: column; gap: 2px; }
.work-role-option strong { font-size: .86rem; font-weight: 600; }
.work-role-option small { color: var(--zea-muted); font-weight: 400; line-height: 1.4; }
/* Desktop modeling workspace. Navigation and viewport are separate from the model. */
.application-shell { --sidebar-width: var(--sidebar-expanded-width, 290px); }
.modeling-sidebar { height: 100%; min-height: 0; min-width: 0; flex: 1; }
.modeling-sidebar { display: flex; flex-direction: column; overflow: hidden; }
.modeling-section { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; overflow: hidden; border-top: 1px solid var(--zea-border); }
.modeling-section-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; gap: 6px; min-height: 43px; }
.modeling-section-header h2 { margin: 0; font-size: .86rem; }
.modeling-header-actions { display: flex; align-items: center; gap: 4px; }
.modeling-create { margin: 0; padding: 4px 7px; font-size: .78rem; }
.modeling-header-actions .icon-button { width: 26px; height: 26px; font-size: .9rem; }
.modeling-list { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; flex: 1; min-height: 0; padding: 0 7px 8px; }
.modeling-list details { margin-top: 2px; }
.modeling-list summary { padding: 6px 4px; font-size: .79rem; color: var(--zea-muted); overflow-wrap: anywhere; }
.modeling-list [style*="--layer-color"] > summary { color: var(--layer-color); background: var(--layer-background); border-radius: 4px; padding-left: 7px; }
#artifactList > details > :not(summary) { margin-left: 16px; }
#artifactList > details > summary { position:relative; padding-right:38px; }
.artifact-layer-info { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:26px; height:26px; padding:4px; color:inherit; }
#artifactList > details > .artifact-layer-search { width: calc(100% - 24px); }
.modeling-label-copy { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-reference-count { flex-shrink: 0; font-size: .75rem; color: var(--zea-muted); }
.modeling-list summary > .modeling-row-action { float: right; height: 20px; margin-top: -2px; }
.modeling-row { display: flex; align-items: center; min-width: 0; padding-left: 12px; }
.modeling-row-label { min-width: 0; flex: 1; text-align: left; border: 0; border-radius: 4px; background: transparent; color: var(--zea-text); padding: 6px 10px; margin: 0; font-size: .83rem; font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modeling-row.is-active > .modeling-row-label { background: var(--zea-tree-selected); color: var(--zea-primary); box-shadow: inset 3px 0 var(--zea-primary); }
.modeling-row-label:hover { background: var(--zea-secondary-soft); color: var(--zea-secondary); }
.modeling-row-label[data-artifact-drag][draggable=true]{cursor:grab}
.diagram-viewport.is-artifact-drop-target{outline:2px solid var(--zea-primary);outline-offset:-3px}
.modeling-row.is-dirty > .modeling-row-label { color: var(--zea-error); font-weight: 600; }
.modeling-row-action { width: 25px; height: 27px; font-size: 1rem; flex-shrink: 0; }
.modeling-tree-node { margin: 0 !important; }
.modeling-tree-node > summary { padding: 0 0 0 3px; }
.modeling-tree-node > summary > .modeling-row { display: inline-flex; width: calc(100% - 14px); padding-left: 0; vertical-align: middle; }
.modeling-tree-node > :not(summary) { margin-left: 12px !important; }
.modeling-tree-node > summary .modeling-row-label { padding-left: 10px; }
.modeling-empty { font-size: .75rem; margin: 2px 6px 7px 18px; color: var(--zea-muted); }
.modeling-sidebar [data-notice] { flex-shrink: 0; max-height: 120px; overflow: auto; font-size: .8rem; margin: 0; padding: 8px 10px; }
.sidebar-collapsed .modeling-sidebar { display: none; }
.diagram-canvas { display: flex; flex-direction: column; overflow: hidden; position: relative; }
.diagram-tabs { display: flex; flex-shrink: 0; overflow-x: auto; background: var(--zea-surface-soft); border-bottom: 1px solid var(--zea-border); scrollbar-width: thin; scrollbar-color: var(--zea-control-border) var(--zea-surface-soft); }
.diagram-tabs::-webkit-scrollbar { height: 6px; }
.diagram-tabs::-webkit-scrollbar-track { background: var(--zea-surface-soft); }
.diagram-tabs::-webkit-scrollbar-thumb { background: var(--zea-control-border); border-radius: 6px; }
.diagram-tabs::-webkit-scrollbar-thumb:hover { background: var(--zea-muted); }
.diagram-tabs:empty { display: none; }
.diagram-tab { display: flex; align-items: center; border-right: 1px solid var(--zea-border); min-width: 130px; max-width: 260px; }
.diagram-tab [role=tab] { padding: 9px 12px; height: 37px; border-radius: 0; }
.diagram-tab-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diagram-tab-dirty { flex-shrink: 0; font-weight: 700; }
.diagram-tab:has([aria-selected=true]) { background: var(--zea-surface); box-shadow: inset 0 2px var(--zea-secondary); }
.diagram-tab [aria-selected=true] { color: var(--zea-secondary); font-weight: 600; }
.diagram-tab.is-dirty [role=tab] { color: var(--zea-error); font-style: italic; }
.diagram-tab.is-dirty:has([aria-selected=true]) { box-shadow: inset 0 2px var(--zea-error); }
@media (forced-colors: active) { .diagram-tabs { scrollbar-color: auto; scrollbar-width: auto; } }
.diagram-tab .icon-button { width: 25px; height: 30px; flex-shrink: 0; font-size: 1.1rem; }
.diagram-tab { position: relative; flex-shrink: 0; }
.diagram-tab [draggable=true] { cursor: grab; }
.diagram-tab.is-dragging { opacity: .5; }
.diagram-tab.drop-before::before, .diagram-tab.drop-after::after { content: ''; position: absolute; top: 3px; bottom: 3px; width: 3px; background: var(--zea-secondary); pointer-events: none; z-index: 2; }
.diagram-tab.drop-before::before { left: 0; }
.diagram-tab.drop-after::after { right: 0; }
.diagram-panels { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.diagram-panel { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.diagram-toolbar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--zea-border); min-height: 42px; flex-wrap: wrap; }
.diagram-toolbar button { margin: 0; font-size: .78rem; padding: 4px 9px; white-space: nowrap; }
.diagram-tool-group { display: flex; align-items: center; gap: 2px; padding-right: 9px; margin-right: 2px; border-right: 1px solid var(--zea-border); }
.diagram-tool-group:last-child { padding-right: 0; margin-right: 0; border: 0; }
.diagram-toolbar .diagram-tool { padding: 0; width: 31px; height: 31px; border: 1px solid transparent; border-radius: 4px; }
.diagram-toolbar .diagram-tool:hover { border-color: var(--zea-control-border); }
.toolbar-spacer { flex: 1; }
.diagram-save-status { font-size: .74rem; color: var(--zea-muted); }
.diagram-viewport { flex: 1; min-height: 0; min-width: 0; overflow: auto; position: relative; touch-action: none; user-select: none; }
.diagram-viewport:focus-visible { outline: 1px solid var(--zea-secondary); outline-offset: -1px; }
.diagram-viewport .joint-element { cursor: move; }
.diagram-viewport [joint-selector=settings]:focus-visible { outline: 2px solid var(--zea-secondary); }
.diagram-viewport .joint-paper { position: relative; }
.diagram-selection-box { position: absolute; border: 1px solid var(--zea-secondary); background: #6945a51a; pointer-events: none; z-index: 10; }
.diagram-viewport .joint-element [joint-selector=body] { pointer-events: none; }
.artifact-picker-body { padding: 12px 16px 16px; }
.artifact-picker-layers details { margin: 0; }
.artifact-picker-layers summary { padding: 7px 9px; font-size: .8rem; font-weight: 600; color: var(--layer-color); background: var(--layer-background); border-radius: 5px; }
.artifact-type-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 2px 3px; }
.artifact-type-pill { display: inline-flex; align-items: stretch; border: 1px solid color-mix(in srgb, var(--layer-color) 30%, white); border-radius: 18px; background: var(--layer-background); overflow: hidden; }
.artifact-type-pill button { margin: 0; background: transparent; color: var(--layer-color); border: 0; border-radius: 0; font-size: .85rem; }
.artifact-type-pill button:hover { background: color-mix(in srgb, var(--layer-color) 10%, transparent); }
.artifact-type-create { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px 6px 12px; }
.artifact-type-about { display: inline-flex; align-items: center; padding: 5px 9px; border-left: 1px solid color-mix(in srgb, var(--layer-color) 20%, transparent) !important; }
.artifact-type-pill button:focus-visible { outline-offset: -3px; }
.catalog-type-status { display:inline-flex; align-items:center; gap:4px; padding:1px 5px; border-radius:8px; background:var(--zea-surface); font-size:.7rem; white-space:nowrap; }
.artifact-type-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 16px; padding: 5px 10px; margin-bottom: 10px; font-size: .84rem; font-weight: 600; }
.artifact-type-info h2 { margin: 14px 0 5px; font-size: .88rem; }
.artifact-type-info p, .artifact-type-info li { font-size: .86rem; line-height: 1.55; }
.artifact-type-info ul { margin: 5px 0; padding-left: 21px; }
.artifact-editor-type { display: flex; gap: 8px; align-items: flex-start; }
.artifact-editor-type p { flex: 1; margin: 0 0 8px; }
.artifact-editor-type .icon-button { flex-shrink: 0; width: 27px; height: 27px; font-size: 0; }
.type-help-relationship { margin-top: 9px; }
.type-help-relationship strong { font-size: .84rem; }
.type-help-relationship p { margin: 3px 0; }
.type-planned { display: inline-block; margin-left: 7px; font-size: .68rem; color: var(--zea-muted); background: var(--zea-surface-soft); border-radius: 3px; padding: 1px 5px; }
#choiceMessage { white-space: pre-line; overflow-wrap: anywhere; }
.choice-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.artifact-conflict { border: 1px solid var(--zea-border); border-radius: 6px; padding: 12px; margin: 12px 0; }
.artifact-conflict h2 { margin: 0 0 6px; }
.artifact-conflict td { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 120px; max-width: 240px; vertical-align: top; }
.artifact-conflict .external-value { background: var(--zea-secondary-soft); }
.artifact-conflict label { margin-bottom: 0; }
.editor-actions { gap: 8px; }
.modeling-row-label.has-button-icon { justify-content: flex-start; }
#diagramGroupField { display: flex; align-items: flex-end; gap: 12px; }
#diagramGroupField label { flex: 1; }
#diagramGroupField button { margin-bottom: .35rem; white-space: nowrap; }
.diagram-empty { position: absolute; top: 45%; left: 0; right: 0; text-align: center; margin: 0; color: var(--zea-muted); pointer-events: none; font-size: .9rem; }
#processFields textarea { min-height: 60px; }
.notification-list { display: grid; gap: 12px; }
.workspace-dialog.notifications-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(1120px, calc(100vw - 24px)); max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0 10px 10px 0; }
.workspace-dialog.notifications-drawer[open] { display: flex; flex-direction: column; animation: notifications-enter .18s ease-out; }
.notifications-drawer > .dialog-header { flex-shrink: 0; }
.notifications-drawer > .dialog-content { min-height: 0; flex: 1; max-height: none; overflow: auto; }
.zvc-editor-dialog.dialog-impact-review { width: min(1120px, calc(100vw - 32px)); }
@keyframes notifications-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .workspace-dialog.notifications-drawer[open] { animation: none; } }
@media (max-width: 600px) { .workspace-dialog.notifications-drawer { width: 100vw; border-radius: 0; } }
.notification-card { border: 1px solid var(--zea-border); border-left: 3px solid var(--zea-secondary); border-radius: 6px; padding: 12px 16px; overflow-wrap: anywhere; }
.notification-card h3 { margin: 0 0 8px; }
.notification-project { color: var(--zea-primary); font-size: .8rem; font-weight: 600; margin: 0 0 5px; }
.notification-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.notification-card .row-actions { margin-top: 8px; }

/* Symbol and note controls stay hidden at rest, including on selected elements. */
.joint-element .artifact-hover-tools { opacity: 0; pointer-events: none; transition: opacity .12s; }
.joint-element:hover .artifact-hover-tools,
.joint-element:focus-within .artifact-hover-tools { opacity: 1; pointer-events: auto; }
.joint-element .integration-hover-tools { opacity: 0; pointer-events: none; transition: opacity .12s; }
.joint-element:hover .integration-hover-tools { opacity: 1; pointer-events: auto; }
.diagram-viewport.is-connecting, .diagram-viewport.is-connecting .joint-element { cursor: crosshair; }
.relationship-endpoints { margin: 0 0 12px; color: var(--zea-muted); overflow-wrap: anywhere; }
.relationship-existing { display: grid; gap: 4px; margin-bottom: 12px; }
.relationship-existing button { text-align: left; }
.relationship-catalog-help { margin: 8px 0 14px; font-size: .85rem; color: var(--zea-muted); }

.property-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--zea-border); margin: 4px 0 12px; padding-bottom: 4px; }
.property-tabs button { margin: 0; padding: 7px 10px; border: 0; border-radius: 5px 5px 0 0; background: transparent; color: var(--zea-muted); font-size: .82rem; }
.property-tabs button[aria-selected=true] { color: var(--zea-primary); background: var(--zea-surface-soft); box-shadow: inset 0 -2px var(--zea-primary); font-weight: 600; }
.property-panel { min-height: 180px; }
.property-panel > :first-child { margin-top: 0; }
.objective-options { max-height: 260px; overflow: auto; border: 1px solid var(--zea-border); border-radius: 5px; padding: 4px 8px; }
.objective-option { display: flex; align-items: center; gap: 8px; padding: 7px 0; margin: 0; font-size: .86rem; }
.objective-option input { width: auto; margin: 0; flex-shrink: 0; }
.worker-result { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; padding: 10px; background: var(--zea-surface-soft); border: 1px solid var(--zea-border); border-radius: 5px; font-size: .8rem; }
.worker-event { border-bottom: 1px solid var(--zea-border); padding: 8px 0; }

/* The global organization console keeps membership administration in view. */
.organizations-layout { display:grid; grid-template-columns:minmax(320px, .9fr) minmax(360px, 1.1fr); gap:24px; }
.organizations-layout > section { min-width:0; }
.organization-users-panel { border-left:1px solid var(--zea-border); padding-left:24px; }
.organizations-layout button[aria-pressed=true] { background:var(--zea-primary-soft); color:var(--zea-primary-hover); font-weight:650; }
#passwordEditorForm fieldset { border:0; padding:0; margin:0; min-width:0; }
#passwordEditorForm .row-actions { margin-top:12px; }
@media(max-width:850px) { .organizations-layout { grid-template-columns:1fr; } .organization-users-panel { border-left:0; border-top:1px solid var(--zea-border); padding:16px 0 0; } }

/* Agent conversations share the workspace without covering diagram controls. */
.artifact-layer-search { width:calc(100% - 16px); margin:6px 8px; padding:6px 8px; font-size:.82rem; }
.agent-panel-toggle { position:relative; flex-shrink:0; margin-left:12px; }
.agent-panel-toggle[aria-expanded=true] { color:var(--zea-secondary); background:var(--zea-secondary-soft); }
.agent-panel { position:relative; display:flex; flex-direction:column; flex:0 0 var(--agent-panel-width,clamp(330px,30vw,430px)); width:var(--agent-panel-width,clamp(330px,30vw,430px)); height:100%; min-width:0; min-height:0; border-left:1px solid var(--zea-border); background:var(--zea-surface-soft); }
.agent-panel-resize-handle { position:absolute; z-index:5; top:0; bottom:0; left:-5px; width:9px; cursor:col-resize; touch-action:none; }
.agent-panel-resize-handle::after { content:""; position:absolute; top:0; bottom:0; left:4px; width:2px; background:transparent; }
.agent-panel-resize-handle:hover::after,.agent-panel-resize-handle:focus-visible::after,.is-resizing-agent .agent-panel-resize-handle::after { background:var(--zea-secondary); }
.agent-panel-resize-handle:focus-visible { outline:2px solid var(--zea-secondary); outline-offset:-2px; }
.is-resizing-agent,.is-resizing-agent * { cursor:col-resize !important; user-select:none !important; }
.agent-panel-header { display:flex; align-items:center; justify-content:space-between; flex:0 0 42px; padding:0 12px; border-bottom:1px solid var(--zea-border); background:var(--zea-surface); }
.agent-panel-header h2 { margin:0; font-size:.92rem; }
.agent-panel-host { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
.agent-panel-content { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; }
.agent-panel-toolbar { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 12px; }
.agent-panel-toolbar > span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.agent-panel-toolbar .row-actions { flex-wrap:nowrap; }
.agent-panel button { font-size:.82rem; }
.agent-panel [data-notice] { margin:0 10px 8px; font-size:.82rem; max-height:100px; overflow:auto; }
.agent-history { border-bottom:1px solid var(--zea-border); flex:0 0 auto; min-height:0; max-height:38%; overflow:auto; background:var(--zea-surface); padding:0 12px 8px; }
.agent-history summary { padding:7px 0; font-weight:600; font-size:.85rem; position:sticky; top:0; background:var(--zea-surface); z-index:1; }
.agent-session-list { display:flex; flex-direction:column; gap:4px; }
.agent-panel .agent-session { display:grid; grid-template-columns:16px 1fr auto; gap:2px 8px; width:100%; text-align:left; padding:8px 10px; margin:0; background:transparent; color:var(--zea-text); border:1px solid transparent; }
.agent-session > .button-icon { grid-column:1; grid-row:1/3; align-self:center; color:var(--zea-secondary); }
.agent-session > span { grid-column:2; }
.agent-session > time { grid-column:3; }
.agent-session strong { grid-column:2/-1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }
.agent-session .muted { font-size:.74rem; }
.agent-panel .agent-session:hover { background:var(--zea-surface-soft); }
.agent-panel .agent-session[aria-pressed=true] { border-color:var(--zea-secondary-border); background:var(--zea-secondary-soft); }
.agent-empty { padding:16px; color:var(--zea-muted); font-size:.85rem; }
.agent-conversation { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
.agent-conversation.is-working { position:relative; isolation:isolate; background:var(--zea-conversation-background); }
.agent-conversation.is-working::before { content:""; position:absolute; inset:-35%; z-index:-1; pointer-events:none; background:radial-gradient(ellipse at 18% 28%,rgba(18,107,104,.28),transparent 57%),radial-gradient(ellipse at 82% 38%,rgba(105,69,165,.24),transparent 58%),radial-gradient(ellipse at 46% 84%,rgba(44,120,171,.25),transparent 57%); animation:agent-working-background 9s ease-in-out infinite; }
.agent-conversation.is-working .agent-conversation-scroll { background:transparent; }
.agent-conversation.is-work-paused::before { animation-play-state:paused; }
@keyframes agent-working-background { 0%,100% { transform:translate(-6%,-4%) rotate(-4deg); } 50% { transform:translate(7%,5%) rotate(6deg); } }
@media (prefers-reduced-motion:reduce) { .agent-conversation.is-working::before { animation:none; transform:none; } }
@media (forced-colors:active) { .agent-conversation.is-working::before { display:none; } .agent-conversation.is-working .agent-conversation-scroll { background:Canvas; } }
.agent-conversation-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; padding:10px 12px; border-bottom:1px solid var(--zea-border); }
.agent-conversation-heading > div { min-width:0; }
.agent-conversation-heading h3 { margin:0; overflow-wrap:anywhere; }
.agent-conversation-heading p { margin:3px 0 0; }
.agent-conversation-heading button { flex-shrink:0; margin:0; }
#externalSessionHint { margin:0; padding:8px 12px; font-size:.78rem; }
.agent-conversation-scroll { flex:1; min-height:0; overflow:auto; padding:12px; background:var(--zea-conversation-background); --zea-muted:#53656a; }
.agent-messages { display:flex; flex-direction:column; gap:10px; }
.agent-message { border:1px solid var(--zea-border); background:var(--zea-surface); padding:10px 12px; border-radius:8px; font-size:.85rem; min-width:0; }
.agent-message header { display:flex; justify-content:space-between; gap:8px; margin-bottom:6px; font-size:.75rem; color:var(--zea-muted); }
.agent-message time { font-size:.7rem; }
.agent-message-body { white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-message-user { margin-left:22px; background:var(--zea-primary-soft); border-color:#c0dacf; }
.agent-message-agent,.agent-message-question { margin-right:12px; }
.agent-message-question { border-left:3px solid var(--zea-secondary); }
.agent-message-error { border-color:#e6b9c3; color:var(--zea-error); background:var(--zea-error-soft); }
.agent-message-activity { border:0; background:transparent; padding:2px 4px; font-size:.77rem; color:var(--zea-muted); }
.agent-message-activity header { display:none; }
.agent-tool-call[data-status=failed] { border-left:3px solid var(--zea-secondary); padding-left:8px; }
.agent-tool-call details { margin-top:4px; }
.agent-tool-call summary { cursor:pointer; }
.agent-tool-call pre { margin:4px 0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:inherit; }
.agent-reply:not(:empty) { border-top:1px solid var(--zea-border); background:var(--zea-surface); padding:10px 12px; max-height:40%; overflow:auto; }
.agent-reply h3 { margin:0; }
.agent-reply textarea { min-height:65px; }
.agent-reply pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.agent-question { min-width:0; margin:12px 0; padding:0; border:0; }
.agent-question legend { margin-bottom:7px; font-size:.88rem; font-weight:600; overflow-wrap:anywhere; }
.agent-question-option { display:flex; align-items:flex-start; gap:8px; padding:8px; margin:6px 0; border:1px solid var(--zea-border); border-radius:5px; cursor:pointer; }
.agent-question-option:has(input:checked) { background:var(--zea-primary-soft); border-color:var(--zea-primary); }
.agent-question-option input[type=radio] { width:auto; flex:0 0 auto; margin:3px 0 0; accent-color:var(--zea-primary); }
.agent-question-option span { min-width:0; display:flex; flex-direction:column; gap:3px; overflow-wrap:anywhere; }
.agent-question-option strong { font-size:.84rem; font-weight:600; }
.agent-question-option small { color:var(--zea-muted); font-size:.78rem; font-weight:400; }

.agent-conversation-heading .row-actions { flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.agent-composer { flex-shrink:0; padding:10px 12px; border-top:1px solid var(--zea-border); background:var(--zea-surface); }
.agent-composer label { margin:0 0 5px; }
.agent-composer textarea { min-height:64px; max-height:min(240px, 30dvh); resize:none; overflow-y:auto; margin-bottom:8px; }
.agent-composer .row-actions { justify-content:space-between; gap:8px; }
.agent-composer .muted,.agent-session-hint { font-size:.8rem; }
.agent-session-hint { margin:0; padding:10px 12px; border-top:1px solid var(--zea-border); }

.agent-session-row { display:flex; align-items:center; gap:4px; }
.agent-session-row > .agent-session { flex:1; min-width:0; }
.agent-session-row > .agent-session-delete { flex:0 0 28px; width:28px; height:28px; padding:5px; color:var(--zea-muted); }
.agent-session-row > .agent-session-delete:hover { color:var(--zea-error); }

.diagram-viewport { background:var(--zea-surface-soft); overscroll-behavior:contain; overflow-anchor:none; }
.diagram-surface { position:relative; flex:none; }
.diagram-paper-host { position:absolute !important; left:0; top:0; }
.diagram-origin { position:absolute; left:3px; top:2px; pointer-events:none; font-size:9px; color:#9aafac; }
.diagram-boundary { position:absolute; z-index:2; color:#92afaa; touch-action:none; }
.diagram-boundary::before { content:''; position:absolute; pointer-events:none; }
.diagram-boundary-width { width:12px; cursor:ew-resize; }
.diagram-boundary-height { height:12px; cursor:ns-resize; }
.diagram-boundary-width::before { left:5px; top:0; height:100%; border-left:2px dashed #b8cfcb; }
.diagram-boundary-height::before { left:0; top:5px; width:100%; border-top:2px dashed #b8cfcb; }
.diagram-boundary-label { position:absolute; font-size:10px; line-height:16px; background:var(--zea-surface-soft); padding:0 4px; pointer-events:none; }
.diagram-boundary-width .diagram-boundary-label { right:9px; top:5px; }
.diagram-boundary-height .diagram-boundary-label { left:5px; top:9px; }
.diagram-boundary:focus-visible { outline:1px solid var(--zea-secondary); outline-offset:1px; }
.diagram-boundary[aria-disabled=true] { cursor:default; }

.orphan-artifact-list { display:flex; flex-direction:column; gap:6px; max-height:45vh; overflow:auto; margin:12px 0; }
.orphan-artifact-row { display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border:1px solid var(--zea-border); border-radius:6px; }
.orphan-artifact-row > input[type=checkbox] { width:16px; height:16px; flex:none; margin:3px 0 0; }
.orphan-artifact-row > span { display:flex; flex-direction:column; min-width:0; gap:2px; overflow-wrap:anywhere; }
.orphan-artifact-row .muted { font-size:.8rem; }
.orphan-progress { display:flex; align-items:center; gap:12px; padding:12px; margin:12px 0; border:1px solid var(--zea-border); border-radius:6px; background:var(--zea-primary-soft); }
.orphan-progress .diagram-save-spinner { flex:none; width:24px; height:24px; border-width:3px; }
.orphan-progress p { margin:4px 0 0; }

.proposal-diff{width:100%;table-layout:fixed;margin:.75rem 0}.proposal-diff th,.proposal-diff td{width:50%;vertical-align:top;padding:.5rem;border:1px solid var(--zea-border)}.proposal-diff pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.8rem;max-height:22rem;overflow:auto}

/* One stable activity row per response, independent of conversation polling. */
.agent-thinking { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; padding:9px 12px; border-bottom:1px solid var(--zea-border); background:var(--zea-surface); font-size:.82rem; }
.agent-thinking[hidden] { display:none; }
.agent-thinking-state { display:flex; align-items:center; gap:8px; min-width:0; }
.agent-thinking-label { color:var(--zea-muted); font-weight:600; }
.agent-thinking-elapsed { flex-shrink:0; color:var(--zea-muted); font-variant-numeric:tabular-nums; font-size:.77rem; }
.agent-thinking-dots { display:inline-flex; align-items:center; gap:3px; height:14px; }
.agent-thinking-dots i { width:5px; height:5px; border-radius:50%; background:var(--zea-primary); }
.agent-thinking-dots i:nth-child(2) { background:var(--zea-secondary); }
.agent-thinking-dots i:nth-child(3) { background:#2c78ab; }
.agent-thinking[data-state=running] .agent-thinking-label { background:linear-gradient(100deg,var(--zea-primary),var(--zea-secondary),#2c78ab,var(--zea-primary)); background-size:250% 100%; background-clip:text; -webkit-background-clip:text; color:transparent; animation:agent-thinking-colors 3s linear infinite; }
.agent-thinking[data-state=running] .agent-thinking-dots i { animation:agent-thinking-pulse 1.3s ease-in-out infinite; }
.agent-thinking[data-state=running] .agent-thinking-dots i:nth-child(2) { animation-delay:.18s; }
.agent-thinking[data-state=running] .agent-thinking-dots i:nth-child(3) { animation-delay:.36s; }
.agent-thinking.is-paused .agent-thinking-label,.agent-thinking.is-paused .agent-thinking-dots i { animation-play-state:paused; }
@keyframes agent-thinking-colors { from { background-position:0% 50%; } to { background-position:250% 50%; } }
@keyframes agent-thinking-pulse { 0%,70%,100% { transform:translateY(0); opacity:.5; } 35% { transform:translateY(-3px); opacity:1; } }
@media (prefers-reduced-motion:reduce) { .agent-thinking .agent-thinking-label,.agent-thinking .agent-thinking-dots i { animation:none !important; } }

@media (forced-colors:active) { .agent-thinking[data-state=running] .agent-thinking-label { color:CanvasText; background:none; } .agent-thinking-dots i { background:CanvasText; } }

.agent-rich-message { white-space:normal; line-height:1.55; }.agent-rich-message>:first-child { margin-top:0; }.agent-rich-message>:last-child { margin-bottom:0; }.agent-rich-message p { margin:0 0 .65rem; }.agent-rich-message h1,.agent-rich-message h2,.agent-rich-message h3 { font-size:1.05rem; margin:.9rem 0 .45rem; }.agent-rich-message ul,.agent-rich-message ol { padding-left:1.4rem; }.agent-rich-message pre,.agent-rich-message code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.8rem; }.agent-rich-message pre { white-space:pre; overflow:auto; padding:.7rem; border-radius:5px; background:var(--zea-surface-soft); }.agent-rich-message code { overflow-wrap:anywhere; }.agent-rich-message blockquote { border-left:3px solid var(--zea-secondary-border); margin:.7rem 0; padding-left:.7rem; color:var(--zea-muted); }.agent-table-scroll { overflow-x:auto; margin:.6rem 0; }.agent-rich-message table { width:100%; border-collapse:collapse; font-size:.8rem; }.agent-rich-message th,.agent-rich-message td { border:1px solid var(--zea-border); padding:.4rem .5rem; vertical-align:top; min-width:6rem; }.agent-rich-message th { background:var(--zea-surface-soft); font-weight:600; }

.diagram-save-host { position:relative; isolation:isolate; }
.diagram-save-overlay { position:absolute; inset:0; z-index:30; display:grid; place-items:center; padding:24px; background:rgb(244 248 248 / 78%); cursor:progress; }
.diagram-save-overlay[hidden] { display:none; }
.diagram-save-card { display:flex; flex-direction:column; align-items:center; gap:12px; max-width:440px; padding:28px; border:1px solid var(--zea-border); border-radius:14px; background:var(--zea-surface,#fff); box-shadow:0 12px 38px rgb(30 65 67 / 12%); text-align:center; }
.diagram-save-card p { margin:0; }
.diagram-save-spinner { width:34px; height:34px; border:4px solid var(--zea-border); border-top-color:var(--zea-primary); border-right-color:var(--zea-secondary); border-radius:50%; animation:diagram-save-spin 1s linear infinite; }
.diagram-save-elapsed { color:var(--zea-muted); font-variant-numeric:tabular-nums; }
@keyframes diagram-save-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .diagram-save-spinner { animation:none; } }

/* The project owns persistence and history; diagrams are views of its draft. */
.project-actions { display: flex; align-items: center; flex-shrink: 0; gap: 2px; padding: 0 6px; border-right: 1px solid var(--zea-border); }
.project-actions .icon-button { width: 30px; height: 32px; }
.project-actions .project-settings-button { flex: 0 0 30px; }
.project-titlebar #projectTitle.is-dirty { color: var(--zea-error); font-weight: 600; }
.project-conflict-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.project-conflict-values pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:220px; overflow:auto; padding:10px; background:var(--zea-surface-soft); border:1px solid var(--zea-border); font:12px ui-monospace,monospace; }
.project-conflict-row { padding:12px 0; border-bottom:1px solid var(--zea-border); }.project-conflict-row h2 { font-size:1rem; }.project-conflict-row label { max-width:420px; }
.zvc-editor-dialog.dialog-draft-changes { width:min(1120px,calc(100vw - 32px)); }
.dialog-draft-changes>div { display:flex; flex-direction:column; max-height:calc(100dvh - 40px); }
.draft-changes-body { padding:0 20px 16px; min-height:0; overflow:auto; }
.draft-changes-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.draft-changes-search { display:block; max-width:480px; margin:0 0 16px; }
.draft-change-row { border:1px solid var(--zea-border); border-radius:5px; margin:8px 0; }
.draft-change-row>summary { display:flex; align-items:center; gap:12px; padding:12px; cursor:pointer; background:var(--zea-surface-soft); list-style:disclosure-closed; }
.draft-change-row>summary::before { content:'▸'; color:var(--zea-muted); }
.draft-change-row[open]>summary::before { content:'▾'; }
.draft-change-heading { display:flex; flex:1; min-width:0; flex-direction:column; gap:3px; overflow-wrap:anywhere; }
.draft-change-status { font-size:.8rem; font-weight:600; color:var(--zea-primary); }
.draft-change-status.is-deleted { color:var(--zea-error); }
.draft-change-status.is-modified { color:var(--zea-secondary); }
.draft-change-fields { width:100%; table-layout:fixed; border-collapse:collapse; font-size:.85rem; }
.draft-change-fields th,.draft-change-fields td { padding:10px; vertical-align:top; border-top:1px solid var(--zea-border); text-align:left; }
.draft-change-fields th:first-child { width:20%; overflow-wrap:anywhere; }
.draft-change-fields pre { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; max-height:240px; overflow:auto; font:12px/1.5 ui-monospace,monospace; }
.draft-changes-actions { flex-shrink:0; margin:0; padding:12px 20px; }
.draft-changes-actions .danger { margin-right:auto; background:var(--zea-error); border-color:var(--zea-error); }
@media(max-width:650px) { .draft-change-fields th,.draft-change-fields td { padding:6px; } .draft-change-row>summary { gap:7px; } }
.project-conflict-notice { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:8px 14px; background:#fff4e4; color:#704600; border-bottom:1px solid #e4c990; font-size:.85rem; }.project-conflict-notice[hidden] { display:none; }
.project-toasts { position:fixed; bottom:20px; right:20px; z-index:1400; pointer-events:none; max-width:min(420px,calc(100vw - 40px)); }.project-toast { padding:12px 16px; border:1px solid var(--zea-border); border-left:4px solid var(--zea-primary); background:var(--zea-surface,#fff); box-shadow:0 5px 20px #0002; border-radius:7px; color:var(--zea-text); }
.invitation-user-search { position:relative; }
.invitation-user-search p { margin:.3rem 0 .6rem; font-size:.8rem; }
.invitation-user-suggestions { position:absolute; top:100%; left:0; right:0; z-index:5; max-height:240px; overflow:auto; border:1px solid var(--zea-control-border); border-radius:6px; background:var(--zea-surface); box-shadow:0 5px 16px #0002; }
.invitation-user-suggestions button { display:flex; flex-direction:column; align-items:flex-start; width:100%; margin:0; padding:.45rem .7rem; border:0; border-radius:0; background:var(--zea-surface); color:var(--zea-text); text-align:left; overflow-wrap:anywhere; }
.invitation-user-suggestions button:hover,.invitation-user-suggestions button[aria-selected=true] { background:var(--zea-primary-soft); color:var(--zea-primary-hover); }
.invitation-user-suggestions small { color:var(--zea-muted); font-weight:400; }
@media(max-width:650px) { .project-conflict-values { grid-template-columns:1fr; } }

/* Requirements use a list editor while retaining independent model identities. */
.requirements-editor { display:grid; grid-template-columns:minmax(230px, 30%) minmax(0, 1fr); gap:16px; min-height:440px; align-items:start; }
.requirements-sidebar { display:flex; flex-direction:column; gap:8px; border-right:1px solid var(--zea-border); padding-right:14px; min-width:0; }
.requirement-list { display:flex; flex-direction:column; gap:1px; max-height:min(62dvh, 660px); overflow:auto; }
.requirement-list-item { display:block; flex-shrink:0; width:100%; margin:0; padding:5px 7px; text-align:left; font-size:.8rem; font-weight:400; line-height:1.35; background:transparent; color:var(--zea-text); border:1px solid transparent; border-radius:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.requirement-list-item:hover { background:var(--zea-surface-soft); }
.requirements-sidebar > button { margin:0; padding:5px 9px; font-size:.8rem; align-self:flex-start; }
.requirements-sidebar > label { margin:0; font-size:.8rem; }
.requirements-sidebar input[type=search] { margin-bottom:0; }
.requirement-list-item[aria-pressed=true] { background:var(--zea-primary-soft, #e4f3ef); border-color:var(--zea-primary); }
.requirement-detail { min-width:0; }
.requirement-actions { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.requirement-actions button { margin:0; padding:5px 9px; font-size:.78rem; }
.requirement-text { font-family:ui-monospace, monospace; resize:vertical; min-height:190px; }
.markdown-source { font-family:ui-monospace, monospace; tab-size:4; }
.requirement-references { display:flex; flex-direction:column; gap:6px; max-height:300px; overflow:auto; }
.requirement-reference-row { display:flex; align-items:center; gap:6px; }
.requirement-reference-row label { display:flex; align-items:center; gap:8px; flex:1; margin:0; }
.requirement-reference-row input[type=checkbox] { width:auto; }
.requirement-reference-type { font-weight:600; margin:8px 0 0; }

.requirement-reference-info { flex:0 0 26px; width:26px; height:26px; font-size:0; }
.requirement-detail [data-property-panel=requirement-references] .requirement-references { max-height:min(60dvh, 660px); }
.attribute-reference-section { margin:0 0 18px; }.attribute-reference-section h3 { font-size:.9rem; margin:0 0 8px; }
.attribute-list-row{display:flex;align-items:center;gap:3px;flex-shrink:0;min-width:0}
.attribute-list-row>.requirement-list-item{display:flex;align-items:center;gap:5px;flex:1;min-width:0;width:auto}
.attribute-list-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attribute-primary-key{display:inline-flex;flex:none;color:var(--zea-primary)}
.attribute-order-actions{display:flex;flex:none;gap:1px}
.attribute-order-actions>button{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin:0;padding:4px;border:0;background:transparent;color:var(--zea-muted)}
.attribute-order-actions>button:hover:not(:disabled){background:var(--zea-primary-soft);color:var(--zea-primary)}
.attribute-order-actions>button:disabled{opacity:.3}
.attribute-identity{font-size:.75rem;margin:0;overflow-wrap:anywhere}
#diagramReferenceList{display:block;max-height:60dvh;overflow:auto;min-width:0}
#diagramReferenceList details{margin:0;padding:0;border:0}
#diagramReferenceList summary{padding:3px 0;color:var(--zea-muted);font-size:.85rem;cursor:pointer}
#diagramReferenceList details>:not(summary){margin-left:32px}
#diagramReferenceList .diagram-reference-item{display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:5px 7px;text-align:left;background:transparent;color:var(--zea-text);border:0;border-radius:4px;font-size:.85rem;font-weight:400;line-height:1.4;white-space:normal}
#diagramReferenceList details>.diagram-reference-item{margin-left:32px;width:calc(100% - 32px)}
#diagramReferenceList summary>.diagram-reference-item{display:inline-flex;width:calc(100% - 20px);vertical-align:middle}
#diagramReferenceList button.diagram-reference-item:hover{background:var(--zea-surface-soft)}
#diagramReferenceList .diagram-reference-item[aria-current=page]{background:var(--zea-primary-soft);color:var(--zea-primary);font-weight:700}
#diagramReferenceList .diagram-reference-item[aria-current=page] .diagram-reference-name{font-weight:700}
#diagramReferenceList .diagram-reference-group{display:inline-flex;align-items:center;gap:7px;font-weight:600}
#diagramReferenceList .diagram-reference-name{flex:1;overflow-wrap:anywhere;min-width:0}
#diagramReferenceList small{font-size:.72rem;flex-shrink:0}

.reference-suggestion-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--zea-border)}
.reference-suggestion{display:grid;grid-template-columns:20px 1fr;gap:4px 8px;padding:8px;flex:1;min-width:0}
.reference-suggestion span{grid-column:2;font-size:.85rem;color:var(--zea-muted)}
.requirement-traceability{width:100%;border-collapse:collapse}.requirement-traceability th,.requirement-traceability td{padding:8px;text-align:left;vertical-align:top;border-bottom:1px solid var(--zea-border)}
.traceability-reference{display:block;margin:2px 0;background:none;border:0;color:var(--zea-primary);text-align:left}

.artifact-editor-type > div { flex: 1; min-width: 0; }

/* Organization library file explorer. */
.library-explorer { display: grid; grid-template-columns: minmax(210px, 28%) minmax(0, 1fr); min-height: 440px; height: min(65dvh, 760px); border: 1px solid var(--zea-border); border-radius: 8px; overflow: hidden; }
#libraryTree { padding: 6px; overflow: auto; border-right: 1px solid var(--zea-border); background: var(--zea-surface-soft); }
#libraryTree ul { list-style: none; margin: 0; padding: 0; }
#libraryTree ul[role=group] { margin-left: 14px; }
#libraryTree li { margin: 0; padding: 0; }
.library-tree-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 22px; align-items: center; gap: 2px; min-height: 27px; border-radius: 4px; }
.library-tree-row:hover { background: var(--zea-primary-soft); }
#libraryTree .library-node-label { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; min-height: 26px; margin: 0; padding: 3px 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--zea-text); font-size: .9rem; line-height: 1.25; font-weight: 400; text-align: left; box-shadow: none; }
#libraryTree .library-node-label[aria-selected=true] { background: var(--zea-primary-soft); border-color: var(--zea-control-border); color: var(--zea-primary); }
#libraryTree .library-node-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#libraryTree .is-active-version .library-node-name { font-weight: 700; }
#libraryTree .library-node-icon { flex: none; width: 15px; height: 15px; color: var(--zea-muted); }
#libraryTree [data-library-kind=type] .library-node-icon, #libraryTree [data-library-kind=library] .library-node-icon { color: var(--zea-primary); }
#libraryTree [data-library-kind=version] .library-node-icon { color: var(--zea-secondary); }
#libraryTree [data-library-kind=directory] .library-node-icon { color: var(--zea-folder); }
#libraryTree .library-node-disclosure, #libraryTree .library-node-more { display: inline-flex; align-items: center; justify-content: center; min-width: 0; width: 20px; height: 24px; min-height: 0; margin: 0; padding: 2px; border: 0; background: transparent; color: var(--zea-muted); box-shadow: none; }
#libraryTree .library-node-disclosure { width: 14px; }
#libraryTree .library-node-disclosure svg { width: 12px; height: 12px; transition: transform .1s; }
#libraryTree .library-node-disclosure.is-expanded svg { transform: rotate(90deg); }
#libraryTree .library-node-disclosure.is-placeholder { visibility: hidden; }
#libraryTree .library-tree-empty { padding: 2px 4px 3px 20px; color: var(--zea-muted); font-size: .85rem; line-height: 1.3; }
.library-active-badge { flex: none; margin-left: auto; padding: 1px 5px; border-radius: 8px; background: var(--zea-primary-soft); color: var(--zea-primary); font-size: .72rem; font-weight: 600; }
.library-toolbar button { padding: 5px 9px; min-height: 30px; font-size: .9rem; }
.library-toolbar { gap: 8px; }
.library-inspector { min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding: 14px; gap: 10px; }
.library-inspector .inspector-header { padding: 0; flex: none; }
.library-inspector h2, .library-inspector p { overflow-wrap: anywhere; }
.library-preview { min-height: 0; flex: 1; overflow: auto; }
.library-preview table { width: 100%; border-collapse: collapse; }
.library-preview td, .library-preview th { padding: 7px; text-align: left; border-bottom: 1px solid var(--zea-border); }
.library-preview td button { text-align: left; overflow-wrap: anywhere; }
.library-code { font-family: ui-monospace, monospace; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.library-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.library-pdf { width: 100%; height: 100%; min-height: 360px; border: 1px solid var(--zea-border); }
.library-reference-options { display: grid; gap: 8px; max-height: 50dvh; overflow: auto; }
.zvc-editor-dialog.dialog-library { width: min(1120px, calc(100vw - 32px)); }
@media (max-width: 650px) { .library-explorer { grid-template-columns: minmax(150px, 35%) minmax(0, 1fr); } .library-inspector { padding: 8px; } }

.methodology-selectors, .architecture-selectors { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, .6fr); gap: 12px; }
.methodology-summary, .architecture-summary { max-height: 280px; overflow: auto; padding: 12px 16px; border: 1px solid var(--zea-border); border-radius: 6px; background: var(--zea-surface-soft); margin-bottom: 12px; overflow-wrap: anywhere; }
.methodology-summary > :first-child, .architecture-summary > :first-child { margin-top: 0; }
@media (max-width: 550px) { .methodology-selectors, .architecture-selectors { grid-template-columns: 1fr; } }

.requirements-sidebar details { border-top:1px solid var(--zea-border); padding-top:8px; }
.requirements-sidebar summary { cursor:pointer; font-size:.82rem; font-weight:600; padding:4px 0; }
.requirements-sidebar summary small { color:var(--zea-muted); font-weight:400; }
.requirements-sidebar [data-requirement-new] { margin:5px 0; padding:5px 7px; font-size:.78rem; }
.requirements-sidebar [data-requirement-list] { max-height:min(28dvh, 300px); }

.requirement-identity { display:grid; grid-template-columns:minmax(90px, 130px) minmax(0, 1fr); gap:12px; align-items:start; }
.requirement-identity label { min-width:0; }
.requirement-identity input { width:100%; }
.participants-label { display:block; font-weight:600; margin-bottom:6px; }
.participants-field { display:flex; gap:8px; align-items:center; margin-bottom:16px; }
.participants-list { display:flex; flex:1; flex-wrap:wrap; gap:5px; min-width:0; padding:7px; border:1px solid var(--zea-control-border); border-radius:5px; min-height:36px; }
.participant-chip { padding:2px 6px; border-radius:4px; background:var(--zea-surface-soft); overflow-wrap:anywhere; font-size:.82rem; }
.actor-selection-options { display:flex; flex-direction:column; gap:6px; max-height:50dvh; overflow:auto; }
.actor-selection-option { display:flex; align-items:center; gap:9px; padding:7px; margin:0; border-bottom:1px solid var(--zea-border); }
.actor-selection-option input { width:auto; margin:0; }
.actor-selection-option span { flex:1; overflow-wrap:anywhere; }
.actor-selection-option small { flex-shrink:0; }
@media(max-width:480px) { .requirement-identity { grid-template-columns:90px minmax(0, 1fr); gap:8px; } }

.sidebar-resize-handle { position:absolute; z-index:6; top:0; bottom:0; right:-5px; width:9px; cursor:col-resize; touch-action:none; }
.sidebar-resize-handle::after { content:""; position:absolute; top:0; bottom:0; right:4px; width:2px; background:transparent; }
.sidebar-resize-handle:hover::after,.sidebar-resize-handle:focus-visible::after,.is-resizing-sidebar .sidebar-resize-handle::after { background:var(--zea-secondary); }
.sidebar-resize-handle:focus-visible { outline:2px solid var(--zea-secondary); outline-offset:-2px; }
.is-resizing-sidebar,.is-resizing-sidebar * { cursor:col-resize !important; user-select:none !important; }
.is-resizing-sidebar .sidebar { transition:none; }

/* Scenario interaction trees remain compact beside the selected step editor. */
.scenario-editor { display: grid; grid-template-columns: minmax(230px, 32%) minmax(0, 1fr); gap: 18px; min-height: 380px; }
.scenario-sidebar { border-right: 1px solid var(--zea-border); padding-right: 12px; min-width: 0; }
.scenario-tree-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.scenario-tree { max-height: 52vh; overflow: auto; padding: 2px; }
.scenario-tree [role=treeitem] { outline: none; }
.scenario-tree-row { display: flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 6px 2px calc(var(--step-depth) * 14px + 10px); border-radius: 5px; position: relative; cursor: pointer; font-size: .82rem; }
.scenario-tree-row:hover { background: var(--zea-surface); }
.scenario-tree [aria-selected=true] > .scenario-tree-row { background: var(--zea-tree-selected); box-shadow: inset 3px 0 var(--zea-primary); }
.scenario-tree [role=treeitem]:focus-visible > .scenario-tree-row { outline: 2px solid var(--zea-secondary); outline-offset: -2px; }
.scenario-tree .step-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; min-width: 18px; padding: 0; border: 0; background: transparent; color: var(--zea-muted); font-size: 13px; line-height: 22px; box-shadow: none; }
.scenario-tree .step-toggle:disabled { opacity: 0; }
.scenario-tree .step-label { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.scenario-tree svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--zea-primary); }
.scenario-tree .step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scenario-tree .step-ordinal { color: var(--zea-muted); font-size: .67rem; flex-shrink: 0; }
.scenario-tree .step-menu { min-width: 22px; width: 22px; height: 22px; padding: 2px; border: 0; background: transparent; }
.scenario-tree-row[draggable=true] { cursor: grab; }
.scenario-tree-row[data-drop=inside] { outline: 2px solid var(--zea-primary); outline-offset: -2px; background: var(--zea-tree-selected); }
.scenario-tree-row[data-drop=before]::before, .scenario-tree-row[data-drop=after]::after { content: ''; position: absolute; left: 0; right: 0; border-top: 2px solid var(--zea-secondary); pointer-events: none; }
.scenario-tree-row[data-drop=before]::before { top: 0; }.scenario-tree-row[data-drop=after]::after { bottom: 0; }
.scenario-detail { min-width: 0; }.scenario-detail > small { display: block; margin-bottom: 6px; }
.scenario-detail .property-tabs { margin-bottom: 12px; }.scenario-tree-hint { font-size: .72rem; margin-top: 10px; }
.participant-chip.inherited { opacity: .85; border-style: dashed; }
[data-step-inherited-actors], [data-step-inherited-requirements] { margin-bottom: 14px; }
.functional-selection-group { margin: 5px 0; }.functional-selection-group summary { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 5px 0; list-style: revert; }
.functional-selection-group summary::before { content: '▸'; }.functional-selection-group[open] summary::before { content: '▾'; }
.functional-selection-group summary small { margin-left: auto; color: var(--zea-muted); }.functional-selection-group svg { width: 16px; height: 16px; flex-shrink: 0; }
.functional-selection-group .actor-selection-option { margin-left: 20px; }
@media (max-width: 700px) { .scenario-editor { grid-template-columns: minmax(0, 1fr); }.scenario-sidebar { border-right: 0; border-bottom: 1px solid var(--zea-border); padding: 0 0 10px; }.scenario-tree { max-height: 30vh; } }

/* Shared diagram-tree placement; separate from personal tab ordering. */
#diagramList .modeling-row[data-tree-draggable=true] { cursor: grab; position: relative; }
#diagramList .modeling-row[data-tree-drop=before]::before, #diagramList .modeling-row[data-tree-drop=after]::after { content: ''; position: absolute; left: 0; right: 0; border-top: 2px solid var(--zea-secondary); pointer-events: none; z-index: 2; }
#diagramList .modeling-row[data-tree-drop=before]::before { top: 0; }#diagramList .modeling-row[data-tree-drop=after]::after { bottom: 0; }
#diagramList [data-tree-drop=inside] { background: var(--zea-tree-selected); outline: 2px solid var(--zea-primary); outline-offset: -2px; border-radius: 5px; }
#diagramList .modeling-row[data-tree-draggable=true] .modeling-row-label { cursor: grab; }

/* Screen wireframe editor: editor chrome uses the portal theme. */
.screen-editor-body{display:flex;flex:1;min-height:0;overflow:hidden}
.screen-palette,.screen-inspector{flex:0 0 180px;overflow:auto;background:var(--zea-surface,#fff);padding:10px;border-right:1px solid var(--zea-border,#d6e3de);font-size:12px}
.screen-inspector{flex-basis:240px;border-right:0;border-left:1px solid var(--zea-border,#d6e3de)}
.screen-palette[hidden],.screen-inspector[hidden]{display:none}
.screen-palette input{width:100%;margin-bottom:10px}
.screen-palette summary,.screen-inspector summary{font-weight:600;padding:7px 0;cursor:pointer}
.screen-widget-choice,.screen-structure-item{display:flex;align-items:center;gap:6px;width:100%;padding:5px 6px;margin:2px 0;background:transparent;border:1px solid transparent;border-radius:4px;text-align:left;color:inherit;font:inherit}
.screen-widget-choice svg{width:16px;height:16px;flex:none}
.screen-widget-choice:hover,.screen-structure-item:hover,.screen-structure-item[aria-pressed=true]{background:#e4f3ef;border-color:#b3d3c8}
.screen-widget-choice{cursor:grab}
.screen-viewport{flex:1;min-width:100px;position:relative;padding:16px}
.screen-surface{position:relative;flex:none;box-shadow:0 1px 5px #0002;background:white;margin:0 22px 22px 0}
.screen-surface>svg{display:block;overflow:visible;user-select:none}
.screen-surface [data-widget-id]{cursor:move;outline:none}
.screen-surface [data-widget-id]:focus{filter:drop-shadow(0 0 2px #146d68)}
.screen-surface [data-widget-tab]{cursor:pointer;outline:none}
.screen-surface [data-widget-tab]:focus-visible>path{stroke:var(--zea-primary);stroke-width:2.5}
.screen-property-form{display:flex;flex-direction:column;gap:8px;padding:8px 0}
.screen-property-form label{display:flex;flex-direction:column;gap:3px;font-weight:500}
.screen-property-form input,.screen-property-form select,.screen-property-form textarea{width:100%;box-sizing:border-box;font:inherit;padding:5px;border:1px solid #b9cec6;border-radius:4px;background:white}
.screen-property-form input[type=checkbox]{width:auto;align-self:flex-start}
.screen-page-boundary{position:absolute;background:none;border:0;border-right:2px dashed #9fbab0;border-bottom:2px dashed #9fbab0;padding:0}
.screen-page-width{right:-12px;top:0;height:100%;width:10px;cursor:ew-resize;border-bottom:0}
.screen-page-height{bottom:-12px;left:0;width:100%;height:10px;cursor:ns-resize;border-right:0}

.screen-property-form label{margin:0;font-size:12px}
.screen-widget-choice,.screen-structure-item{justify-content:flex-start}

.screen-property-section{border-bottom:1px solid var(--zea-border);padding-bottom:6px}
.screen-property-section>summary{font-size:12px;font-weight:600;margin-bottom:5px}
.screen-property-section>label{margin:0 0 8px}
.screen-property-section>small{display:block;color:var(--zea-muted);font-size:11px;line-height:1.45;margin:4px 0}
.screen-property-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-bottom:8px}
.screen-property-pair label{min-width:0}
.screen-widget-type{font-size:13px;margin:10px 0 4px;font-weight:600}
.screen-property-form>small{color:var(--zea-muted);font-size:11px}
.screen-property-form [aria-invalid=true]{border-color:var(--zea-danger,#a63838)}
.screen-property-error{color:var(--zea-danger,#a63838);font-size:12px;margin:0}

/* Group headings use the same before/after insertion cues as diagram rows. */
#diagramList summary[data-tree-draggable=true] { cursor: grab; position: relative; }
#diagramList summary[data-tree-drop=before]::before, #diagramList summary[data-tree-drop=after]::after { content: ''; position: absolute; left: 0; right: 0; border-top: 2px solid var(--zea-secondary); pointer-events: none; z-index: 2; }
#diagramList summary[data-tree-drop=before]::before { top: 0; }
#diagramList summary[data-tree-drop=after]::after { bottom: 0; }

/* Section dividers keep their actions hidden until the shape is hovered. */
.joint-element .separator-hover-tools {opacity:0;pointer-events:none;transition:opacity .12s;}
.joint-element:hover .separator-hover-tools {opacity:1;pointer-events:auto;}

.notification-resolved { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.notification-resolved input { width: auto; margin: 0; }

.traceability-toggle { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .78rem; }
.traceability-toggle[aria-pressed="true"] { color: var(--zea-primary); background: var(--zea-primary-soft, #e8f4f1); }
.traceability-artifact-warning { color: #8a4b12; border-left: 3px solid #a55b16; padding-left: 10px; font-weight: 600; }
.traceability-result { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
#traceabilityReviews pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; font-size: .78rem; }

.traceability-needs-review { border-left: 3px solid #a55b16; }

.traceability-artifacts { display: grid; gap: 10px; margin: 12px 0; }
.traceability-artifact-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: start; }
.traceability-artifact-label { color: var(--zea-muted); font-size: .8rem; padding-top: 3px; }
.traceability-source-list { display: grid; gap: 6px; }
.traceability-artifact { display: inline-flex; align-items: baseline; gap: 7px; overflow-wrap: anywhere; min-width: 0; }
.traceability-artifact svg { width: 18px; height: 18px; flex: 0 0 18px; align-self: center; }
a.traceability-artifact { color: var(--zea-primary); text-decoration: none; border-radius: 3px; }
a.traceability-artifact:hover { text-decoration: underline; }
a.traceability-artifact:focus-visible { outline: 2px solid var(--zea-secondary); outline-offset: 3px; }
.traceability-artifact-code { flex-shrink: 0; font-size: .8rem; }
.traceability-details { margin: 12px 0; }
.traceability-details > summary { color: var(--zea-primary); cursor: pointer; font-weight: 600; }
.traceability-cause { padding: 14px 0; border-top: 1px solid var(--zea-border); }
.traceability-cause:first-child { margin-top: 10px; }
.traceability-reason { white-space: pre-wrap; }
.traceability-change-fields { table-layout: fixed; width: 100%; }
.traceability-change-fields th:first-child { width: 22%; }
.traceability-change-fields pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; font: inherit; font-size: .85rem; }
.traceability-diff-legend { margin: 0 0 8px; font-size: .78rem; color: var(--zea-muted); }
.traceability-diff-removed { background: var(--zea-error-soft); color: var(--zea-error); text-decoration: line-through; }
.traceability-diff-added { background: var(--zea-primary-soft); color: var(--zea-primary-hover); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.traceability-initial-change { display: grid; gap: 6px; margin-top: 12px; }
@media (max-width: 600px) { .traceability-artifact-row { grid-template-columns: 1fr; gap: 4px; } }


.todo-assignment-option { display:flex; align-items:center; gap:10px; margin:8px 0; cursor:pointer; }
.todo-assignment-option input[role="switch"] { appearance:none; -webkit-appearance:none; flex:0 0 38px; width:38px; height:22px; padding:0; margin:0; border:1px solid var(--zea-muted); border-radius:12px; background:#dbe3e0; cursor:pointer; }
.todo-assignment-option input[role="switch"]::before { content:""; display:block; width:16px; height:16px; margin:2px; border-radius:50%; background:#ffffff; transition:transform .12s; }
.todo-assignment-option input[role="switch"]:checked { background:var(--zea-primary); border-color:var(--zea-primary); }
.todo-assignment-option input[role="switch"]:checked::before { transform:translateX(16px); }
.todo-assignment-option input[role="switch"]:focus-visible { outline:2px solid var(--zea-secondary); outline-offset:2px; }
.todo-assignment-option input[role="switch"]:disabled { opacity:.6; cursor:default; }
.todo-comments { max-height:42vh; min-height:80px; overflow:auto; margin:12px 0; }
.todo-comment { border:1px solid var(--zea-border); border-left:3px solid var(--zea-primary); border-radius:8px; padding:12px; margin:10px 2px; }
.todo-comment > strong,.todo-comment > small { display:block; }
.todo-comment > small { color:var(--zea-muted); margin-top:4px; }
.todo-comment > p,.todo-comment > blockquote,.todo-reply-context p { white-space:pre-wrap; overflow-wrap:anywhere; }
.todo-comment-reply { margin-left:24px; border-left-color:var(--zea-secondary); }
.todo-comment blockquote { margin:10px 0; padding-left:12px; border-left:2px solid var(--zea-border); color:var(--zea-muted); }
.todo-reply-context { padding:8px 12px; border-left:3px solid var(--zea-secondary); background:var(--zea-secondary-soft); }
@media (prefers-reduced-motion:reduce) { .todo-assignment-option input[role="switch"]::before { transition:none; } }

/* CR state is conveyed by both text and color, independently of the selection. */
.cr-list-item { display:flex; flex-direction:column; align-items:flex-start; gap:5px; }
.cr-status-badge { display:inline-flex; align-items:center; gap:5px; padding:2px 7px; border-radius:12px; font-size:11px; font-weight:600; }
.cr-status-pending { color:#92400e; background:#fff0d6; }
.cr-status-resolved { color:#1e4f91; background:#e8f1ff; }
.cr-status-verified { color:#25633e; background:#e2f3e8; }
.cr-status-discarded { color:#515c68; background:#edf0f3; }

/* Change request properties reserve room for paired specification fields. */
.zvc-editor-dialog.dialog-change-requests { width:min(1600px, calc(100vw - 40px)); }
.change-requests-editor { grid-template-columns:minmax(200px, 260px) minmax(0, 1fr); }
.change-requests-editor .requirement-identity { grid-template-columns:minmax(90px, 130px) minmax(0, 1fr) minmax(130px, 180px); }
.change-request-fields { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px 16px; }
.change-request-fields > label { display:flex; flex-direction:column; gap:6px; min-width:0; margin:0; }
.change-request-fields textarea { flex:1; width:100%; min-height:9rem; resize:vertical; }
@media (max-width: 1050px) { .change-request-fields { grid-template-columns:minmax(0, 1fr); } }
@media (max-width: 700px) {
    .change-requests-editor { grid-template-columns:minmax(0, 1fr); }
    .change-requests-editor .requirements-sidebar { border-right:0; border-bottom:1px solid var(--zea-border); padding:0 0 12px; }
    .change-requests-editor .requirement-list { max-height:28dvh; }
    .change-requests-editor .requirement-identity { grid-template-columns:minmax(0, 1fr); }
}
