/* Warm paper, navy ink, and a small gold name-badge accent. */
:root {
  --accent: #243f78;
  --accent-ink: #ffffff;
  --accent-soft: #e9edf5;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-2: #efede5;
  --ink: #182740;
  --ink-2: #626b7b;
  --line: #dedfdc;
  --radius: 16px;
  --font-display: Georgia, 'Times New Roman', serif;
  --max: 1400px;
  color-scheme: light;
}

/* Compact working surface. */
.app-header {
  background: var(--bg);
  padding-top: calc(14px + var(--safe-top));
  padding-bottom: 14px;
}

.ask-button {
  font-size: .875rem;
  padding-inline: 16px;
}

.demo-note {
  color: var(--ink-2);
  font-size: .75rem;
  margin: 0 0 16px;
}

.eyebrow {
  font-family: var(--font);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.room-label {
  color: var(--accent);
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 18px;
}

.section-title h2 {
  font-size: 1.7rem;
}

.feed-pane, .detail-pane {
  min-width: 0;
}

.chips {
  gap: 6px;
  padding-bottom: 12px;
}

.chip {
  min-height: 44px;
  flex-shrink: 0;
  font-size: .8rem;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}

.segments {
  display: flex;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
}

.segments button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.segments [aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 1px 4px #18274018;
  color: var(--ink);
}

/* Flat, readable discussion rows. */
.thread {
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.thread h3 {
  margin: 6px 0 8px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.title-button {
  min-height: 44px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.title-button[aria-pressed="true"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: #d4ac54;
  text-underline-offset: 4px;
}

.thread p {
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-line;
}

.preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink-2);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f0e5c7;
  color: #665026;
  font-size: .65rem;
  font-weight: 700;
}

.author-line {
  gap: 7px;
  margin-top: 14px;
}

.author-line .small {
  font-size: .75rem;
}

.author-line .badge {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .65rem;
}

.actions {
  gap: 18px;
  margin-top: 6px;
}

.vote-button {
  min-height: 44px;
  border: 0;
  padding: 0 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.vote-button[aria-pressed="true"] {
  font-weight: 700;
  background: var(--accent-soft);
  border-radius: 8px;
}

.detail-pane {
  display: none;
}

.has-selection .feed-pane {
  display: none;
}

.has-selection .detail-pane {
  display: block;
}

.detail-thread h3 {
  font-size: 1.7rem;
}

.detail-thread {
  margin-bottom: 20px;
}

.detail-empty {
  padding: 40px 20px;
  color: var(--ink-2);
}

.detail-empty h2 {
  margin-top: 14px;
  color: var(--ink);
  font-size: 2rem;
}

.table-mark {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px solid #d7bc7e;
  border-radius: 50%;
  margin: 30px 0;
  color: #a17d2e;
  font-size: 2rem;
}

/* Constrained forms and a true bottom-sheet name badge. */
form, .composer, .welcome {
  max-width: 640px;
}

.composer {
  margin-inline: auto;
}

.composer .row {
  justify-content: space-between;
  margin-bottom: 18px;
}

dialog.badge-sheet {
  margin: auto auto 0;
  border-radius: 22px 22px 0 0;
}

.welcome {
  box-shadow: none;
  padding: 16px 0 0;
}

.reply {
  border-left: 3px solid #d7bc7e;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.card p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.tabbar button {
  min-height: 58px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 850px) {
  .app-main {
    padding-inline: 28px;
  }

  .rooms-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 30px;
    align-items: start;
  }

  .has-selection .feed-pane {
    display: block;
  }

  .detail-pane {
    display: block;
    position: sticky;
    top: 100px;
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
}

@media (max-width: 450px) {
  .app-header {
    gap: 6px;
  }

  .app-header .brand {
    font-size: 1rem;
    gap: 7px;
  }

  .app-header .brand img {
    width: 26px;
    height: 26px;
  }

  .ask-button {
    padding-inline: 12px;
    font-size: .75rem;
  }
}
