/* ===== Reiseplan, Formulare, Import ===== */
/* Kinder des scrollenden Sheet-Inhalts dürfen nicht zusammengedrückt werden */
.sheet-body > * { flex-shrink: 0; }
.block { display: block; }
.grow { flex: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.warn-text { color: var(--danger); }

.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .86rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row-start { justify-content: flex-start; }

.action-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scrollbar-width: none; }
.action-row::-webkit-scrollbar { display: none; }
.action-row .btn { flex: none; white-space: nowrap; }

.callout { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.callout-ok { background: color-mix(in srgb, var(--indigo) 12%, transparent); }
.callout-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--ink); }
.callout ul { margin: 0; padding-left: 18px; }

.empty { text-align: center; padding: 18px 8px; display: flex; flex-direction: column; gap: 6px; }
.empty-title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }

/* Tage */
.days { display: flex; flex-direction: column; gap: 10px; }
.day { border-radius: var(--radius); background: var(--surface-2); padding: 10px 12px 12px; scroll-margin-top: 8px; }
.day.is-today { outline: 2px solid var(--accent); }
.day.is-move { background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.day-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.day-date { font-weight: 700; font-size: .95rem; }
.day-items { display: flex; flex-direction: column; gap: 6px; }

.event, .night {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}
.event-kind { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); min-width: 72px; }
.event-leg .event-kind { color: var(--indigo); }
.event-main { font-weight: 500; flex: 1; min-width: 0; }
.night { align-items: center; background: transparent; padding: 4px 2px; }
.free-window { padding: 8px 10px; border-radius: 10px; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); font-size: .9rem; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot-hotel { background: var(--accent); }
.dot-place { background: var(--indigo); }
.dot-missing { background: transparent; border: 2px dashed var(--ink-2); }

/* Herkunft */
.origin { display: inline-block; font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.origin-structured, .origin-file { background: color-mix(in srgb, var(--indigo) 16%, transparent); color: var(--indigo); }
.origin-text { background: color-mix(in srgb, #C9A227 22%, transparent); color: var(--ink); }
.origin-ai { background: color-mix(in srgb, #8A5CF6 18%, transparent); color: var(--ink); }
.origin-ai::before { content: '✦ '; }
.origin.is-low { outline: 1.5px solid var(--danger); }
.event .origin { margin-left: 0; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.req { color: var(--accent); }
.field input, .field select, .field textarea, .paste {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 46px;
  width: 100%;
}
.field textarea, .paste { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .paste:focus { outline: none; border-color: var(--accent); }
.field.is-missing input, .field.is-missing select { border-color: var(--danger); }
.field-hint { font-size: .76rem; color: var(--ink-2); }
.field-hint.is-error { color: var(--danger); font-weight: 600; }
.field-row { display: flex; gap: 10px; }
.field-row > .field:last-child:not(:first-child) { flex: 0 0 38%; }

.coords { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.coord-status { font-size: .86rem; }
.coord-status.is-missing { color: var(--danger); }
.geo-results { display: flex; flex-direction: column; gap: 4px; }
.geo-result { display: flex; flex-direction: column; text-align: left; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: .88rem; }
.attribution { font-size: .72rem; color: var(--ink-2); }

/* Import */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 22px 14px; border-radius: var(--radius); border: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft); cursor: pointer;
}
.drop-title { font-weight: 700; color: var(--accent); font-size: 1.05rem; }
.or { text-align: center; font-size: .8rem; color: var(--ink-2); }
.help summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.help ul { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.busy { display: flex; align-items: center; gap: 12px; padding: 18px 0; color: var(--ink-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card { border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); }
.card.has-errors { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.card.is-excluded { opacity: .6; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.card.is-excluded .card-head { border-bottom: 0; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.evidence summary { font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.evidence ul { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; color: var(--ink-2); }
.ai-card { padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid color-mix(in srgb, #8A5CF6 40%, transparent); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ai-title { font-weight: 600; }
.sticky-actions { position: sticky; bottom: calc(-24px - var(--safe-bottom)); background: var(--surface); padding: 10px 0 calc(10px + var(--safe-bottom)); margin-bottom: calc(-24px - var(--safe-bottom)); border-top: 1px solid var(--line); }

/* Positionswahl auf der Karte */
.picker { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.picker-cross {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%);
  background:
    linear-gradient(var(--accent), var(--accent)) center / 2px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat;
  filter: drop-shadow(0 0 2px var(--surface)) drop-shadow(0 0 2px var(--surface));
}
.picker-cross::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.picker-bar {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  padding: 14px; border-radius: var(--radius); pointer-events: auto; display: flex; flex-direction: column; gap: 6px;
}
.picker-title { font-weight: 700; }
body.picking .map-controls, body.picking .map-status { visibility: hidden; }

/* ===== Reiseunterlagen importieren ===== */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px; min-height: 104px; border-radius: var(--radius); background: var(--surface-2);
  border: 1.5px solid var(--line); cursor: pointer;
}
.tile:first-child { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tile:active { transform: scale(.98); }
.tile-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }
.tile-title { font-weight: 700; }
.tile-sub { font-size: .78rem; color: var(--ink-2); }
.paste-box { display: flex; flex-direction: column; gap: 8px; }
.btn-block { width: 100%; }
.folder { display: flex; flex-direction: column; gap: 10px; }
.folder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.folder-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; background: var(--surface-2); }
.folder-thumb { width: 48px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface); }
.folder-thumb-doc { display: grid; place-items: center; font-size: 1.4rem; }
.folder-name { flex: 1; min-width: 0; overflow: hidden; }
.folder-name .block { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.doc-chip { margin: 0; flex: none; width: 72px; text-align: center; font-size: .72rem; color: var(--ink-2); }
.doc-chip img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 2px; }
.field-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.conflict { border: 1.5px solid var(--danger); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: color-mix(in srgb, var(--danger) 7%, transparent); }
.conflict-title { font-size: .82rem; font-weight: 700; color: var(--danger); }
.conflict-option { text-align: left; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.card-unassigned { border-style: dashed; }
.card-unassigned select { font: inherit; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.card-unassigned ul { margin: 0; padding-left: 18px; }
.origin-ocr { background: color-mix(in srgb, #C9A227 22%, transparent); color: var(--ink); }
.origin-merged { background: color-mix(in srgb, #2E8B57 20%, transparent); color: var(--ink); }
.origin-translated { background: color-mix(in srgb, #8A5CF6 12%, transparent); color: var(--ink); }
.origin-derived { background: var(--line); }
