/* Phanimenal comments: list, cards, form, paragraph bubbles, highlights, panel.
   Colours only from the tokens in main.css, so section colours and dark mode apply by themselves. */

/* ===================== Section ===================== */
section.cm { margin-top: 64px; }
.cm-shead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin-bottom: 22px; }
.cm-big { font-weight: 900; font-stretch: 62%; text-transform: uppercase; font-size: clamp(58px, 11vw, 104px); line-height: .8; letter-spacing: -.02em; }
.cm-shead .tate { font-size: 19px; color: var(--red-t); }
.cm-sub { display: grid; gap: 4px; margin-left: auto; padding-bottom: 4px; text-align: right; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.cm-count { color: var(--red-t); font-weight: 500; }
@media (max-width: 560px) { .cm-sub { margin-left: 0; text-align: left; flex-basis: 100%; } }

.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.cm-bar-l { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin-right: 4px; }
.cm-bar .chip { cursor: pointer; padding: 6px 13px; font-size: 11.5px; }
.cm-bar .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cm-tip { display: flex; gap: 8px; margin: 0 0 22px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; color: var(--mute); }
.cm-tip-i { color: var(--red-t); }

.cm-empty, .cm-closed, .cm-sheet-empty { padding: 22px 18px; border: 2.5px dashed var(--ink); font-family: var(--f-mono); font-size: 13.5px; line-height: 1.55; text-align: center; }
.cm-closed { margin-top: 24px; }

/* ===================== Comments: compact feed ===================== */
/* Social-media rows (Instagram/YouTube style): avatar | name, text, small action row. No boxes; replies indented. */
.cm-list, .cm-kids { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cm-list { margin-bottom: 8px; }
.cm-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; align-items: start; min-width: 0; color: var(--ink); }
.cm-body { min-width: 0; }
.cm-bubble { position: relative; min-width: 0; }
.cm.is-pending > .cm-card .cm-bubble { padding-left: 8px; border-left: 2px dashed var(--mute); }
.cm.is-reported > .cm-card { opacity: .45; }
.cm-head { display: flex; align-items: center; min-width: 0; }
.cm-av { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); overflow: hidden; display: grid; place-items: center; background: hsl(var(--h, 0) 58% 40%); color: #FFF; font-weight: 900; font-stretch: 70%; font-size: 14.5px; letter-spacing: .02em; line-height: 1; }
.cm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cm-who { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; min-width: 0; }
.cm-name { font-weight: 800; font-stretch: 88%; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.cm-badge { background: var(--red); color: var(--on-red); font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding: 1px 5px; transform: rotate(-3deg); }
.cm-ref { margin: 2px 0 0; padding: 0 0 0 8px; border-left: 2px solid var(--red); font-size: 12.5px; line-height: 1.4; font-weight: 600; color: var(--mute); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.cm-ref a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.cm-ref a:hover { background: var(--tint); }
.cm-ref.is-gone { border-left-style: dashed; font-weight: 500; }
.cm-ref small { font-family: var(--f-mono); font-size: 11px; }
.cm-text { margin-top: 2px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.cm-text p { margin: 0 0 .5em; }
.cm-text p:last-child { margin-bottom: 0; }
.cm-text code { font-family: var(--f-mono); font-size: .88em; background: var(--paper); padding: 1px 4px; }
.cm-text a { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cm-wait { display: inline-block; margin: 6px 0 0; padding: 3px 7px; background: var(--tint); font-family: var(--f-mono); font-size: 11px; }

/* Spoilers: blurred until tapped */
.cm-sp { cursor: pointer; padding: 0 3px; background: repeating-linear-gradient(-45deg, var(--paper-2) 0 6px, var(--stripe) 6px 12px); filter: blur(5px); user-select: none; -webkit-user-select: none; transition: filter .2s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cm-sp:hover { filter: blur(4px); }
.cm-sp.is-open, html:not(.js) .cm-sp:focus { filter: none; background: var(--tint); user-select: text; -webkit-user-select: text; }
.cm-sp:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; filter: blur(3px); }
.cm-sp.is-open:focus-visible { filter: none; }

/* Action row under the bubble: Gefällt mir · Antworten · Zeit ……… Melden · Bearbeiten */
.cm-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin: 1px 0 0 -6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.cm-acts > * { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 0 6px; border: 0; background: none; color: var(--mute); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.cm-acts > *:hover { color: var(--ink); background: var(--paper-2); }
.cm-like .ico { width: 15px; height: 15px; }
.cm-like[aria-pressed="true"] { color: var(--red-t); }
.cm-like[aria-pressed="true"] .ico { fill: var(--red); stroke: var(--red); }
.cm-like.is-bump .ico { animation: cmbump .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cmbump { 40% { transform: scale(1.35); } }
.cm-like-n { min-width: 1ch; }
.cm-reply { color: var(--ink); font-weight: 500; }
.cm-acts .cm-time { text-transform: none; letter-spacing: .02em; }
.cm-report { margin-left: auto; }
.cm-report.is-ask { color: var(--red-t); font-weight: 500; }
.cm-report:disabled { cursor: default; opacity: .7; }
.cm-report:disabled:hover { background: none; color: var(--mute); }
/* Melden / Bearbeiten only show on hover or keyboard focus (desktop); always on touch screens */
@media (hover: hover) {
  .cm-report:not(.is-ask):not(:disabled), .cm-edit { opacity: 0; transition: opacity .15s; }
  .cm-card:hover .cm-report, .cm-card:hover .cm-edit, .cm-acts:focus-within .cm-report, .cm-acts:focus-within .cm-edit { opacity: 1; }
}

/* Replies: hang off a thin ink line from the parent's avatar; smaller avatars */
.cm-kids { margin: 8px 0 0 46px; gap: 10px; }
.cm-kids .cm-card { grid-template-columns: 26px minmax(0, 1fr); gap: 0 8px; }
.cm-kids .cm-av { width: 26px; height: 26px; font-size: 11px; border-width: 1.5px; }
li.cm > .cm-form { margin: 10px 0 4px 46px; }
@media (max-width: 640px) {
  .cm-kids .cm-kids .cm-kids { margin-left: 0; }
  li.cm > .cm-form { margin-left: 0; }
}

/* New comment: short pop */
.cm.is-new > .cm-card { animation: cmnew 1.2s ease-out; }
@keyframes cmnew { 0%, 40% { background: var(--tint); box-shadow: 0 0 0 6px var(--tint); } }

/* ===================== Form ===================== */
.cm-respond { margin-top: 40px; }
.cm-form-h { font-weight: 900; font-stretch: 70%; text-transform: uppercase; font-size: 30px; line-height: 1; margin-bottom: 14px; }
.cm-form-h span { font-family: var(--f-jp); font-size: 15px; letter-spacing: .1em; color: var(--red-t); }
.cm-form { position: relative; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 8px 8px 0 var(--red); padding: 18px 18px 14px; }
li.cm .cm-form, .cm-sheet .cm-form { box-shadow: 5px 5px 0 var(--red); }
.cm-list .cm-form { margin: 12px 0 4px; }
.cm-ctx { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 12px; padding: 6px 10px; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; }
.cm-ctx-x { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cm-ctx-x:hover { color: var(--red-hi); }
.cm-lab { display: block; margin-bottom: 5px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.cm-lab small { text-transform: none; letter-spacing: 0; color: var(--mute); }
.cm-req { color: var(--red-t); }
.cm-form textarea, .cm-form input[type="text"], .cm-form input[type="email"] { display: block; width: 100%; border: 2.5px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); padding: 10px 12px; font-size: 16px; line-height: 1.5; -webkit-appearance: none; appearance: none; transition: box-shadow .15s; }
.cm-form textarea { min-height: 116px; resize: vertical; font-family: var(--f-disp); }
.cm-form textarea::placeholder, .cm-form input::placeholder { color: var(--ph-c); }
.cm-form textarea:focus, .cm-form input[type="text"]:focus, .cm-form input[type="email"]:focus { outline: none; box-shadow: 4px 4px 0 var(--red); }
.cm-form [aria-invalid="true"] { border-color: var(--red); box-shadow: 4px 4px 0 var(--red); }
.cm-help { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin: 6px 0 14px; font-family: var(--f-mono); font-size: 11.5px; color: var(--mute); }
.cm-help code { font-family: var(--f-mono); background: var(--paper-2); color: var(--ink); padding: 0 4px; }
.cm-len { margin-left: auto; }
.cm-len.is-over { color: var(--red-t); font-weight: 500; }
.cm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.cm-fields p { margin: 0; }
.cm-note { display: block; margin-top: 5px; font-family: var(--f-mono); font-size: 11.5px; line-height: 1.45; color: var(--mute); }
.cm-note a { text-decoration: underline; text-underline-offset: 3px; }
.cm-as { margin: 0 0 12px; font-family: var(--f-mono); font-size: 12.5px; }
.cm-check { display: flex; align-items: flex-start; gap: 9px; margin: 2px 0 6px; font-family: var(--f-mono); font-size: 12px; line-height: 1.45; cursor: pointer; }
.cm-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.cm-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cm-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 14px; }
.cm-go { font-size: 19px; padding: 12px 22px; }
.cm-form[aria-busy="true"] .cm-go { opacity: .7; cursor: progress; }
.cm-status { flex: 1 1 220px; min-height: 1.4em; margin: 0; font-family: var(--f-mono); font-size: 13px; line-height: 1.45; }
.cm-status.is-busy { color: var(--mute); }
.cm-status.is-ok::before { content: "\2713  "; color: var(--red-t); font-weight: 500; }
.cm-status.is-wait::before { content: "\25F7  "; color: var(--red-t); }
.cm-status.is-err { color: var(--red-t); font-weight: 500; }
.cm-status.is-err::before { content: "\2715  "; }
.cm-rules { margin-top: 12px; }
@media (max-width: 560px) {
  .cm-form { padding: 14px 14px 12px; box-shadow: 6px 6px 0 var(--red); }
  .cm-fields { grid-template-columns: 1fr; }
}

/* ===================== Paragraph bubbles ===================== */
.prose [data-pc] { position: relative; }
.pc-btn { position: absolute; z-index: 2; top: 4px; right: -66px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 46px; height: 30px; padding: 0 7px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 12px/1 var(--f-mono); letter-spacing: 0; text-transform: none; cursor: pointer; opacity: 0; transition: opacity .15s, transform .15s, background .15s; }
.pc-btn::before { content: ""; position: absolute; top: -2px; bottom: -2px; right: 100%; width: 26px; }
.pc-btn .ico { width: 16px; height: 16px; flex: none; }
.pc-btn.has-n { background: var(--ink); color: var(--paper); }
.pc-btn:hover, .pc-btn:focus-visible { background: var(--red); color: var(--on-red); border-color: var(--ink); transform: rotate(-4deg); }
.prose [data-pc]:hover > .pc-btn, .pc-btn:focus-visible, .pc-btn.has-n, .pc-act > .pc-btn, .pc-act-q > .pc-btn { opacity: 1; }
.prose h2 > .pc-btn { top: 2px; }
.prose li > .pc-btn { top: 0; }
@media (max-width: 959px) {
  .pc-btn { top: auto; bottom: -25px; right: 0; min-width: 0; height: 24px; padding: 0 7px; border-width: 1.5px; font-size: 11px; pointer-events: none; }
  .pc-btn::before { display: none; }
  .pc-btn .ico { width: 14px; height: 14px; }
  .pc-btn.has-n, .pc-tap > .pc-btn { pointer-events: auto; opacity: 1; }
  .prose [data-pc]:hover > .pc-btn:not(.has-n) { opacity: 0; }
  .prose .pc-tap > .pc-btn:not(.has-n) { opacity: 1; animation: pcin .2s cubic-bezier(.2, 1.5, .4, 1); }
  .prose li > .pc-btn { bottom: -21px; }
}
@media (hover: none) { .prose [data-pc]:hover > .pc-btn:not(.has-n) { opacity: 0; } .prose .pc-tap > .pc-btn { opacity: 1; pointer-events: auto; } }
@keyframes pcin { from { transform: scale(.6); } }
.pc-act { background: var(--tint); box-shadow: 0 0 0 8px var(--tint); }

/* ===================== Highlights of commented passages ===================== */
mark.pc-hl { background: var(--tint); color: inherit; padding: 0; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-skip-ink: none; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .15s, color .15s; }
mark.pc-hl-2 { background: var(--tint-2); }
mark.pc-hl.is-hot, mark.pc-hl.is-act { background: var(--red); color: var(--on-red); text-decoration-color: var(--on-red); }
mark.pc-hl.pc-flash, .pc-flash { animation: pcflash 1.6s ease-out; }
@keyframes pcflash { 0%, 35% { background: var(--red); color: var(--on-red); } }

/* Floating "Kommentieren" at the selection, and "N Kommentare" at a highlight */
.pc-sel, .pc-pop { position: absolute; z-index: 70; left: 0; top: 0; }
.pc-sel { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--red); font: 500 12.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; animation: pcin .18s cubic-bezier(.2, 1.5, .4, 1); }
.pc-sel:hover, .pc-sel:focus-visible { background: var(--red); color: var(--on-red); }
.pc-sel .ico { width: 17px; height: 17px; }
.pc-pop { display: grid; gap: 2px; padding: 3px; max-width: min(320px, calc(100vw - 16px)); background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--red); animation: pcin .15s ease-out; }
.pc-pop button { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 10px; border: 0; background: none; color: inherit; font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.pc-pop button:hover, .pc-pop button:focus-visible { background: var(--tint); }
.pc-pop .ico { width: 16px; height: 16px; flex: none; color: var(--red-t); }
.pc-pop small { text-transform: none; letter-spacing: 0; color: var(--mute); }

/* ===================== Panel (side panel, bottom sheet on phones) ===================== */
.cm-sheet .sheet-in { width: min(480px, 100%); }
.cm-sheet .sheet-head h2 { font-size: 40px; }
.cm-q { margin: 12px 0 18px; }
.cm-q-k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red-t); }
.cm-q-t { margin: 6px 0 0; max-height: 9.6em; overflow-y: auto; padding: 10px 14px; border-left: 6px solid var(--red); background: var(--paper-2); font-weight: 700; font-stretch: 90%; font-size: 16.5px; line-height: 1.4; overflow-wrap: anywhere; }
.cm-sheet-list { margin-bottom: 20px; gap: 12px; }
.cm-sheet-empty { margin: 0 0 18px; }
.cm-sheet .cm-form { padding: 14px; }
.cm-sheet .cm-fields { grid-template-columns: 1fr; }
@media (max-width: 759px) {
  .cm-sheet { align-items: flex-end; justify-content: stretch; padding-top: calc(env(safe-area-inset-top, 0px) + 40px); }
  .cm-sheet .sheet-in { width: 100%; height: auto; max-height: 100%; border-width: 2.5px 0 0; box-shadow: 0 -8px 0 var(--red); padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 18px); animation-name: cmup; }
  .cm-sheet .sheet-in::before { content: ""; display: block; flex: none; width: 46px; height: 5px; margin: 0 auto 6px; background: var(--ink); opacity: .25; border-radius: 3px; }
  .cm-sheet .sheet-head h2 { font-size: 32px; }
  .cm-sheet .sheet-x { width: 40px; height: 40px; }
}
@keyframes cmup { from { transform: translateY(60px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .cm.is-new > .cm-card, .cm-like.is-bump .ico, .pc-sel, .pc-pop, .pc-tap > .pc-btn, .pc-flash, .cm-sheet .sheet-in { animation: none !important; }
}
@media print { .pc-btn, .pc-sel, .pc-pop, .cm-respond, .cm-acts, .cm-bar, .cm-tip { display: none !important; } mark.pc-hl { background: none; } }
