/* Reset y tokens */
:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #0b0f12;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #111827;
  --accent: #111827;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .05);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 76px;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  flex-shrink: 0;
}

.logo a {
  text-decoration: none;
  display: inline-block;
}

.logo img {
  width: 54px;
  height: 54px;
  vertical-align: middle;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: center;
  /* Centrado vertical */
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  fill: var(--text)
}

.nav-btn.is-active {
  outline: 2px solid #111827;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 14px 80px
}

.main>section {
  width: min(860px, 100%);
}

.composer-inline {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 10px;
  max-width: 860px;
}

.avatar,
.avatar-xl {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ddd;
  display: inline-block;
  border: 2px solid #fff;
  box-shadow: var(--shadow)
}

.avatar-xl {
  width: 64px;
  height: 64px
}

.avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer
}

.fake-input {
  flex: 1;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  background: #fafafa;
  color: #6b7280;
  cursor: text;
}

.primary,
.ghost {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
  background: #111827;
  color: #fff;
}

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

.ghost {
  background: #fff;
  color: var(--text)
}

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.fab svg {
  width: 26px;
  height: 26px;
  fill: #fff
}

/* Feed */
.feed,
.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.composer-prompt .placeholder {
  flex: 1;
  text-align: left;
  color: var(--muted);
  font-style: normal;
}

.composer-prompt:hover {
  background: #f9fafb;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.thought {
  position: relative
}

.thought>.card {
  padding: 12px 12px 8px
}

.thought-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px
}

.user {
  font-weight: 600
}

.username {
  color: var(--muted)
}

.time {
  color: var(--muted);
  margin-left: auto
}

.content {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 2px 0 6px
}

.placeholder {
  color: #9ca3af;
  font-style: italic
}

.actions {
  display: flex;
  gap: 8px
}

.action {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer
}

.action:focus {
  outline: 2px solid #111827;
  outline-offset: 2px
}

.children {
  margin-left: 22px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px
}

/* Dialog / composer */
dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  max-width: 680px;
  width: min(680px, 95%);
}

.composer-form {
  padding: 14px;
}

.composer-header {
  display: flex;
  align-items: center;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}

.composer-header h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
  text-align: left;
  padding-left: 30px;
  /* balance for close button */
}

.composer-header .ghost {
  margin-left: auto;
  border: none;
  font-size: 18px;
}

.composer-body {
  display: flex;
  gap: 10px;
  padding: 14px 0;
}

.composer-body .avatar {
  flex-shrink: 0;
}

.reply-context {
  max-height: 140px;
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px;
  margin: 6px 0 8px;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: none;
  background: transparent;
  padding: 6px 0;
  font: inherit;
  outline: none;
}

.toolbar {
  display: flex;
  align-items: center;
  margin-top: 8px
}

.muted {
  color: var(--muted)
}

.small {
  font-size: 12px
}

.h3 {
  font-size: 20px;
  margin: 0
}

.spacer {
  flex: 1
}

/* Search */
.searchbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.searchbar input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
}

.placeholder-container {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Profile */
.profile-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 760px;
}

.profile-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.profile-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px;
}

.profile-form legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.profile-form input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  width: 100%;
}

.radio-group {
  display: flex;
  gap: 16px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.file-input {
  display: inline-block;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fafafa;
  cursor: pointer;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost.danger {
  color: #ef4444;
  border-color: #fecaca;
}

.ghost.danger:hover {
  background: #fef2f2;
}

/* Results list */
.result-card .content mark {
  background: #fde68a
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  background: #111827;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow)
}

/* Hamburger bottom-left */
.hamburger {
  position: fixed;
  left: 18px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.hamburger svg {
  width: 22px;
  height: 22px;
  fill: var(--text)
}

/* Bottom sheet menu */
.sheet::backdrop {
  background: rgba(0, 0, 0, .2)
}

.sheet {
  border: none;
  border-radius: 16px;
  padding: 0
}

.sheet-body {
  padding: 12px 12px 6px;
  min-width: 260px
}

.sheet-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit
}

.sheet-close {
  display: block;
  width: 100%;
  border: none;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 6px;
  cursor: pointer
}

.children.collapsed {
  display: none
}

.action.small {
  font-size: 12px;
  padding: 4px 8px
}