:root {
  --bg: #090909;
  --panel: #151515;
  --panel-2: #1d1d1d;
  --text: #f7f7f7;
  --muted: #a1a1a1;
  --line: #2b2b2b;
  --accent: #ef1744;
  --accent-hover: #ff315e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 620px) 300px;
  justify-content: center;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  margin-bottom: 34px;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 21px;
  font-weight: 800;
}
.brand span { color: var(--accent); }
.side-nav { display: grid; gap: 8px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 700;
}
.side-link:hover, .side-link.active { background: var(--panel-2); }
.side-link.active { color: var(--accent); }
.side-link svg { width: 22px; height: 22px; }
.post-button {
  margin-top: 20px;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--accent);
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}
.post-button:hover { background: var(--accent-hover); }

.feed-column {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #0c0c0c;
}
.feed-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.94);
  backdrop-filter: blur(14px);
}
.feed-header h1 {
  margin: 0;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 20px;
}
.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  border: 0;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}

.feed-tabs {
  height: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.feed-tab {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-bottom: 3px solid transparent;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}
.feed-tab.active { color: white; border-bottom-color: var(--accent); }

.composer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.composer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}
.composer textarea {
  width: 100%;
  min-height: 72px;
  resize: none;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 18px;
  line-height: 1.45;
}
.composer textarea::placeholder { color: #777; }
.composer-footer {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.composer-count { color: var(--muted); font-family: "Trebuchet MS", sans-serif; font-size: 12px; }
.primary-button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--accent);
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }

.note-list { min-height: 300px; }
.note-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.note-card:hover { background: rgba(255,255,255,0.018); }
.note-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: #303030;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 800;
}
.note-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 5px;
  font-family: "Trebuchet MS", sans-serif;
}
.note-name { font-weight: 800; }
.note-username, .note-time { color: var(--muted); font-size: 13px; }
.note-content {
  margin: 0 0 14px;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-actions { display: flex; gap: 34px; }
.note-action {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 13px;
}
.note-action svg { width: 18px; height: 18px; }
.note-action:hover, .note-action.liked { color: var(--accent); }

.right-rail { padding: 24px 20px; }
.search-box {
  width: 100%;
  height: 44px;
  margin-bottom: 18px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: white;
  background: var(--panel);
  outline: 0;
}
.search-box:focus { border-color: var(--accent); }
.rail-panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rail-panel h2 {
  margin: 0;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 16px;
}
.topic { display: block; padding: 14px 15px; border-bottom: 1px solid var(--line); }
.topic:last-child { border-bottom: 0; }
.topic:hover { background: var(--panel); }
.topic strong, .topic span { display: block; font-family: "Trebuchet MS", sans-serif; }
.topic strong { margin-bottom: 3px; font-size: 14px; }
.topic span { color: var(--muted); font-size: 12px; }

.profile-page { max-width: 620px; min-height: 100vh; margin: 0 auto; }
.profile-hero { padding: 28px 20px 20px; border-bottom: 1px solid var(--line); }
.profile-top { display: flex; align-items: center; gap: 18px; }
.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 26px;
  font-weight: 800;
}
.profile-heading { flex: 1; }
.profile-heading h1 { margin: 0 0 3px; font-family: "Trebuchet MS", sans-serif; font-size: 24px; }
.profile-heading p { margin: 0; color: var(--muted); font-family: "Trebuchet MS", sans-serif; }
.profile-bio { margin: 16px 0 10px; font-family: "Trebuchet MS", sans-serif; line-height: 1.5; }
.profile-details { color: var(--muted); font-family: "Trebuchet MS", sans-serif; font-size: 14px; }
.profile-edit { margin-top: 16px; display: grid; gap: 10px; }
.profile-edit label { display: grid; gap: 5px; font-family: "Trebuchet MS", sans-serif; font-size: 13px; font-weight: 700; }
.profile-edit input, .profile-edit textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px;
  color: white; background: var(--panel); outline: 0; font-family: "Trebuchet MS", sans-serif;
}
.profile-edit textarea { min-height: 72px; resize: vertical; }
.profile-actions { display: flex; gap: 8px; }
.secondary-button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; color: white; background: transparent; font-family: "Trebuchet MS", sans-serif; font-weight: 800; }

.auth-panel { width: min(420px, calc(100% - 32px)); margin: 60px auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tab { height: 44px; border: 0; color: var(--muted); background: transparent; border-bottom: 3px solid transparent; font-weight: 800; }
.auth-tab.active { color: white; border-bottom-color: var(--accent); }
.auth-form { display: grid; gap: 12px; padding-top: 20px; }
.auth-form label { display: grid; gap: 6px; font-family: "Trebuchet MS", sans-serif; font-size: 13px; font-weight: 700; }
.auth-form input { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: white; background: #0d0d0d; }
.form-error { min-height: 18px; color: #ff7a91; font-family: "Trebuchet MS", sans-serif; font-size: 13px; }

.mobile-nav { display: none; }
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; font-family: "Trebuchet MS", sans-serif; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 74px minmax(0, 620px) 280px; }
  .sidebar { align-items: center; padding-inline: 12px; }
  .brand { font-size: 0; }
  .brand::first-letter { font-size: 21px; }
  .side-link { width: 48px; justify-content: center; padding: 0; }
  .side-link span { display: none; }
  .post-button { width: 48px; font-size: 0; }
  .post-button::first-letter { font-size: 18px; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar, .right-rail { display: none; }
  .feed-column { max-width: 620px; min-height: calc(100vh - 64px); margin: 0 auto; border-inline: 1px solid var(--line); }
  .mobile-nav {
    position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; height: 64px;
    display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line);
    background: rgba(12,12,12,0.96); backdrop-filter: blur(14px);
  }
  .mobile-nav a { display: grid; place-items: center; color: var(--muted); }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav svg { width: 22px; height: 22px; }
  .feed-header { top: 0; }
  body { padding-bottom: 64px; }
}
@media (max-width: 480px) {
  .feed-column { border-inline: 0; }
  .composer, .note-card { padding-inline: 14px; }
  .note-actions { gap: 24px; }
}
