/* Praxt - Lightweight Custom Styles */

/* Light theme (default) */
:root {
  --color-primary: #16a34a;
  --color-primary-dark: #15803d;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f9fafb;
  --color-surface: #fff;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --radius: 0.5rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --max-width: 48rem;
  --safe-bottom: env(safe-area-inset-bottom, 0);
  color-scheme: light dark;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #4ade80;
    --color-primary-dark: #22c55e;
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-border: #374151;
    --color-bg: #111827;
    --color-surface: #1f2937;
    --color-success: #34d399;
    --color-success-bg: #064e3b;
    --color-danger: #f87171;
    --color-danger-bg: #7f1d1d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1rem;
  height: 3.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

header .logo:hover {
  text-decoration: none;
}

header nav {
  display: flex;
  gap: 0.5rem;
}

header nav a {
  padding: 0.5rem 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
}

header nav a:hover {
  color: var(--color-text);
  text-decoration: none;
}

header nav a.active {
  color: var(--color-primary);
}

/* Header search */
.header-search {
  display: none;
  position: relative;
  flex: 1;
  max-width: 20rem;
  margin: 0 1rem;
}

@media (min-width: 640px) {
  .header-search {
    display: flex;
    align-items: center;
  }
}

.header-search .search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.header-search input[type="search"] {
  width: 100%;
  padding: 0.375rem 0.75rem 0.375rem 2rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  transition: border-color 0.15s, box-shadow 0.15s, width 0.2s;
}

.header-search input[type="search"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(110, 229, 70, 0.2);
  background: var(--color-surface);
}

.header-search input[type="search"]::placeholder {
  color: var(--color-text-muted);
}

.header-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

/* Search dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 1000;
}

.search-dropdown.open {
  display: block;
}

.search-suggestion-group {
  padding: 0.5rem 0;
}

.search-suggestion-group+.search-suggestion-group {
  border-top: 1px solid var(--color-border);
}

.search-suggestion-header {
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.search-suggestion {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s;
}

.search-suggestion:hover,
.search-suggestion.selected {
  background: var(--color-bg);
  text-decoration: none;
}

.search-suggestion-user .avatar {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.6875rem;
}

.search-suggestion-name {
  font-weight: 500;
  font-size: 0.875rem;
}

.search-suggestion-post {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.search-suggestion-body {
  font-size: 0.875rem;
  line-height: 1.3;
}

.search-suggestion-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.search-view-all {
  display: block;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.search-view-all:hover {
  background: var(--color-bg);
  text-decoration: none;
}

.search-no-results {
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

header .user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.875rem;
}

header .user-menu a {
  color: var(--color-text-muted);
}

header .user-menu button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

header .user-menu button:hover {
  color: var(--color-text);
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
}

@media (min-width: 640px) {
  main {
    padding-bottom: 2rem;
  }
}

/* Mobile navigation */
.mobile-nav {
  display: flex;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}

.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0.75rem 0;
  color: var(--color-text-muted);
  font-size: 0.625rem;
}

.mobile-nav a:hover {
  text-decoration: none;
}

.mobile-nav a.active {
  color: var(--color-primary);
}

.mobile-nav a.new-post {
  color: var(--color-surface);
}

.mobile-nav a.new-post svg {
  background: var(--color-primary);
  border-radius: 50%;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: -1rem;
  box-shadow: var(--shadow);
}

.mobile-nav svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.125rem;
}

@media (min-width: 640px) {
  .mobile-nav {
    display: none;
  }
}

/* Flash messages */
.flash {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.flash-notice {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.flash-alert {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card+.card {
  margin-top: 1rem;
}

.card h1,
.card h2 {
  margin: 0 0 1rem;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

/* Buttons */
button,
input[type="submit"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

button,
input[type="submit"],
.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
}

button:hover,
input[type="submit"]:hover,
.btn-primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-danger {
  background: none;
  border: none;
  color: var(--color-danger);
  padding: 0.25rem 0.5rem;
}

.btn-danger:hover {
  text-decoration: underline;
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
}

/* Form actions row */
.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* Field groups */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Error states */
.field-error input,
.field-error textarea,
.field-error select {
  border-color: var(--color-danger);
}

.error-message {
  color: var(--color-danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.errors {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Page headers */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

/* Lists */
ul,
ol {
  padding-left: 1.5rem;
}

/* User avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* Image avatars */
img.avatar {
  object-fit: cover;
  background: var(--color-bg);
}

.avatar-large {
  width: 4rem;
  height: 4rem;
  font-size: 1.25rem;
}

/* User rows (for lists) */
.user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.user-row+.user-row {
  border-top: 1px solid var(--color-border);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info a {
  font-weight: 500;
  color: var(--color-text);
}

.user-info small {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Feed items */
article {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

article+article {
  margin-top: 1rem;
}

article header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  height: auto;
  background: none;
  border: none;
  margin-bottom: 0.75rem;
}

article header .meta {
  flex: 1;
}

article header .meta a {
  font-weight: 600;
  color: var(--color-text);
}

article header .meta time {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

article .content {
  white-space: pre-wrap;
  word-wrap: break-word;
}

article footer {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: 1rem;
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}

.stats button {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: inherit;
}

.stats button:hover {
  background: var(--color-bg);
}

.stats strong {
  display: block;
  font-size: 1.5rem;
  color: var(--color-text);
}

.stats small {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Panels (collapsible sections) */
.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: 1rem;
}

.panel.hidden {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.panel-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 0.25rem;
  cursor: pointer;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

/* Empty states */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

/* Modals */
dialog {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  max-width: 28rem;
  width: calc(100% - 2rem);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

dialog h2 {
  margin: 0 0 1rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Auth layout */
.auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 24rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.auth-card h1 {
  text-align: center;
  margin: 0 0 1.5rem;
  color: var(--color-primary);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Utility: visually hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Utility: text alignment */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Utility: margins */
.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--color-bg);
  color: var(--color-text-muted);
  text-decoration: none;
}

.tag:hover {
  background: var(--color-border);
}

.tag-active {
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-primary);
}

/* Link-style button */
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Button forms (button_to) - reset form styles */
form.button_to {
  display: inline-flex;
  flex-direction: row;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* Icon buttons - ghost/subtle round style */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-icon-sm {
  width: 1.75rem;
  height: 1.75rem;
}

.btn-icon-sm svg {
  width: 0.875rem;
  height: 0.875rem;
}

.btn-icon-lg {
  width: 2.75rem;
  height: 2.75rem;
}

.btn-icon-lg svg {
  width: 1.375rem;
  height: 1.375rem;
}

.btn-icon-danger:hover {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* Action buttons container */
.action-buttons {
  display: flex;
  gap: 0.25rem;
}

/* Page actions (centered at bottom of show pages) */
.page-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Search page */
.search-page form {
  gap: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input-wrapper input[type="search"] {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  font-size: 1.125rem;
  border-radius: var(--radius);
}

.search-input-wrapper input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.search-input-wrapper .clear-search {
  position: absolute;
  right: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  color: var(--color-text-muted);
}

.search-input-wrapper .clear-search:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.search-input-wrapper .clear-search svg {
  width: 1rem;
  height: 1rem;
}

.search-filters {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

.filter-tab:hover {
  color: var(--color-text);
  text-decoration: none;
}

.filter-tab.active {
  background: rgba(110, 229, 70, 0.15);
  color: var(--color-primary);
}

.search-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.search-section {
  margin-bottom: 2rem;
}

.search-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-users {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem 1rem;
}

.search-posts article:first-child {
  margin-top: 0;
}

/* ===================
   Link Preview Styles
   =================== */

/* Link preview in feed */
.post-links {
  margin-top: 0.75rem;
}

.post-links .link-preview + .link-preview,
.post-links .link-simple + .link-simple {
  margin-top: 0.5rem;
}

.link-preview {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-preview:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.link-preview-image-container {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  background: var(--color-bg);
}

.link-preview-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-preview-body {
  padding: 0.75rem;
}

.link-preview-site {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.link-preview-favicon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.link-preview-title {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-description {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-pending {
  background: var(--color-bg);
}

.link-preview-loading {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Simple link fallback */
.link-simple {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  color: var(--color-primary);
  text-decoration: none;
}

.link-simple:hover {
  background: var(--color-border);
  text-decoration: none;
}

.link-simple svg {
  flex-shrink: 0;
}

/* ===================
   Emote/Reaction Styles
   =================== */

/* Footer layout for emotes and replies */
article footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

article footer .replies-link {
  margin-left: auto;
}

/* Emotes container */
.emotes-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.emotes-container form {
  display: flex;
  align-items: center;
}

/* Emote button */
.emote-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--color-text-muted);
}

.emote-button:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.emote-button-active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}

.emote-button .emote-emoji {
  font-size: 1rem;
  line-height: 1;
}

.emote-button svg {
  width: 18px;
  height: 18px;
}

/* Emote picker */
.emote-picker {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  display: none;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.emote-picker-open {
  display: flex;
}

.emote-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.15s;
}

.emote-option:hover {
  background: var(--color-bg);
  transform: scale(1.2);
}

.emote-option-selected {
  background: var(--color-primary-bg);
}

/* Emote summary */
.emote-summary {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.emote-count {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem 0.375rem;
  background: var(--color-bg);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: default;
}

.emote-count:hover {
  background: var(--color-border);
}

/* ===================
   File Upload Styles
   =================== */

.file-upload-section {
  margin-top: 0.5rem;
}

.file-upload-area {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.file-upload-area:hover,
.file-upload-area:focus-within {
  border-color: var(--color-primary);
  background: rgba(22, 163, 74, 0.03);
}

.file-upload-area .file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.file-upload-placeholder svg {
  color: var(--color-primary);
}

.file-upload-placeholder span {
  font-weight: 500;
}

.file-upload-placeholder small {
  font-size: 0.75rem;
}

.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.file-preview-grid:empty {
  display: none;
}

.file-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-item .file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
}

.file-preview-item .file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.625rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-item .remove-file {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
}

.file-preview-item .remove-file:hover {
  background: var(--color-danger);
}

/* Inline file input for replies */
.file-input-inline {
  font-size: 0.875rem;
}

/* Existing attachments in edit form */
.existing-attachments {
  margin-top: 0.5rem;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.attachment-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  text-align: center;
}

.attachment-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: calc(var(--radius) / 2);
}

.attachment-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border-radius: calc(var(--radius) / 2);
  color: var(--color-text-muted);
}

.attachment-name {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  word-break: break-all;
}

.attachment-remove {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.attachment-remove input {
  margin: 0;
}

/* Post attachments display */
.post-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.post-attachment-image {
  width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
}

.post-attachment-video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
}

.post-attachment-audio {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
}

.post-attachment-audio audio {
  width: 100%;
}

.post-attachment-audio .audio-filename {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.post-attachment-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  color: var(--color-text);
}

.post-attachment-file:hover {
  background: var(--color-border);
  text-decoration: none;
}

.post-attachment-file svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.post-attachment-file small {
  color: var(--color-text-muted);
}

/* Reply attachments */
.reply-attachments-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.reply-attachment-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: calc(var(--radius) / 2);
}

.reply-attachment-media,
.reply-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--color-bg);
  border-radius: calc(var(--radius) / 2);
  font-size: 0.75rem;
  color: var(--color-text);
}

.reply-attachment-media:hover,
.reply-attachment-file:hover {
  background: var(--color-border);
  text-decoration: none;
}

.reply-row {
  flex-wrap: wrap;
}

/* Comment avatars - smaller size */
.avatar-comment {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}
