/* =====================================================================
   Brieftool „Brücke" — Styles
   Mount: .nc-brief  ·  WhatsApp-artiger Chat + edles Brief-Papier
   ===================================================================== */

.nc-brief {
    --nc-brief-ink: #1f2937;
    --nc-brief-paper: #fffdf7;
    --nc-brief-paper-edge: #ece3cf;
    --nc-brief-accent: #6d5bd0;
    --nc-brief-accent-2: #8b76e8;
    --nc-brief-wa-bg: #e9e2d8;
    --nc-brief-wa-head: #128c7e;
    --nc-brief-wa-out: #d9fdd3;
    --nc-brief-wa-in: #ffffff;
    --nc-brief-radius: 20px;
    --nc-brief-shadow: 0 18px 50px rgba(31, 41, 55, .14);
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--nc-brief-ink);
    -webkit-font-smoothing: antialiased;
}

.nc-brief * { box-sizing: border-box; }

.nc-brief-card {
    background: #fff;
    border-radius: var(--nc-brief-radius);
    box-shadow: var(--nc-brief-shadow);
    overflow: hidden;
}

/* ---------- SETUP ---------- */
.nc-brief-setup { padding: 30px 26px 34px; }
.nc-brief-hero { text-align: center; margin-bottom: 22px; }
.nc-brief-hero-emoji {
    font-size: 48px; line-height: 1;
    filter: drop-shadow(0 6px 14px rgba(109, 91, 208, .3));
    animation: nc-brief-float 4s ease-in-out infinite;
}
@keyframes nc-brief-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.nc-brief-hero-title { font-size: 27px; font-weight: 800; margin: 12px 0 8px; letter-spacing: -.02em; }
.nc-brief-hero-sub { font-size: 15px; line-height: 1.6; color: #5b6472; margin: 0 auto; max-width: 540px; }

.nc-brief-rolecards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 8px; }
.nc-brief-rolecard {
    text-align: left; cursor: pointer; border: 2px solid #eceaf6; background: #faf9ff;
    border-radius: 16px; padding: 16px 16px 15px; transition: .18s; font: inherit; color: inherit;
}
.nc-brief-rolecard:hover { border-color: var(--nc-brief-accent-2); transform: translateY(-2px); }
.nc-brief-rolecard.is-active { border-color: var(--nc-brief-accent); background: #f1edff; box-shadow: 0 8px 22px rgba(109,91,208,.16); }
.nc-brief-rolecard-emoji { font-size: 26px; }
.nc-brief-rolecard-title { font-weight: 700; font-size: 16px; margin: 6px 0 3px; }
.nc-brief-rolecard-desc { font-size: 13px; color: #6b7280; line-height: 1.45; }

.nc-brief-fieldrow { margin-top: 18px; }
.nc-brief-fieldlabel { font-size: 13.5px; font-weight: 700; color: #424b5a; margin-bottom: 9px; }
.nc-brief-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-brief-chip {
    cursor: pointer; border: 1.5px solid #e3e1ee; background: #fff; color: #4b5563;
    border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; transition: .15s;
}
.nc-brief-chip:hover { border-color: var(--nc-brief-accent-2); }
.nc-brief-chip.is-active { background: var(--nc-brief-accent); border-color: var(--nc-brief-accent); color: #fff; }

.nc-brief-idcards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nc-brief-idcard {
    text-align: left; cursor: pointer; border: 1.5px solid #e3e1ee; background: #fff;
    border-radius: 13px; padding: 13px 14px; transition: .16s; font: inherit; color: inherit;
}
.nc-brief-idcard:hover { border-color: var(--nc-brief-accent-2); }
.nc-brief-idcard.is-active { border-color: var(--nc-brief-accent); background: #f1edff; box-shadow: 0 6px 16px rgba(109,91,208,.14); }
.nc-brief-idcard-emoji { font-size: 20px; }
.nc-brief-idcard-title { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
.nc-brief-idcard-desc { font-size: 12.5px; color: #6b7280; line-height: 1.4; }
.nc-brief-anon-note {
    margin-top: 11px; background: #eef2ff; border: 1px solid #d3dafa; border-radius: 11px;
    padding: 11px 14px; font-size: 13px; line-height: 1.5; color: #3f3a73;
}
.nc-brief-modal-sub { font-size: 12px; color: #9aa3b0; margin-top: 2px; }

.nc-brief-namegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.nc-brief-sender-wrap { display: flex; }
.nc-brief-sender-wrap .nc-brief-field { width: 100%; }
.nc-brief-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #424b5a; }
.nc-brief-input {
    width: 100%; border: 1.5px solid #e1e0ec; border-radius: 11px; padding: 11px 13px;
    font-size: 15px; font-family: inherit; color: var(--nc-brief-ink); background: #fff; transition: .15s;
}
.nc-brief-input:focus { outline: none; border-color: var(--nc-brief-accent); box-shadow: 0 0 0 3px rgba(109,91,208,.13); }

.nc-brief-privacy {
    display: flex; gap: 11px; align-items: flex-start; margin-top: 22px;
    background: #f0fbf4; border: 1px solid #c7eed5; border-radius: 13px; padding: 13px 15px;
    font-size: 13.5px; line-height: 1.5; color: #1f5135;
}
.nc-brief-lock { font-size: 17px; }

.nc-brief-start {
    width: 100%; margin-top: 22px; padding: 15px; font-size: 16.5px; font-weight: 700;
}

/* ---------- BUTTONS ---------- */
.nc-brief-btn {
    cursor: pointer; border: 1.5px solid #e1e0ec; background: #fff; color: #3a4150;
    border-radius: 12px; padding: 11px 16px; font-size: 14.5px; font-weight: 700; font-family: inherit;
    transition: .16s; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.nc-brief-btn:hover { border-color: var(--nc-brief-accent-2); transform: translateY(-1px); }
.nc-brief-btn--primary {
    background: linear-gradient(135deg, var(--nc-brief-accent), var(--nc-brief-accent-2));
    border-color: transparent; color: #fff; box-shadow: 0 10px 24px rgba(109,91,208,.28);
}
.nc-brief-btn--primary:hover { box-shadow: 0 14px 30px rgba(109,91,208,.36); }
.nc-brief-link { background: none; border: none; cursor: pointer; color: var(--nc-brief-accent); font-weight: 700; font-size: 14px; font-family: inherit; padding: 6px; }
.nc-brief-link:hover { text-decoration: underline; }

/* ---------- CHAT (WhatsApp) ---------- */
.nc-brief-chat { display: flex; flex-direction: column; height: min(76vh, 680px); }
.nc-brief-chathead {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--nc-brief-wa-head); color: #fff;
}
.nc-brief-back { background: none; border: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .9; }
.nc-brief-avatar {
    width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none;
}
.nc-brief-chathead-name { font-weight: 700; font-size: 16px; }
.nc-brief-chathead-status { font-size: 12.5px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.nc-brief-dot { width: 7px; height: 7px; border-radius: 50%; background: #7CFC9B; box-shadow: 0 0 0 0 rgba(124,252,155,.7); animation: nc-brief-pulse 2s infinite; }
@keyframes nc-brief-pulse { 0% { box-shadow: 0 0 0 0 rgba(124,252,155,.6); } 70% { box-shadow: 0 0 0 7px rgba(124,252,155,0); } 100% { box-shadow: 0 0 0 0 rgba(124,252,155,0); } }

.nc-brief-thread {
    flex: 1; overflow-y: auto; padding: 16px 14px 8px;
    background-color: var(--nc-brief-wa-bg);
    background-image:
        radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px),
        radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
    background-size: 22px 22px; background-position: 0 0, 11px 11px;
}
.nc-brief-daysep { text-align: center; margin: 4px 0 14px; }
.nc-brief-daysep span {
    display: inline-block; background: #fdf4d4; color: #6b5b16; font-size: 12px; font-weight: 600;
    padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06);
}

.nc-brief-bubble {
    max-width: 80%; margin-bottom: 9px; padding: 7px 11px 6px; border-radius: 9px;
    font-size: 14.7px; line-height: 1.45; position: relative; word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,.08); animation: nc-brief-pop .22s ease;
}
@keyframes nc-brief-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.nc-brief-bubble--bot { background: var(--nc-brief-wa-in); border-top-left-radius: 2px; margin-right: auto; }
.nc-brief-bubble--user { background: var(--nc-brief-wa-out); border-top-right-radius: 2px; margin-left: auto; }
.nc-brief-bubble-text { white-space: pre-wrap; }
.nc-brief-bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 10.5px; color: #667781; margin-top: 2px; }
.nc-brief-ticks { color: #53bdeb; font-size: 11px; }

.nc-brief-typing-dots { display: flex; gap: 4px; padding: 3px 2px; }
.nc-brief-typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #9aa7b1; animation: nc-brief-typing 1.3s infinite; }
.nc-brief-typing-dots span:nth-child(2) { animation-delay: .2s; }
.nc-brief-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes nc-brief-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.nc-brief-compose-cta {
    margin: 0 12px 8px; padding: 11px; border: none; cursor: pointer; font-family: inherit;
    border-radius: 12px; font-size: 14.5px; font-weight: 700;
    background: #fff; color: var(--nc-brief-accent); border: 1.5px dashed var(--nc-brief-accent-2);
    transition: .2s;
}
.nc-brief-compose-cta.is-ready {
    background: linear-gradient(135deg, var(--nc-brief-accent), var(--nc-brief-accent-2));
    color: #fff; border-style: solid; border-color: transparent; box-shadow: 0 8px 20px rgba(109,91,208,.3);
    animation: nc-brief-glow 1.8s ease-in-out infinite;
}
@keyframes nc-brief-glow { 0%,100% { box-shadow: 0 8px 20px rgba(109,91,208,.3); } 50% { box-shadow: 0 8px 30px rgba(109,91,208,.5); } }

.nc-brief-inputbar { display: flex; gap: 9px; align-items: flex-end; padding: 10px 12px; background: #f3efe9; }
.nc-brief-chatinput {
    flex: 1; resize: none; border: none; border-radius: 22px; padding: 11px 16px;
    font-size: 15px; font-family: inherit; line-height: 1.4; max-height: 140px; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.nc-brief-chatinput:focus { outline: none; box-shadow: 0 0 0 2px rgba(109,91,208,.25); }
.nc-brief-sendbtn {
    flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--nc-brief-wa-head); color: #fff; font-size: 18px; transition: .15s;
    display: flex; align-items: center; justify-content: center;
}
.nc-brief-sendbtn:hover { transform: scale(1.06); }
.nc-brief-micbtn {
    flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
    background: #fff; color: #54656f; font-size: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.12); transition: .15s;
    display: flex; align-items: center; justify-content: center;
}
.nc-brief-micbtn:hover { transform: scale(1.06); }
.nc-brief-micbtn.is-rec { background: #ef4444; color: #fff; animation: nc-brief-recpulse 1.3s infinite; }
@keyframes nc-brief-recpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 9px rgba(239,68,68,0); } }

/* ---------- LETTER LOADING ---------- */
.nc-brief-loading { padding: 50px 30px; text-align: center; }
.nc-brief-penwrap { font-size: 44px; animation: nc-brief-write 1.6s ease-in-out infinite; }
@keyframes nc-brief-write { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateX(6px); } }
.nc-brief-loading-text { margin: 16px 0 18px; font-size: 16px; font-weight: 600; color: #4b5563; }
.nc-brief-loading-bar { height: 6px; width: 220px; margin: 0 auto; background: #eceaf6; border-radius: 99px; overflow: hidden; }
.nc-brief-loading-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--nc-brief-accent), var(--nc-brief-accent-2)); border-radius: 99px; animation: nc-brief-load 1.2s ease-in-out infinite; }
@keyframes nc-brief-load { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---------- LETTER VIEW ---------- */
.nc-brief-letterview { padding: 26px 24px 30px; }
.nc-brief-letter-head h2 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.nc-brief-hint { font-size: 13.5px; color: #6b7280; margin: 0 0 18px; }

.nc-brief-letter-paper {
    background: var(--nc-brief-paper);
    border: 1px solid var(--nc-brief-paper-edge);
    border-radius: 8px;
    padding: 40px 42px;
    box-shadow: 0 12px 34px rgba(120, 100, 50, .12), inset 0 0 60px rgba(180,160,110,.05);
    position: relative;
    background-image: repeating-linear-gradient(transparent, transparent 31px, rgba(150,130,90,.07) 32px);
    line-height: 32px;
}
.nc-brief-letter-paper::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, #e7b6b6, #e7d3b6); border-radius: 8px 0 0 8px; opacity: .5;
}
.nc-brief-letter-date { text-align: right; font-size: 14px; color: #8a7c5c; margin-bottom: 18px; font-family: Georgia, serif; }
.nc-brief-letter-body {
    font-family: Georgia, "Times New Roman", serif; font-size: 17px; color: #2a2620;
    white-space: pre-wrap; line-height: 32px;
}

/* Schriftstile (Vorschau + Druck) */
.nc-brief-font--maschine .nc-brief-letter-body,
.nc-brief-font--maschine .nc-brief-print-body {
    font-family: "Courier New", Courier, monospace; letter-spacing: .2px; font-size: 16px;
}
.nc-brief-font--handschrift .nc-brief-letter-body,
.nc-brief-font--handschrift .nc-brief-print-body {
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 19px; line-height: 34px;
}

.nc-brief-fontswitch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.nc-brief-fontswitch-label { font-size: 13px; font-weight: 700; color: #6b7280; }
.nc-brief-fontchip {
    cursor: pointer; border: 1.5px solid #e3e1ee; background: #fff; color: #4b5563;
    border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; font-family: inherit; transition: .15s;
}
.nc-brief-fontchip:hover { border-color: var(--nc-brief-accent-2); }
.nc-brief-fontchip.is-active { background: var(--nc-brief-accent); border-color: var(--nc-brief-accent); color: #fff; }

.nc-brief-edit {
    width: 100%; min-height: 320px; border: 1.5px solid #e1e0ec; border-radius: 12px;
    padding: 20px; font-family: Georgia, serif; font-size: 16px; line-height: 1.7; color: var(--nc-brief-ink);
    resize: vertical;
}
.nc-brief-edit:focus { outline: none; border-color: var(--nc-brief-accent); }

.nc-brief-toolbar { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.nc-brief-regen { display: flex; justify-content: space-between; margin-top: 14px; }
.nc-brief-disclaimer { margin-top: 20px; font-size: 12.5px; color: #8a93a0; line-height: 1.5; text-align: center; }

.nc-brief-error { color: #b4232a; font-weight: 600; margin: 0 0 16px; }

/* ---------- IMPACT-VORSCHAU „So könnte es ankommen" ---------- */
.nc-brief-impact {
    margin-top: 16px; border: 1px solid #f3d4e2; border-radius: 14px; overflow: hidden;
    background: linear-gradient(180deg, #fff5f9, #fffdfe); animation: nc-brief-pop .25s ease;
}
.nc-brief-impact-head {
    padding: 13px 18px; font-weight: 800; font-size: 15px; color: #9d2b66;
    background: #fde7f1; border-bottom: 1px solid #f6cfe0;
}
.nc-brief-impact-body { padding: 16px 18px; }
.nc-brief-impact-text { font-size: 15px; line-height: 1.65; color: #3f2e3a; white-space: pre-wrap; }
.nc-brief-impact-foot { margin-top: 12px; font-size: 12px; color: #b98aa6; font-style: italic; }

/* ---------- BEDENKZEIT-BANNER (Wiederaufnahme) ---------- */
.nc-brief-resume {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    background: #fff8ec; border: 1px solid #f3e2bf; border-radius: 14px; padding: 14px 18px; margin-bottom: 18px;
}
.nc-brief-resume-text { font-size: 14px; color: #7a5d1f; line-height: 1.45; }
.nc-brief-resume-actions { display: flex; align-items: center; gap: 12px; }
.nc-brief-resume-actions .nc-brief-btn { padding: 9px 16px; }

/* ---------- MODAL ---------- */
.nc-brief-overlay {
    position: fixed; inset: 0; background: rgba(20,24,40,.5); backdrop-filter: blur(3px);
    z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 18px;
    animation: nc-brief-fade .18s ease;
}
@keyframes nc-brief-fade { from { opacity: 0; } to { opacity: 1; } }
.nc-brief-modalbox {
    background: #fff; border-radius: 18px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: nc-brief-rise .2s ease;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
@keyframes nc-brief-rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.nc-brief-modalhead { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.nc-brief-modalhead h3 { margin: 0; font-size: 18px; font-weight: 800; }
.nc-brief-modalclose { background: none; border: none; font-size: 26px; line-height: 1; color: #9aa3b0; cursor: pointer; }
.nc-brief-modalbody { padding: 4px 20px 8px; display: flex; flex-direction: column; gap: 11px; }
.nc-brief-modalbody .nc-brief-input { margin: 0; }
.nc-brief-modal-lead { font-size: 13.5px; color: #5b6472; line-height: 1.5; margin: 0 0 4px; }
.nc-brief-addr-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.nc-brief-hr { border: none; border-top: 1px solid #eee; margin: 6px 0; }
.nc-brief-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: #3a4150; line-height: 1.45; cursor: pointer; }
.nc-brief-check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--nc-brief-accent); flex: none; }
.nc-brief-muted { color: #9aa3b0; }
.nc-brief-modalfoot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 20px; }
.nc-brief-modalfoot .nc-brief-btn { flex: 1; }

/* ---------- TOAST ---------- */
.nc-brief-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
    background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
    box-shadow: 0 12px 30px rgba(0,0,0,.3); z-index: 100000; opacity: 0; pointer-events: none; transition: .25s;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.nc-brief-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- THANK YOU ---------- */
.nc-brief-thankyou { padding: 48px 32px; text-align: center; }
.nc-brief-thankyou-emoji { font-size: 50px; }
.nc-brief-thankyou h1 { font-size: 25px; font-weight: 800; margin: 14px 0 12px; }
.nc-brief-thankyou p { font-size: 15px; line-height: 1.6; color: #4b5563; max-width: 480px; margin: 0 auto 12px; }
.nc-brief-thankyou .nc-brief-btn { margin-top: 14px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 560px) {
    .nc-brief-rolecards, .nc-brief-namegrid { grid-template-columns: 1fr; }
    .nc-brief-setup, .nc-brief-letterview { padding: 22px 16px 26px; }
    .nc-brief-letter-paper { padding: 28px 22px; }
    .nc-brief-toolbar .nc-brief-btn { flex: 1 1 calc(50% - 5px); }
    .nc-brief-hero-title { font-size: 23px; }
}

/* ---------- PRINT ---------- */
.nc-brief-print-root { display: none; }
@media print {
    html.nc-brief-printing body > *:not(.nc-brief-print-root) { display: none !important; }
    html.nc-brief-printing .nc-brief-print-root {
        display: block !important; position: static; margin: 0; padding: 0;
    }
    .nc-brief-print-paper {
        font-family: Georgia, "Times New Roman", serif; color: #1a1a1a;
        padding: 26mm 24mm; max-width: 100%;
    }
    .nc-brief-print-date { text-align: right; font-size: 12pt; color: #444; margin-bottom: 16mm; }
    .nc-brief-print-body { font-size: 13pt; line-height: 1.85; white-space: pre-wrap; }
    .nc-brief-print-paper.nc-brief-font--maschine .nc-brief-print-body { font-family: "Courier New", Courier, monospace; }
    .nc-brief-print-paper.nc-brief-font--handschrift .nc-brief-print-body { font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-size: 15pt; line-height: 2; }
    @page { margin: 0; size: A4; }
}

/* ---------- ACCESSIBILITY: reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
    .nc-brief *,
    .nc-brief-overlay, .nc-brief-modalbox, .nc-brief-toast,
    .nc-brief-print-root * {
        animation: none !important;
        transition: none !important;
    }
    .nc-brief-hero-emoji, .nc-brief-penwrap, .nc-brief-dot,
    .nc-brief-micbtn.is-rec, .nc-brief-compose-cta.is-ready { animation: none !important; }
}
