/* ══════════════════════════════════════════
   twttr - Original 2006 Style
   Grünes Blob-Logo, minimalistisch, roh
   ══════════════════════════════════════════ */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  background: #fff;
}

a {
  color: #5eab1f;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #3d7a0a;
}

/* Container */
#container {
  width: 520px;
  margin: 0 auto;
  padding: 20px 0;
}

/* ── Header ── */
#header {
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 2px solid #87C540;
}

#header h1 {
  font-size: 42px;
  font-weight: bold;
  letter-spacing: -2px;
  font-family: "Lucida Grande", "Trebuchet MS", sans-serif;
}

#header h1 a {
  text-decoration: none;
}

#header h1 a:hover {
  text-decoration: none;
  opacity: 0.9;
}

.header-logo {
  height: 50px;
  width: auto;
  vertical-align: middle;
}

.tagline {
  color: #999;
  font-size: 12px;
  margin-top: 4px;
}

#nav {
  margin-top: 8px;
  font-size: 12px;
  line-height: 22px;
}

#nav a {
  color: #5eab1f;
  font-weight: bold;
}

.nav-badge {
  display: inline-block;
  background: #c33;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 6px;
  margin-left: 1px;
  vertical-align: baseline;
  line-height: 14px;
}

.nav-user {
  display: block;
  text-align: right;
  color: #999;
  font-size: 11px;
  margin-top: 2px;
}

/* ── Flash Messages ── */
.flash {
  padding: 6px 10px;
  font-size: 12px;
  margin-bottom: 10px;
  border: 1px solid;
  border-radius: 3px;
}

.flash.success {
  background: #f0f9e8;
  color: #3d7a0a;
  border-color: #b3d98a;
}

.flash.error {
  background: #fce6e6;
  color: #cc3333;
  border-color: #f5b3b3;
}

/* ── Content ── */
#content {
  padding: 5px 0;
  min-height: 300px;
}

/* ── Footer ── */
#footer {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  text-align: center;
  font-size: 10px;
  color: #bbb;
}

.footer-links {
  margin-top: 3px;
}

.footer-links a {
  color: #bbb;
}

.footer-links a:hover {
  color: #5eab1f;
}

/* ══════════════════
   Home / Hero
   ══════════════════ */

.hero-box {
  margin-bottom: 20px;
}

.hero-box h2 {
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
  font-weight: bold;
}

.hero-box p {
  font-size: 12px;
  color: #666;
}

.hero-cta {
  margin-top: 12px;
}

.big-button {
  display: inline-block;
  background: #87C540;
  background: linear-gradient(to bottom, #a3d65c, #6db320);
  color: #fff !important;
  text-decoration: none !important;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #5a9a18;
}

.big-button:hover {
  background: #6db320;
  text-decoration: none !important;
}

/* ══════════════════
   Timeline Layout
   ══════════════════ */

#timeline-page,
#profile-page {
  display: flex;
  gap: 20px;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.main-col {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar ── */

.sidebar-box {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  padding: 10px;
  margin-bottom: 10px;
}

.user-card {
  text-align: center;
}

.avatar-big {
  width: 48px;
  height: 48px;
  background: #87C540;
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  line-height: 48px;
  text-align: center;
  border-radius: 4px;
  margin: 0 auto 6px;
}

img.avatar-big {
  object-fit: cover;
  line-height: normal;
}

img.avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  object-fit: cover;
}

.user-card h3 {
  font-size: 13px;
  margin-bottom: 2px;
}

.user-card h3 a {
  color: #5eab1f;
}

.user-bio {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

.user-stats {
  padding-top: 6px;
  border-top: 1px solid #e5e5e5;
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.stat a {
  text-decoration: none;
  color: inherit;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.stat a:hover .stat-num {
  color: #5eab1f;
}

.stat-num {
  font-size: 12px;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
}

.follow-action {
  margin-top: 8px;
}

.member-since {
  margin-top: 8px;
  font-size: 10px;
  color: #ccc;
}

.invite-box {
  margin-top: 12px;
  padding: 8px 10px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 11px;
}

.invite-count {
  margin: 0 0 4px 0;
  color: #333;
  font-size: 12px;
}

.invite-hint {
  margin: 0;
  color: #999;
  font-size: 10px;
}

.invite-codes {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
}

.invite-codes li {
  margin-bottom: 4px;
}

.invite-section-label {
  margin: 8px 0 3px 0;
  font-size: 10px;
  font-weight: bold;
  color: #5eab1f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invite-section-label.shared-label {
  color: #999;
  margin-top: 10px;
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.invite-link-input {
  flex: 1;
  font-size: 10px;
  padding: 3px 5px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
  box-sizing: border-box;
}

.invite-link-shared {
  background: #f9f9f9;
  color: #aaa;
  border-color: #e8e8e8;
}

.invite-action-form {
  margin: 0;
  padding: 0;
  display: inline;
}

.invite-mark-btn,
.invite-unmark-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 5px;
  color: #999;
  line-height: 1;
}

.invite-mark-btn:hover {
  background: #f0f7e6;
  border-color: #5eab1f;
  color: #5eab1f;
}

.invite-unmark-btn:hover {
  background: #fff5f5;
  border-color: #d40d12;
  color: #d40d12;
}

.invite-copied-flash {
  color: #5eab1f;
  font-size: 9px;
  font-weight: bold;
  margin-left: 4px;
}

/* ── Favorites ── */

.fav-form {
  display: inline;
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #999;
  padding: 0 4px;
}

.fav-btn:hover {
  color: #f5a623;
}

.fav-active {
  color: #f5a623;
}

/* ── Retweets ── */

.rt-form {
  display: inline;
}

.rt-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #999;
  padding: 0 4px;
}

.rt-btn:hover {
  color: #5eab1f;
}

.rt-count-link, .fav-count-link {
  font-size: 11px;
  color: #999;
  text-decoration: none;
  margin-left: -2px;
}
.rt-count-link:hover {
  text-decoration: underline;
  color: #5eab1f;
}
.fav-count-link:hover {
  text-decoration: underline;
  color: #c33;
}

/* Notifications */
.notification-list { margin-top: 10px; }
.notification-item {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #e5e5e5;
}
.notification-item:last-child { border-bottom: none; }
.notification-new { background: #f0f7e6; }
.notification-avatar { flex-shrink: 0; }
.notification-body { font-size: 13px; color: #555; line-height: 1.4; }
.notification-icon { font-weight: bold; margin-right: 3px; }
.notification-fav { color: #c33; }
.notification-rt { color: #5eab1f; }
.notification-follow { color: #3d7a0a; font-size: 15px; }
.notification-user { font-weight: bold; color: #5eab1f; text-decoration: none; }
.notification-user:hover { text-decoration: underline; }
.notification-tweet-link {
  display: block;
  margin-top: 3px;
  color: #999;
  font-size: 12px;
  text-decoration: none;
}
.notification-tweet-link:hover { text-decoration: underline; color: #666; }
.notification-time { color: #bbb; font-size: 11px; margin-left: 4px; }

.rt-active {
  color: #5eab1f;
  font-weight: bold;
}

/* ── Trending Topics ── */

.trending-box h4 {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.trending-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
}

.trending-list li a {
  color: #5eab1f;
  font-weight: bold;
}

.trending-count {
  color: #999;
  font-size: 10px;
}

.trending-bar {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

.trending-bar strong {
  color: #333;
  margin-right: 6px;
}

.trending-tag {
  color: #5eab1f;
  font-weight: bold;
  margin-right: 8px;
}

/* ── Pagination ── */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin-top: 8px;
  border-top: 1px solid #eee;
  font-size: 12px;
}

.pagination a {
  color: #5eab1f;
  font-weight: bold;
}

.page-info {
  color: #999;
}

/* ── Hashtags & Mentions ── */

.hashtag {
  color: #5eab1f;
  text-decoration: none;
}

.hashtag:hover {
  text-decoration: underline;
}

.mention {
  color: #5eab1f;
  text-decoration: none;
}

.mention:hover {
  text-decoration: underline;
}

.tweet-link {
  color: #5eab1f;
  text-decoration: none;
}

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

/* ── Twitpic Embeds ── */

.twitpic-embed {
  display: block;
  margin-top: 6px;
}

.twitpic-img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}

/* ── Direct Messages ── */

.dm-list {
  margin-top: 10px;
}

.dm-conversation {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e5e5;
  text-decoration: none;
  color: inherit;
}

.dm-conversation:hover {
  background: #f9f9f9;
}

.dm-avatar {
  margin-right: 8px;
}

.dm-info {
  flex: 1;
}

.dm-info strong {
  color: #333;
}

.dm-preview {
  display: block;
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.dm-time {
  font-size: 10px;
  color: #bbb;
}

.dm-thread {
  margin: 10px 0;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
}

.dm-message {
  display: flex;
  margin-bottom: 10px;
  align-items: flex-start;
}

.dm-sent {
  flex-direction: row-reverse;
}

.dm-bubble {
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  margin: 0 6px;
}

.dm-received .dm-bubble {
  background: #fff;
  border: 1px solid #e0e0e0;
}

.dm-sent .dm-bubble {
  background: #5eab1f;
  color: #fff;
}

.dm-sent .dm-bubble .dm-time {
  color: rgba(255,255,255,0.7);
}

.dm-compose {
  margin-top: 10px;
}

.dm-compose textarea {
  width: 100%;
  padding: 6px;
  font-size: 12px;
  border: 1px solid #ddd;
  box-sizing: border-box;
}

.dm-new-form {
  display: flex;
  gap: 6px;
}

.dm-to-input {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  border: 1px solid #ddd;
}

/* ── Search ── */

.search-form {
  display: flex;
  gap: 6px;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  border: 1px solid #ddd;
}

.search-users {
  margin-bottom: 15px;
}

.search-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
}

.search-bio {
  color: #999;
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-follow,
input[type="submit"].btn-follow {
  background: #87C540;
  background: linear-gradient(to bottom, #a3d65c, #6db320);
  color: #fff;
  border-color: #5a9a18;
}

.btn-follow:hover {
  background: #6db320;
}

.btn-unfollow,
input[type="submit"].btn-unfollow {
  background: #f5f5f5;
  color: #666;
  border-color: #ccc;
}

.btn-unfollow:hover {
  color: #c33;
  border-color: #c33;
}

.btn-edit {
  display: block;
  text-align: center;
  margin-top: 6px;
  background: #f5f5f5;
  color: #666;
  border-color: #ccc;
}

/* ── Tweet Form ── */

.tweet-form-box {
  border: 1px solid #e5e5e5;
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 12px;
}

.tweet-form-box h2 {
  font-size: 13px;
  color: #333;
  margin-bottom: 5px;
  font-weight: bold;
}

.tweet-form-box textarea {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
  font-size: 13px;
  resize: none;
}

.tweet-form-box textarea:focus {
  outline: none;
  border-color: #87C540;
}

.tweet-form-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#char-count {
  font-size: 16px;
  font-weight: bold;
  color: #ccc;
}

.submit-btn {
  background: #87C540;
  background: linear-gradient(to bottom, #a3d65c, #6db320);
  color: #fff;
  border: 1px solid #5a9a18;
  padding: 3px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.submit-btn:hover {
  background: #6db320;
}

/* ══════════════════
   Tweet List
   ══════════════════ */

.tweet {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.tweet-new {
  background: #f0f7e6;
  transition: background 1s ease;
}

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

.tweet-avatar {
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 32px;
  height: 32px;
  background: #ddd;
  color: #999;
  font-size: 14px;
  font-weight: bold;
  line-height: 32px;
  text-align: center;
  border-radius: 3px;
}

.tweet-body {
  flex: 1;
  min-width: 0;
  position: relative;
}

.tweet-author {
  font-weight: bold;
  color: #5eab1f;
  font-size: 12px;
}

.tweet-text {
  color: #333;
  word-wrap: break-word;
}

.tweet-time {
  display: inline;
  font-size: 10px;
  color: #bbb;
  margin-left: 4px;
}

.tweet-time a {
  color: #bbb;
  text-decoration: none;
}

.tweet-time a:hover {
  color: #5eab1f;
}

.tweet-reply-indicator {
  display: block;
  font-size: 11px;
  color: #bbb;
  margin: 2px 0;
}

.tweet-reply-indicator a {
  color: #5eab1f;
}

.tweet-actions {
  margin-top: 4px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.reply-link {
  font-size: 11px;
  color: #5eab1f;
  text-decoration: none;
}

.reply-link:hover {
  text-decoration: underline;
  color: #3d7a0a;
}

.delete-form {
  display: inline;
}

.delete-btn {
  background: none;
  border: none;
  color: #ddd;
  font-size: 14px;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
}

.delete-btn:hover {
  color: #c33;
}

/* ── Pinned Tweet ── */

.pinned-tweet {
  background: #f9fdf5;
  border-bottom: 1px solid #d4eab8 !important;
  border-left: 3px solid #87C540;
  padding-left: 8px;
}

.pinned-label {
  display: block;
  font-size: 10px;
  color: #87C540;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: #bbb;
  padding: 0 2px;
}

.pin-btn:hover { color: #87C540; }
.pin-active { color: #87C540; }

/* ── Empty State ── */

.empty-state {
  padding: 15px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

.empty-state a {
  display: block;
  margin-top: 5px;
}

/* ── Tweet Detail / Thread View ── */

#tweet-detail-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 0;
}

.tweet-thread {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  margin-bottom: 12px;
}

.tweet-in-thread {
  display: flex;
  gap: 8px;
  padding: 8px 10px 4px;
  border-bottom: none;
}

.tweet-in-thread.is-main {
  background: #f0f7e6;
  border-left: 3px solid #87C540;
}

.tweet-in-thread:last-child {
  padding-bottom: 10px;
}

.tweet-in-thread .tweet-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.thread-line {
  width: 2px;
  background: #d4eab8;
  flex: 1;
  min-height: 12px;
  margin-top: 4px;
  border-radius: 1px;
}

.thread-separator {
  height: 8px;
  margin: 0 10px;
  border-bottom: 2px dashed #cde8a8;
}

.reply-form-box {
  border: 1px solid #e5e5e5;
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 12px;
}

.reply-form-box h3 {
  font-size: 13px;
  color: #333;
  margin-bottom: 5px;
  font-weight: bold;
}

.reply-form-box textarea {
  width: 100%;
  padding: 5px;
  border: 1px solid #ccc;
  font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
  font-size: 13px;
  resize: none;
}

.reply-form-box textarea:focus {
  outline: none;
  border-color: #87C540;
}

.form-footer {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#reply-char-count {
  font-size: 16px;
  font-weight: bold;
  color: #ccc;
}

/* ── User List / Grid ── */

.user-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.user-card-small {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  padding: 8px 10px;
  text-align: center;
  width: 100px;
}

.user-card-small .avatar-placeholder {
  width: 28px;
  height: 28px;
  font-size: 12px;
  line-height: 28px;
  margin: 0 auto 4px;
}

.user-card-small a {
  font-size: 10px;
  font-weight: bold;
}

/* ══════════════════
   Auth Pages
   ══════════════════ */

#auth-page {
  display: flex;
  justify-content: center;
}

.auth-box {
  width: 320px;
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  padding: 20px;
}

.auth-box h2 {
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 11px;
  color: #999;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #555;
  margin-bottom: 2px;
}

.field label .required {
  color: #c33;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}

.field input[type="text"]:focus,
.field input[type="password"]:focus {
  outline: none;
  border-color: #87C540;
}

.hint {
  display: block;
  font-size: 10px;
  color: #bbb;
  margin-top: 1px;
}

.auth-alt {
  margin-top: 12px;
  font-size: 11px;
  color: #999;
  text-align: center;
}

/* ══════════════════
   Page Subtitles
   ══════════════════ */

.page-subtitle {
  color: #999;
  font-size: 11px;
  margin-bottom: 10px;
}

h2 {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
}

/* ══════════════════
   Legal Pages
   ══════════════════ */

.legal-page {
  max-width: 480px;
  font-size: 12px;
  color: #555;
  line-height: 1.7;
}

.legal-page h2 {
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

.legal-page h3 {
  font-size: 12px;
  color: #333;
  margin-top: 12px;
  margin-bottom: 3px;
}

.legal-page p {
  margin-bottom: 6px;
}

.legal-page ul {
  margin: 4px 0 8px 18px;
}

.legal-page li {
  margin-bottom: 2px;
}

/* ══════════════════════════════
   Admin Dashboard
   ══════════════════════════════ */

#admin-page {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 0;
}

.admin-header {
  padding: 10px 0 20px 0;
  border-bottom: 2px solid #87C540;
  margin-bottom: 20px;
}

.admin-header h1 {
  font-size: 32px;
  font-weight: bold;
  color: #333;
}

.admin-section {
  margin-bottom: 40px;
  background: #fff;
  padding: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.admin-section h2 {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.stats-overview {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  padding: 15px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: #5eab1f;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 15px;
}

.admin-table thead {
  background: #f5f5f5;
  border: 1px solid #ddd;
}

.admin-table th {
  padding: 10px;
  text-align: left;
  font-weight: bold;
  color: #333;
  border: 1px solid #ddd;
}

.admin-table td {
  padding: 10px;
  border: 1px solid #eee;
  color: #333;
}

.admin-table tr:nth-child(even) {
  background: #fafafa;
}

.admin-table tr:hover {
  background: #f0f0f0;
}

.admin-table code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 2px;
  font-family: monospace;
  font-size: 11px;
}

.status-used {
  background: #87C540;
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: bold;
}

.status-unused {
  background: #f0f0f0;
  color: #666;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
}

.genealogy-list {
  margin-top: 15px;
}

.genealogy-entry {
  margin-bottom: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-left: 3px solid #87C540;
  border-radius: 2px;
}

.genealogy-creator {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.invite-count {
  font-size: 11px;
  color: #999;
  font-weight: normal;
  margin-left: 8px;
}

.genealogy-invitees {
  margin-left: 10px;
}

.invitees-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 5px;
}

.genealogy-invitees ul {
  list-style: none;
  margin: 5px 0;
  padding: 0;
}

.genealogy-invitees li {
  font-size: 12px;
  color: #666;
  margin-bottom: 3px;
  padding-left: 10px;
}

.no-invitees {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 5px;
}

.admin-nav {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-nav-link {
  display: inline-block;
  padding: 6px 14px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  color: #5eab1f;
  font-weight: bold;
  font-size: 12px;
  text-decoration: none;
}

.admin-nav-link:hover {
  background: #e8e8e8;
}

.admin-nav-active {
  background: #5eab1f;
  color: #fff;
  border-color: #4a9017;
}

.admin-nav-active:hover {
  background: #4a9017;
}

.admin-action-btn {
  background: #5eab1f;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.admin-action-btn:hover {
  background: #4a9017;
}

.poll-bar-container {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}

.poll-bar {
  height: 14px;
  background: #5eab1f;
  border-radius: 2px;
  min-width: 2px;
}

.poll-pct {
  font-size: 11px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

.admin-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #999;
}

/* ══════════════════
   Dark Mode
   ══════════════════ */

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --bg2: #242424;
    --bg3: #2e2e2e;
    --text: #d8d8d8;
    --text2: #999;
    --border: #383838;
    --border2: #444;
  }
}

html[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg2: #242424;
  --bg3: #2e2e2e;
  --text: #d8d8d8;
  --text2: #999;
  --border: #383838;
  --border2: #444;
}

html[data-theme="light"],
html:not([data-theme="dark"]) {
  --bg: #fff;
  --bg2: #f9f9f9;
  --bg3: #f5f5f5;
  --text: #333;
  --text2: #999;
  --border: #e5e5e5;
  --border2: #ddd;
}

/* Apply vars — base */
body {
  background: var(--bg);
  color: var(--text);
}

/* Override all hardcoded #333 / #555 text in dark mode */
html[data-theme="dark"] .tweet-text,
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] p,
html[data-theme="dark"] label,
html[data-theme="dark"] .hero-box h2, html[data-theme="dark"] .hero-box p,
html[data-theme="dark"] .trending-bar strong,
html[data-theme="dark"] .admin-header h1,
html[data-theme="dark"] .admin-section h2,
html[data-theme="dark"] .trending-box h4,
html[data-theme="dark"] .reply-form-box h3,
html[data-theme="dark"] .tweet-form-box h2,
html[data-theme="dark"] .dm-info strong,
html[data-theme="dark"] .stat-num,
html[data-theme="dark"] .genealogy-creator,
html[data-theme="dark"] .invite-count,
html[data-theme="dark"] td,
html[data-theme="dark"] .poll-pct,
html[data-theme="dark"] .legal-page,
html[data-theme="dark"] .legal-page h2,
html[data-theme="dark"] .legal-page h3 { color: var(--text); }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tweet-text,
  html:not([data-theme="light"]) h1, html:not([data-theme="light"]) h2,
  html:not([data-theme="light"]) h3, html:not([data-theme="light"]) p,
  html:not([data-theme="light"]) label,
  html:not([data-theme="light"]) .trending-bar strong,
  html:not([data-theme="light"]) .admin-header h1,
  html:not([data-theme="light"]) .dm-info strong,
  html:not([data-theme="light"]) .stat-num,
  html:not([data-theme="light"]) td,
  html:not([data-theme="light"]) .legal-page { color: var(--text); }
}

#header {
  border-bottom-color: #87C540;
}

.tagline, .nav-user, .page-subtitle, .hint,
.auth-subtitle, .user-bio, .member-since,
.invite-hint, .dm-preview, .dm-time, .tweet-reply-indicator,
.stat-label, .empty-state, .trending-count, .search-bio,
.page-info, .tweet-time, .tweet-time a {
  color: var(--text2);
}

.sidebar-box, .tweet-form-box, .reply-form-box,
.auth-box, .dm-thread, .invite-box, .user-card-small,
.trending-bar {
  background: var(--bg2);
  border-color: var(--border);
}

.tweet { border-bottom-color: var(--border); }
html[data-theme="dark"] .tweet-new { background: #1e2e14; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .tweet-new { background: #1e2e14; }
}

.tweet-form-box textarea,
.reply-form-box textarea,
.dm-compose textarea,
.dm-to-input,
.search-input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.invite-link-input {
  background: var(--bg3);
  border-color: var(--border2);
  color: var(--text);
}

.flash.success { background: #1a2e0a; border-color: #3a5a18; color: #8bcf50; }
.flash.error   { background: #2e1010; border-color: #5a1818; color: #d46060; }

.user-stats { border-top-color: var(--border); }
.stat-num   { color: var(--text); }

#footer { border-top-color: var(--border); color: var(--text2); }
.footer-links a { color: var(--text2); }

.pagination { border-top-color: var(--border); }

.tweet-thread { background: var(--bg2); border-color: var(--border); }
.tweet-in-thread { border-bottom-color: var(--border); }
.tweet-in-thread.is-main { background: var(--bg3); }
.thread-separator { background: var(--border); }

.dm-conversation { border-bottom-color: var(--border); }
.dm-conversation:hover { background: var(--bg2); }
.dm-received .dm-bubble { background: var(--bg3); border-color: var(--border2); }

.avatar-placeholder { background: #444; color: #aaa; }

h2 { color: var(--text); }
.auth-box h2, .reply-form-box h3, .tweet-form-box h2 { color: var(--text); }
.field label { color: var(--text2); }

.admin-section { background: var(--bg2); border-color: var(--border); }
.admin-table thead { background: var(--bg3); border-color: var(--border); }
.admin-table th, .admin-table td { border-color: var(--border); color: var(--text); }
.admin-table tr:nth-child(even) { background: var(--bg3); }
.admin-table tr:hover { background: var(--bg2); }
.admin-table code { background: var(--bg3); color: var(--text2); }
.admin-nav-link { background: var(--bg3); border-color: var(--border); }
.admin-nav-link:hover { background: var(--border); }
.stat-card { background: var(--bg3); border-color: var(--border); }
.admin-footer { border-top-color: var(--border); }

.btn-unfollow, input[type="submit"].btn-unfollow {
  background: var(--bg3);
  color: var(--text2);
  border-color: var(--border2);
}

.btn-edit { background: var(--bg3); color: var(--text2); border-color: var(--border2); }

.delete-btn { color: var(--border2); }

.twitpic-img { border-color: var(--border); }

html[data-theme="dark"] .pinned-tweet { background: #1e2a14; border-color: #3a5a1a !important; }
html[data-theme="dark"] .thread-line { background: #3a5a1a; }
html[data-theme="dark"] .tweet-in-thread.is-main { background: #1e2a14; }
html[data-theme="dark"] .thread-separator { border-color: #3a5a1a; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .thread-line { background: #3a5a1a; }
  html:not([data-theme="light"]) .tweet-in-thread.is-main { background: #1e2a14; }
}
html[data-theme="dark"] .pin-active { color: #87C540; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .pinned-tweet { background: #1e2a14; border-color: #3a5a1a !important; }
}

/* Dark mode toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #5eab1f;
  font-weight: bold;
  padding: 0;
  font-family: inherit;
  line-height: 22px;
  vertical-align: baseline;
}
.theme-toggle:hover { text-decoration: underline; }

/* ══════════════════
   Mobile (< 560px)
   ══════════════════ */

@media (max-width: 560px) {
  #container {
    width: 100%;
    padding: 10px 12px;
  }

  #header h1 {
    font-size: 32px;
  }

  .nav-user {
    display: none;
  }

  /* Stack sidebar above content */
  #timeline-page,
  #profile-page {
    flex-direction: column;
    gap: 10px;
  }

  .sidebar {
    width: 100%;
  }

  .main-col {
    width: 100%;
  }

  /* Auth pages */
  .auth-box {
    width: 100%;
  }

  /* User grid */
  .user-card-small {
    width: calc(33% - 6px);
  }

  /* Legal pages */
  .legal-page {
    max-width: 100%;
  }

  /* Tweet detail page */
  #tweet-detail-page {
    max-width: 100%;
    padding: 10px 12px;
  }

  /* DM conversation */
  .dm-thread {
    max-height: none;
  }

  .dm-avatar img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
  }

  .dm-avatar .avatar-placeholder {
    width: 24px;
    height: 24px;
    font-size: 11px;
    line-height: 24px;
  }

  .dm-bubble {
    max-width: 75%;
  }
}

/* ── chrrp.eu brand overrides ── */
html[data-brand="chrrp"] {
  --chrrp: #d7522c;
  --chrrp-dark: #b8431f;
  --chrrp-light: #e87454;
  --chrrp-bg: #fdf1ee;
  --chrrp-border: #f2c4b5;
}

/* Light mode */
html[data-brand="chrrp"]:not([data-theme="dark"]) #header,
html[data-brand="chrrp"] #header {
  border-bottom-color: var(--chrrp);
}

html[data-brand="chrrp"] a,
html[data-brand="chrrp"] #nav a,
html[data-brand="chrrp"] .nav-link,
html[data-brand="chrrp"] .tweet-username,
html[data-brand="chrrp"] .tweet-actions a,
html[data-brand="chrrp"] .follow-link,
html[data-brand="chrrp"] .user-link,
html[data-brand="chrrp"] .footer-links a,
html[data-brand="chrrp"] .trending-topic a,
html[data-brand="chrrp"] .auth-switch a,
html[data-brand="chrrp"] .tweet-time a {
  color: var(--chrrp);
}

html[data-brand="chrrp"] a:hover,
html[data-brand="chrrp"] #nav a:hover {
  color: var(--chrrp-dark);
}

html[data-brand="chrrp"] input[type="submit"],
html[data-brand="chrrp"] button.btn-primary,
html[data-brand="chrrp"] .btn-follow {
  background: var(--chrrp);
  background: linear-gradient(to bottom, var(--chrrp-light), var(--chrrp-dark));
  border-color: var(--chrrp-dark);
  color: #fff !important;
}

html[data-brand="chrrp"] input[type="submit"]:hover,
html[data-brand="chrrp"] button.btn-primary:hover,
html[data-brand="chrrp"] .btn-follow:hover {
  background: var(--chrrp-dark);
}

html[data-brand="chrrp"] .flash.success {
  background: #fdf1ee;
  border-color: var(--chrrp-border);
  color: var(--chrrp-dark);
}

html[data-brand="chrrp"] .tweet-reply-indicator,
html[data-brand="chrrp"] .reply-indicator {
  color: var(--chrrp-light);
}

html[data-brand="chrrp"] .tweet-form-box textarea:focus,
html[data-brand="chrrp"] .reply-form-box textarea:focus,
html[data-brand="chrrp"] .field input:focus {
  border-color: var(--chrrp);
  outline-color: var(--chrrp);
}

html[data-brand="chrrp"] .admin-nav-link.admin-nav-active {
  background: var(--chrrp);
  color: #fff;
  border-color: var(--chrrp-dark);
}

.invite-genealogy {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.invite-genealogy li a {
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  text-decoration: none;
  display: inline-block;
}
.invite-genealogy li a:hover { text-decoration: underline; }

html[data-brand="chrrp"] .header-logo {
  height: 38px;
}

html[data-brand="chrrp"] .theme-toggle {
  color: var(--chrrp);
}

html[data-brand="chrrp"] .theme-toggle:hover {
  color: var(--chrrp-dark);
}

html[data-brand="chrrp"] .stat a:hover .stat-num {
  color: var(--chrrp);
}

html[data-brand="chrrp"] .stat a {
  color: inherit;
  text-decoration: none;
}

html[data-brand="chrrp"] .stat a:hover {
  text-decoration: underline;
}

/* Dark mode */
html[data-brand="chrrp"][data-theme="dark"] a,
html[data-brand="chrrp"][data-theme="dark"] #nav a,
html[data-brand="chrrp"][data-theme="dark"] .tweet-username,
html[data-brand="chrrp"][data-theme="dark"] .tweet-actions a,
html[data-brand="chrrp"][data-theme="dark"] .footer-links a,
html[data-brand="chrrp"][data-theme="dark"] .auth-switch a,
html[data-brand="chrrp"][data-theme="dark"] .tweet-time a {
  color: var(--chrrp-light);
}

html[data-brand="chrrp"][data-theme="dark"] input[type="submit"],
html[data-brand="chrrp"][data-theme="dark"] .btn-follow {
  background: var(--chrrp);
  background: linear-gradient(to bottom, var(--chrrp-light), var(--chrrp-dark));
  border-color: var(--chrrp-dark);
}

html[data-brand="chrrp"][data-theme="dark"] .flash.success {
  background: #2e1508;
  border-color: #6b2a10;
  color: var(--chrrp-light);
}

html[data-brand="chrrp"][data-theme="dark"] #header {
  border-bottom-color: var(--chrrp-dark);
}

@media (prefers-color-scheme: dark) {
  html[data-brand="chrrp"]:not([data-theme="light"]) a,
  html[data-brand="chrrp"]:not([data-theme="light"]) #nav a,
  html[data-brand="chrrp"]:not([data-theme="light"]) .tweet-username,
  html[data-brand="chrrp"]:not([data-theme="light"]) .tweet-actions a,
  html[data-brand="chrrp"]:not([data-theme="light"]) .footer-links a,
  html[data-brand="chrrp"]:not([data-theme="light"]) .tweet-time a {
    color: var(--chrrp-light);
  }

  html[data-brand="chrrp"]:not([data-theme="light"]) input[type="submit"],
  html[data-brand="chrrp"]:not([data-theme="light"]) .btn-follow {
    background: linear-gradient(to bottom, var(--chrrp-light), var(--chrrp-dark));
    border-color: var(--chrrp-dark);
  }

  html[data-brand="chrrp"]:not([data-theme="light"]) #header {
    border-bottom-color: var(--chrrp-dark);
  }
}
