/* /features/nachsorge/ – Handy der Patientin, Umschalter, Posteingang, Raster (Präfix ns-) */

/* ---------- Kopf: ein iPhone allein ---------- */
.sx-stage.sx-nachsorge { margin-top: 56px; padding: 0; border: none; border-radius: 0; background: none; overflow: visible; }
.ns-kopf { display: grid; place-items: center; padding: 0 0 12px; }
.ns-kopf::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(760px, 100%); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(79,70,229,.13), rgba(79,70,229,.05) 55%, transparent); pointer-events: none; }
.ns-kopf .kp { width: 320px; }

/* Sperrbildschirm über der App: helle Statusleiste, fährt nach oben weg */
.ns-ph .kp-status { transition: color .3s; }
.ns-ph .kp-screen:has(.ksp.on) .kp-status { color: #fff; }
.ns-ph .kp-screen:has(.ksp.on) .kp-home { background: #fff; }
.ns-ph .ksp { transition: opacity .4s var(--ease), transform .5s var(--ease); }
.k-flow .ns-ph .ksp[data-at]:not(.on) { transform: translateY(-14%); pointer-events: none; }
.ns-tap { position: relative; height: 0; }
.ns-tap .k-tap { top: -38px; background: rgba(255,255,255,.55); }

/* ---------- Bausteine aus dem Posteingang ---------- */
.ns-ch { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: #e7f6ed; color: #1faf54; flex: 0 0 auto; }
.ns-ch svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ns-rt { display: flex; flex-direction: column; min-width: 0; gap: 2px; text-align: left; }
.ns-rt b { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #131722; white-space: nowrap; }
.ns-rt small { display: block; font-size: 13px; color: #9aa1ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eef0fb; color: #4f46e5; font-size: 12.5px; font-weight: 700; flex: 0 0 auto; }

.ns-b { align-self: flex-start; max-width: 82%; padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid #e6e8ee; box-shadow: 0 1px 2px rgba(19,23,34,.06); font-size: 14px; line-height: 1.5; color: #131722; text-align: left; }
.ns-b.out { align-self: flex-end; background: #4f46e5; border-color: #4f46e5; color: #fff; }
.ns-b small { display: block; margin-top: 4px; font-size: 11px; opacity: .8; }
.ns-b.out small { text-align: right; }
.ns-bb { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 10px 0 4px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.16); font-size: 13.5px; font-weight: 600; }
.ns-bb svg { width: 15px; height: 15px; fill: #fff; stroke: none; }

.ns-th { display: flex; flex-direction: column; border-radius: 12px; background: #f3f5f9; box-shadow: 0 0 0 1px #e6e8ee; overflow: hidden; }
.ns-th-h { display: flex; align-items: center; gap: 11px; min-height: 61px; padding: 12px 14px; background: #fff; border-bottom: 1px solid #e6e8ee; }
.ns-th-h .ns-rt { flex: 1; }
.kwin .ns-th-h .k-btn.hell { gap: 6px; background: #fff; color: #687184; border: 1px solid #e6e8ee; box-shadow: none; font-weight: 600; }
.ns-th-h .k-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ns-th-b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 16px 14px 18px; }
.k-flow .ns-th-b .ns-b[data-at] { transform: translateY(10px) scale(.97); }
.k-flow .ns-th-b .ns-b[data-at].on { transform: none; }

/* ---------- Abschnitt 1: Umschalter ---------- */
.ns-um { margin-top: 32px; display: flex; flex-direction: column; align-items: center; }
.ns-tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: #EFEDE6; }
.ns-tabs button { appearance: none; border: 0; padding: 10px 26px; border-radius: 999px; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.ns-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,22,27,.14); }
.ns-sel { display: none; align-self: stretch; }
.ns-sel select { width: 100%; height: 52px; padding: 0 44px 0 16px; border-radius: 14px; border: 1px solid var(--hair); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314161B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 20px; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); appearance: none; -webkit-appearance: none; }
.ns-fall { width: 100%; display: flex; flex-direction: column; align-items: center; animation: nsFall .35s var(--ease) both; }
.ns-fall[hidden] { display: none; }
@keyframes nsFall { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ns-fall > p { max-width: 560px; margin: 22px auto 0; text-align: center; font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.ns-fall-g { width: 100%; max-width: 860px; min-height: 620px; margin-top: 32px; display: grid; place-items: center; padding: 44px 40px; border-radius: 28px; border: 1px solid var(--hair); background: linear-gradient(180deg, #F6F4EE, #EFECE4); }
.ns-fall-g > .k-flow { width: 100%; display: grid; place-items: center; }
.ns-gut { max-width: 600px; }
.ns-fall-g .kp { width: 280px; }

/* Praxishub-App auf dem Handy der Behandlerin */
.ns-app { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: -46px; padding-top: 46px; background: #fff; font-family: var(--sans, inherit); }
.ns-app-h { display: flex; align-items: center; gap: 9px; padding: 6px 12px 10px 8px; border-bottom: 1px solid #e6e8ee; }
.ns-app-h > svg { width: 19px; height: 19px; fill: none; stroke: #131722; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); flex: 0 0 auto; }
.ns-app-h .ns-av { width: 32px; height: 32px; border-radius: 10px; font-size: 11.5px; }
.ns-app-h .ns-rt b { font-size: 13.5px; }
.ns-app-c { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px 10px; background: #f3f5f9; overflow: hidden; }
.ns-app-c .ns-b { max-width: 86%; padding: 8px 11px; border-radius: 14px; font-size: 12.5px; line-height: 1.42; }
.ns-app-c .ns-b small { font-size: 10px; margin-top: 3px; }
.k-flow .ns-app-c .ns-b[data-at] { display: none; }
.k-flow .ns-app-c .ns-b[data-at].on { display: block; animation: kwIn .32s var(--ease) both; }
.ns-app-f { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #e6e8ee; }
.ns-in { flex: 1; min-width: 0; height: 32px; display: flex; align-items: center; padding: 0 12px; border-radius: 16px; background: #f3f5f9; box-shadow: inset 0 0 0 1px #e6e8ee; }
.ns-in em { font-style: normal; font-size: 12px; color: #131722; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-flow .ns-in em[data-at].on { animation: nsTyp 2.1s steps(26) both; }
@keyframes nsTyp { from { max-width: 0; } to { max-width: 100%; } }
.ns-send { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #4f46e5; flex: 0 0 auto; }
.ns-send svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transform: rotate(-90deg); }
.ns-app-t { display: flex; justify-content: space-around; padding: 9px 10px 22px; border-top: 1px solid #e6e8ee; }
.ns-app-t i { display: grid; color: #9aa1ae; }
.ns-app-t i.on { color: #4f46e5; }
.ns-app-t svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Abschnitt 2: große Aussage, Posteingang wird rot ---------- */
.ns-aussage .wrap { display: flex; flex-direction: column; align-items: center; text-align: center; }
body .ns-aussage h2:not(#_):not(#__) { max-width: 14ch; margin: 0; font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.ns-aussage .wrap > p { max-width: 600px; text-wrap: balance; margin: 26px 0 0; font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.ns-aussage .wrap > .k-flow { width: 100%; max-width: 960px; margin-top: 52px; }
.ns-zwei { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; min-height: 340px; }
.ns-list { align-self: start; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px #e6e8ee; overflow: hidden; }
.ns-row { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 11px; align-items: start; padding: 13px 16px; border-bottom: 1px solid #e6e8ee; }
.ns-row:last-child { border-bottom: none; }
.ns-row > .ns-ch, .ns-row > .ns-rt, .ns-row > time, .ns-row > .k-swap { position: relative; z-index: 1; }
.ns-row .ns-ch { margin-top: 2px; }
.ns-row time, .ns-zeit { font-size: 11px; color: #9aa1ae; font-variant-numeric: tabular-nums; margin-top: 3px; }
.ns-row.neu { box-shadow: inset 3px 0 0 #4f46e5; background: #eef0fb; }
.ns-row.neu .ns-rt b { font-weight: 700; }
.ns-row.neu .ns-rt small { color: #687184; }
.ns-row.neu .ns-zeit { color: #4f46e5; font-weight: 600; }
.ns-zeit .k-sw { justify-content: flex-end; }
.ns-rotbg { position: absolute; inset: 0; background: #fde6e4; box-shadow: inset 3px 0 0 #d9463e; }
.k-flow .ns-rotbg[data-at] { transition: opacity .6s var(--ease); }
.ns-row .ns-dot { position: absolute; z-index: 1; right: 16px; top: 37px; width: 8px; height: 8px; border-radius: 50%; background: #4f46e5; }
.ns-flag { margin: 14px 14px 0; padding: 9px 13px; border-radius: 12px; background: #fdf0ef; border: 1px solid #f1cfcd; font-size: 12.5px; font-weight: 600; line-height: 1.45; color: #7d2c28; text-align: left; }
.k-flow .ns-flag[data-at] { max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; border-width: 0; overflow: hidden; transition: opacity .4s var(--ease), max-height .5s var(--ease), margin .5s var(--ease), padding .5s var(--ease); }
.k-flow .ns-flag[data-at].on { max-height: 90px; margin-top: 14px; padding-top: 9px; padding-bottom: 9px; border-width: 1px; }
.k-flow .ns-th-h .k-btn[data-at] { transform: scale(.94); }
.k-flow .ns-th-h .k-btn[data-at].on { transform: none; }

/* ---------- Abschnitt 3: Raster ---------- */
.ns-bento { margin-top: 44px; display: grid; grid-template-columns: 1.05fr 1fr 1fr; grid-template-areas: "a b c" "a d d"; gap: 18px; }
.ns-kachel { display: flex; flex-direction: column; min-width: 0; border-radius: 24px; border: 1px solid var(--hair); background: var(--paper-2); overflow: hidden; }
.ns-kachel.a { grid-area: a; } .ns-kachel.b { grid-area: b; } .ns-kachel.c { grid-area: c; } .ns-kachel.d { grid-area: d; }
.ns-kachel-g { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 30px 26px 8px; }
.ns-kachel-g > .k-flow { width: 100%; display: grid; place-items: center; }
.ns-kachel > p { margin: 0; padding: 18px 26px 26px; font-size: 17px; line-height: 1.4; font-weight: 500; color: var(--ink); text-wrap: balance; }

.ns-ta { width: 100%; max-width: 320px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px #e6e8ee, 0 14px 30px -20px rgba(19,23,34,.3); overflow: hidden; text-align: left; }
.ns-ta span { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #f3f4f8; font-size: 14.5px; color: #131722; }
.ns-ta span:last-child { border-bottom: none; }
.ns-cb { position: relative; width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #c5cad5; background: #fff; flex: 0 0 auto; }
.ns-cb.on, .ns-cb u { border-color: #4f46e5; background: #4f46e5; }
.ns-cb u { position: absolute; inset: -1.5px; border-radius: 5px; }
.ns-cb.on::after, .ns-cb u::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 8.5px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ns-cb u::after { left: 6.5px; top: 3px; }

.ns-step { display: inline-flex; align-items: center; gap: 12px; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #e6e8ee, 0 14px 30px -20px rgba(19,23,34,.3); }
.ns-step > i { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #f3f4f8; font-style: normal; font-size: 21px; color: #3d4659; }
.ns-step b { min-width: 34px; text-align: right; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #131722; }
.ns-step .k-sw { justify-content: flex-end; }
.ns-step > span { margin-right: 4px; font-size: 15px; color: #687184; }

.ns-mail { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 14px 16px 18px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px #e6e8ee, 0 14px 30px -20px rgba(19,23,34,.3); text-align: left; }
.ns-mail-h { align-self: stretch; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding-bottom: 11px; border-bottom: 1px solid #f0f1f5; }
.ns-mail-av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(180deg, #1E9BFF, #0A6CF5); color: #fff; font-size: 14px; font-weight: 600; }
.ns-mail-h small { font-size: 12px; }
.ns-mail-h time { font-size: 11.5px; color: #9aa1ae; }
.ns-mail > b { font-size: 14.5px; font-weight: 650; line-height: 1.3; color: #131722; }
.ns-mail > p { margin: 0; font-size: 13.5px; line-height: 1.45; color: #3d4659; }
.ns-mail > .k-grau { height: 8px; }

.ns-kl { width: 100%; max-width: 560px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px #e6e8ee, 0 14px 30px -20px rgba(19,23,34,.3); }
.ns-k { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 14px 16px; border-bottom: 1px solid #f3f4f8; }
.ns-k:last-child { border-bottom: none; }
.ns-k .ns-ch { margin-top: 2px; background: none; width: 16px; }
.ns-k .ns-ch svg { width: 14px; height: 14px; stroke-width: 2; }
.ns-k .ns-rt b { font-weight: 500; color: #3d4659; }
.ns-k .ns-rt em { padding: 2px 7px; border-radius: 999px; background: #f0f3f9; font-size: 10.5px; font-weight: 500; font-style: normal; color: #687184; }
.ns-k .ns-rt small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.45; color: #687184; }
.ns-k .ns-rt small .k-grau { margin: 6px 0; }
.ns-kr { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ns-kr time { font-size: 11.5px; color: #9aa1ae; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ns-kr .k-badge { padding: 2px 8px; font-size: 11px; background: #e6f4ec; color: #1a9b59; }
.k-flow .ns-kr span[data-at] { transform: scale(.8); }
.k-flow .ns-kr span[data-at].on { transform: none; }

@media (min-width: 961px) {
  .ns-kachel.b .ns-step { transform: scale(1.25); }
  .ns-kachel.a .ns-ta span { padding: 16px 18px; font-size: 15.5px; }
}
@media (max-width: 960px) {
  .ns-bento { grid-template-columns: 1fr 1fr; grid-template-areas: "a a" "b c" "d d"; }
}
@media (max-width: 720px) {
  .sx-stage.sx-nachsorge { margin-top: 36px; }
  .ns-kopf .kp { width: 300px; }
  .ns-um { margin-top: 20px; align-items: stretch; }
  .ns-tabs { display: none; }
  .ns-sel { display: block; }
  .ns-fall > p { margin-top: 16px; text-align: left; font-size: 17px; }
  .ns-fall-g { min-height: 0; margin-top: 20px; padding: 22px 14px; border-radius: 22px; }
  .ns-fall-g .kp { width: 270px; }
  .ns-b { max-width: 88%; font-size: 13.5px; padding: 9px 12px; }
  .ns-aussage .wrap { align-items: flex-start; text-align: left; }
  body .ns-aussage h2:not(#_):not(#__) { font-size: clamp(34px, 10.4vw, 48px); max-width: none; text-wrap: wrap; }
  .ns-rot .ns-th { min-height: 360px; }
  .ns-aussage .wrap > p { margin-top: 18px; font-size: 17px; }
  .ns-aussage .wrap > .k-flow { margin-top: 28px; }
  .ns-zwei { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 10px; min-height: 380px; }
  .ns-zwei .ns-list .ns-row:nth-child(n+2) { display: none; }
  .ns-rot .kwin-tabs { display: none; }
  .ns-fall-g:has(.kwin) { padding: 0; border: none; background: none; border-radius: 0; }
  .ns-th-h .k-btn { padding: 6px 9px; font-size: 12px; }
  .ns-bento { margin-top: 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c" "d"; gap: 14px; }
  .ns-kachel { border-radius: 20px; }
  .ns-kachel-g { padding: 24px 16px 4px; }
  .ns-kachel > p { padding: 16px 18px 20px; font-size: 16.5px; }
  .ns-k { grid-template-columns: auto minmax(0, 1fr); }
  .ns-kr { grid-column: 2; flex-direction: row; align-items: center; gap: 8px; }
}
