/* FL Doodle — Frontend (buildless Vanilla). Gescopet unter .fldoodle-app. */
.fldoodle-app {
  --fd-accent: #2563eb;
  --fd-accent-dark: #1d4ed8;
  --fd-amber: #f59e0b;
  --fd-green: #16a34a;
  --fd-ink: #1f2937;
  --fd-muted: #6b7280;
  --fd-line: #e5e7eb;
  --fd-soft: #f9fafb;
  color: var(--fd-ink);
  max-width: 1000px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.fldoodle-app * { box-sizing: border-box; }

.fd-card { background: #fff; border: 1px solid var(--fd-line); border-radius: 14px; padding: 20px; margin: 0 0 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.fd-h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.fd-sub { color: var(--fd-muted); margin: 0 0 16px; }

.fd-field { margin: 0 0 14px; }
.fd-label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 5px; }
.fd-hint { color: var(--fd-muted); font-size: .82rem; margin: 4px 0 0; display: block; }
.fd-input { width: 100%; padding: 10px 12px; border: 1px solid var(--fd-line); border-radius: 9px; font: inherit; color: inherit; background: #fff; }
.fd-input:focus { outline: 2px solid var(--fd-accent); border-color: var(--fd-accent); }
.fd-row { display: flex; gap: 12px; flex-wrap: wrap; }
.fd-row > * { flex: 1 1 140px; }

.fd-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--fd-line); border-radius: 9px; background: #fff; color: var(--fd-ink); font: inherit; font-weight: 600; cursor: pointer; }
.fd-btn:hover { background: var(--fd-soft); }
.fd-btn-primary { background: var(--fd-accent); border-color: var(--fd-accent); color: #fff; }
.fd-btn-primary:hover { background: var(--fd-accent-dark); }
.fd-btn[disabled] { opacity: .5; cursor: default; }
.fd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.fd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.fd-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--fd-soft); border: 1px solid var(--fd-line); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: .9rem; }
.fd-chip button { border: 0; background: #e5e7eb; color: #374151; border-radius: 999px; width: 22px; height: 22px; cursor: pointer; font-size: 14px; line-height: 1; }
.fd-chip button:hover { background: #d1d5db; }
.fd-note { color: var(--fd-muted); font-size: .85rem; }

.fd-best { font-weight: 700; }
.fd-best .pin { color: var(--fd-amber); }
.fd-final-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 14px; font-weight: 600; margin: 0 0 14px; }

/* ---- Auswertungstabelle ---- */
.fd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.fd-table { display: grid; min-width: max-content; gap: 4px; }
.fd-corner { }
.fd-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px 4px; font-size: .8rem; font-weight: 700; border-radius: 8px 8px 0 0; background: var(--fd-soft); border: 1px solid var(--fd-line); }
.fd-opt .t { font-weight: 600; color: var(--fd-muted); }
.fd-opt.best { background: #eff6ff; border-color: #bfdbfe; }
.fd-opt.final { box-shadow: inset 0 0 0 2px var(--fd-amber); }
.fd-table.is-admin .fd-opt { cursor: pointer; }
.fd-table.is-admin .fd-opt:hover { background: #e0e7ff; }

.fd-who { display: flex; align-items: center; padding: 4px 8px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.fd-cell { height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 700; border: 1px solid var(--fd-line); }
.fd-cell.v-yes { background: #dcfce7; color: var(--fd-green); border-color: #bbf7d0; }
.fd-cell.v-if  { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.fd-cell.v-no  { background: #fff; color: #d1d5db; }
.fd-cell.final { box-shadow: inset 0 0 0 2px var(--fd-amber); }

.fd-sum-label { display: flex; align-items: center; padding: 4px 8px; font-size: .82rem; color: var(--fd-muted); font-weight: 600; }
.fd-sum { display: flex; align-items: center; justify-content: center; padding: 4px; font-weight: 700; }
.fd-sum.best { color: var(--fd-accent-dark); }
.fd-sum.muted { color: var(--fd-muted); font-weight: 600; }

.fd-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--fd-muted); font-size: .82rem; margin-top: 12px; }
.fd-legend .sw { display: inline-block; width: 18px; height: 14px; border-radius: 4px; border: 1px solid var(--fd-line); }
.fd-legend .sw.v-yes { background: #dcfce7; border-color: #bbf7d0; }
.fd-legend .sw.v-if { background: #fef3c7; border-color: #fde68a; }
.fd-legend .sw.v-no { background: #fff; }

/* ---- Stimm-Editor: 3-Zustand-Segmented-Control ---- */
.fd-vote-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.fd-vote-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--fd-line); border-radius: 10px; background: var(--fd-soft); flex-wrap: wrap; }
.fd-vote-opt { font-size: .95rem; }
.fd-seg { display: inline-flex; border: 1px solid var(--fd-line); border-radius: 9px; overflow: hidden; background: #fff; }
.fd-seg-btn { border: 0; background: #fff; color: var(--fd-muted); font: inherit; font-weight: 600; padding: 8px 12px; cursor: pointer; border-left: 1px solid var(--fd-line); white-space: nowrap; }
.fd-seg-btn:first-child { border-left: 0; }
.fd-seg-btn.seg-yes.active { background: var(--fd-green); color: #fff; }
.fd-seg-btn.seg-if.active  { background: var(--fd-amber); color: #fff; }
.fd-seg-btn.seg-no.active  { background: #9ca3af; color: #fff; }

.fd-share { background: var(--fd-soft); border: 1px dashed var(--fd-line); border-radius: 10px; padding: 14px; margin: 6px 0; }
.fd-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 9px; font-size: .9rem; }
.fd-msg-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.fd-msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

@media (max-width: 560px) {
  .fd-card { padding: 16px; }
  .fd-vote-row { flex-direction: column; align-items: stretch; }
  .fd-seg { width: 100%; }
  .fd-seg-btn { flex: 1 1 0; text-align: center; }
}
