/* ===================================================================
   Zetter — Clean white design with black/dark accents
   =================================================================== */

:root {
  color-scheme: light;
  --compose-viewport-height: 100dvh;
  --compose-viewport-offset-top: 0px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #ffffff;
  --bg-hover: #f5f8fa;
  --bg-secondary: #f7f9f9;
  --bg-overlay: rgba(255, 255, 255, 0.85);
  --border: #e1e8ed;
  --text: #0f1419;
  --text-secondary: #5b7083;
  --primary: #0f1419;
  --primary-hover: #272c30;
  --primary-soft: rgba(15, 20, 25, 0.1);
  --danger: #f4212e;
  --like: #f91880;
  --like-bg: rgba(249, 24, 128, 0.1);
  --repost: #00ba7c;
  --repost-bg: rgba(0, 186, 124, 0.1);
  --comment-hover: rgba(15, 20, 25, 0.08);
  --success: #00ba7c;
  --shadow-fab: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-toast: 0 4px 12px rgba(0, 0, 0, 0.16);
  --radius-pill: 9999px;
  --transition: 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 15px;
}

/* ---- Reset ---- */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

p, span, h1, h2, h3, h4, h5, h6, time, label, textarea, input, .post-body, .notif-body, .comment-body {
  -webkit-user-select: text;
  user-select: text;
}

button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
  outline: none;
}

/* Prevent ALL blue selection/hover on touch devices */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: rgba(0,0,0,0) !important; }
  *:focus:not(:focus-visible) { outline: none !important; }
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overscroll-behavior-y: none;
}

body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

input,
textarea {
  font-size: 16px;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

h1, h2, h3, p {
  margin: 0;
}

/* ===================================================================
   App Shell — 3-column layout
   =================================================================== */

.app {
  display: flex;
  justify-content: center;
  max-width: 1280px;
  margin: 0 auto;
}

/* ===================================================================
   Sidebar (left)
   =================================================================== */

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  width: 275px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 12px;
  overflow-y: auto;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  width: 240px;
  height: 100%;
  padding: 12px 0;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-pill);
  transition: background var(--transition);
  margin-bottom: 2px;
}

.logo-link:hover {
  background: var(--primary-soft);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* Sidebar navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.snav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-pill);
  font-size: 20px;
  font-weight: 400;
  transition: background var(--transition);
  position: relative;
  white-space: nowrap;
}

.snav-item:hover {
  background: var(--bg-hover);
}

.snav-item.active {
  font-weight: 700;
}

.snav-item .icon {
  width: 26px;
  height: 26px;
  fill: var(--text);
  flex-shrink: 0;
}

.snav-label {
  line-height: 1;
}

/* Notification badge */
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  position: absolute;
  top: 6px;
  left: 28px;
}

/* Large compose button */
.compose-btn-large {
  width: 100%;
  padding: 16px 0;
  margin-top: 8px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  transition: background var(--transition);
}

.compose-btn-large:hover {
  background: var(--primary-hover);
}

/* Sidebar user */
.sidebar-user {
  margin-top: auto;
  padding: 12px 0;
}

.sidebar-user-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user-info strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================================================================
   Main column
   =================================================================== */

.main {
  flex: 0 1 600px;
  min-width: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Sticky header with blur */
.main-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 16px;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
   display: grid;
   grid-template-columns: 44px minmax(0, 1fr) 44px;
   align-items: center;
   gap: 10px;
}

.header-side {
   display: flex;
   align-items: center;
   min-width: 0;
}

.header-side-left {
   justify-content: flex-start;
}

.header-side-right {
   justify-content: flex-end;
}

.header-logo-link {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
   flex-shrink: 0;
   color: var(--text);
   text-decoration: none;
   justify-self: center;
}

.header-logo {
  border-radius: 6px;
  flex-shrink: 0;
}

.header-brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.header-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.server-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  flex-shrink: 0;
}

.server-badge[data-server-role="A"] {
  background: rgba(15, 20, 25, 0.06);
  border-color: rgba(15, 20, 25, 0.12);
  color: var(--text);
}

.server-badge[data-server-role="Z"] {
  background: rgba(15, 20, 25, 0.03);
}

.header-title {
   font-size: 20px;
   font-weight: 700;
   line-height: 1.3;
}

.header-actions {
   display: flex;
   align-items: center;
   justify-content: flex-end;
   flex-shrink: 0;
}

.header-icon-btn,
.header-profile-btn {
   width: 40px;
   height: 40px;
   border-radius: 999px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   padding: 0;
   border: 0;
   background: transparent;
   color: var(--text);
   transition: background var(--transition), color var(--transition);
}

.header-icon-btn:hover,
.header-profile-btn:hover,
.header-icon-btn.active,
.header-profile-btn.active {
   background: var(--bg-hover);
}

.header-icon-btn .icon,
.header-profile-btn .icon {
   width: 20px;
   height: 20px;
   fill: currentColor;
}

.header-avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
   justify-content: center;
   cursor: pointer;
}

.header-avatar .icon {
   width: 18px;
   height: 18px;
   fill: currentColor;
}

/* ===================================================================
   Auth section
   =================================================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.auth-section {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 16px;
  padding: 24px;
  z-index: 51;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.auth-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: background var(--transition);
}

.auth-close-btn:hover {
  background: var(--bg-hover);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  transition: background var(--transition), color var(--transition);
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.auth-tab:hover {
  background: #e7e7e8;
}

.auth-tab.active {
  background: var(--primary);
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 16px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ===================================================================
   Buttons
   =================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 14px;
}

.btn-xs {
  padding: 6px 14px;
  font-size: 13px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

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

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

/* ===================================================================
   Compose section
   =================================================================== */

.compose-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 58;
}

.compose-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.compose-section {
  position: fixed;
  top: var(--compose-viewport-offset-top);
  left: 0;
  right: 0;
  width: 100%;
  height: var(--compose-viewport-height);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translateY(calc(100% + 24px));
  transition: transform 0.22s ease;
  pointer-events: none;
  overflow: hidden;
  z-index: 59;
}

.compose-section.open {
  transform: translateY(0);
  pointer-events: auto;
}

.compose-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: #d8dde2;
  margin: 10px auto 8px;
}

.compose-sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
}

.compose-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: background var(--transition);
}

.compose-close-btn:hover {
  background: var(--bg-hover);
}

.compose-sheet-title {
  margin: 0;
  flex: 1;
  font-size: 17px;
  font-weight: 800;
}

.compose-sheet-body {
  display: flex;
  gap: 12px;
  width: min(720px, 100%);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  padding: 18px 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  align-items: flex-start;
}

.avatar-sm {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.compose-form {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.compose-form textarea {
  width: 100%;
  min-height: clamp(220px, 36vh, 360px);
  padding: 8px 0 12px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
  resize: none;
  outline: none;
}

.compose-form textarea::placeholder {
  color: var(--text-secondary);
}

.compose-image-preview-wrap {
  position: relative;
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.compose-image-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.compose-image-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 20, 25, 0.72);
  color: #fff;
  font-size: 18px;
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, var(--bg) 82%, rgba(255, 255, 255, 0));
  z-index: 2;
}

.compose-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.compose-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), opacity var(--transition);
}

.compose-tool-btn:hover {
  background: rgba(15, 20, 25, 0.16);
}

.compose-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.compose-tool-btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.char-counter {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===================================================================
   Status / banner buttons
   =================================================================== */

.status-banner {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.status-banner.error {
  background: rgba(244, 33, 46, 0.08);
  color: var(--danger);
}

.status-banner.success {
  background: rgba(0, 186, 124, 0.08);
  color: var(--success);
}

.new-items-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 400;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.new-items-btn:hover {
  background: var(--primary-soft);
}

/* ===================================================================
   Feed / Timeline
   =================================================================== */

.feed-view {
  /* no padding — posts go edge-to-edge */
}

.timeline-server-tabs {
  position: sticky;
  top: 65px;
  z-index: 18;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.timeline-server-tabs-inner {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.timeline-server-tab {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.timeline-server-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.timeline-server-tab.active {
  border-bottom-color: var(--primary);
  color: var(--text);
  font-weight: 800;
}

.timeline-server-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feed-list {
  /* container for post/notification items */
}

.load-more-btn {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  font-size: 15px;
  color: var(--primary);
  transition: background var(--transition);
}

.load-more-btn:hover {
  background: var(--primary-soft);
}

/* ===================================================================
   Repost label (above post-item)
   =================================================================== */

.repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 0 68px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.repost-label .icon {
  width: 14px;
  height: 14px;
  fill: var(--text-secondary);
}

/* ===================================================================
   Post item — flex layout: avatar left + content right
   =================================================================== */

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

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

/* Post content column */
.post-content {
  flex: 1;
  min-width: 0;
}

/* Post meta — name, @handle, time */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.3;
}

.post-meta strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-meta span {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-meta time {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.post-delete-btn,
.comment-delete-btn {
  margin-left: auto;
  padding: 4px 10px;
  min-height: 32px;
  font-size: 12px;
  color: var(--danger);
  border-color: transparent;
  white-space: nowrap;
}

.post-delete-btn:hover,
.comment-delete-btn:hover {
  background: rgba(244, 33, 46, 0.1);
  color: var(--danger);
}

.post-delete-btn:disabled,
.comment-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Post body */
.post-body {
  margin: 4px 0 8px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-media-wrap {
  margin: 8px 0 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.post-media {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

/* ===================================================================
   Action row & action buttons
   =================================================================== */

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 425px;
}

/* Base action button */
.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}

.act-btn .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 0;
  fill: currentColor;
}

.act-btn span {
  font-size: 13px;
}

.act-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Comment button — dark on hover */
.act-comment:hover {
  background: var(--comment-hover);
  color: var(--text);
}

/* Repost button — green on hover and when active */
.act-repost:hover {
  background: var(--repost-bg);
  color: var(--repost);
}

.act-repost.active {
  color: var(--repost);
}

.act-repost.active .icon {
  fill: var(--repost);
}

.act-share:hover {
  background: var(--primary-soft);
  color: var(--text);
}

.act-share {
  padding: 8px;
}

/* Like button — pink on hover and when active */
.act-like:hover {
  background: var(--like-bg);
  color: var(--like);
}

.act-like.active {
  color: var(--like);
}

.act-like.active .icon {
  fill: var(--like);
}

/* ===================================================================
   Comments panel
   =================================================================== */

.comments-panel {
  margin-top: 8px;
  padding: 12px 0 4px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comment-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.comment-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Comment item — flex layout: avatar + body */
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-hover);
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-body p {
  margin: 4px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.comment-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.comment-meta span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===================================================================
   Notifications
   =================================================================== */

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.notif-item:hover {
  background: var(--bg-hover);
}

.notif-item.unread {
  background: rgba(15, 20, 25, 0.03);
  border-left: 3px solid #536471;
}

.notif-item.unread:hover {
  background: rgba(15, 20, 25, 0.06);
}

.notif-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon .icon {
  width: 20px;
  height: 20px;
}

.notif-like .icon {
  fill: var(--like);
  color: var(--like);
}

.notif-repost .icon {
  fill: var(--repost);
  color: var(--repost);
}

.notif-comment .icon {
  fill: var(--primary);
  color: var(--primary);
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-body strong {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.notif-body span {
  font-size: 14px;
  color: var(--text-secondary);
}

.notif-body p {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.notif-excerpt {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

/* ===================================================================
   Right sidebar
   =================================================================== */

.rsidebar {
  width: 350px;
  flex-shrink: 0;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

.rcard {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-secondary);
}

.rcard h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.rcard p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.server-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.server-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.server-summary-label .server-badge {
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

/* ===================================================================
   Bottom navigation (mobile)
   =================================================================== */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(54px + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 50;
  align-items: center;
  justify-content: space-around;
}

.bnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  position: relative;
}

.bnav-item .icon {
  width: 26px;
  height: 26px;
  fill: var(--text-secondary);
  transition: fill var(--transition), opacity var(--transition);
  opacity: 0.82;
}

.bnav-item.active .icon {
  fill: var(--text);
  opacity: 1;
}

.bnav-item .badge {
  top: 6px;
  left: 28px;
}

/* ===================================================================
   FAB — Floating Action Button
   =================================================================== */

.fab {
  display: none;
  position: fixed;
  bottom: calc(24px + var(--safe-area-bottom));
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  z-index: 40;
  transition: background var(--transition), transform var(--transition);
}

.fab:not([hidden]) {
  display: flex;
}

.fab:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.fab .icon {
  width: 24px;
  height: 24px;
  fill: #fff;
}

/* ===================================================================
   Profile
   =================================================================== */

.profile-card {
  position: relative;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.avatar-img {
  object-fit: cover;
  border-radius: 50%;
}

img.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  display: block;
}

.header-avatar-has-img {
  padding: 0;
  overflow: hidden;
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-edit-launch-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.profile-edit-launch-btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.profile-bio {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.profile-handle {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 2px 0;
}

.profile-join {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 8px 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.profile-stats strong {
  color: var(--text);
  font-weight: 700;
}

.profile-edit-card {
  padding: 20px 16px 28px;
  max-width: 640px;
  margin: 0 auto;
}

.profile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-edit-avatar-area {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.profile-edit-avatar-btn {
  position: relative;
  background: transparent;
  padding: 0;
}

.profile-edit-avatar-btn .profile-avatar {
  margin-bottom: 0;
}

.profile-edit-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: 3px solid var(--bg);
}

.profile-edit-avatar-badge .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.profile-edit-meta {
  text-align: center;
  margin-bottom: 18px;
}

.profile-edit-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.profile-edit-textarea {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  resize: none;
  outline: none;
}

.profile-edit-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.profile-edit-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.profile-edit-footer-spread {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bug-report-card {
  padding-top: 24px;
}

.bug-report-card .profile-edit-header {
  align-items: flex-start;
}

.bug-report-intro {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.bug-report-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bug-report-form .field input {
  border-radius: 18px;
}

.bug-report-textarea {
  min-height: 180px;
}

.bug-report-actions {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ===================================================================
   Post author link
   =================================================================== */

.post-author-link {
  cursor: pointer;
}

.post-author-link:hover {
  text-decoration: underline;
}

.post-detail-shell {
  border-bottom: 1px solid var(--border);
}

.post-detail-shell .post-item {
  border-bottom: none;
}

/* ===================================================================
   Empty state
   =================================================================== */

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ===================================================================
   Icons (SVG)
   =================================================================== */

.icon {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===================================================================
   Toast
   =================================================================== */

.toast-root {
  position: fixed;
  bottom: calc(24px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: #0f1419;
  font-size: 15px;
  font-weight: 400;
  text-align: center;
  box-shadow: var(--shadow-toast);
  pointer-events: auto;
  animation: toast-slide-up 0.2s ease-out;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

@keyframes toast-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================================================
   Update banner
   =================================================================== */

.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(10px + var(--safe-area-top)) 16px 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
}

.update-banner .btn-primary,
.update-banner .btn-xs {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

.update-banner .btn-primary:hover,
.update-banner .btn-xs:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* ===================================================================
   [hidden] attribute support
   =================================================================== */

[hidden] {
  display: none !important;
}

/* ===================================================================
   Responsive: Tablet (700px – 1000px)
   =================================================================== */

@media (max-width: 1100px) {
  .rsidebar {
    display: none;
  }
}

@media (max-width: 1000px) {
  .sidebar {
    width: 88px;
    align-items: center;
  }

  .sidebar-inner {
    width: auto;
    align-items: center;
  }

  .snav-label {
    display: none;
  }

  .snav-item {
    justify-content: center;
    padding: 12px;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-pill);
  }

  .compose-btn-large {
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 0;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
  }

  .compose-btn-large::after {
    content: "+";
    font-size: 24px;
    font-weight: 400;
  }

  .sidebar-user-inner {
    flex-direction: column;
    gap: 8px;
  }

  .sidebar-user-info {
    display: none;
  }

  .sidebar-user .ghost-button {
    font-size: 0;
    padding: 10px;
  }

  .main {
    flex: 1;
  }
}

/* ===================================================================
   Responsive: Mobile (<700px)
   =================================================================== */

@media (max-width: 700px) {
  .sidebar {
    display: none;
  }

  .rsidebar {
    display: none;
  }

  .app {
    display: block;
  }

  .main {
    width: 100%;
    border-left: none;
    border-right: none;
  }

  body {
    padding-bottom: calc(54px + var(--safe-area-bottom));
  }

  .bottom-nav {
    display: flex;
  }

  .fab:not([hidden]) {
    display: flex;
    bottom: calc(72px + var(--safe-area-bottom));
    right: 16px;
  }

  .toast-root {
    bottom: calc(70px + var(--safe-area-bottom));
  }

  .main-header {
    padding: 10px 16px;
  }

  .header-title {
    font-size: 18px;
  }

  .header-brand {
    font-size: 17px;
  }

  .header-brand-wrap {
    gap: 6px;
  }

  .server-badge {
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
  }

  .timeline-server-tabs {
    top: 57px;
  }

  .timeline-server-tab {
    padding: 12px 10px;
    font-size: 14px;
  }

  .post-item {
    padding: 12px 16px;
  }

  .notif-item {
    padding: 12px 16px;
  }

  .comments-panel {
    padding-left: 0;
  }

  .repost-label {
    padding-left: 16px;
  }

  .compose-section {
    top: var(--compose-viewport-offset-top);
    height: var(--compose-viewport-height);
  }

  .compose-sheet-body {
    width: 100%;
    padding: 14px 16px max(20px, env(safe-area-inset-bottom));
  }

  .compose-form textarea {
    min-height: clamp(180px, 34vh, 280px);
    font-size: 18px;
  }

  .compose-image-preview {
    max-height: 300px;
  }
}

/* ===================================================================
   Scrollbar styling (thin, subtle)
   =================================================================== */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}
