/* ============================================================================
   PULS — App-Styles, aufbauend auf corporate-design-system.css
   Regeln: Weiß dominiert · Rot nur als Akzent · Balken in Bordeaux ·
   Radius max. 2px · keine Verläufe/3D · linksbündig · kein ALL-CAPS
   ============================================================================ */

html { height: 100%; }
body { min-height: 100%; display: flex; flex-direction: column; }

main { flex: 1; width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container.narrow { max-width: 640px; }

/* --- Header-Ergänzungen ---------------------------------------------------- */
.ds-header { position: sticky; top: 0; z-index: 10; }
.ds-header a.brand { color: var(--black); text-decoration: none; }
.ds-header a.brand:hover { text-decoration: none; color: var(--black); }

.lang-toggle { display: inline-flex; border: 1px solid var(--grey-2); border-radius: var(--radius); overflow: hidden; }
.lang-toggle button {
  display: flex; align-items: center;
  padding: 0.3rem 0.4rem; background: var(--white);
  border: none; cursor: pointer; opacity: 0.55; line-height: 0;
}
.lang-toggle button svg { display: block; border-radius: 1px; }
.lang-toggle button + button { border-left: 1px solid var(--grey-2); }
.lang-toggle button:hover { opacity: 0.8; }
.lang-toggle button.active { opacity: 1; background: var(--surface); box-shadow: inset 0 -2px 0 var(--primary); }

/* --- Formulare ------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: 0.8rem; font-weight: 600; color: var(--grey-5);
  margin-bottom: 0.3rem;
}
.field input[type="text"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%; padding: 0.5rem 0.65rem; font-family: var(--font-sans);
  font-size: 0.9rem; color: var(--grey-6); background: var(--white);
  border: 1px solid var(--grey-2); border-radius: var(--radius);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary);
}
.field .help { font-size: 0.7rem; color: var(--grey-4); margin-top: 0.25rem; }

.ds-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ds-btn-lg { font-size: 0.95rem; padding: 0.65rem 1.4rem; }
.ds-btn-danger { background: var(--white); border-color: var(--grey-1); color: var(--danger); }
.ds-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* --- Startseite ------------------------------------------------------------ */
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: 2.5rem; font-weight: 300; color: var(--black); line-height: 1.15; }
.hero h1 b { font-weight: 600; }
.hero p { font-size: 0.95rem; color: var(--grey-4); margin-top: 0.5rem; max-width: 42rem; }

.landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 2rem; }
@media (max-width: 760px) { .landing-grid { grid-template-columns: 1fr; } }

.code-input {
  width: 100%; font-family: var(--font-sans); font-size: 2rem; font-weight: 300;
  letter-spacing: 0.35em; text-align: center; padding: 0.6rem 0.25rem;
  color: var(--black); background: var(--white);
  border: 1px solid var(--grey-2); border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
.code-input:focus { outline: none; border-color: var(--primary); }

.my-presentations .item {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--surface);
}
.my-presentations .item:last-child { border-bottom: none; }
.my-presentations .item .t { font-size: 0.9rem; color: var(--grey-6); font-weight: 600; }
.my-presentations .item .c { font-size: 0.75rem; color: var(--grey-4); font-variant-numeric: tabular-nums; }

.error-note { color: var(--danger); font-size: 0.8rem; margin-top: 0.5rem; min-height: 1.2em; }

/* --- Presenter: Editor ------------------------------------------------------ */
.editor-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 1.25rem;
  align-items: start; padding: 1.25rem 0 2rem;
}
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } }

.slide-list { display: flex; flex-direction: column; gap: 0.4rem; }
.slide-item {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--grey-1); border-radius: var(--radius);
  padding: 0.55rem 0.7rem; cursor: pointer; font-family: var(--font-sans);
}
.slide-item:hover { background: var(--surface); }
.slide-item.active { border-color: var(--primary); border-left: 3px solid var(--primary); }
.slide-item .num { font-size: 0.75rem; color: var(--grey-4); min-width: 1.2em; font-variant-numeric: tabular-nums; }
.slide-item .meta { overflow: hidden; }
.slide-item .q {
  font-size: 0.82rem; font-weight: 600; color: var(--grey-6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slide-item .ty { font-size: 0.68rem; color: var(--grey-4); }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.editor-toolbar .spacer { flex: 1; }

.option-row { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.option-row input { flex: 1; }
.option-row .ds-btn { padding: 0.3rem 0.6rem; }

.save-state { font-size: 0.75rem; color: var(--grey-4); }
.save-state.saved { color: var(--success); }

.join-info-card { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.join-info-card .qr { flex-shrink: 0; }
.join-code-big {
  font-size: 2.6rem; font-weight: 300; color: var(--black);
  font-variant-numeric: tabular-nums; letter-spacing: 0.08em; line-height: 1.1;
}
.join-url { font-size: 0.85rem; color: var(--grey-4); }
.join-url b { color: var(--grey-6); }

/* --- Präsentationsmodus ----------------------------------------------------- */
.present-mode { position: fixed; inset: 0; background: var(--white); z-index: 100; display: flex; flex-direction: column; }
.present-mode[hidden] { display: none; }
.present-topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.8rem 2rem; border-bottom: 2px solid var(--primary); background: var(--white);
}
.present-topbar .join-line { font-size: 1rem; color: var(--grey-5); }
.present-topbar .join-line b { color: var(--black); font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
.present-topbar .audience-count { font-size: 0.85rem; color: var(--grey-4); font-variant-numeric: tabular-nums; }

.present-body { flex: 1; overflow: auto; padding: 2.5rem 4rem; display: flex; flex-direction: column; }
@media (max-width: 760px) { .present-body { padding: 1.5rem; } }
.present-question { font-size: 2.4rem; font-weight: 300; color: var(--black); line-height: 1.2; margin-bottom: 2rem; }
.present-results { flex: 1; }
.present-results .barchart { max-width: 900px; }

.present-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.7rem 2rem; border-top: 1px solid var(--grey-1); background: var(--bg);
}
.present-footer .nav { display: flex; gap: 0.5rem; align-items: center; }
.present-footer .pos { font-size: 0.85rem; color: var(--grey-4); font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: center; }
.present-footer .hints { font-size: 0.72rem; color: var(--grey-4); }
.present-footer .qr-small svg { display: block; }

/* --- Publikum (Abstimmen) ---------------------------------------------------- */
.vote-shell { max-width: 560px; margin: 0 auto; padding: 1.25rem 1rem 3rem; width: 100%; }
.vote-topline {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-bottom: 0.6rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--grey-1);
}
.vote-topline .pt { font-size: 0.8rem; color: var(--grey-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-topline .pos { font-size: 0.75rem; color: var(--grey-4); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.vote-question { font-size: 1.35rem; font-weight: 600; color: var(--black); line-height: 1.3; margin-bottom: 1.25rem; }

.vote-options { display: flex; flex-direction: column; gap: 0.5rem; }
.vote-option {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: left;
  font-family: var(--font-sans); font-size: 0.95rem; color: var(--grey-6);
  background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius);
  padding: 0.8rem 0.9rem; cursor: pointer;
}
.vote-option:hover { border-color: var(--grey-4); }
.vote-option.selected { border-color: var(--primary); border-left: 3px solid var(--primary); background: var(--surface-alt); }
.vote-option .mark {
  width: 16px; height: 16px; border: 1px solid var(--grey-3); border-radius: 50%;
  flex-shrink: 0; position: relative;
}
.vote-option.multi .mark { border-radius: var(--radius); }
.vote-option.selected .mark { border-color: var(--primary); }
.vote-option.selected .mark::after {
  content: ''; position: absolute; inset: 3px; background: var(--primary);
  border-radius: inherit;
}

.scale-picker { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.scale-btn {
  min-width: 46px; padding: 0.7rem 0; text-align: center; font-family: var(--font-sans);
  font-size: 1.05rem; font-weight: 300; color: var(--grey-6);
  background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--radius); cursor: pointer;
  font-variant-numeric: tabular-nums; flex: 1;
}
.scale-btn:hover { border-color: var(--grey-4); }
.scale-btn.selected { background: var(--primary); border-color: var(--primary); color: var(--white); }
.scale-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--grey-4); margin-top: 0.4rem; }

.vote-submitted {
  border-left: 3px solid var(--success); background: var(--success-bg);
  padding: 0.7rem 0.9rem; font-size: 0.85rem; color: var(--grey-6); margin-top: 1rem;
  border-radius: var(--radius);
}
.vote-locked {
  border-left: 3px solid var(--warning); background: var(--warning-bg);
  padding: 0.7rem 0.9rem; font-size: 0.85rem; color: var(--grey-6); margin-bottom: 1rem;
  border-radius: var(--radius);
}
.vote-waiting { text-align: center; padding: 4rem 1rem; color: var(--grey-4); }
.vote-waiting .ds-spinner { margin: 0 auto 1rem; }

.vote-results-block { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--grey-1); }
.vote-results-block h3 { font-size: 0.85rem; font-weight: 600; color: var(--grey-5); margin-bottom: 0.75rem; }

/* --- Balkendiagramm (einfarbig Bordeaux, Führender in Rot, 1px schwarze Achse) */
.barchart { display: flex; flex-direction: column; gap: 0.65rem; border-left: 1px solid var(--black); padding-left: 0.9rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 80px; gap: 0.8rem; align-items: center; }
@media (max-width: 640px) { .bar-row { grid-template-columns: minmax(70px, 120px) 1fr 66px; gap: 0.5rem; } }
.bar-label { font-size: 0.9rem; color: var(--grey-6); overflow-wrap: anywhere; }
.bar-track { background: var(--surface); border-radius: 0; height: 1.7rem; position: relative; }
.bar-fill { height: 100%; background: var(--bordeaux-2); transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-fill.leader { background: var(--primary); }
.bar-value { font-size: 0.95rem; font-weight: 600; color: var(--black); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-pct { font-weight: 400; color: var(--grey-4); font-size: 0.78rem; margin-left: 0.4em; }

.present-results .bar-label { font-size: 1.15rem; }
.present-results .bar-track { height: 2.4rem; }
.present-results .bar-value { font-size: 1.3rem; }

/* --- Wortwolke ---------------------------------------------------------------- */
.wordcloud {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center;
  gap: 0.5rem 1.1rem; padding: 1.5rem 0; max-width: 900px; margin: 0 auto;
}
.cloud-word { line-height: 1.15; font-weight: 600; }

/* --- Antwort-Wand ------------------------------------------------------------- */
.answer-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem; }
.answer-card {
  background: var(--white); border: 1px solid var(--grey-1); border-left: 3px solid var(--grey-3);
  border-radius: var(--radius); padding: 0.7rem 0.85rem; font-size: 0.9rem; color: var(--grey-6);
  overflow-wrap: anywhere;
}
.present-results .answer-card { font-size: 1.05rem; }

/* --- Skala-Ergebnis ------------------------------------------------------------ */
.scale-result { max-width: 620px; }
.scale-avg { margin-bottom: 1.5rem; }
.scale-avg-value { font-size: 3.2rem; font-weight: 300; color: var(--black); line-height: 1; font-variant-numeric: tabular-nums; }
.scale-avg-label { font-size: 0.8rem; color: var(--grey-4); margin-top: 0.3rem; }
.scale-dist {
  display: flex; gap: 0.5rem; align-items: stretch; height: 140px;
  border-bottom: 1px solid var(--black); /* 1px schwarze Grundlinie */
}
.scale-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.scale-col-count { font-size: 0.75rem; color: var(--black); text-align: center; font-variant-numeric: tabular-nums; min-height: 1.1em; }
.scale-col-track { flex: 1; display: flex; align-items: flex-end; }
.scale-col-fill { width: 100%; background: var(--bordeaux-2); transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.scale-col-label { font-size: 0.78rem; color: var(--grey-5); text-align: center; padding-top: 0.35rem; font-variant-numeric: tabular-nums; }
.scale-endlabels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--grey-4); margin-top: 0.4rem; }

/* --- Q&A ------------------------------------------------------------------------ */
.qa-list { display: flex; flex-direction: column; gap: 0.5rem; max-width: 720px; }
.qa-item {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--white); border: 1px solid var(--grey-1); border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
}
.qa-vote {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  font-family: var(--font-sans); background: var(--white); border: 1px solid var(--grey-2);
  border-radius: var(--radius); padding: 0.3rem 0.55rem; cursor: pointer; flex-shrink: 0;
  color: var(--grey-5);
}
.qa-vote:hover:not(:disabled) { border-color: var(--grey-4); }
.qa-vote.voted { border-color: var(--primary); color: var(--primary); }
.qa-vote:disabled { cursor: default; }
.qa-vote-count { font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.qa-vote-arrow { font-size: 0.6rem; }
.qa-text { font-size: 0.95rem; color: var(--grey-6); padding-top: 0.3rem; overflow-wrap: anywhere; }
.present-results .qa-text { font-size: 1.15rem; }

/* --- Infofolie ------------------------------------------------------------------- */
.info-text { font-size: 1.05rem; color: var(--grey-6); max-width: 46rem; line-height: 1.6; }
.present-results .info-text { font-size: 1.4rem; }

/* --- Diverses ---------------------------------------------------------------------- */
.results-meta { font-size: 0.75rem; color: var(--grey-4); margin-top: 1rem; }
.results-empty, .results-hidden { color: var(--grey-4); font-size: 0.95rem; padding: 2rem 0; }
.footer-note {
  padding: 1rem 1.5rem; font-size: 0.7rem; color: var(--grey-4);
  border-top: 1px solid var(--grey-1); margin-top: 2rem;
}
