:root {
  --bg: #060606;
  --surface: #0b0b0b;
  --surface-2: #111111;
  --border: #242424;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --dim: #5f6673;
  --accent: #f0c040;
  --accent-2: #d7d7d7;
  --danger: #ff7b7b;
  --shadow: none;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

#app {
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 14px 104px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) 0 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(5, 6, 8, .96), rgba(5, 6, 8, .76));
  backdrop-filter: blur(18px);
}

.topbar h1 {
  font-size: 18px;
  letter-spacing: .08em;
}

.topbar p,
.muted,
small {
  color: var(--muted);
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 900;
  letter-spacing: -.06em;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(680px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  background: rgba(13, 17, 25, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.nav-item {
  border-radius: 17px;
  padding: 12px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
}

.nav-item.active {
  background: rgba(240, 192, 64, .16);
  color: var(--accent);
}

.compose-fab {
  position: fixed;
  right: max(18px, calc((100vw - 720px) / 2 + 18px));
  bottom: 96px;
  width: 58px;
  height: 58px;
  border-radius: 24px;
  background: var(--accent);
  color: #090909;
  font-size: 32px;
  font-weight: 800;
  box-shadow: var(--shadow);
  z-index: 18;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 18px;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.brand-card,
.auth-card,
.post-card,
.profile-card,
.translator-card,
.board-panel,
.dm-panel {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  background: rgba(13, 17, 25, .82);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
}

.brand-card,
.auth-card {
  padding: 24px;
}

.brand-card h1 {
  font-size: clamp(30px, 8vw, 56px);
  line-height: 1.08;
  letter-spacing: -.06em;
  margin: 8px 0 14px;
}

.brand-card p,
.compose-footer p,
.translator-card p {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tabs button,
.ghost {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  padding: 12px;
}

.auth-tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-note,
.profile-subtle {
  color: var(--dim);
  font-size: 12px;
}

.primary {
  border-radius: 18px;
  background: var(--accent);
  color: #101010;
  font-weight: 900;
  padding: 13px 16px;
}

.error-text {
  color: var(--danger);
  min-height: 1.5em;
}

.composer-inline {
  border: 1px dashed rgba(240, 192, 64, .32);
  border-radius: 24px;
  padding: 18px;
  color: var(--muted);
  background: rgba(240, 192, 64, .06);
  margin-bottom: 12px;
  cursor: text;
}

.feed {
  display: grid;
  gap: 12px;
}

.post-card {
  padding: 16px;
}

.post-context {
  color: var(--accent-2);
  font-size: 12px;
  margin-bottom: 8px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
}

.identity small {
  display: block;
  font-size: 12px;
}

.identity.compact {
  align-items: flex-start;
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(240, 192, 64, .28), rgba(104, 211, 145, .14));
  border: 1px solid rgba(255,255,255,.12);
  color: var(--accent);
  font-weight: 900;
}

.avatar.large {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  font-size: 28px;
}

.post-body {
  display: block;
  width: 100%;
  margin: 14px 0;
  text-align: left;
  white-space: pre-wrap;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

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

.post-actions button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12px;
}

.post-actions button.on {
  color: var(--accent);
  border-color: rgba(240, 192, 64, .48);
}

.post-actions .danger-action {
  color: var(--danger);
  border-color: rgba(255, 123, 123, .42);
}

.empty {
  padding: 28px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}

.section-title {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .18em;
  margin: 14px 0 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display: grid;
  place-items: end center;
  padding: 12px;
  z-index: 50;
}

.compose-sheet {
  width: min(720px, 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 30px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.icon-close {
  justify-self: end;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

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

.translation-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
}

.pulse {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 3px solid rgba(240,192,64,.18);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.board-panel,
.dm-panel {
  overflow: hidden;
}

.board-messages,
.dm-messages {
  height: min(62vh, 560px);
  overflow: auto;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.board-message,
.dm-message,
.sent-placeholder,
.translation-toast {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255,255,255,.03);
}

.board-message p,
.dm-message p {
  white-space: pre-wrap;
  margin-top: 8px;
}

.sent-placeholder,
.translation-toast {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.board-form,
.search-form {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px;
}

.board-form input,
.search-form input {
  border-radius: 18px;
}

.thread-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.thread-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(255,255,255,.03);
  padding: 12px;
}

.thread-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 12px;
}

.profile-card > div {
  flex: 1;
}

.profile-card p {
  color: var(--muted);
}

.translator-card {
  padding: 18px;
  margin-bottom: 12px;
}

.translator-card h3 {
  margin: 6px 0;
}

.identity-traits {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.identity-traits div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.identity-traits dt {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

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

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .compose-footer,
  .board-form,
  .search-form {
    display: grid;
  }

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

/* CQ legacy visual direction: black field, white text, thin borders, restrained accents. */
.shell,
.auth-screen {
  max-width: 720px;
}

.shell {
  padding: 0 16px 84px;
}

.topbar {
  margin: 0 -16px 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 6, 6, .94);
  box-shadow: none;
}

.topbar h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .14em;
}

.topbar p {
  font-size: 12px;
}

.signal-dots {
  margin-left: auto;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.signal-dots i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .35;
  animation: signal-blink 1.4s infinite;
}

.signal-dots i:nth-child(2) { animation-delay: .18s; }
.signal-dots i:nth-child(3) { animation-delay: .36s; }

.logo {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f0f0f;
  color: var(--text);
  font-family: "Space Grotesk", Inter, sans-serif;
  letter-spacing: -.08em;
}

.bottom-nav {
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: rgba(6, 6, 6, .96);
  box-shadow: none;
  padding: 4px 10px max(6px, env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 4px;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  padding: 7px 4px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 22%;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #060606;
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 17px;
}

.nav-item i {
  font-size: 17px;
}

.nav-item.active {
  background: transparent;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

.compose-fab {
  width: 54px;
  height: 54px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #0b0b0b;
  color: var(--accent);
  box-shadow: none;
}

.brand-card,
.auth-card,
.post-card,
.profile-card,
.translator-card,
.board-panel,
.dm-panel,
.empty,
.thread-row,
.board-message,
.dm-message,
.sent-placeholder,
.translation-toast {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.feed {
  gap: 8px;
}

.brand-card h1 {
  font-size: clamp(28px, 8vw, 48px);
  letter-spacing: -.04em;
}

.eyebrow,
.post-context {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}

input,
textarea {
  border-radius: 6px;
  background: #050505;
  border-color: var(--border);
}

.primary {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
}

.auth-tabs button,
.ghost,
.post-actions button,
.icon-close {
  border-radius: 6px;
  background: transparent;
  border-color: var(--border);
}

.composer-inline {
  border-color: var(--border);
  border-radius: 8px;
  background: #080808;
}

.avatar,
.avatar.large {
  border-radius: 8px;
  background: #111;
  color: var(--text);
}

.post-card,
.profile-card,
.translator-card {
  padding: 12px;
}

.post-card,
.notification-card,
.thread-row {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.post-body {
  margin: 10px 0;
  color: var(--text);
  font-size: 15px;
}

.modal-backdrop {
  background: rgba(0, 0, 0, .78);
}

.compose-sheet {
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.post-actions {
  gap: 6px;
}

.post-actions button {
  padding: 6px 9px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.notification-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.notification-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.notification-body {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  background: transparent;
}

.notification-kind {
  color: var(--text);
  font-weight: 700;
}

.notification-quote {
  white-space: pre-wrap;
  color: var(--text);
}

.notification-target {
  padding-left: 10px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-messages,
.dm-messages {
  padding: 10px;
  gap: 8px;
}

.board-message,
.dm-message,
.sent-placeholder,
.translation-toast,
.thread-row {
  padding: 10px;
}

.profile-card {
  margin-bottom: 8px;
}

.translator-card {
  margin-bottom: 8px;
}

.signal-loader {
  display: inline-flex;
  align-items: end;
  gap: 4px;
  height: 34px;
}

.signal-loader span {
  display: block;
  width: 5px;
  height: 10px;
  background: var(--accent);
  animation: signal-bars 1s ease-in-out infinite;
}

.signal-loader span:nth-child(2) { animation-delay: .12s; }
.signal-loader span:nth-child(3) { animation-delay: .24s; }
.signal-loader span:nth-child(4) { animation-delay: .36s; }

.morse-line {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  animation: morse-flicker 1.8s steps(2, end) infinite;
}

.mini-signal {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(240, 192, 64, .5);
  animation: mini-pulse 1.2s infinite;
}

.typing-indicator {
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 8px 12px;
}

.signal-cue {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: calc(max(24px, env(safe-area-inset-top)) + 8px) 18px max(24px, env(safe-area-inset-bottom));
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  overflow: hidden;
}

.signal-cue.visible {
  opacity: 1;
}

.signal-cue-wallpaper {
  width: min(100vw, 760px);
  display: grid;
  gap: 12px;
  justify-items: center;
  opacity: 0.16;
  transform: scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.signal-cue.burst .signal-cue-wallpaper {
  opacity: 0.24;
  transform: scale(1);
}

.signal-cue-row {
  width: 118%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.18em;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(18px, 5.3vw, 42px);
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  word-break: break-word;
  text-align: center;
  opacity: 0.26;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.signal-cue.burst .signal-cue-row {
  animation: signal-scan 1400ms cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: var(--row-delay, 0ms);
}

.signal-cue-user .signal-cue-row {
  color: rgba(246, 236, 208, 0.72);
}

.signal-cue-reply .signal-cue-row {
  color: rgba(240, 192, 64, 0.8);
}

@keyframes signal-scan {
  0% {
    opacity: 0.08;
    transform: translateY(10px);
  }
  35% {
    opacity: 0.88;
    transform: translateY(0);
  }
  100% {
    opacity: 0.26;
    transform: translateY(0);
  }
}

@keyframes signal-blink {
  0%, 100% { opacity: .25; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-2px); }
}

@keyframes signal-bars {
  0%, 100% { height: 8px; opacity: .35; }
  50% { height: 32px; opacity: 1; }
}

@keyframes morse-flicker {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes mini-pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 192, 64, .45); }
  100% { box-shadow: 0 0 0 10px rgba(240, 192, 64, 0); }
}
