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

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

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

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

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

/* ---- Raster / Heatmap ---- */
.ft-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.ft-grid {
  display: grid;
  min-width: max-content;
  gap: 4px;
  user-select: none; -webkit-user-select: none;
}
.ft-grid.is-editing { touch-action: none; } /* Drag-Paint soll nicht scrollen */
.ft-head, .ft-time { font-size: .8rem; font-weight: 600; color: var(--ft-muted); display: flex; align-items: center; }
.ft-head { justify-content: center; text-align: center; padding: 4px 2px; }
.ft-time { justify-content: flex-end; padding-right: 8px; white-space: nowrap; }
.ft-corner { }

.cell {
  height: 34px; min-width: 60px;
  border: 1px solid var(--ft-line);
  border-radius: 6px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: #fff; font-weight: 700;
  cursor: default;
}
.ft-grid.is-editing .cell { cursor: pointer; background: #fff; color: var(--ft-accent-dark); }
.ft-grid.is-editing .cell.sel { background: var(--ft-accent); border-color: var(--ft-accent-dark); color: #fff; }
.cell .ft-cellcount { pointer-events: none; }
.cell.is-best { outline: 2px solid var(--ft-amber); outline-offset: -2px; }
.cell.is-final { box-shadow: inset 0 0 0 3px var(--ft-amber); }
.ft-grid:not(.is-editing) .cell { cursor: help; }
.ft-grid.is-admin:not(.is-editing) .cell { cursor: pointer; }

.ft-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ft-muted); font-size: .82rem; margin-top: 12px; }
.ft-legend .sw { display: inline-block; width: 18px; height: 14px; border-radius: 4px; border: 1px solid var(--ft-line); vertical-align: middle; }
.ft-best { font-weight: 700; }
.ft-best .pin { color: var(--ft-amber); }

.ft-share { background: var(--ft-soft); border: 1px dashed var(--ft-line); border-radius: 10px; padding: 14px; margin: 6px 0; }
.ft-share .ft-row { align-items: center; }
.ft-share input { background: #fff; }

.ft-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 9px; font-size: .9rem; }
.ft-msg-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.ft-msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ft-note { color: var(--ft-muted); font-size: .85rem; }
.ft-final-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 14px; font-weight: 600; margin: 0 0 14px; }

@media (max-width: 560px) {
  .ft-card { padding: 16px; }
  .cell { min-width: 52px; height: 38px; }
}
