/* Kundenbereich – warm, ruhig, wie ein Messenger. Admin nutzt weiter app.css. */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin-ext-wght.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin-wght.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  color-scheme: light;
  --bg: #FAF5EF;
  --surface: #FFFFFF;
  --sand: #F3EBE1;
  --ink: #221D19;
  --muted: #6E655C;
  --line: rgba(80, 55, 30, 0.12);
  --line-strong: rgba(80, 55, 30, 0.22);
  --orange: #F26240;
  --orange-text: #BF4026;
  --orange-deep: #A23520;
  --peach: #FDEBE3;
  --ok: #2D7A50;
  --ok-bg: #E6F3EA;
  --blue: #3A5FA8;
  --blue-bg: #EAF0FA;
  --amber: #8F5A00;
  --amber-bg: #FCF0D6;
  --err: #A3311F;
  --err-bg: #FCE9E5;
  --shadow: 0 1px 2px rgba(70, 45, 20, .06), 0 10px 28px -14px rgba(70, 45, 20, .22);
  --shadow-lift: 0 2px 4px rgba(70, 45, 20, .07), 0 18px 36px -16px rgba(70, 45, 20, .30);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #FBD3C4; color: var(--ink); }
a { color: var(--orange-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
textarea { caret-color: var(--orange); }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex-shrink: 0; display: block; }
.ico svg { width: 100%; height: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid rgba(242, 98, 64, .45); outline-offset: 2px; }

/* ---------- Kopf ---------- */
.top { padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); }
.top-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.top img { height: 24px; width: auto; display: block; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--peach); color: var(--orange-deep);
  display: grid; place-items: center; font-weight: 650; font-size: 15px; }
.who .name { font-size: 14px; line-height: 1.25; color: var(--muted); text-align: right; }
.who .name strong { display: block; color: var(--ink); font-weight: 600; }
.who button { background: none; border: 0; padding: 6px; margin: -6px -6px -6px 0; border-radius: 10px; color: var(--muted); cursor: pointer; }
.who button:hover { color: var(--ink); background: var(--sand); }

main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 18px 18px 56px; }

/* ---------- Typo ---------- */
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; font-weight: 680; text-wrap: balance; }
h2 { font-size: 19px; line-height: 1.3; margin: 40px 0 14px; font-weight: 650; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 28px; max-width: 52ch; }
.hint { font-size: 14.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; }
.narrow { max-width: 460px; margin: 5vh auto 0; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; padding: 13px 24px; min-height: 52px;
  background: var(--orange-text); color: #fff; font-weight: 620; font-size: 17px; cursor: pointer; text-decoration: none;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 6px 16px -8px rgba(191, 64, 38, .6);
}
.btn:hover { background: var(--orange-deep); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost:hover { background: var(--sand); }
.btn.quiet { background: transparent; color: var(--muted); box-shadow: none; min-height: 40px; padding: 8px 12px; font-size: 15px; }
.btn.quiet:hover { background: var(--sand); color: var(--ink); }
.btn.block { width: 100%; }
.btn .ico { width: 20px; height: 20px; }

.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px -8px; padding: 6px 10px 6px 8px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.back:hover { background: var(--sand); color: var(--ink); }
.back .ico { width: 18px; height: 18px; }

/* ---------- Formulare ---------- */
label, .label { display: block; font-weight: 600; margin: 0 0 8px; font-size: 16px; }
input[type=email], input[type=text], textarea, select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  padding: 14px 16px; font-size: 17px; transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: #8C8278; }
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(242, 98, 64, .16); }
.field { margin-bottom: 22px; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer; font-weight: 520; min-height: 54px; }
.select .ico { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); width: 20px; height: 20px; }

/* ---------- Hinweise ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 18px; font-size: 16px; line-height: 1.45; }
.notice .ico { margin-top: 1px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.info { background: var(--peach); color: var(--orange-deep); }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Anmeldung ---------- */
.login h1 { font-size: 28px; }
.ways { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 26px; padding: 0; list-style: none; }
.ways li { display: inline-flex; align-items: center; gap: 8px; background: var(--sand); border-radius: 999px; padding: 7px 14px 7px 10px; font-size: 15px; font-weight: 520; }
.ways .ico { width: 18px; height: 18px; color: var(--orange-text); }
.mailart { width: 64px; height: 64px; border-radius: 50%; background: var(--peach); color: var(--orange-text); display: grid; place-items: center; margin-bottom: 18px; }
.mailart .ico { width: 30px; height: 30px; }

/* ---------- Übersicht ---------- */
.hello { margin-bottom: 26px; }
.hello h1 { font-size: 34px; }
.hello .lead { margin-bottom: 0; }
.start {
  display: flex; align-items: center; gap: 18px; text-decoration: none; color: #fff;
  background: var(--orange-text); border-radius: var(--r-lg); padding: 22px 22px; margin-bottom: 18px;
  box-shadow: 0 14px 30px -16px rgba(191, 64, 38, .75);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.start:hover { background: var(--orange-deep); transform: translateY(-2px); box-shadow: 0 20px 36px -18px rgba(162, 53, 32, .8); }
.start:active { transform: translateY(0) scale(.99); }
.start .plus { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex-shrink: 0; }
.start .plus .ico { width: 26px; height: 26px; }
.start strong { display: block; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.start span.sub { display: block; color: rgba(255, 255, 255, .86); font-size: 15px; margin-top: 2px; }
.start .chev { margin-left: auto; opacity: .8; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.req {
  display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; background: var(--surface);
  border-radius: var(--r-md); padding: 16px 16px 16px 18px; box-shadow: var(--shadow);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.req:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.req.attention { box-shadow: inset 0 0 0 2px var(--orange), var(--shadow); }
.req .body { min-width: 0; flex: 1; }
.req .text { font-weight: 560; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.req .meta { font-size: 14px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.req .chev { color: #B3A99E; }
.req .chev .ico { width: 20px; height: 20px; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; border-radius: 999px; padding: 3px 11px 3px 9px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-eingegangen { background: var(--blue-bg); color: var(--blue); }
.st-in_arbeit { background: var(--amber-bg); color: var(--amber); }
.st-rueckfrage { background: var(--peach); color: var(--orange-deep); }
.st-erledigt { background: var(--ok-bg); color: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.loading { display: flex; justify-content: center; padding: 64px 0; }
.loading span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--sand); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.links li { min-width: 0; }
.lnk { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.lnk:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.lnk .circle { width: 40px; height: 40px; border-radius: 50%; background: var(--peach); color: var(--orange-text); display: grid; place-items: center; flex-shrink: 0; }
.lnk .circle .ico { width: 20px; height: 20px; }
.lnk .body { min-width: 0; flex: 1; }
.lnk strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.lnk .host { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lnk .ext { color: #B3A99E; }
.lnk .ext .ico { width: 17px; height: 17px; }

/* ---------- Neue Anfrage ---------- */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  padding: 16px; cursor: pointer; transition: background .2s, border-color .2s;
}
.tool:hover { background: var(--sand); border-color: rgba(80, 55, 30, .35); }
.tool .circle { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--orange-text); display: grid; place-items: center; box-shadow: var(--shadow); }
.tool strong { font-weight: 620; font-size: 16px; line-height: 1.3; }
.tool small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 2px; }
.tool:disabled { opacity: .5; cursor: default; }

.recording { display: flex; align-items: center; gap: 14px; background: var(--err-bg); color: var(--err); border-radius: var(--r-md); padding: 12px 12px 12px 18px; margin-top: 10px; }
.recording .dot { width: 12px; height: 12px; border-radius: 50%; background: #D93025; animation: pulse 1.2s ease-in-out infinite; }
.recording .time { font-variant-numeric: tabular-nums; font-weight: 650; }
.recording .btn { margin-left: auto; min-height: 44px; padding: 8px 18px; font-size: 16px; background: #C42B1C; box-shadow: none; }
@keyframes pulse { 50% { transform: scale(.7); opacity: .45; } }

.audios { display: grid; gap: 8px; margin-top: 10px; }
.audio { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: var(--r-md); padding: 6px 6px 6px 14px; }
.audio .n { font-size: 14px; color: var(--muted); font-weight: 600; }
.audio audio { flex: 1; min-width: 0; height: 40px; }

.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.iconbtn:hover { background: var(--sand); color: var(--ink); }
.iconbtn .ico { width: 20px; height: 20px; }

.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 12px; }
.pic { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--sand); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(34, 29, 25, .78); color: #fff; font-size: 12.5px; font-weight: 620; border-radius: 999px; padding: 2px 9px; }
.pic .iconbtn { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.pic .iconbtn .ico { width: 16px; height: 16px; }
a.pic { display: block; }

.docs { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.docs li { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: var(--r-sm); padding: 6px 6px 6px 12px; font-size: 15px; min-height: 48px; }
.docs li .ico { color: var(--muted); width: 20px; height: 20px; }
.docs li .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.docs li .sz { color: var(--muted); font-size: 13.5px; white-space: nowrap; padding-right: 8px; }

.privacy { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 22px 0 20px; line-height: 1.5; }
.privacy .ico { width: 18px; height: 18px; margin-top: 2px; }

.progress { height: 6px; background: var(--sand); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.progress div { height: 100%; width: 0; background: var(--orange); border-radius: 3px; transition: width .3s var(--ease); }

/* ---------- Detail ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.head h1 { font-size: 26px; margin: 0; }
.when { color: var(--muted); font-size: 15px; margin: 0 0 22px; }

.steps { display: flex; list-style: none; margin: 0 0 30px; padding: 18px 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.steps li { flex: 1; position: relative; text-align: center; font-size: 13.5px; color: var(--muted); font-weight: 520; padding-top: 34px; }
.steps li::before { content: ""; position: absolute; top: 12px; left: -50%; right: 50%; height: 3px; background: var(--sand); border-radius: 2px; }
.steps li:first-child::before { display: none; }
.steps li .mark { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 27px; height: 27px; border-radius: 50%;
  background: var(--sand); color: transparent; display: grid; place-items: center; z-index: 1; }
.steps li .mark .ico { width: 15px; height: 15px; }
.steps li.done { color: var(--ink); }
.steps li.done::before, .steps li.now::before { background: var(--orange); }
.steps li.done .mark { background: var(--orange); color: #fff; }
.steps li.now { color: var(--ink); font-weight: 650; }
.steps li.now .mark { background: var(--surface); box-shadow: inset 0 0 0 3px var(--orange); }
.steps li.now .mark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.steps li.now .mark .ico { display: none; }

.chat { display: grid; gap: 14px; }
.bubble { max-width: 88%; border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); }
.bubble.mine { min-width: min(320px, 88%); justify-self: end; background: var(--surface); border-bottom-right-radius: 6px; }
.bubble.theirs { justify-self: start; background: var(--peach); border-bottom-left-radius: 6px; box-shadow: none; }
.bubble .from { font-size: 13px; color: var(--muted); margin-bottom: 5px; display: flex; gap: 8px; align-items: center; }
.bubble.theirs .from { color: var(--orange-deep); }
.bubble .from .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--orange-text); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.bubble .attach { margin-top: 12px; }
.bubble .attach audio { width: 100%; height: 40px; margin-top: 6px; display: block; }
.bubble .pics { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.bubble .docs li { background: var(--bg); }
.gone { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.gone .ico { margin-top: 2px; }
.seen { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.seen .ico { width: 16px; height: 16px; }
.seen.read { color: var(--blue); }
.seen.read .ico { animation: pop .4s var(--ease) both; }
.gone .ico { width: 16px; height: 16px; }

.reply { margin-top: 28px; }
.reply .box { display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 8px 8px 8px 6px; }
.reply textarea { border: 0; box-shadow: none; min-height: 52px; max-height: 260px; resize: none; padding: 13px 12px; background: transparent; }
.reply textarea:focus { box-shadow: none; }
.reply .box:focus-within { box-shadow: 0 0 0 2px var(--orange), var(--shadow); }
.reply .send { width: 48px; height: 48px; min-height: 48px; padding: 0; flex-shrink: 0; }

/* Ein Moment: Bestätigung nach dem Absenden */
.thanks { display: flex; gap: 14px; align-items: center; background: var(--ok-bg); color: var(--ok); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 22px; }
.thanks .check { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex-shrink: 0; animation: pop .6s var(--ease) both; }
.thanks .check svg path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .25s var(--ease) forwards; }
.thanks strong { display: block; color: #1F5C3B; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Fuß ---------- */
.foot { color: var(--muted); font-size: 13.5px; text-align: center; padding: 20px 18px; padding-bottom: max(20px, env(safe-area-inset-bottom)); line-height: 1.8; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

@media (max-width: 520px) {
  body { font-size: 16.5px; }
  main { padding: 10px 16px 48px; }
  .top { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 26px; }
  .hello h1 { font-size: 29px; }
  .panel { padding: 20px 18px; }
  .who .name { display: none; }
  .tools { grid-template-columns: 1fr; }
  .links { grid-template-columns: minmax(0, 1fr); }
  .tool { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
  .steps { padding: 16px 10px; }
  .steps li { font-size: 12.5px; }
  .bubble { max-width: 94%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
