@font-face {
  font-family: "Archivo";
  src: url("/fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #20201e;
  --muted: #62625c;
  --accent: #253de8;
  --accent-hover: #182bb9;
  --orange: #ff7a38;
  --paper: #f6f6f2;
  --white: #ffffff;
  --surface: #ebebe5;
  --line: #d3d3ca;
  --strong-line: #8c8c80;
  --soft-accent: #e8ebff;
  --error: #aa263a;
  --online: #1c7a43;
  --on-accent: #ffffff;
  --on-accent-muted: #e2e6ff;
  --on-accent-line: #8997ff;
  --font-ui: "Archivo", Arial, sans-serif;
  --font-note: Georgia, serif;
  --radius-control: 0;
  --radius-panel: 0;
  --panel-inset: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font-ui);
  scrollbar-color: var(--strong-line) transparent;
}
::selection {
  background: var(--orange);
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select,
summary {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  min-height: 44px;
  cursor: pointer;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius-control);
  padding: 10px 16px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}
button:hover {
  background: var(--soft-accent);
  border-color: var(--accent);
}
button:active {
  background: var(--soft-accent);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 {
  font-size: 32px;
}
h2 {
  font-size: 26px;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
}
p {
  max-width: 72ch;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font: 750 44px/1 var(--font-ui);
  font-stretch: 85%;
  letter-spacing: -0.035em;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  font-size: 0;
  margin-left: 2px;
  vertical-align: baseline;
}
.section-label {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
}
.small-tag {
  font-size: 14px;
  color: var(--accent);
  background: var(--soft-accent);
  border-radius: var(--radius-control);
  padding: 5px 8px;
  white-space: nowrap;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.primary:active {
  background: var(--ink);
}
.quiet {
  border: 0;
  background: none;
  padding: 8px 0;
  text-align: left;
  font-size: 14px;
  color: var(--muted);
}
a.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.hint,
small {
  font-size: 14px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
input:not([type="checkbox"]),
textarea,
select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius-control);
  background: var(--white);
  margin-top: 8px;
  color: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  caret-color: var(--accent);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  vertical-align: middle;
  margin-right: 6px;
}
label:has(input[type="checkbox"]) {
  min-height: 44px;
  padding: 8px 0;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  margin: 20px 0;
  padding: 14px;
}
fieldset label {
  margin: 5px 0;
  font-weight: 400;
  overflow-wrap: anywhere;
}
legend {
  font-size: 14px;
  font-weight: 600;
}
#parent-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}
#parent-list label input {
  margin-top: 4px;
}
#parent-list label .hint {
  grid-column: 2;
  font-weight: 400;
}
#parent-list {
  max-height: 220px;
  overflow: auto;
  padding: 4px;
}
.welcome {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--paper);
}
.invitation {
  padding: 38px clamp(32px, 4.2vw, 72px) 32px;
  background: var(--accent);
  color: var(--on-accent);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 860px;
}
.invitation .wordmark {
  color: var(--on-accent);
  font-size: 46px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--on-accent-line);
}
.rings {
  position: absolute;
  bottom: 76px;
  right: -180px;
  width: 420px;
  height: 356px;
  color: var(--orange);
  transform: translate3d(0, 0, 0) rotate(-32deg);
  transform-origin: center;
  backface-visibility: hidden;
  pointer-events: none;
  z-index: 0;
}
.invitation > :not(.rings) {
  position: relative;
  z-index: 1;
}
.rings svg {
  display: block;
  width: 100%;
  height: 100%;
}
.invitation h1 {
  font: 750 clamp(64px, 7.6vw, 96px) / 0.96 var(--font-ui);
  font-stretch: 85%;
  letter-spacing: -0.035em;
  text-transform: none;
  margin: 36px 0 22px;
  text-wrap: nowrap;
}
.invitation p:last-child {
  color: var(--on-accent-muted);
  font-size: 14px;
  line-height: 1.65;
  max-width: none;
  margin: auto 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--on-accent-line);
}
.login-card {
  container-type: inline-size;
  width: min(460px, calc(100% - 80px));
  align-self: center;
  justify-self: center;
  padding: 48px 0 28px;
}
.entry-heading {
  margin-bottom: 28px;
}
.login-card h2 {
  font: 750 52px/1 var(--font-ui);
  font-stretch: 90%;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.entry-heading p {
  color: var(--muted);
  line-height: 1.5;
  max-width: 42ch;
  margin: 0;
}
.entry-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ink);
  margin-bottom: 28px;
}
.entry-modes button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
}
.entry-modes button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}
.entry-modes button:hover {
  background: var(--soft-accent);
  color: var(--accent);
}
.login-card form,
.identity-fields {
  display: grid;
  gap: 24px;
}
.identity-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.login-card form label,
.identity-fields label,
.login-card form p {
  margin: 0;
}
.login-card input:not([type="checkbox"]),
.login-card select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--strong-line);
  padding: 12px 0;
  min-height: 50px;
}
.login-card input:hover,
.login-card select:hover {
  border-color: var(--strong-line);
}
#session-room-label input {
  font-size: 24px;
  font-weight: 500;
  min-height: 60px;
  border-bottom-color: var(--ink);
}
#guest-identity {
  padding-bottom: 0;
  border: 0;
}
#session-lifetime {
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  margin-top: -10px;
}
.entry-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.entry-footer > a {
  font-size: 13px;
}
#optional-account:has(#login-form[hidden]) #sso {
  display: none;
}
#back-to-room {
  margin-bottom: 24px;
}
.field-help {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.6;
}
.consent input[type="checkbox"] {
  margin: 3px 0 0;
}
.login-card form > button,
#sso-providers > button {
  width: 100%;
  margin: 0;
}
.login-card .primary {
  min-height: 54px;
  font-size: 15px;
  padding-inline: 20px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.login-card .consent {
  font-size: 13px;
}
#sso-providers {
  display: grid;
  gap: 10px;
  margin: 16px 0 24px;
}
.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.form-divider::before,
.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  row-gap: 4px;
}
.account-links .quiet {
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.disclosure > summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
#account-status:empty {
  display: none;
}
.privacy-note,
#account-status {
  font-size: 14px;
  margin-top: 24px;
}
#hall {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.sidebar {
  background: var(--surface);
  color: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  min-height: 0;
}
.room-navigation-heading {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}
.room-navigation-heading .section-label {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
#new-room {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--orange);
  border-color: transparent;
}
.sidebar :focus-visible {
  outline-color: var(--accent);
}
.room-button:hover {
  background: var(--soft-accent);
  border-color: var(--line);
}
.sidebar nav {
  overflow: auto;
  padding: 4px;
  margin: -4px;
}
.room-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  margin: 0;
  padding: 16px 12px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.room-button.active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.sidebar-note {
  font: italic 22px/1.35 var(--font-note);
  color: var(--ink);
  padding: 24px 0 4px;
  margin: auto 0 0;
  border-top: 1px solid var(--strong-line);
  text-wrap: pretty;
}
.appbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--paper);
}
.appbar-start,
.appbar-end {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.appbar .wordmark {
  font-size: 34px;
  gap: 10px;
  color: var(--white);
}
.appbar :focus-visible {
  outline-color: var(--orange);
}
.appbar-end > button,
#rooms-toggle {
  background: transparent;
  color: var(--paper);
  border-color: #686862;
}
.appbar-end > button:hover,
#rooms-toggle:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--paper);
}
#connection {
  color: #d9dfb1;
  background: transparent;
  padding-inline: 0;
  font-size: 12px;
}
#connection::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: currentColor;
}
.room-heading {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-left: 24px;
  border-left: 1px solid #686862;
}
.room-heading h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  font-stretch: 95%;
  line-height: 1.3;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.appbar-start,
.appbar-end {
  flex-shrink: 0;
}
#members {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: var(--radius-control);
}
#rooms-toggle {
  display: grid;
}
.room-views {
  display: none;
}
#hall.rooms-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
#hall.is-guest {
  grid-template-columns: minmax(0, 1fr);
}
#room-retention {
  margin-top: 8px;
}
.account-actions {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 12px;
}
.account-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.empty {
  margin: auto;
  text-align: left;
  padding: 48px 32px;
  max-width: 620px;
  color: var(--muted);
}
.empty h2 {
  font: 800 clamp(40px, 4.5vw, 64px)/1 var(--font-ui);
  font-stretch: 75%;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.room-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  flex: 1;
  min-height: 0;
}
.conversation {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.timeline-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#timeline {
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 32px;
  scroll-behavior: smooth;
}
.message {
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}
.message-header {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.message-header time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.avatar {
  font-weight: 750;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.message-body {
  margin: 0 0 0 39px;
  white-space: pre-wrap;
}
.message .kind {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.message .kind:empty {
  display: none;
}
#timeline > .hint {
  font: italic 28px/1.3 var(--font-note);
  color: var(--muted);
  max-width: 30ch;
  margin: 16px 0;
  padding: 12px 0;
}
.field-error {
  display: block;
  margin-top: 6px;
  color: var(--error);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.login-card form > label + .field-error {
  margin-top: -18px;
}
[aria-invalid="true"]:not([type="checkbox"]) {
  border-color: var(--error);
}
#timeline > .empty-chat-help {
  font: 400 14px/1.6 var(--font-ui);
  margin: 0;
  padding: 0;
}
.message.artifact-event {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.artifact-event button {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--accent);
  text-align: left;
  font-weight: 650;
  font-size: 16px;
}
.artifact-event p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}
.artifact-event time {
  font-size: 14px;
  color: var(--muted);
}
#composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
  flex-shrink: 0;
  margin: 0 24px 16px;
  border: 0;
  border-radius: var(--radius-panel);
  background: transparent;
  padding: 0 0 env(safe-area-inset-bottom);
}
#mention-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: min(340px, 100%);
  max-height: 260px;
  overflow-y: auto;
  z-index: 4;
  background: var(--white);
  border: 1px solid var(--strong-line);
  padding: 4px;
}
.mention-option { display: block; width: 100%; text-align: left; border: 0; overflow-wrap: anywhere; }
.mention-option[aria-selected="true"] { color: var(--accent); background: var(--soft-accent); }
.mention { color: var(--accent); background: var(--soft-accent); padding: 0 2px; }
.agent-username-field { margin: 0; }
.agent-username-field input { margin-top: 8px; }
.shared-files { list-style: none; padding: 0; margin: 20px 0 0; }
.shared-file { border-top: 1px solid var(--line); padding: 16px 0; overflow-wrap: anywhere; }
.shared-file > strong, .shared-file > span { display: block; }
.shared-file .hint { margin: 6px 0; }
.file-transfer-status { font-size: 13px; color: var(--muted); line-height: 1.5; }
.shared-file progress { display: block; width: 100%; margin-top: 10px; accent-color: var(--accent); }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-actions button, .file-save { padding: 8px 12px; font-size: 13px; }
.file-save { display: inline-block; border: 1px solid var(--strong-line); text-decoration: none; }
.file-save:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#file-status:empty { display: none; }
#composer textarea {
  min-width: 0;
  border: 1px solid var(--strong-line);
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  padding: 12px;
  height: 68px;
  min-height: 68px;
  max-height: 164px;
  line-height: 24px;
  overflow-y: auto;
  resize: none;
  background: var(--white);
}
#composer textarea:focus-visible {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
#composer > button { grid-column: 2; grid-row: 2; }
#message-help {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
#composer > .form-error { grid-column: 1 / -1; margin: 0; }
.artifacts {
  border-left: 1px solid var(--line);
  padding: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.artifact-actions {
  display: flex;
  margin-bottom: 24px;
}
.artifact-actions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border-color: var(--strong-line);
  color: var(--ink);
}
.artifact-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.artifact-card {
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  margin: 24px 0 0;
  overflow-wrap: anywhere;
}
.artifact-card:first-child { margin: 0; padding: 0; border: 0; }
.artifact-card h3 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 0 6px;
}
.artifact-count {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.history-entry {
  margin: 0;
  min-width: 0;
}
.version {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  text-align: left;
  padding: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
}
.version.current {
  background: var(--paper);
  border-color: var(--line);
}
.version:hover {
  background: var(--soft-accent);
  border-color: var(--accent);
}
.version-state {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.version-body { display: grid; gap: 8px; padding: 16px; width: 100%; min-width: 0; }
.version[aria-current="true"] { border-color: var(--accent); background: var(--soft-accent); }
.version-viewing { flex-shrink: 0; color: var(--accent); font-weight: 650; white-space: nowrap; }
.artifact-thumbnail {
  display: grid;
  pointer-events: none;
  place-items: center;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.artifact-thumbnail[data-state="file"],
.artifact-thumbnail[data-state="unavailable"] { padding: 20px; text-align: center; }
.artifact-thumbnail[data-state="file"] { aspect-ratio: auto; min-height: 88px; }
.artifact-thumbnail iframe {
  position: absolute;
  inset: 0;
  width: 300%;
  height: 300%;
  transform: scale(0.3333333);
  transform-origin: top left;
  border: 0;
  pointer-events: none;
}
.artifact-thumbnail img { width: 100%; height: 100%; object-fit: contain; position: absolute; }
.artifact-excerpt { align-self: start; justify-self: stretch; padding: 20px; font: 12px/1.65 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; color: var(--ink); }
.version-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
}
.version-summary {
  color: var(--ink);
}
.version-meta,
.version-parents {
  color: var(--muted);
  font-size: 14px;
}
.history-archive {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
.history-archive .history-list { grid-template-columns: 1fr; }
summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
summary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.version-details {
  margin-bottom: 18px;
}
.version-details p {
  overflow-wrap: anywhere;
}
dialog {
  border: 0;
  border-radius: var(--radius-panel);
  width: min(560px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 28px;
  background: var(--white);
  color: inherit;
  box-shadow: 0 24px 80px #17191f33;
}
dialog::backdrop {
  background: #20201eb8;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}
.dialog-heading > div {
  min-width: 0;
}
.dialog-heading button {
  flex-shrink: 0;
  background: transparent;
}
.dialog-heading h2 {
  margin: 5px 0 0;
  font-family: var(--font-ui);
  font-weight: 750;
  font-stretch: 90%;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.dialog-subtitle {
  margin: -12px 0 24px;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.dialog-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.dialog-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.copy-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.copy-field input {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.copy-field button {
  flex-shrink: 0;
}
#upload-form label:has(input[type="file"]) > .hint {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  line-height: 1.5;
}
#upload-form input[type="file"] {
  padding: 8px;
}
#upload-form input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 12px;
  padding: 5px 10px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1.4 var(--font-ui);
}
#upload-form legend .hint,
#upload-form summary .hint,
#upload-summary-label .hint {
  margin-left: 6px;
  font-weight: 400;
}
.upload-source {
  margin: 20px 0;
}
.upload-source-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}
.upload-modes {
  display: inline-grid;
  grid-template-columns: auto auto;
  border: 1px solid var(--ink);
  margin-bottom: 12px;
}
.upload-modes button {
  min-height: 40px;
  border: 0;
  padding: 8px 14px;
  color: var(--muted);
  transition: none;
}
.upload-modes button[aria-pressed="true"],
.upload-modes button[aria-pressed="true"]:hover {
  background: var(--ink);
  color: var(--white);
}
.drop-zone {
  padding: 16px;
  border: 1px dashed var(--strong-line);
  background: var(--paper);
}
.drop-zone[data-over] {
  border: 1px solid var(--accent);
  background: var(--soft-accent);
}
.drop-zone input[type="file"] {
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
}
.drop-zone .hint {
  margin: 8px 0 0;
}
.upload-text textarea {
  margin: 0;
  font: 14px/1.6 ui-monospace, monospace;
}
#upload-parents {
  margin: 20px 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
#upload-parents > summary {
  min-height: 44px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
}
#account-computers #local-pair { margin-inline-end: 12px; }
#account-computers > a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.4; }
.invitation-label { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.invitation-label label { margin: 0; }
.info-trigger { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; width: 24px; padding: 3px; border: 0; color: var(--muted); }
.invitation-label .field-tooltip,
#agent-sharing-help { width: min(360px, 100%); }
.field-tooltip ul { margin: 0; padding-left: 18px; }
.field-tooltip li + li { margin-top: 8px; }
#members-dialog {
  width: min(720px, calc(100vw - 32px));
  height: min(740px, calc(100dvh - 48px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  background: var(--white);
}
#members-dialog[open] {
  display: flex;
  flex-direction: column;
}
#members-dialog .dialog-heading {
  flex-shrink: 0;
  padding: 28px 28px 0;
  margin: 0;
  border: 0;
}
#members-dialog .dialog-subtitle {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0 28px;
  margin: 8px 0 24px;
}
.room-settings-nav {
  display: flex;
  gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--ink);
  flex-shrink: 0;
}
.room-settings-nav button {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  padding: 14px 8px;
}
.room-settings-nav button[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
}
.room-settings-nav button:hover {
  background: var(--soft-accent);
}
.room-settings-body {
  padding: 28px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.room-settings-body h3 {
  font-size: 20px;
  margin: 0 0 12px;
}
.room-settings-body .dialog-section {
  border-top: 0;
  padding: 0 0 28px;
}
#room-edit-status {
  align-self: center;
  color: var(--accent);
  font-size: 14px;
}
.room-lifetime {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 24px;
}
#room-panel-agents { container-type: inline-size; }
.settings-count { margin-left: 4px; color: inherit; font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; }
.settings-count:empty { display: none; }
#agent-invite-editor { padding-bottom: 24px; }
#agent-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 16px 12px; }
#agent-form > .primary { min-height: 44px; grid-column: 1 / -1; justify-self: start; }
#agent-form > .form-error { grid-column: 1 / -1; }
.agent-name-field { min-width: 0; }
.agent-name-label { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; min-height: 24px; margin-bottom: 8px; }
.agent-name-label label { margin: 0; }
#agent-name { min-width: 0; margin: 0; }
@container (min-width: 580px) {
  #agent-form { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
  #agent-form > .primary { grid-column: 3; min-height: 50px; }
}
@container (max-width: 280px) {
  #agent-form { grid-template-columns: minmax(0, 1fr); }
}
.tooltip-help { display: inline-flex; }
.optional-trigger {
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 400;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.optional-trigger:hover { background: transparent; color: var(--accent); }
.field-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 2;
  width: min(300px, 100%);
  padding: 10px 12px;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
#agent-empty:not([hidden]) { margin-top: 28px; }
.participant-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: var(--radius-control);
  background: var(--soft-accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}
.danger {
  color: var(--error);
  background: transparent;
}
#person-name {
  overflow-wrap: anywhere;
  font-size: 20px;
  font-weight: 500;
}
#account-dialog .account-actions {
  align-items: stretch;
}
#account-dialog .account-actions a {
  justify-content: center;
}
.join-request-list,
#member-list,
#agent-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.join-request-list li,
#member-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.join-request-list li:last-child,
#member-list li:last-child {
  border-bottom: 0;
}
#agent-list:empty {
  display: none;
}
#members #join-count {
  display: inline-flex;
  color: var(--accent);
  background: var(--soft-accent);
  font-variant-numeric: tabular-nums;
}
.member-info {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.agent-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.member-info > strong,
.member-info > span {
  display: block;
}
.member-info > span {
  font-size: 14px;
  color: var(--muted);
}
.member-id {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.member-actions {
  margin-left: auto;
}
.join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.member-actions button {
  color: var(--error);
}
#agent-invites {
  margin-top: 0;
}
#agent-invitation:not([hidden]) { display: grid; gap: 16px; }
.invitation-ready-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
#agent-invitation h3 {
  font-size: 18px;
  color: var(--ink);
  margin: 0;
}
.invitation-ready-heading p,
.invitation-note { margin: 0; }
.invitation-preview { min-width: 0; }
.invitation-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.invitation-actions > button { max-width: 100%; }
.agent-local-setup { min-width: 0; }
.agent-local-setup h4 { margin: 0 0 8px; font-size: 18px; }
.agent-local-setup > label { margin: 16px 0; }
.agent-setup-steps { margin: 20px 0; padding-left: 24px; }
.agent-setup-steps > li { padding-left: 4px; margin-bottom: 20px; }
.agent-setup-steps > li::marker { font-weight: 650; }
.agent-command-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.agent-command-row > input,
.agent-command-row > textarea { min-width: 0; flex: 1; margin: 0; }
.agent-command-row > button { flex: 0 0 auto; }
.agent-command { font: 14px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; resize: none; background: var(--paper); border-color: var(--line); }
.agent-setup-steps .hint { margin: 8px 0 0; }
#agent-other-hosts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#agent-other-hosts > summary { padding: 12px 0; min-height: 44px; }
#agent-other-hosts .invitation-actions { margin: 12px 0 16px; }
@container (max-width: 440px) {
  .agent-command-row { flex-direction: column; align-items: stretch; }
  .agent-command-row > input,
  .agent-command-row > textarea { flex: none; width: 100%; }
}
#agent-line {
  margin: 0;
  min-height: 160px;
  max-height: min(360px, 50dvh);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
}
.artifact-workspace {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.artifact-toolbar {
  padding: 8px var(--panel-inset);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.artifact-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.artifact-identity { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.artifact-format { display: grid; place-items: center; min-width: 44px; min-height: 32px; padding: 4px 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; }
.artifact-toolbar h2 { flex: 0 1 auto; min-width: 0; font-size: 18px; line-height: 1.3; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-toolbar #preview-kind { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-toolbar .icon-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; padding: 0; border-color: transparent; }
.artifact-toolbar #artifact-actions-toggle[aria-expanded="true"] { color: var(--accent); background: var(--soft-accent); }
.artifact-toolbar-action { flex: 0 0 auto; white-space: nowrap; }
.version[aria-busy="true"] { cursor: progress; }
.version[aria-busy="true"] .version-state > span:first-child::after { content: " · Opening…"; color: var(--accent); }
@container (max-width: 560px) {
  .artifact-toolbar-action { display: none; }
}
@container (min-width: 561px) {
  .artifact-actions-popover #derive,
  .artifact-actions-popover #ask-agent { display: none; }
}
.artifact-workspace { position: relative; }
.artifact-workspace[data-loading]::after {
  content: "Loading preview…";
  position: absolute;
  inset: 64px 0 0;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}
.artifact-actions-popover {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(300px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--strong-line);
  border-radius: var(--radius-panel);
  background: var(--white);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.artifact-actions-popover .preview-actions { display: grid; gap: 4px; margin: 0; }
.artifact-menu-meta { margin: 0; padding: 8px 12px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.artifact-actions-popover .preview-actions button { width: 100%; justify-content: start; padding: 12px; border-color: transparent; text-align: left; }
.artifact-actions-popover #derive { display: flex; justify-content: space-between; }
.artifact-actions-popover #toggle-version-details[aria-expanded="true"] { color: var(--accent); background: var(--soft-accent); }
.artifact-actions-popover .version-details { margin: 8px 0 0; padding: 16px 12px 8px; border-top: 1px solid var(--line); }
.artifact-actions-popover .version-details p { margin: 0 0 12px; font-size: 14px; }
.artifact-actions-popover .version-details #preview-meta { font-size: 12px; }
.artifact-actions-popover .version-details label { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 12px 0 0; font-size: 13px; font-weight: 400; }
.artifact-actions-popover .version-details #ancestry:empty { display: none; }
.artifact-actions-popover .version-details #ancestry { margin-bottom: 0; }
.artifact-actions-popover .parent-link { font-size: 13px; padding: 10px; width: 100%; }
.image-preview { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; overflow: auto; padding: 24px; background: var(--surface); }
.image-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
@container (max-width: 580px) {
  .artifact-toolbar h2 { font-size: 16px; }
  .artifact-format,
  .artifact-toolbar #preview-kind { display: none; }
}
.panel-conversation { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.panel-conversation .conversation { flex: 1; }
.panel-conversation #timeline { padding: 20px var(--panel-inset); }
.panel-conversation #timeline::before { display: none; }
.panel-conversation .message-body { margin-left: 0; }
.panel-conversation #composer { margin: 0 var(--panel-inset) var(--panel-inset); }
.preview-open #preview { flex: 1; min-height: 180px; height: 0; border: 0; }
.preview-open #text-preview { flex: 1; min-height: 0; max-height: none; margin: 0; padding: 24px; }
.room-content.preview-open { grid-template-columns: minmax(0, 1fr) 360px; }
#preview-kind {
  color: var(--accent);
  font-weight: 600;
}
.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.preview-actions label {
  margin: 0 0 0 auto;
  font-weight: 400;
}
#preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  width: 100%;
  height: 55vh;
}
#preview-summary {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#text-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 55vh;
  overflow: auto;
  font-size: 14px;
}
#ancestry {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
#ancestry > p {
  width: 100%;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.parent-link {
  text-align: left;
  overflow-wrap: anywhere;
}
#notice {
  position: fixed;
  z-index: 100;
  inset: auto auto 22px 50%;
  margin: 0;
  border: 0;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-control);
  width: max-content;
  max-width: calc(100vw - 32px);
  overflow-wrap: anywhere;
  pointer-events: none;
  box-shadow: 0 8px 30px #0002;
}
.form-error {
  color: var(--error);
  font-size: 14px;
  margin: 12px 0;
}
.reading-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  font-size: 16px;
}
.reading-page .eyebrow {
  font-size: 14px;
  margin-top: 32px;
}
.reading-page h1 {
  font: 900 clamp(48px, 7vw, 80px) / 1 var(--font-ui);
  font-stretch: 75%;
  letter-spacing: -0.035em;
  margin-bottom: 32px;
}
.reading-page h2 {
  margin-top: 40px;
}
.reading-page .wordmark {
  color: var(--accent);
}
.account-page {
  max-width: 600px;
}
.account-page h1 {
  margin-top: 48px;
  font-size: clamp(36px, 7vw, 56px);
}
.account-page form {
  margin: 32px 0 24px;
}
.account-page form label {
  margin: 24px 0 8px;
}
.account-page form button {
  margin-top: 24px;
}
.account-page .account-links {
  margin-top: 24px;
}
body [hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* Assembly: rings identify the collective; every interactive surface is square. */
.brand-symbol {
  width: 38px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--orange);
}
.invitation .brand-symbol {
  width: 46px;
  height: 38px;
}
.primary::after,
#new-room::after,
#upload::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask: url("/arrow.svg") center / contain no-repeat;
}
#upload::after { mask-image: url("/plus.svg"); }
.login-card .primary:hover { background: var(--accent); border-color: var(--accent); }
#session-submit { background: var(--orange); border-color: var(--orange); color: var(--ink); }
#session-submit:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
#new-room:hover { background: var(--ink); color: var(--white); }
.entry-modes button[aria-pressed="true"]:hover,
.room-settings-nav button[aria-pressed="true"]:hover { background: var(--ink); color: var(--white); }
.login-card input:not([type="checkbox"]):hover { border-bottom-color: var(--ink); }
.room-button.active::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: var(--orange);
}
.room-button.active:hover { background: var(--ink); color: var(--white); }
#members #join-count { font-size: 12px; padding: 2px 6px; }
#timeline::before {
  content: "";
  float: right;
  width: 28px;
  height: 24px;
  margin: 0 0 8px 16px;
  background: var(--strong-line);
  mask: url("/rings.svg") center / contain no-repeat;
}
.message-body { max-width: 72ch; }
.message-header > strong { font-weight: 750; }
.message .kind { text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; }
.version-meta, .version-parents { font-size: 12px; line-height: 1.5; }
.artifacts > .hint { font-size: 13px; line-height: 1.6; }
.reading-page { border-top: 8px solid var(--accent); }
.reading-page > header { padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.reading-page .wordmark { color: var(--ink); }
@media (min-width: 761px) and (max-width: 1100px) {
  .invitation { padding-inline: 32px; }
  .invitation h1 { font-size: clamp(64px, 8.2vw, 90px); }
  .rings { right: -220px; bottom: 180px; }
  .login-card { width: calc(100% - 64px); }
}
@media (min-width: 761px) and (max-height: 760px) {
  .invitation { min-height: 860px; }
}

/* Selection changes immediately so light and dark labels never blend to gray. */
.entry-modes button,
.room-settings-nav button { transition: none; }
/* One room context: people and artifacts share the same panel. */
.ui-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.icon-text { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.appbar .brand-symbol { width: 32px; height: 28px; }
.appbar-end { gap: 12px; }
.appbar-end .icon-text { padding: 10px 12px; }
.view-picker {
  container-type: inline-size;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-picker { display: flex; }
.view-picker .view-tab,
.view-combo {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  background-color: transparent;
  border: 0;
  transition: none;
}
.view-picker .view-tab,
.view-combo-face { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; }
.view-picker .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.view-combo { position: relative; }
.view-combo select {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.view-combo-face { min-height: 44px; pointer-events: none; }
.view-combo-face [data-combo-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-picker .combo-chevron { width: 12px; height: 12px; flex-basis: 12px; }
.view-picker .view-tab:hover,
.view-combo:hover { background-color: var(--soft-accent); }
.view-picker .view-tab[aria-pressed="true"],
.view-combo.is-active { background-color: var(--ink); color: var(--white); }
.view-combo:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.view-combo option { background: var(--paper); color: var(--ink); }
.view-count { font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
@container (max-width: 380px) {
  .view-picker .view-tab,
  .view-combo { font-size: 13px; }
  .view-picker .view-tab,
  .view-combo-face { padding-inline: 0; gap: 4px; }
  .view-picker .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
  .view-picker .combo-chevron { width: 10px; height: 10px; flex-basis: 10px; }
  .view-picker .view-count { display: none; }
}
.panel-body { overflow: auto; min-height: 0; flex: 1; padding: 20px var(--panel-inset); overscroll-behavior: contain; }
#people-status:empty { display: none; }
.roster-group + .roster-group { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.roster-heading h3 { font-size: 14px; font-weight: 750; margin: 0; }
.roster-heading h3 span { color: var(--muted); margin-left: 4px; font-weight: 400; font-variant-numeric: tabular-nums; }
.panel-action { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; border: 0; font-size: 13px; color: var(--accent); }
.panel-action .ui-icon { width: 16px; height: 16px; flex-basis: 16px; }
.roster-list { list-style: none; margin: 4px 0 0; padding: 0; }
.roster-person { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.roster-person:last-child { border-bottom: 0; }
.roster-stop { flex: 0 0 auto; margin-left: auto; }
.roster-avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; background: var(--paper); color: var(--ink); }

.roster-info { min-width: 0; overflow-wrap: anywhere; }
.roster-info strong, .roster-info > span { display: block; }
.roster-info strong { font-size: 15px; font-weight: 650; line-height: 1.4; }
.roster-info > span { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 4px; }
.agent-activity::before,
.room-agent-activity::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border: 1px solid currentColor;
  vertical-align: 1px;
}
.agent-activity[data-state="working"],
.agent-activity[data-state="stopping"] { color: var(--accent); }
.agent-activity[data-state="error"] { color: var(--error); }
[data-state="working"].agent-activity::before,
[data-state="working"].room-agent-activity::before {
  background: currentColor;
  animation: agent-working 1.8s linear infinite;
}
.room-agent-activity {
  flex: 0 0 auto;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  color: var(--accent);
  background: var(--soft-accent);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.room-agent-activity[data-state="error"] { color: var(--error); background: var(--paper); }
@keyframes agent-working { to { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) {
  [data-state="working"].agent-activity::before,
  [data-state="working"].room-agent-activity::before { animation: none; }
}
.review-requests { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; margin: 0 0 20px; border-color: var(--accent); color: var(--accent); background: var(--soft-accent); }

@media (max-width: 1150px) {
  #hall {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 14px;
  }
  .room-content {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  #timeline {
    padding: 24px;
  }
}
@media (max-width: 900px) {
  .panel-picker { display: none; }
  #timeline::before { display: none; }
  #hall {
    grid-template-columns: minmax(0, 1fr);
  }
  .appbar {
    min-height: 68px;
    padding: 12px 20px;
  }
  .sidebar {
    display: none;
    position: absolute;
    top: 68px;
    bottom: 0;
    left: 0;
    width: min(320px, 85vw);
    z-index: 10;
    padding: 24px 16px;
  }
  #hall.rooms-open .sidebar {
    display: flex;
  }
  .room-views { display: flex; }
  .room-content {
    display: flex;
    overflow: hidden;
  }
  .conversation {
    flex: 1;
    min-width: 0;
  }
  #timeline {
    max-height: none;
    min-height: 0;
  }
  .artifacts {
    display: none;
    border: 0;
    overflow: hidden;
    flex: 1;
  }
  #hall.show-room-panel .conversation {
    display: none;
  }
  #hall.show-room-panel .artifacts {
    display: flex;
  }
  .preview-open .artifact-workspace { flex: 1; }
  #hall.show-room-panel .preview-open .artifact-workspace { display: none; }
  #hall.show-room-panel .preview-open .panel-conversation .conversation { display: flex; }
}
@media (max-width: 760px) {
  .welcome.joining .invitation h1,
  .welcome.joining .invitation p {
    display: none;
  }
  .welcome {
    grid-template-columns: 1fr;
  }
  .invitation {
    min-height: 390px;
    padding: 24px;
  }
  .invitation .wordmark {
    font-size: 34px;
    padding-bottom: 18px;
  }
  .rings {
    top: auto;
    bottom: 36px;
    left: auto;
    right: -170px;
    width: 270px;
    height: 220px;
  }
  .invitation h1 {
    font-size: clamp(56px, 13vw, 80px);
    margin: 26px 0 16px;
  }
  .invitation p:last-child {
    padding-top: 16px;
    font-size: 13px;
  }
  .welcome.joining .invitation {
    min-height: 92px;
  }
  .welcome.joining .wordmark {
    padding-bottom: 0;
    border: 0;
  }
  .welcome.joining .rings {
    bottom: -100px;
  }
  .login-card {
    width: calc(100% - 48px);
    max-width: 480px;
    padding: 36px 0;
  }
  .login-card h2 {
    font-size: 40px;
  }
  .appbar {
    height: 68px;
    padding: 12px;
    gap: 8px;
  }
  .appbar .wordmark,
  .appbar-end .control-label {
    display: none;
  }
  #hall.is-guest .appbar-start {
    display: none;
  }
  .room-heading {
    padding-left: 0;
    border: 0;
  }
  #members {
    min-width: 44px;
    width: auto;
    height: 44px;
    padding: 10px;
  }
  .appbar-end .icon-text {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 10px;
  }
  #members #join-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    padding: 1px 4px;
    background: var(--orange);
    color: var(--ink);
  }
  #connection {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .appbar-start,
  .appbar-end {
    gap: 8px;
  }
  .workspace {
    min-height: 0;
  }
  .conversation {
    min-height: 0;
  }
  #timeline {
    padding: 20px 16px 8px;
  }
  .message-body {
    margin-left: 0;
  }
  #composer {
    margin: 0 12px 12px;
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .artifacts .panel-body {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  dialog {
    padding: 22px;
    max-height: calc(100dvh - 32px);
  }
  .copy-field {
    flex-direction: column;
  }
  .copy-field button {
    width: 100%;
  }
  .dialog-section {
    padding: 20px 0;
  }
  .dialog-heading {
    gap: 12px;
  }
  .dialog-heading h2 {
    font-size: 25px;
  }
  .join-request-list li,
  #member-list li {
    align-items: start;
    flex-wrap: wrap;
  }
  .member-actions {
    margin-left: 0;
  }
  .join-request-list .member-info {
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 760px) {
  #members-dialog {
    width: calc(100vw - 24px);
    height: calc(100dvh - 24px);
  }
  #members-dialog .dialog-heading {
    padding: 20px 20px 0;
  }
  #members-dialog .dialog-subtitle {
    padding: 0 20px;
    margin-bottom: 20px;
  }
  .room-settings-nav {
    padding: 0 20px;
    gap: 0;
  }
  .room-settings-body {
    padding: 24px 20px;
  }
}

@container (max-width: 400px) {
  .identity-fields {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 500px) {
  .room-views {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .room-content {
    overflow: auto;
  }
  .conversation {
    min-height: 180px;
  }
  #timeline {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  #composer {
    margin-bottom: 8px;
    padding: 0 0 env(safe-area-inset-bottom);
  }
  #composer textarea {
    height: 44px;
    min-height: 44px;
    max-height: 96px;
  }
  #members-dialog .dialog-heading {
    padding-top: 12px;
  }
  #members-dialog .dialog-subtitle {
    -webkit-line-clamp: 1;
    margin: 4px 0 8px;
  }
  .room-settings-nav button {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .room-settings-body {
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

/* Identity is stable across the transcript, room roster, and settings. */
.identity-avatar {
  background: var(--avatar-fill);
  color: var(--avatar-ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.identity-avatar.is-agent {
  background: var(--ink);
  color: var(--avatar-on-dark);
}
.message-header .author-trigger {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;
  cursor: copy;
  padding: 0;
  min-height: 30px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 750;
  text-align: left;
  text-underline-offset: 4px;
}
.message-header .author-trigger:hover .identity-name,
.message-header .author-trigger[aria-expanded="true"] .identity-name { color: var(--accent); text-decoration: underline dotted; }
.author-details {
  position: fixed;
  inset: auto;
  margin: 0;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--strong-line);
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.author-details:popover-open { display: grid; gap: 4px; }
.author-detail-role { display: flex; align-items: center; gap: 6px; font-weight: 650; }
.author-owned-agents { font-weight: 400; }
.author-detail-role .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
.author-details .agent-owner { color: var(--white); font-size: inherit; }
.username-copy { min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: copy; text-decoration: underline dotted; text-underline-offset: 3px; }
.username-copy:hover { color: inherit; background: transparent; text-decoration-style: solid; }
.username-copy:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.mention-copy { display: inline; min-height: 0; border: 0; font: inherit; cursor: copy; }
.mention-copy:hover { color: var(--accent); text-decoration: underline; }

/* A roster agent shares the same two-line rhythm as a person. */
.roster-avatar.is-agent { position: relative; }
.agent-avatar-badge {
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--strong-line);
}
.agent-avatar-badge .ui-icon { width: 12px; height: 12px; }
.roster-person.is-agent .roster-info { flex: 1; }
.roster-person.is-agent .author-identity { flex-wrap: nowrap; align-items: baseline; }
.roster-person.is-agent .identity-name,
.roster-person.is-agent .agent-owner,
.roster-agent-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-person.is-agent .identity-name { flex: 0 1 auto; }
.roster-person.is-agent .agent-owner { flex: 0 1 auto; }
.roster-info > .roster-agent-meta { display: flex; gap: 8px; align-items: center; }
.roster-agent-meta .agent-username { flex: 0 1 auto; }
.roster-agent-meta .agent-activity { flex: 0 1 auto; }
.roster-agent-meta .agent-activity::before { width: 5px; height: 5px; margin-right: 5px; }

.author-identity { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.roster-info > .author-identity,
.member-info > .author-identity { display: flex; }
.agent-owner { font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.message-header .identity-name { font-weight: 750; }
.agent-owner-field { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 6px 12px; margin: 0; font-size: 13px; font-weight: 500; }
.agent-owner-field select { min-height: 44px; margin: 0; padding: 8px; font-size: 16px; width: 100%; max-width: 260px; }
.owner-save-status { display: block; min-height: 18px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.owner-save-status:empty { display: none; }
.agent-owner-field .owner-save-status { grid-column: 2; min-height: 0; margin: 0; }

/* Settings stays a scannable list; each agent opens its own management area. */
#agent-list { border-top: 1px solid var(--line); }
#agent-list > li { border-bottom: 1px solid var(--line); }
.agent-settings-summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 0; color: var(--ink); font-weight: 400; list-style: none; }
.agent-settings-summary::-webkit-details-marker { display: none; }
.agent-settings-summary:hover { background: var(--paper); text-decoration: none; }
.agent-settings-summary:focus-visible { outline-offset: -2px; }
.agent-settings-identity { min-width: 0; }
.agent-settings-identity .author-identity { display: flex; flex-wrap: nowrap; }
.agent-settings-identity .identity-name,
.agent-settings-identity .agent-owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-settings-identity .identity-name { flex: 0 1 auto; font-size: 15px; }
.agent-settings-identity .agent-owner { flex: 0 1 auto; max-width: 55%; }
.agent-settings-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.agent-settings-meta .agent-username { overflow-wrap: anywhere; }
.agent-settings-meta .agent-activity { font-size: inherit; }
.agent-settings-disclosure { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 600; }
.agent-settings-disclosure .ui-icon { width: 14px; height: 14px; }
.agent-settings-row[open] > summary .agent-settings-disclosure .ui-icon { transform: rotate(180deg); }
.agent-access-warning { display: block; margin-top: 3px; font-size: 13px; color: var(--error); }
.agent-management { display: grid; gap: 14px; padding: 4px 0 20px 48px; font-size: 13px; }
.agent-access { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.agent-field-label,
.owner-field-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.agent-management-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.agent-management-actions button { padding-inline: 12px; }
.agent-management-actions > .danger { margin-left: auto; }
.agent-adapter-note { margin: 0; color: var(--muted); font-size: 12px; }
@container (max-width: 380px) {
  .agent-settings-summary { gap: 10px; }
  .agent-settings-disclosure > span { display: none; }
  .agent-management { padding-left: 0; }
}

.author-identity .identity-name { color: var(--ink); }

/* Chat navigation stays with the transcript, including the preview Chat panel. */
.chat-tools { flex-shrink: 0; border-bottom: 1px solid var(--line); padding: 4px 12px; }
.chat-tools > button { margin-left: auto; border-color: transparent; color: var(--muted); min-height: 44px; }
.chat-tools > button:hover { color: var(--ink); background: var(--surface); }
.chat-search { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.chat-search input { flex: 1 1 140px; min-width: 0; width: 0; margin: 0; padding: 8px; min-height: 48px; font-size: 16px; }
.chat-search .icon-button { padding: 8px; border-color: transparent; }
#chat-search-status { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin: 0 4px; }
/* In flow below the transcript, so it never covers message text. */
.chat-latest { flex: 0 0 auto; align-self: flex-end; margin: 8px 20px; min-height: 44px; background: var(--ink); color: var(--white); border-color: var(--ink); }
.chat-latest:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }
#timeline .search-current { outline: 1px solid var(--accent); outline-offset: 8px; }
::highlight(chat-matches) { background-color: var(--soft-accent); color: var(--ink); }
::highlight(chat-current) { background-color: var(--accent); color: var(--white); }
#timeline .search-hit { background: var(--soft-accent); }
.conversation { container-type: inline-size; }
@container (max-width: 440px) {
  .chat-search input { flex-basis: 100%; width: 100%; }
  #chat-search-status { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #timeline { scroll-behavior: auto; }
}

/* Account-owned computers and the compact room connection form. */
#local-agents { padding-bottom: 24px; }
#local-agents > p { margin: 8px 0 0; }
#local-agent-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
#local-agent-form label { margin: 0; min-width: 0; }
#local-agent-form input, #local-agent-form select { width: 100%; min-width: 0; min-height: 50px; margin: 0; }
#local-agent-form button { min-height: 50px; margin: 0; }
#local-agent-status:empty { display: none; }
.agent-connection-modes { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.agent-connection-toggle { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; font-size: 14px; }
#local-agent-manage { margin-left: auto; border-color: transparent; }
input.setting-switch { appearance: none; flex: 0 0 36px; width: 36px; min-height: 22px; height: 22px; margin: 0; padding: 3px; border: 1px solid var(--strong-line); border-radius: 0; background: var(--surface); cursor: pointer; }
input.setting-switch::before { content: ""; display: block; width: 14px; height: 14px; background: var(--muted); transition: transform 160ms var(--ease-out); }
input.setting-switch:checked { background: var(--accent); border-color: var(--accent); }
input.setting-switch:checked::before { background: var(--white); transform: translateX(14px); }
input.setting-switch:disabled { cursor: default; opacity: 0.6; }
@container (max-width: 440px) {
  #local-agent-form { grid-template-columns: minmax(0, 1fr); }
  #local-agent-form button { grid-column: 1 / -1; justify-self: start; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { input.setting-switch::before { transition: none; } }
#account-computers { margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#account-computers h3 { margin: 0; }
#local-pair-status:empty, #local-computers-status:empty { display: none; }
#local-computers { list-style: none; padding: 0; margin: 16px 0 0; }
#local-computers li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; }
#local-computers div { display: grid; gap: 4px; min-width: 0; flex: 1; }
#local-computers strong, #local-computers span { overflow-wrap: anywhere; }
#local-computers span { color: var(--muted); }
#local-computers .device-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
/* Online is a filled green square, offline a hollow grey one, so shape also tells them apart. */
#local-computers .device-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; line-height: 1.4; }
#local-computers .device-status::before { content: ""; flex: none; width: 9px; height: 9px; box-sizing: border-box; border: 2px solid currentColor; }
#local-computers .device-status[data-state="online"] { color: var(--online); }
#local-computers .device-status[data-state="online"]::before { background: currentColor; }
#local-pair-instructions { margin: 16px 0; }
#local-pair-instructions input { max-width: 100%; }
