/* Backstage – Grundgestaltung. Farben kommen aus den Einstellungen (--primary, --bg). */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --primary: #9C4A32;
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --ink: #2B2320;
  --muted: #74675F;
  --line: #E8DDD1;
  --soft: #F3EBE1;
  --ok: #2F6B4F;
  --warn: #8A5A00;
  --err: #A1352B;
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: .4rem; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.wrap { max-width: 860px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.brand img { height: 34px; width: auto; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .9rem; text-decoration: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 0; position: relative; min-width: 0; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.dot { position: absolute; top: 2px; right: calc(50% - 18px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: .66rem; display: grid; place-items: center; font-weight: 700; }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; width: 250px; flex-shrink: 0; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .sidebar .brand { margin: 0 8px 24px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); margin-bottom: 2px; }
  .sidebar nav a svg { width: 20px; height: 20px; color: var(--muted); }
  .sidebar nav a:hover { background: var(--soft); }
  .sidebar nav a.active { background: var(--soft); color: var(--primary); font-weight: 600; }
  .sidebar nav a.active svg { color: var(--primary); }
  .sidebar nav .sep { margin: 16px 12px 6px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .sidebar .count { margin-left: auto; background: var(--primary); color: #fff; border-radius: 9px; font-size: .72rem; padding: 0 7px; font-weight: 700; }
  .sidebar .foot { margin-top: auto; padding: 12px; font-size: .85rem; }
  .main { padding: 36px 40px 60px; }
  .topbar .brand { display: none; }
}

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.soft { background: var(--soft); border-color: transparent; }
.card.hero { background: var(--primary); color: #fff; border: 0; }
.card.hero .eyebrow, .card.hero .muted { color: rgba(255,255,255,.8); }
.card.hero a:not(.btn) { color: #fff; }
.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stat { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--primary); background: var(--primary); color: #fff; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.light { background: #fff; color: var(--primary); border-color: #fff; }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: .88rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex-shrink: 0; accent-color: var(--primary); }
.error { color: var(--err); font-size: .9rem; margin-top: 6px; }

.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: #E7F2EC; color: var(--ok); }
.flash.err { background: #F8E6E3; color: var(--err); }
.notice { border-left: 4px solid var(--warn); background: #FBF3E2; padding: 12px 16px; border-radius: 0 12px 12px 0; margin-bottom: 16px; color: #5a4100; }
.placeholder { border: 2px dashed #D9B98A; background: #FFF8EC; border-radius: 12px; padding: 14px 16px; color: #6b4f1d; }
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.badge.ok { background: #E7F2EC; color: var(--ok); }
.badge.err { background: #F8E6E3; color: var(--err); }
.badge.warn { background: #FBF3E2; color: var(--warn); }
.badge.primary { background: var(--primary); color: #fff; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.item { display: block; text-decoration: none; color: inherit; }

table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tablewrap { overflow-x: auto; }

/* Folge */
.questions { counter-reset: q; list-style: none; padding: 0; margin: 0; }
.questions li { counter-increment: q; position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.questions li:last-child { border-bottom: 0; }
.questions li::before { content: counter(q); position: absolute; left: 0; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--primary); font-family: var(--serif); font-weight: 600; display: grid; place-items: center; }
.verse { padding: 12px 0; border-bottom: 1px solid var(--line); }
.verse:last-child { border-bottom: 0; }
.verse .ref { font-weight: 700; color: var(--primary); font-size: .92rem; }
.quote { font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; padding: 6px 0 6px 18px; border-left: 3px solid var(--primary); margin: 0 0 14px; }
.video { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #1d1714; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); white-space: pre-line; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble .meta { display: block; font-size: .74rem; opacity: .75; margin-top: 4px; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 12px 0; display: flex; gap: 8px; }
.composer textarea { min-height: 48px; height: 48px; }
@media (min-width: 900px) { .composer { bottom: 0; } }

.post { padding: 16px 0; border-bottom: 1px solid var(--line); }
.post .replies { margin: 12px 0 0 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.post.hidden { opacity: .55; }

/* Gast-Seiten */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.guest .box { width: 100%; max-width: 440px; }
.guest .brand { justify-content: center; margin-bottom: 24px; font-size: 1.6rem; }
.guest.wide .box { max-width: 720px; }
.footer-links { text-align: center; font-size: .85rem; margin-top: 18px; }
.footer-links a { color: var(--muted); margin: 0 8px; }

.repeat-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.verse-row { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
@media (min-width: 700px) { .verse-row { grid-template-columns: 200px 1fr auto; } }
.progress { height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.composer .btn { width: 52px; padding: 0; flex-shrink: 0; }
