/* Plattform-Ausschnitte im Beitrag.
   Werte gemessen an den Karten auf swissgrc.com/plattform/: Panel weiss,
   Rahmen #E1E7EE, Radius 10, Schatten 0 10px 22px -16px, Innenabstand
   10 und 11 px, Schrift 11.5 px. Kopfzeile 10 px, 600, #8592A3, Laufweite
   0.8 px. Bühne hellgrau mit 16 px Rand, Kachel weiss mit Radius 16.
   Jede Regel beginnt mit :is(html, #sgx#sgx). Das trifft immer, zählt aber
   wie zwei IDs und schlägt so den Reset des Beitrags (#sgce-a.sgce-article div). */

:is(html, #sgx#sgx) .sgx-demo {
  --sgx-teal: #12A5AB;
  --sgx-teal-tief: #0F7C84;
  --sgx-teal-tint: #E3F4F5;
  --sgx-ink: #16233A;
  --sgx-grau: #8592A3;
  --sgx-grau-2: #6B7A91;
  --sgx-linie: #E1E7EE;
  --sgx-linie-2: #EEF2F6;
  margin: 2.4rem 0 !important;
  padding: 0 !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--sgx-ink);
}

:is(html, #sgx#sgx) .sgx-demo .sgx-demo-ersatz { display: block; }
:is(html, #sgx#sgx) .sgx-demo.is-aktiv .sgx-demo-ersatz { display: none !important; }
:is(html, #sgx#sgx) .sgx-demo figcaption {
  margin: 12px 0 0 !important; font-size: 12.5px !important; line-height: 1.55 !important;
  color: #8892A1 !important; text-align: left !important;
}

/* Raster aus ein bis drei Kacheln */
:is(html, #sgx#sgx) .sgx-demo .sgx-raster {
  display: grid; gap: 14px; grid-template-columns: repeat(var(--sgx-n, 1), minmax(0, 1fr));
}
:is(html, #sgx#sgx) .sgx-demo .sgx-kachel {
  display: flex; flex-direction: column; background: #fff; border: 1px solid #E7EBF0; border-radius: 16px; overflow: hidden;
  opacity: 0; transform: translateY(8px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--sgx-i, 0) * 120ms);
}
:is(html, #sgx#sgx) .sgx-demo.is-da .sgx-kachel { opacity: 1; transform: none; }

:is(html, #sgx#sgx) .sgx-demo .sgx-buehne {
  background: #F4F6F9; padding: 18px 16px; display: flex; align-items: center; justify-content: center; flex: 1;
}

:is(html, #sgx#sgx) .sgx-demo .sgx-panel {
  width: 100%; max-width: 300px; background: #fff; border: 1px solid var(--sgx-linie); border-radius: 10px;
  box-shadow: 0 10px 22px -16px rgba(16, 24, 40, .35); padding: 10px 11px 11px;
  font-size: 11.5px; line-height: 1.35; text-align: left;
}
:is(html, #sgx#sgx) .sgx-demo[dir="rtl"] .sgx-panel { text-align: right; }

:is(html, #sgx#sgx) .sgx-demo .sgx-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
  font-size: 10px; font-weight: 600; color: var(--sgx-grau); letter-spacing: .8px !important; text-transform: uppercase !important;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-kopf > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(html, #sgx#sgx) .sgx-demo .sgx-kopf > span:not(.sgx-p) { text-transform: uppercase !important; letter-spacing: .8px !important; font-size: 10px !important; }
:is(html, #sgx#sgx) .sgx-demo .sgx-marke { flex: none; }
:is(html, #sgx#sgx) .sgx-demo .sgx-kopf .sgx-p { letter-spacing: .4px !important; }

:is(html, #sgx#sgx) .sgx-demo .sgx-zeilen { display: flex; flex-direction: column; gap: 6px; position: relative; }

/* Zeilen erscheinen nacheinander */
:is(html, #sgx#sgx) .sgx-demo .sgx-z {
  opacity: 0; transform: translateY(4px);
  transition: opacity .4s ease, transform .45s cubic-bezier(.2, .7, .2, 1), border-color .3s ease, background .3s ease;
  transition-delay: calc(var(--sgx-i, 0) * 120ms + 200ms + var(--sgx-j, 0) * 110ms);
}
:is(html, #sgx#sgx) .sgx-demo.is-da .sgx-z { opacity: 1; transform: none; }

:is(html, #sgx#sgx) .sgx-demo .sgx-l { color: var(--sgx-grau-2); }
:is(html, #sgx#sgx) .sgx-demo .sgx-v { font-weight: 600; color: var(--sgx-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

:is(html, #sgx#sgx) .sgx-demo .sgx-wert { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

:is(html, #sgx#sgx) .sgx-demo .sgx-feld {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--sgx-linie); border-radius: 6px; padding: 7px 8px;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-feld .sgx-l { color: var(--sgx-ink); }
:is(html, #sgx#sgx) .sgx-demo .sgx-feld .sgx-v { font-weight: 500; color: var(--sgx-grau); font-size: 10.5px; }
:is(html, #sgx#sgx) .sgx-demo .is-hervor { border-color: rgba(18, 165, 171, .55) !important; background: #F3FBFB !important; }
:is(html, #sgx#sgx) .sgx-demo .sgx-feld.is-hervor .sgx-v { color: var(--sgx-teal-tief); font-weight: 700; font-size: 11.5px; }

/* Objekt mit Status */
:is(html, #sgx#sgx) .sgx-demo .sgx-obj {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid var(--sgx-linie); border-radius: 7px; padding: 6px 8px;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-obj-t { display: flex; flex-direction: column; min-width: 0; }
:is(html, #sgx#sgx) .sgx-demo .sgx-obj-t small { font-size: 9.5px; color: var(--sgx-grau); line-height: 1.3; }
:is(html, #sgx#sgx) .sgx-demo .sgx-obj-t span { font-weight: 600; }

/* Verbundene Objekte: Linie mit Punkten links */
:is(html, #sgx#sgx) .sgx-demo .is-verbunden { padding-left: 14px; }
:is(html, #sgx#sgx) .sgx-demo .is-verbunden::before {
  content: ""; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 1.5px; background: #CFE9EA;
}
:is(html, #sgx#sgx) .sgx-demo .is-verbunden > .sgx-z { position: relative; }
:is(html, #sgx#sgx) .sgx-demo .is-verbunden > .sgx-z::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--sgx-teal); box-shadow: 0 0 0 2px #fff;
}

/* Pillen */
:is(html, #sgx#sgx) .sgx-demo .sgx-p {
  display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap;
  border-radius: 999px; padding: 2px 7px; font-size: 10px; font-weight: 600; line-height: 1.5;
  transition: opacity .2s ease, transform .2s ease;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-p i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--ok { background: #E6F5EF; color: #1C8A64; }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--info { background: var(--sgx-teal-tint); color: var(--sgx-teal-tief); }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--warn { background: #FFF3DF; color: #B26E12; }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--neutral { background: #EEF2F6; color: var(--sgx-grau-2); }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--neu { background: #E8EFFA; color: #3062A5; }
:is(html, #sgx#sgx) .sgx-demo .sgx-p.is-weg { opacity: 0; transform: scale(.9); }
:is(html, #sgx#sgx) .sgx-demo .sgx-p.is-neu { animation: sgx-pop .45s cubic-bezier(.2, .9, .3, 1.3); }
:is(html, #sgx#sgx) .sgx-demo .sgx-p.is-versteckt { opacity: 0; transform: translateY(3px); }
:is(html, #sgx#sgx) .sgx-demo .sgx-p--breit { display: flex; justify-content: center; border-radius: 6px; padding: 5px 8px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-chip-z .sgx-p, :is(html, #sgx#sgx) .sgx-demo .sgx-p--breit { white-space: normal; text-align: left; }
:is(html, #sgx#sgx) .sgx-demo .sgx-chip-z .sgx-p i { flex: none; }
@keyframes sgx-pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Kette */
:is(html, #sgx#sgx) .sgx-demo .sgx-kette { display: flex; flex-direction: column; align-items: stretch; }
:is(html, #sgx#sgx) .sgx-demo .sgx-kette-g {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--sgx-linie); border-radius: 7px; padding: 7px 9px;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-kette-g .sgx-l { font-size: 9.5px !important; font-weight: 600; letter-spacing: .6px !important; text-transform: uppercase !important; color: var(--sgx-grau); }
:is(html, #sgx#sgx) .sgx-demo .sgx-kette-g .sgx-v { font-weight: 500; }
:is(html, #sgx#sgx) .sgx-demo .sgx-kette-v { align-self: center; width: 0; height: 12px; border-left: 1.5px dotted var(--sgx-teal); }

/* Workflow */
:is(html, #sgx#sgx) .sgx-demo .sgx-schritte {
  position: relative; display: grid; grid-template-columns: repeat(var(--sgx-n, 3), minmax(0, 1fr)); padding-top: 2px;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-schritte-l {
  position: absolute; top: 8px; height: 2px; background: var(--sgx-linie-2); border-radius: 2px;
  left: calc(50% / var(--sgx-n, 3)); right: calc(50% / var(--sgx-n, 3));
}
:is(html, #sgx#sgx) .sgx-demo .sgx-schritte-f { display: block; height: 100%; width: 0; background: var(--sgx-teal); border-radius: 2px; transition: width .45s ease; }
:is(html, #sgx#sgx) .sgx-demo .sgx-st { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10px; color: var(--sgx-grau-2); text-align: center; }
:is(html, #sgx#sgx) .sgx-demo .sgx-st i {
  width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #C9D3DE; background: #fff; display: block;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-st.is-an i { background: var(--sgx-teal); border-color: var(--sgx-teal); box-shadow: 0 0 0 3px rgba(18, 165, 171, .14); }
:is(html, #sgx#sgx) .sgx-demo .sgx-st.is-an { color: var(--sgx-ink); }

/* Balken */
:is(html, #sgx#sgx) .sgx-demo .sgx-balken { display: flex; flex-direction: column; gap: 5px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-spur { display: block; height: 6px; border-radius: 3px; background: var(--sgx-linie-2); overflow: hidden; }
:is(html, #sgx#sgx) .sgx-demo .sgx-spur-f { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 1s cubic-bezier(.2, .7, .2, 1); }
:is(html, #sgx#sgx) .sgx-demo .sgx-spur-f--info, :is(html, #sgx#sgx) .sgx-demo .sgx-spur-f--neutral, :is(html, #sgx#sgx) .sgx-demo .sgx-spur-f--neu { background: linear-gradient(90deg, #2DC6CB, var(--sgx-teal)); }
:is(html, #sgx#sgx) .sgx-demo .sgx-spur-f--ok { background: #2BB38A; }
:is(html, #sgx#sgx) .sgx-demo .sgx-spur-f--warn { background: #E5A33A; }

/* Kennzahlen */
:is(html, #sgx#sgx) .sgx-demo .sgx-zahl { display: flex; flex-direction: column; gap: 2px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahl .sgx-l { font-size: 10.5px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahl-v { font-size: 20px; font-weight: 700; letter-spacing: -.2px !important; font-variant-numeric: tabular-nums; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahl-h { font-size: 10px; color: var(--sgx-grau); }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahlen { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahlen-k { border: 1px solid var(--sgx-linie); border-radius: 7px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahlen-k .sgx-l { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zahlen-v { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Knopf */
:is(html, #sgx#sgx) .sgx-demo .sgx-knopf-z { display: flex; flex-direction: column; gap: 6px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-knopf {
  display: block; text-align: center; background: var(--sgx-teal-tief); color: #fff; border-radius: 6px; padding: 7px 10px;
  font-weight: 600; font-size: 11px; transition: transform .12s ease, filter .12s ease;
}
:is(html, #sgx#sgx) .sgx-demo .sgx-knopf.is-druck { transform: scale(.97); filter: brightness(.92); }

/* Meldung */
:is(html, #sgx#sgx) .sgx-demo .sgx-chip-z { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
:is(html, #sgx#sgx) .sgx-demo .sgx-chip-t { color: var(--sgx-grau-2); font-size: 10.5px; }

/* Verlauf */
:is(html, #sgx#sgx) .sgx-demo .sgx-verlauf { display: flex; gap: 10px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--sgx-linie-2); }
:is(html, #sgx#sgx) .sgx-demo .sgx-verlauf:last-child { border-bottom: 0; padding-bottom: 0; }
:is(html, #sgx#sgx) .sgx-demo .sgx-zeit { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: var(--sgx-teal-tief); font-weight: 600; flex: none; }
:is(html, #sgx#sgx) .sgx-demo .sgx-verlauf-t { display: flex; flex-direction: column; }
:is(html, #sgx#sgx) .sgx-demo .sgx-verlauf-t small { font-size: 9.5px; color: var(--sgx-grau); }

/* Auswahl und Schalter */
:is(html, #sgx#sgx) .sgx-demo .sgx-pillen { display: flex; gap: 5px; flex-wrap: wrap; }
:is(html, #sgx#sgx) .sgx-demo .sgx-wahl { border-radius: 6px; padding: 4px 9px; background: #F1F4F7; color: var(--sgx-grau-2); font-weight: 600; font-size: 10.5px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-wahl.is-an { background: var(--sgx-teal); color: #fff; }
:is(html, #sgx#sgx) .sgx-demo .sgx-schalter-z { display: flex; align-items: center; gap: 8px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-schalter { position: relative; width: 24px; height: 14px; border-radius: 7px; background: #D5DCE4; flex: none; transition: background .25s ease; }
:is(html, #sgx#sgx) .sgx-demo .sgx-schalter::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
:is(html, #sgx#sgx) .sgx-demo .sgx-schalter.is-an { background: var(--sgx-teal); }
:is(html, #sgx#sgx) .sgx-demo .sgx-schalter.is-an::after { transform: translateX(10px); }

/* Titel und Text unter der Bühne */
:is(html, #sgx#sgx) .sgx-demo .sgx-unten { padding: 14px 16px 16px; }
:is(html, #sgx#sgx) .sgx-demo .sgx-titel { font-family: 'Anek Latin', Inter, sans-serif; font-size: 15.5px; font-weight: 700; line-height: 1.3; color: var(--sgx-ink); }
:is(html, #sgx#sgx) .sgx-demo .sgx-text { display: block; margin-top: 5px; font-size: 13.5px; line-height: 1.55; color: #5B6B82; }
:is(html, #sgx#sgx) .sgx-demo .sgx-text b { color: var(--sgx-ink); font-weight: 600; }

/* Nebeneinander: Bühnen und Texte stehen auf gleicher Höhe. */
@supports (grid-template-rows: subgrid) {
  :is(html, #sgx#sgx) .sgx-demo .sgx-raster:not(.is-quer):not(.is-stapel) { grid-template-rows: 1fr auto; }
  :is(html, #sgx#sgx) .sgx-demo .sgx-raster:not(.is-quer):not(.is-stapel) .sgx-kachel { display: grid; grid-row: span 2; grid-template-rows: subgrid; gap: 0; }
}

/* Quer: in einer schmalen Spalte liegt jede Kachel quer, Ausschnitt links,
   Text rechts. So bleibt jede Karte gross genug. */
:is(html, #sgx#sgx) .sgx-demo .sgx-raster.is-quer { grid-template-columns: 1fr; gap: 12px; }
:is(html, #sgx#sgx) .sgx-demo .is-quer .sgx-kachel { flex-direction: row; align-items: stretch; }
:is(html, #sgx#sgx) .sgx-demo .is-quer .sgx-buehne { flex: 0 0 56%; padding: 18px 18px; }
:is(html, #sgx#sgx) .sgx-demo .is-quer .sgx-unten { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 16px 20px; }
:is(html, #sgx#sgx) .sgx-demo[dir="rtl"] .is-quer .sgx-kachel { flex-direction: row-reverse; }

/* Schmal: Kacheln untereinander */
:is(html, #sgx#sgx) .sgx-demo .sgx-raster.is-stapel { grid-template-columns: 1fr; }
:is(html, #sgx#sgx) .sgx-demo .is-stapel .sgx-kachel { flex-direction: column; }
:is(html, #sgx#sgx) .sgx-demo .is-stapel .sgx-buehne { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  :is(html, #sgx#sgx) .sgx-demo *, :is(html, #sgx#sgx) .sgx-demo *::before, :is(html, #sgx#sgx) .sgx-demo *::after { transition: none !important; animation: none !important; }
  :is(html, #sgx#sgx) .sgx-demo .sgx-kachel, :is(html, #sgx#sgx) .sgx-demo .sgx-z { opacity: 1; transform: none; }
}
