:root {
  --brand-blue: #145a96;
  --brand-blue-dark: #0f4676;
  --brand-blue-soft: #eaf2f8;
  --brand-accent: #f4bb44;
  --surface: #ffffff;
  --surface-muted: #f3f7fb;
  --text-primary: #1c2b39;
  --text-muted: #4f6478;
  --border-soft: #ccd9e5;
}

/* ------------------------------------------------------------------ */
/* Layout & base                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, Geneva, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #eef3fb 45%, #ffffff 100%);
  color: var(--text-primary);
}

header {
  background: #344a9a;
  color: #f7fbff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  border-bottom: none;
  height: 100px;
}
.header-title {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
header h1 { font-size: 1.6rem; }
header p  { font-size: 0.9rem; opacity: 0.88; color: #d9e8f6; }
.group-logo-link {
  display: inline-block;
  text-decoration: none;
}
.group-logo {
  height: 60px;
  width: auto;
  display: block;
}
.varri-logo {
  height: 50px;
  width: auto;
  display: block;
}
.uni-logo-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.uni-logo-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #f7fbff;
  text-decoration: none;
  line-height: 1;
}
.uni-logo-link:visited,
.uni-logo-link:hover,
.uni-logo-link:focus,
.uni-logo-link:active {
  color: #f7fbff;
  text-decoration: none;
}
.uni-logo-text {
  color: #f7fbff;
  font-size: .95rem;
  white-space: nowrap;
}
.uni-logo {
  height: 52px;
  width: auto;
  display: block;
}

main {
  width: 100%;
  max-width: 1300px;
  padding: 15px;
  display: grid;
  grid-template-columns: 380px 1fr;
  margin: 0 auto;
  justify-content: start;
  align-items: flex-start;
  gap: 1.5rem;
}

.controls-column {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: auto;
  
  height: 100%;  
  min-height: 520px;
  max-height: max(520px, calc(100vh - 260px));
}

.control-panel {
  padding: .45rem;
}

.control-group {
  border: 1px solid #dbe6f0;
  border-radius: 8px;
  background: #fbfdff;
  overflow: visible;
}

.control-group > summary {
  cursor: pointer;
  padding: .6rem .8rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--brand-blue-dark);
  user-select: none;
  vertical-align: middle;
  width: 100%;
}

.control-group > summary::-webkit-details-marker {
  margin-right: .35rem;
}

.control-group[open] > summary {
  border-bottom: 1px solid #dbe6f0;
  background: #f3f8fd;
}

.control-group-body {
  padding: .4rem .8rem .35rem;
}

#full-screen-menu {
  display: inline-flex;
  align-items: sub;
  gap: 6px;
  vertical-align: middle;
  margin-left: auto;
  padding-left: 2rem;
}


/* ------------------------------------------------------------------ */
/* Input panel                                                          */
/* ------------------------------------------------------------------ */
.panel {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .12);
  padding: .8rem;
}

.panel h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-blue-dark);
  border-bottom: 2px solid #dbe6f0;
  padding-bottom: .5rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #2c4259;
  margin-bottom: .25rem;
}

label small {
  font-weight: 400;
  color: var(--text-muted);
}

.list-counter {
  color: #57606a;
  font-size: 0.9em;
  font-weight: normal;
}

.start-index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}

.start-index-item {
  min-width: 0;
}

.start-index-label-row {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .2rem;
  position: relative;
}

.start-index-label-row .legend-color {
  margin-bottom: 0;
  vertical-align: middle;
}

.start-index-label-row label {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.start-index-label-row > input[type="number"] {
  width: 4.7rem;
  margin: 0;
  line-height: 1.2;
}

.start-index-label-row > .field-tooltip {
  align-self: center;
}

.start-index-item .input-wrap input,
.start-index-item > input {
  margin-bottom: 0;
}

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: .45rem .6rem;
  border: 1px solid var(--border-soft);
  background: #fcfdff;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  line-height: 1;
  font-size: .85rem;
  margin-bottom: .75rem;
  transition: border-color .2s;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
  letter-spacing: normal;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--brand-blue);
}

textarea { resize: vertical; }

/* enable textarea highlighting by overlaying a backdrop div with identical text and highlights*/
.backdropable {
  /* Typography - MUST BE IDENTICAL */
  font-family: "Courier New", Courier, monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  letter-spacing: normal !important;
  
  /* Dimensions & Spacing - MUST BE IDENTICAL */
  border: 1px solid var(--border-soft) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  padding-left: 8px !important;
  padding-right: 8px;

  /* Line wrapping rules */
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

/* 4. Backdrop Positioning */
div.backdropable {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden !important; /* Hide backdrop scrollbar; JS controls scroll */
  pointer-events: none;
  z-index: 1;
  background: #fcfdff; /* Background moves to backdrop */
}

/* 5. Highlight span text layer */
.highlights {
  font-family: "Courier New", Courier, monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  word-break: break-all !important;
  color: transparent;
}

/* 6. Textarea Layer */
textarea.backdropable {
  position: relative;
  z-index: 2;
  background-color: transparent !important; /* Transparent so highlights show through */
  resize: vertical;
  display: block;
  white-space: nowrap;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
}

/* error handling */
.input-wrap.has-error > textarea.backdropable  {
  border-color: #e74c3c !important;
}
.input-wrap.has-error > div.backdropable  {
  background-color: #fff5f5 !important;
  border-color: #e74c3c !important;
}

/* Highlight-Klassen für die Abschnitte */
.hl-seq1, .hl-seq2, .hl-basepair {
  display: inline;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}


textarea.profileData {
  overflow-wrap: normal;
  overflow-x: auto;
  white-space: pre;
}


textarea.drag-over {
  border-color: var(--brand-blue);
  background-color: var(--brand-blue-soft);
  box-shadow: 0 0 0 2px rgba(20, 90, 150, 0.25);
}


.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}

.profile-label-with-color {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.profile-label-with-color > label {
  margin: 0;
}

.profile-color-picker {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
  border: 1px solid #7e92a4;
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
}

.profile-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.profile-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 1px;
}

.profile-color-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  margin-left: .1rem;
}

.profile-color-mode-checkbox {
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
}

.profile-color-mode-text {
  font-size: .72rem;
  font-weight: 600;
  color: #4f6478;
  line-height: 1;
}

.label-dropdown-col-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.2fr;
  gap: .6rem;
  align-items: center;
  margin-bottom: .55rem;
}

.label-dropdown-col-row > label {
  margin: 0;
}

.label-dropdown-col-row > select {
  margin-bottom: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .75rem;
  font-size: .85rem;
}
.checkbox-row input { width: auto; margin: 0; }
.checkbox-row label { margin: 0; }
.checkbox-row-nested { margin-left: 1.5em; }

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border: none;
  border-radius: 4px;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-primary:hover { background: var(--brand-blue-dark); }
.btn-success { background: #2e8b57; color: #fff; }
.btn-success:hover { background: #236b43; }
.btn-info    { background: #1d7fa4; color: #fff; }
.btn-info:hover { background: #16617d; }
.btn-secondary { background: #d8e5f1; color: var(--text-primary); }
.btn-secondary:hover { background: #c6d8e8; }
.btn-cite    { background: #d65413; color: #fff; }
.btn-cite:hover { background: #b13f0f; }
.btn-shareLink { background: var(--brand-blue); color: #fff; }
.btn-shareLink:hover { background: var(--brand-blue-dark); }
.btn-openVarri { background: #03427d; color: #fff; }
.btn-openVarri:hover { background: #034b8b; }
.btn-sm { padding: .35rem .5rem; font-size: .8rem; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: .5rem;
}

/* Button-styled links */
a.btn {
  box-sizing: border-box;
  color: #fff;
  text-decoration: none;
  user-select: none;
}
a.btn:hover,
a.btn:focus,
a.btn:active {
  text-decoration: none;
}

/* ------------------------------------------------------------------ */
/* Example dropdown                                                     */
/* ------------------------------------------------------------------ */
.example-label {
  display: block;
  color: #2c4259;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.examples {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin-bottom: 1rem;
}

.example-dropdown {
  flex: 1 1 14rem;
  min-width: 0;
}

.example-dropdown > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding: .4rem 2rem .4rem .6rem;
  border: 1px solid #c0d6e8;
  border-radius: 4px;
  background: var(--brand-blue-soft);
  color: var(--text-primary);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
  list-style: none;
  user-select: none;
}

.example-dropdown > summary::-webkit-details-marker {
  display: none;
}

.example-dropdown > summary::after {
  position: absolute;
  right: .65rem;
  content: "▾";
  transition: transform .15s ease;
}

.example-dropdown[open] > summary::after {
  transform: rotate(180deg);
}

.example-dropdown > summary:hover {
  background: #d6e7f4;
}

.example-dropdown > summary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.example-options {
  max-height: 16rem;
  margin-top: .25rem;
  overflow-y: auto;
  border: 1px solid #c0d6e8;
  border-radius: 4px;
  background: var(--surface);
}

.example-option {
  display: block;
  width: 100%;
  padding: .55rem .6rem;
  border: 0;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.example-option + .example-option {
  border-top: 1px solid var(--border-soft);
}

.example-option:hover,
.example-option:focus {
  background: var(--brand-blue-soft);
}

.example-option:focus-visible {
  position: relative;
  outline: 2px solid var(--brand-blue);
  outline-offset: -2px;
}

.example-option[aria-current="true"] {
  box-shadow: inset 3px 0 var(--brand-blue);
}

.example-option-name,
.example-option-description {
  display: block;
}

.example-option-name {
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.25;
}

.example-option-description {
  margin-top: .2rem;
  color: var(--text-muted);
  font-size: .72rem;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ */
/* Result panel                                                         */
/* ------------------------------------------------------------------ */
.result-panel {
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: auto;
  min-width: 0;
  max-width: calc(50vw +350px);

  min-height: 520px;
  height: max(520px, calc(100vh - 260px));;
}

.highlight-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #fcfdff;
}

.highlight-empty {
  padding: .6rem .7rem;
  color: #5d6f81;
  font-size: .84rem;
}

.highlight-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  padding: .3rem;
  border-bottom: 1px solid #e4ecf4;
}

.highlight-item:last-child {
  border-bottom: none;
}

.highlight-item-main {
  text-align: left;
  border: 1px solid #d7e2ee;
  border-radius: 5px;
  background: #fff;
  color: #1f3144;
  padding: .42rem .52rem;
  font-size: .79rem;
  font-family: "Courier New", monospace;
  cursor: pointer;
}

.highlight-item.active .highlight-item-main {
  background: #eaf2f8;
  border-color: #9fb9d4;
}

.highlight-delete {
  border: 1px solid #d9c5c5;
  border-radius: 5px;
  background: #fff2f2;
  color: #9a2e2e;
  padding: .35rem .5rem;
  font-size: .73rem;
  cursor: pointer;
}

.highlight-delete:hover {
  background: #ffe3e3;
}

.highlightInput {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 2fr) 1.5em 4em;
  gap: .45rem;
  align-items: end;
}

.regionInput {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 1.5em 4em;
  gap: .45rem;
  align-items: start;
}

.regionInput > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.regionInput label {
  margin: 0 0 .25rem;
}

.regionInput .input-wrap {
  display: flex;
  align-items: center;
  min-height: 34px;
}

.regionInput input[type="text"] {
  width: 100%;
  min-width: 0;
  margin: 0;
}


#subseqColor,#regionColor {
  width: 100%;
  height: 34px;
  padding: 2px;
  margin-bottom: .75rem;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #fcfdff;
}


.mutationInput {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem 2rem;
  gap: .45rem;
  align-items: end;
}

.mutationInput > div {
  min-width: 0;
}

.mutationInput #mutationSequence,
.mutationInput #mutationPosition,
.mutationInput #mutationBase,
.mutationInput #mutationColor {
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
}

.mutationInput #mutationColor {
  height: 34px;
  padding: 2px;
}


#rendering-canvas {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .12);
  flex: 1;
  min-height: 450px;
  overflow: hidden;
  position: relative;
}

#rendering-canvas svg {
  width: 100%;
  height: 100%;
}

#rendering-caption {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .12);
  padding: .6rem 1.2rem;
  margin-top: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: smaller;
  color: var(--text-muted);
}

.viz-control {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .12);
  padding: .6rem 1.2rem;
  margin-top: .75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.viz-control label {
  margin: 0;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand-blue-dark);
  white-space: nowrap;
}
.viz-control input[type="range"] {
  flex: 1;
  margin: 0;
  min-width: 50;
}


.export-bar {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .12);
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.export-bar span { font-size: .85rem; font-weight: 600; color: var(--brand-blue-dark); }
.cite-note {
  margin-left: auto;
  color: #666;
  font-size: .8em;
  text-align: right;
}

.cropping-value {
  margin-left: .3em;
  color: var(--text-primary);
  font-weight: 600;
  display: inline-block;
  width: 1.5em;
}

.rotation-value {
  margin-left: .3em;
  color: var(--text-primary);
  font-weight: 600;
  display: inline-block;
  width: 2.5em;
}

/* ------------------------------------------------------------------ */
/* Messages                                                             */
/* ------------------------------------------------------------------ */
#msg {
  border-radius: 6px;
  padding: .6rem .9rem;
  font-size: .85rem;
  margin-top: .6rem;
  display: none;
}
#msg.error   { background: #fdecea; color: #c0392b; display: block; }
#msg.success { background: #eafaf1; color: #1e8449; display: block; }

/* ------------------------------------------------------------------ */
/* Legend                                                               */
/* ------------------------------------------------------------------ */


/* Colour-picker swatches in the legend */
input[type="color"].legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #999;
  padding: 1px;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  vertical-align: middle;
}
input[type="color"].legend-color::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}
input[type="color"].legend-color::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}
input[type="color"].legend-color-rect {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  border: 1px solid #999;
  padding: 1px;
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  vertical-align: middle;
  opacity: 0.8;
}
input[type="color"].legend-color-rect::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 2px;
}
input[type="color"].legend-color-rect::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}


/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.site-footer {
  width: 100%;
  margin: 0 auto 1.5rem;
  padding: .9rem 1rem 0;
}
.footer-content {
  background: #f6f9ff;
  border: 1px solid #d7e2f2;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 46, 74, .08);
  padding: 20px;
  height: 80px;
  font-size: .82rem;
  line-height: 1.1;
  color: #30455f;
  text-align: center;
}
.footer-content p + p {
  margin-top: .45rem;
}
.footer-content a {
  color: #1c4f8e;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-content a:hover {
  color: #133d70;
}

/* ------------------------------------------------------------------ */
/* Inline field validation — error highlight + hover tooltip           */
/* ------------------------------------------------------------------ */
.input-wrap {
  position: relative !important;
  display: block;
  width: 100%;
}
.input-wrap.has-error > textarea,
.input-wrap.has-error > input {
  border-color: #e74c3c !important;
  background: #fff5f5 !important;
}
.field-tooltip {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  background: #2c2c2c;
  color: #fff;
  font-size: .76rem;
  font-family: "Segoe UI", Tahoma, Geneva, sans-serif;
  font-weight: 400;
  padding: .4rem .65rem;
  border-radius: 4px;
  white-space: normal;
  width: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  z-index: 200;
  pointer-events: none;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.field-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 12px;
  border: 5px solid transparent;
  border-bottom-color: #2c2c2c;
}
.input-wrap.has-error:hover .field-tooltip {
  display: block;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */
@media (max-width: 780px) {
  main {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .group-logo {
    height: 57px;
  }
}

/* ------------------------------------------------------------------ */
/* Hide header and footer for content-only embedding mode. */
/* ------------------------------------------------------------------ */

body.hide-footer-and-header header,
body.hide-footer-and-header footer {
  display: none !important;
}

body.hide-footer-and-header main {
  width: 100vw;
  height: 100vh;
  margin: 0;
  max-width: none;
  grid-template-columns: minmax(360px, 380px) 1fr;
  align-items: stretch;
  overflow: hidden;
}

body.hide-footer-and-header .controls-column {
  min-height: 0;  
  height: 100%;  
  max-height: 100vh;
}

/* 3. Sicherstellen, dass <aside> im normalen Dokumentenfluss bleibt */
body.hide-footer-and-header .controls-column aside {
  position: relative;  /* Darf NICHT position: absolute sein! */
  box-sizing: border-box;
}

body.hide-footer-and-header .result-panel {
  width: 100%;
  max-width: 100%;
  height: 100%;
}


/* ------------------------------------------------------------------ */
/* Rendering-only embedding mode. */
/* ------------------------------------------------------------------ */

body.rendering-only header,
body.rendering-only footer,
body.rendering-only .controls-column {
  display: none !important;
}

body.rendering-only main {
  display: block;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
}

body.rendering-only .result-panel {
  width: 100%;
  height: 100%;
}

/* Keep exports and embedded rendering backgrounds transparent. */
body.rendering-only {
  background: transparent;
}

/* ------------------------------------------------------------------ */
/* Input Dialogs                                                             */
/* ------------------------------------------------------------------ */


/* 1. Haupt-Dialog Container */
dialog.app-dialog {
  border: 1px solid #d1dce5;
  border-radius: 8px;
  padding: 0; /* Padding wird über Header/Body gesteuert */
  background-color: #ffffff;
  color: #1a2b4c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 8px 24px rgba(27, 42, 74, 0.18);
  min-width: 220px;
  overflow: hidden;
  margin: 0;
  position: fixed;
}

/* 2. Abdunkelung des Hintergrunds (Backdrop) */
dialog.app-dialog::backdrop {
  background-color: rgba(15, 25, 45, 0.25);
}

/* 3. Dialog Header */
.app-dialog .dialog-header {
  background-color: #edf2f9;
  border-bottom: 1px solid #d1dce5;
  color: #1a365d;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: move;
  user-select: none;
}

/* 4. Dialog Body / Input Bereich */
.app-dialog .dialog-body {
  padding: 12px;
}

.app-dialog input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 13px;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.app-dialog input:focus {
  border-color: #2b4282;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(43, 66, 130, 0.15);
}

/* 5. Dialog Actions (Buttons) */
.app-dialog .dialog-actions {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 12px;
  background-color: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

/* Base Button Style */
.app-dialog .btn {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

/* Primary Button (OK) - Dunkelblau entsprechend dem Header */
.app-dialog .btn-primary {
  background-color: #2b4282;
  color: #ffffff;
  border-color: #23376d;
}

.app-dialog .btn-primary:hover {
  background-color: #1f3266;
}

/* Secondary Button (Abbrechen) - Neutrales Grau-Blau */
.app-dialog .btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}

.app-dialog .btn-secondary:hover {
  background-color: #cbd5e1;
  color: #0f172a;
}

#fastaInput {
  min-width: 600px;
}