/* Shared workspace presentation. Workflow content remains owned by index.js. */
:root {
    color-scheme: light;
    --ws-ink: #17324a;
    --ws-muted: #657b8d;
    --ws-border: #dfe8ef;
    --ws-blue: #246bd1;
    --ws-teal: #087e83;
}
* { box-sizing: border-box; }
body.b2base-workspace {
    display: block;
    height: auto;
    min-height: 100vh;
    margin: 0;
    overflow: auto;
    background: #f3f7fb;
    color: var(--ws-ink);
    font: 14px/1.5 "Segoe UI", Arial, sans-serif;
}
.b2base-workspace a { color: var(--ws-blue); }
.ws-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 12px max(28px, calc((100vw - 1536px) / 2));
    background: #fff;
    border-bottom: 1px solid var(--ws-border);
}
.ws-brand { display: flex; align-items: center; gap: 11px; color: var(--ws-ink) !important; text-decoration: none; }
.ws-brand img { width: 38px; height: 38px; object-fit: contain; }
.ws-brand strong { display: block; font-size: 21px; letter-spacing: -.65px; line-height: 1.1; }
.ws-brand small { display: block; margin-top: 4px; color: var(--ws-muted); font-size: 11px; letter-spacing: .7px; }
.ws-topnav { display: flex; align-items: center; gap: 20px; }
.ws-topnav a { font-weight: 600; text-decoration: none; }
.ws-topnav .ws-secondary-link { color: var(--ws-muted); }
.ws-topnav .ws-editor-link { padding: 9px 14px; border: 1px solid #cbddec; border-radius: 8px; background: #f8fbff; color: #235b95; }
.ws-topnav a:hover { color: #0b485a; }
.ws-shell { max-width: 1536px; margin: 0 auto; padding: 25px 28px 32px; }
.ws-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.ws-heading { min-width: 0; }
.ws-eyebrow { display: flex; align-items: center; gap: 9px; color: var(--ws-muted); font-size: 12px; margin: 0 0 7px; }
.ws-eyebrow span:last-child { padding: 2px 8px; background: #e5eef7; border-radius: 5px; color: #45637f; }
#header {
    display: block;
    background: transparent;
    color: var(--ws-ink);
    margin: 0;
    padding: 0;
    text-align: left;
    font-size: clamp(23px, 2.1vw, 31px);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.7px;
    border: 0;
    box-shadow: none;
    overflow-wrap: anywhere;
}
#header:empty::before { content: "Workflow Workspace"; }
#text-area {
    display: flex;
    align-items: center;
    min-height: 24px;
    max-width: 850px;
    background: transparent;
    margin: 8px 0 0;
    padding: 0;
    font-size: 14px;
    color: var(--ws-muted);
    border: 0;
    box-shadow: none;
    overflow: visible;
    overflow-wrap: anywhere;
}
#text-area:empty::before { content: "Aufgaben bearbeiten, Dokumente sammeln und Daten im Blick behalten."; }
.ws-stats { display: flex; flex-shrink: 0; gap: 0; margin: 0 0 2px; }
.ws-stat { padding: 0 20px; border-left: 1px solid #d6e1ea; }
.ws-stat:last-child { padding-right: 0; }
.ws-stat dt { color: var(--ws-muted); font-size: 12px; }
.ws-stat dd { color: var(--ws-ink); font-size: 24px; font-weight: 650; margin: 0 0 1px; line-height: 1.3; }
.ws-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
#style-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: #e7eef5;
    border: 1px solid #e0e8f0;
    border-radius: 10px;
    box-shadow: none;
    font-size: 13px;
    text-align: left;
}
#style-area .monospace-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: auto;
    aspect-ratio: auto;
    padding: 8px 12px;
    background: transparent;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 7px;
    box-shadow: none;
    font: 600 13px/1.4 "Segoe UI", Arial, sans-serif;
    color: #536a7d;
    cursor: pointer;
    transform: none;
    transition: background .15s ease, color .15s ease;
}
#style-area .monospace-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#style-area .monospace-button:hover { color: var(--ws-ink); background: #f5f9fc; }
#style-area .monospace-button[aria-pressed="true"] { background: #fff; color: #215a9d; border-color: #d9e4ef; box-shadow: 0 2px 4px #17324a08; }
.ws-view-hint { color: var(--ws-muted); font-size: 12px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.ws-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ws-border); border-radius: 13px; background: #fff; box-shadow: 0 3px 10px #17324a03; overflow: hidden; }
.ws-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 15px 20px; border-bottom: 1px solid #eaf0f5; }
.ws-card-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; line-height: 1.4; font-weight: 650; letter-spacing: -.1px; }
.ws-card-heading h2 svg { width: 18px; height: 18px; fill: none; stroke: #6988a1; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ws-card-heading small { color: var(--ws-muted); font-size: 11px; }
.ws-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 5px; color: var(--ws-teal); background: #e8f6f3; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ws-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #159a83; }
.ws-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 23px; padding: 0 7px; border-radius: 6px; background: #f0f5f9; color: #5b7388; font-size: 11px; font-weight: 600; white-space: nowrap; }
#workspace, #list, #docs, #bpmn, #json {
    display: block;
    grid-column: auto;
    grid-row: auto;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 20px;
    border: 0;
    background: #fff;
    box-shadow: none;
    color: var(--ws-ink);
    overflow: auto;
}
#workspace { flex: 1; min-height: 275px; max-height: 540px; padding: 22px; }
#workspace:empty::before { display: block; padding: 45px 20px; text-align: center; color: var(--ws-muted); content: "Der nächste Schritt wird hier angezeigt."; }
#workspace > p:first-child { margin-top: 0; font-size: 15px; font-weight: 400; }
#workspace > p { line-height: 1.65; }
#workspace > button { margin: 6px 8px 6px 0; }
#workspace form { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; max-width: 760px; }
#workspace form > div { width: 100%; }
#workspace label { display: block; margin: 0 0 6px; color: #35506a; font-size: 13px; font-weight: 600; }
#workspace input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
#workspace select, #workspace textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 41px;
    padding: 9px 12px;
    font: inherit;
    color: var(--ws-ink);
    background-color: #fff;
    border: 1px solid #ccdae5;
    border-radius: 7px;
    box-shadow: 0 1px 2px #17324a03;
    transition: border-color .15s, box-shadow .15s;
}
#workspace input[type="file"] { background: #f7fafc !important; padding: 12px !important; margin-bottom: 10px; border-style: dashed !important; }
#workspace input::file-selector-button { margin-right: 12px; border: 0; border-radius: 5px; padding: 6px 9px; background: #e2edf9; color: #295d95; font-weight: 600; cursor: pointer; }
#workspace input::placeholder, #workspace textarea::placeholder { color: #8b9ba9; }
#workspace input:focus, #workspace select:focus, #workspace textarea:focus { border-color: #6a9ee0; outline: 0; box-shadow: 0 0 0 3px #246bd114; }
#workspace button { padding: 10px 16px; border: 1px solid transparent; border-radius: 7px; font: 600 13px/1.5 "Segoe UI", Arial, sans-serif; color: #fff; background: var(--ws-blue); box-shadow: 0 2px 3px #246bd110; cursor: pointer; }
#workspace button:hover { background: #195bb7; }
#workspace button.ws-skip { color: #577085; background: #f0f5f9; border-color: #d9e5ee; box-shadow: none; }
#workspace .highlighted-button { background: #e4f4f0; color: #087969; border-color: #94d6c4; }
#workspace button:disabled { opacity: .5; cursor: not-allowed; }
#workspace input[type="checkbox"], #workspace input[type="radio"], .task-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ws-teal); vertical-align: middle; margin-right: 8px; }
#workspace iframe { max-width: 100%; border: 1px solid var(--ws-border); border-radius: 8px; }
#ro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; gap: 14px; grid-column: auto; grid-row: auto; min-width: 0; }
#ro .ws-card-heading { padding-left: 16px; padding-right: 16px; }
#list, #docs { flex: 1; max-height: 540px; padding: 15px; }
.ws-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 32px 18px; text-align: center; min-height: 220px; }
.ws-empty[hidden] { display: none; }
.ws-empty svg { width: 37px; height: 37px; margin-bottom: 9px; fill: none; stroke: #a7becf; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ws-empty strong { color: #527088; font-size: 12px; font-weight: 600; }
.ws-empty p { color: #8a9daa; font-size: 12px; margin: 0; max-width: 180px; line-height: 1.6; }
#list:empty, #docs:empty { flex: 0; padding: 0; }
.task-item { position: relative; padding: 9px 8px; margin-bottom: 7px; background: #f8fbfd; border: 1px solid #e7eef4; border-radius: 7px; overflow-wrap: anywhere; color: #375570; font-size: 13px; cursor: default; }
.task-item .task-item { margin-top: 8px; margin-bottom: 0; margin-left: 10px !important; padding: 6px; background: #fff; border-color: #e8eff4; }
.task-item.completed { color: #75938e; text-decoration: none; background: #f2faf7; border-color: #e1efe9; }
.task-item.completed > span { text-decoration: line-through; }
.file-item { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding: 11px 10px; border: 1px solid #e2eaf1; border-radius: 7px; color: #45647d; font-size: 12px; word-break: break-word; }
.file-item::before { content: ""; display: block; flex: 0 0 13px; height: 17px; border: 1.5px solid #88a4ba; border-radius: 2px; background: linear-gradient(#d9e6f1,#d9e6f1) 3px 6px / 6px 1px no-repeat, linear-gradient(#d9e6f1,#d9e6f1) 3px 10px / 6px 1px no-repeat; }
.ws-card-footnote { margin: 0; padding: 9px 16px; color: #93a3b0; border-top: 1px solid #f0f4f7; font-size: 10px; }
#bpmn { padding: 0; height: 305px; min-height: 305px; background-color: #fbfdff; background-image: radial-gradient(#dbe5ee .8px, transparent .8px); background-size: 16px 16px; overflow: hidden; cursor: grab; }
#bpmn:active { cursor: grabbing; }
#bpmn .bjs-powered-by { display: none; }
#json { height: 305px; padding: 0; overflow: auto; }
#json > .jsoneditor { border: 0; font-family: "Segoe UI", Arial, sans-serif; }
#json .jsoneditor-menu { background: #eef4fa; border-bottom: 1px solid #e2eaf2; }
#json .jsoneditor-menu > button { filter: brightness(.4) sepia(.3) saturate(2) hue-rotate(160deg); }
#json .jsoneditor-search input { border: 0; }
#json .jsoneditor-navigation-bar { background: #f8fbfd; color: #6b8295; border-color: #e6eef4; }
#json div.jsoneditor-tree { background: #fff; padding: 8px; }
#json .jsoneditor-field, #json .jsoneditor-value, #json .jsoneditor-readonly { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
#json .jsoneditor-field { color: #385e84; }
#taskContextMenu, #contextMenu { padding: 5px; min-width: 145px; border: 1px solid var(--ws-border) !important; border-radius: 8px; box-shadow: 0 8px 24px #17324a1f; }
#taskContextMenu > div, #contextMenu > div { padding: 7px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; }
#taskContextMenu > div:hover, #contextMenu > div:hover { background: #edf4fa; }
.ws-footer { display: flex; justify-content: space-between; gap: 20px; margin: 19px 2px 0; color: #8c9fab; font-size: 11px; }
.ws-footer span:first-child { color: #69879c; }
body[data-view="list"] #ro { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
body[data-view="list"] .ws-data-card { display: none; }
body[data-view="json"] #ro { display: none; }
body[data-view="json"] .ws-data-card { grid-column: 1 / -1; }
body[data-view="bpmn"] .ws-work-card, body[data-view="bpmn"] .ws-diagram-card { grid-column: 1 / -1; }
body[data-view="bpmn"] #workspace { min-height: 150px; max-height: 300px; }
body[data-view="bpmn"] #bpmn { height: 510px; }
body[data-view="bpmn"] #ro, body[data-view="bpmn"] .ws-data-card { display: none; }
body[data-view="workspace"] .ws-grid { display: block; max-width: 1000px; margin: 0 auto; }
body[data-view="workspace"] #workspace { min-height: 450px; max-height: none; padding: 30px; }
body[data-view="workspace"] #ro, body[data-view="workspace"] .ws-diagram-card, body[data-view="workspace"] .ws-data-card { display: none; }
.b2base-workspace :focus-visible { outline: 3px solid #97c4f0; outline-offset: 3px; }
@media (min-width: 1600px) { .ws-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
@media (max-width: 1050px) {
    .ws-stats { display: none; }
    .ws-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
    #ro { grid-template-columns: 1fr; gap: 12px; }
    .ws-empty { min-height: 100px; padding: 16px; }
    .ws-empty svg { display: none; }
    .ws-empty p { max-width: 240px; }
    #ro .ws-card-heading { min-height: 44px; padding-top: 11px; padding-bottom: 11px; }
    .ws-card-footnote { display: none; }
    .ws-view-hint { display: none; }
}
@media (max-width: 720px) {
    .ws-topbar { min-height: 65px; gap: 10px; padding: 12px 16px; }
    .ws-brand strong { font-size: 19px; }
    .ws-brand small { font-size: 9px; }
    .ws-brand img { width: 30px; height: 30px; }
    .ws-topnav { gap: 12px; font-size: 12px; }
    .ws-topnav .ws-help-link { display: none; }
    .ws-topnav .ws-editor-link { padding: 7px 9px; }
    .ws-shell { padding: 21px 14px; }
    .ws-intro { margin-bottom: 18px; }
    #style-area { width: 100%; gap: 3px; }
    #style-area .monospace-button { flex: 1 1 auto; min-height: 40px; font-size: 11px; padding: 8px 7px; gap: 5px; }
    #style-area .monospace-button svg { display: none; }
    .ws-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    body[data-view] #ro { grid-column: auto; grid-row: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ws-card-heading { padding: 14px 16px; }
    #workspace { min-height: 250px; max-height: none; padding: 18px; }
    #workspace button { min-height: 42px; }
    #bpmn, #json { height: 300px; }
    body[data-view="workspace"] #workspace { min-height: 350px; padding: 20px; }
    .ws-footer { flex-direction: column; gap: 5px; }
    .ws-empty { padding: 20px 12px; }
}
@media (max-width: 420px) {
    .ws-topnav .ws-secondary-link { display: none; }
    body[data-view] #ro { grid-template-columns: 1fr; }
    #style-area .monospace-button { font-size: 10px; padding: 7px 5px; }
}
@media (prefers-reduced-motion: reduce) { .b2base-workspace *, .b2base-workspace *::before { transition: none !important; } }
