/* Marktplan-Konfigurator — Shirtschleuder Arbeitswelt Supermarkt (Konzept: docs/prototypen/marktplan/)
   Flächen und Schrift aus den Katalog-Tokens (Dark Mode inklusive); Gruppenfarben sind die Kennfarben des Plans. */
.mp {
  --mp-bg: var(--surface, #F7F6F2);
  --mp-line: var(--border, #E4E1D8);
  --mp-ink: var(--text-strong, #2C2C2A);
  --mp-ink-2: var(--text-muted, #5F5E5A);
  --mp-frische: #3B6D11;   --mp-frische-hell: #EAF3DE;   --mp-frische-dunkel: #27500A;
  --mp-genuss: #854F0B;    --mp-genuss-hell: #FAEEDA;    --mp-genuss-dunkel: #633806;
  --mp-kulissen: #534AB7;  --mp-kulissen-hell: #EEEDFE;  --mp-kulissen-dunkel: #3C3489;
  --mp-aussen: #0F6E56;    --mp-aussen-hell: #E1F5EE;    --mp-aussen-dunkel: #085041;
  --mp-pflicht: #2C2C2A;
  container-type: inline-size;
  background: var(--mp-bg);
  border: 1px solid var(--mp-line);
  border-radius: var(--radius-md, 14px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--mp-ink);
  font-family: inherit;
  /* Auf dem iPad quer passt alles in eine Bildschirmhöhe — unter Kopf und klebender Weltleiste („Nach oben“
     springt genau dorthin; --welt-leistenhoehe setzt erlebnis.js) */
  height: min(calc(100vw * 0.75), calc(100vh - 120px));
  height: min(calc(100vw * 0.75), calc(100dvh - var(--kopf, 54px) - var(--welt-leistenhoehe, 88px) - 24px));
  min-height: 460px;
}
.mp * { box-sizing: border-box; }

.mp__kopf { display: flex; align-items: center; gap: 12px; padding: 10px 18px 0; flex-wrap: wrap; }
.mp__titel { font-size: 20px; font-weight: 600; margin: 0; color: var(--mp-ink); }
.mp__groesse { display: flex; gap: 2px; background: var(--mp-line); border-radius: 9px; padding: 2px; }
.mp__groesse button { border: 0; border-radius: 7px; padding: 6px 16px; font: inherit; font-size: 15px; background: transparent; color: var(--mp-ink); cursor: pointer; min-height: 36px; }
.mp__groesse button[aria-pressed="true"] { background: var(--mp-ink); color: var(--mp-bg); }
.mp__groesse button:focus-visible { outline: 2px solid var(--focus, var(--mp-ink)); outline-offset: 1px; }
.mp__zahl { margin-left: auto; font-size: 14px; color: var(--mp-ink-2); }

.mp__plan { flex: 1; min-height: 0; padding: 0 12px; }
.mp__plan svg { width: 100%; height: 100%; display: block; font-family: inherit; }
.mp__schild { cursor: pointer; }
.mp__schild:focus { outline: none; }
.mp__schild:focus-visible rect { stroke: var(--mp-ink); stroke-width: 2.5; }
.mp__status { margin: 0; padding: 0 18px; min-height: 0; font-size: 14px; color: var(--mp-ink-2); }
.mp__status:not(:empty) { padding-bottom: 6px; }

.mp__panel { display: grid; grid-template-columns: repeat(var(--mp-spalten, 5), minmax(0, 1fr)); gap: 14px; padding: 10px 18px 14px; border-top: 1px solid var(--mp-line); }
.mp__gruppe h4 { font-size: 14px; font-weight: 600; margin: 0 0 7px; }
.mp__liste { display: flex; flex-direction: column; gap: 5px; }
.mp__kachel {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; border-radius: 9px; padding: 0 12px; min-height: 40px;
  font: inherit; font-size: 15px; text-align: left; white-space: nowrap;
  cursor: pointer; transition: background-color .12s, color .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.mp__kachel span { overflow: hidden; text-overflow: ellipsis; }
.mp__sym { width: 18px; height: 18px; flex: none; }
.mp__kachel .mp__ck { margin-left: auto; width: 17px; height: 17px; flex: none; }
.mp__kachel.is-hover { box-shadow: 0 0 0 2px var(--mp-ink); }
.mp__kachel:focus-visible { outline: 2px solid var(--focus, var(--mp-ink)); outline-offset: 2px; }
/* Bereich ohne fertiges Schaufenster: im Plan wählbar, Kachel gestrichelt */
.mp__kachel.is-vorbereitung { outline: 1px dashed currentColor; outline-offset: -4px; }

.mp__kachel[data-gruppe="frische"]  { background: var(--mp-frische-hell);  color: var(--mp-frische-dunkel); }
.mp__kachel[data-gruppe="genuss"]   { background: var(--mp-genuss-hell);   color: var(--mp-genuss-dunkel); }
.mp__kachel[data-gruppe="kulissen"] { background: var(--mp-kulissen-hell); color: var(--mp-kulissen-dunkel); }
.mp__kachel[data-gruppe="aussen"]   { background: var(--mp-aussen-hell);   color: var(--mp-aussen-dunkel); }
.mp__kachel[aria-pressed="true"][data-gruppe="frische"]  { background: var(--mp-frische);  color: #fff; }
.mp__kachel[aria-pressed="true"][data-gruppe="genuss"]   { background: var(--mp-genuss);   color: #fff; }
.mp__kachel[aria-pressed="true"][data-gruppe="kulissen"] { background: var(--mp-kulissen); color: #fff; }
.mp__kachel[aria-pressed="true"][data-gruppe="aussen"]   { background: var(--mp-aussen);   color: #fff; }
/* Immer dabei (Kasse, Lager): fest eingeschaltet in der Schildfarbe des Plans, Klick springt zur Ausstattung */
.mp__kachel[data-gruppe="pflicht"] { background: var(--mp-pflicht); color: #fff; }
.mp__gruppe[data-gruppe="pflicht"] h4 { color: var(--mp-ink); }
.mp__gruppe[data-gruppe="frische"]  h4 { color: var(--mp-frische-dunkel); }
.mp__gruppe[data-gruppe="genuss"]   h4 { color: var(--mp-genuss-dunkel); }
.mp__gruppe[data-gruppe="kulissen"] h4 { color: var(--mp-kulissen-dunkel); }
.mp__gruppe[data-gruppe="aussen"]   h4 { color: var(--mp-aussen-dunkel); }
/* Dark Mode: Überschriften in hellen Stufen, ausgeschaltete Kacheln gedämpft statt hell */
:root[data-theme="dark"] .mp__gruppe[data-gruppe="frische"]  h4 { color: #97C459; }
:root[data-theme="dark"] .mp__gruppe[data-gruppe="genuss"]   h4 { color: #EF9F27; }
:root[data-theme="dark"] .mp__gruppe[data-gruppe="kulissen"] h4 { color: #AFA9EC; }
:root[data-theme="dark"] .mp__gruppe[data-gruppe="aussen"]   h4 { color: #5DCAA5; }
:root[data-theme="dark"] .mp__kachel[data-gruppe="pflicht"] { background: #5F5E5A; }
:root[data-theme="dark"] .mp__kachel[aria-pressed="false"] { background: rgba(255,255,255,.06); color: var(--text, #E6E6E6); }

/* Nur-Ansicht: Kachel-Panel ausblenden, Plan dient als Sprungmarke */
.mp[data-modus="ansicht"] .mp__panel,
.mp[data-modus="ansicht"] .mp__groesse { display: none; }
.mp[data-modus="ansicht"] { height: auto; min-height: 0; aspect-ratio: 16 / 8; }

/* Hochformat / schmale Geräte: Kacheln zweispaltig, Seite darf scrollen */
@container (max-width: 760px) {
  .mp__panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 420px) {
  .mp__panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px), (orientation: portrait) {
  .mp { height: auto; min-height: 0; }
  .mp__plan { aspect-ratio: 4 / 3; flex: none; }
}
@media (prefers-reduced-motion: reduce) { .mp__kachel { transition: none; } }

/* Ausgeschaltete Schaufenster auf der Seite */
.mp-ausgeblendet { display: none !important; }

/* Ihr Team — Stellenprofile unter dem Plan (marktplan-personal.js) */
.mp-team {
  --mp-bg: var(--surface, #F7F6F2);
  --mp-line: var(--border, #E4E1D8);
  --mp-ink: var(--text-strong, #2C2C2A);
  --mp-ink-2: var(--text-muted, #5F5E5A);
  --mp-frische: #3B6D11;   --mp-frische-hell: #EAF3DE;   --mp-frische-dunkel: #27500A;
  --mp-genuss: #854F0B;    --mp-genuss-hell: #FAEEDA;    --mp-genuss-dunkel: #633806;
  --mp-kulissen: #534AB7;  --mp-kulissen-hell: #EEEDFE;  --mp-kulissen-dunkel: #3C3489;
  --mp-aussen: #0F6E56;    --mp-aussen-hell: #E1F5EE;    --mp-aussen-dunkel: #085041;
  --mp-pflicht-hell: #ECEAE4; --mp-pflicht-dunkel: #2C2C2A;
  background: var(--mp-bg);
  border: 1px solid var(--mp-line);
  border-radius: var(--radius-md, 14px);
  padding: 14px 18px 16px;
  color: var(--mp-ink);
  display: flex; flex-direction: column; gap: 12px;
}
.mp-team[hidden] { display: none; }
.mp-team * { box-sizing: border-box; }
.mp-team .mp__sym { width: 16px; height: 16px; flex: none; }
.mp-team__kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-team__zahl { font-size: 15px; color: var(--mp-ink-2); }
.mp-team__knopf { margin-left: auto; border: 1px solid var(--mp-line); background: transparent; color: var(--mp-ink); border-radius: 9px; padding: 6px 12px; min-height: 36px; font: inherit; font-size: 14px; cursor: pointer; }
.mp-team__hinweis { margin: 0; font-size: 14px; color: var(--mp-ink-2); max-width: 900px; }

.mp-team__rollen { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-team__summe { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 9px; padding: 0 10px; min-height: 36px; font: inherit; font-size: 14px; cursor: pointer; }
.mp-team__summe b { font-weight: 700; font-variant-numeric: tabular-nums; }

.mp-team__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mp-team__zeile { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--mp-line); }
.mp-team__profil { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.mp-team__rolle { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 0 9px; min-height: 30px; font-size: 14px; }
.mp-team__rolle.is-haupt { font-weight: 600; }
.mp-team__weg { display: inline-flex; border: 0; background: transparent; color: inherit; padding: 4px; margin-right: -5px; border-radius: 6px; cursor: pointer; opacity: .7; }
.mp-team__weg:hover { opacity: 1; }
.mp-team__plus, .mp-team__neu select { font: inherit; font-size: 14px; color: var(--mp-ink); background: transparent; border: 1px dashed var(--mp-line); border-radius: 8px; min-height: 30px; padding: 0 6px; max-width: 12rem; }
.mp-team__titel { flex-basis: 100%; min-width: 0; font: inherit; font-size: 13px; color: var(--mp-ink-2); background: transparent;
  border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin-left: -6px; }
/* Unterzeile editierbar: sieht aus wie Text, zeigt beim Zeigen/Fokus, dass man sie ändern kann */
.mp-team__titel:hover { border-color: var(--mp-line); }
.mp-team__titel:focus { outline: none; border-color: var(--mp-ink); color: var(--mp-ink); background: var(--mp-bg); }
.mp-team__titel::placeholder { color: var(--mp-ink-2); opacity: .6; font-style: italic; }
.mp-team__stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.mp-team__stepper button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--mp-line); background: transparent; color: var(--mp-ink); border-radius: 9px; cursor: pointer; }
.mp-team__stepper output { min-width: 2.6em; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-team__neu { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mp-ink-2); border-top: 1px solid var(--mp-line); padding-top: 10px; }
.mp-team button:focus-visible, .mp-team select:focus-visible { outline: 2px solid var(--focus, var(--mp-ink)); outline-offset: 1px; }

.mp-team [data-gruppe="pflicht"]  { background: var(--mp-pflicht-hell);  color: var(--mp-pflicht-dunkel); }
.mp-team [data-gruppe="frische"]  { background: var(--mp-frische-hell);  color: var(--mp-frische-dunkel); }
.mp-team [data-gruppe="genuss"]   { background: var(--mp-genuss-hell);   color: var(--mp-genuss-dunkel); }
.mp-team [data-gruppe="kulissen"] { background: var(--mp-kulissen-hell); color: var(--mp-kulissen-dunkel); }
.mp-team [data-gruppe="aussen"]   { background: var(--mp-aussen-hell);   color: var(--mp-aussen-dunkel); }
.mp-team .mp-team__rolle.is-haupt[data-gruppe="pflicht"]  { background: var(--mp-pflicht-dunkel); color: #fff; }
.mp-team .mp-team__rolle.is-haupt[data-gruppe="frische"]  { background: var(--mp-frische);  color: #fff; }
.mp-team .mp-team__rolle.is-haupt[data-gruppe="genuss"]   { background: var(--mp-genuss);   color: #fff; }
.mp-team .mp-team__rolle.is-haupt[data-gruppe="kulissen"] { background: var(--mp-kulissen); color: #fff; }
.mp-team .mp-team__rolle.is-haupt[data-gruppe="aussen"]   { background: var(--mp-aussen);   color: #fff; }
:root[data-theme="dark"] .mp-team [data-gruppe]:not(.is-haupt) { background: rgba(255,255,255,.07); color: var(--text, #E6E6E6); }
:root[data-theme="dark"] .mp-team .mp-team__rolle.is-haupt[data-gruppe="pflicht"] { background: #5F5E5A; }

@media (max-width: 560px) {
  .mp-team { padding: 12px 14px; }
  .mp-team__zeile { flex-wrap: wrap; }
  .mp-team__stepper { margin-left: auto; }
  .mp-team__knopf { margin-left: 0; }
}

/* Kopfzahl im Kopf eines Schaufensters (aus „Ihr Team“) */
.mp-fenster-team { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; margin: 0; justify-self: start; font-size: 15px; color: var(--text-muted, #5F5E5A); }
.mp-fenster-team .mp__sym { width: 18px; height: 18px; flex: none; }
.mp-fenster-team b { color: var(--text-strong, #2C2C2A); font-variant-numeric: tabular-nums; }
