/* Ghostwriter – Oberfläche. Ruhig, warm, gut lesbar; zuerst fürs Telefon gebaut. */

:root {
  --papier: #f6f2ea;
  --papier-2: #efe7da;
  --karte: #fffdf9;
  --tinte: #1f1a16;
  --tinte-2: #5f564d;
  --tinte-3: #8a7f73;
  --linie: #e7dfd2;
  --linie-2: #d8cdbc;
  --akzent: #8a5a2b;
  --akzent-2: #a86f38;
  --akzent-hell: #f4e7d5;
  --auf-akzent: #fffaf2;
  --gruen: #2e6a4e;
  --gruen-hell: #e2efe7;
  --gelb: #8f5d0f;
  --gelb-hell: #f7ecd6;
  --blau: #2d5a86;
  --blau-hell: #e3ecf6;
  --rot: #a3352b;
  --rot-hell: #f7e4e1;
  --schatten: 0 1px 2px rgba(31, 26, 22, .05), 0 12px 32px -18px rgba(31, 26, 22, .28);
  --schatten-klein: 0 1px 2px rgba(31, 26, 22, .06);
  --radius: 18px;
  --radius-klein: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --breite: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #14110e;
    --papier-2: #1a1612;
    --karte: #1e1a16;
    --tinte: #f2ece3;
    --tinte-2: #bfb3a5;
    --tinte-3: #8f8477;
    --linie: #2f2822;
    --linie-2: #3d342b;
    --akzent: #d9a56d;
    --akzent-2: #e8bb87;
    --akzent-hell: #33261a;
    --auf-akzent: #1a130c;
    --gruen: #7fc6a0;
    --gruen-hell: #1b2c22;
    --gelb: #e3b566;
    --gelb-hell: #33281a;
    --blau: #92b9e4;
    --blau-hell: #1b2633;
    --rot: #ee958a;
    --rot-hell: #3a1f1c;
    --schatten: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -18px rgba(0, 0, 0, .7);
    --schatten-klein: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinte);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--akzent-hell), transparent 60%),
    var(--papier);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--akzent); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--akzent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ohne-js { max-width: 30rem; margin: 20vh auto; padding: 0 1.5rem; text-align: center; font-family: var(--serif); font-size: 1.2rem; }

/* ── Laden ── */
.laden { display: grid; place-items: center; min-height: 100vh; }
.laden-punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--akzent); animation: puls 1.2s ease-in-out infinite; }

@keyframes puls { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Marke ── */
.marke { display: inline-flex; align-items: center; gap: .6rem; color: var(--tinte); text-decoration: none; }
.marke-zeichen { width: 32px; height: 32px; flex: none; color: var(--tinte); }
.feder-spitze { fill: var(--papier); }
.marke-wort { font-family: var(--serif); font-size: 1.28rem; letter-spacing: .01em; }

/* ── Anmeldung ── */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom)); }
.anmeldung-karte {
  width: 100%; max-width: 410px; padding: 2.4rem 2rem 2rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 24px; box-shadow: var(--schatten);
  animation: einblenden .4s ease both;
}
.anmeldung-kopf { text-align: center; margin-bottom: 1.8rem; }
.anmeldung-kopf .marke-zeichen { width: 58px; height: 58px; margin-bottom: 1rem; }
.anmeldung-kopf h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 2.3rem; line-height: 1.1; letter-spacing: -.005em; }
.anmeldung-kopf p { margin: .55rem 0 0; color: var(--tinte-2); font-family: var(--serif); font-style: italic; font-size: 1.08rem; }
.anmeldung-fuss { margin: 1.6rem 0 0; text-align: center; font-size: .84rem; color: var(--tinte-3); }

.feld { display: grid; gap: .35rem; margin-bottom: 1rem; }
.feld label { font-size: .86rem; font-weight: 600; color: var(--tinte-2); }
.feld .hilfe { font-size: .8rem; color: var(--tinte-3); font-weight: 400; }
.eingabe {
  width: 100%; min-height: 48px; padding: .7rem .9rem;
  background: var(--papier); border: 1px solid var(--linie-2); border-radius: var(--radius-klein);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.eingabe:hover { border-color: var(--tinte-3); }
.eingabe:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--akzent) 18%, transparent); background: var(--karte); }
select.eingabe { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; background-image: linear-gradient(45deg, transparent 50%, var(--tinte-2) 50%), linear-gradient(135deg, var(--tinte-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.formular-fehler { min-height: 1.4em; margin: .1rem 0 .7rem; color: var(--rot); font-size: .9rem; }

/* ── Knöpfe ── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.1rem; border-radius: 999px; border: 1px solid var(--linie-2);
  background: var(--karte); color: var(--tinte); font-weight: 600; font-size: .95rem; cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; text-decoration: none; white-space: nowrap;
}
.knopf:hover { border-color: var(--tinte-3); }
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: .55; cursor: default; transform: none; }
.knopf svg { width: 18px; height: 18px; flex: none; }
.knopf-primaer { background: var(--tinte); border-color: var(--tinte); color: var(--papier); box-shadow: var(--schatten-klein); }
.knopf-primaer:hover { background: color-mix(in srgb, var(--tinte) 88%, var(--akzent)); border-color: transparent; }
.knopf-akzent { background: var(--akzent); border-color: var(--akzent); color: var(--auf-akzent); }
.knopf-akzent:hover { background: var(--akzent-2); border-color: var(--akzent-2); }
.knopf-leise { background: transparent; border-color: transparent; color: var(--tinte-2); padding-inline: .7rem; }
.knopf-leise:hover { background: var(--papier-2); border-color: transparent; color: var(--tinte); }
.knopf-gefahr { color: var(--rot); }
.knopf-gefahr:hover { background: var(--rot-hell); }
.knopf-klein { min-height: 36px; padding: .35rem .8rem; font-size: .86rem; }
.knopf-breit { width: 100%; min-height: 50px; font-size: 1rem; }

/* ── Kopfzeile ── */
.kopf {
  position: sticky; top: 0; z-index: 20;
  padding: calc(.7rem + env(safe-area-inset-top)) 1.25rem .7rem;
  background: color-mix(in srgb, var(--papier) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--linie) 70%, transparent);
}
.kopf-innen { max-width: var(--breite); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kopf-rechts { display: flex; align-items: center; gap: .35rem; }
.person { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .93rem; color: var(--tinte-2); }
.person-kreis { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--akzent-hell); color: var(--akzent); font-family: var(--serif); font-size: 1rem; font-weight: 400; }

/* ── Inhalt ── */
.inhalt { max-width: var(--breite); margin: 0 auto; padding: 1.6rem 1.25rem calc(3rem + env(safe-area-inset-bottom)); }
.inhalt > * { animation: einblenden .35s ease both; }

.begruessung h1 { margin: .4rem 0 .5rem; font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1.08; letter-spacing: -.01em; }
.begruessung p { margin: 0; max-width: 36rem; color: var(--tinte-2); font-size: 1.04rem; }

.kennzahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 1.5rem 0 1.8rem; }
.kennzahl { padding: .9rem 1rem; background: color-mix(in srgb, var(--karte) 75%, transparent); border: 1px solid var(--linie); border-radius: var(--radius-klein); }
.kennzahl-wert { display: block; font-family: var(--serif); font-size: 1.55rem; line-height: 1.15; }
.kennzahl-name { display: block; margin-top: .15rem; font-size: .8rem; color: var(--tinte-3); }

.karte {
  margin: 0 0 1.25rem; padding: 1.5rem 1.4rem;
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten);
}
.karte-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.karte-kopf h2 { margin: .1rem 0 0; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.2; }
.oberzeile { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--akzent); }
.karte-text { margin: 0 0 1rem; color: var(--tinte-2); }

/* Nachricht des Ghostwriters */
.nachricht { position: relative; padding-left: 1.6rem; }
.nachricht::before { content: ""; position: absolute; left: 0; top: .3rem; bottom: .3rem; width: 3px; border-radius: 3px; background: var(--akzent); }
.nachricht-text { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; white-space: pre-line; }
.nachricht-zeit { margin: .7rem 0 0; font-size: .82rem; color: var(--tinte-3); }

/* Fragen */
.thema + .thema { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
.thema-titel { margin: 0 0 .7rem; font-size: .95rem; font-weight: 700; color: var(--tinte); }
.fragen { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.frage { display: grid; grid-template-columns: 2rem 1fr; gap: .2rem .6rem; padding: .85rem .9rem .8rem .75rem; border-radius: var(--radius-klein); background: var(--papier); border: 1px solid transparent; transition: border-color .15s; }
.frage:hover { border-color: var(--linie-2); }
.frage-nr { font-family: var(--serif); font-size: 1.15rem; color: var(--akzent); line-height: 1.45; text-align: right; }
.frage-text { margin: 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.45; }
.frage-hinweis { margin: .25rem 0 0; font-size: .88rem; color: var(--tinte-2); }
.frage-fuss { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-top: .35rem; }
.marker { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; }
.marker svg { width: 14px; height: 14px; }
.marker-neu { background: var(--akzent-hell); color: var(--akzent); }
.marker-ok { background: var(--gruen-hell); color: var(--gruen); }

.leer { padding: 1.2rem 1.1rem; border-radius: var(--radius-klein); background: var(--papier); color: var(--tinte-2); }
.leer strong { display: block; margin-bottom: .25rem; color: var(--tinte); font-family: var(--serif); font-weight: 400; font-size: 1.12rem; }

/* Hochladen */
.ablage {
  position: relative; display: grid; justify-items: center; gap: .35rem; width: 100%;
  padding: 1.8rem 1rem 1.6rem; border: 2px dashed var(--linie-2); border-radius: var(--radius);
  background: var(--papier); text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.ablage:hover, .ablage.ziehen { border-color: var(--akzent); background: var(--akzent-hell); }
.ablage:focus-within { border-color: var(--akzent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--akzent) 18%, transparent); }
.ablage-symbol { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--karte); color: var(--akzent); box-shadow: var(--schatten-klein); margin-bottom: .35rem; }
.ablage-symbol svg { width: 24px; height: 24px; }
.ablage-titel { font-weight: 700; font-size: 1.02rem; }
.ablage-hinweis { font-size: .86rem; color: var(--tinte-3); }
.ablage input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.upload-felder { display: grid; grid-template-columns: 1fr; gap: 0 .9rem; margin-top: 1.1rem; }
@media (min-width: 640px) { .upload-felder { grid-template-columns: 1.15fr 1fr; } }

.uploads { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .55rem; }
.upload { padding: .75rem .9rem; border: 1px solid var(--linie); border-radius: var(--radius-klein); background: var(--papier); }
.upload-zeile { display: flex; align-items: center; gap: .7rem; }
.upload-symbol { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--karte); color: var(--tinte-2); }
.upload-symbol svg { width: 18px; height: 18px; }
.upload-info { min-width: 0; flex: 1; }
.upload-name { display: block; font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-stand { display: block; font-size: .82rem; color: var(--tinte-3); }
.upload.fertig .upload-symbol { background: var(--gruen-hell); color: var(--gruen); }
.upload.fehler .upload-symbol { background: var(--rot-hell); color: var(--rot); }
.upload.fehler .upload-stand { color: var(--rot); }
.balken { height: 6px; margin-top: .6rem; border-radius: 6px; background: var(--linie); overflow: hidden; }
.balken > span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--akzent), var(--akzent-2)); transition: width .25s ease; }

.upload-aktionen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-top: 1.1rem; }

.dienst { display: flex; align-items: flex-start; gap: .55rem; margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--linie); font-size: .86rem; color: var(--tinte-2); }
.dienst-punkt { flex: none; width: 9px; height: 9px; margin-top: .42rem; border-radius: 50%; background: var(--tinte-3); }
.dienst.aktiv .dienst-punkt { background: var(--gruen); box-shadow: 0 0 0 4px var(--gruen-hell); }

/* Aufnahmen */
.monat { margin: 1.3rem 0 .55rem; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tinte-3); }
.monat:first-child { margin-top: 0; }
.aufnahmen { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.aufnahme { border: 1px solid var(--linie); border-radius: var(--radius-klein); background: var(--papier); overflow: hidden; transition: border-color .15s, background .15s; }
.aufnahme.offen { background: var(--karte); border-color: var(--linie-2); box-shadow: var(--schatten-klein); }
.aufnahme-kopf { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "info status pfeil"; align-items: center; column-gap: .8rem; width: 100%; padding: .85rem .9rem; border: 0; background: transparent; text-align: left; cursor: pointer; }
.aufnahme-kopf .aufnahme-info { grid-area: info; }
.aufnahme-kopf .status { grid-area: status; }
.aufnahme-kopf .pfeil { grid-area: pfeil; }
.aufnahme-kopf:hover .aufnahme-titel { color: var(--akzent); }
.aufnahme-info { min-width: 0; flex: 1; }
.aufnahme-titel { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s; }
.aufnahme-meta { display: block; font-size: .83rem; color: var(--tinte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfeil { flex: none; width: 18px; height: 18px; color: var(--tinte-3); transition: transform .2s; }
.aufnahme.offen .pfeil { transform: rotate(180deg); }

.status { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-wartet { background: var(--gelb-hell); color: var(--gelb); }
.status-in_arbeit { background: var(--blau-hell); color: var(--blau); }
.status-in_arbeit::before { animation: puls 1.1s ease-in-out infinite; }
.status-fertig { background: var(--gruen-hell); color: var(--gruen); }
.status-fehler { background: var(--rot-hell); color: var(--rot); }

.aufnahme-detail { padding: 0 1rem 1rem; border-top: 1px solid var(--linie); }
.detail-text { margin: .9rem 0 0; color: var(--tinte-2); font-size: .93rem; }
.detail-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.transkript { margin-top: .9rem; max-height: 60vh; overflow: auto; padding: .2rem .2rem .2rem 0; -webkit-overflow-scrolling: touch; }
.absatz { display: grid; grid-template-columns: 3.6rem 1fr; gap: .6rem; margin: 0 0 .9rem; }
.zeitmarke { padding-top: .22rem; font-size: .76rem; font-variant-numeric: tabular-nums; color: var(--tinte-3); }
.absatz-text { font-family: var(--serif); font-size: 1.06rem; line-height: 1.62; }
.transkript-laden { margin-top: .9rem; color: var(--tinte-3); font-size: .9rem; }

/* Fuß */
.fuss { max-width: var(--breite); margin: 0 auto; padding: 0 1.25rem calc(2.5rem + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem; color: var(--tinte-3); font-size: .84rem; }
.fuss button { padding: 0; border: 0; background: none; color: var(--tinte-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .84rem; }

/* Dialog */
dialog.info {
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 1px solid var(--linie);
  border-radius: 22px; background: var(--karte); color: var(--tinte); box-shadow: var(--schatten);
}
dialog.info::backdrop { background: rgba(20, 17, 14, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.info-innen { padding: 1.6rem 1.5rem 1.4rem; overflow: auto; max-height: calc(100vh - 3rem); }
.info-innen h2 { margin: .15rem 0 1rem; font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }
.info-innen h3 { margin: 1.4rem 0 .5rem; font-size: 1rem; }
.schritte { margin: 0; padding: 0; list-style: none; counter-reset: schritt; display: grid; gap: .7rem; }
.schritte li { position: relative; padding-left: 2.4rem; color: var(--tinte-2); }
.schritte li::before { counter-increment: schritt; content: counter(schritt); position: absolute; left: 0; top: -.05rem; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--akzent-hell); color: var(--akzent); font-family: var(--serif); }
.schritte strong { color: var(--tinte); }
.punkte { margin: 0; padding-left: 1.2rem; color: var(--tinte-2); display: grid; gap: .45rem; }
.info-fuss { display: flex; justify-content: flex-end; margin-top: 1.4rem; }

/* Hinweise */
.meldungen { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: grid; gap: .5rem; width: min(440px, calc(100vw - 2rem)); pointer-events: none; }
.meldung { padding: .75rem 1rem; border-radius: 14px; background: var(--tinte); color: var(--papier); font-size: .92rem; box-shadow: var(--schatten); animation: einblenden .25s ease both; pointer-events: auto; }
.meldung.fehler { background: var(--rot); color: #fff; }

@media (max-width: 560px) {
  .aufnahme-kopf { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info pfeil" "status pfeil"; row-gap: .45rem; }
  .aufnahme-kopf .status { justify-self: start; }
}

@media (max-width: 420px) {
  .karte { padding: 1.25rem 1.05rem; border-radius: 16px; }
  .kennzahl { padding: .75rem .7rem; }
  .kennzahl-wert { font-size: 1.3rem; }
  .person-name { display: none; }
  .status { padding: .2rem .5rem; }
  .absatz { grid-template-columns: 1fr; gap: .1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
