/* ==========================================================================
   DSGPT Prompt-Generator (dsgpt.de/prompt/) · prompt.css
   Eigene Optik im Stil der Website: Karten wie .np-card, Eingaben wie .cf-input,
   Buttons .bp/.bo. Die Klassennamen des Werkzeugs (history__, sheet__, doc__ ...)
   bleiben, weil prompt.js sie erzeugt bzw. abfragt. Alles unter .pg-page.
   ========================================================================== */

.pg-page {
  --pg-card: linear-gradient(180deg, rgba(34, 38, 55, 0.55), rgba(18, 20, 31, 0.55));
  --pg-danger: #ff7b7b;
}
.pg-page .si { max-width: 1240px; }
.pg-page .icon, .dialog .icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg-page .visually-hidden, .pg-page .hp {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.pg-page [hidden] { display: none !important; }
/* .bp hat global ein sehr breites Seiten-Padding, im Werkzeug kompakt halten */
.pg-page .bp { padding: 14px 28px; width: auto; }
.pg-page .bp:disabled, .pg-page .bo:disabled, .pg-page .chip:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.pg-intro .np-hero { padding-bottom: 8px; }
.pg-section { padding-top: 72px; }
.pg-faq .fql { max-width: 820px; margin: 0 auto; }

/* --- Kleine Buttons, die prompt.js auch selbst erzeugt ------------------- */
.pg-page .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--tx);
  padding: 10px 18px; border-radius: var(--rs); border: 1px solid var(--bd);
  background: rgba(255, 255, 255, 0.02); cursor: pointer; transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.pg-page .btn:hover { border-color: var(--ba); color: var(--ac); }
.pg-page .btn--sm { padding: 7px 13px; font-size: 0.8rem; }
.pg-page .btn--block { width: 100%; }
.pg-page .btn--quiet { border-color: transparent; color: var(--tm); }
.pg-page .btn--danger { border-color: rgba(255, 123, 123, 0.5); color: var(--pg-danger); }
.pg-page .btn--danger:hover { background: rgba(255, 123, 123, 0.1); color: var(--pg-danger); border-color: var(--pg-danger); }
.pg-page .icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--rs);
  border: 1px solid transparent; background: none; color: var(--tm); cursor: pointer;
}
.pg-page .icon-btn:hover { border-color: var(--bd); color: var(--tx); }
.pg-page .link-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0;
  font: inherit; font-size: 0.8rem; color: var(--td); cursor: pointer;
}
.pg-page .link-btn:hover { color: var(--pg-danger); }

/* --- Arbeitsfläche: Verlauf | Blatt | Panel ------------------------------ */
.workspace { display: grid; gap: 28px; padding-top: 24px; align-items: start; }
.workspace__main {
  display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "bar" "demo" "sheet" "panel" "tpl" "below";
}
.workspace__bar { grid-area: bar; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Nur direkte Kinder der Arbeitsfläche, sonst rutscht z. B. das Beispiel-Blatt weiter unten mit ins Raster */
.workspace__main > .demo-note { grid-area: demo; }
.workspace__main > .sheet { grid-area: sheet; }
.workspace__main > .panel { grid-area: panel; }
.workspace__main > .templates { grid-area: tpl; }
.workspace__main > .below { grid-area: below; }
@media (min-width: 1024px) {
  .workspace__main {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "bar bar" "demo demo" "sheet panel" "tpl panel" "below panel";
  }
  .panel { position: sticky; top: 96px; }
}
@media (min-width: 1280px) {
  .workspace { grid-template-columns: 240px minmax(0, 1fr); }
  .workspace__history-toggle { display: none !important; }
}

/* --- Verlauf (ab 1280 px Seitenleiste, darunter Schublade) --------------- */
.history { display: flex; flex-direction: column; gap: 14px; }
.history__head { display: flex; align-items: center; justify-content: space-between; }
.history__title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; margin: 0; }
.history__title .icon { color: var(--ac); }
.pg-page .history__close { display: none; }
/* Verlauf-Gruppen sind <section>: globale Seitenabstände der Website zurücksetzen */
.pg-page .history__group { padding: 0; margin: 0; max-width: none; }
.history__group { display: flex; flex-direction: column; gap: 8px; }
.history__group + .history__group { margin-top: 10px; }
.history__group-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--td);
}
.history__group-title .icon { width: 14px; height: 14px; }
.history__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history__item {
  position: relative; display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--bd); border-radius: 12px; background: var(--s); transition: border-color 0.2s;
}
.history__item:hover, .history__item[aria-current="true"] { border-color: var(--ba); }
.history__open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: none; border: 0; padding: 10px 12px; color: var(--tx); font: inherit; cursor: pointer;
}
.history__name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history__meta { font-size: 0.72rem; color: var(--td); }
.history__menu {
  position: absolute; right: 6px; top: calc(100% + 4px); z-index: 20; min-width: 170px;
  display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--bd); border-radius: 12px;
  background: var(--s2); box-shadow: var(--sh);
}
.history__menu button {
  display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 0.84rem; color: var(--tx); cursor: pointer;
}
.history__menu button:hover { background: rgba(255, 255, 255, 0.05); }
.history__menu .is-danger { color: var(--pg-danger); }
.empty {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px; color: var(--tm); font-size: 0.84rem; line-height: 1.55;
}
.empty strong { display: block; color: var(--tx); margin-bottom: 2px; }
.empty__icon { width: 22px !important; height: 22px !important; color: var(--td); }
.history__clear { align-self: flex-start; }
.history-backdrop { position: fixed; inset: 0; z-index: 140; background: rgba(5, 7, 12, 0.6); }

@media (max-width: 1279.98px) {
  .history {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 150; width: min(320px, 88vw);
    padding: 22px 18px; background: var(--bg-2); border-right: 1px solid var(--bd); overflow-y: auto;
    transform: translateX(-102%); transition: transform 0.25s ease;
  }
  .history.is-open { transform: none; }
  .pg-page .history__close { display: inline-grid; }
}

/* --- Kontingent-Anzeige -------------------------------------------------- */
.quota {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 7px 14px;
  border: 1px solid var(--bd); border-radius: 999px; background: var(--s); font-size: 0.8rem; color: var(--tm);
}
.quota:empty { display: none; }
.quota__meter { width: 46px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.quota__fill { display: block; height: 100%; background: var(--ac); border-radius: inherit; }
.quota--leer .quota__fill { background: var(--pg-danger); }
.quota__zusatz { color: var(--td); }
#neu-oben { margin-left: auto; }

.demo-note {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 16px; font-size: 0.85rem; color: var(--tm);
  border: 1px solid rgba(224, 164, 88, 0.4); border-radius: 12px; background: rgba(224, 164, 88, 0.08);
}
.demo-note .icon { color: #e0a458; }

/* --- Prompt-Blatt -------------------------------------------------------- */
.sheet {
  position: relative; border: 1px solid var(--bd); border-radius: 20px; background: var(--pg-card);
  padding: 30px; box-shadow: var(--sh);
}
.sheet__label { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 14px; }
.sheet__label .icon { color: var(--ac); width: 20px; height: 20px; }
.pg-page textarea.sheet__input { min-height: 170px; font-size: 0.98rem; }
.sheet__hint-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 8px; }
.sheet__help { margin: 0; font-size: 0.8rem; color: var(--tm); line-height: 1.5; }
.counter { font-size: 0.76rem; color: var(--td); white-space: nowrap; }
.counter.is-voll { color: var(--pg-danger); }
.sheet__toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--bd);
}
.select-inline { display: flex; align-items: center; gap: 12px; }
.select-inline label { font-size: 0.84rem; color: var(--tm); white-space: nowrap; }
.select-inline select { width: auto; min-width: 190px; padding: 10px 14px; cursor: pointer; }

.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet__title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.sheet__version { margin: 2px 0 0; font-size: 0.8rem; color: var(--td); }
.sheet__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--rs);
  border: 1px solid var(--bd); background: rgba(255, 255, 255, 0.02); color: var(--tx);
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.tool-btn:hover, .tool-btn[aria-pressed="true"] { border-color: var(--ba); color: var(--ac); }
.tool-btn--akzent { background: var(--ac); border-color: var(--ac); color: var(--bg-1); }
.tool-btn--akzent:hover { background: var(--acd); border-color: var(--acd); color: var(--bg-1); }
.tool-btn.is-done { background: var(--ag); border-color: var(--ba); color: var(--ac); }

/* Der Prompt selbst: ruhige, gut lesbare Fläche */
.doc {
  display: flex; flex-direction: column; padding: 22px 24px; border-radius: 14px;
  background: rgba(15, 17, 23, 0.55); border: 1px solid var(--bd);
  font-size: 0.95rem; line-height: 1.7; color: var(--tx); white-space: pre-wrap; overflow-wrap: anywhere;
}
.doc:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.doc__line { display: block; min-height: 1.7em; }
.doc__line--label { font-weight: 700; color: var(--tx); margin-top: 2px; }
.doc__line--neu { background: rgba(46, 204, 113, 0.14); box-shadow: -8px 0 0 rgba(46, 204, 113, 0.14), 8px 0 0 rgba(46, 204, 113, 0.14); border-radius: 4px; }
.doc--statisch .doc__line--neu { background: none; box-shadow: none; }
.pg-page textarea.doc-edit__input { min-height: 320px; font-size: 0.92rem; }
.doc-edit .sheet__help { margin-top: 8px; }
.doc__legend { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 0.78rem; color: var(--tm); }
.doc__legend .icon { width: 15px; height: 15px; color: var(--ac); }

.sheet__loading { padding: 48px 10px; text-align: center; }
.sheet__loading-text { font-size: 1.05rem; font-weight: 700; margin: 0; }
.sheet__loading-sub { font-size: 0.82rem; color: var(--tm); margin: 6px 0 0; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 4px; vertical-align: -2px; background: var(--ac); animation: pg-blink 1s steps(1) infinite; }
@keyframes pg-blink { 50% { opacity: 0; } }

.alert {
  margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; font-size: 0.86rem; line-height: 1.55;
  border: 1px solid rgba(255, 123, 123, 0.45); background: rgba(255, 123, 123, 0.08); color: var(--tx);
}

/* --- Rechte Spalte ------------------------------------------------------- */
.panel { border: 1px solid var(--bd); border-radius: 20px; background: var(--s); padding: 26px 24px; }
.panel__title { font-size: 1.08rem; font-weight: 800; margin: 0 0 16px; }
.panel__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.panel__head .panel__title { margin-bottom: 4px; }
.panel__lead { font-size: 0.82rem; color: var(--tm); margin: 0; line-height: 1.5; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps p { margin: 0; }
.steps strong { display: block; font-size: 0.9rem; color: var(--tx); }
.steps p span { display: block; font-size: 0.8rem; color: var(--tm); line-height: 1.5; margin-top: 2px; }
.steps__icon {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px;
  background: var(--ag); border: 1px solid var(--ba); color: var(--ac);
}
.panel__note { display: flex; gap: 10px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--bd); font-size: 0.8rem; color: var(--tm); line-height: 1.5; }
.panel__note .icon { color: var(--ac); width: 16px; height: 16px; margin-top: 2px; }
.panel__note a, .field a { color: var(--ac); }

/* Verbesserungs-Optionen (von prompt.js erzeugt) */
.options { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.option-group__title { font-size: 0.72rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ac); margin: 0 0 8px; }
.option-group__items { display: flex; flex-wrap: wrap; gap: 8px; }
.option-empty { font-size: 0.82rem; color: var(--tm); margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--bd); background: rgba(255, 255, 255, 0.02); color: var(--tm);
  font: inherit; font-size: 0.82rem; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.chip:hover { border-color: var(--ba); color: var(--tx); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--ag); border-color: var(--ba); color: var(--tx); }
.chip__check { width: 14px; height: 14px; color: var(--ac); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.84rem; font-weight: 600; color: var(--tx); }
.field__opt { font-weight: 400; color: var(--td); }
.pg-page .field textarea.cf-input { min-height: 90px; }
.panel__submit { margin-top: 16px; }
.panel__submit .bp { width: 100%; justify-content: center; }
.panel__hint { font-size: 0.78rem; color: var(--td); margin: 10px 0 0; text-align: center; }

/* --- Vorlagen ------------------------------------------------------------ */
.pg-block-head { margin-bottom: 18px; }
.pg-block-head h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 800; letter-spacing: -0.4px; margin: 0 0 6px; }
.pg-block-head h2 .tac { color: var(--ac); }
.pg-block-head p { margin: 0; color: var(--tm); font-size: 0.92rem; line-height: 1.6; }
.vorlagen__kategorien { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.kat {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--s); color: var(--tm); font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.kat .icon { width: 16px; height: 16px; }
.kat:hover { border-color: var(--ba); color: var(--tx); }
.kat[aria-selected="true"] { background: var(--ag); border-color: var(--ba); color: var(--tx); }
.kat[aria-selected="true"] .icon { color: var(--ac); }
.vorlagen__beschreibung { font-size: 0.82rem; color: var(--td); margin: 0 0 12px; }
.vorlagen__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.vorlage {
  position: relative; display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; text-align: left;
  padding: 18px; border-radius: 16px; border: 1px solid var(--bd); background: var(--pg-card);
  color: var(--tx); font: inherit; cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
}
.vorlage:hover { transform: translateY(-4px); border-color: var(--ba); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38), 0 0 26px rgba(46, 204, 113, 0.07); }
.vorlage__titel { font-size: 0.95rem; font-weight: 700; }
.vorlage__text {
  font-size: 0.82rem; color: var(--tm); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.vorlage__cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--ac); }
.vorlage__cta .icon { width: 15px; height: 15px; transition: transform 0.2s; }
.vorlage:hover .vorlage__cta .icon { transform: translateX(3px); }

/* --- Fassungen und schnelle Anpassungen ---------------------------------- */
.below { border: 1px solid var(--bd); border-radius: 20px; background: var(--s); padding: 22px 24px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--bd); margin-bottom: 18px; }
.tabs__tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--tm);
  font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.tabs__tab[aria-selected="true"] { color: var(--tx); border-bottom-color: var(--ac); }
.tabs__tab .icon { width: 16px; height: 16px; }
.tabs__count { font-size: 0.72rem; font-weight: 800; color: var(--ac); background: var(--ag); border-radius: 999px; padding: 2px 8px; }
.tabs__panel:focus-visible { outline: 2px solid var(--ac); outline-offset: 4px; border-radius: 8px; }
.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.version { padding: 14px 16px; border: 1px solid var(--bd); border-radius: 12px; background: rgba(15, 17, 23, 0.45); }
.version[aria-current="true"] { border-color: var(--ba); }
.version__name { font-size: 0.88rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.version__badge { font-size: 0.68rem; font-weight: 800; color: var(--ac); background: var(--ag); border-radius: 999px; padding: 2px 8px; }
.version__time { font-size: 0.74rem; color: var(--td); }
.version__changes { margin: 6px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--tm); line-height: 1.55; }
.version__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.origin { margin-top: 14px; }
.origin summary { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--tm); cursor: pointer; list-style: none; }
.origin summary::-webkit-details-marker { display: none; }
.origin summary .icon { width: 15px; height: 15px; transition: transform 0.2s; }
.origin[open] summary .icon { transform: rotate(90deg); }
.origin p { margin: 10px 0 0; font-size: 0.86rem; color: var(--tm); line-height: 1.6; white-space: pre-wrap; }
.below__lead { font-size: 0.84rem; color: var(--tm); margin: 0 0 16px; }
.mods { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mods__title { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--tx); margin: 0 0 10px; }
.mods__title .icon { width: 15px; height: 15px; color: var(--ac); }
.mods__row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Beispiel-Prompt mit Markierungen ------------------------------------ */
.anatomy { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) { .anatomy { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }
.sheet--sample { padding: 22px; }
.sample__mark {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--ac); color: var(--bg-1); font-size: 0.72rem; font-weight: 800; white-space: normal;
}
.anatomy__notes { list-style: none; counter-reset: pg-note; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.anatomy__notes li {
  counter-increment: pg-note; position: relative; padding: 18px 20px 18px 62px;
  border: 1px solid var(--bd); border-radius: 16px; background: var(--pg-card);
}
.anatomy__notes li::before {
  content: counter(pg-note); position: absolute; left: 20px; top: 18px; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--ag); border: 1px solid var(--ba);
  color: var(--ac); font-size: 0.8rem; font-weight: 800;
}
.anatomy__notes h3 { font-size: 0.98rem; font-weight: 700; margin: 0 0 4px; }
.anatomy__notes p { font-size: 0.85rem; color: var(--tm); margin: 0; line-height: 1.55; }
.pg-page .np-ico .icon { width: 22px; height: 22px; }

/* --- Dialoge und Toast --------------------------------------------------- */
.dialog {
  /* margin:auto zentriert den Dialog wieder (globaler Reset der Website setzt margin:0) */
  position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 32px); overflow: auto;
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--bd); border-radius: 20px;
  background: var(--bg-2); color: var(--tx); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(3px); }
.dialog__body { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.dialog__icon .icon { width: 22px; height: 22px; }
.dialog__icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--ag); border: 1px solid var(--ba); color: var(--ac);
}
.dialog__icon--danger { background: rgba(255, 123, 123, 0.1); border-color: rgba(255, 123, 123, 0.4); color: var(--pg-danger); }
.dialog__title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.dialog__text { font-size: 0.88rem; color: var(--tm); line-height: 1.6; margin: 0; }
.dialog .check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.5; color: var(--tx); cursor: pointer; }
.dialog .check input { margin-top: 3px; accent-color: var(--ac); }
.dialog .check a { color: var(--ac); }
.dialog .field label { font-size: 0.84rem; }
.dialog__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.dialog__actions .bp { padding: 12px 22px; width: auto; }
.dialog .btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 0.86rem; font-weight: 600; padding: 12px 20px; border-radius: var(--rs); border: 1px solid var(--bd); background: none; color: var(--tx); cursor: pointer; }
.dialog .btn--danger { border-color: rgba(255,123,123,.5); color: #ff7b7b; }
.dialog .cf-input { width: 100%; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 20px); opacity: 0;
  padding: 11px 18px; border-radius: 999px; background: var(--s2); border: 1px solid var(--ba);
  color: var(--tx); font-size: 0.86rem; box-shadow: var(--sh); transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Smartphone ---------------------------------------------------------- */
@media (max-width: 640px) {
  .sheet { padding: 22px 18px; border-radius: 16px; }
  .panel, .below { padding: 20px 18px; }
  .sheet__toolbar { flex-direction: column; align-items: stretch; }
  .select-inline { flex-direction: column; align-items: stretch; gap: 6px; }
  .select-inline select { width: 100%; }
  .sheet__toolbar .bp { width: 100%; justify-content: center; }
  .doc { padding: 16px; font-size: 0.9rem; }
  .vorlagen__liste { grid-template-columns: 1fr; }
  .tabs__tab { padding: 10px 8px; font-size: 0.82rem; }
  .pg-section { padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .history, .vorlage, .toast { transition: none; }
  .caret { animation: none; }
}
