/* =================================================================
   textwerk.css — eigene Bausteine der Seite textwerk.php
   Akzent Terrakotta: #c2410c (Kontrast auf Weiß 5,2:1), Text #9a3412 (7,3:1).
   Alles unter #container, nur logische Eigenschaften (RTL-tauglich).
   ================================================================= */
#container { --tw: #c2410c; --tw-t: #9a3412; --tw-l: #fff7ed; --tw-b: #fed7aa;
             --auf: #047857; --auf-t: #065f46; --auf-l: #ecfdf5; --auf-b: #a7f3d0;
             --dt: #475569; --dt-t: #334155; --dt-l: #f1f5f9; --dt-b: #cbd5e1; }
#container .t-tw { --c: var(--tw); --ct: var(--tw-t); --cl: var(--tw-l); --cb: var(--tw-b); }
#container .t-auf { --c: var(--auf); --ct: var(--auf-t); --cl: var(--auf-l); --cb: var(--auf-b); }
#container .t-dt { --c: var(--dt); --ct: var(--dt-t); --cl: var(--dt-l); --cb: var(--dt-b); }
#container .tw-t { color: var(--tw-t); }
#container .tw-acc { color: var(--tw); }
#container .tw-ic { background: var(--tw-l) !important; color: var(--tw) !important; }
#container .tw-h4 { font-family: 'Roboto', sans-serif; font-weight: 500; font-size: 1.02rem; margin-bottom: 3px; line-height: 1.3; }
#container .tw-sub { text-align: center; font-size: clamp(1.3rem, 2vw, 1.8rem); margin: clamp(56px, 7vw, 90px) 0 26px; }
#container .hero h1 { overflow-wrap: break-word; hyphens: auto; }
#container .av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #2563eb; color: #fff; font-size: 0.56rem; font-weight: 600; flex-shrink: 0; }

/* ---------- Editor (Hero) ---------- */
#container .tw-hv { position: relative; padding-block: 24px 34px; }
#container .tw-ed { max-width: 600px; margin-inline: auto; }
#container .tw-kopf { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #f2f2f5; font-size: 0.64rem; color: #6e6e73; }
#container .tw-kopf .ok { display: inline-flex; align-items: center; gap: 4px; color: #15803d; font-weight: 500; }
#container .tw-kopf .v { background: #f5f5f7; border-radius: 50px; padding: 1px 8px; }
#container .tw-kopf .sp { flex: 1; }
#container .tw-kopf .rs-ico { color: #6e6e73; }
#container .tw-leiste { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 1px solid #ececf0; background: #fafafb; font-size: 0.66rem; color: #1d1d1f; overflow: hidden; white-space: nowrap; }
#container .tw-leiste .wahl { border: 1px solid #e3e5ea; background: #fff; border-radius: 6px; padding: 2px 16px 2px 7px; position: relative; flex-shrink: 0; }
#container .tw-leiste .wahl::after { content: ""; position: absolute; inset-inline-end: 6px; top: 50%; width: 4px; height: 4px; border-inline-end: 1px solid #86868b; border-bottom: 1px solid #86868b; transform: translateY(-70%) rotate(45deg); }
#container .tw-leiste .wahl.k { padding-inline-end: 14px; }
#container .tw-leiste .tr { width: 1px; height: 16px; background: #e3e5ea; flex-shrink: 0; }
#container .tw-leiste b, #container .tw-leiste em, #container .tw-leiste u, #container .tw-leiste s { width: 20px; text-align: center; font-family: Georgia, serif; font-size: 0.78rem; flex-shrink: 0; }
#container .tw-leiste b { background: var(--tw-l); color: var(--tw-t); border-radius: 5px; }
#container .tw-leiste .al { display: inline-grid; gap: 2px; width: 14px; flex-shrink: 0; }
#container .tw-leiste .al i { height: 1.5px; background: #515154; }
#container .tw-leiste .al i:nth-child(2) { width: 70%; }
#container .tw-leiste .al.m i { justify-self: center; }
#container .tw-leiste .rs-ico { color: #515154; flex-shrink: 0; }
#container .tw-leiste .farbe { width: 14px; height: 14px; border-bottom: 3px solid var(--tw); flex-shrink: 0; }
#container .tw-leiste .mark { width: 14px; height: 14px; background: #fef08a; border-radius: 3px; flex-shrink: 0; }
#container .tw-blatt-wrap { background: #eef0f3; padding: 18px 22px 0; overflow: hidden; }
#container .tw-blatt { background: #fff; max-width: 400px; margin-inline: auto; padding: 22px 28px 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); font-family: Arial, sans-serif; color: #1d1d1f; display: grid; gap: 7px; }
#container .tw-bk { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--tw); flex-wrap: wrap; }
#container .tw-bk .logo, #container .tw-a4-kopf .logo { font-family: 'Roboto Serif', serif; font-weight: 700; color: var(--tw-t); font-size: 0.82rem; }
#container .tw-bk small { font-size: 0.5rem; color: #86868b; }
#container .tw-h1 { display: block; font-size: 0.98rem; font-weight: 700; margin-top: 6px; }
#container .tw-h2 { display: block; font-size: 0.74rem; font-weight: 700; color: var(--tw-t); }
#container .tw-p { font-size: 0.6rem !important; color: #515154 !important; line-height: 1.5 !important; font-family: Arial, sans-serif; }
#container .tw-ul { list-style: none; padding-inline-start: 4px; font-size: 0.6rem; color: #1d1d1f; display: grid; gap: 2px; }
#container .tw-ul li { display: flex; gap: 6px; align-items: baseline; }
#container .tw-ul li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #1d1d1f; flex-shrink: 0; transform: translateY(-1px); }
#container .tw-mtab { width: 100%; border-collapse: collapse; font-size: 0.56rem; margin-top: 4px; }
#container .tw-mtab th, #container .tw-mtab td { border: 1px solid #d2d6de; padding: 3px 5px; text-align: start; color: #1d1d1f; }
#container .tw-mtab th { color: var(--tw-t); }
#container .tw-mtab th { background: var(--tw-l); color: var(--tw-t); font-weight: 700; }
#container .tw-fuss { text-align: end; font-size: 0.5rem; color: #86868b; margin-top: 8px; padding-top: 6px; border-top: 1px solid #f2f2f5; }
#container .tw-toast-a { inset-inline-start: -3%; bottom: 0; }
#container .tw-toast-b { inset-inline-end: -2%; top: 0; animation-delay: -3s; }
#container .vk-toast b { display: block; }

/* ---------- Was ist ---------- */
#container .tw-was { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 980px; margin: 0 auto; }
#container .tw-was li { display: flex; gap: 12px; align-items: flex-start; background: #fafafb; border: 1px solid #ececf0; border-radius: 16px; padding: 16px; font-size: 0.92rem; color: #1d1d1f; font-weight: 400; line-height: 1.45; }
#container .tw-was .fi { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Schreiben ---------- */
#container .tw-werk { max-width: 540px; margin-inline: auto; }
#container .tw-werk-body { display: grid; }
#container .tw-leiste.gross { font-size: 0.72rem; padding: 9px 14px; flex-wrap: wrap; white-space: normal; row-gap: 6px; }
#container .tw-schriften { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; border-bottom: 1px solid #f2f2f5; align-items: center; }
#container .tw-schriften small { font-size: 0.62rem; color: #86868b; margin-inline-end: 4px; flex-basis: 100%; }
#container .tw-schriften span { font-size: 0.78rem; border: 1px solid #e3e5ea; border-radius: 7px; padding: 3px 9px; color: #1d1d1f; }
#container .tw-tabdemo { padding: 14px; display: grid; gap: 10px; }
#container .tw-ctx { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#container .tw-ctx small { font-size: 0.62rem; color: #86868b; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-inline-end: 4px; }
#container .tw-ctx span { font-size: 0.66rem; background: #f5f5f7; border-radius: 6px; padding: 3px 8px; color: #515154; }
#container .tw-ctx span.on { background: var(--tw); color: #fff; }
#container .tw-mtab.gross { font-size: 0.74rem; font-family: Georgia, serif; }
#container .tw-mtab.gross th, #container .tw-mtab.gross td { padding: 6px 8px; }
#container .tw-mtab td.sel { background: rgba(194,65,12,0.08); outline: 1.5px solid var(--tw); outline-offset: -1.5px; }

/* ---------- Briefkopf ---------- */
#container .tw-brief { position: relative; max-width: 480px; margin-inline: auto; padding-bottom: 40px; }
#container .tw-a4 { background: #fff; aspect-ratio: 210 / 297; width: 82%; padding: 7% 8%; box-shadow: 0 30px 70px rgba(0,20,60,0.14), 0 0 0 1px rgba(0,0,0,0.05); border-radius: 4px; display: flex; flex-direction: column; gap: 8px; font-family: Arial, sans-serif; color: #1d1d1f; box-sizing: border-box; overflow: hidden; }
#container .tw-a4-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding-bottom: 8px; border-bottom: 2px solid var(--tw); }
#container .tw-a4-kopf div { display: grid; font-size: 0.5rem; color: #6e6e73; text-align: end; }
#container .tw-a4-abs { font-size: 0.46rem; color: #86868b; text-decoration: underline; margin-top: 10px; }
#container .tw-a4-an { display: grid; font-size: 0.62rem; line-height: 1.4; }
#container .tw-a4-betreff { font-size: 0.7rem; margin-top: 10px; }
#container .tw-a4 p { font-size: 0.6rem !important; color: #1d1d1f !important; line-height: 1.5 !important; font-family: Arial, sans-serif; }
#container .tw-a4 .z { display: block; height: 5px; border-radius: 3px; background: #eef0f3; }
#container .tw-a4 .z.k { width: 70%; }
#container .tw-a4-fuss { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 0.46rem; color: #86868b; border-top: 1px solid #f2f2f5; padding-top: 6px; }
#container .tw-folie { position: absolute; inset-inline-end: 0; bottom: 0; width: 56%; aspect-ratio: 16 / 9; background: #1c1917; color: #fff; border-radius: 10px; padding: 5% 6%; box-shadow: 0 30px 60px rgba(0,0,0,0.3); display: flex; flex-direction: column; justify-content: center; gap: 6px; box-sizing: border-box; }
#container .tw-folie b { font-family: 'Roboto Serif', serif; font-size: clamp(0.9rem, 1.6vw, 1.2rem); color: #fdba74; }
#container .tw-folie span { font-size: 0.7rem; color: rgba(255,255,255,0.85); }
#container .tw-folie small { position: absolute; bottom: 8px; inset-inline-end: 12px; font-size: 0.56rem; color: rgba(255,255,255,0.5); }

/* ---------- Versionen (dunkel) ---------- */
#container .tw-dark { background: #1c1917; }
#container .tw-dark h2 { color: #fff; }
#container .tw-dark .lead { color: rgba(255,255,255,0.7); }
#container .tw-t2 { color: #fdba74; }
#container .tw-feat-dark .fi { background: rgba(253,186,116,0.12); color: #fdba74; }
#container .tw-feat-dark .tw-h4 { color: #fff; }
#container .tw-feat-dark p { color: rgba(255,255,255,0.65); }
#container .tw-vers { max-width: 440px; margin-inline: auto; background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 40px 80px rgba(0,0,0,0.4); }
#container .tw-vers-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; color: #1d1d1f; margin-bottom: 10px; }
#container .tw-v { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; }
#container .tw-v.on { background: var(--tw-l); box-shadow: inset 3px 0 0 var(--tw); }
#container .tw-v .nr { width: 28px; height: 28px; border-radius: 8px; background: #f5f5f7; color: #515154; font-weight: 600; font-size: 0.74rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#container .tw-v.on .nr { background: var(--tw); color: #fff; }
#container .tw-v div { flex: 1; min-width: 0; }
#container .tw-v b { display: block; font-weight: 500; font-size: 0.82rem; color: #1d1d1f; }
#container .tw-v small { display: block; font-size: 0.68rem; color: #86868b; }
#container .tw-v .a { color: #86868b; display: inline-flex; }
#container .tw-v-btn { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; background: var(--tw); color: #fff; border-radius: 10px; padding: 9px; font-size: 0.78rem; font-weight: 500; }
#container .tw-sperre { display: flex; align-items: center; gap: 8px; margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 8px 10px; font-size: 0.72rem; }

/* ---------- Tabellen (Teilen, Formate) ---------- */
#container .tw-tab-wrap { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid #ececf0; border-radius: 20px; overflow: hidden; }
#container .tw-tab-wrap.breit { max-width: 1000px; }
#container .tw-tab { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
#container .tw-tab th, #container .tw-tab td { padding: 14px 18px; text-align: start; border-bottom: 1px solid #f2f2f5; vertical-align: middle; }
#container .tw-tab thead th { background: var(--tw-l); color: var(--tw-t); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
#container .tw-tab tbody th { font-weight: 500; color: #1d1d1f; }
#container .tw-tab tbody th .fi { display: inline-flex; width: 28px; height: 28px; border-radius: 8px; align-items: center; justify-content: center; margin-inline-end: 10px; vertical-align: middle; }
#container .tw-tab td { color: #515154; font-weight: 300; }
#container .tw-tab tr:last-child th, #container .tw-tab tr:last-child td { border-bottom: 0; }
#container .tw-fmt td { font-size: 0.88rem; }
#container .tw-fmt tbody th { white-space: nowrap; }
#container .tw-ja { display: inline-flex; align-items: center; gap: 4px; color: #15803d; font-weight: 500; }
#container .tw-nein { color: #c9cdd6; display: inline-flex; }
#container .tw-nein .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#container .tw-mehr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 1000px; margin: 40px auto 0; }
#container .tw-ki .go { margin-top: 14px; color: #fdba74; font-size: 0.9rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
#container .tw-rel { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Abschluss ---------- */
#container .tw-cta { background: linear-gradient(135deg, #431407 0%, #9a3412 55%, #c2410c 100%); }
#container .tw-cta h2 span { color: #fed7aa; }

/* ---------- Breiten ---------- */
@media (max-width: 1100px) {
    #container .tw-rel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    #container .tw-was { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    #container .tw-rel, #container .tw-mehr { grid-template-columns: minmax(0, 1fr); }
    #container .tw-toast-a { inset-inline-start: 0; }
    #container .tw-toast-b { inset-inline-end: 0; }
    #container .tw-blatt-wrap { padding: 12px 12px 0; }
    #container .tw-blatt { padding: 16px 16px 10px; }
}
@media (max-width: 600px) {
    #container .tw-tab thead { display: none; }
    #container .tw-tab tr { display: block; padding: 12px 14px; border-bottom: 1px solid #f2f2f5; }
    #container .tw-tab tr:last-child { border-bottom: 0; }
    #container .tw-tab tbody th, #container .tw-tab td { display: block; padding: 0; border: 0; white-space: normal; }
    #container .tw-tab td { margin-top: 6px; font-size: 0.86rem; }
    #container .tw-tab td::before { content: attr(data-l); display: block; font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #86868b; margin-bottom: 1px; }
    #container .tw-a4 { width: 90%; }
    #container .tw-folie { width: 64%; }
}
@media (prefers-reduced-motion: reduce) {
    #container .vk-toast { animation: none; }
}
