/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* === Vars === */
:root{
  --topbar-h: 70px;
  --topbar-offset: 70px;
  --gutter: 40px;
  --sidebar-w: 220px;
  --right-rail-w: 300px;
  --feed-max: 720px;

  --bg: #f8f9fa;
  --text: #1a1a1a;
  --muted: #6c757d;
  --muted-2: #868e96;
  --line: #e9ecef;
  --line-2: #dee2e6;
  --surface: #ffffff;
  --card: #ffffff;
  --input: #f1f3f5;
  --brand: #111111;
  --brand-2: #0d0d0d;
  --focus: #6366f1;
  --focus-ring: rgba(99,102,241,.20);
  --card-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
}

body.dark-theme {
  --bg: #0b1220;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #a5b4c5;
  --line: #1f2937;
  --line-2: #243447;
  --surface: #0f172a;
  --card: #111827;
  --input: #1f2937;
  --brand: #e5e7eb;
  --brand-2: #cbd5e1;
  --focus: #a5b4fc;
  --focus-ring: rgba(99,102,241,.35);
}

/* === Reset-ish === */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  line-height: 1.35;
}

body.dark-theme {
  background: radial-gradient(circle at top left, rgba(99,102,241,0.08), transparent 30%), var(--bg);
}

.hidden { display: none !important; }

/* === Top Bar Styling === */
#topbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  min-height: var(--topbar-h);
  background-color: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px var(--gutter);
  z-index: 1000;
}

#topbar::after {
  content: "";
  flex-basis: 100%;
  height: 0;
}

#sidebarToggle { display: none; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.topbar-center {
  flex: 1 1 360px;
  display: flex;
  justify-content: center;
  min-width: 0;
}

#searchbar {
  display: block;
  width: 100%;
  max-width: 450px;
  height: 40px;
  padding: 0 20px;
  margin: 0 auto;
  background-color: var(--input);
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 0.95rem;
  color: var(--text);
  resize: none;
  line-height: 40px;
  transition: all 0.2s ease-in-out;
}

#searchbar:focus {
  outline: none;
  border-color: #a5b4fc;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#searchbar::placeholder { color: var(--muted-2); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.sidebar-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  outline: none;
  border-color: #ced4da;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.sidebar-toggle-bar {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: #111;
  border-radius: 999px;
}

.sidebar-toggle-bar::before,
.sidebar-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #111;
  border-radius: 999px;
}

.sidebar-toggle-bar::before { top: -6px; }
.sidebar-toggle-bar::after { top: 6px; }

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

.topbar-link,
.signout-button {
  border: none;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}


.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding-inline: 20px;
}

.topbar-link:hover,
.signout-button:hover { background: #000; transform: translateY(-1px); }

/* === Authentication Overlay === */
.auth-overlay {
  position: fixed;
  inset: 0;
  overflow-y: auto; /* <-- ENABLE SCROLLING */
  -webkit-overflow-scrolling: touch; /* <-- SAFARI SMOOTH SCROLL */
  height: 100dvh; /* <-- dynamic viewport height for Safari */
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.85));
  padding: 24px;
  z-index: 2000;
  backdrop-filter: blur(2px);

  display: flex;
  align-items: flex-start; /* <-- allow content to extend downward */
  justify-content: center;
}


.auth-card {
  background: #ffffff;
  border-radius: 28px;
  width: min(100%, 420px);
  padding: 40px 36px;
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 20px;
}

.auth-header h1 { margin: 0; font-size: 2rem; }
.auth-header p { margin: 8px 0 0; color: var(--muted); line-height: 1.4; }

/* Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f3f5;
  padding: 6px;
  border-radius: 16px;
}

.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #495057;
}
.auth-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.auth-tab.active {
  background: var(--brand-2);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(13, 13, 13, 0.25);
}

/* Forms */
.auth-form {
  display: none;
  grid-auto-rows: min-content;
  gap: 14px;
}
.auth-form.active { display: grid; }

.auth-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.auth-form input,
.auth-form select {
  width: 100%;
  height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color .15s ease;
  background: #fff;
}

.auth-form input:focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Autofill normalization */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #111 !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  transition: background-color 9999s ease-out 0s;
}

.birthday-select-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

.birthday-select-group select {
  appearance: none;
  background-color: #ffffff;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"%3E%3Cpath fill="none" stroke="%23666" stroke-width="1.5" d="M1 1l5 5 5-5"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  height: 52px;
  padding: 14px 16px;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  background: var(--brand);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, background .15s ease;
  margin-top: 6px;
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(17, 17, 17, 0.18);
  background: #000;
}
.auth-submit:disabled { opacity: 0.6; cursor: progress; }

.auth-error {
  min-height: 20px;
  color: #e03131;
  font-size: 0.9rem;
  font-weight: 500;
}

/* === App Layout === */

/* push below topbar */
#appContent {
  padding-top: calc(var(--topbar-offset) + 32px);
  padding-bottom: 40px;
}

#appShell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, var(--feed-max)) var(--right-rail-w);
  justify-content: center;
  gap: var(--gutter);
  max-width: calc(var(--sidebar-w) + var(--feed-max) + var(--right-rail-w) + (var(--gutter) * 2));
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* left sidebar */
#Sidebar {
  position: sticky;
  top: calc(var(--topbar-offset) + 24px);
  align-self: start;
  width: 100%;
  background-color: var(--surface);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 15px;
}

.sidebarButton {
  width: 100%;
  padding: 12px 20px;
  margin: 5px 0;
  background-color: transparent;
  color: #495057;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease-in-out;
  display: block;
  text-decoration: none;
}
.sidebarButton:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

/* main feed */
#feedContainer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#feed {
  width: 100%;
  max-width: var(--feed-max);
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#suggestions {
  position: sticky;
  top: calc(var(--topbar-offset) + 24px);
  align-self: start;
  width: 100%;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1050;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1200px) {
  #feed {
    max-height: calc(100vh - var(--topbar-offset) - 72px);
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
  }

  #feed::-webkit-scrollbar { width: 10px; }
  #feed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 999px;
  }

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

/* tablet: stack rails and let body scroll */
@media (max-width: 1199.98px) {
  :root {
    --gutter: 32px;
  }
  #appShell {
    grid-template-columns: minmax(0, var(--feed-max));
  }

  #Sidebar,
  #suggestions {
    position: static;
    width: 100%;
  }

  #Sidebar {
    margin-bottom: 24px;
  }

  #suggestions {
    margin-top: 24px;
  }

  #feed {
    padding: 0;
  }
}

@media (max-width: 1024px) {
  :root {
    --gutter: 24px;
  }

  #title {
    font-size: 1.6rem;
  }
}

@media (max-width: 900px) {
  :root {
    --gutter: 18px;
  }

  #sidebarToggle {
    display: inline-flex;
  }

  #topbar {
    gap: 12px;
    padding: 12px var(--gutter);
  }

  .topbar-left {
    flex: 1 1 auto;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
    gap: 8px;
  }

  .topbar-center {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
  }

  #searchbar {
    max-width: none;
  }

  #appContent {
    padding-top: calc(var(--topbar-offset) + 24px);
  }

  #appShell {
    padding: 0 var(--gutter);
  }

  #Sidebar {
    position: fixed;
    top: var(--topbar-offset);
    bottom: 0;
    left: 0;
    width: min(320px, 80vw);
    max-width: 320px;
    border-radius: 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    padding: 28px 24px;
    overflow-y: auto;
    max-height: calc(100vh - var(--topbar-offset));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1100;
  }

  body.sidebar-open #Sidebar {
    transform: translateX(0);
  }

  #suggestions {
    position: static;
    margin-top: 24px;
  }

  #feed {
    padding: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 14px;
  }

  #topbar {
    padding: 10px var(--gutter);
  }

  #title {
    font-size: 1.4rem;
  }

  #searchbar {
    height: 44px;
    line-height: 44px;
    padding-inline: 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-link,
  .signout-button {
    padding-inline: 16px;
  }

  #Sidebar {
    width: min(320px, 88vw);
    padding: 24px 20px;
  }
}

/* feed */
.feed-empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 16px;
}

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

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.9), rgba(17, 17, 17, 0.6));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #f8f9fa;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  flex-shrink: 0;
}

.post-avatar.has-photo {
  color: transparent;
}

.post-username {
  font-weight: 600;
  font-size: 1rem;
}

.post-media {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  background: var(--input);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.post-media video,
.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-text {
  background: var(--input);
  padding: 24px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  min-height: 0;
}

.post-caption {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-caption.post-caption-empty {
  color: var(--muted);
}

.post-caption.hidden {
  display: none;
}

.post-actions {
  display: flex;
  gap: 12px;
}

.post-action-button,
.post-follow-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.post-action-button.post-action-secondary {
  background: transparent;
  color: var(--muted);
}

.post-action-button.post-action-danger {
  background: #fee2e2;
  border-color: #fecdd3;
  color: #991b1b;
}

.post-action-button:hover,
.post-action-button:focus-visible,
.post-follow-button:hover,
.post-follow-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  outline: none;
}

.post-action-button[disabled],
.post-follow-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.post-follow-button.post-following {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.post-follow-button.post-follow-self {
  background: var(--input);
  color: var(--muted);
  border-color: var(--input);
}

.post-counts {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.post-comments {
  display: grid;
  gap: 12px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.comment-item {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.comment-empty {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

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

.comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-action {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.comment-action.comment-action-danger {
  color: #b91c1c;
  border-color: #fecdd3;
  background: #fff1f2;
}

/* Dark theme overrides */
body.dark-theme #topbar,
body.dark-theme #Sidebar,
body.dark-theme .feed-empty,
body.dark-theme .post,
body.dark-theme .settings-card {
  box-shadow: none;
}

body.dark-theme #searchbar {
  border-color: var(--line);
}

body.dark-theme .post-action-button.post-action-danger {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecdd3;
}

body.dark-theme .comment-action.comment-action-danger {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecdd3;
}

.comment-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.comment-input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.comment-submit {
  border: none;
  background: var(--brand);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.comment-submit:hover,
.comment-submit:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  outline: none;
}

.comment-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.post-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 20, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2100;
}

.post-modal {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.post-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 12px;
  gap: 16px;
}

.post-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--input);
  padding: 6px;
  border-radius: 999px;
}

.post-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 10px 18px;
  min-width: 80px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.post-tab.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.25);
}

.post-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.post-close {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.post-close:hover,
.post-close:focus-visible {
  color: #000000;
}

.post-modal-body {
  padding: 0 28px 24px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
}

.post-modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.post-error {
  min-height: 20px;
  color: #b4231a;
  font-size: 0.9rem;
}

.post-context {
  display: grid;
  gap: 18px;
}

.post-field {
  display: grid;
  gap: 10px;
}

.post-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #20232b;
}

.post-context textarea,
.post-context input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: #fbfcfd;
  resize: vertical;
  min-height: 120px;
}

.post-context input[type="file"] {
  padding: 14px;
  min-height: 0;
}

.post-context textarea:focus,
.post-context input[type="file"]:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.post-helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.post-upload-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  padding: 8px;
  background: #f8f9fa;
}

.post-upload-preview img,
.post-upload-preview video {
  max-width: 100%;
  border-radius: 12px;
}

.post-modal-footer {
  padding: 18px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.post-primary,
.post-secondary {
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-primary {
  border: none;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.25);
}

.post-secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #212529;
}

.post-primary:hover,
.post-primary:focus-visible,
.post-secondary:hover,
.post-secondary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(17, 17, 17, 0.18);
  outline: none;
}

.post-primary:disabled,
.post-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* suggestions */
.suggestion-header { font-weight: 500; color: var(--muted-2); font-size: 0.9rem; margin-bottom: 8px; }
.suggestion-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.suggestion-avatar { width: 35px; height: 35px; background-color: #e9ecef; border-radius: 50%; }
.suggestion-username { font-weight: 500; font-size: 0.9rem; }

/* === Profile Page === */
.profile-page {
  background: linear-gradient(180deg, #f8f9fa 0%, #eef1f5 100%);
}

.profile-content {
  padding-top: calc(var(--topbar-h) + 48px);
  padding-bottom: 64px;
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 24px;
  display: grid;
  gap: 24px;
}

.profile-status {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.profile-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
  display: grid;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.profile-header {
  display: flex;
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111111, #2b2b2b);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 700;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
}

.profile-avatar--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.profile-avatar-initials {
  letter-spacing: 0.02em;
}

.profile-heading { display: grid; gap: 4px; }

.profile-name {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.profile-handle {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.profile-intro {
  margin: 0;
  font-size: 1rem;
  color: var(--muted-2);
  line-height: 1.6;
}

.profile-details {
  margin: 0;
  display: grid;
  gap: 18px;
}

.profile-details > div {
  display: grid;
  gap: 6px;
}

.profile-details dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.profile-details dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.profile-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.profile-actions .profile-button {
  margin: 0;
}

@media (max-width: 600px) {
  .profile-card {
    padding: 24px;
  }

  .profile-header {
    align-items: flex-start;
  }

  .profile-avatar {
    width: 60px;
    height: 60px;
  }
}

.profile-button {
  border: transparent;
  background-color: #0e0d0d;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-button:hover,
.profile-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.18);
  outline: none;
}

.profile-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === Profile Settings Page === */
.profile-settings-page {
  background: linear-gradient(180deg, #f8f9fa 0%, #eef1f5 100%);
}

.profile-settings {
  padding-top: calc(var(--topbar-h) + 48px);
  padding-bottom: 64px;
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 24px;
}

.settings-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: grid;
  gap: 24px;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.settings-header p {
  margin: 8px 0 0;
  color: var(--muted-2);
  line-height: 1.6;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.settings-form input[type="text"] {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-form input[type="text"]:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.1);
  outline: none;
}

.settings-photo {
  display: grid;
  gap: 12px;
}

.settings-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111111, #2b2b2b);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.6rem;
  background-size: cover;
  background-position: center;
  position: relative;
}

.settings-photo-initials {
  letter-spacing: 0.03em;
}

.settings-photo-preview.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.settings-photo-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 10px 18px;
  background: #111827;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.settings-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-link {
  background: transparent;
  border: none;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.settings-photo-hint,
.settings-help {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-2);
}

.settings-actions {
  margin-top: 12px;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 54px;
  height: 30px;
  background: var(--input);
  border-radius: 999px;
  padding: 4px;
  cursor: pointer;
  border: 1px solid var(--line);
}

.toggle input { display: none; }

.toggle-slider {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 50%; left: 6px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider::after {
  transform: translate(16px, -50%);
  background: #111827;
}

.settings-status {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 1.4em;
}

.settings-status.is-error {
  color: #dc2626;
}

.settings-status.is-success {
  color: #047857;
}

.settings-status.is-info {
  color: var(--muted-2);
}

@media (max-width: 600px) {
  .settings-card {
    padding: 24px;
  }

  .settings-photo-preview {
    width: 84px;
    height: 84px;
  }
}