/* Standalone thread splitter. Own palette; only the feed mimics X/Twitter. */

:root {
  --bg: #ffffff;
  --text: #16181c;
  --muted: #5b6570;
  --border: #d7dce1;
  --chip-bg: #eef1f4;
  --accent: #1d9bf0;
  --accent-contrast: #ffffff;
  --page: #f7f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --text: #e7e9ea;
    --muted: #8b98a5;
    --border: #2f3336;
    --chip-bg: #1f2327;
    --accent: #1d9bf0;
    --accent-contrast: #ffffff;
    --page: #0c0e10;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
}

.page-head {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.5rem;
}

.page-head .back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.page-head .back:hover {
  color: var(--accent);
}

.page-head h1 {
  margin: 0.5rem 0 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

main.layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  gap: 1.75rem;
  align-items: start;
}

.label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --- Compose ------------------------------------------------------------ */

textarea {
  width: 100%;
  min-height: 14rem;
  resize: vertical;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea:focus-visible,
select:focus-visible,
input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stats {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.settings legend {
  padding: 0 0.35em;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
}

.fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

select,
input[type="text"] {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.25rem;
  margin-top: 0.9rem;
  font-size: 0.88rem;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn:hover {
  filter: brightness(0.94);
}

.btn.quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.quiet:hover {
  background: var(--chip-bg);
  filter: none;
}

/* --- Preview ------------------------------------------------------------ */

.preview {
  position: sticky;
  top: 1rem;
}

.feed {
  --x-bg: #ffffff;
  --x-text: #0f1419;
  --x-muted: #536471;
  --x-line: #eff3f4;
  --x-hair: #cfd9de;
  --x-blue: #1d9bf0;
  background: var(--x-bg);
  color: var(--x-text);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  max-height: min(72vh, 46rem);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .feed {
    --x-bg: #000000;
    --x-text: #e7e9ea;
    --x-muted: #71767b;
    --x-line: #2f3336;
    --x-hair: #333639;
  }
}

.feed-empty {
  margin: 0;
  padding: 2.75rem 1.5rem;
  text-align: center;
  color: var(--x-muted);
  font-size: 0.95rem;
}

.post {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 0.7rem;
  padding: 0.85rem 1rem 0;
}

.post + .post {
  padding-top: 0.4rem;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--x-hair);
  display: grid;
  place-items: center;
}

.avatar svg {
  width: 26px;
  height: 26px;
  fill: var(--x-muted);
}

.stem {
  width: 2px;
  flex: 1;
  min-height: 12px;
  margin-top: 4px;
  background: var(--x-hair);
}

.post:last-child .stem {
  display: none;
}

.body {
  min-width: 0;
  padding-bottom: 0.7rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.35rem;
  font-size: 0.95rem;
  line-height: 1.2;
}

.name {
  font-weight: 700;
}

.handle,
.dot,
.time {
  color: var(--x-muted);
}

.copy {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--x-blue);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}

.copy:hover {
  text-decoration: underline;
}

.text {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text a {
  color: var(--x-blue);
  text-decoration: none;
}

.text a:hover {
  text-decoration: underline;
}

.text .mention {
  color: var(--x-blue);
}

/* --- FAQ ---------------------------------------------------------------- */

.faq {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.faq h2 {
  font-size: 1.05rem;
  margin: 0.5rem 0 0.75rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 0 1rem;
}

.faq details + details {
  margin-top: 0.6rem;
}

.faq summary {
  cursor: pointer;
  padding: 0.8rem 0;
  font-weight: 600;
}

.faq details p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 52rem) {
  main.layout {
    grid-template-columns: 1fr;
  }

  .preview {
    position: static;
  }

  .fields {
    grid-template-columns: 1fr;
  }
}
