@font-face { font-family: 'DM Sans'; src: url(fonts/dmsans.woff2) format('woff2'); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root, [data-theme=light] {
  --teal: #12333A; --paper: #F6F1E7; --card: #FFFDF8; --ink: #12333A; --muted: #4F6468; --line: #E2DACB;
  --green: #2A7F76; --green-ink: #fff; --orange: #B54C22; --orange-bg: #FBE9DF; --yellow: #F4C542; --yellow-ink: #5A4300;
  --bubble-me: #12333A; --bubble-me-ink: #F6F1E7; --bubble-k: #FFFDF8; --soft: #EFE8DA; --warn: #8A2A0E; --warn-bg: #FDE4D8;
  color-scheme: light;
}
[data-theme=dark] {
  --teal: #0E2328; --paper: #0E2328; --card: #16343A; --ink: #F1EBDF; --muted: #A9BDBF; --line: #24474E;
  --green: #3FA79C; --green-ink: #06201D; --orange: #F08A5D; --orange-bg: #3A2418; --yellow: #F4C542; --yellow-ink: #F4C542;
  --bubble-me: #2A7F76; --bubble-me-ink: #fff; --bubble-k: #16343A; --soft: #1B3D43; --warn: #FFB59A; --warn-bg: #3A2418;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); }
body { font: 16px/1.45 'DM Sans', system-ui, -apple-system, sans-serif; min-height: 100dvh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--green); overflow-wrap: anywhere; }
p { margin: .3em 0; }
button, input, textarea, select { font: inherit; font-size: 16px; color: inherit; }
input, textarea, select { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0; }
textarea { resize: none; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.subtle { color: var(--muted); font-size: .88rem; }
.hidden, [hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand .logo { font-size: 1.5rem; }
.brand .name { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.3rem; }
.tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.whochip { font-size: .85rem; padding: 4px 10px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.iconbtn { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.testbar { background: var(--yellow); color: #3B2C00; font-size: .85rem; padding: 6px 16px; text-align: center; }

main { padding: 14px 16px 20px; max-width: 640px; margin: 0 auto; }
main > * + * { margin-top: 14px; }

/* tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { border: 0; background: none; padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .82rem; color: var(--muted); cursor: pointer; position: relative; }
.tabs button span { font-size: 1.3rem; line-height: 1; }
.tabs button.on { color: var(--ink); font-weight: 700; }
.tabs button.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.badge { position: absolute; top: 4px; left: calc(50% + 10px); background: var(--orange); color: #fff; font-size: .72rem; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; display: grid; place-items: center; }

/* buttons */
.btn { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); min-height: 44px; }
.btn.go { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.btn.warn { color: var(--orange); border-color: var(--orange); }
.btn.small { padding: 6px 10px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; }
.card + .card { margin-top: 12px; }
.stack > * + * { margin-top: 12px; }

/* login */
.login { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.login .card { max-width: 380px; width: 100%; padding: 22px; }
.login .big { font-size: 3.4rem; }
.login form > * + * { margin-top: 10px; }
.err { color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 8px 10px; font-size: .92rem; }

/* sprechen */
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 99px; padding: 6px 12px; font-size: .9rem; max-width: 100%; }
.chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: 0 2px; color: var(--muted); }
.ctx { display: flex; gap: 8px; align-items: center; }
.ctx select { flex: 1; padding: 8px 10px; border-radius: 99px; }
.msgs { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 88%; border-radius: 18px; padding: 10px 13px; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg.me { align-self: flex-end; background: var(--bubble-me); color: var(--bubble-me-ink); border-bottom-right-radius: 6px; }
.msg.me a { color: inherit; }
.msg.k { align-self: flex-start; background: var(--bubble-k); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .who { display: block; font-size: .75rem; opacity: .75; margin-bottom: 2px; font-weight: 600; }
.msg.status { align-self: flex-start; background: none; border: 1px dashed var(--line); color: var(--muted); font-size: .9rem; }
.msg.blocked { align-self: stretch; max-width: 100%; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.msg .srcs { margin-top: 6px; font-size: .85rem; white-space: normal; }
.msg .srcs summary { cursor: pointer; color: var(--muted); }
.kcard { margin-top: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; white-space: normal; }
.kcard h4 { margin: 0 0 4px; font-size: .95rem; }
.kcard ol { margin: 4px 0 0; padding-left: 20px; }
.kcard.rule { border-color: var(--green); }
.kcard.gpt { border-color: var(--yellow); }
.kcard .state { font-weight: 700; color: var(--green); }
.composer { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--paper); padding: 10px 0 4px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: end; z-index: 10; }
.composer textarea { max-height: 140px; border-radius: 20px; }
.mic { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.micbig { width: 100%; border: 0; border-radius: 22px; background: var(--teal); color: #F6F1E7; padding: 14px; font-weight: 700; font-size: 1.05rem; cursor: pointer; display: flex; justify-content: center; gap: 10px; align-items: center; touch-action: none; user-select: none; -webkit-user-select: none; min-height: 56px; }
[data-theme=dark] .micbig { background: #24474E; }
.micbig.on { background: var(--orange); color: #fff; }
.micst { font-size: .88rem; color: var(--muted); min-height: 1.2em; text-align: center; }
.recdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #E0442A; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.attach { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 1.2rem; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--green); color: var(--green-ink); font-size: 1.2rem; cursor: pointer; }
.send:disabled { background: var(--line); color: var(--muted); }
.install { border-style: dashed; }

/* reisen */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.strip button { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px 6px; cursor: pointer; text-align: center; min-width: 0; }
.strip b { display: block; font-size: 1.4rem; font-family: 'Fraunces', serif; }
.strip small { display: block; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.strip .wait { border-color: var(--orange); background: var(--orange-bg); }
.strip .wait b, .strip .wait small { color: var(--orange); }
.hours { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trip { cursor: pointer; display: block; width: 100%; text-align: left; color: inherit; font: inherit; }
.trip .t1 { display: flex; gap: 10px; align-items: flex-start; }
.trip .em { font-size: 1.8rem; line-height: 1; }
.trip .tt { flex: 1; min-width: 0; }
.trip .tt h3 { margin: 0; overflow-wrap: anywhere; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.bar.y i { background: var(--yellow); }
.status { font-size: .88rem; color: var(--muted); }
.oline { color: var(--orange); font-weight: 600; font-size: .9rem; margin-top: 4px; }
details.arch > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.list li:first-child { border-top: 0; }
.list li > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* trip detail */
.back { border: 0; background: none; color: var(--green); font-weight: 600; padding: 4px 0; cursor: pointer; font-size: 1rem; }
.road { position: relative; display: flex; gap: 0; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; }
.road::-webkit-scrollbar { display: none; }
.leg { flex: 1 0 96px; text-align: center; position: relative; padding-top: 28px; min-width: 0; }
.leg::before { content: ''; position: absolute; top: 14px; left: 0; right: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px); }
.leg.fertig::before { background: var(--green); }
.leg .dot { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); }
.leg.fertig .dot { border-color: var(--green); background: var(--green); }
.leg.arbeit .dot { border-color: var(--yellow); }
.leg .car { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); font-size: 1.3rem; }
.leg b { display: block; font-size: .9rem; overflow-wrap: anywhere; }
.leg small { color: var(--muted); font-size: .78rem; }
.own { font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 2px 8px; white-space: nowrap; background: var(--soft); }
.own.ihr { background: var(--orange-bg); color: var(--orange); }
.td-ihr > div { color: var(--orange); font-weight: 600; }
.td-done > div { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.tick { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; font-size: .9rem; padding: 0; }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.tick.ro { cursor: default; border-style: dashed; }
.opt { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 10px; background: var(--card); min-width: 0; }
.opt.rec { border-color: var(--yellow); box-shadow: 0 0 0 2px color-mix(in srgb, var(--yellow) 30%, transparent); }
.opt.chosen { border-color: var(--green); }
.opt h4 { margin: 0 0 6px; font-size: 1rem; overflow-wrap: anywhere; }
.opt .star { color: var(--yellow-ink); background: color-mix(in srgb, var(--yellow) 35%, transparent); font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.opt dl { margin: 6px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .92rem; }
.opt dt { color: var(--muted); }
.opt dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.net { font-weight: 700; font-size: .8rem; padding: 1px 8px; border-radius: 99px; }
.net.belegt { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green); }
.net.nur { background: var(--orange-bg); color: var(--orange); }
.net.keine { background: var(--soft); color: var(--muted); }
.applied { font-size: .88rem; background: color-mix(in srgb, var(--green) 12%, transparent); border-radius: 10px; padding: 6px 10px; margin-top: 8px; }

/* über euch */
.mascot { display: flex; gap: 14px; align-items: center; }
.mascot .face { font-size: 3.2rem; line-height: 1; }
.stars { color: var(--yellow-ink); font-weight: 700; }
.fam summary { cursor: pointer; font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.02rem; padding: 4px 0; }
.fam .body { font-size: .94rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.fam .chg { background: color-mix(in srgb, var(--green) 12%, transparent); border-radius: 10px; padding: 6px 10px; margin: 6px 0; font-size: .92rem; }
.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line); border: 0; position: relative; cursor: pointer; flex: 0 0 46px; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--green); }
.switch.on::after { left: 21px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--teal); color: #F6F1E7; padding: 10px 16px; border-radius: 99px; z-index: 50; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
[data-theme=dark] .toast { background: var(--green); color: var(--green-ink); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
