/* Reise-App – Gestaltung abgeleitet von anlageplan_thailand.html:
   Grün/Beige/Creme, weisse Karten mit feinen Linien, Pills/Tags, ruhige Typografie. */
:root {
  --beige: #E8DCCB; --gruen: #4E6A57; --gruen-dunkel: #3B5143; --gruen-tief: #2F4238;
  --creme: #F5EFE6; --karte: #FFFFFF; --text: #2E2A24; --muted: #6B6459; --linie: #E3D9C8;
  --flaeche: #F7F3EA; --warn: #A8724A; --neg: #9C4A3A; --akzent: #C9A87C;
  --radius: 12px; --tabbar: 58px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--creme); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.45; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }   /* Standardgrösse aller Icons */
a { color: var(--gruen-dunkel); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 13px; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Grundgerüst */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh;
  padding: 0 0 calc(var(--tabbar) + var(--safe-bottom) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(245, 239, 230, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
  padding: calc(var(--safe-top) + 8px) 12px 8px; display: flex; align-items: center; gap: 6px; min-height: 52px;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; color: var(--gruen-dunkel);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.big h1 { font-size: 26px; }
.iconbtn { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--gruen-dunkel); cursor: pointer; flex: none; }
.iconbtn:active { background: var(--beige); }
.iconbtn svg, .btn svg, .row svg, .tab svg { width: 22px; height: 22px; }
main { padding: 12px 14px; }
h2.section { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin: 22px 4px 8px; font-weight: 600; }
h2.section:first-child { margin-top: 6px; }

/* ---------- Tabbar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(245, 239, 230, .97);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--linie);
  padding-bottom: var(--safe-bottom); }
.tabbar .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab { height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tab.active { color: var(--gruen-dunkel); font-weight: 700; }
.tab.active svg { stroke-width: 2.2; }

/* ---------- Karten */
.card { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px;
  margin: 10px 0; box-shadow: 0 1px 3px rgba(60, 50, 30, .05); }
.card.tight { padding: 4px 0; }
.card h3 { margin: 0 0 6px; font-size: 17px; color: var(--gruen-dunkel); }

/* Hero (aktuelle Buchung) – grüner Verlauf wie in der Vorlage */
.hero { background: linear-gradient(135deg, #4E6A57 0%, #3B5143 60%, #2F4238 100%); color: #F5EFE6;
  border-radius: 14px; padding: 16px 16px 14px; margin: 10px 0; }
.hero .kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--beige); opacity: .95;
  display: flex; align-items: center; gap: 6px; }
.hero .kicker svg { width: 16px; height: 16px; }
.hero h3 { font-size: 22px; line-height: 1.2; margin: 6px 0 4px; font-weight: 600; color: #fff; }
.hero .when { font-size: 15px; opacity: .92; }
.hero .addr { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; opacity: .9; margin-top: 8px;
  color: #F5EFE6; text-decoration: none; }
.hero .addr svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.refbox { margin-top: 12px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px; padding: 8px 10px 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.refbox .l { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.refbox .v { font-size: 22px; font-weight: 700; letter-spacing: .04em; color: #fff; word-break: break-all; }
.refbox .grow { flex: 1; min-width: 0; }
.refbox svg { width: 20px; height: 20px; opacity: .85; }
.hero .actions { display: flex; gap: 8px; margin-top: 12px; }
.hero .btn.primary { background: #F5EFE6; color: var(--gruen-tief); }
.hero .btn.ghost { background: transparent; color: #F5EFE6; border-color: rgba(255, 255, 255, .35); }

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--linie); background: var(--karte);
  color: var(--gruen-dunkel); font-weight: 600; text-decoration: none; cursor: pointer; font-size: 16px; }
.btn.primary { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.grow { flex: 1; }
.btn.danger { color: var(--neg); }
.btn:active { filter: brightness(.95); }
.btn[disabled] { opacity: .5; }
.btnrow { display: flex; gap: 8px; margin: 10px 0; }

/* ---------- Zeilen (Listen) */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; text-decoration: none;
  color: inherit; border-top: 1px solid var(--linie); cursor: pointer; background: none; width: 100%;
  border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.card.tight > .row:first-child, .card.tight > :first-child .row { border-top: 0; }
.row:active { background: var(--flaeche); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { white-space: pre-line; overflow-wrap: anywhere; }
.row .lbl { font-size: 12.5px; color: var(--muted); }
.row .end { color: var(--muted); flex: none; display: flex; align-items: center; gap: 4px; font-size: 13px; }
.row .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche); color: var(--gruen-dunkel);
  display: flex; align-items: center; justify-content: center; flex: none; }
.row .ico svg { width: 20px; height: 20px; }
.row.past { opacity: .62; }
.datebadge { width: 46px; flex: none; text-align: center; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 10px; padding: 4px 0; line-height: 1.1; }
.datebadge .d { font-size: 19px; font-weight: 700; color: var(--gruen-dunkel); }
.datebadge .m { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.agenda .time { width: 50px; flex: none; font-weight: 700; color: var(--gruen-dunkel); font-variant-numeric: tabular-nums; }

/* ---------- Tags / Pills */
.tag { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600;
  letter-spacing: .02em; white-space: nowrap; background: var(--beige); color: var(--gruen-dunkel); vertical-align: middle; }
.tag.gut { background: #E4EFE6; color: var(--gruen); }
.tag.mittel { background: #F4EAD6; color: #8a6a2f; }
.tag.schlecht { background: #F3E2DE; color: var(--neg); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.offdot { width: 8px; height: 8px; border-radius: 50%; background: var(--gruen); display: inline-block; }
.offdot.no { background: transparent; border: 1.5px solid var(--akzent); }

/* ---------- Sync-Chip */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 10px; border-radius: 999px;
  background: var(--karte); border: 1px solid var(--linie); color: var(--muted); cursor: pointer; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gruen); }
.chip.off .dot { background: var(--akzent); }
.chip.err .dot { background: var(--neg); }
.chip.busy .dot { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 1 } to { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .chip.busy .dot { animation: none; } }

/* ---------- Suche */
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--karte); border: 1px solid var(--linie);
  border-radius: 12px; padding: 0 12px; min-height: 46px; color: var(--muted); text-decoration: none; }
.searchbar input { border: 0; outline: 0; background: transparent; flex: 1; min-height: 44px; font-size: 16px; color: var(--text); }
.searchbar svg { width: 20px; height: 20px; flex: none; }
mark { background: #F4EAD6; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Detail */
.facts .row { cursor: default; }
.facts .row[data-copy] { cursor: pointer; }
.bigref { font-size: 24px; font-weight: 700; color: var(--gruen-dunkel); letter-spacing: .04em; overflow-wrap: anywhere; }
.kv-actions { display: flex; gap: 2px; }
.history { font-size: 14px; }
.history .h { padding: 8px 16px; border-top: 1px solid var(--linie); }
.history .h:first-child { border-top: 0; }
details.card > summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--gruen-dunkel); padding: 2px 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 8px; }

/* ---------- Viewer */
.viewer { position: fixed; inset: 0; z-index: 50; background: #3a3631; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.viewer .vbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-top) + 6px) 8px 6px; background: rgba(46, 42, 36, .94); color: #fff; }
.viewer .vbar .iconbtn { color: #fff; }
.viewer .vbar .iconbtn:active { background: rgba(255, 255, 255, .15); }
.viewer .vbar .name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .pages { padding: 8px 8px calc(var(--safe-bottom) + 24px); display: flex; flex-direction: column; gap: 8px; }
.viewer .pages img { width: 100%; height: auto; background: #fff; border-radius: 4px; display: block; }
.viewer .textdoc { background: #fff; color: var(--text); border-radius: 8px; padding: 16px; white-space: pre-wrap;
  overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.viewer .msg { color: #F5EFE6; text-align: center; padding: 48px 20px; }
.viewer.light { background: #fff; }
.viewer.light .pages { align-items: center; justify-content: center; min-height: 70vh; }
.viewer.light .pages img { max-width: min(92vw, 520px); }

/* QR-Vollbild */
.qrfull { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center; }
.qrfull img { width: min(86vw, 70vh, 460px); height: auto; image-rendering: pixelated; }
.qrfull .label { font-size: 22px; font-weight: 700; color: var(--gruen-dunkel); margin-top: 16px; }
.qrfull .val { font-size: 14px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.qrgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qrtile { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; padding: 10px 8px 8px;
  text-align: center; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gruen-dunkel); }
.qrtile img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; margin-bottom: 6px; }
.qrtile .ph { width: 100%; aspect-ratio: 1; background: var(--flaeche); border-radius: 6px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; font-weight: 400; }

/* ---------- Formulare */
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--gruen-dunkel); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid var(--linie);
  border-radius: 10px; padding: 10px 12px; background: var(--karte); font-size: 16px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--akzent); border-color: var(--akzent); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--beige); padding: 4px; border-radius: 11px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg button { border: 0; background: transparent; min-height: 38px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--gruen-dunkel); cursor: pointer; }
.seg button.on { background: var(--karte); box-shadow: 0 1px 2px rgba(60, 50, 30, .12); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field input[type=datetime-local] { min-width: 0; -webkit-appearance: none; appearance: none; }
.grid2 .field { margin: 6px 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.switch input { width: 50px; height: 30px; accent-color: var(--gruen); }

/* ---------- Hinweise */
.note { background: #FBF4E8; border: 1px solid var(--akzent); border-radius: 10px; padding: 12px 14px; font-size: 14px;
  color: #5b4630; margin: 10px 0; }
.note svg { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.note.ok { background: #EEF4EF; border-color: #B9CDBE; color: var(--gruen-dunkel); }
.note.err { background: #F8ECE9; border-color: #DDB3A9; color: var(--neg); }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.empty svg { width: 34px; height: 34px; opacity: .6; }

/* ---------- Toast & Sheet */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px);
  z-index: 80; background: var(--gruen-tief); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(46, 42, 36, .45); display: flex; align-items: flex-end;
  justify-content: center; }
.sheet { background: var(--creme); width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(var(--safe-bottom) + 16px); max-height: 92vh; overflow-y: auto; }
.sheet h3 { margin: 4px 0 10px; color: var(--gruen-dunkel); }

/* ---------- Tresor */
.vault-locked { text-align: center; padding: 18px 16px; }
.vault-locked svg { width: 34px; height: 34px; color: var(--gruen); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 12px; }
.thumbs img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linie); cursor: pointer; }

/* Pairing / Vollbildseiten */
.center-page { padding: calc(var(--safe-top) + 40px) 20px 40px; max-width: 460px; margin: 0 auto; }
.center-page h1 { color: var(--gruen-dunkel); font-size: 26px; }
.codeinput { font-size: 26px !important; text-align: center; letter-spacing: .2em; text-transform: uppercase; }

@media (min-width: 600px) {
  .topbar { border-left: 1px solid var(--linie); border-right: 1px solid var(--linie); }
}
