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

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

a {
  color: #b03333;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #8a2020;
}

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

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

#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;
}

html[data-theme="dark"] .header-logo {
  filter: brightness(3) saturate(1.5);
  mix-blend-mode: screen;
}

.tagline {
  color: var(--text2);
  font-size: 12px;
  margin-top: 4px;
}

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

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

#nav a + a::before,
#nav a + .theme-toggle::before {
  content: " | ";
  font-weight: normal;
  color: var(--text2);
  speak: never;
}

#nav .nav-admin {
  color: #8e44ad;
}

html[data-theme="dark"] #nav .nav-admin,
html[data-theme="dark"] .admin-header h1,
html[data-theme="dark"] .admin-header {
  color: #c792ea;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #nav .nav-admin,
  html:not([data-theme="light"]) .admin-header h1 {
    color: #c792ea;
  }
}

.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: var(--text2);
  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: #2a6a2a;
  border-color: #b3d98a;
}

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

html[data-theme="dark"] .flash.success {
  background: #1a2e1a;
  color: #7ecf7e;
  border-color: #2d5a2d;
}

html[data-theme="dark"] .flash.error {
  background: #2e1a1a;
  color: #ff8080;
  border-color: #5a2d2d;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .flash.success {
    background: #1a2e1a;
    color: #7ecf7e;
    border-color: #2d5a2d;
  }
  html:not([data-theme="light"]) .flash.error {
    background: #2e1a1a;
    color: #ff8080;
    border-color: #5a2d2d;
  }
}

/* ── Content ── */
#main-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: var(--text2);
}

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

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

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

/* ══════════════════
   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: #0077b6;
  background: linear-gradient(to bottom, #0077b6, #e05555);
  color: #fff !important;
  text-decoration: none !important;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #e05555;
}

.big-button:hover {
  background: #e05555;
  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: var(--bg2);
  border: 1px solid var(--border);
  padding: 10px;
  margin-bottom: 10px;
}

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

.avatar-big {
  width: 48px;
  height: 48px;
  background: #0077b6;
  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: #b03333;
}

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

.user-stats {
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.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: #b03333;
}

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

.stat-label {
  font-size: 11px;
  color: var(--text2);
  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: var(--bg3);
  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: var(--text2);
  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: #b03333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invite-section-label.shared-label {
  color: var(--text2);
  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: var(--bg2);
  color: var(--text2);
  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: var(--text2);
  line-height: 1;
}

.invite-mark-btn:hover {
  background: #f0f0ff;
  border-color: #b03333;
  color: #b03333;
}

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

.invite-copied-flash {
  color: #b03333;
  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: var(--text2);
  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: var(--text2);
  padding: 0 4px;
}

.rt-btn:hover {
  color: #b03333;
}

.rt-count-link, .fav-count-link {
  font-size: 11px;
  color: var(--text2);
  text-decoration: none;
  margin-left: 2px;
}
.rt-count-link:hover {
  text-decoration: underline;
  color: #b03333;
}
.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 var(--border, #e5e5e5);
}
.notification-item:last-child { border-bottom: none; }
.notification-new { background: var(--bg-new, #f0f0ff); }
.notification-avatar { flex-shrink: 0; }
.notification-body { font-size: 13px; color: var(--text, #555); line-height: 1.4; }
.notification-icon { font-weight: bold; margin-right: 3px; }
.notification-fav { color: #c33; }
.notification-rt { color: #b03333; }
.notification-follow { color: #e05555; font-size: 15px; }
.notification-dm { color: #3498db; }
.notification-user { font-weight: bold; color: #b03333; text-decoration: none; }
.notification-user:hover { text-decoration: underline; }
.notification-tweet-link {
  display: block;
  margin-top: 3px;
  color: var(--text2);
  font-size: 12px;
  text-decoration: none;
}
.notification-tweet-link:hover { text-decoration: underline; color: #666; }
.notification-time { color: var(--text2, #bbb); font-size: 11px; margin-left: 4px; }
.follow-back-btn {
  background: #0077b6; color: #fff; border: none; padding: 3px 10px;
  border-radius: 10px; font-size: 11px; font-weight: bold; cursor: pointer;
}
.follow-back-btn:hover { background: #e05555; }
.user-list-status {
  font-size: 11px;
  color: var(--text2, #999);
  margin-left: 4px;
  font-style: italic;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

.verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 12px;
  line-height: 1;
}

.avatar-wrap-big .verified-badge {
  font-size: 18px;
  bottom: -3px;
  right: -3px;
}

.retweet-indicator {
  font-size: 11px;
  color: #b03333;
  padding: 0 0 2px 0;
}
.retweet-indicator a {
  color: #b03333;
  text-decoration: none;
}
.retweet-indicator a:hover {
  text-decoration: underline;
}

.rt-active {
  color: #b03333;
  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: #b03333;
  font-weight: bold;
}

.trending-count {
  color: var(--text2);
  font-size: 10px;
}

.trending-bar {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 12px;
}

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

.trending-tag {
  color: #b03333;
  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 {
  gap: 6px;
}

.pagination a {
  color: #b03333;
  text-decoration: none;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.pagination a:hover {
  background: #ff6b6b;
  color: #fff;
  border-color: #b03333;
}

.page-current {
  padding: 2px 7px;
  background: #ff6b6b;
  color: #fff;
  border-radius: 3px;
  font-weight: bold;
}

.page-dots {
  color: var(--text2);
}

.page-info {
  color: var(--text2);
}

/* ── Hashtags & Mentions ── */

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

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

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

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

.tweet-link {
  color: #b03333;
  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 var(--border);
  border-radius: 4px;
}

/* ── Direct Messages ── */

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

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

.dm-conversation:hover {
  background: var(--bg2);
}

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

.dm-info {
  flex: 1;
}

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

.dm-preview {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

.dm-time {
  font-size: 10px;
  color: var(--text2);
}

.dm-thread {
  margin: 10px 0;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
}

.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: #ff6b6b;
  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: var(--text2);
}

/* ── 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: #0077b6;
  background: linear-gradient(to bottom, #0077b6, #e05555);
  color: #fff;
  border-color: #e05555;
}

.btn-follow:hover {
  background: #e05555;
}

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

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

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

/* ── Tweet Form ── */

.tweet-form-box {
  border: 1px solid var(--border);
  background: var(--bg2);
  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 #8c8c8c;
  font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
  font-size: 13px;
  resize: none;
}

.tweet-form-box textarea:focus {
  outline: 2px solid #0077b6;
  outline-offset: -1px;
  border-color: #0077b6;
}

.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: #0077b6;
  background: linear-gradient(to bottom, #0077b6, #e05555);
  color: #fff;
  border: 1px solid #e05555;
  padding: 3px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.submit-btn:hover {
  background: #e05555;
}

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

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

.tweet-new {
  background: var(--bg-new, #f0f0ff);
  transition: background 1s ease;
}

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

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

.avatar-placeholder {
  width: 32px;
  height: 32px;
  background: #ddd;
  color: var(--text2);
  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: #b03333;
  font-size: 12px;
}

.tweet-text {
  color: #333;
  word-wrap: break-word;
  white-space: pre-line;
}

.tweet-time {
  display: inline;
  font-size: 10px;
  color: var(--text2);
  margin-left: 4px;
}

.tweet-time a {
  color: var(--text2);
  text-decoration: none;
}

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

.tweet-source {
  display: inline;
  font-size: 10px;
  color: var(--text2);
  margin-left: 4px;
  font-style: italic;
}

.tweet-reply-indicator {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin: 2px 0;
}

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

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

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

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

.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 .collapsible-content {
  display: flex;
  gap: 8px;
  flex: 1;
}
.pinned-tweet {
  background: #f0f0ff;
  border-bottom: 1px solid #c4c0fc !important;
  border-left: 3px solid #0077b6;
  padding-left: 8px;
  color: #222;
}
.pinned-tweet .tweet-text,
.pinned-tweet .tweet-author,
.pinned-tweet .tweet-time,
.pinned-tweet .tweet-time a {
  color: #222;
}

.pinned-label {
  display: block;
  font-size: 10px;
  color: #0077b6;
  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: var(--text2);
  padding: 0 2px;
}

.pin-btn:hover { color: #0077b6; }
.pin-active { color: #0077b6; }

/* ── Empty State ── */

.empty-state {
  padding: 15px;
  text-align: center;
  color: var(--text2);
  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: var(--bg2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

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

.tweet-in-thread.is-main {
  background: #f0f0ff;
  border-left: 3px solid #0077b6;
}

.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: #c4c0fc;
  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 var(--border);
  background: var(--bg2);
  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: 2px solid #0077b6;
  outline-offset: -1px;
  border-color: #0077b6;
}

.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: var(--bg2);
  border: 1px solid var(--border);
  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: var(--bg2);
  border: 1px solid var(--border);
  padding: 20px;
}

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

.auth-subtitle {
  font-size: 11px;
  color: var(--text2);
  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 #8c8c8c;
  font-size: 13px;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="password"]:focus {
  outline: 2px solid #0077b6;
  outline-offset: 1px;
  border-color: #0077b6;
}

.hint {
  display: block;
  font-size: 10px;
  color: var(--text2);
  margin-top: 1px;
}

.auth-alt {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text2);
  text-align: center;
}

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

.page-subtitle {
  color: var(--text2);
  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;
}

.a11y-list {
  list-style: none;
  margin: 6px 0 16px;
  padding: 0;
}

.a11y-list li {
  padding: 6px 0 6px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.a11y-list li::before {
  content: "✓ ";
  color: #2a7a2a;
  font-weight: bold;
}

.a11y-id {
  font-size: 10px;
  color: var(--text2);
  font-family: monospace;
  margin-right: 4px;
}

.a11y-date {
  color: var(--text2);
  font-size: 11px;
  margin-bottom: 12px;
}

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

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

/* Admin pages break out of the narrow #container */
#container:has(#admin-page) {
  width: 95%;
  max-width: 1400px;
}

#admin-page {
  width: 100%;
  padding: 20px 0;
}

.admin-header {
  padding: 10px 0 20px 0;
  border-bottom: 3px solid #8e44ad;
  margin-bottom: 20px;
}

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

.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: var(--bg3);
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
}

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

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

.admin-section {
  overflow-x: auto;
}

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

.admin-table thead {
  background: var(--bg3);
  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: #0077b6;
  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: var(--bg2);
  border-left: 3px solid #0077b6;
  border-radius: 2px;
}

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

.invite-count {
  font-size: 11px;
  color: var(--text2);
  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: var(--text2);
  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: var(--bg3);
  border: 1px solid #ddd;
  border-radius: 3px;
  color: #b03333;
  font-weight: bold;
  font-size: 12px;
  text-decoration: none;
}

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

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

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

.admin-action-btn {
  background: #ff6b6b;
  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: #ff6b6b;
  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: var(--text2);
}

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

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #1c1618;
    --bg2: #261e21;
    --bg3: #30272a;
    --text: #e8e0e2;
    --text2: #b5a8ac;
    --border: #453a3d;
    --border2: #554a4d;
    --bg-new: #1a1a3a;
  }
}

html[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg2: #242424;
  --bg3: #2e2e2e;
  --text: #e0e0e0;
  --text2: #b0b0b0;
  --border: #404040;
  --border2: #505050;
  --bg-new: #1a1a3a;
}

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

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

html[data-theme="dark"] a { color: #ff8080; }
html[data-theme="dark"] a:hover { color: #ffaaaa; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) a { color: #ff8080; }
  html:not([data-theme="light"]) a:hover { color: #ffaaaa; }
}

/* 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: #0077b6;
}

.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); }
@media (prefers-color-scheme: dark) {
}

.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: var(--text2); }

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: #0e0e3a; border-color: #1a1a6a !important; color: #e0e0e0; }
html[data-theme="dark"] .pinned-tweet .tweet-text,
html[data-theme="dark"] .pinned-tweet .tweet-author,
html[data-theme="dark"] .pinned-tweet .tweet-time,
html[data-theme="dark"] .pinned-tweet .tweet-time a { color: #e0e0e0; }
html[data-theme="dark"] .thread-line { background: #1a1a6a; }
html[data-theme="dark"] .tweet-in-thread.is-main { background: #0e0e3a; }
html[data-theme="dark"] .thread-separator { border-color: #1a1a6a; }
html[data-theme="dark"] .tweet-thread { background: var(--bg2); border-color: var(--border); }
html[data-theme="dark"] .reply-form-box { background: var(--bg2); border-color: var(--border); }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .thread-line { background: #1a1a6a; }
  html:not([data-theme="light"]) .tweet-in-thread.is-main { background: #0e0e3a; }
  html:not([data-theme="light"]) .tweet-thread { background: var(--bg2); border-color: var(--border); }
  html:not([data-theme="light"]) .reply-form-box { background: var(--bg2); border-color: var(--border); }
  html:not([data-theme="light"]) .thread-separator { border-color: #1a1a6a; }
  html:not([data-theme="light"]) .pinned-tweet { background: #0e0e3a; border-color: #1a1a6a !important; }
}
html[data-theme="dark"] .pin-active { color: #0077b6; }

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

/* Dark mode toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #b03333;
  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) {
  body {
    font-size: 15px;
  }

  #container {
    width: 100%;
    padding: 10px 12px;
  }

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

  #nav {
    font-size: 14px;
    line-height: 2;
  }

  .nav-user {
    display: none;
  }

  .tweet-text {
    font-size: 15px;
    line-height: 1.45;
  }

  .tweet-author {
    font-size: 14px;
  }

  .tweet-time, .tweet-time a {
    font-size: 12px;
  }

  .tweet-actions {
    font-size: 14px;
  }

  .tweet-actions .rt-btn,
  .tweet-actions .fav-btn {
    font-size: 15px;
  }

  .tagline {
    font-size: 13px;
  }

  h2 {
    font-size: 18px;
  }

  .hero-box p, .hero-box h2 {
    font-size: 15px;
  }

  textarea#tweet-input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  .search-input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .notification-body {
    font-size: 14px;
  }

  .dm-bubble {
    font-size: 14px;
  }

  .invite-link-input {
    font-size: 12px;
  }

  /* 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: #b03333;
  --chrrp-dark: #8a2020;
  --chrrp-light: #ff8e8e;
  --chrrp-pink: #ff6b6b;
  --chrrp-bg: #fff0f0;
  --chrrp-border: #fcc4c4;
}

/* 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: #0077b6;
  background: linear-gradient(to bottom, #0077b6, #b03333);
  border-color: #b03333;
  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: #b03333;
}

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"] .mention,
html[data-brand="chrrp"] .hashtag,
html[data-brand="chrrp"] .tweet-author,
html[data-brand="chrrp"] .tweet-link,
html[data-brand="chrrp"] .notification-user,
html[data-brand="chrrp"] .notification-rt,
html[data-brand="chrrp"] .notification-follow,
html[data-brand="chrrp"] .rt-active,
html[data-brand="chrrp"] .fav-active,
html[data-brand="chrrp"] .retweet-indicator,
html[data-brand="chrrp"] .retweet-indicator a,
html[data-brand="chrrp"] .invite-section-label,
html[data-brand="chrrp"] .skip-link { color: var(--chrrp); }

html[data-brand="chrrp"] .follow-back-btn,
html[data-brand="chrrp"] .submit-btn {
  background: #0077b6;
  background: linear-gradient(to bottom, #0077b6, #e05555);
  border-color: #e05555;
  color: #fff;
}
html[data-brand="chrrp"] .follow-back-btn:hover,
html[data-brand="chrrp"] .submit-btn:hover { background: #e05555; }

html[data-brand="chrrp"] .skip-link { background: var(--chrrp); }

html[data-brand="chrrp"] .tweet-new { background: var(--chrrp-bg); }
html[data-brand="chrrp"] .notification-new { background: var(--chrrp-bg); }
html[data-brand="chrrp"] .tweet-pinned { border-color: var(--chrrp); background: var(--chrrp-bg); }

html[data-brand="chrrp"] .nav-badge { background: var(--chrrp-pink); }
html[data-brand="chrrp"] .fav-active { color: var(--chrrp-pink) !important; }
html[data-brand="chrrp"] .notification-fav { color: var(--chrrp-pink); }
html[data-brand="chrrp"] #header { border-bottom-color: var(--chrrp-pink); }

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

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

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 */
/* Dark mode: WCAG AA compliant colors (4.5:1+ contrast on #1a1a1a) */
html[data-brand="chrrp"][data-theme="dark"] {
  --chrrp: #ffa0a0;
  --chrrp-dark: #e08080;
  --chrrp-light: #ffbaba;
  --chrrp-pink: #7b9fff;
  --chrrp-bg: #2a1a1a;
  --chrrp-border: #5a3a3a;
}

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,
html[data-brand="chrrp"][data-theme="dark"] .mention,
html[data-brand="chrrp"][data-theme="dark"] .hashtag,
html[data-brand="chrrp"][data-theme="dark"] .tweet-author,
html[data-brand="chrrp"][data-theme="dark"] .tweet-link,
html[data-brand="chrrp"][data-theme="dark"] .notification-user,
html[data-brand="chrrp"][data-theme="dark"] .trending-tag,
html[data-brand="chrrp"][data-theme="dark"] .invite-section-label,
html[data-brand="chrrp"][data-theme="dark"] .rt-active,
html[data-brand="chrrp"][data-theme="dark"] .retweet-indicator,
html[data-brand="chrrp"][data-theme="dark"] .retweet-indicator a,
html[data-brand="chrrp"][data-theme="dark"] .notification-rt,
html[data-brand="chrrp"][data-theme="dark"] .notification-follow {
  color: var(--chrrp);
}

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

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

html[data-brand="chrrp"][data-theme="dark"] #header { border-bottom-color: var(--chrrp-pink); }
html[data-brand="chrrp"][data-theme="dark"] .fav-active { color: var(--chrrp-pink) !important; }
html[data-brand="chrrp"][data-theme="dark"] .notification-fav { color: var(--chrrp-pink); }
html[data-brand="chrrp"][data-theme="dark"] .nav-badge { background: var(--chrrp-pink); color: #1a1a1a; }
html[data-brand="chrrp"][data-theme="dark"] .tweet-new { background: var(--chrrp-bg); }
html[data-brand="chrrp"][data-theme="dark"] .notification-new { background: var(--chrrp-bg); }
html[data-brand="chrrp"][data-theme="dark"] .tweet-pinned,
html[data-brand="chrrp"][data-theme="dark"] .tweet-pinned * { border-color: var(--chrrp-border); }
html[data-brand="chrrp"][data-theme="dark"] .skip-link { background: var(--chrrp); color: #1a1a1a; }
html[data-brand="chrrp"][data-theme="dark"] .theme-toggle { color: var(--chrrp); }

/* Also override base hardcoded #ff6b6b in dark mode */
html[data-theme="dark"] .mention,
html[data-theme="dark"] .hashtag,
html[data-theme="dark"] .tweet-author,
html[data-theme="dark"] .tweet-link,
html[data-theme="dark"] .notification-user { color: #ffa0a0; }

html[data-theme="dark"] .notification-rt,
html[data-theme="dark"] .notification-follow,
html[data-theme="dark"] .rt-active,
html[data-theme="dark"] .retweet-indicator,
html[data-theme="dark"] .retweet-indicator a,
html[data-theme="dark"] .trending-tag,
html[data-theme="dark"] .invite-section-label { color: #ffa0a0; }

html[data-theme="dark"] .fav-active { color: #7b9fff !important; }
html[data-theme="dark"] .notification-fav { color: #7b9fff; }

@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"]) {
    --chrrp: #ffa0a0;
    --chrrp-dark: #e08080;
    --chrrp-light: #ffbaba;
    --chrrp-pink: #7b9fff;
    --chrrp-bg: #2a1a1a;
    --chrrp-border: #5a3a3a;
  }

  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);
    color: #1a1a1a !important;
  }

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

  html[data-brand="chrrp"]:not([data-theme="light"]) .tweet-new,
  html[data-brand="chrrp"]:not([data-theme="light"]) .notification-new { background: var(--chrrp-bg); }
}

/* ── chirrido.eu brand overrides ── */
html[data-brand="chirrido"] {
  --chirrido: #4dbcc3;
  --chirrido-dark: #3a9ea4;
  --chirrido-light: #7dd3d8;
  --chirrido-bg: #eef9fa;
  --chirrido-border: #b5e4e7;
}

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

html[data-brand="chirrido"] a,
html[data-brand="chirrido"] #nav a,
html[data-brand="chirrido"] .tweet-author,
html[data-brand="chirrido"] .tweet-actions a,
html[data-brand="chirrido"] .footer-links a,
html[data-brand="chirrido"] .tweet-time a,
html[data-brand="chirrido"] .mention,
html[data-brand="chirrido"] .hashtag,
html[data-brand="chirrido"] .notification-user,
html[data-brand="chirrido"] .notification-rt,
html[data-brand="chirrido"] .notification-follow,
html[data-brand="chirrido"] .rt-active,
html[data-brand="chirrido"] .fav-active,
html[data-brand="chirrido"] .retweet-indicator,
html[data-brand="chirrido"] .retweet-indicator a,
html[data-brand="chirrido"] .invite-section-label,
html[data-brand="chirrido"] .trending-tag { color: var(--chirrido); }

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

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

html[data-brand="chirrido"] .flash.success { background: var(--chirrido-bg); border-color: var(--chirrido-border); color: var(--chirrido-dark); }
html[data-brand="chirrido"] .tweet-new { background: var(--chirrido-bg); }
html[data-brand="chirrido"] .notification-new { background: var(--chirrido-bg); }
html[data-brand="chirrido"] .tweet-pinned { border-color: var(--chirrido); background: var(--chirrido-bg); }
html[data-brand="chirrido"] .nav-badge { background: var(--chirrido); }
html[data-brand="chirrido"] .skip-link { background: var(--chirrido); }
html[data-brand="chirrido"] .theme-toggle { color: var(--chirrido); }
html[data-brand="chirrido"] .theme-toggle:hover { color: var(--chirrido-dark); }
html[data-brand="chirrido"] .stat a:hover .stat-num { color: var(--chirrido); }

html[data-brand="chirrido"][data-theme="dark"] a,
html[data-brand="chirrido"][data-theme="dark"] #nav a,
html[data-brand="chirrido"][data-theme="dark"] .tweet-author,
html[data-brand="chirrido"][data-theme="dark"] .tweet-actions a,
html[data-brand="chirrido"][data-theme="dark"] .footer-links a,
html[data-brand="chirrido"][data-theme="dark"] .tweet-time a { color: var(--chirrido-light); }

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

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

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

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

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

/* ── Autocomplete ── */
.autocomplete-dropdown {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #ccc);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  color: var(--text, #333);
}

/* ── Accessibility ── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #0077b6;
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

.rt-btn:focus,
.fav-btn:focus,
.delete-btn:focus,
.pin-btn:focus,
.theme-toggle:focus,
.follow-back-btn:focus,
.submit-btn:focus,
input[type="submit"]:focus,
button[type="submit"]:focus,
.btn-follow:focus,
.btn-unfollow:focus {
  outline: 2px solid #0077b6;
  outline-offset: 2px;
}

.reply-link:focus,
.rt-count-link:focus,
.tweet-time a:focus,
.tweet-author:focus,
#nav a:focus {
  outline: 2px solid #0077b6;
  outline-offset: 2px;
}

html[data-theme="dark"] :focus-visible,
html[data-theme="dark"] a:focus,
html[data-theme="dark"] button:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus {
  outline-color: #4db8ff;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) :focus-visible,
  html:not([data-theme="light"]) a:focus,
  html:not([data-theme="light"]) button:focus,
  html:not([data-theme="light"]) input:focus,
  html:not([data-theme="light"]) textarea:focus {
    outline-color: #4db8ff;
  }
}

/* ── RCS Beta Page form ── */
.legal-page .form-group label {
  display: block;
  font-size: 12px;
  color: var(--text2, #666);
  margin-bottom: 4px;
}
.legal-page .form-group input[type="tel"],
.legal-page .form-group input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg, #fff);
  color: var(--text, #333);
}
