.research-room {
  --room-ink: var(--ink, #192d34);
  --room-muted: var(--muted, #607277);
  --room-line: var(--line, #dce5e5);
  --room-paper: var(--page, #f4f7f7);
  --room-brand: var(--green, #126e5e);
  --room-active: var(--wash, #e8f3ef);
  --room-radius: 12px;
  color: var(--room-ink);
  min-width: 0;
}
.research-room-layout {
  display: grid;
  grid-template-columns: minmax(188px, .9fr) minmax(0, 3.34fr) minmax(240px, 1.04fr);
  align-items: stretch;
  gap: 20px;
}
.research-room-left, .research-room-primary, .research-room-secondary { min-width: 0; }
.research-room-left, .research-room-primary { display: grid; align-content: start; gap: 16px; }
.research-room-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--room-line);
  border-radius: var(--room-radius);
  background: var(--panel, #fff);
  overflow-wrap: anywhere;
}
.research-room-intro, .research-room-top-status, .research-room-panel-head,
.research-room-editor-header, .research-room-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.research-room-intro { margin-bottom: 16px; }
.research-room-intro h1 { margin: 0; font-size: clamp(18px, 1.8vw, 23px); line-height: 1.25; }
.research-room-top-status { justify-content: flex-start; }
.research-room-mobile-context { display: none; }
.research-room-context-jump {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--room-ink);
  font-size: .875rem;
  font-weight: 700;
  text-underline-offset: 3px;
}
.research-room-unavailable, .research-room-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--room-muted);
  background: var(--room-paper);
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.45;
}
.research-room-unavailable[data-ready='true'], .research-room-configuration-tag {
  color: var(--room-brand);
  background: var(--room-active);
}
.research-room-left { grid-template-rows: auto auto 1fr auto; padding: 16px 12px; }
.research-room :is(.research-room-left, .research-room-panel-head, .research-room-config) h2 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.4;
}
.research-room-left > h2 { margin-inline: 4px; }
.research-room-nav { display: grid; gap: 6px; }
.research-room-nav a {
  position: relative;
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 61px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--room-ink);
  font-size: .9rem;
  text-decoration: none;
}
.research-room-nav a strong { font-weight: 650; }
.research-room-nav a small { color: var(--room-muted); font-size: .75rem; }
.research-room-nav a:is(:hover,[aria-current='page']) { color: var(--room-brand); background: var(--room-active); }
.research-room-nav a[aria-current='page']::before {
  content: '';
  position: absolute;
  inset: 20% auto 20% 0;
  width: 3px;
  border-radius: 3px;
  background: var(--room-brand);
}
.research-room-history {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--room-line);
}
.research-room-recent > summary {
  min-height: 44px;
  padding: 10px 4px;
  color: var(--room-muted);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 700;
}
.research-room-recent ol { list-style: none; margin: 0; padding: 0; }
.research-room-recent button { display: grid; width: 100%; gap: 3px; padding: 8px; border-radius: 8px; text-align: left; }
.research-room-recent button[aria-current='true'] { background: var(--room-active); }
.research-room-recent button strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--room-ink);
  font-weight: 650;
}
.research-room-recent button small { color: var(--room-muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.research-member-archive ol { max-height: 26rem; overflow: auto; }
.research-room-context-name { margin: 10px 0 0; font-size: 1rem; font-weight: 700; line-height: 1.5; }
#research-room-context-title { scroll-margin-top: 16px; }
.research-room-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0 0;
  font-variant-numeric: tabular-nums;
  font-size: .825rem;
  line-height: 1.5;
}
.research-room-facts dt { color: var(--room-muted); font-size: .75rem; }
.research-room-facts dd { margin: 3px 0 0; }
.research-room-asset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 10px;
  font-size: .875rem;
  font-weight: 650;
}
.research-room-asset select {
  min-block-size: 44px;
  min-inline-size: 100px;
  max-inline-size: 100%;
  padding: 6px 8px;
  border: 1px solid var(--room-line);
  border-radius: 6px;
  color: var(--room-ink);
  background: var(--panel, #fff);
}
.research-room-news-summary { margin: 10px 0 0; font-size: .875rem; line-height: 1.6; }
.research-room-secondary { align-self: start; }
.research-room-quote, .research-room-materials, .research-room-config { margin-top: 16px; border-top: 1px solid var(--room-line); }
.research-room-quote { padding-top: 12px; }
.research-room-quote h3 { margin: 0 0 6px; font-size: .875rem; }
.research-room-quote-empty {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--room-muted);
  background: var(--room-paper);
  font-size: .8rem;
}
.research-room-quote-empty > span { display: block; color: var(--room-ink); font-size: 1.25rem; }
.research-room-quote-empty p { margin: 2px 0; }
.research-room-quote-empty button { padding-inline: 0; }
.research-room-config { padding-top: 14px; }
.research-room-config h2 { color: var(--room-muted); }
.research-room :is(.research-room-materials, .research-room-plan) > summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--room-brand);
  cursor: pointer;
  font-weight: 700;
}
.research-room-materials > summary { color: var(--room-ink); }
.research-room-materials section { margin-top: 8px; padding: 10px; border-radius: 8px; background: var(--room-paper); }
.research-room-materials h3 { margin: 0; color: var(--room-ink); font-size: .875rem; }
.research-room-materials a { display: inline-flex; align-items: center; min-height: 36px; gap: 4px; font-size: .825rem; }
.research-room-source { margin-top: 2px; font-size: .875rem; line-height: 1.5; }
.research-room-source :is(a, p) { overflow-wrap: anywhere; }
.research-room-source a { color: var(--room-brand); text-underline-offset: 3px; }
.research-room-source p { font-variant-numeric: tabular-nums; }
.research-room-source .research-room-news-summary { font-variant-numeric: normal; }
.research-room-plan p, .research-room-plan ol { margin: 6px 0 0; color: var(--room-muted); font-size: .825rem; line-height: 1.6; }
.research-room-plan ol { padding-left: 20px; }
.research-room-plan li + li { margin-top: 6px; }
.research-room-messages { display: grid; gap: 8px; max-height: 30rem; overflow: auto; }
.research-room-empty {
  padding: 14px 16px;
  border: 1px solid var(--room-line);
  border-radius: var(--room-radius);
  background: var(--panel, #fff);
}
.research-room-empty h3 { margin: 0; font-size: 1rem; }
.research-room-empty p, .research-room-muted, .research-room-source p {
  margin: 5px 0 0;
  color: var(--room-muted);
  font-size: .875rem;
  line-height: 1.6;
}
.research-room-message {
  min-width: 0;
  margin-inline-start: clamp(0px, 5vw, 56px);
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--room-radius);
  background: var(--room-active);
  overflow-wrap: anywhere;
}
.research-room-message-head { color: var(--room-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.research-room-message p { margin: 6px 0 0; font-size: 1rem; line-height: 1.6; white-space: pre-wrap; }
.research-room-message summary { margin-top: 4px; color: var(--room-brand); font-size: .825rem; cursor: pointer; }
.research-room-message-context { color: var(--room-muted); font-size: .825rem; }
.research-room-transcript-toggle { padding-inline: 0; }
.research-room-template, .research-member-synthesis { padding: clamp(16px, 1.8vw, 25px); }
.research-room-synthesis-brand { display: flex; align-items: center; gap: 8px; color: var(--room-brand); font-size: 1rem; font-weight: 750; }
.research-room-synthesis-brand > span {
  display: inline-grid;
  flex: 0 0 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--room-brand);
  font-size: .85rem;
}
.research-room-template h2, .research-member-synthesis > h2 {
  margin: 12px 0 0;
  font-size: clamp(1.375rem, 2.1vw, 1.8rem);
  line-height: 1.25;
}
.research-room-template-outline > summary { min-height: 44px; padding-block: 10px; color: var(--room-brand); cursor: pointer; font-size: .875rem; font-weight: 650; }
.research-room-report { margin: 0; padding: 0 0 0 20px; font-size: .875rem; line-height: 1.6; }
.research-room-report li { padding: 6px 0; border-top: 1px solid var(--room-line); }
.research-room-report li::marker { color: var(--room-brand); font-weight: 650; }
.research-room :is(a, button, textarea, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--room-brand); outline-offset: 2px; }
.research-room button {
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--room-brand);
  cursor: pointer;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.45;
}
.research-room button:not([data-room-send]):hover:enabled, .research-room-source a:hover { text-decoration: underline; text-underline-offset: 3px; }
.research-room button:disabled { cursor: not-allowed; opacity: .55; }
.research-room button.research-room-new { width: 100%; border-color: var(--room-line); border-radius: 7px; }
.research-room-form label { font-size: .9rem; font-weight: 700; }
.research-room-compose-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.research-room-form textarea {
  display: block;
  width: 100%;
  min-height: 61px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid var(--room-line);
  border-radius: 7px;
  color: var(--room-ink);
  background: var(--panel, #fff);
  font: inherit;
  line-height: 1.5;
}
.research-room-form textarea::placeholder { color: var(--room-muted); }
.research-room button[data-room-send] { align-self: stretch; min-width: 80px; padding: 8px 12px; border-radius: 7px; color: #fff; background: var(--room-brand); }
.research-room button[data-room-send]:hover:enabled { background: var(--green-dark, #084336); }
.research-room button[data-room-send]:disabled { color: var(--room-muted); background: var(--room-paper); opacity: 1; }
.research-room-conflict, .research-member-pending, .research-member-followup { margin-top: 8px; padding: 6px 8px; border-radius: 6px; background: var(--room-paper); }
.research-room-conflict { border: 1px solid #ebdfc8; color: #624719; background: #fcf7ec; font-size: .875rem; }
.research-room-conflict p, .research-member-pending p { margin: 0; }
.research-room-send-note, .research-room-storage, .research-room-status {
  margin: 8px 0 0;
  color: var(--room-muted);
  font-size: .8rem;
  line-height: 1.55;
}
.research-room-status:not(:empty) { padding: 8px 10px; border-radius: 6px; color: var(--room-brand); background: var(--room-active); }
.research-room-status:empty { margin: 0; }
.research-member-controls { margin-top: 8px; border-top: 1px solid var(--room-line); }
.research-member-quota, .research-member-followup, .research-member-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--room-muted);
  font-size: .825rem;
  font-variant-numeric: tabular-nums;
}
.research-member-quota strong { color: var(--room-ink); }
.research-member-pending p { font-size: .875rem; font-weight: 650; }
.research-member-report { display: grid; gap: 16px; scroll-margin-top: 12px; }
.research-member-meta { margin: 6px 0 0; color: var(--room-muted); font-size: .825rem; }
.research-member-condition {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  color: #624719;
  background: #fcf7ec;
  font-size: .875rem;
}
.research-member-section { margin-top: 16px; }
.research-member-section h3 { margin: 0; font-size: 1rem; }
.research-member-section p, .research-member-report dd { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.65; }
.research-member-section-1 { padding: 12px 14px; border-radius: 8px; background: var(--room-active); }
.research-member-section-1 h3, .research-member-scenario h4 { color: var(--room-brand); }
.research-member-section-2 p { color: var(--room-muted); }
.research-member-scenarios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.research-member-scenario { min-width: 0; padding: 10px 12px; border-radius: 8px; background: var(--room-paper); }
.research-member-scenario h4 { margin: 0; font-size: .875rem; }
.research-member-scenario[data-scenario='counter'] h4 { color: #765d27; }
.research-member-report dl { margin: 8px 0 0; }
.research-member-report dl div { margin-top: 6px; }
.research-member-report dt { color: var(--room-muted); font-size: .825rem; font-weight: 650; }
.research-member-report dd { margin: 0; }
.research-member-report ul { padding-left: 20px; }
.research-member-report li { margin: 4px 0; }
.research-member-report li small { display: block; color: var(--room-muted); }
.research-member-report-details, .research-member-opinions, .research-member-actions, [data-room-replay-result] { margin-top: 12px; }
.research-member-report :is(.research-member-section-4,.research-member-section-5,.research-member-section-6,.research-member-opinions,[data-room-replay-result]) {
  padding-top: 10px;
  border-top: 1px solid var(--room-line);
}
.research-member-report button.research-member-report-toggle { display: none; }
.research-member-opinions summary { min-height: 44px; padding-block: 10px; color: var(--room-brand); cursor: pointer; font-weight: 650; }
.research-member-opinions article { margin-top: 8px; padding: 10px; border-radius: 6px; background: var(--room-paper); }
.research-member-opinions :is(h4,p), [data-room-replay-result] :is(h3,p) { margin: 0 0 5px; overflow-wrap: anywhere; }
.research-member-actions button { padding: 8px 10px; border-color: var(--room-line); border-radius: 7px; }
@media (max-width: 1119px) {
  .research-room-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 250px); gap: 12px; }
  .research-room-left { grid-column: 1 / -1; grid-template-rows: auto; gap: 8px; padding: 10px; }
  .research-room-left > h2 { display: none; }
  .research-room-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-room-nav a { min-height: 53px; }
  .research-room-history { gap: 0; }
  .research-room-left button.research-room-new { justify-self: start; width: auto; padding: 6px 12px; }
}
@media (max-width: 739px) {
  .research-room-layout { grid-template-columns: minmax(0, 1fr); }
  .research-room-primary { gap: 12px; }
  .research-room-intro { align-items: flex-start; flex-direction: column; }
  .research-room-intro h1 { font-size: clamp(1.625rem, 6.1vw, 2.1rem); }
  .research-room-context-jump { flex-basis: 100%; min-height: 30px; }
  .research-room-mobile-context {
    display: grid;
    width: 100%;
    gap: 3px;
    padding-top: 4px;
    overflow-wrap: anywhere;
  }
  .research-room-mobile-context strong { font-size: .875rem; }
  .research-room-mobile-context small { color: var(--room-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
  .research-room-left { padding: 8px; }
  .research-room-nav a { min-height: 48px; padding: 6px 8px; }
  .research-room-nav a small { display: none; }
  .research-room-history:has(> :only-child) + .research-room-new { grid-column: 2; grid-row: 2; justify-self: end; }
  .research-room-left:has(.research-room-history > :only-child) { grid-template-columns: minmax(0, 1fr) auto; }
  .research-room-left:has(.research-room-history > :only-child) .research-room-nav { grid-column: 1 / -1; }
  .research-room-left:has(.research-room-history > :only-child) .research-room-history { border-top: 0; }
  .research-room-message { margin-inline-start: 0; border-color: var(--room-line); background: var(--panel, #fff); }
  .research-room-form textarea, .research-room-asset select { font-size: 1rem; }
  .research-member-report button.research-member-report-toggle { display: block; width: 100%; margin-top: 12px; padding: 8px; border-color: var(--room-line); border-radius: 7px; }
  .research-member-report-details[data-expanded='false'] { display: none; }
}
@media (max-width: 360px) {
  .research-room button[data-room-send] { min-width: 60px; }
  .research-room-compose-field { gap: 6px; }
  .research-member-scenarios { grid-template-columns: minmax(0, 1fr); }
}
