/*
 * otv.today posts, ported from the old site's Tailwind classes (FeedPost,
 * InlinePostDetail, CommentItem, CommentInput). Rows are separated by a single
 * line, without cards. Colours use this site's theme for now; the old gold
 * accents are kept as they were.
 */
:root {
  --otv-gold: #facc15;
  --otv-gold-2: #f59e0b;
  --otv-gold-hover: #fbbf24;
  /* Gold used as text or icon. #facc15 is unreadable on white (1.5:1), so the
     light theme uses a deep amber; the dark theme keeps the bright gold. */
  --otv-gold-text: #a15c07;
  --otv-gold-text-hover: #854d0e;
  --otv-line: var(--border-light);
  --otv-row-hover: color-mix(in srgb, var(--text-primary) 4%, transparent);
  --otv-input-bg: color-mix(in srgb, var(--text-primary) 6%, transparent);
  --otv-input-border: color-mix(in srgb, var(--text-primary) 12%, transparent);
  --otv-error: #f87171;
}
html.dark {
  --otv-gold-text: #facc15;
  --otv-gold-text-hover: #fbbf24;
}

/* FeedPost: border-b transition-colors cursor-pointer; px-4 pt-3 pb-[10px] */
.otv-post { min-width: 0; border-bottom: 1px solid var(--otv-line); cursor: pointer; transition: background-color .15s ease; }
/* Rows are separated by their line alone, so the hover tint reaches it. */
.discussion-feed:has(> .otv-post) { gap: 0; }
/* Only real pointers get the hover tint; on phones it stuck after a tap. */
@media (hover: hover) { .otv-post:hover { background: var(--otv-row-hover); } }
html:not(.dark) .nova-square-page .civic-community-feed > .otv-post {
  background: var(--bg-card);
}
@media (hover: hover) {
  html:not(.dark) .nova-square-page .civic-community-feed > .otv-post:hover {
    background: var(--bg-hover);
  }
}
.otv-post-row { display: flex; align-items: flex-start; gap: 12px; }
.otv-post > .otv-post-row { padding: 12px 16px 10px; }
.otv-post-avatar { flex-shrink: 0; }
.otv-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--otv-input-bg); color: var(--text-primary); font-size: var(--fs-sm); font-weight: 700; transition: opacity .15s ease; }
.otv-avatar.is-initial { background: var(--avatar-fallback-bg); }
.otv-avatar:hover { opacity: .8; }
.otv-avatar-sm { width: 36px; height: 36px; }
.otv-post-main { flex: 1; min-width: 0; }
.otv-post-head { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px; min-width: 0; white-space: nowrap; }
/* One line, as on X: the name and the @handle give way together, so a little
   of each stays readable; the time and the ••• menu always stay. */
.otv-post-head > * { flex-shrink: 0; }
.otv-post-name { flex: 0 1 auto; min-width: 0; overflow: hidden; color: var(--text-primary); font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.otv-post-head > .otv-post-handle { flex: 0 1 auto; min-width: 4em; overflow: hidden; text-overflow: ellipsis; }
.otv-post-name:hover { text-decoration: underline; }
.otv-muted { color: var(--text-muted); }
.otv-time { font-size: var(--fs-sm); }
.otv-post-text { margin: 4px 0 0; color: var(--text-primary); font-size: var(--fs-md); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.otv-link { color: var(--otv-gold-text); text-decoration: none; }
.otv-link:hover { text-decoration: underline; }
.otv-post-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(100%, 480px);
  min-width: 0;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--otv-line);
  border-radius: 12px;
  background: var(--otv-input-bg);
  color: var(--text-secondary);
  text-decoration: none;
}
.otv-post-link-card:hover { border-color: var(--secondary); }
.otv-post-link-card:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.otv-post-link-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--otv-gold-text);
  font-size: var(--fs-sm);
}
.otv-post-link-label strong,
.otv-post-link-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otv-post-link-label strong { color: var(--text-primary); font-size: var(--fs-sm); font-weight: 600; }
.otv-post-link-label small { margin-top: 2px; font-size: var(--fs-xs); }

/* Media: rounded-2xl, images fit-content up to 500px tall */
.otv-post-media { position: relative; margin-top: 12px; overflow: hidden; border-radius: 16px; }
.otv-post-media.is-image { width: fit-content; max-width: 100%; }
.otv-post-media.is-image img { display: block; max-width: 100%; max-height: 500px; height: auto; object-fit: contain; border-radius: 16px; cursor: pointer; }
/* Same size the picture takes once loaded (its own width, at most the column
   and at most 500px tall), worked out from its stored dimensions up front. */
.otv-post-media.is-image:where(.is-sized) { width: 100%; }
.otv-post-media.is-image.is-sized img { width: min(100%, calc(var(--w) * 1px), calc(500px * var(--w) / var(--h))); aspect-ratio: var(--w) / var(--h); }
.otv-post-media.is-image.is-detail { border: 1px solid var(--otv-line); }
.otv-post-media.is-image.is-detail img { max-height: 720px; border-radius: 0; background: var(--otv-input-bg); }
.otv-post-media.is-video { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--otv-line); background: #1a1a1a; }
/* Portrait clips keep their shape at up to 500px tall, left-aligned (FeedPost). */
.otv-post-media.is-video.is-portrait { width: auto; max-width: 100%; height: min(500px, 70vh); aspect-ratio: var(--otv-video-ratio, 9 / 16); }
.otv-post-media video { display: block; width: 100%; height: 100%; object-fit: contain; background: #1a1a1a; }

/* Images fade in as they arrive instead of popping in line by line. */
.otv-post-media.is-image img[data-fade] { opacity: 0; transition: opacity .25s ease; }
.otv-post-media.is-image img.is-loaded { opacity: 1; }

/* ---------- Feed video player (FeedPost) ---------- */
.otv-video { isolation: isolate; cursor: pointer; }
.otv-video video { position: absolute; inset: 0; }
.otv-video-cover { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #1a1a1a; cursor: pointer; transition: opacity .2s ease; }
.otv-video-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.otv-video.is-portrait .otv-video-cover img { object-fit: contain; }
.otv-video.has-started .otv-video-cover { opacity: 0; pointer-events: none; }
.otv-video-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; transform: translate(-50%, -50%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .15s ease; }
.otv-video-play svg { margin-left: 3px; }
.otv-video-cover:hover .otv-video-play { background: rgba(0, 0, 0, .7); }
.otv-video-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .72); color: #fff; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }

.otv-video-buffer { position: absolute; inset: 0; z-index: 3; display: none; place-items: center; pointer-events: none; }
.otv-video.is-buffering .otv-video-buffer { display: grid; }
.otv-video-buffer .loading-spinner { width: 32px; height: 32px; border-color: rgba(255, 255, 255, .25); border-top-color: #fff; }

/* Controls appear on hover once playing; a thin progress line stays visible. */
.otv-video-controls { position: absolute; right: 0; bottom: 0; left: 0; z-index: 4; padding: 28px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.otv-video.has-started:hover .otv-video-controls,
.otv-video.has-started:focus-within .otv-video-controls { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) {
  .otv-video.has-started .otv-video-controls { opacity: 1; transform: none; pointer-events: auto; }
}
/* Paused after it started: the round play button returns (FeedPost). */
.otv-video-resume { position: absolute; inset: 0; z-index: 2; display: none; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.otv-video.has-started:not(.is-playing):not(.is-buffering) .otv-video-resume { display: block; }
.otv-video-resume:hover .otv-video-play { background: rgba(0, 0, 0, .7); }
.otv-video-progress { position: relative; height: 4px; margin-bottom: 6px; border-radius: 999px; background: rgba(255, 255, 255, .3); cursor: pointer; }
.otv-video-progress::before { content: ""; position: absolute; inset: -8px 0; }
.otv-video-progress-fill { position: absolute; inset: 0; border-radius: inherit; background: #fff; transform: scaleX(0); transform-origin: left center; }
.otv-video-progress:focus-visible { outline: 2px solid var(--otv-gold); outline-offset: 3px; }
.otv-video-bar { display: flex; align-items: center; gap: 4px; color: #fff; }
.otv-video-bar button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; transition: background-color .15s ease; }
.otv-video-bar button:hover { background: rgba(255, 255, 255, .18); }
.otv-video-bar button:focus-visible { outline: 2px solid var(--otv-gold); outline-offset: 1px; }
.otv-video-time { margin-left: 4px; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.otv-video-fullscreen { margin-left: auto; }
.otv-video:not(.has-started) .otv-video-controls { display: none; }
/* The progress line under the picture while the controls are hidden. */
.otv-video.has-started::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; height: 2px; background: rgba(255, 255, 255, .2); pointer-events: none; }
.otv-video.has-started:hover::after { display: none; }
.otv-video .otv-video-when-paused,
.otv-video.is-playing .otv-video-when-playing { display: contents; }
.otv-video .otv-video-when-playing,
.otv-video.is-playing .otv-video-when-paused { display: none; }
.otv-video-when-sound,
.otv-video-sound .otv-video-when-muted { display: none; }
.otv-video-when-muted,
.otv-video-sound .otv-video-when-sound { display: contents; }

/* "… Mai mult" sits right after the last word of a long post (foldedTextMarkup). */
.otv-post-more { display: inline; padding: 0; border: 0; background: none; color: var(--otv-gold-text); font: inherit; font-weight: 600; cursor: pointer; }
.otv-post-more:hover { text-decoration: underline; }

/* "N postări noi": floats under the tabs and brings the newest posts in. */
.otv-new-posts { position: sticky; top: 64px; z-index: 30; display: flex; align-items: center; gap: 6px; width: fit-content; margin: 10px auto -46px; padding: 6px 14px 6px 12px; border: 0; border-radius: 999px; background: #3b82f6; color: #fff; font: inherit; font-size: var(--fs-sm); font-weight: 600; box-shadow: 0 6px 18px rgba(37, 99, 235, .35); cursor: pointer; animation: otvNewPostsIn .25s ease-out; }
.otv-new-posts:hover { background: #2563eb; }
.otv-new-posts-face { display: inline-grid; width: 24px; height: 24px; margin-left: -6px; overflow: hidden; border: 2px solid #3b82f6; border-radius: 50%; background: var(--bg-main); }
.otv-new-posts-face:first-of-type { margin-left: 2px; }
.otv-new-posts-face img, .otv-new-posts-face > * { width: 100%; height: 100%; object-fit: cover; font-size: var(--fs-xs); }
@keyframes otvNewPostsIn { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }

/* The like hand gives a short pop when it lands. */
.otv-action.is-popping .otv-ok { animation: otvOkPop .3s ease-out; }
@keyframes otvOkPop { 40% { scale: 1.3; } }

@media (prefers-reduced-motion: reduce) {
  .otv-video-controls, .otv-video-cover, .otv-post-media.is-image img { transition: none; }
  .otv-new-posts, .otv-action.is-popping .otv-ok { animation: none; }
}

/* Action bar: flex justify-between mt-3 max-w-md */
.otv-post-actions { display: flex; align-items: center; justify-content: space-between; max-width: 448px; margin-top: 12px; }
.otv-post-actions.is-centered { margin: 12px auto 0; padding: 4px 0 2px; }
.otv-action { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font: inherit; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.otv-action span { font-size: var(--fs-sm); }
.otv-action.is-static { cursor: default; }
.otv-action.is-blue:hover { background: rgba(59, 130, 246, .1); color: #60a5fa; }
.otv-action.is-gold:hover { background: rgba(234, 179, 8, .1); color: var(--otv-gold-text); }
.otv-action.is-voted { color: var(--otv-gold-text); }
.otv-ok { display: inline-block; font-size: var(--fs-md); }

/* The ⋯ menu: w-48 rounded-xl border shadow-xl */
.otv-post-menu, .otv-comment-menu { position: relative; margin-left: auto; }
.otv-post-menu-button, .otv-comment-menu-button { display: grid; place-items: center; margin: -4px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.otv-post-menu-button:hover { background: rgba(29, 155, 240, .1); color: var(--otv-gold-text); }
.otv-post-actions > .otv-post-menu { margin-left: 0; }
.otv-post-actions .otv-post-menu-button { margin: 0; padding: 6px 8px; }
.otv-post-actions .otv-dropdown { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; }
.otv-dropdown { position: absolute; top: 100%; right: 0; z-index: 40; width: 192px; margin-top: 4px; overflow: hidden; border: 1px solid var(--otv-line); border-radius: 12px; background: var(--bg-card); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 8px 10px -6px rgba(0, 0, 0, .3); cursor: default; }
.otv-dropdown button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-md); font-weight: 500; line-height: 1.2; text-align: left; cursor: pointer; }
/* Every icon in the same 18px box, so the labels line up whatever the icon's shape. */
.otv-dropdown button svg { flex: none; width: 18px; height: 18px; }
.otv-dropdown button:hover { background: var(--otv-row-hover); }
.otv-dropdown button[hidden] { display: none; }
.otv-dropdown button.is-danger { color: #ef4444; }
.otv-dropdown button.is-danger:hover { background: rgba(239, 68, 68, .1); }

/* Image viewer: fixed inset-0 bg-black/80 backdrop-blur-sm */
@keyframes otvFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes otvScaleIn { from { opacity: .6; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.otv-image-preview { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: otvFadeIn 150ms ease-out; }
.otv-image-preview.is-closing { opacity: 0; transition: opacity 150ms ease-out; }
.otv-image-preview-frame { position: relative; max-width: 92vw; max-height: calc(100vh - 40px); padding: 18px 0; animation: otvScaleIn 150ms ease-out; }
.otv-image-preview-pad { padding: 0 16px; }
.otv-image-preview img { display: block; width: 100%; height: auto; max-height: calc(100vh - 76px); object-fit: contain; border-radius: 28px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); }
.otv-image-preview-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer; transition: background-color .15s ease; }
.otv-image-preview-close:hover { background: rgba(0, 0, 0, .6); }
/* Phones: the picture fills the screen on black, edge to edge. */
@media (max-width: 768px) {
  .otv-image-preview { background: #000; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .otv-image-preview-frame { max-width: 100vw; max-height: 100vh; max-height: 100svh; padding: 0; }
  .otv-image-preview-pad { padding: 0; }
  .otv-image-preview img { width: 100vw; max-height: 100vh; max-height: 100svh; border-radius: 0; box-shadow: none; }
  .otv-image-preview-close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
}

/* Post page: sticky "Postare" header, h-[53px] backdrop-blur-xl */
.otv-detail-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; height: 53px; padding: 0 16px; border-bottom: 1px solid var(--otv-line); background: color-mix(in srgb, var(--bg-main) 85%, transparent); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.otv-detail-header h1 { margin: 0; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; }
.otv-detail-back { display: grid; place-items: center; margin-left: -8px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: var(--text-primary); cursor: pointer; }
.otv-detail-back:hover { background: var(--otv-row-hover); }
.otv-detail-post { padding: 12px 16px; border-bottom: 1px solid var(--otv-line); }
.otv-detail-text { margin: 12px 0 0; color: var(--text-primary); font-size: var(--fs-lg); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.otv-detail-reply { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--otv-line); }
.otv-detail-reply-field { flex: 1; min-width: 0; }
.otv-comments > .otv-comment-item { padding: 12px 16px; }
.otv-comments > .otv-comment-item + .otv-comment-item { border-top: 1px solid var(--otv-line); }
.otv-detail-empty { padding: 32px 16px; color: var(--text-muted); text-align: center; }
/* The one empty / error message used across pages, with an optional action. */
.otv-detail-empty a, .otv-detail-empty button { display: inline-block; margin-left: 4px; padding: 0; border: 0; background: none; color: var(--otv-gold-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.otv-detail-empty a:hover, .otv-detail-empty button:hover { text-decoration: underline; }
.pulse-cards-grid > .otv-detail-empty, .news-grid > .otv-detail-empty { grid-column: 1 / -1; }
.otv-detail-spacer { height: 100px; }
@keyframes otvSpin { to { transform: rotate(360deg); } }

/* CommentInput */
.otv-comment-input { display: grid; gap: 8px; }
.otv-comment-input-field { position: relative; }
.otv-comment-input textarea { display: block; width: 100%; min-height: 48px; max-height: 120px; padding: 14px 52px 14px 20px; overflow: hidden; border: 1px solid var(--otv-input-border); border-radius: 12px; background: var(--otv-input-bg); color: var(--text-primary); font: inherit; font-size: var(--fs-md); resize: none; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.otv-comment-input textarea:focus { outline: none; border-color: rgba(250, 204, 21, .5); box-shadow: 0 0 0 2px rgba(250, 204, 21, .25); }
.otv-comment-input textarea::placeholder { color: var(--text-muted); }
.otv-comment-send { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: linear-gradient(to right, var(--otv-gold), var(--otv-gold-2)); color: #fff; cursor: pointer; }
.otv-comment-send:hover:not(:disabled) { background: linear-gradient(to right, var(--otv-gold-2), #d97706); }
.otv-comment-send:disabled { opacity: .5; cursor: default; }
.otv-comment-input-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.otv-comment-input-foot span { flex: 1; }
.otv-comment-count, .otv-comment-error { margin: 0; font-size: var(--fs-xs); }
.otv-comment-count { color: var(--text-muted); }
.otv-comment-count.is-limit, .otv-comment-error { color: var(--otv-error); }
.otv-comment-login { padding: 16px 0; text-align: center; }
.otv-gold-button { padding: 10px 24px; border: 0; border-radius: 12px; background: linear-gradient(to right, var(--otv-gold), var(--otv-gold-2)); color: #000; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.otv-gold-button:hover { background: linear-gradient(to right, var(--otv-gold-2), #d97706); }

/* CommentItem */
.otv-comment.is-reply { margin-left: 32px; }
.otv-comment-row { display: flex; gap: 12px; }
.otv-comment-avatar { flex-shrink: 0; }
.otv-comment-avatar img.otv-avatar { background: linear-gradient(135deg, #a855f7, #ec4899); }
.otv-comment-body { flex: 1; min-width: 0; }
.otv-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.otv-comment-name { color: var(--text-primary); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.otv-comment-name:hover { text-decoration: underline; }
.otv-role { padding: 2px 8px; border-radius: 4px; font-size: var(--fs-xs); }
.otv-role.is-admin { background: rgba(239, 68, 68, .15); color: #f87171; }
.otv-role.is-mod { background: rgba(34, 197, 94, .15); color: #4ade80; }
.otv-comment-time { font-size: var(--fs-xs); }
.otv-comment-text { margin: 0 0 8px; color: var(--text-primary); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.otv-comment-actions { display: flex; align-items: center; gap: 16px; color: var(--text-muted); }
.otv-comment-actions button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; transition: color .15s ease; }
.otv-comment-actions button:disabled { cursor: default; }
.otv-comment-actions button:not(:disabled):hover { color: var(--text-primary); }
.otv-comment-like.is-liked, .otv-comment-like.is-liked:hover { color: #f87171; }
.otv-comment-like.is-liked svg { fill: #f87171; }
.otv-comment-actions .otv-comment-toggle, .otv-comment-actions .otv-comment-toggle:hover { color: var(--otv-gold-text); }
.otv-comment-actions .otv-comment-toggle:hover { color: var(--otv-gold-text-hover); }
.otv-comment-menu-button { margin: 0; padding: 4px; opacity: 0; }
.otv-comment:hover > .otv-comment-row .otv-comment-menu-button,
.otv-comment-menu-button[aria-expanded="true"] { opacity: 1; }
.otv-comment-menu-button:hover { background: color-mix(in srgb, var(--text-primary) 10%, transparent); }
.otv-comment-reply-input { margin: 12px 0 0 48px; }
.otv-comment-replies { display: grid; gap: 12px; margin-top: 12px; }
@media (hover: none) { .otv-comment-menu-button { opacity: 1; } }

@media (min-width: 768px) {
  .otv-comment-text { font-size: var(--fs-md); }
  .otv-comment-actions button { font-size: var(--fs-sm); }
}

/* ReportModal */
.otv-report { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom right, rgba(8, 5, 18, .95), rgba(13, 7, 31, .95), rgba(18, 10, 47, .95)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.otv-report-card { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 448px; max-height: calc(100dvh - 32px); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; background: linear-gradient(to bottom right, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04)); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); color: #fff; }
.otv-report-close { position: absolute; top: 16px; right: 16px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.otv-report-close:hover { background: rgba(255, 255, 255, .2); }
.otv-report-form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.otv-report-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.otv-report-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: rgba(239, 68, 68, .2); color: #f87171; font-size: var(--fs-lg); }
.otv-report-head h2 { margin: 0; color: #fff; font-size: var(--fs-lg); font-weight: 700; }
.otv-report-head p { max-width: 250px; margin: 0; overflow: hidden; color: rgba(255, 255, 255, .6); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.otv-report-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px; }
.otv-report-label { margin: 0 0 12px; color: rgba(255, 255, 255, .9); font-size: var(--fs-sm); font-weight: 600; }
.otv-report-reasons { display: grid; gap: 8px; margin-bottom: 24px; }
.otv-report-reasons button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; font: inherit; font-size: var(--fs-sm); font-weight: 500; text-align: left; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.otv-report-reasons button:hover { background: rgba(255, 255, 255, .1); }
.otv-report-reasons button span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.otv-report-reasons button.is-selected { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .15); }
.otv-report-reasons button.is-selected span { background: rgba(239, 68, 68, .3); }
.otv-report-details { margin-bottom: 24px; }
.otv-report-details textarea { width: 100%; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; font: inherit; resize: none; }
.otv-report-details textarea:focus { outline: none; border-color: rgba(255, 255, 255, .3); }
.otv-report-details small { display: block; margin-top: 4px; color: rgba(255, 255, 255, .4); font-size: var(--fs-xs); text-align: right; }
.otv-report-foot { display: flex; gap: 12px; padding: 12px 20px 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.otv-report-foot button { flex: 1; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.otv-report-foot button.is-danger { border: 0; background: linear-gradient(to right, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239, 68, 68, .3); }
.otv-report-foot button:disabled { opacity: .5; cursor: not-allowed; }
.otv-report-foot button.is-danger:disabled { background: rgba(239, 68, 68, .3); box-shadow: none; }
.otv-report-done { padding: 24px; text-align: center; }
.otv-report-done span { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: rgba(34, 197, 94, .2); color: #4ade80; font-size: var(--fs-xl); }
.otv-report-done h3 { margin: 0 0 8px; color: #fff; font-size: var(--fs-lg); }
.otv-report-done p { margin: 0; color: rgba(255, 255, 255, .6); font-size: var(--fs-sm); }

html:not(.dark) .otv-report-card :is(.otv-report-close, h2, h3, .otv-report-reasons button, textarea, .otv-report-foot button:not(.is-danger)) {
  color: var(--text-primary);
}
html:not(.dark) .otv-report-card :is(.otv-report-head p, .otv-report-label, .otv-report-details small, .otv-report-done p) {
  color: var(--text-secondary);
}
html:not(.dark) .otv-report-card :is(.otv-report-close, .otv-report-reasons button, textarea, .otv-report-foot button:not(.is-danger)) {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}
html:not(.dark) .otv-report-card .otv-report-reasons button.is-selected {
  background: #fef2f2;
  border-color: #f87171;
}
html:not(.dark) .otv-report-card textarea:focus { border-color: var(--secondary); }
html:not(.dark) .otv-report-card .otv-report-foot { border-color: var(--border-light); }

/* Feed tabs: absolute top-0 z-40 backdrop-blur-md border-b, black at 75% */
.otv-feed-tabs { position: sticky; top: 0; z-index: 40; display: flex; border-bottom: 1px solid var(--otv-line); background: color-mix(in srgb, var(--bg-main) 75%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.otv-feed-tabs [data-otv-tab],
.otv-feed-tabs [data-profile-tab],
.otv-feed-tabs [data-live-source],
.otv-feed-tabs [data-measure-tab] { flex: 1; padding: 16px 0; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: var(--fs-md); font-weight: 600; text-align: center; cursor: pointer; transition: color .15s ease; }
.otv-feed-tabs [aria-selected="true"] { color: var(--text-primary); }
.otv-feed-tablist { display: contents; }
.otv-feed-tabs [role="tab"]:hover,
.otv-feed-tabs [data-measure-tab]:hover,
.otv-feed-tabs [data-measure-tab][aria-current="page"] { color: var(--text-primary); }
.otv-feed-refresh { padding: 16px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.otv-feed-refresh svg { display: block; }
.otv-feed-indicator { position: absolute; bottom: 0; left: 0; width: 0; height: 4px; border-radius: 999px; background: var(--otv-gold); transition: all .3s ease-out; }
@keyframes otvSpinOnce { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.is-spinning-once { animation: otvSpinOnce .5s ease-out; }
.otv-feed-refresh[aria-busy="true"] svg { animation: otvSpin .9s linear infinite; }

/* Load More */
.otv-load-more { display: flex; justify-content: center; padding: 24px 0; }
.otv-load-more[hidden] { display: none; }
.otv-load-more button { padding: 8px 24px; border: 0; border-radius: 999px; background: var(--otv-input-bg); color: var(--otv-gold-text); font: inherit; font-weight: 600; cursor: pointer; transition: background-color .15s ease; }
.otv-load-more button:hover { background: var(--otv-row-hover); }


/* Member profile: the rounded cover card stays; under it the avatar overlaps
   the cover with the buttons on its right, then name, details and counts run
   in one compact block, as on X and otv.today. */
.community-profile-v2 .otv-profile-hero { overflow: visible; }
.community-profile-v2 .otv-profile-hero .community-profile-cover { height: 150px; }
.otv-profile-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: -64px; padding: 0 20px; }
.community-profile-v2 .otv-profile-top .community-profile-avatar { position: relative; flex: 0 0 auto; width: 128px; height: 128px; margin: 0; border: 4px solid var(--bg-card); box-shadow: none; }
.otv-profile-top .community-profile-actions { position: static; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 4px; }
.otv-profile-top .community-profile-edit-btn,
.otv-profile-top .community-profile-follow-btn,
.otv-profile-top .community-profile-message-btn,
.otv-profile-top .community-profile-more { height: 38px; border-radius: 999px; font-size: var(--fs-sm); }
.otv-profile-top .community-profile-edit-btn { display: inline-flex; align-items: center; padding: 0 18px; border: 1px solid var(--otv-input-border); background: transparent; color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
.otv-profile-top .community-profile-edit-btn:hover { background: var(--otv-row-hover); }
/* Round icon buttons (mesaj, ⋯): neutral outline, a soft fill on hover. */
.otv-profile-top .community-profile-message-btn,
.otv-profile-top .community-profile-more { display: grid; place-items: center; width: 38px; padding: 0; border: 1px solid var(--otv-input-border); border-radius: 50%; background: transparent; color: var(--text-primary); font-size: var(--fs-md); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.otv-profile-top .community-profile-message-btn:hover,
.otv-profile-top .community-profile-more:hover { border-color: color-mix(in srgb, var(--text-primary) 30%, transparent); background: var(--otv-row-hover); color: var(--text-primary); }
.otv-profile-top .community-profile-follow-btn { padding: 0 20px; border: 0; background: linear-gradient(135deg, var(--otv-gold), var(--otv-gold-2)); color: #111827; font-weight: 600; box-shadow: 0 8px 14px -6px rgba(250, 204, 21, .35); cursor: pointer; transition: filter .15s ease, box-shadow .15s ease; }
.otv-profile-top .community-profile-follow-btn:hover { background: linear-gradient(135deg, var(--otv-gold), var(--otv-gold-2)); color: #111827; filter: brightness(1.08); box-shadow: 0 10px 18px -6px rgba(250, 204, 21, .45); }
.otv-profile-top .community-profile-follow-btn.is-following { background: transparent; color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--otv-input-border); }
.otv-profile-top .community-profile-follow-btn.is-following:hover { filter: none; background: rgba(239, 68, 68, .1); color: #f87171; box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .4); }
.otv-profile-top :is(button):focus-visible { outline: 2px solid var(--otv-gold); outline-offset: 2px; }
/* Narrow columns: a smaller avatar so it and the buttons fit beside each other.
   It must come after the rules above, which it overrides. */
@container (max-width: 620px) {
  .community-profile-v2 .otv-profile-hero .community-profile-cover { height: 110px; }
  .otv-profile-top { margin-top: -44px; padding: 0 16px; }
  .community-profile-v2 .otv-profile-top .community-profile-avatar { width: 88px; height: 88px; }
  .otv-profile-info { padding: 10px 16px 14px; }
}
.otv-profile-info { padding: 12px 20px 16px; }
.otv-profile-info h1 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; letter-spacing: 0; }
.otv-profile-info h1 .community-profile-verified { font-size: var(--fs-md); }
.otv-profile-handle { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--fs-md); }
.otv-profile-bio { margin: 12px 0 0; color: var(--text-primary); font-size: var(--fs-md); line-height: 1.5; }
.otv-profile-bio.is-empty { color: var(--text-muted); }
.otv-profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; color: var(--text-muted); font-size: var(--fs-sm); }
.otv-profile-meta:empty { display: none; }
.otv-profile-meta i { margin-right: 4px; }
.otv-profile-meta a { color: var(--otv-gold-text); text-decoration: none; }
.otv-profile-meta a:hover { text-decoration: underline; }
/* Profile tabs as on otv.today: the count above its label. */
.otv-profile-tabs [data-profile-tab] { padding: 12px 0 14px; }
.otv-profile-tabs [data-profile-tab] span { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 6px; }
.otv-profile-tabs [data-profile-tab] b { color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; }
.otv-profile-tabs [data-profile-tab] small { font-size: var(--fs-sm); font-weight: 500; }
/* Who they follow, or who follows them. */
.community-profile-v2 .community-profile-tab-panel:has(.otv-follow-list) { padding: 0; }
.otv-follow-list { margin: 0; padding: 4px 0; list-style: none; }
.otv-follow-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.otv-follow-row:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.otv-follow-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-elevated, #334155); }
.otv-follow-avatar.is-initial { display: grid; place-items: center; background: var(--avatar-fallback-bg); color: var(--text-primary); font-weight: 700; }
.otv-follow-name { display: grid; min-width: 0; }
.otv-follow-name strong, .otv-follow-name small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.otv-follow-name strong { color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; }
.otv-follow-name small { color: var(--text-muted); font-size: var(--fs-sm); }
.otv-follow-empty { margin: 0; padding: 2rem 16px; color: var(--text-muted); font-size: var(--fs-sm); text-align: center; }
.otv-profile-tabs { position: relative; top: auto; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.community-profile-v2 .community-profile-tab-panel { padding: 1rem 16px; }
.community-profile-v2 .community-profile-tab-panel:has(.community-profile-post-feed) { padding: 0; }
a.community-profile-activity-item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: .8rem; padding: 1rem 0; border-bottom: 1px solid var(--otv-line); color: inherit; text-decoration: none; }
a.community-profile-activity-item:last-child { border-bottom: 0; }
a.community-profile-activity-item:hover strong { text-decoration: underline; }

/*
 * The right column of a profile stays in place while the profile scrolls,
 * and scrolls on its own if it is taller than the screen. `clip` instead of
 * `hidden` on the page wrappers: hidden makes them scroll containers, which
 * would pin the sticky column to a box that never scrolls.
 */
@media (min-width: 769px) {
  body:has(.community-profile-page),
  body:has(.community-profile-page) .main-content,
  body:has(.community-profile-page) .content-area { overflow-x: clip; }
  .community-profile-v2 .community-profile-rail {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
}

/*
 * Lideri Comunitate: the ranking scrolls with the page while the column on
 * the right stays in place (same approach as the profile page above).
 */
.leaderboard-full-row,
.leaderboard-full-row:hover { color: inherit; text-decoration: none; }
@media (min-width: 769px) {
  body:has(.leaders-page),
  body:has(.leaders-page) .main-content,
  body:has(.leaders-page) .content-area { overflow-x: clip; }
  .leaders-page .leaderboard-side-panel {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
}

/* The standing card on a profile: real votes, place and latest votes. */
/* The member's standing on the profile rail. */
.otv-standing-card { gap: 1rem; padding: 1.25rem; }
.otv-standing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.otv-standing-total, .otv-standing-rank { display: grid; gap: 4px; }
/* While the standing loads (router.js loadStanding). */
.otv-standing-skel { display: block; width: 3.5rem; height: 22px; border-radius: 6px; }
.otv-standing-skel.is-big { width: 5rem; height: 28px; }
.otv-standing-skel.is-line { width: 100%; height: 14px; }
.otv-standing-rank .otv-standing-skel { justify-self: end; }
.otv-standing-loading { display: grid; gap: 12px; margin: 0; padding: 4px 0; list-style: none; }
.otv-standing-total strong { color: var(--text-primary); font-size: var(--fs-xl); font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.otv-standing-head span { color: var(--text-muted); font-size: var(--fs-xs); }
.otv-standing-rank { justify-items: end; text-align: right; }
.otv-standing-rank strong { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--otv-gold) 16%, transparent); color: var(--otv-gold-text); font-size: var(--fs-md); font-weight: 800; line-height: 1.2; }
.otv-standing-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.otv-standing-stats > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.otv-standing-stats b { color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; }
.otv-standing-stats span { color: var(--text-muted); font-size: var(--fs-xs); }
.otv-standing-recent h3 { margin: 0 0 6px; color: var(--text-primary); font-size: var(--fs-sm); font-weight: 700; }
.otv-standing-recent ul { display: grid; margin: 0 -8px; padding: 0; list-style: none; }
.otv-standing-recent a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.otv-standing-recent a:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.otv-standing-recent a:hover span { color: var(--text-primary); }
.otv-standing-recent b { display: inline-flex; align-items: center; gap: 4px; color: #22c55e; font-size: var(--fs-xs); font-weight: 700; }
.otv-standing-recent b i { font-size: .7em; }
.otv-standing-recent span { overflow: hidden; color: var(--text-secondary); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.otv-standing-recent time { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.otv-standing-empty { margin: 0; color: var(--text-muted); font-size: var(--fs-xs); }
.otv-standing-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .9rem; border-top: 1px solid var(--border-light); }
.otv-standing-foot a, .otv-standing-foot button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--fs-xs); font-weight: 700; text-decoration: none; cursor: pointer; }
.otv-standing-foot a { color: var(--otv-gold-text); }
.otv-standing-foot a i { font-size: .85em; transition: translate .15s ease; }
.otv-standing-foot a:hover i { translate: 3px 0; }
.otv-standing-foot button { color: var(--text-secondary); }
.otv-standing-foot button:hover { color: var(--text-primary); }

/*
 * Three-column pages, laid out like Facebook: the right column sits against
 * the right edge of the window and the middle column is centred in the space
 * left between the sidebar and it, never wider than --otv-center-width.
 */
:root { --otv-center-width: 680px; --otv-rail-width: 300px; }
@media (min-width: 1101px) {
  /* Comunitatea OTV, a post's page, Setări, Notificări, Regulament */
  body:has(.nova-square-page) .content-area { max-width: none; padding-inline: 24px 16px; }
  .nova-square-page .nova-square-layout { grid-template-columns: minmax(0, 1fr) var(--otv-rail-width); justify-content: stretch; gap: 24px; }
  .nova-square-page .nova-square-conversation > * { max-width: var(--otv-center-width); margin-inline: auto; }

  /* A member's profile */
  body:has(.community-profile-page) .content-area { max-width: none; padding-right: 16px; }
  .community-profile-v2.community-profile-page { max-width: none; }
  @container (width > 820px) {
    .community-profile-v2 .community-profile-layout { grid-template-columns: minmax(0, 1fr) var(--otv-rail-width); gap: 24px; }
    .community-profile-v2 .community-profile-primary { width: 100%; max-width: var(--otv-center-width); justify-self: center; }
  }

  /* Lideri Comunitate: the title and ranking share the middle column. */
  body:has(.leaders-page) .content-area { max-width: none; padding-right: 16px; }
  .leaders-page { display: grid; grid-template-columns: minmax(0, 1fr) var(--otv-rail-width); column-gap: 24px; align-items: start; }
  .leaders-page > .leaderboard-page-header,
  .leaders-page .leaderboard-ranking-panel { grid-column: 1; width: 100%; max-width: var(--otv-center-width); justify-self: center; }
  .leaders-page .leaderboard-page-grid { grid-column: 1 / -1; grid-template-columns: subgrid; }
}

/* Post bar on the feed: looks like a field, opens the compose window. */
.otv-compose-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 24px 16px 12px; border: 0; border-bottom: 1px solid var(--otv-line); background: transparent; color: var(--text-muted); font: inherit; text-align: left; cursor: pointer; }
.otv-compose-bar .discussion-avatar { width: 40px; height: 40px; flex-shrink: 0; }
.otv-compose-bar-prompt { flex: 1; padding: 10px 16px; border-radius: 999px; background: var(--otv-input-bg); font-size: var(--fs-md); transition: background-color .15s ease; }
.otv-compose-bar:hover .otv-compose-bar-prompt { background: color-mix(in srgb, var(--text-primary) 9%, transparent); }
.otv-compose-bar-icons { display: flex; gap: 14px; padding-right: 4px; color: var(--otv-gold-text); font-size: var(--fs-md); }

html:not(.dark) .nova-square-page .civic-community-main > :is(.otv-feed-tabs, .otv-compose-bar) {
  background: var(--bg-card);
  border-bottom-color: var(--border-light);
}

html:not(.dark) .nova-square-page .otv-feed-tabs :is([data-otv-tab]:not([aria-selected="true"]):not(:hover), .otv-feed-refresh),
html:not(.dark) .nova-square-page .otv-compose-bar {
  color: var(--text-secondary);
}

html:not(.dark) .nova-square-page .otv-compose-bar-prompt {
  background: var(--bg-hover);
}

html:not(.dark) .nova-square-page .otv-compose-bar:hover .otv-compose-bar-prompt {
  background: var(--bg-main);
}

/* ComposeModal: centred near the top, 600px, rounded, header with X. */
.otv-compose-window[hidden] { display: none; }
.otv-compose-window { position: fixed; inset: 0; z-index: 1000; }
html:has(.otv-compose-window:not([hidden])),
body:has(.otv-compose-window:not([hidden])) { overflow: hidden; }
.otv-compose-backdrop { touch-action: none; }
.otv-compose-backdrop { position: absolute; inset: 0; background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter); animation: otvFadeIn 150ms ease-out; }
.otv-compose-dialog { position: absolute; top: 8%; left: 0; right: 0; display: flex; flex-direction: column; margin-inline: auto; width: min(560px, calc(100vw - 24px)); max-height: 84vh; overflow: hidden; border: 1px solid var(--otv-line); border-radius: 18px; background: var(--window-glass); -webkit-backdrop-filter: var(--window-glass-filter); backdrop-filter: var(--window-glass-filter); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5); animation: otvScaleIn 150ms ease-out; }
.otv-compose-head { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; flex-shrink: 0; padding: 10px 14px; border-bottom: 1px solid var(--otv-line); }
.otv-compose-head h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; text-align: center; }
.otv-compose-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--otv-input-bg); color: var(--text-primary); font-size: var(--fs-md); cursor: pointer; }
.otv-compose-close:hover { background: var(--otv-row-hover); }

/* The composer inside it (nova-community.js renderComposer, otv-composer). */
.otv-composer { position: static; top: auto; display: flex; flex-direction: column; flex: 1; gap: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.otv-composer-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 8px; }
.otv-composer textarea.otv-composer-editor { display: block; box-sizing: border-box; width: 100%; min-height: 80px; max-height: none; margin: 0; padding: 4px 0; overflow: hidden; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 1.3rem; line-height: 1.4; resize: none; box-shadow: none; }
.otv-composer textarea.otv-composer-editor::placeholder { color: var(--text-muted); }
.otv-composer textarea.otv-composer-editor:focus,
.otv-composer textarea.otv-composer-editor:focus-visible { border: 0; outline: none; box-shadow: none; }

/* The attachment, large, with a round remove button, as X and Facebook show it. */
.otv-composer .discussion-media-preview { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: fit-content; min-width: 64px; min-height: 64px; max-width: 100%; margin: 10px 0 4px; padding: 0; border: 1px solid var(--otv-line); border-radius: 14px; background: #000; overflow: hidden; }
.otv-composer .discussion-media-preview[hidden] { display: none; }
.otv-composer .discussion-media-preview img,
.otv-composer .discussion-media-preview video { display: block; width: auto; max-width: 100%; height: auto; max-height: 200px; object-fit: contain; border-radius: 0; background: #000; }
.otv-composer .discussion-media-preview > div { display: none; }
.otv-composer .discussion-media-preview:has(img),
.otv-composer .discussion-media-preview img { background: #fff; }
.otv-composer .discussion-media-preview button { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(15, 20, 25, .75); color: #fff; font-size: var(--fs-sm); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.otv-composer .discussion-media-preview button:hover { background: rgba(15, 20, 25, .9); }

.otv-composer-foot { flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 16px; }
.otv-composer-add { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border: 1px solid var(--otv-line); border-radius: 12px; }
.otv-composer-add > span { color: var(--text-primary); font-size: var(--fs-sm); font-weight: 600; }
.otv-composer-tools { display: flex; gap: 2px; }
.otv-composer-tools button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 1.3rem; cursor: pointer; transition: background-color .15s ease; }
.otv-composer-tools button:hover { background: var(--otv-row-hover); }
.otv-composer-tools button:disabled { opacity: .5; cursor: default; }
.otv-composer-tools button.is-camera,
.otv-composer-tools button > span { display: none; }
.otv-composer-tools .is-image { color: #45bd62; }
.otv-composer-tools .is-video { color: #f5b301; }
.otv-composer-submit { display: flex; align-items: center; gap: 12px; }
.otv-composer-submit [data-action="publish"] { flex: 1; min-height: 42px; padding: 0 20px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%); color: #111827; font: inherit; font-weight: 700; cursor: pointer; }
.otv-composer-submit [data-action="publish"]:disabled { background: var(--otv-input-bg); color: var(--text-muted); cursor: default; }

/* X's ring: fills toward the limit, counts down the last 20 characters. */
.otv-composer-count { position: relative; display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; color: var(--text-secondary); font-size: var(--fs-xs); transition: opacity .15s ease; }
.otv-composer-count svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.otv-composer-count circle { fill: none; stroke: var(--otv-line); stroke-width: 2.5; }
.otv-composer-count circle.is-fill { stroke: #f5b301; stroke-linecap: round; stroke-dasharray: var(--fill, 0) 100; transition: stroke-dasharray .12s ease; }
.otv-composer-count.is-near circle.is-fill { stroke: #f97316; }
.otv-composer-count b { position: relative; font-weight: 600; }

@media (max-width: 640px) {
  .otv-compose-dialog {
    top: calc(var(--compose-visible-top, 0px) + max(12px, env(safe-area-inset-top, 0px)));
    bottom: auto;
    width: calc(100vw - 24px);
    height: auto;
    max-height: calc(var(--compose-visible-height, 100dvh) - max(12px, env(safe-area-inset-top, 0px)) - 12px);
  }
  .otv-compose-head { padding-block: 7px; }
  .otv-compose-dialog:focus { outline: none; }
  .otv-composer textarea.otv-composer-editor { flex: none; min-height: 72px; max-height: 72px; overflow-y: auto; }
  .otv-composer-scroll:has(.discussion-media-preview:not([hidden])) textarea.otv-composer-editor { min-height: 56px; max-height: 56px; }
  .otv-composer-scroll { display: flex; flex: 0 1 auto; flex-direction: column; padding-block: 12px 6px; overscroll-behavior: contain; }
  .otv-composer-foot { gap: 8px; padding-bottom: 12px; }
  .otv-composer-add { border: 0; padding: 0; }
  .otv-composer-add > span { display: none; }
  .otv-composer-tools { display: grid; grid-template-columns: 1.2fr 1fr .9fr; gap: 6px; width: 100%; }
  .otv-composer-tools button,
  .otv-composer-tools button.is-camera {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    width: 100%; min-width: 0; height: 44px; padding: 0 4px; border: 1px solid var(--otv-line);
    border-radius: 10px; background: var(--otv-input-bg); color: var(--text-primary);
    font: inherit; font-size: var(--fs-xs); font-weight: 650; white-space: nowrap;
  }
  .otv-composer-tools button > span { display: inline; }
  .otv-composer-tools button > i { font-size: var(--fs-sm); }
  .otv-composer-tools button.is-camera { color: #f9d98e; border-color: rgba(245, 203, 101, .42); background: rgba(245, 203, 101, .12); }
  .otv-composer .discussion-media-preview:not([hidden]) { display: block; flex: none; align-self: flex-start; min-width: 54px; min-height: 54px; }
  .otv-composer .discussion-media-preview img,
  .otv-composer .discussion-media-preview video { max-height: clamp(64px, calc(var(--compose-visible-height, 100dvh) - 240px), 176px); }
  .otv-composer .discussion-media-preview button { top: 4px; right: 4px; }
}

/* Publication status survives route changes; the feed shows the full draft. */
.otv-publish-jobs { position: fixed; right: 20px; bottom: 20px; width: min(360px, calc(100vw - 32px)); max-height: 60dvh; overflow-y: auto; z-index: 850; display: grid; gap: 10px; }
.otv-publish-jobs[hidden], .otv-publish-jobs.has-feed { display: none; }
.otv-pending-post { padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-card); color: var(--text-primary); }
.otv-publish-jobs .otv-pending-post { margin: 0; box-shadow: var(--shadow-xl); }
.otv-pending-preview { display: flex; align-items: flex-start; gap: 12px; }
.otv-pending-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.otv-pending-preview p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.otv-pending-post.is-compact .otv-pending-preview p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.otv-pending-post.is-compact img { width: 44px; height: 44px; }
.otv-pending-status { display: grid; gap: 4px; margin-top: 12px; font-size: var(--fs-sm); }
.otv-pending-status span { color: var(--text-secondary); }
.otv-pending-post progress { width: 100%; height: 6px; margin-top: 10px; accent-color: #facc15; }
.otv-pending-actions { display: flex; gap: 12px; margin-top: 10px; }
.otv-pending-actions:empty { display: none; }
.otv-pending-actions button, .otv-pending-actions a { padding: 6px 10px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-hover); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
[data-image-upload-status] { color: var(--text-secondary); font-size: var(--fs-xs); }
@media (max-width: 768px) { .otv-publish-jobs { bottom: calc(82px + env(safe-area-inset-bottom)); right: 16px; } }

.otv-youtube-preview { overflow: hidden; margin: 10px 0; border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-card); }
.otv-youtube-media { position: relative; aspect-ratio: 16 / 9; min-height: 200px; }
.otv-youtube-thumb { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #080b10; cursor: pointer; }
.otv-youtube-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.otv-youtube-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 68px; height: 48px; border-radius: 14px; transform: translate(-50%, -50%); background: #f00; color: #fff; box-shadow: 0 4px 18px #0006; }
.otv-youtube-play svg { margin-left: 3px; }
.otv-youtube-thumb:hover .otv-youtube-play { background: #c00; }
.otv-youtube-thumb:focus-visible { outline: 3px solid #facc15; outline-offset: -3px; }
.otv-youtube-thumb[aria-busy="true"] .otv-youtube-play { width: 58px; height: 58px; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.otv-youtube-player { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #080b10; transition: opacity .3s ease; }
.otv-youtube-player.is-pending { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .otv-youtube-player { transition: none; }
}
.otv-youtube-caption { display: grid; gap: 5px; padding: 12px 14px; }
.otv-youtube-caption strong { color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.4; }
.otv-youtube-caption span, .otv-youtube-caption a { color: var(--text-secondary); font-size: var(--fs-xs); }
.otv-youtube-caption span:empty { display: none; }
.otv-youtube-caption a:hover { color: var(--text-primary); }
