/*
 * Open Stream – design system
 * Warm, content-first layout with clear hierarchy
 */

:root {
  /* Palette */
  --bg-page: #f5f3ef;
  --bg-card: #ffffff;
  --bg-card-hover: #fafaf9;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --text: #1c1917;
  --text-muted: #57534e;
  --text-subtle: #a8a29e;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-muted: #ccfbf1;

  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-muted: #fee2e2;

  --success: #15803d;
  --warn-bg: #fef9c3;
  --warn-border: #facc15;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Typography */
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, monospace;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);

  --primary: #0f766e;
  --primary-hover: #0d5f59;
  --text-main: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  min-height: 100vh;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-md);
  min-height: 0;
}

/* Nav */
.app-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.app-nav__brand {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text);
  text-decoration: none;
  margin-right: var(--space-md);
}

.app-nav__brand:hover {
  color: var(--accent);
}

.app-nav__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.app-nav__link:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.app-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-xs);
  margin-left: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
}

.app-nav__user {
  margin-left: auto;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
}

.app-nav__user:hover {
  color: var(--accent);
}

.app-nav__logout {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.app-nav__logout:hover,
.app-nav__logout-form input[type=submit]:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-page);
}

.app-nav__logout-form {
  margin: 0;
  display: inline-block;
}

.app-nav__logout-form input[type=submit] {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

/* Flash */
.flash {
  padding: var(--space-md) var(--space-lg);
  margin: 0;
  font-size: var(--text-sm);
}

.flash--notice {
  background: #dcfce7;
  color: var(--success);
  border-bottom: 1px solid #bbf7d0;
}

.flash--alert {
  background: var(--danger-muted);
  color: var(--danger);
  border-bottom: 1px solid #fecaca;
}

/* Page titles */
.page-title {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-xl);
  font-weight: 600;
}

.page-title--large {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-xl);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow);
}

.card--compact {
  padding: var(--space-sm) var(--space-md);
}

/* Compose / forms */
.compose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
}

.compose__row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.compose__row--relative {
  position: relative;
}

.compose__mention-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

/* @mention autocomplete dropdown */
.compose__mentions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: var(--space-xs);
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.compose__mentions-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background 0.1s;
}

.compose__mentions-item:hover,
.compose__mentions-item--selected {
  background: var(--accent-muted);
}

.compose__mentions-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.compose__mentions-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.compose__mentions-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.125rem;
}

.compose__mentions-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose__mentions-handle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.compose__avatar {
  flex-shrink: 0;
}

.compose__input--inline {
  flex: 1;
  min-height: 60px;
  margin-bottom: 0;
}

.compose--inline {
  margin-top: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
}

.compose__input {
  width: 100%;
  padding: var(--space-md);
  font-family: inherit;
  font-size: var(--text-base);
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 80px;
  margin-bottom: var(--space-sm);
}

.compose__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.compose__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
}

.compose__previews {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.compose__preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compose__preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compose__preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose__preview-remove:hover {
  background: var(--danger);
}

.compose__media-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.compose__media-add:hover {
  color: var(--accent-hover);
  background: var(--accent-muted);
}

.compose__media-add input {
  display: none;
}

.compose__media-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose__progress {
  flex: 1;
  min-width: 60px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.compose__progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s ease;
  width: 0%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--accent);
  color: white;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: white;
}

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

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

.btn--danger {
  background: var(--danger);
  color: white;
}

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

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.btn--sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8125rem;
}

/* Forms (auth) */
.auth-box {
  max-width: 400px;
  margin: var(--space-xl) auto;
  padding: var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.auth-box__title {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-2xl);
  font-weight: 600;
  text-align: center;
}

.auth-box__subtitle {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.form-group__input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: inherit;
  font-size: var(--text-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.form-group__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

.form-group__input--readonly {
  background: var(--bg-muted, #f5f5f5);
  color: var(--text-muted, #666);
}

.form-actions {
  margin-top: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.form-errors {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  color: var(--danger);
  font-size: var(--text-sm);
}

.form-errors li {
  margin-bottom: var(--space-xs);
}

/* Narrow auth card (sign up, check email) inside open-stream layout */
body.app-layout:has(.auth-flow-page) {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f8f9fb;
}

body.app-layout:has(.auth-flow-page) .open-stream-wrap {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 40px 16px !important;
}

body.app-layout:has(.auth-flow-page) .open-stream {
  width: 100% !important;
  max-width: 420px !important;
  min-width: unset !important;
  margin: 0 !important;
}

.auth-flow-page .auth-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 28px;
  max-width: none;
  margin: 0;
  box-shadow: none;
}

.auth-flow-page .auth-box__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 20px;
  text-align: left;
}

.auth-flow-page .auth-box__subtitle {
  margin: 0 0 var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: left;
  line-height: 1.5;
}

.auth-flow-page .form-group {
  margin-bottom: 16px;
}

.auth-flow-page .form-group__label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: normal;
}

.auth-flow-page .form-group__input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: none;
}

.auth-flow-page .form-group__input:focus {
  border-color: #0076ff;
  box-shadow: none;
}

.auth-flow-page .form-errors {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  color: #dc2626;
  font-size: 13px;
}

.auth-flow-page .form-errors li {
  margin-bottom: 6px;
}

.auth-flow-page .form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.auth-flow-page .btn {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.auth-flow-page .btn--primary {
  background: var(--primary);
  color: #fff;
}

.auth-flow-page .btn--primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.auth-flow-page .btn--secondary {
  background: #f3f4f6;
  color: #333;
}

.auth-flow-page .btn--secondary:hover {
  background: #e5e7eb;
}

.auth-flow-page .auth-divider {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 20px 0;
  position: relative;
}

.auth-flow-page .auth-divider::before,
.auth-flow-page .auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e5e7eb;
}

.auth-flow-page .auth-divider::before {
  left: 0;
}

.auth-flow-page .auth-divider::after {
  right: 0;
}

.auth-flow-page .google-btn {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.auth-flow-page .google-btn:hover {
  background: var(--primary-hover);
  color: #fff;
  border-color: var(--primary-hover);
}

.auth-flow-page .check-email__address {
  display: block;
  margin: 0 0 var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: #f5f5f4;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 600;
  word-break: break-word;
}

.auth-flow-page .check-email__hint {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-flow-page .check-email__footer {
  margin-top: var(--space-lg);
  text-align: center;
  font-size: var(--text-sm);
}

.auth-flow-page .check-email__footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-flow-page .check-email__footer a:hover {
  text-decoration: underline;
}

/* Two-column page layout (guest view: main content + sidebar) */
body.app-layout:has(.two-col-page) .open-stream-wrap {
  padding-left: 24px;
  padding-right: 24px;
}

body.app-layout:has(.two-col-page) .open-stream {
  width: 100% !important;
  max-width: 1200px !important;
  min-width: 0 !important;
}

.two-col-page {
  width: 100%;
}

.two-col-page__layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.two-col-page__main {
  min-width: 0;
}

.two-col-page__sidebar {
  position: sticky;
}

@media (max-width: 900px) {
  .two-col-page__layout {
    grid-template-columns: 1fr;
  }

  .two-col-page__sidebar {
    position: static;
  }
}

/* Sidebar auth card */
.sidebar-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.sidebar-auth-card__title {
  margin: 0 0 12px;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

.sidebar-auth-card__text {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.sidebar-auth-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-auth-card__terms {
  margin-top: 16px;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.sidebar-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-subtle);
  font-size: 0.75rem;
  padding: 0 4px;
}

.btn--full {
  width: 100%;
}

/* Avatar */
.avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.avatar--48 {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.avatar--40 {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.avatar--72 {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.avatar--40.avatar--placeholder {
  font-size: 0.875rem;
}

.avatar--72.avatar--placeholder {
  font-size: 1.5rem;
}

/* Post */
.post {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md);
  transition: background 0.15s;
}

.post:last-child {
  border-bottom: none;
}

.post--clickable {
  cursor: pointer;
}

.post:hover {
  background: var(--bg-card-hover);
}

.post__layout {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.post__avatar {
  flex-shrink: 0;
}

.post__avatar a {
  display: block;
  text-decoration: none;
}

.post__content {
  flex: 1;
  min-width: 0;
}

.post__boost-label {
  font-size: var(--text-sm);
  color: var(--text-subtle);
  margin-bottom: var(--space-sm);
}

.post__boost-label a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.post__boost-label a:hover {
  text-decoration: underline;
}

.post__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  flex-wrap: wrap;
}

.post__meta {
  color: var(--text-subtle);
  font-size: var(--text-sm);
}

/* Timeline */
.timeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}


.timeline.timeline--standalone {
  border-radius: var(--radius);
}

.timeline .post {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.timeline .post:last-child {
  border-bottom: none;
}

.post__author {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.post__author:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post__time {
  font-size: var(--text-sm);
  color: var(--text-subtle);
  text-decoration: none;
}

.post__time:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post__meta-count,
.post__likes-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-left: var(--space-xs);
}

.post__body {
  margin: 0 0 var(--space-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.post__mention,
.post__body--markdown a.post__mention {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.post__mention:hover,
.post__body--markdown a.post__mention:hover {
  text-decoration: underline;
}

.post__media {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius);
  overflow: hidden;
}

.post__media-link {
  display: block;
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
}

.post__media-img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.post__quoted {
  margin: var(--space-sm) 0;
  padding: var(--space-md);
  border: 1px solid var(--border);
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: block;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.post__quoted:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.post__quoted--link {
  cursor: pointer;
}

.post__quoted-author {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.post__quoted-body {
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.post__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  flex-wrap: wrap;
}

.post-action {
  display: inline-flex;
  align-items: center;
}

.post-action__link,
.post-action__form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  margin: 0;
}

.post-action__form button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}

.post-action__link:hover,
.post-action__form:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.post-action__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.post-action__icon--filled {
  color: var(--danger);
}

.post__action-form--like .post-action__icon--filled,
.post__action-form--like .post-action__count--active {
  color: var(--danger);
}

.post__action-form--like:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

.post-action__count {
  min-width: 1.25em;
  text-align: left;
}

.post-action__count--active {
  color: var(--danger);
}


.post__action-form--danger {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.post__action-form--danger button {
  color: var(--danger);
}

.post__action-form--danger:hover {
  color: var(--danger-hover);
  background: var(--danger-muted);
}

.post__actions form {
  margin: 0;
}

.post__action-form input[type=submit] {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
}

.post__action-form input[type=submit]:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.post__action-form--danger input[type=submit]:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

/* Profile */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
}

.profile-header__avatar-wrap {
  flex-shrink: 0;
}

.profile-header__name {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xl);
  font-weight: 600;
}

.profile-header__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.profile-header__description {
  margin-top: var(--space-sm);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.profile-header__description p {
  margin: 0 0 var(--space-xs) 0;
}

.profile-header__description p:last-child {
  margin-bottom: 0;
}

.profile-header__feed-pref {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.profile-header__feed-pref-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xs);
}

.profile-header__feed-field-name {
  font-weight: 600;
  color: var(--text);
  margin-right: var(--space-xs);
}

.profile-header__feed-desc {
  margin: 0 0 var(--space-sm);
}

.profile-header__feed-spec-wrap {
  margin-top: var(--space-xs);
}

.profile-header__feed-spec-wrap .profile-header__feed-field-name {
  display: block;
  margin-bottom: var(--space-xs);
}

.profile-header__feed-spec {
  margin: 0;
  padding: var(--space-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-muted);
}

.profile-header__actions {
  margin-top: var(--space-sm);
}

/* Profile tabs */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.profile-tabs__link {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.profile-tabs__link:hover {
  color: var(--text);
}

.profile-tabs__link--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* User list (followers, etc.) */
.user-list {
  list-style: none;
  padding: var(--space-sm) 0;
  margin: 0;
}

.user-list.card {
  padding: var(--space-md) var(--space-lg);
}

.user-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.user-list__item:last-child {
  border-bottom: none;
}

.user-list__item:hover {
  background: var(--bg-card-hover);
}

.user-list__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: var(--space-xs) 0;
  margin: calc(-1 * var(--space-xs)) 0;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.user-list__link:hover {
  color: var(--accent);
}

.user-list__link .avatar {
  flex-shrink: 0;
}

.user-list__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-list__name {
  font-weight: 600;
  font-size: var(--text-base);
}

.user-list__meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.user-list__action {
  margin: 0;
  flex-shrink: 0;
}

.user-list__action input[type="submit"] {
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.user-list__action input[type="submit"]:hover {
  opacity: 0.9;
}

/* Auth divider */
.auth-divider {
  text-align: center;
  margin: var(--space-lg) 0;
  font-size: var(--text-sm);
  color: var(--text-subtle);
}
.warn-box {
  padding: var(--space-md);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-top: var(--space-md);
}

.warn-box code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

/* Section title */
.section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0 var(--space-md);
}

.section-title__count {
  font-weight: 500;
  color: var(--text-muted);
}

/* App config render (sandboxed iframe) */
.app-render {
  margin-bottom: var(--space-xl);
}

.app-render__iframe {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Tight layout for app posts in feed - content adjacent to action buttons */
.post__body.app-render {
  margin-bottom: 0;
  padding: 0;
}

.post__body.app-render + .post__actions {
  margin-top: 0;
  padding-top: 0;
}

.app-render__iframe--post {
  min-height: 1px;
  display: block;
  border: none;
  margin: 0;
  vertical-align: top;
}

/* Empty state */
.empty-hint {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-subtle);
  font-size: var(--text-sm);
}

.post-detail__nav {
  margin-bottom: var(--space-md);
}

.post-detail__back {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.post-detail__back:hover {
  color: var(--accent);
  text-decoration: underline;
}

.post-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post-detail__main .post {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
}

.post-detail__replies {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.post-detail__section-title {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
}

.post-detail__reply-form {
  margin-bottom: var(--space-lg);
}

.post-detail__reply-form .compose__row {
  margin-bottom: var(--space-sm);
}

.post-detail__reply-form .compose__actions {
  margin-top: 0;
}

.post-detail__replies .post {
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post-detail__replies .post:last-of-type {
  margin-bottom: 0;
}

.post-detail__section {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.post-detail__section:last-child {
  border-bottom: none;
}

.post-detail__section .section-title {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
}

.post-detail__boosted-by {
  margin: 0 0 var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.post-detail__boosted-by a {
  color: var(--accent);
  text-decoration: none;
}

.post-detail__boosted-by a:hover {
  text-decoration: underline;
}
