:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #000;
  --panel-alt: #16181c;
  --border: #2f3336;
  --text: #e7e9ea;
  --muted: #8b98a5;
  --accent: #1d9bf0;
  --danger: #f4212e;
  font-family: 'Inter', 'TwitterChirp', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s, opacity 0.2s;
}

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

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

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

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  opacity: 0.9;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-label {
  margin: 0;
  font-weight: 700;
}

.brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(140deg, #2cfcf3, #a678ff);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-actions button,
.sidebar-actions label {
  width: 100%;
}

.profile-tabs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.profile-tab {
  padding: 12px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  text-align: left;
}

.profile-tab.active {
  border-color: var(--accent);
  background: rgba(29, 155, 240, 0.15);
}

.sidebar-footer {
  font-size: 12px;
  color: var(--muted);
}

.workspace {
  padding: 24px 48px;
  display: flex;
  justify-content: center;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage {
  max-width: 640px;
  width: 100%;
}

.preview {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.profile-shell {
  background: var(--panel);
}

.banner {
  height: 200px;
  background: linear-gradient(130deg, #111827, #2a0f39);
  position: relative;
  overflow: hidden;
}

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

.banner-edit-hint,
.avatar-edit-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s;
}

.banner:hover .banner-edit-hint,
.avatar:hover .avatar-edit-hint {
  opacity: 1;
}

.avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  background: #15202b;
  overflow: hidden;
  position: relative;
  margin-top: -70px;
  margin-left: 16px;
}

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

.profile-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.post-count {
  color: var(--muted);
  font-size: 14px;
}

.edit-btn {
  padding: 6px 18px;
  border-radius: 999px;
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.identity .display-name {
  font-size: 22px;
  font-weight: 700;
}

.identity .handle {
  color: var(--muted);
}

.bio {
  margin: 0;
  white-space: pre-wrap;
}

.meta-row,
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stats strong {
  color: var(--text);
}

.editable {
  cursor: text;
}

.editable:focus {
  outline: 2px solid var(--accent);
  border-radius: 4px;
}

.editable[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.numeric {
  min-width: 32px;
  display: inline-block;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}

.tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 12px 0;
  position: relative;
  font-weight: 600;
}

.tabs button.active,
.tabs button:hover {
  color: var(--text);
}

.tabs button.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
}

.stage .thread,
.composer {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  padding: 16px;
  display: flex;
  gap: 12px;
}

.composer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #15202b;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #273340;
  color: #fff;
  font-weight: 700;
}

.composer-avatar .avatar-fallback {
  font-size: 16px;
}

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

.composer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer-input {
  min-height: 120px;
  white-space: pre-wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.composer-input:focus {
  outline: none;
}

.composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.composer-icons {
  display: flex;
  gap: 8px;
}

.composer-icons button {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 999px;
}

.composer-icons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--accent);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.icon.image {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M21 19V5H3v14h18zm0-16a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5a2 2 0 012-2h18zM8 7a2 2 0 110 4 2 2 0 010-4zm0 6l2.86 3.43 2-2.58L17 19H7l1-6z\"/></svg>');
}

.icon.gif {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 7h5v2H6v6h3v2H4zm7 0h2v6h3v2h-5zm7 0h5v2h-3v2h3v2h-3v4h-2z\"/></svg>');
}

.icon.poll {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 5h2v14H7zm4 4h2v10h-2zm4-4h2v14h-2z\"/></svg>');
}

.icon.emoji {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2a10 10 0 1010 10A10 10 0 0012 2zm-3.5 7.5A1.5 1.5 0 119 13a1.5 1.5 0 01-.5-3.5zm7 7.9a5 5 0 01-7 0l1.4-1.4a3 3 0 004.2 0zm.5-6.4A1.5 1.5 0 1116 13a1.5 1.5 0 01-.5-3.5z\"/></svg>');
}

.icon.schedule {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 8h1v5h4v1h-5zm7-4v14H5V4h14m0-2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V4a2 2 0 00-2-2zm-5 2v2H10V4z\"/></svg>');
}

.icon.location {
  mask-image: url('data:image/svg+xml;utf8,<svg fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2a7 7 0 00-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 00-7-7zm0 9.5a2.5 2.5 0 112.5-2.5 2.5 2.5 0 01-2.5 2.5z\"/></svg>');
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
}

.composer-media {
  width: 100%;
  margin-top: 4px;
  display: block;
}

.composer-media .media-wrapper {
  position: relative;
  width: 100%;
}

.composer-media img,
.composer-media video,
.media-preview {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #000;
}

.composer-media video {
  outline: none;
}

.remove-media {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.remove-media:hover {
  background: rgba(0, 0, 0, 0.9);
}

.thread {
  display: flex;
  flex-direction: column;
}

.post {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
}

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

.post.dragging {
  opacity: 0.4;
}

.post.drag-target {
  outline: 1px dashed var(--accent);
  outline-offset: -6px;
}

.avatar-sm {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #15202b;
  flex-shrink: 0;
}

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

.post-header {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 14px;
}

.post-header .handle {
  color: var(--muted);
}

.post-text {
  margin: 6px 0 8px;
  white-space: pre-wrap;
}

.post-media-slot {
  width: 100%;
  margin-top: 8px;
}


.post img.media,
.post video.media {
  width: 100%;
  border-radius: 16px;
  margin-top: 8px;
  background: #000;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tweet-btn {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.tweet-btn:hover {
  background: rgba(29, 155, 240, 0.1);
}

.post-actions {
  display: flex;
  gap: 32px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.post.empty-state {
  justify-content: center;
  color: var(--muted);
}

.delete-post {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .workspace {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 16px;
  }
  .tabs {
    gap: 16px;
  }
  .composer-actions input[type='text'] {
    width: 100%;
  }
}
.verified-tick {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
