/* Briefgenerator — eine Datei, Variablen oben. Kein Build-Schritt. */

:root {
  --papier: #ffffff;
  --grund: #f4f2ee;
  --schrift: #1c1b19;
  --grau: #6a675f;
  --linie: #ddd9d1;
  --akzent: #1f4a6b;
  --akzent-hell: #eaf1f6;
  --warnung: #8c2f22;
  --warnung-hell: #fbecea;
  --rand: 6px;
  --spalte: 62rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--schrift);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

header {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  background: var(--papier);
  border-bottom: 1px solid var(--linie);
}
header .titel a { color: var(--schrift); font-weight: 700; text-decoration: none; }
header nav { display: flex; align-items: center; gap: 1.2rem; margin-left: auto; }
header nav a { color: var(--grau); text-decoration: none; }
header nav a:hover, header nav a.hier { color: var(--akzent); }

main { max-width: var(--spalte); margin: 2rem auto 5rem; padding: 0 1.5rem; }

h1 { font-size: 1.5rem; margin: 0 0 0.3rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 0.95rem; margin: 1.2rem 0 0.3rem; color: var(--grau); }

a { color: var(--akzent); }
.grau { color: var(--grau); }
.nowrap { white-space: nowrap; }
.zurueck { margin: 0 0 0.5rem; }

.hinweis { color: var(--grau); font-size: 0.9rem; margin: 0.3rem 0 1rem; }
.hinweis.kasten {
  background: var(--akzent-hell); border: 1px solid var(--linie);
  border-radius: var(--rand); padding: 0.8rem 1rem; color: var(--schrift);
}
.leer { color: var(--grau); padding: 1.5rem 0; }

.fehler {
  background: var(--warnung-hell); border: 1px solid var(--warnung);
  color: var(--warnung); border-radius: var(--rand);
  padding: 0.8rem 1rem; margin: 0 0 1.2rem;
}
.fehler ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* --- Formulare --------------------------------------------------------- */

fieldset {
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: var(--rand); padding: 1rem 1.2rem 1.2rem; margin: 0 0 1.2rem;
}
legend { font-weight: 700; padding: 0 0.4rem; }

label { display: block; margin: 0 0 0.8rem; }
label > span { display: block; font-size: 0.85rem; color: var(--grau); margin-bottom: 0.2rem; }

input[type=text], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 0.5rem 0.6rem;
  border: 1px solid var(--linie); border-radius: var(--rand);
  background: var(--papier); color: var(--schrift);
  font: inherit;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent);
}

.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.raster label.schmal { max-width: 12rem; }
@media (max-width: 42rem) { .raster { grid-template-columns: 1fr; } }

label.haken { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
label.haken > span { margin: 0; color: var(--schrift); font-size: 1rem; }
label.haken input { width: auto; }

.knopfzeile { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0; }

button, .knopf {
  display: inline-block;
  background: var(--akzent); color: #fff; border: 0;
  border-radius: var(--rand); padding: 0.55rem 1.1rem;
  font: inherit; text-decoration: none; cursor: pointer;
}
button:hover, .knopf:hover { filter: brightness(1.15); }
button.gefahr { background: var(--warnung); }

.suchzeile { display: flex; gap: 0.6rem; align-items: center; margin: 0 0 1.2rem; }
.suchzeile input { max-width: 26rem; }

.loeschzeile {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--linie); padding-top: 1.2rem; margin-top: 2rem;
}
.loeschzeile .hinweis { margin: 0; flex: 1 1 18rem; }

/* --- Listen ------------------------------------------------------------ */

table.liste {
  width: 100%; border-collapse: collapse;
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: var(--rand); overflow: hidden;
}
table.liste th {
  text-align: left; font-size: 0.8rem; color: var(--grau);
  font-weight: 600; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--linie);
}
table.liste td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:last-child td { border-bottom: 0; }
table.liste td .grau { font-size: 0.85rem; }

/* Anmeldeformular — schmal, weil es genau ein Feld hat. */
form.anmeldung { max-width: 26rem; }
/* Abmelden gehört in die Navigation, sieht dort aber nicht wie ein Knopf
   aus — es ist ein Weg, kein Vorgang. */
header form.abmelden { display: inline; }
header form.abmelden button {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--grau); cursor: pointer; text-decoration: none;
}
header form.abmelden button:hover { text-decoration: underline; }

/* Ablage, Archiv, Papierkorb — drei Ansichten derselben Liste. */
nav.ansichten { display: flex; gap: 1.2rem; margin-bottom: 0.8rem; }
nav.ansichten a {
  text-decoration: none; color: var(--grau); padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
nav.ansichten a.hier { color: inherit; border-bottom-color: var(--akzent); }

ul.kacheln { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 0 0 1.5rem; }
ul.kacheln li {
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: var(--rand); padding: 0.5rem 0.9rem;
}
ul.kacheln li.hier { border-color: var(--akzent); background: var(--akzent-hell); }
ul.kacheln a { text-decoration: none; }
ul.kacheln strong { display: block; }
ul.kacheln .grau { font-size: 0.85rem; }

/* Unterscheidet zwei Absender, die denselben Namen tragen — Geschäft und
   Privatadresse derselben Person. Steht über dem Namen, weil danach gegriffen
   wird, nicht nach dem Namen. */
.etikett {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--akzent); background: var(--akzent-hell);
  border-radius: var(--rand); padding: 0.05rem 0.4rem; margin-bottom: 0.25rem;
}

/* Empfängerauswahl des Serienbriefs — viele Haken auf wenig Fläche, aber
   ohne Scrollkasten: Wer 40 Betreute anschreibt, will alle sehen. */
.empfaengerwahl {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.1rem 1rem; margin-bottom: 0.5rem;
}
.empfaengerwahl .haken { margin: 0; }

/* Aufzählung und Ankreuzkästchen im Wortlaut — dieselbe Form wie im Satz. */
.wortlaut ul.briefliste { margin: 0.6rem 0; padding-left: 1.2rem; }
.wortlaut ul.briefliste li { margin-bottom: 0.25rem; }
.wortlaut hr { border: 0; border-top: 1px solid var(--linie); margin: 1rem 0; }
.wortlaut h3 { margin: 1rem 0 0.4rem; color: inherit; font-size: 1rem; }
.kaestchen {
  display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.3em;
  border: 1px solid var(--grau); text-align: center; line-height: 0.85em;
}

/* --- Briefansicht ------------------------------------------------------ */

.zweispaltig { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: start; }
@media (max-width: 48rem) { .zweispaltig { grid-template-columns: 1fr; } }

.wortlaut {
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: var(--rand); padding: 1.2rem 1.4rem;
}
.wortlaut p { margin: 0 0 0.9rem; }
address { font-style: normal; line-height: 1.45; }
code { background: var(--grund); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.85em; }

/* --- Entwurf oder abgelegt --------------------------------------------- */

.marke {
  display: inline-block; font-size: 0.75rem; line-height: 1.4;
  padding: 0.1rem 0.5rem; border-radius: 999px;
  background: var(--grund); border: 1px solid var(--linie); color: var(--grau);
}
.marke.entwurf { background: #fdf3d8; border-color: #e0c982; color: #6b4e0d; }
/* Brief im Namen eines Mandanten — der Absender auf dem Blatt ist nicht der
   eigene Briefkopf. In der Ablage der wichtigste Unterschied zwischen zwei
   sonst gleich aussehenden Zeilen. */
/* Vorlage, an der ein Hinweis hängt (etwa: Kündigung braucht Papier). */
.marke.hinweismarke { background: #fdf3d8; border-color: #e0c982; color: #6b4e0d; cursor: help; }
.marke.fremd { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent); }

.kasten.entwurfskasten {
  background: var(--papier); border: 1px solid var(--linie);
  border-left: 4px solid #e0c982;
  border-radius: var(--rand); padding: 1rem 1.2rem; margin: 0 0 1.5rem;
}
.entwurfskasten p { margin: 0 0 0.5rem; }
.entwurfskasten .knopfzeile { margin-bottom: 0; }
.entwurfskasten form { display: inline; }

.logovorschau {
  max-height: 70px; max-width: 260px;
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: var(--rand); padding: 0.4rem;
}
input[type=file] { font: inherit; }
