/* Guhya Forum — modern Discord + YouTube inspired UI */
:root {
  --bg: #0f1115;
  --bg-elevated: #161a21;
  --bg-card: #1a1f27;
  --bg-hover: #222832;
  --bg-input: #12151b;
  --border: #2a3140;
  --border-soft: #232a36;
  --text: #e8eaed;
  --text-secondary: #9aa3b2;
  --text-muted: #6b7380;
  --accent: #7c6cf0;
  --accent-2: #38bdf8;
  --accent-pink: #ec4899;
  --accent-hover: #6366f1;
  --accent-soft: rgba(124, 108, 240, 0.18);
  --like: #ed4245;
  --like-soft: rgba(237, 66, 69, 0.15);
  --success: #3ba55d;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-w: 860px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: #8b93f7; }

/* ========== Header ========== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wordmark span { color: var(--accent); }
.wordmark::before {
  content: "";
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #ec4899, #38bdf8);
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(236,72,153,0.45);
}
.tagline {
  display: none;
  color: var(--text-muted);
  font-size: 13px;
}
@media (min-width: 640px) {
  .tagline { display: block; }
}
.header-meta {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-soft);
}

/* ========== Layout ========== */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px 80px;
  width: 100%;
  flex: 1;
}

/* ========== Topics ========== */
.topics {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topics::-webkit-scrollbar { display: none; }
.topic-chip {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.topic-chip:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
.topic-chip.active {
  background: linear-gradient(135deg, #ec4899, #38bdf8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(236,72,153,0.3);
}

/* ========== Composer ========== */
.composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.composer h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.composer h2::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.row-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row-fields .field { flex: 1; min-width: 140px; }

input[type=text],
textarea,
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input[type=text]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.remaining {
  font-size: 12.5px;
  color: var(--text-muted);
}
.remaining.low { color: #f0a020; }
.remaining.zero { color: var(--like); }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
}
button:disabled, .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary, .btn.primary {
  background: linear-gradient(135deg, #ec4899 0%, #a78bfa 45%, #38bdf8 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.25), 0 2px 8px rgba(56, 189, 248, 0.2);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
button.primary:hover:not(:disabled), .btn.primary:hover {
  background: linear-gradient(135deg, #f472b6 0%, #c4b5fd 45%, #7dd3fc 100%);
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.35), 0 3px 12px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}

/* ========== Posts list ========== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.post-card:hover {
  border-color: #3a4252;
  background: var(--bg-hover);
}
.post-card a.post-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #9b59b6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.post-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.post-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-time {
  font-size: 12px;
  color: var(--text-muted);
}
.topic-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.post-body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  z-index: 2;
}
.post-body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}
.action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.action-btn.liked,
.action-btn.like-btn.liked {
  color: var(--like);
  background: var(--like-soft);
}
.action-btn.liked:hover {
  background: rgba(237,66,69,0.25);
}
.action-btn svg {
  flex-shrink: 0;
}
.like-count {
  font-variant-numeric: tabular-nums;
}

/* ========== Empty / Pagination ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state p { margin: 0 0 8px; font-size: 15px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.pagination a:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: #3a4252;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}
.page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== Single post page ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 18px;
  padding: 6px 0;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.single-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.single-post .post-body {
  font-size: 15.5px;
  line-height: 1.65;
  margin-bottom: 16px;
}
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0 0;
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
}
.share-url {
  flex: 1;
  min-width: 140px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 7px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ========== Replies ========== */
.replies-section {
  margin-top: 8px;
}
.replies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.replies-header h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.reply-count {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: 12px;
}

.reply {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.reply:last-child { border-bottom: none; }
.reply-content {
  flex: 1;
  min-width: 0;
}
.reply-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.reply-author {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.reply-time {
  font-size: 12px;
  color: var(--text-muted);
}
.reply-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.reply-composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
}
.reply-composer h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

/* ========== Alerts ========== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert.error {
  background: rgba(237,66,69,0.12);
  border: 1px solid rgba(237,66,69,0.3);
  color: #f48787;
}
.alert.success {
  background: rgba(59,165,93,0.12);
  border: 1px solid rgba(59,165,93,0.3);
  color: #6dd48a;
}

/* ========== Footer ========== */
footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
}

/* ========== Mobile polish ========== */
@media (max-width: 520px) {
  .post-card, .single-post, .composer, .reply-composer {
    padding: 14px;
  }
  .avatar { width: 32px; height: 32px; font-size: 12px; }
  .topic-badge { display: none; }
  .share-bar { flex-direction: column; align-items: stretch; }
  .share-url { width: 100%; }
}

/* Smooth like animation */
.like-btn {
  transition: transform 0.12s ease;
}
.like-btn:active {
  transform: scale(0.92);
}
.like-btn.liked svg {
  animation: heartPop 0.3s ease;
}
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ========== Advanced: thread lines (Discord-style) ========== */
.replies-section {
  position: relative;
}
.reply {
  position: relative;
  padding-left: 4px;
}
.reply::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
.reply:first-of-type::before {
  top: 28px;
}
.reply:last-of-type::before {
  bottom: calc(100% - 28px);
  top: 0;
}
.reply:only-of-type::before {
  display: none;
}
.reply .avatar.sm {
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 3px var(--bg);
}

/* Horizontal connector from line to avatar */
.reply::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 20px;
  width: 14px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  z-index: 1;
}
.reply:only-of-type::after {
  display: none;
}

/* Nested feel spacing */
.reply-content {
  margin-left: 2px;
}

/* ========== Instant like animation ========== */
.action-btn.like-btn {
  position: relative;
  overflow: visible;
}
.action-btn.like-btn.liked {
  color: var(--like);
  background: var(--like-soft);
}
.action-btn.like-btn svg {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.action-btn.like-btn.liked svg {
  transform: scale(1.12);
}
.action-btn.like-btn.pop svg {
  animation: likeBurst 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes likeBurst {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1.12); }
}
@keyframes likeUnburst {
  0% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.action-btn.like-btn.unpop svg {
  animation: likeUnburst 0.2s ease;
}

/* Floating +1 particle */
.like-particle {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--like);
  pointer-events: none;
  animation: particleUp 0.6s ease forwards;
  z-index: 10;
}
@keyframes particleUp {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-22px) scale(1.2); }
}

/* Smooth card enter */
.post-card {
  animation: fadeSlide 0.25s ease both;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Focus rings for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Subtle pulse on new content */
.alert.success {
  animation: fadeSlide 0.3s ease;
}

/* ========== Search bar ========== */
.top-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-form {
  flex: 1;
  min-width: 180px;
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.search-form button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.search-form button:hover { color: var(--accent); }

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: #3a4252;
}

/* ========== Leaderboard modal ========== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 8px 0; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  transition: background 0.12s;
}
.lb-row:hover { background: var(--bg-hover); }
.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-rank.gold { color: #f5c542; font-size: 18px; }
.lb-rank.silver { color: #c0c7d1; font-size: 16px; }
.lb-rank.bronze { color: #cd7f32; font-size: 16px; }
.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 9px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}

/* ========== Thread lines (Discord-style) ========== */
.replies-thread {
  position: relative;
  margin-left: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.replies-thread .reply {
  position: relative;
  padding: 12px 0 12px 4px;
  border-bottom: none;
}
.replies-thread .reply::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 26px;
  width: 14px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}
.replies-thread .reply:hover {
  background: transparent;
}

/* ========== Better like animation ========== */
.like-btn {
  transition: transform 0.1s ease, background 0.12s, color 0.12s;
  will-change: transform;
}
.like-btn:active { transform: scale(0.88); }
.like-btn.liked {
  color: var(--like) !important;
  background: var(--like-soft) !important;
}
.like-btn.pulse {
  animation: likePulse 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes likePulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.22); }
  55% { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.like-btn .like-count {
  transition: transform 0.15s ease;
  display: inline-block;
}
.like-btn.pulse .like-count {
  animation: countPop 0.3s ease;
}
@keyframes countPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Time micro style */
.post-time, .reply-time {
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.post-time time, .reply-time time {
  cursor: default;
}

/* Search results header */
.search-label {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-weight: 500;
}
.search-label strong { color: var(--text); }

/* Hide remaining limit text styling already exists — we simply omit from HTML */

/* External links + preview cards */
.ext-link {
  color: #8b9cff;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  position: relative;
  z-index: 3;
}
.ext-link:hover { color: #b3bcff; }
.link-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none !important;
  position: relative;
  z-index: 3;
  transition: border-color 0.15s, background 0.15s;
}
.link-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.link-card-host {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.link-card-url {
  font-size: 12.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== FAB + composer sheet ========== */
.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ec4899 0%, #818cf8 50%, #38bdf8 100%);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
  z-index: 150;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:hover {
  background: var(--accent-hover);
  transform: scale(1.06);
  box-shadow: 0 8px 28px rgba(88, 101, 242, 0.55);
}
.fab:active { transform: scale(0.94); }

.sheet-backdrop {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 160;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(3px);
}
.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
}
.sheet-backdrop.open .sheet {
  transform: translateY(0);
}
.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.sheet-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.sheet-body {
  padding: 14px 18px 24px;
}

@media (min-width: 640px) {
  .sheet-backdrop {
    align-items: center;
    padding: 16px;
  }
  .sheet {
    border-radius: 14px;
    max-height: 80vh;
  }
  .sheet-handle { display: none; }
}

@media (max-width: 520px) {
  .fab { right: 16px; bottom: 18px; width: 52px; height: 52px; }
}

/* Reply composer — clear, always usable */
.reply-composer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}
.reply-composer h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.reply-composer h3::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}
.reply-composer textarea {
  min-height: 96px;
}
.hint-muted {
  font-size: 12px;
  color: var(--text-muted);
}
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
#replyBtn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Three-dot message menu (profile) */
.menu-dots {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 6;
}
.menu-dots:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.menu-drop {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 20;
  overflow: hidden;
}
.menu-drop.open { display: block; }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text); }
.menu-item.danger { color: var(--like); }
.menu-item.danger:hover { background: var(--like-soft); }
.reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Guaranteed visible replies list */
.replies-list {
  display: block;
  margin: 0 0 12px;
  padding: 0;
}
.replies-list .reply {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  min-height: 48px;
}
.replies-list .reply:last-child { border-bottom: none; }
.reply-empty {
  padding: 24px 16px !important;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.reply-composer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 5;
  margin-top: 16px;
  margin-bottom: 24px;
}
.post-actions .action-btn {
  position: relative;
  z-index: 3;
}
.post-card .post-link {
  z-index: 1;
}


/* ===== Nebula buttons + forced reply form (final) ===== */
button.primary, .btn.primary, #replyBtn, .composer-actions .primary {
  background: linear-gradient(135deg, #ec4899 0%, #a78bfa 42%, #38bdf8 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.28), 0 2px 10px rgba(56, 189, 248, 0.22);
}
button.primary:hover:not(:disabled), .btn.primary:hover, #replyBtn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.fab {
  background: linear-gradient(145deg, #ec4899 0%, #818cf8 50%, #38bdf8 100%) !important;
  box-shadow: 0 6px 24px rgba(236, 72, 153, 0.4), 0 0 20px rgba(56, 189, 248, 0.25) !important;
}

/* Reply form: always visible, correct placement */
#replyBox,
.reply-composer,
section#replies {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 4 !important;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  clip: auto !important;
}

#replyBox {
  margin-top: 20px !important;
  margin-bottom: 32px !important;
  padding: 18px !important;
  background: #1a1f27 !important;
  border: 1px solid #2a3140 !important;
  border-radius: 12px !important;
}

#shareBox {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

input:focus, textarea:focus, select:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2) !important;
}

.avatar {
  background: linear-gradient(135deg, #ec4899, #38bdf8) !important;
}
