/* Base: tokens mapping, Bootstrap overrides, page chrome.
   design/tokens.css is loaded before this file (see index.html). */

:root {
  --app-bg: var(--ui-color-canvas);
  --app-surface: var(--ui-color-surface);
  --app-surface-muted: var(--ui-color-surface-muted);
  --app-border: var(--ui-color-border);
  --app-border-strong: var(--ui-color-border-strong);
  --app-text: var(--ui-color-text);
  --app-muted: var(--ui-color-text-secondary);
  --app-text-tertiary: var(--ui-color-text-tertiary);
  --app-primary: var(--ui-color-primary);
  --app-primary-light: var(--ui-color-primary-muted);
  --app-primary-hover: var(--ui-color-primary-hover);
  --app-primary-active: var(--ui-color-primary-hover);
  --bs-primary: var(--app-primary);
  --bs-primary-rgb: 26, 82, 120;
  --bs-primary-text-emphasis: var(--app-primary-active);
  --bs-primary-bg-subtle: var(--app-primary-light);
  --bs-primary-border-subtle: color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
  --bs-link-color: var(--app-primary);
  --bs-link-hover-color: var(--app-primary-hover);
  --bs-focus-ring-color: rgba(var(--bs-primary-rgb), 0.25);
  --status-equal: var(--ui-color-success);
  --status-equal-bg: var(--ui-color-success-muted);
  --status-diff: var(--ui-color-warning);
  --status-diff-bg: var(--ui-color-warning-muted);
  --status-missing: var(--ui-color-danger);
  --status-missing-bg: var(--ui-color-danger-muted);
  --font-ui: var(--ui-font-sans);
  --font-mono: var(--ui-font-mono);
  --app-panel-radius: var(--ui-radius-panel);
  --app-panel-border: 1px solid var(--app-border);
  --app-panel-shadow: var(--ui-shadow-none);
  --app-header-sticky-offset: 0px;
  --app-sticky-overlap: 1px;
  --app-z-sticky-subbar: 1040;
  --app-z-dropdown: 1048;
  --app-z-drag-overlay: 1060;
  --bs-dropdown-zindex: var(--app-z-dropdown);
  --code-bg: #1a2332;
  --code-fg: #abb2bf;
  --code-muted: #7d8b99;
  --code-rule: #2d3a47;
  --code-highlight-bg: rgba(30, 90, 138, 0.45);
  --code-highlight-bar: #5ba3d9;
  --code-highlight-line-no: #b8d4eb;
  --code-panel-bg: #fafbfc;
  --app-table-head-bg: var(--app-surface);
  --app-table-head-text: var(--app-primary);
  --app-table-head-fill: var(--app-table-head-bg);
  --app-table-head-edge: var(--app-border);
  --app-table-head-edge-shadow: inset 0 -1px 0 0 var(--app-table-head-edge);
  --app-table-head-bleed-cover: inset 0 2px 0 0 var(--app-table-head-fill);
  --app-table-row-padding-y: 0.5rem;
  --app-table-row-padding-x: 0.5rem;
  --app-table-expand-padding-y: 0.5rem;
  --app-table-head-padding-y: 0.65rem;
  --compare-row-hover-bg: var(--ui-table-row-hover);
  --compare-col-hover-bg: var(--ui-table-col-hover);
  --compare-row-col-hover-bg: var(--ui-table-row-col-hover);
  --app-tool-nav-height: 100dvh;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-hover);
  --bs-btn-hover-border-color: var(--app-primary-hover);
  --bs-btn-active-bg: var(--app-primary-active);
  --bs-btn-active-border-color: var(--app-primary-active);
  --bs-btn-disabled-bg: var(--app-primary);
  --bs-btn-disabled-border-color: var(--app-primary);
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  min-height: var(--ui-size-control);
}

.form-select,
.form-control {
  border-color: var(--app-border);
  color: var(--app-text);
}

.form-select-sm,
.form-control-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
  min-height: var(--ui-size-control);
}

.form-check-input:checked {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.form-check-input:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.form-check-input:focus:not(:focus-visible) {
  box-shadow: none;
  border-color: var(--bs-border-color);
}

.form-check-input:checked:focus:not(:focus-visible) {
  border-color: var(--app-primary);
}

.form-switch .form-check-input {
  --form-switch-bg-off: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  --form-switch-bg-off-hover: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.38%29'/%3e%3c/svg%3e");
  --form-switch-bg-on: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  --form-switch-bg-focus: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%235a94c4'/%3e%3c/svg%3e");
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-switch .form-check-input:hover:not(:disabled):not(:focus-visible) {
  border-color: rgba(var(--bs-primary-rgb), 0.45);
}

.form-switch .form-check-input:not(:checked):hover:not(:disabled):not(:focus-visible) {
  --bs-form-switch-bg: var(--form-switch-bg-off-hover);
}

.form-switch .form-check-input:checked:hover:not(:disabled):not(:focus-visible) {
  background-color: var(--app-primary-hover);
  border-color: var(--app-primary-hover);
}

.form-switch .form-check-input:focus:not(:focus-visible) {
  --bs-form-switch-bg: var(--form-switch-bg-off);
}

.form-switch .form-check-input:checked:focus:not(:focus-visible) {
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.form-switch .form-check-input:focus-visible {
  --bs-form-switch-bg: var(--form-switch-bg-focus);
}

.form-switch .form-check-input:checked:focus-visible {
  --bs-form-switch-bg: var(--form-switch-bg-on);
}

.dropdown-menu {
  z-index: var(--app-z-dropdown) !important;
  border-color: var(--app-border);
}

.form-control:focus-visible,
.form-select:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.form-control:focus:not(:focus-visible),
.form-select:focus:not(:focus-visible) {
  border-color: var(--bs-border-color);
  box-shadow: none;
  outline: none;
}

:where(
  .btn,
  .btn-link,
  .nav-link,
  .app-tool-nav-item,
  .app-tool-nav-toggle,
  .form-check-input,
  .multi-select-toggle,
  .file-explorer .file-remove-btn,
  .history-open-btn,
  .history-delete-btn,
  .history-clear-btn,
  .result-expand-btn,
  .result-settings-toggle,
  .hint-ignore-btn
):focus:not(:focus-visible) {
  box-shadow: none;
  outline: none;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-ui);
  min-height: 100vh;
  min-height: 100dvh;
}

main.app-main,
main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
}

/* Tool shell — navy rail + content column */

.app-shell {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 100dvh;
}

.app-shell-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.app-tool-nav {
  --app-tool-nav-gutter: 0.5rem;
  --app-tool-nav-item: 2.25rem;
  --app-tool-nav-inner: 15.25rem;
  --app-tool-nav-expanded: calc(var(--app-tool-nav-inner) + var(--app-tool-nav-gutter) * 2);
  --app-tool-nav-collapsed: calc(var(--app-tool-nav-item) + var(--app-tool-nav-gutter) * 2);
  --app-tool-nav-bg: var(--app-primary);
  --app-tool-nav-hover: color-mix(in srgb, var(--ui-color-on-primary) 12%, transparent);
  --app-tool-nav-active: var(--app-bg);
  --app-tool-nav-ink: color-mix(in srgb, var(--ui-color-on-primary) 78%, var(--app-primary));
  --app-tool-nav-ink-muted: color-mix(in srgb, var(--ui-color-on-primary) 52%, var(--app-primary));
  box-sizing: border-box;
  flex: 0 0 var(--app-tool-nav-expanded);
  width: var(--app-tool-nav-expanded);
  max-width: var(--app-tool-nav-expanded);
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 30;
  align-self: flex-start;
  height: var(--app-tool-nav-height);
  max-height: var(--app-tool-nav-height);
  /* No right padding: scrollbar sits on the sidebar edge */
  padding: 0.75rem 0 1rem var(--app-tool-nav-gutter);
  background: var(--app-tool-nav-bg);
  border: none;
  border-right: none;
  border-radius: 0;
  transition-property: flex-basis, width, max-width;
  transition-duration: 0.28s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.app-tool-nav.is-collapsed {
  flex-basis: var(--app-tool-nav-collapsed);
  width: var(--app-tool-nav-collapsed);
  max-width: var(--app-tool-nav-collapsed);
}

.app-tool-nav-inner {
  box-sizing: border-box;
  /* Absorb former right gutter so overall nav width stays unchanged */
  width: calc(var(--app-tool-nav-inner) + var(--app-tool-nav-gutter));
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.app-tool-nav-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-12);
  padding: 0.2rem var(--app-tool-nav-gutter) 0.9rem 0;
  overflow: hidden;
  position: relative;
}

.app-tool-nav-brand-text {
  flex: 0 0 auto;
  min-width: 0;
}

.app-tool-nav .app-title {
  color: var(--ui-color-on-primary);
  font-size: var(--ui-font-size-lg);
  white-space: nowrap;
}

.app-tool-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: var(--ui-space-8);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ui-color-on-primary) 28%, transparent) transparent;
}

.app-tool-nav-scroll::-webkit-scrollbar {
  width: 0.4rem;
}

.app-tool-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.app-tool-nav-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ui-color-on-primary) 28%, transparent);
  border-radius: 999px;
}

.app-tool-nav-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ui-color-on-primary) 48%, transparent);
}

.app-tool-nav-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.app-tool-nav-utility {
  flex: 0 0 auto;
}

.app-tool-nav-toggle {
  position: relative;
  left: 0;
  z-index: 1;
  flex: 0 0 var(--app-tool-nav-item);
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--app-tool-nav-item);
  min-height: var(--app-tool-nav-item);
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: var(--ui-radius-control);
  background: transparent;
  color: var(--app-tool-nav-ink-muted);
  cursor: pointer;
  transition-property: background-color, color, transform, left;
  transition-duration: 0.15s, 0.15s, 0.15s, 0.28s;
}

.app-tool-nav.is-collapsed .app-tool-nav-toggle {
  left: calc(var(--app-tool-nav-item) - 100%);
}

.app-tool-nav-toggle i {
  width: 1rem;
  font-size: 0.7rem;
  line-height: 1;
  text-align: center;
}

.app-tool-nav-toggle:hover {
  background: var(--app-tool-nav-hover);
  color: var(--ui-color-on-primary);
}

.app-tool-nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.app-tool-nav-toggle:active {
  transform: scale(0.98);
}

.app-tool-nav-item.app-tool-nav-workspace .app-workspace-badge {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 1.35rem;
  padding: 0.2em 0.5em;
  border: none;
  background: color-mix(in srgb, var(--ui-color-on-primary) 18%, transparent);
  color: var(--ui-color-on-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: 0;
  vertical-align: middle;
}

.app-tool-nav-item.app-tool-nav-workspace.is-flash {
  background: var(--app-tool-nav-hover);
  color: var(--ui-color-on-primary);
}

.app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace {
  width: var(--app-tool-nav-item);
  max-width: var(--app-tool-nav-item);
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: var(--app-tool-nav-item);
  height: var(--app-tool-nav-item);
}

.app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace .app-tool-nav-icon-wrap {
  position: relative;
}

.app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace .app-tool-nav-title,
.app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace .app-workspace-badge {
  display: none !important;
}

/* Collapse: clip the wide inner rail — keep icon positions stable, fade labels. */
.app-tool-nav-title,
.app-tool-badge,
.app-tool-nav .app-title {
  transition-property: opacity;
  transition-duration: 0.18s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.app-tool-nav.is-collapsed .app-tool-nav-title,
.app-tool-nav.is-collapsed .app-tool-badge,
.app-tool-nav.is-collapsed .app-title {
  opacity: 0;
}

.app-tool-nav-flyout-tip {
  position: fixed;
  z-index: 1080;
  transform: translateY(-50%);
  padding: 0.35rem 0.55rem;
  border-radius: var(--ui-radius-control);
  background: var(--app-text);
  color: var(--app-surface);
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--app-text) 18%, transparent);
}

.app-tool-nav-flyout-tip[hidden] {
  display: none !important;
}

.app-tool-nav-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--app-tool-nav-gutter) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
}

.tool-nav-section {
  list-style: none;
  margin: 0.85rem 0 0.35rem;
  padding: 0 0.65rem;
}

.tool-nav-section:first-child {
  margin-top: 0.35rem;
}

.tool-nav-section-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-tool-nav-ink-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  padding: 0 0.15rem 0.25rem;
}

.app-tool-nav.is-collapsed .tool-nav-section {
  display: none;
}

.app-tool-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--ui-space-12);
  width: 100%;
  min-height: var(--app-tool-nav-item);
  padding: 0 0.7rem;
  border: none;
  border-radius: var(--ui-radius-control);
  background: transparent;
  color: var(--app-tool-nav-ink);
  text-align: start;
  cursor: pointer;
  overflow: hidden;
  transition-property: background-color, color, width, max-width, padding;
  transition-duration: 0.15s, 0.15s, 0.28s, 0.28s, 0.28s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.app-tool-nav-item:hover:not(:disabled):not(.is-active) {
  background: var(--app-tool-nav-hover);
  color: var(--ui-color-on-primary);
}

.app-tool-nav-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.app-tool-nav-item.is-active {
  background: var(--app-tool-nav-active);
  color: var(--app-primary);
  font-weight: 650;
}

.app-tool-nav-item.is-active .app-tool-nav-icon {
  opacity: 1;
  color: var(--app-primary);
}

.app-tool-nav-item.is-upcoming:not(.is-active) {
  color: var(--app-tool-nav-ink-muted);
  font-weight: 500;
}

.app-tool-nav-item.is-upcoming:not(.is-active) .app-tool-nav-icon {
  opacity: 0.5;
}

.app-tool-nav-item.is-upcoming:hover:not(:disabled):not(.is-active) {
  background: color-mix(in srgb, var(--ui-color-on-primary) 8%, transparent);
  color: color-mix(in srgb, var(--ui-color-on-primary) 70%, var(--app-primary));
}

.app-tool-nav-item.is-upcoming:hover:not(:disabled):not(.is-active) .app-tool-nav-icon {
  opacity: 0.7;
}

.app-tool-nav-icon-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
}

.app-tool-nav-icon {
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.2;
  color: inherit;
  opacity: 0.85;
}

.app-tool-nav-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-align: start;
}

.app-tool-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-height: 1.15rem;
  padding: 0.15em 0.5em;
  border-radius: var(--ui-radius-pill);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.app-tool-badge--upcoming {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-text) 10%, var(--app-border));
}

.app-tool-badge--preview {
  background: var(--app-primary-light);
  color: var(--app-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary) 22%, var(--app-border));
}

.app-tool-badge--alpha {
  background: color-mix(in srgb, #c47d0e 14%, var(--app-surface, #fff));
  color: #8a5a00;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c47d0e 28%, var(--app-border));
}

.app-tool-nav-item .app-tool-badge {
  width: 3.55rem;
  margin-left: auto;
  box-sizing: border-box;
  letter-spacing: 0.04em;
}

.app-tool-nav-item .app-tool-badge--upcoming {
  background: color-mix(in srgb, var(--ui-color-on-primary) 8%, transparent);
  color: color-mix(in srgb, var(--ui-color-on-primary) 48%, var(--app-primary));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-color-on-primary) 12%, transparent);
}

.app-tool-nav-item .app-tool-badge--preview {
  background: color-mix(in srgb, var(--ui-color-on-primary) 92%, transparent);
  color: var(--app-primary);
  box-shadow: none;
}

.app-tool-nav-item .app-tool-badge--alpha {
  background: color-mix(in srgb, #f0c14a 88%, transparent);
  color: #5c3d00;
  box-shadow: none;
}

.app-tool-nav-item.is-active .app-tool-badge--upcoming {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-text) 10%, var(--app-border));
}

.app-tool-nav-item.is-active .app-tool-badge--preview {
  background: var(--app-primary-light);
  color: var(--app-primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary) 22%, var(--app-border));
}

.app-tool-nav-item.is-active .app-tool-badge--alpha {
  background: color-mix(in srgb, #c47d0e 14%, var(--app-surface, #fff));
  color: #8a5a00;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c47d0e 28%, var(--app-border));
}

.app-tool-nav-item:hover:not(:disabled):not(.is-active) .app-tool-badge--upcoming {
  background: color-mix(in srgb, var(--ui-color-on-primary) 10%, transparent);
  color: color-mix(in srgb, var(--ui-color-on-primary) 62%, var(--app-primary));
}

.app-tool-nav-item:hover:not(:disabled):not(.is-active) .app-tool-badge--preview {
  background: var(--ui-color-on-primary);
  color: var(--app-primary);
}

.app-tool-nav-item:hover:not(:disabled):not(.is-active) .app-tool-badge--alpha {
  background: #f0c14a;
  color: #5c3d00;
}

.app-tool-main {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: var(--ui-space-20);
  padding-bottom: var(--ui-space-48);
  padding-left: var(--ui-space-24);
  padding-right: var(--ui-space-24);
}

/* Ausführungsplanung: fill remaining viewport height; table scrolls inside */
body:has(#toolPanelExecPlan:not([hidden]):not(.d-none)) .app-shell-main {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body:has(#toolPanelExecPlan:not([hidden]):not(.d-none)) .app-tool-main {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  padding-top: var(--ui-space-16);
  padding-bottom: var(--ui-space-16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body:has(#toolPanelExecPlan:not([hidden]):not(.d-none)) #toolPanelExecPlan {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

.app-tool-panel[hidden] {
  display: none !important;
}

.tool-placeholder {
  padding: var(--ui-space-8) 0 1rem;
  max-width: 36rem;
}

.tool-placeholder-lead {
  margin-top: var(--ui-space-8);
  font-size: var(--ui-font-size-sm);
  line-height: 1.45;
  color: var(--app-muted);
  text-wrap: pretty;
}

.workspace-empty-note {
  text-wrap: pretty;
  max-width: 36rem;
}

/* Shared workspace status — inventory + tool relevance */

.workspace-status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-panel);
  background: color-mix(in srgb, var(--app-surface-muted) 70%, var(--app-surface));
  font-size: var(--ui-font-size-sm);
  line-height: 1.4;
}

.workspace-status-main {
  min-width: 0;
  flex: 1 1 14rem;
  text-wrap: pretty;
}

.workspace-status-inv {
  font-weight: 600;
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

.workspace-status-sep {
  color: var(--app-muted);
}

.workspace-status-ready {
  color: var(--app-muted);
}

.workspace-status-miss {
  color: var(--app-text);
  font-weight: 600;
}

.workspace-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.65rem;
  flex: 0 0 auto;
}

.workspace-status-actions .btn-link {
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
  color: var(--app-primary);
}

.workspace-status-actions .btn-link:hover,
.workspace-status-actions .btn-link:focus-visible {
  text-decoration: underline;
}

.workspace-status-cta {
  font-weight: 650;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
    gap: 0;
    min-height: 0;
  }

  .app-tool-nav,
  .app-tool-nav.is-collapsed {
    position: static;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: var(--ui-space-12) var(--ui-space-16);
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-color-on-primary) 16%, transparent);
  }

  .app-tool-nav-inner {
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0;
  }

  .app-tool-nav-scroll {
    overflow: visible;
    padding-bottom: 0;
  }

  .app-tool-nav-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--ui-space-8);
    overflow-x: auto;
    padding-bottom: var(--ui-space-4);
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ui-color-on-primary) 28%, transparent) transparent;
  }

  .app-tool-nav-list::-webkit-scrollbar {
    height: 0.35rem;
  }

  .app-tool-nav-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .app-tool-nav-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ui-color-on-primary) 28%, transparent);
    border-radius: 999px;
  }

  .app-tool-nav-list::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }

  .app-tool-nav-item {
    flex: 0 0 auto;
    width: var(--app-tool-nav-inner);
    max-width: 70vw;
  }

  .app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace {
    width: var(--app-tool-nav-item);
    max-width: var(--app-tool-nav-item);
  }

  .app-tool-nav-toggle {
    flex: 0 0 var(--app-tool-nav-item);
  }

  .app-tool-nav.is-collapsed .app-tool-nav-toggle {
    left: 0;
  }

  .app-tool-nav-workspace {
    width: auto;
    max-width: var(--app-tool-nav-inner);
  }

  .app-tool-nav.is-collapsed .app-tool-nav-item.app-tool-nav-workspace {
    width: auto;
    max-width: none;
  }

  .app-tool-main {
    padding-top: var(--ui-space-16);
  }
}

code:not(.source-file-lines):not(.hljs) {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--app-primary);
  background: var(--app-primary-light);
  padding: 0.1em 0.35em;
  border-radius: var(--ui-radius-control);
}

.hint-snippet code,
.source-file-view code:not(.source-file-lines) {
  color: inherit;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Header / footer */

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--app-primary-light);
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 0;
  flex-shrink: 0;
}

.app-header-inner {
  min-height: var(--ui-size-header);
  padding-top: var(--ui-space-8);
  padding-bottom: var(--ui-space-8);
  gap: var(--ui-space-16);
}

.app-header-context {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-title {
  font-size: var(--ui-font-size-xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.app-tool-nav-about {
  width: 100%;
  position: relative;
}

.app-tool-nav-about > .app-tool-nav-about-btn {
  width: 100%;
}

.app-about-menu {
  --bs-dropdown-min-width: 14rem;
  padding: 0.75rem;
  margin-top: 0.35rem !important;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  color: var(--app-text);
  z-index: 1080 !important;
}

.app-about-panel {
  font-size: var(--ui-font-size-xs);
  line-height: 1.35;
}

.app-about-line {
  margin: 0;
  color: var(--app-muted);
}

.app-about-link {
  color: var(--app-primary);
  text-decoration: none;
}

.app-about-link:hover {
  text-decoration: underline;
}

.app-about-dev {
  border-top: 1px solid var(--app-border);
  padding-top: 0.65rem;
}

.app-about-dev-summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--app-muted);
  list-style: none;
}

.app-about-dev-summary::-webkit-details-marker {
  display: none;
}

.app-about-dev-summary::before {
  content: "▸ ";
  display: inline-block;
  width: 0.9em;
}

.app-about-dev[open] > .app-about-dev-summary::before {
  content: "▾ ";
}

.app-about-dev-body {
  margin-top: 0.55rem;
}

.app-about-menu .org-backup-select {
  width: 100%;
  max-width: none;
}

.app-tool-nav.is-collapsed .app-tool-nav-about {
  width: var(--app-tool-nav-item);
  max-width: var(--app-tool-nav-item);
  flex: 0 0 var(--app-tool-nav-item);
  overflow: visible;
}

.app-tool-nav.is-collapsed .app-tool-nav-about > .app-tool-nav-about-btn {
  width: var(--app-tool-nav-item);
  max-width: var(--app-tool-nav-item);
  min-height: var(--app-tool-nav-item);
  height: var(--app-tool-nav-item);
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.app-tool-nav.is-collapsed .app-tool-nav-about > .app-tool-nav-about-btn .app-tool-nav-icon-wrap {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

.app-tool-nav.is-collapsed .app-tool-nav-about > .app-tool-nav-about-btn .app-tool-nav-title {
  display: none !important;
}

.files-section-heading {
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.section-heading {
  font-size: var(--ui-font-size-lg);
  font-weight: 600;
}

.min-w-0 {
  min-width: 0;
}

@media (max-width: 768px) {
  .app-header-context {
    justify-content: flex-start;
  }
}

/* Entry drop zone — one compact surface on the canvas */

.upload-section {
  display: flex;
  justify-content: center;
  background: transparent;
  padding: 4.5rem 1rem 3rem;
}

.upload-section.has-history {
  padding-top: 2.5rem;
  padding-bottom: 1.25rem;
}

.source-chooser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 1rem 1.25rem;
  width: 100%;
  max-width: 56rem;
}

.source-chooser-or {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  align-self: center;
  color: var(--app-text-muted, #6c757d);
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-chooser-or span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-surface-muted, #eef1f4) 80%, var(--app-surface));
  border: 1px solid var(--app-border);
}

.source-chooser-card,
.drop-zone {
  width: 100%;
  max-width: none;
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  padding: 2rem 1.75rem;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  background: var(--app-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.drop-zone {
  cursor: pointer;
}

.source-chooser-card:hover,
.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  border-color: var(--app-primary);
  background: var(--app-surface);
  outline: none;
  box-shadow: 0 0 0 3px var(--app-primary-light, color-mix(in srgb, var(--app-primary) 18%, transparent));
}

.idv-source-card:hover {
  border-color: color-mix(in srgb, var(--app-primary) 45%, var(--app-border));
}

.source-chooser-card-body,
.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.source-chooser-icon,
.drop-zone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.85rem;
  border-radius: 0.75rem;
  font-size: 1.05rem;
  color: var(--app-primary);
  background: color-mix(in srgb, var(--app-primary) 10%, var(--app-surface));
}

.source-chooser-title,
.drop-zone-title {
  font-size: var(--ui-font-size-lg);
  font-weight: 600;
  text-wrap: balance;
  margin-bottom: 0.35rem;
}

.source-chooser-hint,
.drop-zone-hint {
  font-size: var(--ui-font-size-sm);
  max-width: 22rem;
  line-height: 1.45;
  text-wrap: pretty;
  margin-bottom: 1.15rem;
}

.idv-source-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 18.5rem;
  margin-bottom: 0.65rem;
}

.idv-source-select {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.idv-source-load-btn {
  width: 100%;
  white-space: nowrap;
}

.idv-source-load-btn:disabled {
  opacity: 0.55;
}

.source-chooser-status {
  min-height: 1.25rem;
  max-width: 22rem;
  font-variant-numeric: tabular-nums;
}

.idv-source-card.is-loading {
  cursor: progress;
  pointer-events: none;
  opacity: 0.92;
}

.idv-source-card--compact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(14rem, 1fr);
  gap: 0.85rem 1.25rem;
  align-items: center;
  width: 100%;
  max-width: none;
  padding: 1rem 1.15rem;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.idv-source-card-compact-main {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.idv-source-card--compact .source-chooser-icon {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.idv-source-card-compact-copy {
  min-width: 0;
}

.idv-source-card--compact .source-chooser-title {
  font-size: var(--ui-font-size-base, 1rem);
  margin-bottom: 0.15rem;
}

.idv-source-card--compact .source-chooser-hint {
  margin-bottom: 0;
  max-width: none;
}

.idv-source-card--compact .idv-source-controls {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-end;
  max-width: none;
  margin-bottom: 0;
}

.idv-source-card--compact .idv-source-select {
  flex: 1 1 11rem;
  width: auto;
}

.idv-source-card--compact .idv-source-load-btn {
  flex: 0 0 auto;
  width: auto;
}

.idv-source-card--compact .source-chooser-status {
  grid-column: 1 / -1;
  max-width: none;
  min-height: 0;
}

@media (max-width: 900px) {
  .source-chooser {
    grid-template-columns: 1fr;
    max-width: 35rem;
  }

  .source-chooser-or {
    padding: 0.15rem 0;
  }

  .source-chooser-or span {
    min-width: auto;
    min-height: auto;
    padding: 0.2rem 0.75rem;
  }

  .idv-source-card--compact {
    grid-template-columns: 1fr;
  }

  .idv-source-card--compact .idv-source-controls {
    justify-content: stretch;
  }

  .idv-source-card--compact .idv-source-load-btn {
    width: 100%;
  }
}

.drop-zone.is-loading {
  cursor: progress;
  pointer-events: none;
}

.drop-zone.is-loading .drop-zone-hint {
  font-variant-numeric: tabular-nums;
  max-width: 28rem;
  overflow-wrap: anywhere;
}

/* Full-page indicator while dragging files anywhere over the app */

.file-drag-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--app-z-drag-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--app-bg) 78%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.file-drag-overlay[hidden] {
  display: none !important;
}

.file-drag-overlay.is-active {
  pointer-events: auto;
  opacity: 1;
}

.file-drag-overlay-panel {
  width: min(100%, 28rem);
  padding: 2.5rem 2rem;
  text-align: center;
  border: 2px dashed var(--app-primary);
  border-radius: var(--app-panel-radius);
  background: var(--app-surface);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.08);
}

.file-drag-overlay-icon {
  display: inline-block;
  font-size: 2rem;
  color: var(--app-primary);
  margin-bottom: 0.75rem;
}

.file-drag-overlay-title {
  font-size: var(--ui-font-size-xl);
  font-weight: 600;
}

.file-drag-overlay-hint {
  font-size: var(--ui-font-size-sm);
}

/* Shared workspace modal */

.workspace-modal-lead {
  font-size: var(--ui-font-size-sm);
  text-wrap: pretty;
  margin-bottom: 0.85rem;
}

.workspace-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  margin-bottom: var(--ui-space-16);
}

.workspace-modal-empty {
  padding: var(--ui-space-16);
  border-radius: var(--ui-radius-panel);
  background: var(--app-surface-muted);
  font-size: var(--ui-font-size-sm);
  text-wrap: pretty;
}

.workspace-modal-group + .workspace-modal-group {
  margin-top: var(--ui-space-16);
}

.workspace-modal-group-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  margin: 0 0 var(--ui-space-8);
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.workspace-modal-group-tag {
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--app-primary);
  font-size: 0.72rem;
}

.workspace-modal-group.is-tool-other {
  opacity: 0.72;
}

.workspace-modal-group.is-tool-relevant .workspace-modal-group-title {
  color: var(--app-text);
}

.workspace-modal-group-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--app-text);
  letter-spacing: 0;
  text-transform: none;
}

.workspace-modal-explorer {
  max-height: none;
}

/* Chronological source history — same column as the drop zone */

.history-section {
  max-width: 35rem;
  margin: 0 auto 2rem;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ui-space-16);
  margin-bottom: var(--ui-space-8);
}

.history-heading {
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin: 0;
}

.history-clear-btn {
  padding: 0;
  color: var(--app-muted);
  text-decoration: none;
  font-size: var(--ui-font-size-sm);
  min-height: 0;
  line-height: inherit;
}

.history-clear-btn:hover,
.history-clear-btn:focus-visible {
  color: var(--app-text);
  text-decoration: underline;
}

.history-day {
  margin: 0 0 var(--ui-space-16);
}

.history-day:last-child {
  margin-bottom: 0;
}

.history-day-label {
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
  padding: var(--ui-space-4) 0;
}

.history-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--app-border);
}

.history-day-label + .history-item {
  border-top: 1px solid var(--app-border);
}

.history-open-btn {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: var(--ui-space-12);
  align-items: baseline;
  text-align: left;
  background: transparent;
  border: none;
  padding: var(--ui-space-8) var(--ui-space-4);
  min-height: var(--ui-size-control);
  cursor: pointer;
  color: inherit;
}

.history-open-btn:hover,
.history-open-btn:focus-visible {
  background: var(--app-surface-muted);
}

.history-time {
  font-family: var(--font-mono);
  font-size: var(--ui-font-size-sm);
  font-variant-numeric: tabular-nums;
  color: var(--app-muted);
}

.history-title {
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  font-size: var(--ui-font-size-xs);
  color: var(--app-text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-delete-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  border: none;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
  padding: 0;
}

.history-delete-btn:hover,
.history-delete-btn:focus-visible {
  color: var(--ui-color-danger);
  background: var(--ui-color-danger-muted);
}

@media (prefers-reduced-motion: reduce) {
  .app-tool-nav,
  .app-tool-nav-toggle,
  .app-tool-nav-item {
    transition: none;
  }

  .app-tool-nav-toggle:active {
    transform: none;
  }

  .history-open-btn,
  .history-delete-btn {
    transition: none;
  }

  .source-line {
    transition: none;
  }

  .source-line-arrive.source-line-active {
    animation: none;
  }

  .hint-ignore-btn {
    transition: none;
  }

  .hint-ignore-btn:active {
    transform: none;
  }

  .include-resolve-chrome .btn {
    transition: none;
  }

  .include-resolve-chrome .btn:active {
    transform: none;
  }

  .include-resolve-start {
    transition: none;
  }

  .include-resolve-start:active {
    transform: none;
  }
}

@media (max-width: 480px) {
  .history-open-btn {
    grid-template-columns: 3.25rem minmax(0, 1fr);
  }

  .history-meta {
    grid-column: 2;
  }
}

/* Workspace tool headings */

.workspace-program-label {
  display: flex;
  align-items: center;
  gap: var(--ui-space-8);
  font-size: var(--ui-font-size-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.workspace-program-label .app-tool-badge {
  margin-left: 0;
}

.file-explorer {
  --file-tree-step: 1.2rem;
  --file-tree-pad: 0.75rem;
  --file-tree-icon: 1rem;
  --file-tree-gap: 0.2rem;
  --file-tree-radius: 0.4rem;
  --file-tree-line: color-mix(in srgb, var(--app-text) 52%, var(--app-muted));
  background: var(--app-surface);
  border: var(--app-panel-border);
  border-radius: var(--app-panel-radius);
  box-shadow:
    0 1px 2px rgba(28, 36, 48, 0.06),
    0 0 0 1px color-mix(in srgb, var(--app-border-strong) 35%, transparent);
}

.file-explorer > :first-child {
  border-top-left-radius: calc(var(--app-panel-radius) - 1px);
  border-top-right-radius: calc(var(--app-panel-radius) - 1px);
}

.file-explorer > :last-child {
  border-bottom-left-radius: calc(var(--app-panel-radius) - 1px);
  border-bottom-right-radius: calc(var(--app-panel-radius) - 1px);
}

.file-explorer .file-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem var(--file-tree-pad);
  padding-left: calc(var(--file-tree-pad) + (var(--tree-depth, 0) * var(--file-tree-step)));
  border-bottom: 1px solid color-mix(in srgb, var(--app-border) 55%, transparent);
  font-size: var(--ui-font-size-md);
  transition: background-color 0.12s ease;
}

.file-explorer .file-item:hover {
  background: var(--app-surface-muted);
}

.file-explorer .file-item:last-child {
  border-bottom: none;
}

.file-explorer .file-tree-icon {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: var(--file-tree-icon);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--app-muted);
}

.file-explorer .file-tree-guides {
  position: absolute;
  left: var(--file-tree-pad);
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  width: calc(var(--tree-depth, 0) * var(--file-tree-step));
  pointer-events: none;
}

.file-explorer .file-tree-guide {
  position: relative;
  flex: 0 0 var(--file-tree-step);
  width: var(--file-tree-step);
  height: 100%;
}

.file-explorer .file-tree-guide--pipe::before {
  content: "";
  position: absolute;
  left: calc(var(--file-tree-icon) / 2);
  top: 0;
  bottom: 0;
  border-left: 1px dotted var(--file-tree-line);
}

/* Rounded L for every child; branch continues the vertical below the elbow. */
.file-explorer .file-tree-guide--branch::after,
.file-explorer .file-tree-guide--last::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  left: calc(var(--file-tree-icon) / 2);
  top: 0;
  width: calc(100% - (var(--file-tree-icon) / 2) - var(--file-tree-gap));
  height: 50%;
  border-left: 1px dotted var(--file-tree-line);
  border-bottom: 1px dotted var(--file-tree-line);
  border-bottom-left-radius: var(--file-tree-radius);
}

.file-explorer .file-tree-guide--branch::before {
  content: "";
  position: absolute;
  left: calc(var(--file-tree-icon) / 2);
  top: calc(50% - var(--file-tree-radius));
  bottom: 0;
  border-left: 1px dotted var(--file-tree-line);
}

@media (forced-colors: active) {
  .file-explorer .file-tree-guide--pipe::before,
  .file-explorer .file-tree-guide--branch::before,
  .file-explorer .file-tree-guide--branch::after,
  .file-explorer .file-tree-guide--last::after,
  .file-explorer .file-folder-label--branch::after {
    border-color: CanvasText;
  }
}

.file-explorer .file-path {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  font-size: var(--ui-font-size-sm);
  word-break: break-all;
}

.file-explorer .file-path .file-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--app-text);
}

.file-explorer .file-meta {
  flex-shrink: 0;
  color: var(--app-muted);
  font-size: var(--ui-font-size-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-explorer .file-folder-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: var(--ui-font-size-sm);
  color: var(--app-text);
  padding: 0.45rem var(--file-tree-pad);
  padding-left: calc(var(--file-tree-pad) + (var(--tree-depth, 0) * var(--file-tree-step)));
  background: color-mix(in srgb, var(--app-border-strong) 18%, var(--app-surface));
  border-bottom: 1px solid var(--app-border-strong);
}

.file-explorer .file-folder-label--nested {
  background: transparent;
  border-bottom-color: color-mix(in srgb, var(--app-border) 55%, transparent);
  font-weight: 600;
}

.file-explorer .file-folder-label .file-tree-icon {
  color: var(--app-primary);
}

/* Stem under folder icon → meets child guides at the row edge. */
.file-explorer .file-folder-label--branch::after {
  content: "";
  position: absolute;
  left: calc(
    var(--file-tree-pad) + (var(--tree-depth, 0) * var(--file-tree-step)) +
      (var(--file-tree-icon) / 2)
  );
  top: calc(50% + (var(--file-tree-icon) / 2) + var(--file-tree-gap));
  bottom: -1px;
  border-left: 1px dotted var(--file-tree-line);
  pointer-events: none;
}

.file-explorer .file-folder-name {
  min-width: 0;
  word-break: break-all;
}

.file-explorer .file-remove-btn {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: var(--ui-radius-control);
  background: transparent;
  color: var(--app-muted);
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.file-explorer .file-remove-btn::before {
  content: "";
  position: absolute;
  inset: -0.625rem;
}

.file-explorer .file-remove-btn:hover {
  background: rgba(26, 35, 50, 0.06);
  color: var(--app-text);
}

.file-explorer .file-remove-btn:active {
  transform: scale(0.96);
}

/* Filter bar — pills above the result panel, same language as the model tools */

.filter-bar,
.filter-bar .filter-bar-fields {
  overflow: visible;
}

.filter-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.filter-bar-label {
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--app-muted);
  line-height: 1.2;
}

.filter-bar-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.filter-bar-field {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
}

.filter-bar-field .filter-label-row {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-bar-reset {
  flex-shrink: 0;
  align-self: center;
  padding: 0.25rem 0;
  color: var(--app-muted);
  text-decoration: none;
}

.filter-bar-reset:hover,
.filter-bar-reset:focus-visible {
  color: var(--app-text);
  text-decoration: underline;
}

.multi-select-dropdown .multi-select-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.multi-select-dropdown .multi-select-toggle:focus:not(:focus-visible) {
  box-shadow: none;
}

.multi-select-dropdown .multi-select-toggle::after {
  margin-left: auto;
}

.filter-bar .multi-select-toggle {
  width: auto;
  min-height: 1.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--ui-radius-control);
  border-color: var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: none;
}

.filter-bar .multi-select-toggle::after {
  margin-left: 0.45rem;
  opacity: 0.4;
}

.filter-bar .multi-select-toggle--active {
  border-color: var(--app-border-strong);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: none;
}

.filter-bar .multi-select-toggle--active .multi-select-summary {
  font-weight: 600;
}

.multi-select-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.multi-select-menu {
  min-width: 16rem;
}

.viewport-scroll-menu {
  padding: 0 !important;
  background-color: var(--app-surface);
  overflow: hidden;
}

.viewport-scroll-menu-inner {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(24rem, calc(100vh - 8rem));
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.multi-select-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.25rem 0.5rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.8125rem;
}

.multi-select-action {
  text-decoration: none;
  line-height: 1.2;
}

.multi-select-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.25rem 0.35rem;
  border-radius: 0.25rem;
  width: 100%;
  cursor: pointer;
}

.multi-select-option .form-check-input {
  float: none;
  flex-shrink: 0;
  margin-left: 0;
  margin-top: 0.2em;
}

.multi-select-option:hover {
  background: var(--app-surface-muted);
}

.multi-select-option .form-check-label {
  flex: 1;
  min-width: 0;
  width: auto;
  cursor: pointer;
  font-size: 0.875rem;
}

/* Result panel — table is the only card */

.compare-results-panel {
  border: var(--app-panel-border);
  border-radius: var(--app-panel-radius);
  box-shadow: var(--app-panel-shadow);
  background: var(--app-surface);
  --result-tabs-offset: 3.5rem;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.result-tabs-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  position: sticky;
  /* Overlap the header when stuck so subpixel gaps cannot show scrolling content. */
  top: calc(var(--app-header-sticky-offset, 0px) - var(--app-sticky-overlap));
  z-index: var(--app-z-sticky-subbar);
  background: var(--app-surface);
  border-bottom: none;
  border-radius: var(--app-panel-radius) var(--app-panel-radius) 0 0;
  box-shadow:
    inset 0 1px 0 0 var(--app-surface),
    inset 0 -1px 0 0 var(--app-border);
}

.result-tabs-bar.is-stuck {
  border-radius: 0;
  box-shadow:
    0 -2px 0 0 var(--app-surface),
    inset 0 2px 0 0 var(--app-surface),
    inset 0 -1px 0 0 var(--app-border);
}

.result-tabs-title {
  flex-shrink: 0;
  line-height: 1.25;
}

.result-tabs-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
  flex-shrink: 0;
}

.result-tabs-actions .btn-outline-secondary {
  border-color: transparent;
  background: transparent;
  color: var(--app-muted);
}

.result-tabs-actions .btn-outline-secondary:hover,
.result-tabs-actions .btn-outline-secondary:focus-visible {
  border-color: transparent;
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.result-tabs-actions .btn-outline-secondary i {
  display: none;
}

.compare-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
  width: max-content;
  height: var(--ui-size-control);
  padding: var(--ui-space-2);
  gap: 0;
  background: var(--app-bg);
  border: none;
  border-radius: var(--ui-radius-panel);
}

.compare-tabs-seg {
  position: relative;
  display: flex;
  align-items: center;
  height: calc(var(--ui-size-control) - 2 * var(--ui-space-2));
  padding: 0 var(--ui-space-12);
  border-radius: var(--ui-radius-control);
  color: var(--app-muted);
  font-size: var(--ui-font-size-sm);
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  transition-property: color, background-color;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.compare-tabs-seg::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
}

.compare-tabs-seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compare-tabs-seg:hover {
  color: var(--app-primary);
}

.compare-tabs-seg:has(:checked) {
  color: var(--app-primary);
  font-weight: 600;
  background: var(--app-surface);
}

.compare-tabs-seg:has(:focus-visible) {
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
  z-index: 1;
}

.result-settings-dropdown .result-settings-toggle {
  display: inline-flex;
  align-items: center;
}

.result-settings-menu {
  min-width: 17.5rem;
  border-color: var(--app-border);
  box-shadow: 0 0.35rem 1rem rgba(26, 35, 50, 0.1);
  padding: 0 !important;
}

.result-settings-menu .viewport-scroll-menu-inner {
  padding: 0.5rem;
  max-height: min(32rem, calc(100vh - 7rem));
}

.result-settings-group + .result-settings-group {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--app-border);
}

.result-settings-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  padding: 0.1rem 0.55rem 0.3rem;
}

.result-settings-radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0;
  padding: 0.35rem 0.55rem;
  border-radius: var(--ui-radius-control);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.result-settings-radio-option + .result-settings-radio-option {
  margin-top: 0.1rem;
}

.result-settings-radio-option:hover {
  background: rgba(26, 35, 50, 0.04);
}

.result-settings-radio-option .form-check-input {
  margin-top: 0.15rem;
  margin-left: 0;
  float: none;
  flex-shrink: 0;
}

.result-settings-radio-option .form-check-label {
  cursor: pointer;
  user-select: none;
  padding-left: 0;
  font-size: var(--ui-font-size-sm);
  line-height: 1.35;
  flex: 1;
}

.result-settings-radio-option.is-disabled {
  opacity: 0.55;
  cursor: default;
}

.result-settings-radio-option.is-disabled .form-check-label {
  cursor: default;
}

.search-group {
  width: 220px;
}

.search-group .input-group-text {
  background: var(--app-surface);
  border-color: var(--app-border);
  color: var(--app-muted);
}

.compare-table tbody tr.result-detail-row > td {
  position: relative;
  z-index: 3;
}

.compare-table {
  font-size: var(--ui-font-size-md);
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  --sticky-expand-width: 2.25rem;
  --compare-row-hover-bg: var(--ui-table-row-hover);
  --compare-col-hover-bg: var(--ui-table-col-hover);
  --compare-row-col-hover-bg: var(--ui-table-row-col-hover);
}

/* Page scroll: overflow clip on table wrapper breaks sticky thead. */
.compare-results-panel > .results-table-wrap {
  overflow: visible;
  position: relative;
  --compare-col-hover-bg: var(--ui-table-col-hover);
  --compare-row-col-hover-bg: var(--ui-table-row-col-hover);
}

/* One overlay bar instead of restyling every body cell in the column. */
.table-col-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
  background: var(--compare-col-hover-bg, var(--ui-table-col-hover));
}

.table-col-hover-overlay.is-visible {
  display: block;
}

.compare-table thead th,
.compare-table tbody tr.result-row td {
  white-space: nowrap;
}

.compare-table thead th.col-datenbank,
.compare-table thead th.col-schema,
.compare-table td.col-datenbank,
.compare-table td.col-schema {
  width: 1%;
}

.compare-table thead th {
  background-color: var(--app-table-head-fill);
  color: var(--app-table-head-text);
  border-bottom: none;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
  --app-table-head-bleed-cover: inset 0 2px 0 0 var(--app-table-head-fill);
  box-shadow:
    0 -2px 0 0 var(--app-table-head-fill),
    var(--app-table-head-bleed-cover),
    var(--app-table-head-edge-shadow);
  padding-top: var(--app-table-head-padding-y);
  padding-bottom: var(--app-table-head-padding-y);
}

.compare-table tbody tr.result-row > td {
  padding-top: var(--app-table-row-padding-y);
  padding-bottom: var(--app-table-row-padding-y);
  vertical-align: middle;
}

.compare-results-panel > .results-table-wrap > .compare-table thead th {
  /* Extra overlap: tabs bar already sits 1px higher, so subtract twice. */
  top: calc(
    var(--app-header-sticky-offset, 0px)
    + var(--result-tabs-offset, 3.5rem)
    - var(--app-sticky-overlap)
    - var(--app-sticky-overlap)
  );
}

.compare-table tbody tr {
  cursor: default;
}

.compare-table tbody tr.expandable {
  cursor: pointer;
}

.compare-table.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: var(--compare-row-hover-bg);
}

.compare-table th.col-hover,
.compare-table td.col-hover {
  --bs-table-bg-state: var(--compare-col-hover-bg);
}

.compare-table.table-hover > tbody > tr:hover > .col-hover {
  --bs-table-bg-state: var(--compare-row-col-hover-bg);
}

.compare-table th.col-hover {
  --app-table-head-fill: color-mix(in srgb, var(--app-text) 5%, var(--app-table-head-bg));
}

/* content-visibility: auto breaks sticky thead painting (see model-tools mapping.css). */
.compare-table tbody > tr:not(.result-detail-row):not(.result-group-row) {
  content-visibility: visible;
  contain-intrinsic-size: auto 2.5rem;
}

.compare-table tbody td.result-col-expand {
  position: sticky;
  left: 0;
  z-index: 1;
  width: var(--sticky-expand-width);
  min-width: var(--sticky-expand-width);
  max-width: var(--sticky-expand-width);
  background: inherit;
  text-align: center;
  vertical-align: middle;
  padding: var(--app-table-expand-padding-y) 0.25rem var(--app-table-expand-padding-y) 0.5rem;
}

.compare-table thead th.result-col-expand {
  left: auto;
  z-index: 3;
  width: var(--sticky-expand-width);
  min-width: var(--sticky-expand-width);
  max-width: var(--sticky-expand-width);
  text-align: center;
  vertical-align: middle;
  padding-top: var(--app-table-head-padding-y);
  padding-bottom: var(--app-table-head-padding-y);
  padding-left: 0.5rem;
  padding-right: 0.25rem;
  background-color: var(--app-table-head-bg);
  box-shadow:
    0 -2px 0 0 var(--app-table-head-fill),
    var(--app-table-head-bleed-cover),
    var(--app-table-head-edge-shadow);
}

.compare-table tbody tr .result-col-expand {
  background: var(--app-surface);
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, transparent);
}

.compare-table td.col-tabelle,
.compare-table td.col-schema {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.compare-table td.attr-star {
  color: var(--app-muted);
  font-style: italic;
}

.compare-table td.col-datei {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.compare-table th.col-vorkommen,
.compare-table td.col-vorkommen {
  width: 1%;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.compare-table td.col-vorkommen-has-value {
  color: var(--app-primary);
  font-weight: 600;
}

.compare-table tbody tr.result-group-row {
  cursor: default;
}

.compare-table tbody tr.result-group-row > td {
  background: var(--app-surface-muted);
  border-bottom: 1px solid var(--app-border);
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  white-space: nowrap;
}

.compare-table.table-hover > tbody > tr.result-group-row:hover > * {
  --bs-table-bg-state: var(--app-surface-muted);
}

.result-group-inner {
  display: flex;
  align-items: baseline;
  gap: 0.55rem 0.75rem;
  min-width: 0;
}

.result-group-path {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.result-group-sep {
  color: var(--app-muted);
  font-weight: 500;
}

.result-group-label {
  font-weight: 650;
  color: var(--app-text);
}

.result-group-row[data-group-by="schema"] .result-group-path,
.result-group-row[data-group-by="tabelle"] .result-group-path {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.result-group-meta {
  color: var(--app-muted);
  font-weight: 500;
}

.result-group-stats {
  margin-left: auto;
  color: var(--app-muted);
  font-size: var(--ui-font-size-sm);
  font-weight: 500;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
  border-radius: 0 0 var(--app-panel-radius) var(--app-panel-radius);
}

.table-pagination .btn {
  border-radius: var(--ui-radius-control);
}

/* Bottom panel corners when pagination is hidden (table is the visual footer). */
.compare-results-panel:has(#resultsPagination.d-none)
  > .results-table-wrap:not(.d-none)
  .compare-table tbody > tr:last-child.result-row > td:first-child {
  border-bottom-left-radius: calc(var(--app-panel-radius) - 1px);
}

.compare-results-panel:has(#resultsPagination.d-none)
  > .results-table-wrap:not(.d-none)
  .compare-table tbody > tr:last-child.result-row > td:last-child {
  border-bottom-right-radius: calc(var(--app-panel-radius) - 1px);
}

.compare-results-panel:has(#resultsPagination.d-none)
  > .results-table-wrap:not(.d-none)
  .compare-table tbody > tr:last-child.result-detail-row > td,
.compare-results-panel:has(#resultsPagination.d-none)
  > .results-table-wrap:not(.d-none)
  .compare-table tbody > tr:last-child.result-group-row > td {
  border-bottom-left-radius: calc(var(--app-panel-radius) - 1px);
  border-bottom-right-radius: calc(var(--app-panel-radius) - 1px);
}

.compare-results-panel > .empty-state:not(.d-none) {
  border-radius: 0 0 var(--app-panel-radius) var(--app-panel-radius);
}

.empty-state {
  padding: 0.9rem 1.15rem 1.15rem;
  color: var(--app-muted);
  font-size: var(--ui-font-size-sm);
  line-height: 1.45;
}

@media (max-width: 768px) {
  .result-tabs-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .result-tabs-search.search-group {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* Analysis hints — same filter bar language as the result panel */

.hints-filtered-empty {
  padding: 0.85rem 1rem;
  font-size: var(--ui-font-size-sm);
}

.hints-results-panel {
  --result-tabs-offset: 0px;
}

.hints-results-panel .compare-table thead th,
.hints-results-panel .compare-table thead th.result-col-expand {
  position: static;
  top: auto;
  box-shadow: none;
  border-bottom: 1px solid var(--app-table-head-edge);
}

.hints-results-panel .compare-table thead th:first-child {
  border-top-left-radius: calc(var(--app-panel-radius) - 1px);
}

.hints-results-panel .compare-table thead th:last-child {
  border-top-right-radius: calc(var(--app-panel-radius) - 1px);
}

.hints-results-panel .compare-table tbody > tr:last-child.result-row > td:first-child,
.hints-results-panel .compare-table tbody > tr:last-child.result-detail-row > td {
  border-bottom-left-radius: calc(var(--app-panel-radius) - 1px);
}

.hints-results-panel .compare-table tbody > tr:last-child.result-row > td:last-child,
.hints-results-panel .compare-table tbody > tr:last-child.result-detail-row > td {
  border-bottom-right-radius: calc(var(--app-panel-radius) - 1px);
}

.hint-location {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--app-border);
}

.hint-location:last-child {
  border-bottom: none;
}

.hint-location-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--app-primary);
  margin-bottom: 0.35rem;
  word-break: break-all;
}

.hint-snippet {
  margin: 0;
  padding: 0.55rem 0.65rem;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-rule);
  border-radius: var(--ui-radius-control);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-x: auto;
}

.hint-snippet .hljs,
.hint-snippet [class*="hljs-"] {
  background: transparent;
  padding: 0;
}

.hint-snippet-line {
  display: block;
  white-space: pre;
  min-height: 1.45em;
  color: var(--code-fg);
}

.hint-snippet-code {
  white-space: pre;
}

.hint-snippet-code .hljs {
  display: inline;
  padding: 0;
  background: transparent;
}

.hint-table-wrap {
  overflow: visible;
}

.hint-table {
  width: 100%;
  min-width: 100%;
}

.hint-table .result-col-expand {
  position: static;
  left: auto;
}

.hint-table.compare-table tbody tr .result-col-expand {
  box-shadow: none;
}

.hint-table th.col-hint-art,
.hint-table td.col-hint-art {
  white-space: nowrap;
}

.hint-table td.col-hint-id,
.hint-table tbody tr.result-row td.col-hint-id {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  max-width: 36rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint-table th.col-hint-action,
.hint-table td.col-hint-action {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.hint-table .hint-ignore-btn {
  min-height: 0;
  min-width: 0;
  padding: 0;
  line-height: inherit;
  font-size: inherit;
  vertical-align: baseline;
}

.hint-ignore-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--app-muted);
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  border-radius: var(--ui-radius-control);
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition-property: color, background-color, transform;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.hint-ignore-btn:hover,
.hint-ignore-btn:focus-visible {
  color: var(--app-primary);
  background: var(--app-primary-light);
  padding: 0 0.2rem;
  margin: 0 -0.2rem;
}

.hint-ignore-btn:active {
  transform: scale(0.96);
}

.result-col-expand {
  width: 2.25rem;
  padding-left: 0.5rem;
  padding-right: 0.25rem;
}

.result-expand-btn {
  border: none;
  background: transparent;
  color: var(--app-muted);
  padding: 0.1rem 0.25rem;
  line-height: 1;
  border-radius: var(--ui-radius-control);
  cursor: pointer;
}

.result-expand-btn:hover {
  color: var(--app-primary);
  background: var(--app-primary-light);
}

.result-expand-btn.is-open {
  color: var(--app-primary);
}

.result-expand-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.result-expand-btn i {
  transition: transform 0.15s ease;
}

.result-expand-btn.is-open i {
  transform: rotate(90deg);
}

.result-detail-row td.result-detail-cell {
  padding: 0;
  background: var(--code-panel-bg);
  border-top: none;
  overflow: hidden;
  white-space: normal;
}

.result-detail-inner {
  padding: 0.5rem 0.75rem 0.65rem 2.5rem;
  min-width: 0;
  overflow: hidden;
  contain: inline-size;
  width: 100%;
  box-sizing: border-box;
}

.compare-table tbody tr.result-row.is-open td {
  border-bottom-color: transparent;
}

.source-file-view {
  max-height: min(28rem, 55vh);
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--code-bg);
}

.source-file-lines {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--code-fg);
  background: transparent;
  padding: 0;
  border-radius: 0;
  width: max-content;
  min-width: 100%;
}

.source-line-text .hljs {
  display: inline;
  padding: 0;
  background: transparent;
}

.source-line {
  display: flex;
  min-height: 1.45em;
  max-width: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.source-line-no {
  flex-shrink: 0;
  box-sizing: content-box;
  min-width: calc(var(--line-no-digits, 4) * 1ch);
  padding: 0 0.65rem 0 0.55rem;
  color: var(--code-muted);
  user-select: none;
  border-right: 1px solid var(--code-rule);
  margin-right: 0.55rem;
  white-space: pre;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-line-text {
  flex: 1;
  min-width: 0;
  padding-right: 0.55rem;
  white-space: pre;
}

.source-line-highlight {
  background: var(--code-highlight-bg);
  box-shadow: inset 3px 0 0 var(--code-highlight-bar);
}

.source-line-highlight .source-line-no {
  color: var(--code-highlight-line-no);
  font-weight: 600;
}

.source-line-active {
  background: color-mix(in srgb, var(--code-highlight-bg) 70%, var(--code-highlight-bar));
  box-shadow: inset 4px 0 0 var(--code-highlight-bar);
}

.source-line-active .source-line-no {
  color: var(--code-highlight-line-no);
  font-weight: 700;
}

.source-line-arrive.source-line-active {
  animation: source-line-arrive 0.28s ease;
}

@keyframes source-line-arrive {
  0% {
    box-shadow: inset 6px 0 0 var(--code-highlight-bar);
    background: color-mix(in srgb, var(--code-highlight-bar) 28%, var(--code-highlight-bg));
  }
  100% {
    box-shadow: inset 4px 0 0 var(--code-highlight-bar);
    background: color-mix(in srgb, var(--code-highlight-bg) 70%, var(--code-highlight-bar));
  }
}

.source-line-jump {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-line-jump:hover {
  color: var(--app-primary-hover);
}

.source-line-jump-active {
  font-weight: 700;
  text-decoration: none;
}

.source-line-no-jump {
  cursor: pointer;
}

.source-line-no-jump:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.result-source-location {
  margin-bottom: 0.65rem;
}

.result-source-location:last-child {
  margin-bottom: 0;
}

.error-report {
  --bs-alert-padding-x: 1rem;
  --bs-alert-padding-y: 0.9rem;
}

.error-report-title {
  font-weight: 650;
  font-size: var(--ui-font-size-md);
  margin-bottom: 0.35rem;
  text-wrap: balance;
}

.error-report-lead {
  margin-bottom: 0.75rem;
  color: var(--app-text);
  text-wrap: pretty;
}

.error-report-facts {
  display: grid;
  gap: 0.35rem 1rem;
  margin: 0 0 0.75rem;
  font-size: var(--ui-font-size-sm);
}

.error-report-facts > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  align-items: start;
}

.error-report-facts dt {
  margin: 0;
  color: var(--app-muted);
  font-weight: 500;
}

.error-report-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.error-report-details {
  margin: 0;
}

.error-report-details summary {
  cursor: pointer;
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

.error-report-details summary:hover,
.error-report-details summary:focus-visible {
  color: var(--app-primary);
}

.error-report-copy {
  margin: 0.5rem 0 0.65rem;
  min-height: 2.5rem;
}

.error-report-dump {
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border-radius: calc(var(--app-panel-radius) - 2px);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  font-family: var(--font-mono);
  font-size: var(--ui-font-size-xs);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Include-Auflösung */

.include-resolve-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-16);
  padding-bottom: var(--ui-space-20);
  margin-bottom: var(--ui-space-16);
  box-shadow: inset 0 -1px 0 0 var(--app-border);
}

.include-resolve-head .workspace-program-label {
  margin: 0;
}

.include-resolve-work {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-20);
  margin-top: 0;
  min-width: 0;
}

.include-resolve-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--ui-space-12);
}

.include-resolve-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-8) var(--ui-space-12);
  min-width: 0;
}

.include-resolve-select {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
  max-width: 36rem;
}

.include-resolve-label {
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  color: var(--app-text);
  margin: 0;
  white-space: nowrap;
}

.include-resolve-starts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  margin: 0;
}

.include-resolve-starts[hidden] {
  display: none !important;
}

.include-resolve-start {
  appearance: none;
  border: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--font-mono);
  font-size: var(--ui-font-size-xs);
  line-height: 1.25;
  min-height: var(--ui-size-control);
  padding: 0 var(--ui-space-8);
  border-radius: var(--ui-radius-control);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition-property: color, background-color;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.include-resolve-start:hover,
.include-resolve-start:focus-visible {
  color: var(--app-primary);
  background: var(--app-primary-light);
}

.include-resolve-start.is-active {
  color: var(--app-primary);
  background: var(--app-primary-light);
  font-weight: 650;
}

.include-resolve-start:active {
  transform: scale(0.96);
}

.include-resolve-stats {
  font-size: var(--ui-font-size-sm);
  color: var(--ui-color-warning);
  font-variant-numeric: tabular-nums;
  margin: 0;
  padding: var(--ui-space-8) var(--ui-space-12);
  border-radius: var(--ui-radius-control);
  background: var(--ui-color-warning-muted);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-color-warning) 18%, var(--app-border));
}

.include-resolve-stats[hidden] {
  display: none !important;
}

.include-resolve-output {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
  min-width: 0;
}

.include-resolve-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-12) var(--ui-space-16);
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.include-resolve-chrome .btn {
  transition-property: color, background-color, border-color, transform;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.include-resolve-chrome .btn:active {
  transform: scale(0.96);
}

.include-resolve-chrome-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-8);
}

.include-resolve-chrome-opts {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-12) var(--ui-space-20);
}

.include-resolve-chrome .btn.is-copied {
  color: var(--app-success, #1b7a4a);
  border-color: color-mix(in srgb, var(--app-success, #1b7a4a) 45%, var(--app-border));
}

.include-resolve-chrome-opts .form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--ui-size-control);
  margin: 0;
  padding-left: 0;
}

.include-resolve-chrome-opts .form-check-input {
  float: none;
  margin: 0;
  flex-shrink: 0;
}

.include-resolve-chrome-opts .form-check-label {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  color: var(--app-text);
}

.include-resolve-panel {
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  background: var(--code-bg);
  /* visible so CSS sticky labels can use the page scrollport */
  overflow: visible;
}

.include-resolve-source-wrap {
  position: relative;
  background: var(--code-bg);
  border-radius: var(--app-panel-radius);
  overflow: visible;
}

.include-resolve-source {
  max-height: none;
  overflow: visible;
  max-width: 100%;
  border: 0;
  border-radius: var(--app-panel-radius);
  background: var(--code-bg);
}

.include-resolve-panel .include-resolve-source {
  border-radius: var(--app-panel-radius);
  background: var(--code-bg);
}

.include-resolve-source .source-file-lines {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.include-resolve-source .source-line {
  max-width: 100%;
  align-items: stretch;
}

.include-resolve-source .source-line-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* Soft-wrap: first visual line flush, continuations indented */
  padding-left: 1.25ch;
  text-indent: -1.25ch;
}

.include-resolve-source .source-line-no {
  align-self: flex-start;
  width: calc(var(--line-no-digits, 2) * 1ch);
  min-width: calc(var(--line-no-digits, 2) * 1ch);
  max-width: calc(var(--line-no-digits, 2) * 1ch);
  padding: 0 0.35rem 0 0.25rem;
  margin-right: 0.2rem;
  border-right-width: 0;
}

.include-resolve-source:not(.is-decor-off) .source-line-no {
  margin-right: 0.2rem;
}

/* Fixed-width rail between gutter and code — same for every line, bars never shift text */
.include-resolve-source .include-depth-rail {
  flex: 0 0 0;
  width: 0;
  position: relative;
  align-self: stretch;
  pointer-events: none;
}

.include-resolve-source:not(.is-decor-off) .include-depth-rail {
  flex: 0 0 7px;
  width: 7px;
  margin-right: 0.25rem;
}

.include-resolve-source.is-decor-off .include-depth-rail {
  display: none;
}

/* Toggle: Include-Hervorhebung aus — keine Schattierung, Balken, Ränder oder Datei-Labels */
.include-resolve-source.is-decor-off .source-line.is-included,
.include-resolve-source.is-decor-off .source-line.is-cycle,
.include-resolve-source.is-decor-off .source-line.is-unresolved,
.include-resolve-source.is-decor-off .source-line.is-included.is-include-start,
.include-resolve-source.is-decor-off .source-line.is-included.is-include-end,
.include-resolve-source.is-decor-off .source-line.is-included.is-include-start.is-include-end,
.include-resolve-source.is-decor-off .source-line.is-cycle.is-include-start,
.include-resolve-source.is-decor-off .source-line.is-cycle.is-include-end,
.include-resolve-source.is-decor-off .source-line.is-unresolved.is-include-start,
.include-resolve-source.is-decor-off .source-line.is-unresolved.is-include-end {
  background: transparent;
  box-shadow: none;
}

.include-resolve-source.is-decor-off .include-block-chip-slot,
.include-resolve-source.is-decor-off .include-chip-trail {
  display: none !important;
}

.include-resolve-source.is-decor-off .source-line.is-include-marker .source-line-text {
  opacity: 1;
}

/* Depth bars painted inside the fixed rail */
.include-resolve-source .source-line.is-included,
.include-resolve-source .source-line.is-cycle,
.include-resolve-source .source-line.is-unresolved {
  --include-bar-1: #4ecdc4;
  --include-bar-2: #3cb5ac;
  --include-bar-3: #2a9189;
  --include-bar-4: #1c6e68;
  --include-bar-gap: 1px;
  --include-bar-w: 1px;
}

.include-resolve-source .source-line.is-included .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved .include-depth-rail::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--include-depth, 1) * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap));
  max-width: 100%;
  border-radius: 1px;
  pointer-events: none;
  background: var(--include-bar-1);
}

.include-resolve-source .source-line.is-included[data-include-depth="2"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="2"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="2"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    var(--include-bar-2) calc(var(--include-bar-w) + var(--include-bar-gap)) 100%
  );
}

.include-resolve-source .source-line.is-included[data-include-depth="3"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="3"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="3"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    var(--include-bar-2) calc(var(--include-bar-w) + var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)),
    transparent calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))),
    var(--include-bar-3) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))) 100%
  );
}

.include-resolve-source .source-line.is-included[data-include-depth="4"] .include-depth-rail::before,
.include-resolve-source .source-line.is-included[data-include-depth="5"] .include-depth-rail::before,
.include-resolve-source .source-line.is-included[data-include-depth="6"] .include-depth-rail::before,
.include-resolve-source .source-line.is-included[data-include-depth="7"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="4"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="5"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="6"] .include-depth-rail::before,
.include-resolve-source .source-line.is-cycle[data-include-depth="7"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="4"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="5"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="6"] .include-depth-rail::before,
.include-resolve-source .source-line.is-unresolved[data-include-depth="7"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    var(--include-bar-2) calc(var(--include-bar-w) + var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)),
    transparent calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))),
    var(--include-bar-3) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))) calc(3 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)),
    transparent calc(3 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)) calc(3 * (var(--include-bar-w) + var(--include-bar-gap))),
    var(--include-bar-4) calc(3 * (var(--include-bar-w) + var(--include-bar-gap))) 100%
  );
}

.include-resolve-source .source-line.is-cycle[data-include-depth="1"] .include-depth-rail::before {
  background: #e8a45a;
}

.include-resolve-source .source-line.is-unresolved[data-include-depth="1"] .include-depth-rail::before {
  background: #e07a7a;
}

.include-resolve-source .source-line.is-cycle[data-include-depth="2"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    #e8a45a calc(var(--include-bar-w) + var(--include-bar-gap)) 100%
  );
}

.include-resolve-source .source-line.is-unresolved[data-include-depth="2"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    #e07a7a calc(var(--include-bar-w) + var(--include-bar-gap)) 100%
  );
}

.include-resolve-source .source-line.is-cycle[data-include-depth="3"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    var(--include-bar-2) calc(var(--include-bar-w) + var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)),
    transparent calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))),
    #e8a45a calc(2 * (var(--include-bar-w) + var(--include-bar-gap))) 100%
  );
}

.include-resolve-source .source-line.is-unresolved[data-include-depth="3"] .include-depth-rail::before {
  background: linear-gradient(
    90deg,
    var(--include-bar-1) 0 var(--include-bar-w),
    transparent var(--include-bar-w) calc(var(--include-bar-w) + var(--include-bar-gap)),
    var(--include-bar-2) calc(var(--include-bar-w) + var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)),
    transparent calc(2 * (var(--include-bar-w) + var(--include-bar-gap)) - var(--include-bar-gap)) calc(2 * (var(--include-bar-w) + var(--include-bar-gap))),
    #e07a7a calc(2 * (var(--include-bar-w) + var(--include-bar-gap))) 100%
  );
}

.include-resolve-source .source-line.is-included {
  --include-tint: #4ecdc4;
  --include-shade: 16%;
  --include-edge: color-mix(in srgb, #d4f6f1 12%, transparent);
  background: color-mix(in srgb, var(--include-tint) var(--include-shade), var(--code-bg));
}

.include-resolve-source .source-line.is-included[data-include-depth="2"] {
  --include-tint: #3cb5ac;
  --include-shade: 26%;
}

.include-resolve-source .source-line.is-included[data-include-depth="3"] {
  --include-tint: #2a9189;
  --include-shade: 38%;
}

.include-resolve-source .source-line.is-included[data-include-depth="4"],
.include-resolve-source .source-line.is-included[data-include-depth="5"],
.include-resolve-source .source-line.is-included[data-include-depth="6"],
.include-resolve-source .source-line.is-included[data-include-depth="7"] {
  --include-tint: #1c6e68;
  --include-shade: 50%;
}

.include-resolve-source .source-line.is-included.is-include-start {
  box-shadow: inset 0 1px 0 0 var(--include-edge);
}

.include-resolve-source .source-line.is-included.is-include-end {
  box-shadow: inset 0 -1px 0 0 var(--include-edge);
}

.include-resolve-source .source-line.is-included.is-include-start.is-include-end {
  box-shadow:
    inset 0 1px 0 0 var(--include-edge),
    inset 0 -1px 0 0 var(--include-edge);
}

.include-resolve-source .source-line.is-cycle,
.include-resolve-source .source-line.is-unresolved {
  --include-shade: 24%;
  background: color-mix(in srgb, var(--include-tint) var(--include-shade), var(--code-bg));
}

.include-resolve-source .source-line.is-cycle {
  --include-tint: #e8a45a;
  --include-edge: color-mix(in srgb, #f3d5a8 12%, transparent);
}

.include-resolve-source .source-line.is-unresolved {
  --include-tint: #e07a7a;
  --include-edge: color-mix(in srgb, #f0c4c4 12%, transparent);
}

.include-resolve-source .source-line.is-cycle.is-include-start,
.include-resolve-source .source-line.is-unresolved.is-include-start {
  box-shadow: inset 0 1px 0 0 var(--include-edge);
}

.include-resolve-source .source-line.is-cycle.is-include-end,
.include-resolve-source .source-line.is-unresolved.is-include-end {
  box-shadow: inset 0 -1px 0 0 var(--include-edge);
}

.include-resolve-source .source-line.is-include-marker .source-line-text {
  opacity: 0.82;
}

.include-resolve-source .source-line.is-include-start {
  position: relative;
}

.include-resolve-source .include-block {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  --include-tint: #4ecdc4;
  --include-chip-fg: #0b1220;
  --include-chip-bg: color-mix(in srgb, #4ecdc4 55%, #e8fffb);
}

.include-resolve-source .include-block[data-include-depth="2"] {
  --include-tint: #3cb5ac;
  --include-chip-bg: color-mix(in srgb, #3cb5ac 68%, #c5f0eb);
}

.include-resolve-source .include-block[data-include-depth="3"] {
  --include-tint: #2a9189;
  --include-chip-fg: #f2fffd;
  --include-chip-bg: color-mix(in srgb, #2a9189 82%, #0b1220);
}

.include-resolve-source .include-block[data-include-depth="4"],
.include-resolve-source .include-block[data-include-depth="5"],
.include-resolve-source .include-block[data-include-depth="6"],
.include-resolve-source .include-block[data-include-depth="7"] {
  --include-tint: #1c6e68;
  --include-chip-fg: #f2fffd;
  --include-chip-bg: color-mix(in srgb, #1c6e68 88%, #061018);
}

.include-resolve-source .include-block.is-cycle {
  --include-tint: #e8a45a;
  --include-chip-fg: #0b1220;
  --include-chip-bg: color-mix(in srgb, #e8a45a 72%, #fff4e5);
}

.include-resolve-source .include-block.is-unresolved {
  --include-tint: #e07a7a;
  --include-chip-fg: #0b1220;
  --include-chip-bg: color-mix(in srgb, #e07a7a 72%, #ffe8e8);
}

/* Sticky file labels: absolute right stack — parents peek left; only peek motion animates. */
.include-resolve-source .include-chip-trail {
  --chip-peek: 0.72rem;
  position: sticky;
  top: var(--app-header-sticky-offset, 0px);
  z-index: 12;
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  visibility: hidden;
}

.include-resolve-source .include-chip-trail.is-active {
  visibility: visible;
}

.include-resolve-source .include-chip-trail .include-file-chip {
  position: absolute;
  top: 0;
  right: var(--include-file-chip-inset, 8px);
  z-index: var(--stack-i, 1);
  margin: 0;
  transform: translateX(calc(var(--stack-from-end, 0) * -1 * var(--chip-peek)));
  transform-origin: right center;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.28s ease,
    box-shadow 0.28s ease;
}

.include-resolve-source .include-chip-trail .include-file-chip.is-back {
  filter: brightness(0.9);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--include-tint, #4ecdc4) 40%, transparent),
    2px 0 6px -2px color-mix(in srgb, #000 28%, transparent);
}

.include-resolve-source .include-chip-trail .include-file-chip.is-front {
  filter: none;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--include-tint, #4ecdc4) 45%, transparent),
    0 1px 4px color-mix(in srgb, #000 18%, transparent);
}

.include-resolve-source .include-chip-trail .include-file-chip.is-leaving {
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.include-resolve-source .include-chip-trail .include-file-chip.is-instant {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .include-resolve-source .include-chip-trail .include-file-chip {
    transition: none;
  }
}

.include-resolve-source .include-block-chip-slot {
  position: sticky;
  top: var(--app-header-sticky-offset, 0px);
  z-index: calc(3 + var(--include-depth, 1));
  height: 0;
  text-align: right;
  overflow: visible;
  pointer-events: none;
}

.include-resolve-source .include-block-chip-slot.is-obscured .include-file-chip {
  visibility: hidden;
}

.include-resolve-source .include-file-chip {
  display: inline-block;
  box-sizing: border-box;
  width: max-content;
  min-width: max-content;
  max-width: none;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--include-chip-fg, #0b1220);
  background-color: var(--include-chip-bg, #9fe8e0);
  padding: 0.14rem 0.35rem 0.16rem;
  border-radius: 0 0 0.25rem 0.25rem;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--include-tint, #4ecdc4) 40%, transparent);
}

.include-resolve-source .include-block-chip-slot .include-file-chip {
  margin: 0 var(--include-file-chip-inset, 8px) 0 0;
}

.include-resolve-source .include-file-chip.is-cycle {
  --include-tint: #e8a45a;
  --include-chip-fg: #0b1220;
  --include-chip-bg: color-mix(in srgb, #e8a45a 72%, #fff4e5);
}

.include-resolve-source .include-file-chip.is-unresolved {
  --include-tint: #e07a7a;
  --include-chip-fg: #0b1220;
  --include-chip-bg: color-mix(in srgb, #e07a7a 72%, #ffe8e8);
}

.include-resolve-source .source-line.is-included.source-line-active,
.include-resolve-source .source-line.is-cycle.source-line-active,
.include-resolve-source .source-line.is-unresolved.source-line-active {
  background: color-mix(in srgb, var(--code-highlight-bg) 70%, var(--code-highlight-bar));
}

@media (max-width: 720px) {
  .include-resolve-select {
    max-width: none;
    flex-basis: 100%;
  }

  .include-resolve-chrome {
    align-items: stretch;
  }

  .include-resolve-chrome .btn {
    width: 100%;
    justify-content: center;
  }
}

.tabulate-work {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-16);
}

.tabulate-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ui-space-12);
}

.tabulate-pick {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  min-width: 10rem;
}

.tabulate-label {
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  color: var(--app-muted);
}

.tabulate-warn {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
}

.tabulate-warn-item {
  margin: 0;
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
}

.tabulate-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(16rem, 1fr) minmax(18rem, 1.2fr);
  gap: var(--ui-space-16);
  align-items: start;
}

.tabulate-vars-pane {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
}

.tabulate-vars {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  max-height: 28rem;
  overflow: auto;
}

.tabulate-var {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  min-height: 40px;
  padding: var(--ui-space-8) var(--ui-space-12);
  text-align: left;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-8, 8px);
  background: var(--app-surface);
  color: inherit;
}

.tabulate-var:hover,
.tabulate-var:focus-visible {
  border-color: var(--app-primary);
}

.tabulate-var.is-used {
  opacity: 0.55;
}

.tabulate-var:active {
  transform: scale(0.96);
}

.tabulate-var-name {
  font-weight: 650;
  font-size: var(--ui-font-size-sm);
}

.tabulate-var-meta {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.tabulate-board {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
}

.tabulate-drop {
  min-height: 3.5rem;
  padding: var(--ui-space-8);
  border: 1px solid var(--app-border);
  border-radius: calc(8px + 8px);
  background: var(--app-surface);
}

.tabulate-drop.is-over {
  border-color: var(--app-primary);
  background: color-mix(in srgb, var(--app-primary) 6%, var(--app-surface));
}

.tabulate-drop-title {
  font-size: var(--ui-font-size-sm);
  font-weight: 650;
  color: var(--app-primary);
}

.tabulate-drop-sub {
  font-weight: 400;
  color: var(--app-muted);
  font-size: 0.75rem;
}

.tabulate-drop-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  min-height: 2rem;
  margin-top: var(--ui-space-8);
}

.tabulate-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-4);
  min-height: 32px;
  padding: 0 var(--ui-space-8) 0 var(--ui-space-12);
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface);
  font-size: var(--ui-font-size-sm);
  font-variant-numeric: tabular-nums;
}

.tabulate-chip-x {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  line-height: 1;
}

.tabulate-chip-x:hover,
.tabulate-chip-x:focus-visible {
  color: var(--app-primary);
}

.tabulate-opts {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
  padding-top: var(--ui-space-8);
}

.tabulate-check {
  display: flex;
  align-items: center;
  gap: var(--ui-space-8);
  min-height: 32px;
  font-size: var(--ui-font-size-sm);
}

.tabulate-box-row {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
}

.tabulate-advanced {
  font-size: var(--ui-font-size-sm);
}

.tabulate-where {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  margin-top: var(--ui-space-8);
}

.tabulate-where-list {
  margin: var(--ui-space-8) 0 0;
  padding-left: 1.1rem;
}

.tabulate-out-title {
  font-size: var(--ui-font-size-sm);
  font-weight: 650;
  margin: 0 0 var(--ui-space-8);
}

.tabulate-preview {
  overflow: auto;
  margin-bottom: var(--ui-space-16);
}

.tabulate-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ui-font-size-sm);
  font-variant-numeric: tabular-nums;
  background: var(--app-surface);
}

.tabulate-grid th,
.tabulate-grid td {
  border-bottom: 1px solid var(--app-border);
  padding: var(--ui-space-8) var(--ui-space-12);
  text-align: right;
}

.tabulate-grid thead th {
  color: var(--app-primary);
  text-align: center;
  background: var(--app-surface);
  box-shadow: inset 0 -1px 0 0 var(--app-border);
}

.tabulate-grid tbody th {
  text-align: left;
  font-weight: 600;
}

.tabulate-code {
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  background: var(--code-bg, #282c34);
  max-height: 22rem;
  overflow: auto;
}

.tabulate-code-pre {
  margin: 0;
  padding: var(--ui-space-12);
  font-size: 0.8rem;
  line-height: 1.45;
  color: #abb2bf;
}

.tabulate-muted {
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
  text-wrap: pretty;
}

@media (max-width: 1100px) {
  .tabulate-layout {
    grid-template-columns: 1fr;
  }
}

/* --- E-Mail-Generator -------------------------------------------------- */

.email-work {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-16);
  min-height: 0;
}

.email-head {
  flex: 0 0 auto;
}

.email-env-label {
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
}

.email-env-select {
  width: auto;
  min-width: 7.5rem;
}

.email-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: var(--ui-space-16);
  align-items: start;
}

.email-compose-pane,
.email-out-pane {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.email-out-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.email-panel {
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  padding: 0.75rem 0.85rem 0.9rem;
}

.email-panel--collapsible {
  padding-bottom: 0.75rem;
}

.email-panel--collapsible:has(> .collapse:not(.show)) {
  padding-bottom: 0.65rem;
}

.email-panel-header {
  margin-bottom: 0;
}

.email-panel-body {
  padding-top: 0.75rem;
}

.email-panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.email-panel--collapsible .email-panel-title {
  margin-bottom: 0;
}

.email-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 1.55rem;
  text-align: left;
}

.email-panel-chevron {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--app-muted);
  transition: transform 0.2s;
}

.email-panel-toggle[aria-expanded="false"] .email-panel-chevron,
.email-panel--collapsible:has(> .collapse:not(.show)) .email-panel-chevron {
  transform: rotate(-90deg);
}

.email-input-group--nested {
  background: var(--app-surface-muted, #f7f8fa);
  margin-top: 0.75rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border-radius: var(--ui-radius-control, 0.375rem);
}

.email-rcpt-block {
  margin-bottom: 0.65rem;
}

.email-attach-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.email-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.email-attach-add {
  align-self: flex-start;
}

.email-attach-item {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control, 0.375rem);
  background: var(--app-surface, #fff);
}

.email-attach-icon {
  color: #6b7280;
  font-size: 0.85rem;
}

.email-attach-path {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
}

.email-attach-remove {
  padding: 0.15rem 0.35rem;
  color: #9aa3af;
  text-decoration: none;
}
/* macro-form-like field groups */
.email-input-group {
  background: var(--app-surface, #fff);
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  padding: 0.65rem 0.75rem;
}

.email-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0;
}

.email-section-body {
  padding-top: 0.75rem;
}

.email-group-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.email-group-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  width: 100%;
  min-height: 1.55rem;
  text-align: left;
}

.email-group-toggle-heading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.email-group-toggle .email-group-title {
  margin-bottom: 0;
}

.email-input-group--collapsible .settings-chevron,
.email-group-toggle .settings-chevron {
  font-size: 0.8rem;
  width: 0.7rem;
  color: var(--app-muted);
  transition: transform 0.2s;
}

.settings-toggle .settings-chevron {
  transition: transform 0.2s;
}

.settings-toggle[aria-expanded="false"] .settings-chevron,
.email-input-group--collapsible:has(> .collapse:not(.show)) .settings-chevron {
  transform: rotate(-90deg);
}

.email-field {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  column-gap: 1rem;
  row-gap: 0.3rem;
  align-items: start;
  margin-bottom: 0.65rem;
}

.email-field--stack {
  grid-template-columns: 1fr;
}

.email-field--stack .email-field-label {
  text-align: left;
  padding-top: 0;
}

.email-field:last-child {
  margin-bottom: 0;
}

.email-field-label {
  text-align: right;
  padding-top: 0.3rem;
}

.email-field-label .form-label {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.email-field-control {
  min-width: 0;
}

.email-field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.15rem;
}

.email-field-stack .form-check {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.email-field-stack .form-check-input {
  margin-top: 0.2rem;
}

.email-field-stack .form-check-label {
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Exec-plan modal: checkbox rows align label with control (no text-input offset). */
.exec-plan-modal-form .email-field:has(> .email-field-control.email-field-stack) {
  align-items: center;
}

.exec-plan-modal-form .email-field:has(> .email-field-control.email-field-stack) .email-field-label {
  padding-top: 0;
}

.exec-plan-modal-form .email-field-stack {
  padding-top: 0;
}

.exec-plan-modal-form .email-field-stack .form-check {
  align-items: center;
}

.exec-plan-modal-form .email-field-stack .form-check-input {
  margin-top: 0;
}

.exec-plan-modal-form .email-field-stack .form-check-label {
  font-size: 0.875rem;
  line-height: 1.25;
}

.exec-plan-modal-form .email-field:has(.exec-plan-weekdays) {
  align-items: start;
}

.exec-plan-modal-form .email-field:has(.exec-plan-weekdays) .email-field-label {
  padding-top: 0.2rem;
}

.email-chipbox.form-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-height: calc(1.5em + 0.5rem + 2px);
  height: auto;
  padding: 0.25rem 0.5rem;
  cursor: text;
}

.email-chipbox.form-control:focus-within {
  border-color: rgba(var(--bs-primary-rgb), 0.55);
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
  outline: 0;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.1rem 0.2rem 0.1rem 0.45rem;
  border-radius: 999px;
  background: #eef1f4;
  border: 1px solid #d5dbe3;
  font-size: 0.8rem;
  line-height: 1.3;
}

.email-chip.is-invalid {
  background: #fce8e8;
  border-color: #e5a3a3;
  color: #842029;
}

.email-chipbox.has-invalid {
  border-color: var(--bs-form-invalid-border-color, #dc3545);
}

.email-chip-input.is-invalid {
  box-shadow: none;
}

.email-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-chip-x {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
  border-radius: 999px;
  cursor: pointer;
}

.email-chip-x:hover,
.email-chip-x:focus-visible {
  background: #dde3ea;
  color: #111;
}

.email-chip-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  padding: 0.15rem 0;
  color: inherit;
}

.email-chip-input::placeholder,
.email-field-control .form-control::placeholder {
  color: var(--app-muted, #6b7280);
  opacity: 0.42;
  font-style: normal;
  font-weight: 400;
}

.email-staging-group {
  opacity: 0.92;
}

.email-staging-hint {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.email-staging-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.email-staging-grid .email-field {
  margin-bottom: 0;
}

.email-staging-grid .email-field-label {
  color: var(--app-muted);
}

.email-editor-wrap {
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  background: var(--app-surface, #fff);
  overflow: hidden;
}

.email-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface-muted, #f7f8fa);
}

.email-toolbar .btn {
  padding: 0.15rem 0.4rem;
}

.email-toolbar-sep {
  width: 1px;
  align-self: stretch;
  background: var(--app-border);
  margin: 0 0.1rem;
}

.email-editor {
  min-height: 11rem;
  max-height: 20rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  font-size: 11pt;
  line-height: 1.4;
  color: inherit;
  /* Match wrap radius so focus ring follows bottom corners */
  border-radius: 0 0 var(--app-panel-radius) var(--app-panel-radius);
}

/* No block margins — otherwise one Enter looks like a blank line but yields no put ''; */
.email-editor p,
.email-editor div {
  margin: 0;
}

.email-editor:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--app-accent, #0d6efd) 35%, transparent);
}

.email-editor .email-data-table {
  width: auto;
  max-width: 100%;
  margin: 0.65rem 0;
}

/* Explicit cell borders keep the grid visible despite Bootstrap's reset. */
.email-editor table,
.email-preview .ol-body table {
  border-collapse: collapse;
  border: 1px solid #bac4d0;
  font-variant-numeric: tabular-nums;
}

.email-editor :is(th, td),
.email-preview .ol-body :is(th, td) {
  min-width: 5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #bac4d0;
  vertical-align: top;
  line-height: 1.5;
}

.email-editor th,
.email-preview .ol-body th {
  background-color: #edf2f7;
  color: #263445;
  font-weight: 600;
  text-align: left;
}

.email-ph {
  display: inline-block;
  margin: 0 0.05em;
  padding: 0 0.28em;
  border-radius: 0.2rem;
  background: #f0f4fa;
  border: 1px solid #c9d6ea;
  color: #345;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82em;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
}

.email-ph:active {
  cursor: grabbing;
}

.email-ph.is-dragging {
  opacity: 0.4;
}

.email-ph.is-invalid {
  border-color: #e8a0a0;
  background: #fff5f5;
  color: #8a3030;
}

.email-drop-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin: 0 1px;
  vertical-align: text-bottom;
  background: #0d6efd;
  border-radius: 1px;
  pointer-events: none;
  animation: email-caret-blink 1s step-end infinite;
}

@keyframes email-caret-blink {
  50% { opacity: 0; }
}

.email-out-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.email-code-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.email-code-chrome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.email-code-chrome .btn.is-copied {
  border-color: var(--bs-success, #198754);
  color: var(--bs-success, #198754);
}

.email-import-source {
  font-size: 0.8rem;
  line-height: 1.4;
  min-height: 12rem;
  white-space: pre;
}

.email-preview {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #201f1e;
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  overflow: visible;
  box-sizing: border-box;
}

.email-preview.is-empty::before {
  content: "Keine Vorschau";
  display: block;
  padding: 0.5rem 0.25rem;
  color: var(--app-muted);
  font-size: 0.85rem;
  font-family: var(--font-ui);
}

.email-preview .ol-mail {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  box-shadow: none;
  overflow: hidden;
}

.email-preview .ol-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid #edebe9;
}

.email-preview .ol-subject {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: #201f1e;
}

.email-preview .ol-from {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.email-preview .ol-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0078d4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.email-preview .ol-from-main {
  min-width: 0;
  flex: 1;
}

.email-preview .ol-from-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.email-preview .ol-from-name {
  font-size: 14px;
  font-weight: 600;
}

.email-preview .ol-from-addr {
  font-size: 12px;
  color: #605e5c;
  font-weight: 400;
  margin-left: 4px;
}

.email-preview .ol-sent {
  font-size: 12px;
  color: #605e5c;
  white-space: nowrap;
}

.email-preview .ol-line {
  font-size: 12px;
  color: #605e5c;
  margin-top: 2px;
  line-height: 1.35;
}

.email-preview .ol-k {
  color: #605e5c;
}

.email-preview .ol-v {
  color: #201f1e;
}

.email-preview .ol-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid #edebe9;
  background: #faf9f8;
}

.email-preview .ol-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #e1dfdd;
  border-radius: 2px;
  background: #fff;
  font-size: 12px;
}

.email-preview .ol-attach-ico {
  flex: 0 0 auto;
  color: #605e5c;
  font-size: 0.75rem;
}

.email-preview .ol-attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}

.email-preview .ol-body {
  padding: 16px 18px 22px;
  line-height: 1.4;
}

.email-preview .ol-body p {
  margin: 0 0 10px;
}

.email-preview .ol-body p:last-child {
  margin-bottom: 0;
}

.email-preview .ol-plain {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.email-preview table.email-data-table {
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.email-code {
  margin: 0;
  padding: var(--ui-space-12);
  border: 1px solid var(--app-border);
  border-radius: var(--app-panel-radius);
  background: var(--code-bg, #282c34);
  color: #abb2bf;
  overflow: visible;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.email-code-line {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-height: 1.35em;
}

.email-code-line-no {
  flex: 0 0 auto;
  min-width: calc(var(--line-no-digits, 2) * 1ch);
  text-align: right;
  color: #5c6370;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.email-code-line-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.email-code .hljs,
.email-code [class*="hljs-"] {
  background: transparent;
  padding: 0;
}

@media (max-width: 1200px) {
  .email-layout {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.75fr);
  }
}

@media (max-width: 900px) {
  .email-layout {
    grid-template-columns: 1fr;
  }

  .email-field {
    grid-template-columns: 1fr;
  }

  .email-field-label {
    text-align: left;
    padding-top: 0;
  }

  .exec-plan-form-section-head {
    grid-template-columns: 1fr;
  }

  .exec-plan-form-section-title {
    grid-column: 1;
  }
}


/* -- Ausfuehrungsplanung -- */
.exec-plan-work {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-16);
  min-height: 0;
  flex: 1 1 0;
  max-height: 100%;
  overflow: hidden;
}

.exec-plan-head {
  display: flex;
  align-items: center;
  gap: var(--ui-space-12) var(--ui-space-16);
  flex-wrap: wrap;
  flex-shrink: 0;
  padding-bottom: 0;
}

.exec-plan-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 0 1 auto;
}

.exec-plan-head-text .workspace-program-label {
  margin: 0;
}

.exec-plan-head .exec-plan-matrix-legend {
  flex: 1 1 12rem;
  justify-content: center;
}

.exec-plan-head .workspace-program-label {
  margin-right: 0;
}

.exec-plan-toolbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ui-space-8);
  margin-left: auto;
}

.exec-plan-toolbar .result-settings-toggle {
  height: var(--ui-size-control);
  display: inline-flex;
  align-items: center;
}

.exec-plan-zoom {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  margin-left: 0;
  width: max-content;
  height: var(--ui-size-control);
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  overflow: hidden;
  background: var(--app-surface);
}

.exec-plan-zoom-btn,
.exec-plan-zoom-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  color: var(--app-text-tertiary);
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.exec-plan-zoom-btn {
  width: 1.75rem;
  padding: 0;
}

.exec-plan-zoom-btn .fa-solid {
  font-size: 0.7rem;
}

.exec-plan-zoom-value {
  min-width: 2.75rem;
  padding: 0 0.15rem;
  border-left: 1px solid var(--app-border);
  border-right: 1px solid var(--app-border);
  color: var(--app-text);
  font-size: var(--ui-font-size-xs);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.exec-plan-zoom-btn:hover:not(:disabled),
.exec-plan-zoom-value:hover {
  color: var(--app-text);
  background: var(--app-surface-muted);
}

.exec-plan-zoom-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.exec-plan-zoom-btn:focus-visible,
.exec-plan-zoom-value:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 0.15rem var(--bs-focus-ring-color);
  z-index: 1;
}

.exec-plan-status {
  margin: 0;
  min-height: 0;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-status:empty,
.exec-plan-status[hidden] {
  display: none;
}

.exec-plan-status.is-ok {
  color: var(--ui-color-success);
}

.exec-plan-status.is-error {
  color: var(--ui-color-danger);
}

.exec-plan-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0.15rem 0;
  list-style: none;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
  line-height: 1.35;
}

.exec-plan-matrix-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.exec-plan-matrix-legend .exec-plan-matrix-mark.is-adjusted {
  background: var(--app-muted);
  border-radius: 0.15rem;
}

.exec-plan-matrix-legend .exec-plan-matrix-mark.is-extra {
  background: var(--ui-color-success);
}

.exec-plan-matrix-legend .exec-plan-matrix-mark.needs-deputy {
  box-shadow: 0 0 0 2px var(--ui-color-warning);
}

.exec-plan-matrix-shell {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  --exec-plan-zoom: 1;
  --exec-plan-nummer-width: 3.25rem;
  --exec-plan-name-width: 14rem;
  --exec-plan-head-month-height: 1.55rem;
  --exec-plan-head-day-height: 1.75rem;
  --exec-plan-row-height: 1.7rem;
  --compare-col-hover-bg: var(--ui-table-col-hover-overlay);
  zoom: var(--exec-plan-zoom);
}

.exec-plan-matrix-shell.is-empty {
  min-height: 12rem;
}

.exec-plan-matrix-canvas {
  position: relative;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
}

.exec-plan-matrix-col-hover {
  z-index: 4;
}

.exec-plan-matrix {
  margin: 0;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--ui-font-size-xs);
}

.exec-plan-matrix.table > thead > tr > th {
  position: sticky;
  z-index: 2;
  background-color: var(--app-table-head-fill) !important;
  color: var(--app-table-head-text);
  border-bottom: 1px solid var(--app-border);
  font-weight: 600;
  white-space: nowrap;
}

.exec-plan-matrix.table > thead > tr.exec-plan-matrix-months > .exec-plan-matrix-month {
  top: 0;
  height: var(--exec-plan-head-month-height);
  text-align: center;
  padding: 0.2rem 0.25rem;
  border-right: 1px solid var(--app-border);
  font-size: var(--ui-font-size-xs);
}

.exec-plan-matrix.table > thead > tr.exec-plan-matrix-days > .exec-plan-matrix-day {
  top: var(--exec-plan-head-month-height);
  height: var(--exec-plan-head-day-height);
  padding: 0.1rem 0;
  text-align: center;
  min-width: 1.5rem;
  width: 1.5rem;
  vertical-align: bottom;
  border-right: 1px solid color-mix(in srgb, var(--app-border) 70%, transparent);
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-day.is-nonbat {
  background-color: var(--app-surface-muted) !important;
  color: var(--app-text-tertiary);
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-day.is-today,
.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell.is-today {
  background-color: var(--app-primary-light) !important;
}

.exec-plan-matrix.table > thead > tr > th.col-hover {
  background-color: color-mix(in srgb, var(--app-text) 6%, var(--app-table-head-fill)) !important;
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-sticky.col-hover {
  background-color: color-mix(in srgb, var(--app-text) 6%, var(--app-table-head-fill)) !important;
}

.exec-plan-matrix-day-num {
  display: block;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.exec-plan-matrix-day-wd {
  display: block;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--app-muted);
  line-height: 1.1;
}

.exec-plan-matrix.table > :not(caption) > tr > .exec-plan-matrix-sticky {
  position: sticky;
  z-index: 3;
  left: 0;
  background-color: var(--app-surface) !important;
  background-image: none !important;
  border-right: 1px solid var(--app-border);
  white-space: nowrap;
  vertical-align: middle;
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-sticky {
  top: 0;
  z-index: 5;
  background-color: var(--app-table-head-fill) !important;
  color: var(--app-table-head-text);
  vertical-align: bottom;
  box-shadow: inset 0 -1px 0 0 var(--app-border);
}

.exec-plan-matrix.table > :not(caption) > tr > .exec-plan-matrix-sticky--nummer {
  left: 0;
  width: var(--exec-plan-nummer-width);
  min-width: var(--exec-plan-nummer-width);
  max-width: var(--exec-plan-nummer-width);
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  padding: 0 0.45rem !important;
  color: var(--app-muted);
}

.exec-plan-matrix.table > :not(caption) > tr > .exec-plan-matrix-sticky--name {
  left: var(--exec-plan-nummer-width);
  width: var(--exec-plan-name-width);
  min-width: var(--exec-plan-name-width);
  max-width: var(--exec-plan-name-width);
  padding: 0 0.85rem 0 0.65rem !important;
  text-align: left !important;
  overflow: hidden;
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-sticky--name {
  box-shadow: inset 0 -1px 0 0 var(--app-border);
}

.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-sticky--name .exec-plan-idv-link,
.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-sticky--name .exec-plan-add-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-sticky,
.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell {
  height: var(--exec-plan-row-height);
  border-bottom: 1px solid color-mix(in srgb, var(--app-border) 55%, transparent);
}

.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell {
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  min-width: 1.5rem;
  width: 1.5rem;
  border-right: 1px solid color-mix(in srgb, var(--app-border) 55%, transparent);
  background-color: var(--app-surface);
}

.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell.is-nonbat {
  background-color: color-mix(in srgb, var(--app-surface-muted) 80%, var(--app-surface)) !important;
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-day.is-past,
.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell.is-past {
  opacity: 0.38;
}

.exec-plan-matrix.table > thead > tr > .exec-plan-matrix-day.is-past {
  color: var(--app-muted);
}

.exec-plan-matrix.table > tbody > tr > .exec-plan-matrix-cell.is-past .exec-plan-matrix-mark {
  opacity: 0.7;
}

.exec-plan-matrix-mark {
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--app-primary);
  vertical-align: middle;
}

.exec-plan-matrix-cell.is-adjusted .exec-plan-matrix-mark {
  background: var(--app-muted);
  border-radius: 0.15rem;
}

.exec-plan-matrix-cell.is-extra .exec-plan-matrix-mark {
  background: var(--ui-color-success);
}

.exec-plan-matrix-cell.needs-deputy .exec-plan-matrix-mark {
  box-shadow: 0 0 0 2px var(--ui-color-warning);
}

.exec-plan-matrix-cell.is-actual-ok .exec-plan-matrix-mark,
.exec-plan-matrix-legend .exec-plan-matrix-mark.is-actual-ok {
  background: var(--ui-color-success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ui-color-success) 45%, transparent);
}

.exec-plan-matrix-cell.is-actual-error .exec-plan-matrix-mark,
.exec-plan-matrix-legend .exec-plan-matrix-mark.is-actual-error {
  background: var(--ui-color-danger);
  border-radius: 0.1rem;
}

.exec-plan-matrix-cell.is-actual-skipped .exec-plan-matrix-mark,
.exec-plan-matrix-legend .exec-plan-matrix-mark.is-actual-skipped {
  background: transparent;
  border: 2px solid var(--app-muted);
  box-sizing: border-box;
}

.exec-plan-protocol {
  flex: 0 0 auto;
  margin-top: 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  padding: 0.55rem 0.7rem 0.65rem;
}

.exec-plan-today {
  flex: 0 0 auto;
  margin-top: 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  padding: 0.55rem 0.7rem 0.65rem;
}

.exec-plan-today-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.35rem;
}

.exec-plan-today-title {
  margin: 0;
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
}

.exec-plan-today-meta,
.exec-plan-today-empty {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-today-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  max-height: 7.5rem;
  overflow: auto;
}

.exec-plan-today-list li {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
  font-size: var(--ui-font-size-xs);
}

.exec-plan-today-nr {
  font-variant-numeric: tabular-nums;
  color: var(--app-muted);
}

.exec-plan-today-status {
  font-weight: 600;
  text-transform: lowercase;
}

.exec-plan-today-status.is-ok { color: var(--ui-color-success); }
.exec-plan-today-status.is-error { color: var(--ui-color-danger); }
.exec-plan-today-status.is-skipped { color: var(--app-muted); }
.exec-plan-today-status.is-pending { color: var(--app-muted); font-weight: 500; }

.exec-plan-today-hint {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--app-border);
}

.exec-plan-today-hint-steps {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-today-hint code {
  font-size: 0.92em;
}

.exec-plan-protocol-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.4rem;
}

.exec-plan-protocol-title {
  margin: 0;
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
}

.exec-plan-protocol-meta {
  margin: 0 0 0.85rem;
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
  line-height: 1.4;
}

.exec-plan-protocol-empty {
  margin: 0;
  font-size: var(--ui-font-size-sm);
  color: var(--app-muted);
}

.exec-plan-protocol-table-wrap {
  max-height: none;
  overflow: auto;
}

#execPlanProtocolModal .exec-plan-protocol-table-wrap {
  max-height: min(55vh, 28rem);
}

.exec-plan-protocol-table {
  margin: 0;
  font-size: var(--ui-font-size-xs);
}

.exec-plan-protocol-table th,
.exec-plan-protocol-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 0.55rem 0.75rem;
}

.exec-plan-protocol-status {
  font-weight: 600;
  text-transform: lowercase;
}

.exec-plan-protocol-table tr.is-status-ok .exec-plan-protocol-status {
  color: var(--ui-color-success);
}

.exec-plan-protocol-table tr.is-status-error .exec-plan-protocol-status {
  color: var(--ui-color-danger);
}

.exec-plan-protocol-table tr.is-status-skipped .exec-plan-protocol-status {
  color: var(--app-muted);
}

.exec-plan-matrix.table > tbody > tr.exec-plan-matrix-row:hover > .exec-plan-matrix-sticky,
.exec-plan-matrix.table > tbody > tr.exec-plan-matrix-row:hover > .exec-plan-matrix-cell {
  background-color: color-mix(in srgb, var(--app-primary-light) 55%, var(--app-surface)) !important;
}

.exec-plan-matrix-row.is-inactive {
  opacity: 0.55;
}

.exec-plan-matrix-row.is-inactive .exec-plan-idv-link {
  text-decoration: line-through;
}

.exec-plan-idv-link,
.exec-plan-add-link {
  font-weight: 600;
  text-decoration: none;
}

.exec-plan-idv-link:hover,
.exec-plan-add-link:hover {
  text-decoration: underline;
}

.exec-plan-idv-nr {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--app-muted);
}

.exec-plan-matrix-add-row td {
  background: color-mix(in srgb, var(--app-surface-muted) 55%, var(--app-surface)) !important;
  border-top: 1px dashed var(--app-border);
}

.exec-plan-matrix-add-row .exec-plan-add-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.15rem;
  font-weight: 600;
  color: var(--app-primary);
}

.exec-plan-matrix-add-span {
  min-width: 1.5rem;
}

#toolPanelExecPlan.exec-plan-readonly .exec-plan-add-link {
  opacity: 0.45;
  pointer-events: none;
}

#toolPanelExecPlan.exec-plan-offline .exec-plan-matrix-shell {
  opacity: 0.72;
  pointer-events: none;
}

.exec-plan-table-empty {
  padding: 0.75rem 0.5rem !important;
  color: var(--app-muted);
  text-align: left !important;
}

.exec-plan-modal-dialog {
  --bs-modal-width: min(96vw, 76rem);
}

.exec-plan-modal-body {
  padding-top: var(--ui-space-12);
  /* Focus rings live inside the form scroller; keep body from double-clipping. */
  overflow-x: visible;
}

.exec-plan-modal-layout {
  display: grid;
  grid-template-columns: minmax(22rem, 2fr) minmax(14rem, 1fr);
  gap: var(--ui-space-16);
  min-height: min(70vh, 40rem);
  align-items: stretch;
}

.exec-plan-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
  /* Room for focus rings (box-shadow) so they are not clipped by the scrollport. */
  padding: 0.4rem 0.65rem 0.5rem 0.45rem;
  max-height: min(70vh, 40rem);
}

.exec-plan-modal-form .email-field {
  margin-bottom: 0.7rem;
}

.exec-plan-modal-form .email-field-control {
  overflow: visible;
  min-width: 0;
}

.exec-plan-modal-form .form-control,
.exec-plan-modal-form .form-select {
  max-width: 100%;
}

.exec-plan-modal-form input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.exec-plan-form-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: visible;
}

.exec-plan-form-section + .exec-plan-form-section {
  margin-top: 0.45rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--app-border);
}

.exec-plan-reveal {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 0.7rem;
  overflow: visible;
  transition-property: grid-template-rows, opacity, transform, margin-top, margin-bottom, padding-top, border-top-width;
  transition-duration: 0.28s, 0.2s, 0.28s, 0.28s, 0.28s, 0.28s, 0.28s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.exec-plan-reveal > .exec-plan-reveal-clip {
  min-height: 0;
  /* Clip only while collapsing; when open, keep focus rings visible. */
  overflow: hidden;
  /* Inset so a focus ring still has paint room while overflow is hidden. */
  padding: 0.3rem 0.35rem;
  margin: -0.3rem -0.35rem;
}

.exec-plan-reveal:not(.is-collapsed) > .exec-plan-reveal-clip {
  overflow: visible;
}

/* Spacing lives on the reveal wrapper — margin inside overflow:hidden would be clipped. */
.exec-plan-reveal .email-field {
  margin-bottom: 0;
}

.exec-plan-reveal.is-collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  margin-bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.exec-plan-form-section.exec-plan-reveal.is-collapsed {
  margin-top: 0;
  padding-top: 0;
  border-top-width: 0;
}

.exec-plan-reveal--instant,
.exec-plan-reveal--instant.is-collapsed {
  transition: none !important;
}

.exec-plan-form-section > .exec-plan-reveal:last-child,
.exec-plan-form-section > .email-field:last-child,
.exec-plan-modal-form > .exec-plan-reveal:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .exec-plan-reveal {
    transition: none !important;
  }
}

.exec-plan-form-section-head {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  column-gap: 1rem;
  align-items: baseline;
  margin: 0 0 0.55rem;
}

.exec-plan-form-section-title {
  grid-column: 2;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-secondary-color, var(--app-muted));
  line-height: 1.35;
}

.exec-plan-modal-preview {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--app-border);
  padding-left: var(--ui-space-12);
}

.exec-plan-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ui-space-8);
}

.exec-plan-preview-head .exec-plan-form-section-title {
  grid-column: auto;
}

.exec-plan-preview-meta {
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-preview-wrap {
  overflow: auto;
  min-height: 0;
  flex: 1;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
}

.exec-plan-field-label-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.exec-plan-field-hint {
  margin: 0.3rem 0 0;
  font-size: var(--ui-font-size-xs);
  line-height: 1.35;
  color: var(--app-muted);
}

.exec-plan-field-hint code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--app-primary);
  background: var(--app-primary-light);
  padding: 0.05em 0.3em;
  border-radius: var(--ui-radius-control);
}

.info-popover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  line-height: 1;
  cursor: pointer;
}

.info-popover-btn:hover,
.info-popover-btn:focus-visible,
.info-popover-btn[aria-expanded="true"] {
  color: var(--app-primary);
}

.info-popover-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
  border-radius: 50%;
}

.info-popover {
  --popover-arrow-width: 1rem;
  --popover-arrow-height: 0.5rem;
  position: fixed;
  inset: unset;
  width: max-content;
  max-width: min(26rem, calc(100vw - 1.5rem));
  height: fit-content;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-panel);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.info-popover-arrow {
  position: absolute;
  left: calc(var(--popover-caret, 1rem) - 0.5 * var(--popover-arrow-width));
  width: var(--popover-arrow-width);
  height: var(--popover-arrow-height);
}

.info-popover-arrow::before,
.info-popover-arrow::after {
  position: absolute;
  display: block;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.info-popover[data-placement="bottom"] .info-popover-arrow {
  top: calc(-1 * var(--popover-arrow-height) - 1px);
}

.info-popover[data-placement="bottom"] .info-popover-arrow::before,
.info-popover[data-placement="bottom"] .info-popover-arrow::after {
  border-width: 0 calc(var(--popover-arrow-width) * 0.5) var(--popover-arrow-height);
}

.info-popover[data-placement="bottom"] .info-popover-arrow::before {
  top: 0;
  border-bottom-color: var(--app-border);
}

.info-popover[data-placement="bottom"] .info-popover-arrow::after {
  top: 1px;
  border-bottom-color: var(--app-surface-muted);
}

.info-popover[data-placement="top"] .info-popover-arrow {
  bottom: calc(-1 * var(--popover-arrow-height) - 1px);
}

.info-popover[data-placement="top"] .info-popover-arrow::before,
.info-popover[data-placement="top"] .info-popover-arrow::after {
  border-width: var(--popover-arrow-height) calc(var(--popover-arrow-width) * 0.5) 0;
}

.info-popover[data-placement="top"] .info-popover-arrow::before {
  bottom: 0;
  border-top-color: var(--app-border);
}

.info-popover[data-placement="top"] .info-popover-arrow::after {
  bottom: 1px;
  border-top-color: var(--app-surface);
}

.info-popover-header {
  position: relative;
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--app-text);
  background: var(--app-surface-muted);
  border-bottom: 1px solid var(--app-border);
  border-radius: calc(var(--ui-radius-panel) - 1px) calc(var(--ui-radius-panel) - 1px) 0 0;
}

.info-popover[data-placement="bottom"] .info-popover-header::before {
  position: absolute;
  top: 0;
  left: var(--popover-caret, 1rem);
  width: var(--popover-arrow-width);
  margin-left: calc(-0.5 * var(--popover-arrow-width));
  content: "";
  border-bottom: 1px solid var(--app-surface-muted);
}

.info-popover-body {
  padding: 1rem;
  color: var(--app-text);
}

.info-popover-body p {
  margin: 0 0 0.5rem;
}

.info-popover-body p:last-child {
  margin-bottom: 0;
}

.info-popover-list {
  margin: 0 0 0.65rem;
  padding-left: 1.15rem;
}

.info-popover-list li {
  margin: 0.2rem 0;
}

.info-popover-meta {
  color: var(--app-muted);
  font-weight: 650;
}

.info-popover-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--app-primary);
  background: var(--app-primary-light);
  padding: 0.1em 0.35em;
  border-radius: var(--ui-radius-control);
}

.exec-plan-date-add {
  display: flex;
  gap: var(--ui-space-8);
  align-items: center;
}

.exec-plan-date-add .form-control {
  flex: 1;
  min-width: 0;
}

.exec-plan-date-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-width: 0;
}

.exec-plan-date-block > .btn {
  align-self: flex-start;
}

.exec-plan-date-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
  min-width: 0;
  align-items: start;
}

.exec-plan-date-pair-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exec-plan-date-pair-title {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  font-weight: 600;
  color: var(--app-muted);
  line-height: 1.2;
}

/* Align row label with the date inputs, not the column captions. */
.exec-plan-modal-form .email-field:has(.exec-plan-date-pair) .email-field-label {
  padding-top: calc(var(--ui-font-size-xs, 0.75rem) * 1.2 + 0.2rem + 0.3rem);
}

.exec-plan-idv-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.exec-plan-idv-nummer {
  width: 5.5rem;
  flex: none;
}

.exec-plan-idv-name {
  flex: 1 1 10rem;
  min-width: 0;
}

.exec-plan-modal-form .exec-plan-idv-identity:has(.is-invalid) ~ #execPlanNameFeedback {
  display: block;
}

.exec-plan-path-resolved {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-top: 0.35rem;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
  line-height: 1.35;
  word-break: break-all;
}

.exec-plan-path-resolved[hidden] {
  display: none !important;
}

.exec-plan-path-resolved.is-error {
  color: var(--bs-danger, #b02a37);
}

.exec-plan-path-resolved-label {
  font-weight: 650;
  flex: none;
}

.exec-plan-path-resolved-value {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: inherit;
  background: transparent;
  padding: 0;
}

.exec-plan-modal-form .invalid-feedback {
  display: none;
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.exec-plan-modal-form .form-control.is-invalid ~ .invalid-feedback,
.exec-plan-modal-form .exec-plan-freq-sentence:has(.is-invalid) + .invalid-feedback,
.exec-plan-modal-form .exec-plan-day-sentence:has(#execPlanByMonthDay.is-invalid) ~ #execPlanMonthDayFeedback,
.exec-plan-modal-form .exec-plan-day-sentence:has(#execPlanBySetPos.is-invalid) ~ #execPlanSetPosFeedback {
  display: block;
}

.exec-plan-freq-sentence,
.exec-plan-day-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  min-width: 0;
}

.exec-plan-freq-select,
.exec-plan-day-rule-select {
  width: auto;
  min-width: 9.5rem;
  max-width: 100%;
  flex: 0 1 auto;
}

.exec-plan-day-rule-select[hidden] {
  display: none !important;
}

.exec-plan-freq-interval,
.exec-plan-day-complement {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.exec-plan-freq-interval[hidden],
.exec-plan-day-complement[hidden] {
  display: none !important;
}

.exec-plan-freq-interval .form-control,
.exec-plan-day-num {
  width: 4.25rem;
  flex: none;
}

.exec-plan-day-weekday {
  width: auto;
  min-width: 7.5rem;
  flex: 0 1 auto;
}

.exec-plan-day-weekday[hidden] {
  display: none !important;
}

.exec-plan-freq-glue,
.exec-plan-freq-unit {
  color: var(--app-text);
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.exec-plan-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
  min-width: 0;
}

.exec-plan-date-range-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exec-plan-date-range-label {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  font-weight: 600;
  color: var(--app-muted);
  line-height: 1.2;
}

/* Align row label with the date inputs, not the Start/Ende captions. */
.exec-plan-modal-form .email-field:has(.exec-plan-date-range) .email-field-label {
  padding-top: calc(var(--ui-font-size-xs, 0.75rem) * 1.2 + 0.2rem + 0.3rem);
}

.exec-plan-date-range .form-control {
  width: 100%;
  min-width: 0;
}

.exec-plan-require-bat {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  min-height: 0;
}

.exec-plan-require-bat .form-check-input {
  margin-top: 0;
}

.exec-plan-date-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 8rem;
  overflow: auto;
}

.exec-plan-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-8);
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface-muted);
  font-size: var(--ui-font-size-sm);
}

.exec-plan-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
}

.exec-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--ui-space-12);
}

.exec-plan-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exec-plan-toolbar-group .form-label {
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-horizon {
  width: 5.5rem;
}

.exec-plan-table-meta {
  margin-left: auto;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.exec-plan-table-wrap {
  overflow: auto;
  min-height: 0;
  flex: 1;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
}

.exec-plan-table {
  margin: 0;
  font-size: var(--ui-font-size-sm);
}

.exec-plan-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--app-table-head-bg);
  color: var(--app-table-head-text);
  white-space: nowrap;
  border-bottom-width: 1px;
}

.exec-plan-table td,
.exec-plan-table th {
  vertical-align: middle;
  padding: 0.4rem 0.55rem;
}

.exec-plan-table-empty {
  text-align: center;
  color: var(--app-muted);
  padding: 1.5rem !important;
}

.exec-plan-row.is-past {
  color: var(--app-muted);
}

.exec-plan-row.is-today {
  background: var(--app-primary-light);
}

.exec-plan-row.needs-deputy {
  background: var(--ui-color-warning-muted);
}

.exec-plan-row.is-adjusted .exec-plan-date {
  font-style: italic;
}

.exec-plan-date {
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
}

.exec-plan-wd {
  color: var(--app-muted);
  font-size: var(--ui-font-size-xs);
  margin-right: 0.35rem;
}

.exec-plan-pill {
  display: inline-block;
  font-size: 0.65rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: var(--ui-radius-control);
  margin-right: 0.25rem;
  vertical-align: middle;
}

.exec-plan-pill--adj {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  border: 1px solid var(--app-border);
}

.exec-plan-pill--deputy {
  background: var(--ui-color-warning-muted);
  color: var(--ui-color-warning);
  border: 1px solid color-mix(in srgb, var(--ui-color-warning) 30%, var(--app-border));
}

.exec-plan-pill--extra {
  background: var(--app-primary-light);
  color: var(--app-primary);
  border: 1px solid color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
}

.exec-plan-path,
.exec-plan-notes {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .exec-plan-layout {
    grid-template-columns: 1fr;
  }

  .exec-plan-idv-list {
    max-height: 10rem;
    flex: none;
  }

  .exec-plan-modal-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .exec-plan-modal-form {
    max-height: none;
  }

  .exec-plan-modal-preview {
    border-left: none;
    border-top: 1px solid var(--app-border);
    padding-left: 0;
    padding-top: var(--ui-space-12);
    min-height: 16rem;
  }

  .exec-plan-date-pair {
    grid-template-columns: 1fr;
  }
}
/* Execution planner dialog: compact form hierarchy and persistent preview. */
#execPlanIdvModal .exec-plan-modal-dialog {
  --bs-modal-width: min(96vw, 74rem);
  margin: 3vh auto;
  height: 94dvh;
}
#execPlanIdvModal .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 18%), 0 2px 8px rgb(0 0 0 / 8%);
  background: var(--app-surface);
}
#execPlanIdvModal .modal-header { padding: 18px 24px; }
#execPlanIdvModal .exec-plan-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--app-muted);
}
#execPlanIdvModal .modal-title { font-weight: 650; letter-spacing: -.025em; text-wrap: balance; }
#execPlanIdvModal .modal-body { padding: 0; overflow: hidden; min-height: 0; }
#execPlanIdvModal .exec-plan-modal-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, .48fr);
  gap: 0;
  height: min(74dvh, 820px);
  min-height: 0;
}
#execPlanIdvModal .exec-plan-modal-form {
  padding: 20px 24px 24px;
  max-height: none;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--app-border-strong) transparent;
  scroll-padding: 20px;
}
#execPlanIdvModal .email-field {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
#execPlanIdvModal .email-field-label {
  text-align: right;
  padding: 10px 0 0;
  min-height: 18px;
}
#execPlanIdvModal .email-field-label .form-label,
#execPlanIdvModal .exec-plan-date-pair-title,
#execPlanIdvModal .exec-plan-date-range-label {
  font-size: 12px;
  font-weight: 550 !important;
  line-height: 1.5;
  color: var(--app-muted);
}
#execPlanIdvModal .exec-plan-field-label-row { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
#execPlanIdvModal .info-popover-btn {
  position: relative;
  width: 24px;
  min-height: 18px;
  font-size: 12px;
}
#execPlanIdvModal .info-popover-btn::after { content: ""; position: absolute; width: 40px; height: 40px; }
#execPlanIdvModal .form-control,
#execPlanIdvModal .form-select {
  min-height: 40px;
  font-size: 14px;
  line-height: 1.5;
  padding-top: 8px;
  padding-bottom: 8px;
  border-radius: 7px;
  background-color: var(--app-surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
#execPlanIdvModal .form-control:not(.is-invalid):hover,
#execPlanIdvModal .form-select:hover { border-color: var(--app-border-strong); }
#execPlanIdvModal .form-control:not(.is-invalid):focus,
#execPlanIdvModal .form-select:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px var(--app-primary-light); }
#execPlanIdvModal input[type="date"],
#execPlanIdvModal input[type="number"] { font-variant-numeric: tabular-nums; }
#execPlanIdvModal #execPlanPath { font-family: var(--font-mono); font-size: 12px; }
#execPlanIdvModal .exec-plan-form-section { flex-shrink: 0; }
#execPlanIdvModal .exec-plan-form-section + .exec-plan-form-section { margin-top: 8px; padding-top: 20px; }
#execPlanIdvModal .exec-plan-form-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
#execPlanIdvModal .exec-plan-form-section-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--app-text);
}
#execPlanIdvModal .exec-plan-identity-grid { display: block; }
#execPlanIdvModal #execPlanNummer { max-width: 110px; }
#execPlanIdvModal .exec-plan-activation { display: flex; align-items: center; gap: 9px; min-height: 40px; margin: -6px 0; padding: 0; }
#execPlanIdvModal .exec-plan-activation .form-check-input { float: none; margin: 0; width: 30px; height: 18px; cursor: pointer; }
#execPlanIdvModal .exec-plan-activation label { display: flex; align-items: center; min-height: 40px; font-size: 12px; cursor: pointer; }
#execPlanIdvModal .exec-plan-date-range,
#execPlanIdvModal .exec-plan-date-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#execPlanIdvModal .exec-plan-date-range-item[hidden] { display: none; }
#execPlanIdvModal .exec-plan-date-range:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
#execPlanIdvModal .exec-plan-reveal { margin-bottom: 14px; }
#execPlanIdvModal .exec-plan-reveal.is-collapsed { margin-bottom: 0; }
#execPlanIdvModal .exec-plan-reveal .email-field { margin-bottom: 0; }
#execPlanIdvModal .exec-plan-freq-sentence,
#execPlanIdvModal .exec-plan-day-sentence { gap: 8px; }
#execPlanIdvModal .exec-plan-freq-glue,
#execPlanIdvModal .exec-plan-freq-unit { font-size: 13px; color: var(--app-muted); }
#execPlanIdvModal .exec-plan-weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
#execPlanIdvModal .exec-plan-weekdays label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 46px;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
#execPlanIdvModal .exec-plan-weekdays input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
#execPlanIdvModal .exec-plan-weekdays label:has(:checked) { color: var(--app-primary); background: var(--app-primary-light); border-color: var(--app-primary); box-shadow: inset 0 -2px var(--app-primary); }
#execPlanIdvModal .exec-plan-weekdays label:has(:focus-visible) { outline: 2px solid var(--app-primary); outline-offset: 3px; }
#execPlanIdvModal .exec-plan-weekdays label:has(:disabled) { opacity: .55; cursor: default; }
#execPlanIdvModal .exec-plan-weekdays label:not(:has(:disabled)):hover { border-color: var(--app-primary); }
#execPlanIdvModal .exec-plan-date-block { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: start; }
#execPlanIdvModal .exec-plan-date-block > .form-control { grid-column: 1; grid-row: 1; }
#execPlanIdvModal .exec-plan-date-block > .btn { grid-column: 2; grid-row: 1; width: 40px; min-height: 40px; border-color: var(--app-border); border-radius: 7px; }
#execPlanIdvModal .exec-plan-date-list { grid-column: 1 / -1; gap: 5px; }
#execPlanIdvModal .exec-plan-date-list:empty { display: none; }
#execPlanIdvModal .exec-plan-date-item { background: var(--app-surface-muted); border-radius: 7px; padding: 0 4px 0 10px; }
#execPlanIdvModal .exec-plan-date-remove { min-width: 40px; min-height: 40px; }
#execPlanIdvModal .exec-plan-modal-preview {
  border: 0;
  border-left: 1px solid var(--app-border);
  padding: 24px 20px;
  background: var(--app-surface-muted);
  min-height: 0;
  gap: 14px;
  overflow: hidden;
}
#execPlanIdvModal .exec-plan-preview-head { align-items: center; }
#execPlanIdvModal .exec-plan-preview-count { color: var(--app-primary); background: var(--app-primary-light); border-radius: 5px; padding: 4px 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
#execPlanIdvModal .exec-plan-next { display: flex; flex-direction: column; gap: 7px; padding: 18px; background: var(--app-surface); border-radius: 12px; box-shadow: 0 1px 3px rgb(0 0 0 / 6%); }
#execPlanIdvModal .exec-plan-next-label { color: var(--app-muted); font-size: 12px; }
#execPlanIdvModal #execPlanNextDate { font-size: 22px; font-weight: 600; color: var(--app-primary); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
#execPlanIdvModal .exec-plan-preview-meta { font-size: 11px; font-variant-numeric: tabular-nums; }
#execPlanIdvModal .exec-plan-preview-wrap { border: 0; border-radius: 0; scrollbar-width: thin; scrollbar-color: var(--app-border-strong) transparent; }
#execPlanIdvModal .exec-plan-preview-table { font-size: 12px; }
#execPlanIdvModal .exec-plan-preview-table th { font-size: 11px; font-weight: 550; color: var(--app-muted); background: var(--app-surface-muted); }
#execPlanIdvModal .exec-plan-preview-table td { padding: 10px 5px; background: transparent; }
#execPlanIdvModal .exec-plan-preview-table td:first-child { white-space: nowrap; }
#execPlanIdvModal .exec-plan-preview-table td:nth-child(2) { color: var(--app-muted); font-size: 11px; }
#execPlanIdvModal .exec-plan-preview-table .is-today td { background: var(--app-primary-light); }
#execPlanIdvModal #execPlanPriority {
  max-width: 7rem;
}
#execPlanIdvModal .modal-footer .btn { min-height: 40px; padding: 8px 18px; border-radius: 7px; font-size: 13px; margin: 0; transition: background-color 150ms ease, scale 100ms ease; }
#execPlanIdvModal .modal-footer .btn:active { scale: .96; }
#execPlanIdvModal #execPlanModalDeleteBtn { border-color: transparent; }
#execPlanIdvModal .modal-footer .btn-secondary { background: var(--app-surface); color: var(--app-text); border-color: var(--app-border); }
#execPlanIdvModal .btn-close { padding: 12px; margin: 0 -8px 0 0; }
@media (max-width: 760px) {
  #execPlanIdvModal .exec-plan-modal-dialog { margin: 12px auto; height: calc(100dvh - 24px); }
  #execPlanIdvModal .modal-body { overflow-y: auto; }
  #execPlanIdvModal .exec-plan-modal-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  #execPlanIdvModal .exec-plan-modal-form { overflow: visible; padding: 18px; }
  #execPlanIdvModal .exec-plan-modal-preview { border-left: 0; border-top: 1px solid var(--app-border); padding: 20px 18px; max-height: 440px; }
  #execPlanIdvModal .modal-header, #execPlanIdvModal .modal-footer { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 420px) {
  #execPlanIdvModal .exec-plan-date-pair { grid-template-columns: minmax(0, 1fr); }
  #execPlanIdvModal .exec-plan-weekdays label { min-width: 40px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #execPlanIdvModal .form-control, #execPlanIdvModal .form-select,
  #execPlanIdvModal .exec-plan-weekdays label, #execPlanIdvModal .modal-footer .btn { transition: none; }
}
#execPlanIdvModal .btn-close { margin-left: auto; }
#execPlanIdvModal .exec-plan-form-section[aria-labelledby="execPlanOrgHeading"] {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#execPlanIdvModal .exec-plan-form-section[aria-labelledby="execPlanOrgHeading"] textarea { min-height: 40px; }
#execPlanIdvModal .exec-plan-form-section[aria-labelledby="execPlanOrgHeading"] > .email-field {
  margin-bottom: 14px;
}
#execPlanIdvModal .exec-plan-form-section[aria-labelledby="execPlanOrgHeading"] > .email-field:last-child {
  margin-bottom: 0;
}

/* Align section titles and compound controls with the horizontal form grid. */
#execPlanIdvModal .exec-plan-form-section-head { margin-left: 151px; }
#execPlanIdvModal .email-field:has(.exec-plan-date-range) > .email-field-label,
#execPlanIdvModal .email-field:has(.exec-plan-date-pair) > .email-field-label { padding-top: 30px; }
@media (min-width: 761px) and (max-width: 1000px) {
  #execPlanIdvModal .modal-body { overflow-y: auto; }
  #execPlanIdvModal .exec-plan-modal-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  #execPlanIdvModal .exec-plan-modal-form { overflow: visible; }
  #execPlanIdvModal .exec-plan-modal-preview { border-left: 0; border-top: 1px solid var(--app-border); max-height: 440px; }
}
@media (max-width: 600px) {
  #execPlanIdvModal .email-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #execPlanIdvModal .email-field > .email-field-label { text-align: left; padding-top: 0; }
  #execPlanIdvModal .exec-plan-field-label-row { justify-content: flex-start; }
  #execPlanIdvModal .exec-plan-form-section-head { margin-left: 0; }
}

/* --- Organisation panel --- */
.org-panel {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-16);
  min-height: 0;
  max-width: 72rem;
  padding-bottom: var(--ui-space-16);
}

.org-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-12) var(--ui-space-16);
}

.org-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 14rem;
}

.org-head-text .workspace-program-label {
  margin: 0;
}

.org-head-actions {
  margin: 0;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.org-backup-select {
  width: auto;
  min-width: 11rem;
  max-width: 16rem;
}

.org-session {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
  line-height: 1.4;
  text-wrap: pretty;
}

.org-session.is-warn {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  margin-top: 0.15rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--ui-radius-control);
  background: color-mix(in srgb, var(--ui-color-warning) 14%, var(--app-surface));
  color: color-mix(in srgb, var(--ui-color-warning) 42%, var(--app-text));
  border: 1px solid color-mix(in srgb, var(--ui-color-warning) 28%, var(--app-border));
}

.org-status {
  margin: 0;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
  line-height: 1.4;
}

.org-status:empty,
.org-status[hidden] {
  display: none;
}

.org-status.is-ok {
  color: var(--ui-color-success);
}

.org-status.is-error {
  color: var(--ui-color-danger);
}

.org-error {
  margin: 0;
}

.org-error[hidden] {
  display: none !important;
}

.org-tabs {
  border-bottom: 1px solid var(--app-border);
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.org-tabs .nav-link {
  color: var(--app-muted);
  font-size: var(--ui-font-size-sm);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.7rem 1rem;
  background: transparent;
  margin-bottom: -1px;
}

.org-tabs .nav-link:hover {
  color: var(--app-text);
  border-bottom-color: color-mix(in srgb, var(--app-border) 80%, var(--app-primary));
}

.org-tabs .nav-link.active {
  color: var(--app-primary);
  border-bottom-color: var(--app-primary);
  background: transparent;
}

.org-tab-panes {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-16);
  padding-top: 0;
  flex: 1 1 auto;
}

.org-tab-pane {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-14, 0.875rem);
  min-height: 0;
  flex: 1 1 auto;
}

.org-tab-pane[hidden],
.org-tab-pane.d-none {
  display: none !important;
}

.org-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.org-section-toolbar .btn {
  min-height: var(--ui-size-control, 2rem);
}

.org-person-form,
.org-vac-form,
.org-tab-pane .row.g-2 {
  --bs-gutter-y: 0.75rem;
  --bs-gutter-x: 0.75rem;
}

.org-panel .form-label,
.org-panel .form-label-sm {
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--app-text);
}

.org-panel .form-control,
.org-panel .form-select {
  min-height: var(--ui-size-control, 2rem);
}

.org-panel .form-check.form-switch {
  min-height: var(--ui-size-control, 2rem);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 2.5em;
  margin: 0;
}

.org-switch-field {
  min-height: var(--ui-size-control, 2rem);
  margin-top: 0.1rem;
}

.org-empty {
  font-size: var(--ui-font-size-sm);
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--ui-radius-control);
  background: color-mix(in srgb, var(--app-surface-muted) 65%, var(--app-surface));
  border: 1px dashed var(--app-border);
}

.org-table-wrap {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 12rem;
  border-radius: var(--ui-radius-control);
  box-shadow: inset 0 0 0 1px var(--app-border);
  background: var(--app-surface, #fff);
}

.org-table-wrap[hidden] {
  display: none !important;
}

.org-table {
  margin: 0;
  width: 100%;
  font-size: var(--ui-font-size-sm);
}

.org-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--app-surface, #fff);
  font-weight: 650;
  white-space: nowrap;
  border-bottom-width: 1px;
  padding: 0.7rem 1rem;
}

.org-table tbody td {
  padding: 0.65rem 1rem;
  vertical-align: middle;
}

.org-table tbody tr.org-row {
  cursor: pointer;
  transition-property: background-color;
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.org-table tbody tr.org-row:hover {
  background: color-mix(in srgb, var(--app-primary) 6%, transparent);
}

.org-table tbody tr.org-row.is-selected {
  background: color-mix(in srgb, var(--app-primary) 12%, transparent);
}

.org-table tbody tr.org-row.is-inactive {
  color: var(--app-muted);
}

.org-mono {
  font-size: 0.8125em;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.org-col-nr {
  width: 4.5rem;
  font-variant-numeric: tabular-nums;
}

.org-col-path {
  max-width: 18rem;
}

.org-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: end;
}

.org-modal-eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--app-muted);
  margin-bottom: 0.35rem;
}

.idv-search-panel .idv-search-query-row {
  max-width: none;
}

.idv-search-panel .idv-search-actions {
  max-width: none;
}

.idv-search-stale {
  margin-top: 0.45rem;
  max-width: none;
}

.idv-search-panel .table-responsive {
  border-radius: var(--ui-radius-control);
  box-shadow: inset 0 0 0 1px var(--app-border);
  background: var(--app-surface, #fff);
  max-width: none;
  width: 100%;
}

.idv-search-panel .table {
  margin: 0;
  width: 100%;
}

.idv-search-panel .table th,
.idv-search-panel .table td {
  padding: 0.65rem 1rem;
  vertical-align: top;
}

.idv-search-idv-cell {
  width: 14rem;
}

.idv-search-file-cell {
  width: 12rem;
  word-break: break-word;
}

.idv-search-context-cell {
  width: auto;
  min-width: 0;
}

.idv-search-hit-source.source-file-view {
  max-height: none;
  width: 100%;
}

.idv-search-file-modal-dialog {
  max-width: min(96vw, 72rem);
  height: calc(100dvh - 2rem);
  margin: 1rem auto;
}

.idv-search-file-modal-dialog .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.idv-search-file-modal-dialog .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.idv-search-file-modal-source.source-file-view {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  height: 100%;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.idv-search-index-errors {
  margin: 0.25rem 0 0;
}

.idv-search-index-errors-list {
  padding-left: 1.1rem;
}

.idv-search-panel .idv-search-hit {
  cursor: pointer;
}

.idv-search-panel .idv-search-hit:hover,
.idv-search-panel .idv-search-hit:focus-visible {
  background: color-mix(in srgb, var(--app-primary) 8%, var(--app-surface));
  outline: none;
}

.include-resolve-idv-bar,
.idv-source-bar {
  margin: 0;
}

#toolPanelIncludeResolve .tool-placeholder {
  max-width: 40rem;
  padding-top: 0;
}

#toolPanelOrg.org-panel-readonly .org-section-toolbar .btn-primary,
#toolPanelOrg.org-panel-offline .org-section-toolbar .btn-primary {
  opacity: 0.65;
}

.org-adhoc-placeholder {
  max-width: 40rem;
}

.org-vac-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-12);
  flex: 0 0 auto;
}

.org-vac-toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.org-vac-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--ui-font-size-xs);
  color: var(--app-muted);
}

.org-vac-matrix-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.org-vac-matrix-shell {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 12rem;
  border: 1px solid var(--app-border);
  border-radius: var(--ui-radius-control);
  background: var(--app-surface);
  --org-vac-zoom: 1;
  --org-vac-name-width: 11rem;
  --org-vac-head-month-height: 1.55rem;
  --org-vac-head-day-height: 1.75rem;
  --org-vac-row-height: 1.85rem;
  zoom: var(--org-vac-zoom);
}

.org-vac-matrix-shell[hidden] {
  display: none !important;
}

.org-vac-matrix-canvas {
  width: max-content;
  min-width: 100%;
}

.org-vac-matrix {
  margin: 0;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--ui-font-size-xs);
}

.org-vac-matrix.table > thead > tr > th {
  border-bottom-width: 1px;
  vertical-align: middle;
  text-align: center;
  font-weight: 650;
  padding: 0.15rem 0.1rem;
}

.org-vac-matrix.table > thead > tr.org-vac-matrix-months > .org-vac-matrix-month {
  height: var(--org-vac-head-month-height);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--app-surface);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.org-vac-matrix.table > thead > tr.org-vac-matrix-days > .org-vac-matrix-day {
  top: var(--org-vac-head-month-height);
  position: sticky;
  z-index: 5;
  height: var(--org-vac-head-day-height);
  background: var(--app-surface);
  min-width: 1.55rem;
  width: 1.55rem;
}

.org-vac-matrix.table > thead > tr > .org-vac-matrix-day.is-nonbat,
.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-nonbat {
  background: color-mix(in srgb, var(--app-surface-muted) 70%, var(--app-surface));
}

.org-vac-matrix.table > thead > tr > .org-vac-matrix-day.is-today,
.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-today {
  background-color: var(--app-primary-light) !important;
}

.org-vac-matrix.table > thead > tr > .org-vac-matrix-day.is-past,
.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-past {
  opacity: 0.55;
}

.org-vac-matrix.table > thead > tr > .org-vac-matrix-day.is-past {
  color: var(--app-muted);
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-past .org-vac-matrix-mark {
  opacity: 0.85;
}

.org-vac-matrix-day-num {
  display: block;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.org-vac-matrix-day-wd {
  display: block;
  font-size: 0.62rem;
  color: var(--app-muted);
  line-height: 1.1;
}

.org-vac-matrix.table > :not(caption) > tr > .org-vac-matrix-sticky {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--org-vac-name-width);
  min-width: var(--org-vac-name-width);
  max-width: var(--org-vac-name-width);
  text-align: left !important;
  padding: 0 0.75rem !important;
  background: var(--app-surface) !important;
  border-right: 1px solid var(--app-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-vac-matrix.table > thead > tr > .org-vac-matrix-sticky {
  z-index: 7;
  top: 0;
  height: calc(var(--org-vac-head-month-height) + var(--org-vac-head-day-height));
  vertical-align: bottom;
  padding-bottom: 0.45rem !important;
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell {
  position: relative;
  height: var(--org-vac-row-height);
  min-width: 1.55rem;
  width: 1.55rem;
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--app-border) 70%, transparent);
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell:not(.is-absent) {
  cursor: cell;
}

.org-vac-matrix.is-selecting,
.org-vac-matrix.is-selecting * {
  user-select: none;
  cursor: crosshair;
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-range-preview {
  background: color-mix(in srgb, var(--app-primary) 22%, var(--app-surface)) !important;
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-range-anchor {
  box-shadow: inset 0 0 0 2px var(--app-primary);
}

.org-vac-matrix.table > tbody > tr > .org-vac-matrix-cell.is-range-preview.is-today {
  background: color-mix(in srgb, var(--app-primary) 34%, var(--app-primary-light)) !important;
}

.org-vac-matrix-legend .org-vac-matrix-mark {
  position: static;
  display: inline-block;
  width: 1.35rem;
  height: 0.55rem;
  vertical-align: middle;
  border-radius: 0.2rem;
  transform: none;
  left: auto;
  right: auto;
  top: auto;
}

.org-vac-matrix-mark {
  appearance: none;
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  z-index: 1;
  width: auto;
  height: 0.72rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ui-color-warning);
  cursor: pointer;
  transform: translateY(-50%);
}

.org-vac-matrix-mark.is-strip-start {
  left: 3px;
  border-top-left-radius: 0.22rem;
  border-bottom-left-radius: 0.22rem;
}

.org-vac-matrix-mark.is-strip-end {
  right: 3px;
  border-top-right-radius: 0.22rem;
  border-bottom-right-radius: 0.22rem;
}

.org-vac-matrix-mark.is-strip-start.is-strip-end {
  left: 3px;
  right: 3px;
}

.org-vac-matrix-mark.is-planned {
  background: color-mix(in srgb, var(--app-primary) 55%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary) 40%, transparent);
}

.org-vac-matrix-mark.is-approved {
  background: var(--ui-color-warning);
}

.org-vac-matrix-mark.is-other {
  background: var(--app-muted);
}

.org-vac-matrix-mark:disabled {
  cursor: default;
  opacity: 0.85;
}

.org-vac-matrix-mark.is-strip-hover:not(:disabled) {
  --org-vac-strip-ring: color-mix(in srgb, var(--ui-color-warning) 55%, var(--app-text));
  filter: brightness(0.88);
  height: 0.9rem;
  z-index: 2;
  box-shadow:
    inset 0 1.5px 0 0 var(--org-vac-strip-ring),
    inset 0 -1.5px 0 0 var(--org-vac-strip-ring);
}

.org-vac-matrix-mark.is-strip-hover.is-strip-start:not(:disabled) {
  box-shadow:
    inset 1.5px 0 0 0 var(--org-vac-strip-ring),
    inset 0 1.5px 0 0 var(--org-vac-strip-ring),
    inset 0 -1.5px 0 0 var(--org-vac-strip-ring);
}

.org-vac-matrix-mark.is-strip-hover.is-strip-end:not(:disabled) {
  box-shadow:
    inset -1.5px 0 0 0 var(--org-vac-strip-ring),
    inset 0 1.5px 0 0 var(--org-vac-strip-ring),
    inset 0 -1.5px 0 0 var(--org-vac-strip-ring);
}

.org-vac-matrix-mark.is-strip-hover.is-strip-start.is-strip-end:not(:disabled) {
  box-shadow: inset 0 0 0 1.5px var(--org-vac-strip-ring);
}

.org-panel--vacations {
  max-width: none;
}

/* Organisation: fill viewport; tables/matrix scroll inside */
body:has(#toolPanelOrg:not([hidden]):not(.d-none)) .app-shell-main {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body:has(#toolPanelOrg:not([hidden]):not(.d-none)) .app-tool-main {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  padding-top: var(--ui-space-16);
  padding-bottom: var(--ui-space-16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body:has(#toolPanelOrg:not([hidden]):not(.d-none)) #toolPanelOrg {
  flex: 1 1 0;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

body:has(#toolPanelOrg:not([hidden]):not(.d-none)) .org-panel {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  max-width: none;
  overflow: hidden;
  padding-bottom: 0;
}

body:has(#toolPanelOrg:not([hidden]):not(.d-none)) .org-tab-panes {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

body:has(#toolPanelOrg:not([hidden]):not(.d-none)) .org-vac-matrix-shell {
  flex: 1 1 0;
  max-height: none;
}

body:has(#toolPanelIdvSearch:not([hidden]):not(.d-none)) .app-tool-main {
  overflow: auto;
}

#orgIdvModal .modal-header,
#orgVacModal .modal-header,
#orgPersonModal .modal-header,
#execPlanProtocolModal .modal-header,
#workspaceModal .modal-header,
#emailImportModal .modal-header,
#emailPlaceholderModal .modal-header,
#emailTableModal .modal-header,
#emailLinkModal .modal-header {
  padding: 1rem 1.35rem;
}

#orgIdvModal .modal-body,
#orgVacModal .modal-body,
#orgPersonModal .modal-body,
#execPlanProtocolModal .modal-body,
#emailImportModal .modal-body,
#emailPlaceholderModal .modal-body,
#emailTableModal .modal-body,
#emailLinkModal .modal-body {
  padding: 1.15rem 1.35rem;
}

#orgIdvModal .modal-footer,
#orgVacModal .modal-footer,
#orgPersonModal .modal-footer,
#execPlanProtocolModal .modal-footer,
#workspaceModal .modal-footer,
#emailImportModal .modal-footer,
#emailPlaceholderModal .modal-footer,
#emailTableModal .modal-footer,
#emailLinkModal .modal-footer {
  padding: 1rem 1.35rem;
  gap: 0.5rem;
}

#workspaceModal .modal-body {
  padding: 1.15rem 1.35rem;
}

.app-tool-main > .app-tool-panel:not(.d-none):not([hidden]) {
  padding-top: 0;
}
