/* Workspace geometry. Colours and type still come from the active Stilprofil. */
@media screen {
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace {
    display: grid;
    grid-template-columns: 278px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    align-items: stretch;
    gap: 0;
    height: var(--shell-viewport-height, 100dvh);
    position: relative;
    top: var(--shell-viewport-offset, 0px);
    min-height: 0;
    overflow: hidden;
    --shell-divider: color-mix(in srgb, var(--general-surface-text-color) 18%, transparent);
    --shell-content-divider: color-mix(in srgb, var(--content-surface-text-color) 18%, transparent);
  }
  .app-shell--workspace .app-shell__skip {
    position: fixed;
    top: -8rem;
    left: 1rem;
    z-index: 150;
    padding: .75rem 1rem;
    background: var(--general-surface-background-color);
  }
  .app-shell--workspace .app-shell__skip:focus { top: .5rem; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__global-nav {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    min-height: 66px;
    margin: 0;
    padding: .5rem 1.5rem;
    border-bottom: 1px solid var(--shell-divider);
    position: relative;
    z-index: 40;
  }
  .app-shell--workspace .header-logo { flex: 0 0 230px; margin: 0; }
  .app-shell--workspace .header-logo a { display: flex; align-items: center; gap: .5rem; color: inherit; }
  .app-shell--workspace .header-logo img { width: 36px; height: 42px; margin: 0; object-fit: contain; }
  .app-shell--workspace .header-logo span { font-size: 1.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -.055em; }
  .app-shell--workspace .app-shell__search-toggle { display: none; }
  .app-shell--workspace .app-shell__global-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
  .app-shell--workspace .app-shell__menu { position: relative; }
  .app-shell--workspace .app-shell__menu > summary {
    padding: .5rem .75rem;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: .5rem;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: .5rem;
    list-style: none;
  }
  .app-shell--workspace .app-shell__menu > summary::-webkit-details-marker { display: none; }
  .app-shell--workspace .app-shell__menu > summary::after { content: '⌄'; }
  .app-shell--workspace .app-shell__menu[open] > summary { border-color: currentColor; }
  .app-shell--workspace .app-shell__menu-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    z-index: 50;
    width: min(22rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 8rem);
    overflow: auto;
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid currentColor;
    border-radius: .75rem;
    background: var(--general-surface-background-color);
    color: var(--general-surface-text-color);
    box-shadow: 0 12px 36px rgb(0 0 0 / 15%);
  }
  .app-shell--workspace .user-info { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; margin: 0; }
  .app-shell--workspace .work-mode-picker { margin: 0; }
  .app-shell--workspace .work-mode-picker__panel { position: static; margin-top: .5rem; min-width: 0; box-shadow: none; }
  .app-shell--workspace .footer__style-profile { justify-content: flex-start; margin: 0; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__search-region {
    grid-column: auto;
    grid-row: auto;
    flex: 1;
    min-width: 0;
    max-width: 560px;
    position: relative;
    margin: 0;
    padding: 0;
  }
  .app-shell--workspace .app-shell__search-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
  .app-shell--workspace .app-shell__search-input { min-width: 0; border-radius: .5rem; min-height: 42px; }
  .app-shell--workspace [data-global-search-mode] { max-width: 6rem; min-height: 40px; font: inherit; }
  .app-shell--workspace .app-shell__search-option {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    width: 100%;
    z-index: 2;
    margin: 0;
    padding: .75rem;
    background: var(--general-surface-background-color);
    border: 1px solid var(--shell-divider);
    border-radius: .5rem;
    color: var(--general-surface-text-color);
  }
  .app-shell--workspace .app-shell__search-panel {
    position: absolute;
    top: calc(100% + 3.5rem);
    left: 0;
    width: 100%;
    max-height: min(60dvh, 32rem);
    overflow: auto;
    background: var(--general-surface-background-color);
    border: 1px solid var(--shell-divider);
    border-radius: .5rem;
    padding: .75rem;
    box-shadow: 0 12px 32px rgb(0 0 0 / 12%);
    display: none;
  }
  .app-shell--workspace .app-shell__search-region:focus-within .app-shell__search-panel:has([data-global-search-status]:not(:empty)) { display: block; }
  .app-shell--workspace [data-global-search-result] > div { padding: .5rem 0; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__navigation {
    grid-column: 1;
    grid-row: 2 / 5;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--shell-divider);
    background: var(--general-surface-background-color);
  }
  .app-shell--workspace .app-shell__navigation-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
  .app-shell--workspace [data-shell-nav-toggle] { display: none; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__bookmarks-region { width: 100%; margin: 1.75rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--shell-divider); }
  .app-shell--workspace .bookmarks-strip__list { flex-direction: column; gap: .6rem; padding: .5rem 0; }
  .app-shell--workspace .bookmarks-strip__item { min-width: 0; overflow-wrap: anywhere; }
  .app-shell--workspace .object-hierarchy-nav { margin: 0; padding: 0; min-width: 0; color: var(--general-surface-text-color); }
  .app-shell--workspace .object-hierarchy-nav__path-row { display: block; }
  .app-shell--workspace .object-hierarchy-nav__path-list { width: 100%; }
  .app-shell--workspace .object-hierarchy-nav__path-item { min-width: 0; }
  .app-shell--workspace .object-hierarchy-nav__path-item--current {
    border-left: 3px solid currentColor;
    border-radius: .5rem;
    color: var(--general-surface-link-color);
    background: color-mix(in srgb, var(--general-surface-link-color) 8%, var(--general-surface-background-color));
    padding: .5rem;
  }
  .app-shell--workspace .object-hierarchy-nav .object-hierarchy-nav__path-item--current::after { display: none; }
  .app-shell--workspace .app-shell__current-object { display: flex; align-items: flex-start; gap: .5rem; min-width: 0; }
  .app-shell--workspace .app-shell__current-object #object-icon-large { width: 20px; height: 20px; margin: .3rem 0 0; flex: none; }
  .app-shell--workspace #object-title { text-align: left; margin: 0; min-width: 0; overflow-wrap: anywhere; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__main-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: auto;
    overscroll-behavior: contain;
  }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .system-content { padding: 2rem clamp(1.25rem, 3.4vw, 3.5rem); }
  .app-shell--workspace .app-shell__object-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    min-height: 61px;
    margin: 0;
    padding: .5rem 1.5rem;
    border-bottom: 1px solid var(--shell-content-divider);
    background: var(--content-surface-background-color);
  }
  .app-shell--workspace .object-header__type-row { margin: 0; }
  .app-shell--workspace #views-nav { padding: 0; margin: 0; gap: .5rem; }
  .app-shell--workspace .object-header__actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
  .app-shell--workspace .app-shell__object-information .app-shell__menu-panel { background: var(--content-surface-background-color); color: var(--content-surface-text-color); }
  .app-shell--workspace .app-shell__menu-panel .card { padding: 0; margin: 0; }
  .app-shell--workspace .app-shell__menu-panel .zones { margin: 0; }
  .app-shell--workspace .object-body-grid { display: block; min-width: 0; margin: 0; }
  .app-shell--workspace .object-body-grid__content { min-width: 0; padding: 2rem clamp(1.25rem, 3.4vw, 3.5rem); }
  .app-shell--workspace #module-content { min-width: 0; scroll-margin-top: 5rem; }
  .app-shell--workspace .danger-zone { margin: 0; padding: 1rem clamp(1.25rem, 3.4vw, 3.5rem); }
  .app-shell--workspace .app-shell__end-mark { border-top: 1px solid var(--shell-content-divider); width: 4rem; margin: 1.5rem auto 2rem; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__status-region {
    grid-column: 2;
    grid-row: 4;
    position: relative;
    top: auto;
    min-height: 0;
    max-height: 30dvh;
    overflow: auto;
    border-top: 1px solid var(--shell-divider);
    border-bottom: 0;
  }
  .app-shell--workspace .app-shell__status-container { max-width: none; }
  .app-shell--workspace .app-shell__navigation-shade { display: none; }
  .app-shell--workspace :is(button, summary, a, [contenteditable="true"]):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
  body.is-document-print-ready-view .app-shell--workspace :is(.app-shell__skip, .app-shell__navigation, .app-shell__navigation-shade, .app-shell__end-mark),
  body[data-view-mode="page"] .app-shell--workspace :is(.app-shell__skip, .app-shell__navigation, .app-shell__navigation-shade, .app-shell__end-mark) { display: none !important; }
  body.is-document-print-ready-view .app-shell--workspace .object-body-grid__content,
  body[data-view-mode="page"] .app-shell--workspace .object-body-grid__content { padding: 0; }
  body.is-document-print-ready-view .app-shell--workspace { display: block; }
}

@media screen and (max-width: 760px) {
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__global-nav { min-height: 52px; padding: .35rem .75rem; gap: .5rem; flex-wrap: wrap; }
  .app-shell--workspace .header-logo { flex: 1; }
  .app-shell--workspace .header-logo img { width: 24px; height: 32px; }
  .app-shell--workspace .header-logo span { font-size: 1.2rem; }
  .app-shell--workspace .app-shell__menu > summary { min-height: 40px; padding: .35rem .5rem; font-size: .85rem; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__search-region { order: 3; flex-basis: 100%; max-width: none; }
  .app-shell--workspace .app-shell__search-toggle { display: inline-flex; min-width: 44px; min-height: 40px; padding: .35rem .5rem; font: inherit; color: inherit; border: 1px solid transparent; border-radius: .5rem; background: transparent; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace:not(.app-shell--search-open) .app-shell__search-region { display: none; }
  .app-shell--workspace .app-shell__search-input { min-height: 38px; padding: .4rem .65rem; }
  .app-shell--workspace [data-global-search-mode] { min-height: 38px; }
  .app-shell--workspace .app-shell__menu-panel { position: fixed; top: 3.5rem; right: .75rem; max-height: calc(100dvh - 5rem); }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__navigation { grid-column: 1; grid-row: 2; position: relative; padding: .5rem .75rem; border-right: 0; border-bottom: 1px solid var(--shell-divider); max-height: 30dvh; }
  .app-shell--workspace .app-shell__navigation-heading { margin: 0; }
  .app-shell--workspace [data-shell-nav-toggle] { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: transparent; color: inherit; border: 1px solid transparent; border-radius: .5rem; font-size: 1.2rem; position: absolute; right: .5rem; top: .25rem; z-index: 1; cursor: pointer; }
  .app-shell--workspace:not(.app-shell--navigation-open) .app-shell__navigation-heading > span,
  .app-shell--workspace:not(.app-shell--navigation-open) .app-shell__navigation :is([data-object-context-image], .app-shell__bookmarks-region, .object-hierarchy-nav__child-list, .object-hierarchy-nav__empty-surface, .object-hierarchy-nav__sort-row, .object-hierarchy-nav__errors),
  .app-shell--workspace:not(.app-shell--navigation-open) .object-hierarchy-nav__path-item:not(.object-hierarchy-nav__path-item--current) { display: none; }
  .app-shell--workspace:not(.app-shell--navigation-open) .object-hierarchy-nav__path-item--current { padding-right: 3rem; }
  .app-shell--workspace:not(.app-shell--navigation-open) .object-hierarchy-nav__path-item::after { display: none; }
  .app-shell--workspace.app-shell--system .app-shell__navigation-heading { min-height: 36px; }
  .app-shell--workspace.app-shell--system .app-shell__navigation-heading > span { display: inline; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__main-content { grid-column: 1; grid-row: 3; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--workspace .app-shell__status-region { grid-column: 1; grid-row: 5; }
  .app-shell--workspace .app-shell__object-toolbar { padding: .4rem .75rem; gap: .4rem; }
  .app-shell--workspace .object-header__type-row { font-size: .75rem; }
  .app-shell--workspace .object-header__actions { gap: .25rem; }
  .app-shell--workspace .app-shell__object-toolbar .button { min-height: 40px; padding: .4rem .65rem; }
  .app-shell--workspace .object-body-grid__content { padding: 1.25rem; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--navigation-open .app-shell__navigation { position: fixed; inset: 0 auto 0 0; z-index: 100; width: min(340px, calc(100vw - 24px)); max-height: none; padding: 1.25rem 1rem; box-shadow: 8px 0 40px rgb(0 0 0 / 20%); }
  .app-shell--navigation-open .app-shell__navigation-heading { position: sticky; top: -1.25rem; z-index: 2; min-height: 44px; margin-bottom: 1rem; padding-right: 2.5rem; background: var(--general-surface-background-color); }
  .app-shell--navigation-open .app-shell__navigation-shade:not([hidden]) { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; border: 0; border-radius: 0; background: rgb(0 0 0 / 35%); }
}

@media print {
  .app-shell--workspace :is(.app-shell__skip, .app-shell__navigation, .app-shell__navigation-shade, .app-shell__end-mark) { display: none !important; }
  .app-shell--workspace, .app-shell--workspace .object-body-grid { display: block !important; }
  .app-shell--workspace .app-shell__main-content { max-width: none; margin: 0; }
}

@media screen and (max-width: 360px) { .app-shell--workspace .header-logo span { display: none; } }

@media screen {
  .app-shell--workspace .app-shell__capture {
    grid-column: 2; grid-row: 3; min-width: 0;
    padding: .5rem 1.5rem max(.5rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--shell-content-divider);
    background: var(--content-surface-background-color); color: var(--content-surface-text-color);
    font-family: var(--content-surface-text-font-family);
  }
  .app-shell__capture[hidden] { display: none; }
  .app-shell__capture .capture-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .6rem; margin: 0; }
  .app-shell__capture .capture-compose label { min-width: 0; gap: .25rem; font-size: .75rem; line-height: 1.4; }
  .app-shell__capture .capture-compose textarea { min-width: 0; min-height: 44px; max-height: min(128px, 25dvh); resize: none; font-size: 16px; font-weight: 400; line-height: 1.4; border-color: var(--shell-content-divider); }
  .app-shell__capture .capture-compose button { align-self: end; min-height: 44px; margin: 0; padding: .5rem .9rem; border: 1px solid currentColor; border-radius: .5rem; background: var(--content-surface-text-color); color: var(--content-surface-background-color); font: inherit; }
  .app-shell__capture .capture-status { grid-column: 1 / -1; font-size: .8rem; line-height: 1.4; margin: 0; overflow-wrap: anywhere; max-height: 18dvh; overflow: auto; }
  .app-shell__capture .capture-status:empty { display: none; }
  .app-shell__capture :is(textarea, button):focus-visible { outline: 2px solid var(--content-surface-text-color); outline-offset: 2px; }
  body[data-view-mode="page"] .app-shell__capture,
  body.is-document-print-ready-view .app-shell__capture { display: none !important; }
}
@media screen and (max-width: 760px) {
  .app-shell--workspace .app-shell__capture { grid-column: 1; grid-row: 4; padding: .5rem .75rem max(.5rem, env(safe-area-inset-bottom)); }
}
@media print { .app-shell__capture { display: none !important; } }

.app-shell__capture .capture-compose { position: relative; }
.app-shell__capture .capture-compose__inbox { position: absolute; top: 0; right: 0; font-size: .75rem; color: inherit; }

@media screen {
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view):has(.app-shell__capture:not([hidden])) .edge-list__content--bottom-tools {
    bottom: var(--shell-tools-clearance, calc(4rem + env(safe-area-inset-bottom, 0px)));
  }
}

@media screen {
  /* The status region otherwise traps its fixed log behind the sticky toolbar. */
  .app-shell--workspace .app-shell__status-region:has(.activity-log-overlay--open) { z-index: 120; }
  .app-shell--workspace .activity-log-overlay__panel { display: flex; flex-direction: column; overflow: hidden; }
  .app-shell--workspace .activity-log-overlay__list { min-height: 0; overflow: auto; }
  .app-shell--workspace :is(.activity-log-overlay__header, .activity-log-overlay__hint, .activity-log-overlay__full-history) { flex-shrink: 0; }
  .app-shell--workspace .activity-log-overlay__full-history { align-self: flex-start; }
  .app-shell--workspace .activity-log-overlay__close { min-width: 44px; min-height: 44px; font: inherit; }
  .app-shell--workspace .app-shell__global-nav:has(.app-shell__history-notice) { flex-wrap: wrap !important; row-gap: .5rem; }
  .app-shell__history-notice {
    order: 4;
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .75rem;
    padding: .5rem .75rem;
    border: 1px solid currentColor;
    border-left: 4px solid currentColor;
    border-radius: .4rem;
    font-size: .85rem;
  }
  .app-shell__history-notice button {
    margin-left: auto;
    min-height: 44px;
    padding: .4rem .65rem;
    border: 1px solid currentColor;
    border-radius: .35rem;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }
}

/* Named edge actions share the shell's surfaces. Only the visible card commits. */
body.is-dragging .edge-lists .edge-list:not(.edge-list--bottom) {
  opacity: 1; overflow: visible; pointer-events: none !important;
  background: transparent; border: 0; box-shadow: none;
}
body.is-dragging .edge-lists .edge-list::before,
body.is-dragging .edge-lists .edge-list::after,
body.is-dragging .edge-list:not(.edge-list--bottom) > .edge-list__content { display: none !important; }
body.is-dragging .edge-list--top.edge-list--active { height: 36px; }
.edge-lists [data-edge-card] { display: none; }
body.is-dragging .edge-lists [data-edge-card].edge-dropzone--allowed,
body.is-dragging .edge-lists [data-edge-card].edge-dropzone--read-only-allowed {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  position: fixed; inset: auto; width: 190px; min-height: 70px; padding: .7rem .85rem;
  box-sizing: border-box; gap: .2rem; border: 1px solid #d7ddd4; border-radius: 10px;
  background: var(--content-surface-background-color, #fff) !important;
  color: var(--content-surface-text-color, #232c2a); box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
  pointer-events: auto !important; z-index: 10; font: 13px/1.4 system-ui, sans-serif;
}
.edge-lists [data-edge-card] small { font-size: 11px; opacity: .78; }
body.is-dragging .edge-lists [data-edge-card].edge-list__dropzone--drag-active {
  outline: 2px solid var(--content-surface-link-color, #205c51); outline-offset: 2px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}
body.is-dragging .edge-lists .edge-list--left [data-edge-card] { left: 18px; top: 35vh; }
body.is-dragging .edge-lists .edge-list--left [data-edge-card].edge-list__dropzone--bottom-half { top: 58vh; }
body.is-dragging .edge-lists .edge-list--right [data-edge-card] { right: 18px; top: 35vh; }
body.is-dragging .edge-lists .edge-list--right [data-edge-card].edge-list__dropzone--bottom-half { top: 58vh; }
body.is-dragging .edge-lists .edge-list--top [data-edge-card] { top: 18px; left: calc(50vw - 202px); }
body.is-dragging .edge-lists .edge-list--top [data-edge-card].edge-list__dropzone--right-half { left: calc(50vw + 12px); }
.edge-list__primary-tools { flex-direction: row; gap: .4rem; }
.edge-list__primary-tool.node-item { width: auto; min-width: 44px; height: 44px; min-height: 44px; padding: 0 .75rem; border-radius: 8px; box-shadow: 0 3px 12px rgb(0 0 0 / 9%); background: var(--content-surface-background-color, #fff); color: var(--content-surface-text-color, #232c2a); }
.edge-list__primary-tool .edge-list__tool-card { gap: .4rem; color: inherit; font: 13px system-ui, sans-serif; }
.edge-list__primary-tool .edge-list__tool-icon { color: inherit; border: 0; background: transparent; }
.edge-list__stored-toggle { align-self: flex-end; min-height: 36px; padding: .25rem .6rem; border: 1px solid #d7ddd4; border-radius: 8px; background: var(--content-surface-background-color, #fff); color: var(--content-surface-text-color, #232c2a); font: 12px system-ui, sans-serif; }
.edge-list__content--bottom-tools { gap: .4rem; }
.node-object-menu-trigger { border: 0; border-radius: 6px; background: transparent; color: inherit; min-width: 40px; min-height: 40px; font: bold 18px system-ui, sans-serif; cursor: pointer; }
.node-object-menu-trigger:hover { background: rgb(127 127 127 / 12%); }
.node-object-menu-trigger:focus-visible, .edge-list__stored-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.object-placement-menu { width: min(470px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px; box-sizing: border-box; border: 1px solid #d7ddd4; border-radius: 16px; background: var(--content-surface-background-color, #fff); color: var(--content-surface-text-color, #232c2a); box-shadow: 0 16px 60px rgb(0 0 0 / 20%); font: 15px/1.45 system-ui, sans-serif; overflow: auto; }
.object-placement-menu::backdrop { background: rgb(24 33 29 / 28%); backdrop-filter: blur(3px); }
.object-placement-menu header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.object-placement-menu h2 { font: 600 20px/1.3 system-ui, sans-serif; margin: 0; }
.object-placement-menu header button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; font-size: 22px; }
.object-placement-menu__subject { padding: 12px; border-radius: 8px; background: rgb(127 127 127 / 8%); overflow-wrap: anywhere; }
.object-placement-menu h3 { margin: 22px 0 4px; font: 600 11px/1.4 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.object-placement-menu__action { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 10px 8px; border: 0; border-bottom: 1px solid #d7ddd4; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.object-placement-menu__action small { font-size: 12px; opacity: .75; }
.object-placement-menu__action--destructive > span { color: #a52c25; }
.object-placement-menu__action:hover { background: rgb(127 127 127 / 8%); }
.app-shell__object-information .danger-zone { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--shell-divider); }
.app-shell__object-information .danger-zone small { display: block; margin-top: 6px; font-size: 12px; }
@media (max-width: 600px) {
  body.is-dragging .edge-lists [data-edge-card].edge-dropzone--allowed,
  body.is-dragging .edge-lists [data-edge-card].edge-dropzone--read-only-allowed { width: calc(50vw - 24px); min-height: 72px; padding: .6rem; font-size: 12px; }
  body.is-dragging .edge-lists .edge-list--left [data-edge-card] { left: 10px; }
  body.is-dragging .edge-lists .edge-list--right [data-edge-card] { right: 10px; }
  body.is-dragging .edge-lists .edge-list--top [data-edge-card] { left: 10px; top: 10px; }
  body.is-dragging .edge-lists .edge-list--top [data-edge-card].edge-list__dropzone--right-half { left: auto; right: 10px; }
  .object-placement-menu { padding: 16px; }
}

/* Bookmark rows inherit pointer-events:none from their drag-only presenter. */
.bookmarks-strip__item .node-object-menu-trigger,
.edge-list--active .node-object-menu-trigger { pointer-events: auto; }

.portal-widget { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.portal-widget > .portal-widget__identity { grid-column: 1; grid-row: 1; align-self: center; }
.portal-widget > .node__actions { grid-column: 2; grid-row: 1; }
.portal-widget > .portal-widget__content { grid-column: 1 / -1; grid-row: 2; min-width: 0; }

/* Content rhythm in the workspace; published and print layouts retain their geometry. */
@media screen {
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget { margin: 0 0 1.5rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget__identity { margin: 0; padding: .5rem 0; font-size: 1.125rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget__content { border-top: 1px solid var(--shell-content-divider); }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-page { width: 100%; margin: 0; padding: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__summary { min-height: 36px; font-size: .8rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__summary::after { content: ' ⌄'; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__summary[aria-expanded="false"]::after { content: ' ›'; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; padding: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__item { display: flex; align-items: center; justify-content: space-between; min-width: 0; min-height: 52px; padding: .25rem 0; border-bottom: 1px solid var(--shell-content-divider); }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__item .node-drag-affordance { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-list { gap: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item { padding: 1rem 0; border: 0; border-bottom: 1px solid var(--shell-content-divider); border-radius: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item__title { margin-bottom: .35rem; overflow-wrap: anywhere; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item__text { margin: 0; overflow-wrap: anywhere; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-page__intro { max-width: 74ch; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view__datetime { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view__datetime legend { margin-bottom: .75rem; font-weight: 600; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view__datetime-fields { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view__datetime-fields label { display: grid; gap: .35rem; min-width: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view input:is([type="date"], [type="time"]),
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view textarea { box-sizing: border-box; min-height: 44px; max-width: 100%; padding: .6rem .75rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view #clear-event-time { min-height: 44px; padding: .6rem .75rem; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .event-view label:has(#is_monitored) { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
  .app-shell--workspace #views-nav > :is(a, .active-view) { gap: .4rem; padding: .35rem .55rem; border-radius: 8px; min-height: 40px; }
  .app-shell--workspace #views-nav > .active-view { box-shadow: none; background: color-mix(in srgb, var(--content-surface-text-color) 8%, var(--content-surface-background-color)); }
}
@media screen and (min-width: 1100px) {
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .bookmarks-strip__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item:has(> .capture-item__title) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; align-items: center; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item__title { grid-column: 1; grid-row: 1; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item__text { grid-column: 1; grid-row: 2; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-item > .capture-item__actions { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  body[data-view-mode="object"]:not(.is-document-print-ready-view) .portal-widget .capture-convert { grid-column: 1 / -1; }
}
@media screen and (min-width: 761px) {
  body[data-view-mode="object"]:not(.is-document-print-ready-view) #save-object-btn:disabled { padding: .35rem .5rem; border-color: transparent; background: transparent; color: var(--content-surface-text-color); font-size: .8rem; min-height: 40px; }
}

.object-placement-menu > a { color: var(--content-surface-link-color, #205c51); text-decoration: underline; }

.mobile-dock-controls, .activity-status__mobile-label, .mobile-capture-close, .mobile-build-stamp { display: none; }
/* Mobile commands are explicit menu choices, never targets appearing under a finger. */
@media screen and (max-width: 760px), screen and (pointer: coarse) {
  body.is-dragging .edge-lists .edge-list [data-edge-card],
  body.is-dragging .edge-lists .edge-list > .edge-list__dropzone { display: none !important; pointer-events: none !important; }
}
@media screen and (max-width: 760px) {
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .app-shell__global-nav {
    min-height: 48px; padding: 2px 12px; gap: 4px;
  }
  .app-shell--mobile .header-logo span { display: none; }
  body:has(.app-shell--mobile) #build-stamp { display: none; }
  .app-shell--mobile .mobile-build-stamp { display: block; font-size: 12px; color: inherit; opacity: .8; }
  .app-shell--mobile .app-shell__menu > summary,
  .app-shell--mobile .app-shell__menu-panel button { min-height: 44px; }
  .app-shell--mobile .activity-log-overlay__row button,
  .app-shell--mobile .node-object-menu-trigger { min-width: 44px; min-height: 44px; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .app-shell__navigation {
    min-height: 48px; padding: 2px 12px; max-height: none;
  }
  .app-shell--mobile:not(.app-shell--navigation-open) #object-hierarchy-nav { margin: 0 48px 0 36px; }
  .app-shell--mobile:not(.app-shell--navigation-open):has(#save-object-btn:not(:disabled):not([hidden])) #object-hierarchy-nav { margin-right: 104px; }
  .app-shell--mobile:not(.app-shell--navigation-open) .object-hierarchy-nav__path-item--current { padding: 0 8px; min-height: 44px; }
  .app-shell--mobile:not(.app-shell--navigation-open) .app-shell__current-object { min-height: 44px; align-items: center; gap: 8px; min-width: 0; }
  .app-shell--mobile:not(.app-shell--navigation-open) #object-title { font-size: 18px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
  .app-shell--mobile:not(.app-shell--navigation-open) .app-shell__current-object #object-icon-large { width: 24px; height: 24px; margin: 0; }
  .app-shell--mobile:not(.app-shell--navigation-open) [data-shell-nav-toggle] { left: 4px; right: auto; top: 2px; }
  .app-shell--mobile .app-shell__navigation > .object-header__actions { position: absolute; right: 8px; top: 2px; margin: 0; gap: 2px; }
  .app-shell--mobile .app-shell__object-information > summary { font-size: 0; min-width: 44px; justify-content: center; padding: 0; }
  .app-shell--mobile .app-shell__object-information > summary::before { content: '···'; font-size: 22px; }
  .app-shell--mobile .app-shell__object-information > summary::after { display: none; }
  .app-shell--mobile #save-object-btn:disabled { display: none; }
  .app-shell--mobile #save-object-btn { min-height: 44px; padding: 4px 8px; }
  .app-shell--mobile .app-shell__object-toolbar { display: none; }
  .app-shell--mobile #views-nav { display: flex; flex-wrap: wrap; gap: 8px; order: -1; }
  .app-shell--mobile #views-nav a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .app-shell--mobile .app-shell__menu-panel { top: 50px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 118px); }
  .app-shell--mobile .app-shell__object-information .app-shell__menu-panel { top: 100px; max-height: calc(100dvh - 168px); }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .object-body-grid__content,
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .system-content { padding: 12px; }
  .app-shell--mobile .capture-page { padding: 0; margin: 12px 0; }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile-chrome-hidden :is(.app-shell__global-nav, .app-shell__navigation) {
    min-height: 0; height: 0; padding-block: 0; border: 0; visibility: hidden; overflow: hidden;
  }
  .app-shell--mobile:not(.app-shell--capture-open) .app-shell__capture { display: none; }
  .app-shell--mobile.app-shell--capture-open .app-shell__capture:not([hidden]) { display: block; padding: 8px 12px; }
  .app-shell--mobile .mobile-capture-close { display: block; margin-left: auto; margin-bottom: 4px; min-height: 44px; padding: 4px 10px; border: 0; background: transparent; color: inherit; font: inherit; }
  .app-shell--mobile .app-shell__capture textarea { max-height: min(200px, 36dvh); }
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .app-shell__status-region { overflow: visible; max-height: none; z-index: 65; }
  .app-shell--mobile .activity-status-zone { height: calc(48px + env(safe-area-inset-bottom, 0px)); min-height: 48px; padding: 0 4px env(safe-area-inset-bottom, 0px); gap: 0; overflow: visible; align-items: stretch; }
  .app-shell--mobile .mobile-dock-controls { display: contents; }
  .app-shell--mobile .mobile-dock-controls > *, .app-shell--mobile [data-activity-log-toggle] {
    flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 6px; background: transparent;
    color: inherit; font: 12px/1.2 system-ui, sans-serif; text-decoration: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  }
  .app-shell--mobile .mobile-dock-controls > * > span, .app-shell--mobile .activity-status__mobile-label > span { font-size: 18px; }
  .app-shell--mobile [data-shell-capture-toggle][aria-expanded="true"], .app-shell--mobile [data-shell-tools-toggle][aria-expanded="true"] { background: rgb(127 127 127 / 15%); }
  .app-shell--mobile:not(:has([data-shell-capture]:not([hidden]))) [data-shell-capture-toggle] { display: none; }
  .app-shell--mobile .activity-status__desktop-icon { display: none; }
  .app-shell--mobile .activity-status__mobile-label { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .app-shell--mobile .activity-status__previous, .app-shell--mobile .activity-status__empty,
  .app-shell--mobile .activity-status-zone > [data-time-machine-ui] { display: none; }
  .app-shell--mobile .activity-status__content { position: absolute; bottom: calc(100% + 8px); left: 12px; right: 12px; width: auto; pointer-events: none; }
  .app-shell--mobile .activity-status__latest { min-width: 0; width: 100%; }
  .app-shell--mobile .activity-status__line { display: none; }
  .app-shell--mobile .activity-status__line.activity-status__item--emphasized {
    display: flex; min-height: 56px; max-height: 180px; padding: 8px; gap: 6px; pointer-events: auto;
    border: 1px solid currentColor; border-radius: 10px; background: var(--general-surface-background-color); box-shadow: 0 4px 20px rgb(0 0 0 / 15%);
  }
  .app-shell--mobile.app-shell--workspace .activity-status__line .activity-status__text { display: block; flex: 1; white-space: normal; overflow: hidden; max-height: 130px; min-width: 0; line-height: 1.4; padding-block: 2px; }
  .app-shell--mobile .activity-status__text .linked-object { max-width: 100%; height: auto; align-items: flex-start; }
  .app-shell--mobile .activity-status__details { min-width: 36px; min-height: 44px; }
  .app-shell--mobile .activity-status__line .activity-status__text .linked-object__title { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
  .app-shell--mobile .activity-status__undo { flex-shrink: 0; }
  .app-shell--mobile:has(.activity-log-overlay--open, dialog[open]) .activity-status__content,
  .app-shell--mobile.app-shell--capture-open .activity-status__content,
  body.mobile-tools-open .app-shell--mobile .activity-status__content { visibility: hidden; }
  .app-shell--mobile .activity-log-overlay__panel > [data-time-machine-ui] { display: flex; flex-shrink: 0; }
  .app-shell--mobile .activity-log-overlay__panel .time-machine-ui__toggle::after { content: ' Tidsmaskin'; font: 14px system-ui; }
  .app-shell--mobile.app-shell--navigation-open .app-shell__navigation > .object-header__actions { display: none; }
  body:has(.app-shell--mobile):not(.mobile-tools-open) .edge-list__content--bottom-tools { display: none !important; }
  body:has(.app-shell--mobile).mobile-tools-open .edge-list__content--bottom-tools {
    display: flex !important; position: fixed; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px;
    padding: 12px; border: 1px solid #a9b0a9; border-radius: 12px; background: var(--content-surface-background-color); z-index: 80;
  }
  body:has(.app-shell--mobile) .edge-list__primary-tools { display: flex; width: 100%; }
  body:has(.app-shell--mobile) .edge-list__primary-tool { flex: 1; }
  body:has(.app-shell--mobile) .edge-lists .edge-list::before,
  body:has(.app-shell--mobile) .edge-lists .edge-list::after { display: none; }
  .app-shell--mobile .app-shell__history-notice { font-size: 12px; padding: 4px 8px; gap: 4px; }
}

@media screen and (max-width: 760px) {
  .time-machine-popover { max-height: calc(100dvh - 16px); overflow: auto; }
}
@media screen and (max-width: 760px) and (max-height: 520px) {
  body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--capture-open:not(:has([data-shell-history-notice])) :is(.app-shell__global-nav, .app-shell__navigation) {
    min-height: 0; height: 0; padding-block: 0; border: 0; visibility: hidden; overflow: hidden;
  }
  .app-shell--mobile .mobile-capture-close { margin: 0 0 0 auto; }
}

/* Published links keep their publication context; only the tree presentation
   shares the workspace's current-row and left-drawer pattern. */
.public-site-frame__toggle, .public-site-frame__shade { display: none; }
.public-site-frame__nav-link { max-width: 100%; overflow-wrap: anywhere; }
.public-site-frame__path-item--current > .public-site-frame__nav-link {
  display: block;
  padding: .5rem;
  border-left: 3px solid currentColor;
  border-radius: .5rem;
  background: color-mix(in srgb, var(--general-surface-link-color) 8%, var(--general-surface-background-color));
}
@media screen and (max-width: 760px) {
  .public-site-frame__navigation-panel { position: relative; min-height: 49px; margin-top: 1rem; }
  .public-site-frame__toggle { display: flex; align-items: center; justify-content: center; position: absolute; top: 2px; left: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: .5rem; font: inherit; font-size: 1.3rem; color: inherit; background: var(--general-surface-background-color); cursor: pointer; }
  .public-site-frame__nav { margin: 0 0 0 48px; }
  .public-site-frame:not(.public-site-frame--open) .public-site-frame__path-item:not(.public-site-frame__path-item--current),
  .public-site-frame:not(.public-site-frame--open) .public-site-frame__child-list { display: none; }
  .public-site-frame:not(.public-site-frame--open) .public-site-frame__path-item--current > a { min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .public-site-frame--open .public-site-frame__navigation-panel { position: fixed; inset: 0 auto 0 0; z-index: 100; width: min(340px, calc(100vw - 24px)); margin: 0; padding: 1rem; overflow: auto; max-height: 100dvh; box-sizing: border-box; background: var(--general-surface-background-color); color: var(--general-surface-text-color); box-shadow: 8px 0 40px rgb(0 0 0 / 20%); }
  .public-site-frame--open .public-site-frame__toggle { position: sticky; top: 0; margin: 0 0 .75rem auto; z-index: 1; }
  .public-site-frame--open .public-site-frame__nav { margin: 0; }
  .public-site-frame--open .public-site-frame__nav-link { min-height: 44px; padding-top: .5rem; padding-bottom: .5rem; box-sizing: border-box; }
  .public-site-frame--open .public-site-frame__shade:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 90; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgb(0 0 0 / 35%); }
}
@media print {
  .public-site-frame-region { display: none !important; }
}

.app-shell__accent-line, .app-shell__accent-panel { display: none; pointer-events: none; }
@media screen {
  :root[data-style-accent] body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell__accent-line {
    display: block; position: absolute; inset: 0 0 auto; height: 6px; z-index: 41;
    background: var(--accent-surface-background-color);
  }
  :root[data-style-accent] body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell__global-nav { padding-top: calc(.5rem + 6px); }
}
@media screen and (min-width: 761px) {
  :root[data-style-accent] body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell__accent-panel {
    display: block; position: relative; height: 64px; margin: 2rem .25rem .5rem;
    background: var(--accent-surface-background-color); border-radius: 36px 4px 36px 4px; overflow: hidden;
  }
  .app-shell__accent-panel::before, .app-shell__accent-panel::after { content: ''; position: absolute; width: 100px; height: 100px; border: 1px solid rgb(255 255 255 / 65%); border-radius: 50%; }
  .app-shell__accent-panel::before { top: -55px; right: 20px; }
  .app-shell__accent-panel::after { top: 20px; left: 20px; }
}
.style-profile-editor__quick-choices { margin: 0 0 1.5rem; }
.style-profile-editor__quick-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.style-profile-editor__quick-grid button { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem .75rem; cursor: pointer; }
.style-profile-editor__quick-grid button[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
.style-profile-editor__swatch { width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; flex: none; }
.style-profile-editor__accent-preview { height: 80px; border-radius: 36px 4px 36px 4px; }
.style-profile-editor__general-disclosure > summary,
.style-profile-editor__all-roles > summary { min-height:44px; padding:.65rem .5rem; cursor:pointer; }
.style-profile-editor__workspace:has(.style-profile-editor__all-roles:not([open])) { grid-template-columns:minmax(0,1fr); }
.style-profile-editor__preview { border-color:var(--panel-surface-border-color,#d9ded6); background:var(--panel-surface-background-color,#f6f7f2); }

@media screen and (max-width:760px) {
  :root[data-style-accent] body:not([data-view-mode="page"]):not(.is-document-print-ready-view) .app-shell--mobile .app-shell__global-nav { padding-top:8px; }
}
.public-site-frame-region,
.public-site-frame__path-item,
.public-site-frame__child-item { min-width:0; }
@media screen and (max-width:760px) {
  body[data-view-mode="page"] .app-shell--object { grid-template-columns:minmax(0,1fr); }
}
