/* Public area (v5.23) – uses the design variables from style.css (dark + light) */
.side-link { position: relative; }
.side-badge { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.side-badge.hidden { display: none; }

#public-view { max-width: 820px; }
.pub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub-head p { color: var(--text-2); }

/* Composer / hint */
.pub-composer, .pub-hint-card { margin-bottom: 18px; }
.pub-comp-top { display: flex; gap: 12px; }
.pub-comp-fields { flex: 1; display: grid; gap: 8px; min-width: 0; }
.pub-comp-fields input, .pub-comp-fields textarea, .pub-edit-form input, .pub-edit-form textarea, .pub-projfields select, .pub-c-form input, .pub-adm-q {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font: inherit; resize: vertical;
}
.pub-comp-fields input:focus, .pub-comp-fields textarea:focus, .pub-edit-form input:focus, .pub-edit-form textarea:focus, .pub-projfields select:focus, .pub-c-form input:focus, .pub-adm-q:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.pub-comp-opts { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pub-comp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 12px; }
.pub-comp-foot small { color: var(--text-3); }
.pub-comp-foot button.primary { width: auto; margin: 0; }
.pub-projfields { display: grid; gap: 10px; }
.pub-projfields label, .pub-edit-form label, .pub-adm-q-wrap { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.pub-lockhint { color: var(--warn); }
.pub-hint-card { display: flex; gap: 14px; align-items: center; }
.pub-hint-card p { color: var(--text-2); margin-top: 4px; font-size: 14px; }
.pub-hint-ico { font-size: 28px; }

/* Sichtbarkeit */
.pub-vis { display: grid; gap: 8px; }
.pub-vis-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-chip { position: relative; cursor: pointer; }
.pub-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pub-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .15s var(--ease); }
.pub-chip:hover span { border-color: var(--text-3); color: var(--text); }
.pub-chip.on span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pub-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pub-vis-hint { color: var(--text-3); }
.pub-aud { display: grid; gap: 4px; max-height: 180px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.pub-aud.hidden { display: none; }
.pub-pick { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-xs); cursor: pointer; color: var(--text); font-size: 14px; }
.pub-pick:hover { background: var(--accent-soft); }
.pub-pick small { margin-left: auto; color: var(--text-3); }

/* Reiter */
.pub-tabs { display: flex; gap: 6px; margin: 4px 0 16px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.pub-tabs button { border: 0; background: transparent; color: var(--text-2); padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pub-tabs button:hover { color: var(--text); }
.pub-tabs button.active { background: var(--accent-soft); color: var(--accent); }
.pub-newer { display: block; margin: 0 auto 14px; border: 0; background: var(--accent-grad); color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-soft); }

/* Beitrag */
.pub-feed { display: grid; gap: 16px; }
.pub-post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px 12px; box-shadow: var(--shadow-soft); animation: pub-in .3s var(--ease); }
@keyframes pub-in { from { opacity: 0; transform: translateY(6px); } }
.pub-repost-bar { color: var(--text-3); font-size: 12.5px; font-weight: 600; margin: -4px 0 10px; }
.pub-post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; position: relative; }
.pub-avatar { width: 40px; height: 40px; flex: none; }
.pub-avatar.small { width: 30px; height: 30px; font-size: 12px; }
.pub-who { display: grid; min-width: 0; flex: 1; }
.pub-name { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.pub-who small { color: var(--text-3); font-size: 12.5px; }
.pub-badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.pub-post-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -0.02em; margin: 2px 0 6px; }
.pub-body { color: var(--text); line-height: 1.6; overflow-wrap: anywhere; font-size: 15px; }
.pub-body a, .pub-c-main a { color: var(--accent); }
.pub-body code, .pub-c-main code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.pub-codeblock { margin: 10px 0; padding: 12px 14px; background: var(--editor); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.pub-codeblock code { background: none; padding: 0; font-size: inherit; }

.pub-menu { position: relative; }
.pub-menu summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); font-size: 20px; line-height: 1; }
.pub-menu summary::-webkit-details-marker { display: none; }
.pub-menu summary:hover { background: var(--surface-2); }
.pub-menu > div { position: absolute; right: 0; top: 36px; z-index: 5; min-width: 150px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-pop); padding: 4px; display: grid; }
.pub-menu button { text-align: left; border: 0; background: transparent; color: var(--text); padding: 9px 12px; border-radius: var(--r-xs); cursor: pointer; font: inherit; font-size: 14px; }
.pub-menu button:hover { background: var(--surface-2); }
.pub-menu button.danger { color: var(--bad); }

.pub-video { position: relative; margin: 12px 0; border-radius: var(--r-md); overflow: hidden; background: #000; border: 1px solid var(--line); }
.pub-video video { display: block; width: 100%; max-height: 520px; background: #000; }
.pub-video-badge { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(10, 13, 23, .78); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; backdrop-filter: blur(6px); }
.pub-video-badge::first-letter { color: var(--bad); }

.pub-project { display: flex; gap: 14px; align-items: center; margin: 12px 0; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); flex-wrap: wrap; }
.pub-project .project-icon { flex: none; }
.pub-project-main { display: grid; gap: 2px; flex: 1; min-width: 160px; }
.pub-project-main small { color: var(--text-2); }
.pub-project-meta { color: var(--text-3); font-size: 12px; font-family: var(--font-mono); }
.pub-project-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-project-actions button { width: auto; margin: 0; }

.pub-actions { display: flex; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.pub-act { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--text-2); padding: 8px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
.pub-act:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.pub-act:disabled { opacity: .45; cursor: not-allowed; }
.pub-act .ico { font-size: 16px; line-height: 1; }
.pub-act.like.on { color: #ff4d7a; }
.pub-act.like.on .ico { animation: pub-pop .3s var(--ease); }
.pub-act.repost.on { color: var(--ok); }
@keyframes pub-pop { 50% { transform: scale(1.35); } }
.pub-act:focus-visible, .pub-tabs button:focus-visible, .pub-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Kommentare */
.pub-comments { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.pub-comments.hidden { display: none; }
.pub-c-list { display: grid; gap: 12px; }
.pub-comment { display: flex; gap: 10px; }
.pub-c-main { flex: 1; min-width: 0; background: var(--surface-2); border-radius: var(--r-md); padding: 8px 12px; }
.pub-c-main > div { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pub-c-main small { color: var(--text-3); margin-left: 8px; font-size: 12px; }
.pub-c-main p { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.pub-c-del { margin-left: auto; border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.pub-c-del:hover { color: var(--bad); }
.pub-c-form { display: flex; gap: 8px; }
.pub-c-form button { width: auto; margin: 0; }
.pub-c-load { color: var(--text-3); font-size: 13px; }

/* Empty / loading */
.pub-empty { text-align: center; padding: 48px 20px; color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.pub-empty > div { font-size: 34px; margin-bottom: 8px; }
.pub-skel { height: 150px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: pub-sk 1.2s linear infinite; }
@keyframes pub-sk { to { background-position: -200% 0; } }
.pub-more { display: grid; place-items: center; margin-top: 16px; }
.pub-more button.hidden { display: none; }

/* Dialoge */
.smart-card.wide { width: min(980px, 100%); }
.pub-edit-form { display: grid; gap: 14px; }
.pub-codeview { display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 300px; }
.pub-files { display: grid; align-content: start; gap: 2px; max-height: 60vh; overflow: auto; border-right: 1px solid var(--line); padding-right: 8px; }
.pub-files button { text-align: left; border: 0; background: transparent; color: var(--text-2); padding: 6px 10px; border-radius: var(--r-xs); cursor: pointer; font-family: var(--font-mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-files button:hover { background: var(--surface-2); color: var(--text); }
.pub-files button.on { background: var(--accent-soft); color: var(--accent); }
.pub-codewrap { min-width: 0; }
.pub-codehead { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-sm) var(--r-sm) 0 0; border: 1px solid var(--line); border-bottom: 0; }
.pub-codehead small { color: var(--text-3); }
.pub-code { margin: 0; max-height: 60vh; overflow: auto; padding: 10px 0; background: var(--editor); border: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); font-family: var(--font-mono); font-size: 13px; line-height: 1.55; tab-size: 2; user-select: text; }
.pub-code code { display: block; min-width: max-content; }
.pub-code .ln { display: block; padding: 0 14px 0 0; white-space: pre; }
.pub-code .ln::before { content: attr(data-n); display: inline-block; width: 3.4em; margin-right: 12px; text-align: right; color: var(--text-3); user-select: none; }
.pub-adm-list, .pub-adm-res { display: grid; gap: 6px; margin: 10px 0; }
.pub-adm-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.pub-adm-row small { color: var(--text-3); margin-right: auto; }
.pub-adm-row button { width: auto; margin: 0; }

/* Record button in the editor */
.rec-btn { display: inline-flex; align-items: center; gap: 8px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(255, 111, 135, .2); }
.rec-btn.recording { border-color: var(--bad); color: var(--bad); }
.rec-btn.recording .rec-dot { animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }

/* Floating recording bar */
.rec-pill { position: fixed; z-index: 1200; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow-pop); font-weight: 600; font-size: 14px; }
.rec-pill .rec-dot { animation: rec-blink 1s infinite; }
.rec-pill.paused .rec-dot { animation: none; background: var(--warn); box-shadow: none; }
.rec-pill time { font-variant-numeric: tabular-nums; min-width: 4.2em; }
.rec-pill button { width: auto; margin: 0; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.rec-pill .rec-stop { background: var(--bad); color: #fff; border: 0; cursor: pointer; font-weight: 700; }
.rec-pill small { color: var(--text-3); font-weight: 500; }

/* Recording dialog */
.rec-dialog { display: grid; gap: 14px; }
.rec-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; cursor: pointer; }
.rec-opt small { display: block; color: var(--text-3); }
.rec-tip { color: var(--text-2); font-size: 13px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.rec-preview video { width: 100%; max-height: 340px; border-radius: var(--r-md); background: #000; }
.rec-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.rec-bar > i { display: block; height: 100%; width: 0; background: var(--accent-grad); transition: width .2s; }
.rec-row { display: flex; gap: 10px; }
.rec-row button { margin: 0; }
.rec-err { color: var(--bad); font-size: 13px; }

@media (max-width: 760px) {
  .page-view#public-view { padding: 20px 14px 56px; }
  .pub-codeview { grid-template-columns: 1fr; }
  .pub-files { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; max-height: 120px; }
  .pub-act .lbl { display: none; }
  .rec-pill { right: 10px; left: 10px; bottom: 10px; justify-content: space-between; }
  .rec-btn span:not(.rec-dot) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pub-post, .pub-act.like.on .ico, .pub-skel, .rec-dot { animation: none; } }
