:root {
  --bg: #05060a; --card: #0d0d0f; --card-2: #17171a; --text: #edf0fb; --muted: #8790ac; --faint: #545c78;
  --border: #1e1e22; --border-strong: #323236; --accent: #f2f2f5; --ok: #3ecf8e; --ok-soft: rgba(62,207,142,.14);
  --danger: #ff5c7a; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
.pt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px max(16px, env(safe-area-inset-left)); padding-top: calc(14px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--border); }
.pt-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.pt-brand img { border-radius: 6px; }
.pt-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.pt-status { color: var(--muted); padding: 40px 0; text-align: center; }
.pt-status.pt-error { color: var(--danger); }
h1 { font-size: 22px; margin: 0 0 6px; }
.pt-lead { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }
.pt-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pt-chip { border: 1px solid var(--border-strong); background: var(--card-2); color: var(--muted); border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pt-chip.active { background: var(--accent); color: #0a0a0c; border-color: var(--accent); }
.pt-list { display: flex; flex-direction: column; gap: 14px; }
.pt-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pt-card.done { opacity: .78; }
.pt-img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.pt-body { padding: 4px 16px 16px; }
.pt-body[hidden] { display: none; }
.pt-card-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.35; }
.pt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pt-tag { font-size: 11px; padding: 2px 9px; border-radius: 20px; background: var(--card-2); border: 1px solid var(--border-strong); color: var(--muted); }
.pt-tag.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.pt-note { font-size: 14px; line-height: 1.55; color: #cfd3e6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.pt-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.pt-row { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.pt-check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.pt-check input { width: 22px; height: 22px; accent-color: var(--ok); cursor: pointer; }
.pt-comment { width: 100%; margin-top: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.45; resize: vertical; min-height: 64px; }
.pt-comment:focus { outline: none; border-color: var(--muted); }
.pt-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 36px; }
.pt-btn { border: 1px solid var(--border-strong); background: var(--card-2); color: var(--text); border-radius: 8px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pt-btn:disabled { opacity: .6; cursor: default; }
.pt-btn-ghost { background: none; color: var(--muted); }
.pt-saved { font-size: 12px; color: var(--ok); }
.pt-err { font-size: 12px; color: var(--danger); }
.pt-empty { text-align: center; color: var(--muted); padding: 36px 8px; font-size: 14px; }
a { color: var(--text); }

.pt-sec { margin-top: 10px; }
.pt-sec-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
.pt-pre { white-space: pre-wrap; }

.pt-summary { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 52px; }
.pt-summary:hover { background: var(--card-2); }
.pt-summary:focus-visible { outline: 2px solid var(--muted); outline-offset: -2px; }
.pt-summary-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-summary-meta { font-size: 12px; color: var(--muted); }
.pt-chev { font-size: 22px; line-height: 1; color: var(--muted); transition: transform .15s ease; flex: none; }
.pt-card.open .pt-chev { transform: rotate(90deg); }
.pt-card.open .pt-summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.pt-list { gap: 10px; }
.pt-img { margin: 0 -16px 12px; width: calc(100% + 32px); max-width: none; }
@media (prefers-reduced-motion: reduce) { .pt-chev { transition: none; } }

/* ---- Bereiche (Tabs) ---- */
.pt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 16px; overflow-x: auto; scrollbar-width: none; }
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tab { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 10px 12px; cursor: pointer; margin-bottom: -1px; }
.pt-tab.active { color: var(--text); border-bottom-color: var(--text); }
.pt-tab .pt-count { font-weight: 500; color: var(--faint); margin-left: 4px; }
.pt-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pt-toolbar:empty { display: none; }
.pt-btn-primary { background: var(--accent); color: #0a0a0c; border-color: var(--accent); }
.pt-task { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.pt-task input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ok); margin: 1px 0 0; flex: none; cursor: pointer; }
.pt-task-main { flex: 1; min-width: 0; }
.pt-task-text { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.pt-card.done .pt-task-text { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.pt-task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.pt-tag.due { color: #ffb238; background: rgba(255,178,56,.12); border-color: transparent; }
.pt-tag.urgent { color: var(--danger); background: rgba(255,92,122,.12); border-color: transparent; }
.pt-task-comment-toggle { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 2px 0; }
.pt-mycomment { font-size: 13px; color: #cfd3e6; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--border-strong); white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-doc-actions { display: flex; gap: 8px; margin-top: 12px; }
.pt-summary-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-card.open .pt-summary-preview { display: none; }

/* gegliederte Texte (richtext.js) */
.rt { font-size: 14.5px; line-height: 1.6; color: #dfe3f2; }
.rt-h { font-weight: 700; font-size: 14px; margin: 14px 0 4px; color: var(--text); }
.rt-h:first-child { margin-top: 0; }
.rt-p { margin: 4px 0 10px; }
.rt-list { margin: 2px 0 10px; padding-left: 22px; }
.rt-list li { margin: 4px 0; }
.rt-list li::marker { color: var(--muted); }
.rt-list li.rt-sub { margin-left: 18px; list-style-type: circle; }
.pt-tabs[hidden], .pt-filters:empty { display: none; }
.pt-newtask { width: 100%; padding: 12px 14px 10px; }
.pt-newtask .pt-comment { margin-top: 0; min-height: 84px; }
.pt-newtask-row { flex-wrap: wrap; justify-content: flex-end; }
.pt-newtask-date { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-right: auto; }
.pt-date { background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px; color-scheme: dark; }
.pt-danger { color: var(--danger); }
.pt-err:empty { display: none; }
.pt-note { padding: 14px 16px; }
.pt-note-text { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-note-link { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.pt-note .pt-task-meta { margin-top: 8px; }
.pt-newtask-row .pt-err { margin-right: auto; }
.pt-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pt-newtask-row .pt-saved { margin-right: auto; font-size: 13px; }

/* Reiter: auf dem Handy umbrechen statt seitlich scrollen (nichts lässt sich mehr verziehen) */
html, body { overflow-x: hidden; overscroll-behavior-x: none; }
.pt-tabs { flex-wrap: wrap; overflow: visible; gap: 6px; border-bottom: 0; margin: 14px 0 16px; }
.pt-tab { border: 1px solid var(--border-strong); border-radius: 20px; padding: 8px 14px; margin: 0; font-size: 14px; line-height: 1.2; background: var(--card-2); color: var(--muted); }
.pt-tab.active { background: var(--accent); color: #0a0a0c; border-color: var(--accent); }
.pt-main { overflow-x: hidden; }
.pt-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#pt-push.on { color: var(--ok); border-color: rgba(62,207,142,.5); }
.pt-pushhint { font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; line-height: 1.45; }
.pt-tag.foryou { color: #0a0a0c; background: var(--ok); border-color: transparent; font-weight: 700; }
@media (max-width: 420px) { .pt-head .pt-btn { padding: 8px 10px; font-size: 12.5px; } .pt-brand span { display: none; } }
.pt-steps { margin: 6px 0 0; padding-left: 20px; }
.pt-steps li { margin: 4px 0; }
.pt-pushhint { margin-bottom: 12px; }

/* ---------- Gemeinsame Bausteine für Creative Scoring und Versand im Kundenportal ----------
   Dieselben Variablen und Grundklassen wie in der App (styles.css), damit scoring.css und versand.css hier gleich aussehen. */
:root {
  --bg-elevated: #0d0d0f; --bg-elevated-2: #17171a; --text-muted: #8790ac; --text-faint: #545c78;
  --accent-ink: #0a0a0c; --neutral-soft: rgba(255,255,255,.06); --fill: #1c1c1f; --fill-hover: #28282c;
  --danger-soft: rgba(255,92,122,.14); --warning: #ffb238; --warning-soft: rgba(255,178,56,.14);
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
}
.empty-state { text-align: center; color: var(--text-faint); padding: 40px 16px; font-size: 14px; }
.toolbar-btn { border: none; background: var(--fill); color: var(--text-muted); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; }
.toolbar-btn:hover { background: var(--fill-hover); color: var(--text); }
.toolbar-btn:disabled { opacity: .55; cursor: default; }
.ku-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; margin-right: 4px; display: inline-block; }
.ku-tag-grey { background: var(--bg-elevated-2); color: var(--text-faint); border: 1px solid var(--border-strong); }
.ku-tag-green { background: rgba(62,207,142,.14); color: #3ecf8e; }
.ku-tag-amber { background: var(--warning-soft); color: var(--warning); }
.pl-tabs { display: flex; gap: 4px; background: var(--bg-elevated-2); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 1rem; overflow-x: auto; }
.pl-tab { flex: 1; border: none; background: none; color: var(--text-faint); font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: calc(var(--radius-sm) - 2px); font-family: inherit; cursor: pointer; white-space: nowrap; }
.pl-tab.active { background: var(--bg-elevated); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cs-input { width: 100%; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 13.5px; padding: 8px 10px; }
.cs-input:focus { outline: none; border-color: var(--text-muted); }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: .6rem 0; }
.ad-tile { display: flex; flex-direction: column; gap: 2px; background: var(--bg-elevated-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; min-width: 0; }
.ad-tile-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.ad-tile-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ad-tile-sub { font-size: 11.5px; color: var(--text-faint); }
.pt-main.pt-wide { max-width: 1040px; }
.pt-embed { min-width: 0; }
.pt-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); max-width: min(92vw, 520px); background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-md); font-size: 13.5px; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.pt-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .pt-toast { transition: none; } }
