:root {
  --void: #070707;
  --void-soft: #0d0d0d;
  --surface: #151515;
  --surface-raised: #1d1d1d;
  --surface-hover: #232323;
  --bone: #f2efe5;
  --bone-soft: #c5c2ba;
  --muted: #7d7d78;
  --line: rgba(242, 239, 229, 0.13);
  --line-strong: rgba(242, 239, 229, 0.24);
  --signal: #d7ff57;
  --coral: #ff684d;
  --ice: #80aaff;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --utility: "DIN Alternate", "Avenir Next Condensed", "PingFang SC", sans-serif;
  --rail-width: 56px;
  --composer-width: 700px;
  --entry-ash: #17120f;
  --entry-ember: #b9521e;
  --entry-copper: #e58a48;
  --entry-ivory: #f3ead8;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--bone);
  background: var(--void);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

body.entry-locked {
  height: 100vh;
  overflow: hidden;
}

.beian-link {
  color: inherit;
  text-decoration: none;
}

.beian-link:hover {
  color: var(--bone-soft);
}

.beian-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
}

.beian-icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.beian-mps {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}

.site-beian {
  position: fixed;
  z-index: 90;
  right: 0;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  left: 0;
  display: flex;
  pointer-events: none;
  align-items: center;
  justify-content: center;
}

.site-beian .beian-group,
.site-beian .beian-link {
  pointer-events: auto;
  color: #6a6a64;
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

body.entry-locked .site-beian {
  display: none;
}

button,
textarea,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button:not(:disabled) {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry-gate {
  position: fixed;
  z-index: 300;
  inset: 0;
  min-width: 320px;
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 52%, rgba(84, 34, 13, 0.2), transparent 38%),
    #030303;
  color: var(--entry-ivory);
  cursor: crosshair;
  transition: visibility 0s linear 1s;
}

.entry-gate::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
  content: "";
  mix-blend-mode: soft-light;
  opacity: 0.1;
}

.entry-gate.is-leaving {
  visibility: hidden;
  pointer-events: none;
}

.entry-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04);
  animation: entry-field-arrive 1.6s 0.1s cubic-bezier(0.18, 0.78, 0.18, 1) forwards;
}

.tunnel-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #f2f1ed;
  opacity: 0;
  pointer-events: none;
}

.entry-vignette {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.74), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.72)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.48), transparent 28%, rgba(0, 0, 0, 0.22));
}

.entry-rail {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 62px;
  padding: 22px 0 24px;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(243, 234, 216, 0.12);
  background: rgba(1, 1, 1, 0.36);
  backdrop-filter: blur(6px);
}

.entry-monogram {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(243, 234, 216, 0.45);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 13px;
}

.entry-year,
.entry-vertical,
.entry-header,
.entry-aside,
.entry-footer,
.entry-action-copy {
  font-family: var(--utility);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.entry-year {
  margin-top: 22px;
  color: rgba(243, 234, 216, 0.35);
  font-size: 7px;
  writing-mode: vertical-rl;
}

.entry-rail > i {
  width: 1px;
  height: 72px;
  margin-top: 20px;
  background: linear-gradient(var(--entry-copper), transparent);
}

.entry-vertical {
  margin-top: auto;
  color: rgba(243, 234, 216, 0.48);
  font-size: 7px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.entry-frame {
  position: absolute;
  z-index: 4;
  top: 22px;
  right: 24px;
  bottom: 22px;
  left: 82px;
  border: 1px solid rgba(243, 234, 216, 0.11);
  opacity: 0;
  animation: entry-frame-arrive 900ms 240ms ease forwards;
}

.entry-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 55px;
  padding: 0 21px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(243, 234, 216, 0.11);
  color: rgba(243, 234, 216, 0.43);
  font-size: 7px;
}

.entry-header nav,
.entry-coordinate {
  display: flex;
  gap: clamp(18px, 3vw, 48px);
}

.entry-coordinate b {
  color: rgba(243, 234, 216, 0.62);
  font-weight: 400;
}

.entry-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(215, 255, 87, 0.65);
  animation: entry-pulse 2.2s ease-in-out infinite;
}

.entry-aside {
  position: absolute;
  top: 88px;
  right: 22px;
  width: 155px;
  padding-top: 10px;
  border-top: 1px solid rgba(243, 234, 216, 0.18);
  color: rgba(243, 234, 216, 0.35);
  font-size: 7px;
  line-height: 1.8;
}

.entry-aside p {
  margin: 15px 0 0;
  color: rgba(243, 234, 216, 0.67);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.55;
  text-transform: none;
}

.entry-identity {
  position: absolute;
  right: clamp(35px, 8vw, 130px);
  bottom: clamp(48px, 8vh, 92px);
  left: clamp(38px, 9vw, 150px);
}

.entry-identity > p {
  width: max-content;
  max-width: 100%;
  margin: 0 0 18px 0.8vw;
  color: rgba(243, 234, 216, 0.54);
  font-family: var(--display);
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: 0.16em;
  line-height: 1.7;
}

.entry-title-row {
  display: flex;
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
}

.entry-title-row h1 {
  display: flex;
  margin: 0;
  gap: 0.16em;
  color: rgba(243, 234, 216, 0.9);
  font-family: var(--display);
  font-size: clamp(88px, 15vw, 218px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.72;
  text-shadow: 0 3px 36px rgba(0, 0, 0, 0.45);
}

.entry-title-row h1 span {
  display: block;
  opacity: 0;
  transform: translateY(26px);
  animation: entry-title-arrive 850ms cubic-bezier(0.14, 0.82, 0.16, 1) forwards;
}

.entry-title-row h1 span:first-child { animation-delay: 420ms; }
.entry-title-row h1 span:last-child { animation-delay: 520ms; }

.entry-action {
  display: flex;
  min-width: 165px;
  padding: 10px 0;
  gap: 13px;
  align-items: center;
  background: transparent;
  color: var(--entry-ivory);
  cursor: pointer;
  opacity: 0;
  text-align: left;
  transform: translateX(-12px);
  animation: entry-action-arrive 600ms 850ms ease forwards;
}

.entry-action-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid rgba(243, 234, 216, 0.45);
  border-radius: 50%;
  background: rgba(3, 3, 3, 0.3);
  backdrop-filter: blur(6px);
  transition: background 300ms ease, border-color 300ms ease, transform 300ms ease;
}

.entry-action-mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.2;
  transition: transform 300ms ease;
}

.entry-action-copy strong,
.entry-action-copy small {
  display: block;
}

.entry-action-copy strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.entry-action-copy small {
  margin-top: 5px;
  color: rgba(243, 234, 216, 0.38);
  font-size: 6px;
}

.entry-action:hover .entry-action-mark,
.entry-action:focus-visible .entry-action-mark {
  border-color: var(--entry-copper);
  background: var(--entry-ember);
  transform: scale(1.08);
}

.entry-action:hover .entry-action-mark svg,
.entry-action:focus-visible .entry-action-mark svg {
  transform: translateX(3px);
}

.entry-action:focus-visible {
  outline-color: var(--entry-copper);
}

.entry-footer {
  position: absolute;
  right: 18px;
  bottom: 15px;
  left: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 28px;
  align-items: center;
  color: rgba(243, 234, 216, 0.3);
  font-size: 6px;
}

.entry-footer > span:first-child {
  justify-self: start;
}

.entry-footer .beian-group {
  justify-self: center;
}

.entry-footer > span:last-child {
  justify-self: end;
  text-align: right;
}

.entry-footer .beian-link {
  color: rgba(243, 234, 216, 0.7);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: none;
}

.entry-footer .beian-link:hover {
  color: rgba(243, 234, 216, 0.92);
}

.entry-gate.is-leaving .entry-field {
  animation: entry-field-leave 1s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

.entry-gate.is-leaving .entry-frame,
.entry-gate.is-leaving .entry-rail {
  animation: entry-ui-leave 640ms ease forwards;
}

@keyframes entry-field-arrive {
  to { opacity: 1; transform: scale(1); }
}

@keyframes entry-frame-arrive {
  from { opacity: 0; transform: scale(0.992); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes entry-title-arrive {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes entry-action-arrive {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes entry-pulse {
  50% { opacity: 0.38; box-shadow: 0 0 4px rgba(215, 255, 87, 0.25); }
}

@keyframes entry-field-leave {
  35% { filter: brightness(1.35); opacity: 1; }
  to { filter: brightness(1.7); opacity: 0; transform: scale(1.12); }
}

@keyframes entry-ui-leave {
  to { opacity: 0; transform: translateY(-10px); }
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 68% 34%, black, transparent 73%);
}

.app-rail {
  position: fixed;
  z-index: 80;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--rail-width);
  padding: 14px 0 12px;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--line);
  background: rgba(7, 7, 7, 0.94);
  backdrop-filter: blur(16px);
}

.brand-signal {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  background: transparent;
}

.brand-signal span {
  position: absolute;
  display: block;
  width: 3px;
  border-radius: 99px;
  background: var(--bone);
  transform-origin: 50% 50%;
}

.brand-signal span:nth-child(1) { height: 20px; transform: rotate(0deg); }
.brand-signal span:nth-child(2) { height: 20px; transform: rotate(72deg); }
.brand-signal span:nth-child(3) { height: 20px; transform: rotate(144deg); }
.brand-signal span:nth-child(4) { height: 7px; background: var(--signal); transform: rotate(36deg) translateY(-7px); }
.brand-signal span:nth-child(5) { width: 5px; height: 5px; background: var(--coral); }

.rail-nav {
  display: grid;
  margin: auto 0;
  gap: 12px;
}

.rail-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #74746f;
  transition: color 160ms ease, background 160ms ease;
}

.rail-button:hover,
.rail-button.is-active {
  background: var(--surface);
  color: var(--bone);
}

.rail-button.is-active::before {
  position: absolute;
  left: -9px;
  width: 2px;
  height: 16px;
  border-radius: 0 2px 2px 0;
  background: var(--signal);
  content: "";
}

.rail-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.rail-count,
.rail-indicator {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border: 2px solid var(--void);
  border-radius: 99px;
  background: var(--coral);
  color: white;
  font-family: var(--utility);
  font-size: 8px;
  line-height: 11px;
  text-align: center;
}

.rail-indicator {
  width: 8px;
  min-width: 8px;
  height: 8px;
  padding: 0;
  background: var(--signal);
}

.rail-footer {
  display: grid;
  gap: 11px;
  justify-items: center;
}

.engine-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64645f;
}

.engine-light.is-sources {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 104, 77, 0.1);
}

.engine-light.is-live {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(215, 255, 87, 0.1);
}

.engine-light.is-error {
  background: #74746f;
  box-shadow: 0 0 0 4px rgba(116, 116, 111, 0.12);
}

.rail-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: linear-gradient(145deg, #171717, #0b0b0b);
  color: var(--bone-soft);
  font-family: var(--display);
  font-size: 12px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--rail-width);
  padding-bottom: 190px;
}

.workspace-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 58px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(7, 7, 7, 0.98) 72%, rgba(7, 7, 7, 0));
  backdrop-filter: blur(11px);
}

.route-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.route-title span,
.micro-label,
.header-meta,
.feed-toolbar,
.card-kicker,
.composer-foot,
.portrait-source,
.message-sequence,
.note-date {
  font-family: var(--utility);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-title span {
  color: #565651;
  font-size: 10px;
}

.route-title h1 {
  margin: 0;
  color: var(--bone-soft);
  font-size: 13px;
  font-weight: 500;
}

.header-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  color: #666661;
  font-size: 8px;
}

.header-meta button {
  padding: 5px 0;
  border-bottom: 1px solid #4e4e49;
  background: transparent;
  color: #aaa9a1;
  font-size: 9px;
}

.header-meta .account-trigger {
  display: inline-flex;
  min-height: 34px;
  padding: 6px 12px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(242, 239, 229, 0.04);
  color: var(--bone-soft);
}

.header-meta .account-trigger.is-signed {
  border-color: rgba(215, 255, 87, 0.3);
  background: rgba(215, 255, 87, 0.05);
  color: var(--signal);
}

.header-meta .account-trigger strong {
  font-size: 9px;
  font-weight: 500;
}

.header-meta .api-config-trigger {
  display: inline-flex;
  min-height: 34px;
  padding: 6px 10px;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(255, 104, 77, 0.42);
  border-radius: 99px;
  background: rgba(255, 104, 77, 0.06);
  color: var(--bone-soft);
}

.api-config-trigger i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 10px rgba(255, 104, 77, 0.62);
}

.api-config-trigger strong {
  font-size: 9px;
  font-weight: 500;
}

.api-config-trigger.is-ready {
  border-color: rgba(215, 255, 87, 0.3);
  background: rgba(215, 255, 87, 0.05);
}

.api-config-trigger.is-ready i {
  background: var(--signal);
  box-shadow: 0 0 10px rgba(215, 255, 87, 0.62);
}

.view-panel {
  animation: view-in 340ms cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.63fr) minmax(530px, 1.37fr);
  gap: clamp(20px, 3vw, 52px);
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px clamp(18px, 3vw, 48px) 80px;
}

.community-thesis {
  position: sticky;
  top: 80px;
  display: flex;
  height: calc(100vh - 120px);
  min-height: 560px;
  padding: clamp(24px, 3vw, 48px) 0;
  flex-direction: column;
  align-items: flex-start;
}

.micro-label {
  margin: 0;
  color: #666661;
  font-size: 8px;
  font-weight: 600;
}

.community-thesis h2 {
  margin: clamp(32px, 7vh, 78px) 0 26px;
  font-family: var(--display);
  font-size: clamp(48px, 5.5vw, 88px);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.98;
}

.community-thesis h2 em {
  position: relative;
  color: var(--signal);
  font-style: normal;
}

.community-thesis h2 em::after {
  position: absolute;
  right: -11px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.thesis-copy {
  max-width: 430px;
  margin: 0;
  color: #96958e;
  font-size: 13px;
  line-height: 1.9;
}

.thesis-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 440px);
  margin-top: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.thesis-stats span {
  display: grid;
  min-height: 70px;
  padding: 12px 8px;
  align-content: center;
  border-right: 1px solid var(--line);
  color: #696964;
  font-family: var(--utility);
  font-size: 8px;
  line-height: 1.5;
  text-transform: uppercase;
}

.thesis-stats span:last-child {
  border-right: 0;
}

.thesis-stats strong {
  color: var(--bone);
  font-size: 19px;
  font-weight: 500;
}

.starter-prompts {
  display: flex;
  margin-top: auto;
  gap: 7px;
  flex-wrap: wrap;
}

.starter-prompts button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: #81817c;
  font-size: 9px;
  text-align: left;
  transition: border-color 160ms ease, color 160ms ease;
}

.starter-prompts button:hover {
  border-color: var(--line-strong);
  color: var(--bone);
}

.community-feed-wrap {
  min-width: 0;
}

.feed-toolbar {
  display: flex;
  min-height: 42px;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: #5f5f5a;
  font-size: 8px;
}

.feed-toolbar strong {
  color: var(--bone-soft);
  font-weight: 500;
}

.feed-tabs {
  display: flex;
  gap: 3px;
}

.feed-tabs button,
.note-filters button {
  padding: 6px 9px;
  border-radius: 5px;
  background: transparent;
  color: #6d6d68;
  font-size: 9px;
}

.feed-tabs button:hover,
.feed-tabs button.is-active,
.note-filters button:hover,
.note-filters button.is-active {
  background: var(--surface-raised);
  color: var(--bone);
}

.thinker-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.thinker-card {
  position: relative;
  display: inline-flex;
  width: 100%;
  margin: 0;
  overflow: hidden;
  break-inside: avoid;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color 180ms ease, transform 220ms ease, box-shadow 220ms ease;
  animation: card-arrive 500ms both cubic-bezier(0.16, 0.84, 0.24, 1);
  animation-delay: calc(var(--index) * 45ms);
}

.thinker-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.thinker-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 24px 55px rgba(0, 0, 0, 0.35);
}

.thinker-card[hidden] {
  display: none !important;
}

.card-meta {
  display: flex;
  height: 36px;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: #777771;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #777771;
  font-size: 16px;
}

.card-meta button:hover {
  background: var(--surface-hover);
  color: var(--bone);
}

.card-select {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  text-align: left;
}

.portrait-stage {
  position: relative;
  aspect-ratio: 4 / 4.65;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 37%),
    #101010;
}

.portrait-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 58%, #ffd8a8));
  content: "";
  mix-blend-mode: color;
  opacity: 0;
  transition: opacity 280ms ease;
}

.thinker-card:nth-child(2n) .portrait-stage {
  aspect-ratio: 4 / 3.45;
}

.card-portrait {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to top, rgba(8, 8, 8, 0.92), transparent 45%),
    var(--portrait);
  background-position: center, var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.85) contrast(1.08);
  opacity: 0.9;
  transition: filter 260ms ease, transform 500ms cubic-bezier(0.16, 0.84, 0.24, 1), opacity 260ms ease;
}

.thinker-card:hover .card-portrait {
  filter: grayscale(0.52) contrast(1.06);
  opacity: 1;
  transform: scale(1.018);
}

.thinker-card.is-selected .card-portrait {
  filter: grayscale(0) saturate(1.24) contrast(1.04);
  opacity: 1;
  transform: scale(1.025);
}

.thinker-card.is-selected .portrait-stage::after {
  opacity: 0.42;
}

.portrait-index {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.selection-mark {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(7, 7, 7, 0.44);
  color: transparent;
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.thinker-card.is-selected .selection-mark {
  border-color: var(--accent);
  background: var(--accent);
  color: #080808;
}

.thinker-card.is-selected .card-meta,
.thinker-card.is-selected .card-kicker span:last-child {
  color: var(--accent);
}

.thinker-card.is-selected .card-copy {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%);
}

.card-name {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 12px;
  left: 14px;
}

.card-name h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 43px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.card-name p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.53);
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.card-copy {
  min-height: 128px;
  padding: 17px 15px 15px;
}

.card-kicker {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  color: #65655f;
  font-size: 7px;
}

.card-kicker span:last-child {
  color: var(--accent);
}

.card-copy > p {
  margin: 0;
  color: var(--bone-soft);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.62;
}

.card-keywords {
  display: flex;
  margin-top: 16px;
  gap: 5px;
  flex-wrap: wrap;
}

.card-keywords span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #70706a;
  font-size: 7px;
}

.composer-dock {
  position: fixed;
  z-index: 70;
  bottom: 56px;
  left: calc(var(--rail-width) + (100vw - var(--rail-width)) / 2);
  width: min(var(--composer-width), calc(100vw - var(--rail-width) - 34px));
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(23, 23, 23, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
  transition: opacity 200ms ease, transform 240ms ease;
}

.new-replies-button {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: flex;
  width: min(350px, calc(100% - 12px));
  min-height: 46px;
  padding: 8px 11px;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 104, 77, 0.44);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 104, 77, 0.08), transparent 42%),
    rgba(15, 15, 15, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.44);
  color: var(--bone-soft);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.new-replies-button[hidden] {
  display: none;
}

.new-replies-button > span {
  display: flex;
  min-width: max-content;
  gap: 8px;
  align-items: center;
}

.new-replies-button i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(215, 255, 87, 0.55);
  animation: reading-queue-pulse 1.8s ease-in-out infinite;
}

.new-replies-button strong {
  font-size: 11px;
  font-weight: 500;
}

.new-replies-button small {
  overflow: hidden;
  flex: 1;
  color: #77716b;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-replies-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.new-replies-button:hover,
.new-replies-button:focus-visible {
  border-color: var(--signal);
}

@keyframes reading-queue-pulse {
  50% { opacity: 0.4; transform: scale(0.76); }
}

@media (prefers-reduced-motion: reduce) {
  .new-replies-button i { animation: none; }
}

.composer-dock.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 18px);
}

.composer-dock.is-awaiting-selection {
  width: min(390px, calc(100vw - var(--rail-width) - 34px));
  padding: 5px;
}

.composer-dock.is-awaiting-selection .selection-line {
  min-height: 48px;
  padding: 0;
  border-bottom: 0;
}

.composer-dock.is-awaiting-selection .selection-button {
  width: auto;
  min-width: 0;
  min-height: 48px;
  padding: 7px 10px;
  flex: 1;
}

.composer-dock.is-awaiting-selection form,
.composer-dock.is-awaiting-selection .composer-foot {
  display: none;
}

.composer-dock.is-awaiting-selection .conversation-style {
  flex: 0 0 auto;
  margin-right: 5px;
  border-color: rgba(255, 104, 77, 0.3);
}

.composer-dock.is-awaiting-selection .conversation-style button:not([data-conversation-style="open"]) {
  display: none;
}

.composer-dock.is-awaiting-selection .conversation-style button[data-conversation-style="open"] {
  min-height: 38px;
  padding-inline: 12px;
  background: rgba(255, 104, 77, 0.1);
  color: #df8a77;
}

.selection-line {
  display: flex;
  min-height: 35px;
  padding: 0 2px 8px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.selection-button {
  display: flex;
  min-width: 0;
  padding: 0;
  gap: 9px;
  align-items: center;
  background: transparent;
  text-align: left;
}

.selected-portraits {
  display: flex;
  min-width: 28px;
  padding-left: 2px;
}

.selected-portraits span {
  width: 26px;
  height: 26px;
  margin-left: -7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0) saturate(1.15);
}

.selected-portraits span:first-child {
  margin-left: 0;
}

.selected-portraits .open-floor-array {
  display: grid;
  width: 28px;
  height: 24px;
  margin: 0;
  padding: 3px;
  grid-template-columns: repeat(4, 3px);
  grid-auto-rows: 3px;
  gap: 2px;
  place-content: center;
  border: 1px solid rgba(255, 104, 77, 0.38);
  border-radius: 3px;
  background: rgba(255, 104, 77, 0.04);
  background-image: none;
  filter: none;
}

.open-floor-array i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5f3730;
  box-shadow: 0 0 0 rgba(255, 104, 77, 0);
}

.composer-dock.is-open-floor {
  border-color: rgba(255, 104, 77, 0.34);
}

.is-routing-open-floor .open-floor-array i {
  animation: open-floor-scan 1.1s ease-in-out infinite;
  animation-delay: calc(var(--seat-index, 0) * 55ms);
}

.is-routing-open-floor .open-floor-array i:nth-child(1) { --seat-index: 1; }
.is-routing-open-floor .open-floor-array i:nth-child(2) { --seat-index: 2; }
.is-routing-open-floor .open-floor-array i:nth-child(3) { --seat-index: 3; }
.is-routing-open-floor .open-floor-array i:nth-child(4) { --seat-index: 4; }
.is-routing-open-floor .open-floor-array i:nth-child(5) { --seat-index: 5; }
.is-routing-open-floor .open-floor-array i:nth-child(6) { --seat-index: 6; }
.is-routing-open-floor .open-floor-array i:nth-child(7) { --seat-index: 7; }
.is-routing-open-floor .open-floor-array i:nth-child(8) { --seat-index: 8; }
.is-routing-open-floor .open-floor-array i:nth-child(9) { --seat-index: 9; }
.is-routing-open-floor .open-floor-array i:nth-child(10) { --seat-index: 10; }
.is-routing-open-floor .open-floor-array i:nth-child(11) { --seat-index: 11; }
.is-routing-open-floor .open-floor-array i:nth-child(12) { --seat-index: 12; }
.is-routing-open-floor .open-floor-array i:nth-child(13) { --seat-index: 13; }
.is-routing-open-floor .open-floor-array i:nth-child(14) { --seat-index: 14; }
.is-routing-open-floor .open-floor-array i:nth-child(15) { --seat-index: 15; }
.is-routing-open-floor .open-floor-array i:nth-child(16) { --seat-index: 16; }

@keyframes open-floor-scan {
  0%, 100% {
    background: #5f3730;
    box-shadow: 0 0 0 rgba(255, 104, 77, 0);
  }
  45% {
    background: var(--signal);
    box-shadow: 0 0 7px rgba(255, 104, 77, 0.72);
  }
}

/* User-built figures and salon memory share the existing archival language. */
.import-person-trigger {
  display: inline-flex;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(215, 255, 87, 0.42);
  gap: 8px;
  align-items: center;
  color: var(--signal);
  background: rgba(215, 255, 87, 0.055);
  font: 600 11px/1 var(--utility);
  letter-spacing: 0.08em;
}

.import-person-trigger i {
  font-size: 17px;
  font-style: normal;
  font-weight: 300;
}

.custom-carousel-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(420px, calc(100vw - 90px));
  padding: 34px;
  border: 1px solid rgba(128, 170, 255, 0.2);
  gap: 13px;
  text-align: center;
  background: rgba(8, 11, 18, 0.82);
  transform: translate(-50%, -50%);
}

.custom-carousel-empty span {
  color: var(--ice);
  font: 600 9px/1 var(--utility);
  letter-spacing: 0.17em;
}

.custom-carousel-empty strong {
  font: 400 25px/1.2 var(--display);
}

.custom-carousel-empty button {
  min-height: 40px;
  margin-top: 6px;
  color: #0b0e08;
  background: var(--signal);
  font: 600 11px/1 var(--utility);
}

.person-import-dialog {
  width: min(1080px, calc(100vw - 32px));
  max-width: none;
  overflow: hidden;
}

.person-import-shell {
  width: 100%;
  max-height: min(880px, calc(100vh - 32px));
  padding: 54px 54px 36px;
  overflow: auto;
  border: 1px solid rgba(128, 170, 255, 0.24);
  background:
    linear-gradient(90deg, rgba(128, 170, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(128, 170, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 82% 7%, rgba(66, 117, 225, 0.17), transparent 26%),
    #080b12;
  background-size: 38px 38px, 38px 38px, auto, auto;
}

.person-import-shell::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25px;
  width: 1px;
  background: linear-gradient(transparent, rgba(128, 170, 255, 0.42) 12%, rgba(128, 170, 255, 0.16) 88%, transparent);
  content: "";
}

.import-head {
  display: grid;
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.62fr);
  gap: 48px;
  align-items: end;
}

.import-head h2 {
  max-width: 720px;
  margin: 5px 0 0;
  color: #f6f8ff;
  font: 400 clamp(48px, 6vw, 82px)/0.88 var(--display);
  letter-spacing: -0.065em;
}

.import-head > p {
  margin: 0;
  color: #a6adbd;
  font-size: 14px;
  line-height: 1.85;
}

.person-import-form {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 42px;
}

.person-import-form section {
  min-width: 0;
}

.import-section-label {
  color: var(--ice);
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.18em;
}

.person-import-form h3 {
  margin: 9px 0 23px;
  color: var(--bone);
  font: 400 29px/1.05 var(--display);
}

.source-research {
  position: relative;
  margin: 0 0 26px;
  padding: 18px 0;
  border-top: 1px solid rgba(128, 170, 255, 0.24);
  border-bottom: 1px solid rgba(128, 170, 255, 0.12);
}

.source-research-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.source-research-head strong {
  display: block;
  color: #edf3ff;
  font: 500 17px/1.25 var(--display);
}

.source-research-head p {
  max-width: 570px;
  margin: 7px 0 0;
  color: #8d98ad;
  font-size: 11px;
  line-height: 1.75;
}

.source-research-head button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid rgba(128, 170, 255, 0.48);
  gap: 10px;
  align-items: center;
  color: #e8f0ff;
  background: rgba(73, 112, 192, 0.1);
  font: 600 11px/1 var(--utility);
  letter-spacing: 0.05em;
}

.source-research-head button:hover:not(:disabled) {
  border-color: var(--signal);
  color: var(--signal);
  background: rgba(215, 255, 87, 0.055);
}

.source-research-head button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.source-research-head svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.source-research-scope {
  display: flex;
  margin-top: 15px;
  color: #68758d;
  font: 600 9px/1.4 var(--utility);
  letter-spacing: 0.08em;
  flex-wrap: wrap;
}

.source-research-scope span {
  margin-right: 10px;
  padding-right: 10px;
  border-right: 1px solid rgba(128, 170, 255, 0.18);
}

.source-research-scope span:last-child {
  margin-right: 0;
  padding-right: 0;
  border-right: 0;
}

.source-research-status {
  position: relative;
  margin-top: 16px;
  padding: 12px 14px 12px 35px;
  overflow: hidden;
  color: #a8b5cc;
  background: rgba(128, 170, 255, 0.06);
  font-size: 11px;
  line-height: 1.65;
}

.source-research-status::before {
  position: absolute;
  top: 17px;
  left: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ice);
  content: "";
}

.source-research-status.is-working::after {
  position: absolute;
  right: 100%;
  bottom: 0;
  width: 38%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ice));
  content: "";
  animation: research-scan 1.7s linear infinite;
}

.source-research-status.is-success {
  color: #cfe49a;
  background: rgba(215, 255, 87, 0.045);
}

.source-research-status.is-success::before { background: var(--signal); }

.source-research-status.is-error {
  color: #eaa395;
  background: rgba(255, 104, 77, 0.055);
}

.source-research-status.is-error::before { background: var(--coral); }

.source-research-results {
  margin-top: 18px;
  border-top: 1px solid rgba(128, 170, 255, 0.12);
}

.research-result-summary {
  display: flex;
  min-height: 48px;
  gap: 14px;
  align-items: center;
  color: #77849a;
  font-size: 10px;
  justify-content: space-between;
}

.research-result-summary strong { color: var(--signal); }

.research-result-summary button {
  padding: 6px 0;
  color: #91a1bc;
  background: transparent;
  font: 600 9px/1 var(--utility);
  letter-spacing: 0.07em;
}

.research-source-row {
  display: grid;
  padding: 15px 0;
  border-top: 1px solid rgba(128, 170, 255, 0.1);
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  transition: opacity 180ms ease;
}

.research-source-row.is-muted { opacity: 0.42; }

.research-source-row > label {
  display: flex;
  margin: 0;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
}

.research-source-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  border: 1px solid rgba(128, 170, 255, 0.35);
  accent-color: var(--signal);
}

.research-source-row label span { min-width: 0; }

.research-source-row small,
.research-source-row strong,
.research-source-row em {
  display: block;
}

.research-source-row small {
  color: #69758a;
  font: 600 8px/1.35 var(--utility);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-source-row strong {
  margin-top: 5px;
  color: #dce6f8;
  font-size: 12px;
  line-height: 1.45;
}

.research-source-row em {
  margin-top: 5px;
  color: #73815e;
  font-size: 9px;
  font-style: normal;
}

.research-source-row > a {
  padding-top: 2px;
  color: var(--ice);
  font: 600 9px/1.4 var(--utility);
  text-decoration: none;
  white-space: nowrap;
}

.research-source-row details {
  grid-column: 1 / -1;
  padding-left: 27px;
}

.research-source-row summary {
  color: #69758a;
  cursor: pointer;
  font-size: 10px;
}

.research-source-row details p {
  max-height: 260px;
  margin: 11px 0 0;
  padding: 13px 14px;
  overflow: auto;
  color: #aeb8ca;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

@keyframes research-scan {
  to { right: -38%; }
}

.person-import-form label {
  display: grid;
  margin-bottom: 16px;
  gap: 8px;
}

.person-import-form label > span {
  color: #8f97a8;
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.person-import-form input,
.person-import-form textarea,
.person-import-form select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(192, 211, 255, 0.22);
  border-radius: 0;
  color: #eef3ff;
  background: rgba(255, 255, 255, 0.025);
}

.person-import-form input,
.person-import-form select {
  height: 46px;
  padding: 0 12px;
}

.person-import-form textarea {
  padding: 13px 12px;
  line-height: 1.7;
  resize: vertical;
}

.person-import-form input::placeholder,
.person-import-form textarea::placeholder {
  color: #555d6d;
}

.import-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.portrait-drop {
  margin-top: 25px;
  padding: 18px;
  border: 1px dashed rgba(128, 170, 255, 0.25);
  background: rgba(128, 170, 255, 0.035);
}

.portrait-drop input {
  height: auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.portrait-drop small {
  color: #626b7d;
  line-height: 1.55;
}

.voice-proof {
  display: flex;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 104, 77, 0.22);
  gap: 12px;
  align-items: center;
  background: rgba(255, 104, 77, 0.04);
}

.voice-proof > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 16px rgba(255, 104, 77, 0.7);
}

.voice-proof > span {
  display: grid;
  gap: 3px;
}

.voice-proof strong {
  color: #efede7;
  font-size: 12px;
}

.voice-proof small {
  color: #747b8b;
  font-size: 11px;
}

.voice-proof.is-ready {
  border-color: rgba(215, 255, 87, 0.3);
  background: rgba(215, 255, 87, 0.045);
}

.voice-proof.is-ready > i {
  background: var(--signal);
  box-shadow: 0 0 18px rgba(215, 255, 87, 0.7);
}

.import-actions {
  display: flex;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  gap: 12px;
  justify-content: flex-end;
}

.import-actions button {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  color: var(--bone-soft);
  background: transparent;
  font: 600 11px/1 var(--utility);
  letter-spacing: 0.08em;
}

.import-actions .import-build-button {
  border-color: var(--signal);
  color: #080a05;
  background: var(--signal);
}

.import-actions .import-build-button:disabled {
  border-color: var(--line);
  color: #60645d;
  background: #1a1c18;
}

.imported-roster {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.imported-roster > span {
  color: #747b8b;
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.14em;
}

#importedRosterList {
  display: flex;
  margin-top: 13px;
  gap: 8px;
  flex-wrap: wrap;
}

.imported-person-pill {
  display: inline-flex;
  padding: 7px 9px 7px 12px;
  border: 1px solid var(--line);
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
}

.imported-person-pill button {
  width: 24px;
  height: 24px;
  color: #777e8d;
  background: transparent;
}

.persona-import-transition {
  position: fixed;
  z-index: 700;
  inset: 0;
  overflow: hidden;
  color: #eef5ff;
  background: #01030a;
  opacity: 0;
  transition: opacity 260ms ease;
}

.persona-import-transition.is-active {
  opacity: 1;
}

.persona-import-transition.is-complete {
  opacity: 0;
  transition-duration: 520ms;
}

.persona-import-transition.is-error .import-transition-copy p,
.persona-import-transition.is-error .import-transition-copy h2 {
  color: #ff8d7a;
  text-shadow: 0 9px 34px rgba(255, 83, 61, 0.3);
}

.persona-import-transition.is-error > header,
.persona-import-transition.is-error > footer {
  color: rgba(255, 157, 140, 0.7);
}

.persona-import-transition canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.persona-import-transition::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 50% 46%, transparent 0 18%, rgba(0, 3, 12, 0.2) 55%, rgba(0, 2, 8, 0.8) 100%);
  background-size: 100% 5px, auto;
  content: "";
  mix-blend-mode: screen;
  opacity: 0.35;
}

.persona-import-transition > header,
.persona-import-transition > footer {
  position: absolute;
  z-index: 2;
  right: 34px;
  left: 34px;
  display: flex;
  color: rgba(217, 231, 255, 0.58);
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.18em;
  justify-content: space-between;
}

.persona-import-transition > header { top: 28px; }
.persona-import-transition > footer { bottom: 25px; }

.import-transition-frame {
  position: absolute;
  z-index: 2;
  inset: 18px;
  border: 1px solid rgba(177, 205, 255, 0.08);
  pointer-events: none;
}

.import-transition-frame i {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(214, 232, 255, 0.42);
  border-style: solid;
}

.import-transition-frame i:nth-child(1) { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.import-transition-frame i:nth-child(2) { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.import-transition-frame i:nth-child(3) { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
.import-transition-frame i:nth-child(4) { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }

.import-transition-copy {
  position: absolute;
  z-index: 3;
  top: 69%;
  left: 50%;
  width: min(620px, calc(100vw - 52px));
  text-align: center;
  transform: translate(-50%, -50%);
}

.import-transition-copy p {
  margin: 0 0 12px;
  color: rgba(229, 239, 255, 0.78);
  font: 500 14px/1 var(--body);
  letter-spacing: 0.2em;
}

.import-transition-copy h2 {
  margin: 0;
  text-shadow: 0 0 26px rgba(118, 172, 255, 0.48);
  font: 400 clamp(36px, 6vw, 72px)/1 var(--display);
  letter-spacing: 0.08em;
}

.import-transition-copy > span {
  display: block;
  margin-top: 12px;
  color: rgba(166, 198, 247, 0.42);
  font: 600 9px/1 var(--utility);
  letter-spacing: 0.32em;
}

body.is-importing-person {
  height: 100vh;
  overflow: hidden;
}

.history-view {
  padding: 104px clamp(24px, 6vw, 88px) 90px;
}

.history-heading {
  display: flex;
  max-width: 1120px;
  margin: 0 auto 34px;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
}

.history-heading h2 {
  margin: 5px 0 10px;
  font: 400 clamp(46px, 7vw, 92px)/0.9 var(--display);
  letter-spacing: -0.055em;
}

.history-heading p:not(.micro-label) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.history-search {
  position: relative;
  display: grid;
  max-width: 1120px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line-strong);
  grid-template-columns: 240px 1fr 24px;
  gap: 18px;
  align-items: center;
}

.history-search span {
  color: #72736e;
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.11em;
}

.history-search input {
  height: 62px;
  border: 0;
  outline: 0;
  color: var(--bone);
  background: transparent;
  font: 400 18px/1 var(--body);
}

.history-search i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.history-search i::after {
  display: block;
  width: 6px;
  height: 1px;
  margin: 11px 0 0 10px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.history-meta {
  display: flex;
  max-width: 1120px;
  margin: 14px auto 28px;
  color: #777873;
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.12em;
  justify-content: space-between;
}

.history-meta button {
  color: #777873;
  background: transparent;
  font-size: 11px;
}

.history-grid {
  display: grid;
  max-width: 1120px;
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.history-card {
  position: relative;
  min-height: 230px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 62%);
}

.history-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 38%;
  height: 1px;
  background: var(--accent, var(--ice));
  content: "";
}

.history-card > header,
.history-card > footer {
  display: flex;
  color: #73756f;
  font: 600 9px/1 var(--utility);
  letter-spacing: 0.13em;
  justify-content: space-between;
}

.history-card h3 {
  margin: 30px 0 12px;
  font: 400 25px/1.25 var(--display);
}

.history-card p {
  display: -webkit-box;
  margin: 0 0 24px;
  overflow: hidden;
  color: #9e9f99;
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.history-card > footer {
  position: absolute;
  display: flex;
  right: 24px;
  bottom: 20px;
  left: 24px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.history-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}

.history-card button,
.history-card .history-open {
  color: var(--bone-soft);
  background: transparent;
  font: 600 10px/1 var(--utility);
}

.history-empty {
  max-width: 1120px;
  margin: 80px auto 0;
  text-align: center;
  color: #777873;
}

.history-empty > span {
  color: var(--ice);
  font-size: 62px;
}

.history-empty h3 {
  margin: 12px 0 8px;
  color: var(--bone);
  font: 400 27px/1 var(--display);
}

.history-empty p {
  margin: 0;
}

.history-dialog-shell {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 52px;
  overflow: auto;
}

.history-dialog-shell h2 {
  max-width: 720px;
  margin: 8px 0 16px;
  font: 400 clamp(34px, 6vw, 62px)/1.05 var(--display);
}

.history-dialog-meta {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
}

.history-transcript article {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.history-transcript strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ice);
  font: 600 10px/1 var(--utility);
  letter-spacing: 0.1em;
}

.history-transcript p {
  margin: 0;
  color: var(--bone-soft);
  line-height: 1.75;
  white-space: pre-wrap;
}

.history-dialog-actions {
  position: sticky;
  bottom: -1px;
  padding: 18px 0 2px;
  background: linear-gradient(180deg, transparent, rgba(9, 9, 9, 0.96) 28%);
}

@media (max-width: 900px) {
  .person-import-shell { padding: 50px 26px 28px; }
  .import-head { grid-template-columns: 1fr; gap: 18px; }
  .person-import-form { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .history-search { grid-template-columns: 1fr 24px; }
  .history-search span { grid-column: 1 / -1; padding-top: 16px; }
}

@media (max-width: 620px) {
  .import-person-trigger { min-width: 44px; padding: 0 11px; }
  .import-person-trigger span { display: none; }
  .import-field-grid { grid-template-columns: 1fr; gap: 0; }
  .source-research-head { grid-template-columns: 1fr; gap: 14px; }
  .source-research-head button { width: 100%; justify-content: center; }
  .source-research-scope { gap: 7px 0; }
  .research-result-summary { align-items: flex-start; flex-direction: column; gap: 6px; padding: 12px 0; }
  .research-source-row { grid-template-columns: 1fr; }
  .research-source-row > a { padding-left: 27px; }
  .import-actions { align-items: stretch; flex-direction: column; }
  .import-head h2 { font-size: 47px; }
  .persona-import-transition > header,
  .persona-import-transition > footer { right: 18px; left: 18px; }
  .persona-import-transition > footer { gap: 10px; flex-direction: column; }
  .import-transition-frame { inset: 9px; }
  .import-transition-copy { top: 72%; }
  .history-view { padding: 84px 16px 140px; }
  .history-heading { align-items: stretch; flex-direction: column; }
  .history-dialog-shell { padding: 48px 20px 28px; }
}

.selection-button strong,
.selection-button small {
  display: block;
}

.selection-button strong {
  color: var(--bone-soft);
  font-size: 12px;
  font-weight: 500;
}

.selection-button small {
  margin-top: 2px;
  color: #64645f;
  font-size: 10px;
}

.conversation-style {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.conversation-style button {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 5px;
  background: transparent;
  color: #65655f;
  font-size: 11px;
}

.conversation-style button.is-active {
  background: #32322f;
  color: var(--bone);
}

.composer-stop-discussion {
  display: none;
  min-height: 40px;
  padding: 5px 11px;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(255, 104, 77, 0.58);
  border-radius: 6px;
  background: rgba(255, 104, 77, 0.09);
  color: #eda28f;
  text-align: left;
}

.composer-dock.is-discussing .conversation-style {
  display: none;
}

.composer-dock.is-discussing .composer-stop-discussion {
  display: inline-flex;
}

.composer-stop-discussion > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 0 12px rgba(255, 104, 77, 0.38);
}

.composer-stop-discussion strong,
.composer-stop-discussion small {
  display: block;
}

.composer-stop-discussion strong {
  font-size: 11px;
  font-weight: 500;
}

.composer-stop-discussion small {
  margin-top: 2px;
  color: #83635a;
  font-size: 8px;
}

.composer-stop-discussion:disabled {
  opacity: 0.58;
}

@media (prefers-reduced-motion: reduce) {
  .is-routing-open-floor .open-floor-array i {
    animation: none;
    background: var(--signal);
  }
}

.composer-dock form {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 8px;
  padding-top: 8px;
}

.composer-dock textarea {
  width: 100%;
  min-height: 60px;
  max-height: 160px;
  padding: 10px 9px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--bone);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.55;
}

.composer-dock textarea::placeholder {
  color: #64645f;
}

.send-button {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 7px;
  place-items: end;
  align-self: end;
  border-radius: 9px;
  background: var(--bone);
  color: var(--void);
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}

.send-button:hover:not(:disabled) {
  background: var(--signal);
  transform: translateY(-1px);
}

.send-button:disabled {
  opacity: 0.28;
}

.send-button span {
  width: 100%;
  font-size: 7px;
  line-height: 1.1;
}

.send-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.composer-foot {
  display: flex;
  padding: 7px 3px 1px;
  align-items: center;
  justify-content: space-between;
  color: #555550;
  font-size: 10px;
}

.chat-shell {
  width: min(1050px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.chat-header {
  display: flex;
  min-height: 115px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.chat-header h2,
.notes-heading h2,
.dialog-shell > h2 {
  margin: 12px 0 20px;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.chat-actions {
  display: flex;
  margin-bottom: 20px;
  gap: 8px;
}

.chat-actions button,
.primary-outline,
.notes-empty button,
.chat-empty button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: #898983;
  font-size: 9px;
}

.chat-actions button:hover:not(:disabled),
.primary-outline:hover:not(:disabled),
.notes-empty button:hover,
.chat-empty button:hover {
  border-color: var(--line-strong);
  color: var(--bone);
}

.chat-actions #openThreadMap.has-open-branches:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent, #d86c45) 42%, var(--line));
  color: var(--bone-soft);
}

.chat-actions #openThreadMap.has-open-branches:not(:disabled)::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent, #d86c45);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, #d86c45) 62%, transparent);
  content: "";
  vertical-align: 1px;
}

.chat-actions button:disabled,
.primary-outline:disabled {
  opacity: 0.3;
}

.chat-participants {
  display: flex;
  min-height: 58px;
  padding: 10px 0;
  gap: 17px;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.chat-person {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.chat-person span {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.42);
}

.chat-person strong,
.chat-person small {
  display: block;
}

.chat-person strong {
  color: var(--bone-soft);
  font-size: 9px;
  font-weight: 500;
}

.chat-person small {
  margin-top: 2px;
  color: #62625d;
  font-family: var(--utility);
  font-size: 7px;
}

.conversation-stream {
  min-height: 55vh;
}

.chat-empty {
  display: grid;
  min-height: 480px;
  place-items: center;
  align-content: center;
  color: #70706a;
  text-align: center;
}

.chat-empty p {
  margin: 20px 0 15px;
  font-family: var(--display);
  font-size: 18px;
}

.empty-orbit {
  position: relative;
  width: 95px;
  height: 50px;
}

.empty-orbit span {
  position: absolute;
  top: 0;
  width: 48px;
  height: 48px;
  border: 1px solid #474743;
  border-radius: 50%;
}

.empty-orbit span:nth-child(2) { left: 23px; border-color: #6e5b55; }
.empty-orbit span:nth-child(3) { left: 46px; border-color: #5f6841; }

.message-list {
  counter-reset: message;
}

.message {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 50px);
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  animation: message-in 360ms ease both;
}

.message::before {
  counter-increment: message;
  content: counter(message, decimal-leading-zero);
  position: absolute;
  top: 16px;
  right: 0;
  color: #3f3f3b;
  font-family: var(--utility);
  font-size: 8px;
}

.message.is-user,
.message.is-topic {
  grid-template-columns: 150px minmax(0, 1fr);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.018), transparent);
}

.message-profile {
  align-self: start;
}

.message-avatar {
  width: 58px;
  height: 68px;
  margin-bottom: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 29px 29px 5px 5px;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.45) contrast(1.06);
}

.message-profile strong,
.message-profile small {
  display: block;
}

.message-profile strong {
  color: var(--bone-soft);
  font-size: 10px;
  font-weight: 500;
}

.message-profile small {
  margin-top: 3px;
  color: #595954;
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.message-content > p {
  max-width: 760px;
  margin: 0;
  color: #d6d2c9;
  font-family: var(--display);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.9;
  white-space: pre-wrap;
}

.reply-link {
  display: inline-flex;
  margin-bottom: 11px;
  padding: 4px 7px;
  align-items: center;
  border-left: 1px solid var(--coral);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: #a7685b;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.reply-link:hover,
.reply-link:focus-visible {
  color: var(--signal);
}

.reply-link:focus-visible {
  outline: 1px solid var(--signal);
  outline-offset: 3px;
}

.reply-link svg {
  width: 12px;
  height: 12px;
  margin-left: 6px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reply-link small {
  max-width: min(34ch, 42vw);
  margin-left: 7px;
  overflow: hidden;
  color: #77736d;
  font-family: var(--body);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-link:hover small,
.reply-link:focus-visible small {
  color: #aaa39a;
}

.topic-branch {
  display: inline-flex;
  margin-bottom: 11px;
  gap: 7px;
  align-items: center;
  color: #85827a;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.topic-branch > span {
  width: 13px;
  height: 1px;
  background: rgba(231, 225, 213, 0.28);
}

.reasoning-trace {
  margin-top: 20px;
  border-top: 1px solid rgba(231, 225, 213, 0.11);
  border-bottom: 1px solid rgba(231, 225, 213, 0.07);
}

.method-status-note {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin: 0.8rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: rgb(255 255 255 / 52%);
  font-size: 0.72rem;
  line-height: 1.45;
}

.method-status-note strong {
  flex: none;
  color: rgb(255 255 255 / 72%);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.reasoning-trace summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 12px;
  min-height: 44px;
  gap: 11px;
  align-items: center;
  color: #aaa79f;
  cursor: pointer;
  list-style: none;
}

.reasoning-trace summary::-webkit-details-marker {
  display: none;
}

.reasoning-trace summary::after {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(var(--coral), var(--coral)) center / 10px 1px no-repeat,
    linear-gradient(var(--coral), var(--coral)) center / 1px 10px no-repeat;
  content: "";
}

.reasoning-trace[open] summary::after {
  background: linear-gradient(var(--coral), var(--coral)) center / 10px 1px no-repeat;
}

.reasoning-trace summary > span {
  color: #c7c2b8;
  font-size: 10px;
  font-weight: 600;
}

.reasoning-trace summary > small {
  overflow: hidden;
  color: #77756f;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reasoning-steps {
  display: grid;
  margin: 0;
  padding: 2px 0 16px;
  gap: 0;
  list-style: none;
}

.reasoning-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  margin: 0;
  padding: 5px 0 8px;
  gap: 14px;
}

.reasoning-steps li::before {
  position: absolute;
  top: 11px;
  left: 55px;
  width: 5px;
  height: 5px;
  border: 1px solid #67635c;
  border-radius: 50%;
  background: #151514;
  content: "";
}

.reasoning-steps li:not(:last-child)::after {
  position: absolute;
  top: 17px;
  bottom: -6px;
  left: 57px;
  width: 1px;
  background: rgba(231, 225, 213, 0.11);
  content: "";
}

.reasoning-steps p {
  margin: 0;
  color: #aaa79f;
  font-size: 11px;
  line-height: 1.65;
}

.reasoning-steps li > span {
  color: #6f6d67;
  font-family: var(--utility);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.reasoning-steps li.is-arrival p {
  color: #d8d2c7;
}

.reasoning-steps li.is-arrival > span {
  color: var(--coral);
}

.reasoning-steps li.is-arrival::before {
  border-color: var(--coral);
  background: var(--coral);
}

.message.is-referenced .message-content {
  animation: referenced-turn 1.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes referenced-turn {
  0%, 100% { background: transparent; }
  22% { background: rgba(215, 255, 87, 0.07); }
}

.learning-chip {
  display: table;
  margin: 0 0 12px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--coral)) 52%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent, var(--coral)) 72%, var(--bone));
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.message.is-learning-question .message-content {
  padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--accent, var(--coral)) 36%, transparent);
}

.message.is-user .message-profile,
.message.is-topic .message-profile {
  color: #6c6c67;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message.is-user .message-content > p,
.message.is-topic .message-content > p {
  color: var(--bone);
  font-size: clamp(22px, 3vw, 35px);
  line-height: 1.45;
}

.message.is-topic .message-content > p::before {
  color: var(--coral);
  content: "“";
}

.message.is-topic .message-content > p::after {
  color: var(--coral);
  content: "”";
}

.message-tools {
  display: flex;
  margin-top: 21px;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.source-chip,
.ai-chip {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #aaa79f;
  font-size: 10px;
}

.engine-notice {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(18px, 4vw, 50px);
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 104, 77, 0.25);
  color: #8d8c85;
}

.engine-notice > button {
  grid-column: 2;
  min-height: 40px;
  padding: 8px 13px;
  align-self: center;
  border: 1px solid rgba(255, 104, 77, 0.48);
  border-radius: 5px;
  background: transparent;
  color: #f0b29f;
  font-size: 12px;
  white-space: nowrap;
}

.engine-notice > button:hover,
.engine-notice > button:focus-visible {
  border-color: var(--coral);
  color: #fff;
}

.picker-search {
  display: grid;
  margin: 24px 0 14px;
  gap: 7px;
  color: #85857f;
  font-family: var(--utility);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.picker-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  background: #111;
  color: var(--bone);
  font-family: var(--body);
  font-size: 15px;
}

.picker-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 12px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 17px;
  text-align: center;
}

.session-restore {
  position: fixed;
  z-index: 94;
  top: 72px;
  right: 18px;
  display: flex;
  max-width: min(520px, calc(100vw - var(--rail-width) - 36px));
  min-height: 62px;
  padding: 10px 11px 10px 15px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(242, 239, 229, 0.25);
  border-radius: 9px;
  background: rgba(242, 239, 229, 0.96);
  color: #10100f;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

/* The gallery filter row is the primary way into field filters and persona
   import.  A restored-session decision may float over the cards, but never
   over those controls. */
.is-gallery-view .session-restore {
  top: 138px;
}

.api-onboarding {
  position: fixed;
  z-index: 74;
  top: 70px;
  right: 18px;
  display: flex;
  width: min(620px, calc(100vw - var(--rail-width) - 36px));
  min-height: 68px;
  padding: 11px 12px 11px 16px;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 104, 77, 0.35);
  border-left: 3px solid var(--coral);
  border-radius: 8px;
  background: rgba(12, 12, 12, 0.94);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.api-onboarding[hidden] {
  display: none;
}

.api-onboarding > span,
.api-onboarding > span strong,
.api-onboarding > span small {
  display: block;
}

.api-onboarding > span strong {
  color: var(--bone-soft);
  font-size: 12px;
  font-weight: 500;
}

.api-onboarding > span small {
  margin-top: 5px;
  color: #777771;
  font-size: 9px;
  line-height: 1.55;
}

.api-onboarding > button {
  min-width: 126px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 5px;
  background: var(--bone);
  color: var(--void);
  font-size: 9px;
}

.api-onboarding > button:hover {
  background: var(--signal);
}

.session-restore > span strong,
.session-restore > span small {
  display: block;
}

.session-restore > span strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
}

.session-restore > span small {
  margin-top: 3px;
  color: #5b5b56;
  font-size: 10px;
}

.session-restore > div {
  display: flex;
  gap: 6px;
}

.session-restore button {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid rgba(16, 16, 15, 0.2);
  border-radius: 5px;
  background: transparent;
  color: #10100f;
  font-size: 11px;
}

.session-restore button:first-child {
  background: #10100f;
  color: var(--bone);
}

.engine-notice > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.engine-notice > p {
  max-width: 740px;
  margin: 0;
  font-size: 10px;
  line-height: 1.7;
}

.message.is-source .message-avatar {
  filter: grayscale(0.1) contrast(1.04);
}

.source-result-heading {
  max-width: 760px;
  padding-left: 15px;
  border-left: 2px solid var(--coral);
}

.source-result-heading > span,
.source-result-heading > strong {
  display: block;
}

.source-result-heading > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.source-result-heading > strong {
  margin-top: 7px;
  color: var(--bone-soft);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}

.source-result-heading > p {
  margin: 7px 0 0;
  color: #73736d;
  font-size: 10px;
  line-height: 1.65;
}

.evidence-stack {
  max-width: 860px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.evidence-card {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.016), transparent 72%);
}

.evidence-card summary {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  min-height: 48px;
  padding: 11px 10px 11px 0;
  gap: 12px;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.evidence-card summary::-webkit-details-marker {
  display: none;
}

.evidence-card summary::after {
  content: "+";
  grid-column: 3;
  grid-row: 1;
  color: #777770;
  font-size: 14px;
}

.evidence-card[open] summary::after {
  content: "−";
  color: var(--coral);
}

.evidence-card summary > span {
  color: #6f4d47;
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.evidence-card summary > strong {
  overflow: hidden;
  color: #9b9a93;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-card summary > small {
  grid-column: 3;
  grid-row: 1;
  margin-right: 25px;
  color: #53534f;
  font-family: var(--utility);
  font-size: 7px;
}

.evidence-card blockquote {
  max-width: 760px;
  margin: 3px 0 16px 90px;
  padding: 0 18px 0 0;
  color: #aaa8a0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.75;
}

.evidence-card > a {
  display: inline-block;
  margin: 0 0 17px 90px;
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.evidence-card > a:hover {
  text-decoration: underline;
}

.evidence-empty {
  margin: 20px 0 0 !important;
  color: #656560 !important;
  font-family: var(--body) !important;
  font-size: 10px !important;
}

.ai-chip {
  border-color: rgba(255, 104, 77, 0.28);
  color: #af6758;
}

.save-note-button {
  display: inline-flex;
  margin-left: auto;
  padding: 7px 9px;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: #9a9991;
  font-size: 8px;
}

.save-note-button:hover,
.save-note-button.is-saved {
  border-color: var(--signal);
  background: rgba(215, 255, 87, 0.08);
  color: var(--signal);
}

.save-note-button svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
}

.discussion-summary {
  margin: 25px 0;
  padding: 22px;
  border: 1px dashed #4a4a45;
  border-radius: 9px;
  background: rgba(215, 255, 87, 0.035);
}

.round-marker {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  padding: 17px 0;
  gap: clamp(18px, 4vw, 50px);
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: #676762;
}

.round-marker > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.round-marker > p {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.conversation-relay {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  min-height: 112px;
  padding: 22px 0;
  gap: clamp(18px, 4vw, 50px);
  align-items: center;
  border-top: 1px solid rgba(255, 104, 77, 0.22);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 104, 77, 0.035), transparent 58%);
}

.conversation-relay[hidden] {
  display: none;
}

.conversation-relay.is-running {
  border-top-color: rgba(215, 255, 87, 0.28);
  background: linear-gradient(90deg, rgba(215, 255, 87, 0.035), transparent 58%);
}

.conversation-relay.is-running > button {
  border-color: rgba(255, 104, 77, 0.68);
  background: rgba(255, 104, 77, 0.1);
  color: #f0a28e;
}

.conversation-relay.is-stopping {
  opacity: 0.68;
}

.relay-track {
  position: relative;
  display: flex;
  min-height: 34px;
  padding-right: 22px;
  align-items: center;
}

.relay-track::after {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 9px;
  height: 1px;
  background: linear-gradient(90deg, var(--coral), rgba(255, 104, 77, 0.12));
  content: "";
}

.relay-track > span {
  z-index: 1;
  width: 31px;
  height: 36px;
  margin-left: -7px;
  border: 1px solid #4c423e;
  border-radius: 16px 16px 4px 4px;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.28) contrast(1.05);
}

.relay-track > span:first-child {
  margin-left: 0;
}

.relay-track > i {
  position: absolute;
  z-index: 2;
  right: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px rgba(215, 255, 87, 0.55);
  animation: relay-breathe 1.8s ease-in-out infinite;
}

.relay-copy > span,
.relay-copy > strong,
.relay-copy > small {
  display: block;
}

.relay-copy > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.relay-copy > strong {
  margin-top: 7px;
  color: var(--bone-soft);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}

.relay-copy > small {
  max-width: 620px;
  margin-top: 6px;
  color: #73736d;
  font-size: 9px;
  line-height: 1.65;
}

.conversation-relay > button {
  display: inline-flex;
  min-height: 44px;
  padding: 0 13px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 104, 77, 0.42);
  border-radius: 5px;
  background: rgba(255, 104, 77, 0.045);
  color: #dda08f;
  font-size: 10px;
  white-space: nowrap;
}

.conversation-relay > button:hover,
.conversation-relay > button:focus-visible {
  border-color: var(--signal);
  color: var(--signal);
}

.conversation-relay > button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
}

@keyframes relay-breathe {
  50% { opacity: 0.35; transform: scale(0.72); }
}

.summary-title {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  justify-content: space-between;
  color: var(--signal);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.summary-grid article {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.summary-grid strong {
  display: block;
  margin-bottom: 7px;
  color: var(--bone-soft);
  font-size: 9px;
}

.summary-grid p {
  margin: 0;
  color: #898983;
  font-size: 11px;
  line-height: 1.75;
}

.thinking-row {
  display: grid;
  grid-template-columns: 42px auto minmax(70px, 1fr);
  min-height: 96px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: #5d5d58;
  font-size: 9px;
}

.thinking-avatar {
  width: 38px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--line-strong));
  border-radius: 20px 20px 5px 5px;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent);
}

.thinking-copy strong,
.thinking-copy span {
  display: block;
}

.thinking-copy strong {
  color: var(--bone-soft);
  font-size: 10px;
  font-weight: 500;
}

.thinking-copy span {
  margin-top: 4px;
  color: color-mix(in srgb, var(--accent) 75%, var(--muted));
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.typing-dots {
  display: flex;
  gap: 5px;
  justify-self: end;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: thinking 1.1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }

.notes-view {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 80px;
}

.notes-heading {
  display: flex;
  min-height: 190px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.notes-heading h2 {
  margin-bottom: 12px;
}

.notes-heading p:last-child {
  max-width: 600px;
  margin: 0 0 25px;
  color: #777771;
  font-size: 11px;
  line-height: 1.7;
}

.notes-heading .primary-outline {
  margin-bottom: 25px;
}

.note-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  color: #60605b;
  font-family: var(--utility);
  font-size: 8px;
  text-transform: uppercase;
}

.note-filters {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.notes-empty {
  display: grid;
  min-height: 480px;
  place-items: start;
  align-content: start;
}

.new-board-placeholder {
  display: grid;
  width: min(290px, 100%);
  aspect-ratio: 1.62;
  margin: 4px 0 28px;
  place-items: center;
  border: 1px dashed #333330;
  border-radius: 8px;
  color: #666661;
  font-size: 29px;
}

.notes-empty h3 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
}

.notes-empty p {
  max-width: 480px;
  margin: 0 0 16px;
  color: #75756f;
  font-size: 11px;
  line-height: 1.75;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.note-card {
  position: relative;
  min-height: 265px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease;
}

.note-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.note-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  content: "";
}

.note-card button {
  display: flex;
  width: 100%;
  min-height: 265px;
  padding: 19px;
  flex-direction: column;
  background: transparent;
  text-align: left;
}

.note-card-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.note-person {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #9b9a93;
  font-size: 9px;
}

.note-person span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.5);
}

.note-date {
  color: #565651;
  font-size: 7px;
}

.note-card h3 {
  margin: 24px 0 12px;
  color: var(--bone);
  font-family: var(--display);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.note-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #85857f;
  font-size: 10px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.note-card footer {
  display: flex;
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  align-items: center;
  justify-content: space-between;
  color: #5f5f5a;
  font-family: var(--utility);
  font-size: 7px;
  text-transform: uppercase;
}

.note-card footer span:last-child {
  color: var(--accent);
}

dialog {
  color: var(--bone);
}

.panel-dialog {
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #101010;
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.75);
}

.panel-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(9px);
}

.dialog-shell {
  position: relative;
  padding: clamp(28px, 6vw, 68px);
}

.dialog-close {
  position: absolute;
  z-index: 5;
  top: 18px;
  right: 18px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(16, 16, 16, 0.76);
  color: var(--bone-soft);
  font-size: 20px;
}

.dialog-intro {
  max-width: 590px;
  margin: -7px 0 30px;
  color: #74746e;
  font-size: 11px;
  line-height: 1.7;
}

.thread-map-dialog {
  width: min(860px, calc(100vw - 36px));
}

.thread-map-shell > h2 {
  max-width: 620px;
  margin: 12px 0 36px;
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.94;
}

.thread-map-topic {
  display: grid;
  grid-template-columns: 110px 1fr;
  padding: 18px 0 22px;
  gap: 20px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.thread-map-topic > span,
.thread-map-section header > span {
  color: #85857e;
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.thread-map-topic p {
  max-width: 620px;
  margin: 0;
  color: var(--bone-soft);
  font-size: 14px;
  line-height: 1.65;
}

.thread-map-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.thread-map-stats span {
  display: flex;
  min-height: 72px;
  padding: 14px 0;
  align-items: baseline;
  gap: 7px;
  color: #85857e;
  font-size: 9px;
}

.thread-map-stats span + span {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.thread-map-stats strong {
  color: var(--bone);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
}

.thread-map-section {
  padding: 28px 0 0;
}

.thread-map-section header {
  display: flex;
  margin-bottom: 14px;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.thread-map-section header > strong {
  color: #9a9a92;
  font-family: var(--utility);
  font-size: 8px;
  font-weight: 400;
}

.thread-map-turns {
  position: relative;
  border-top: 1px solid var(--line);
}

.thread-map-turns::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 1px;
  background: #292926;
  content: "";
}

.thread-map-turn {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 92px;
  padding: 14px 0;
  grid-template-columns: 44px 1fr 24px;
  gap: 15px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.thread-map-turn:hover,
.thread-map-turn:focus-visible {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.thread-map-avatar {
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, #333);
  border-radius: 50%;
  background-position: center;
  background-size: cover;
}

.thread-map-turn-copy {
  display: grid;
  gap: 8px;
}

.thread-map-turn-copy > span {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.thread-map-turn-copy strong {
  color: var(--bone);
  font-size: 11px;
  font-weight: 500;
}

.thread-map-turn-copy small {
  color: var(--accent);
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.thread-map-turn-copy em {
  padding: 3px 6px;
  border: 1px solid #343431;
  border-radius: 999px;
  color: #6f6f69;
  font-family: var(--utility);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.thread-map-turn-copy em.is-open {
  border-color: color-mix(in srgb, var(--accent) 42%, #343431);
  color: var(--accent);
}

.thread-map-turn-copy b {
  color: #91918a;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.65;
}

.thread-map-operation {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px;
  color: #70706a;
  font-size: 9px;
  line-height: 1.55;
}

.thread-map-operation i {
  color: var(--accent);
  font-family: var(--utility);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.06em;
}

.thread-map-turn > svg {
  width: 17px;
  fill: none;
  stroke: #5b5b56;
}

.thread-map-boundaries > div {
  display: grid;
  border-top: 1px solid var(--line);
}

.thread-map-boundaries p,
.thread-map-empty {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: #898982;
  font-size: 11px;
  line-height: 1.65;
}

.thread-map-boundaries p strong {
  margin-right: 10px;
  color: var(--bone-soft);
  font-weight: 500;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

.picker-person {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 11px;
  min-height: 74px;
  padding: 10px;
  align-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.picker-person:nth-child(even) {
  border-right: 0;
}

.picker-person:hover,
.picker-person.is-selected {
  background: var(--surface);
}

.picker-person.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.picker-photo {
  width: 43px;
  height: 51px;
  border-radius: 22px 22px 4px 4px;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.55);
  transition: filter 220ms ease, box-shadow 220ms ease;
}

.picker-person.is-selected .picker-photo {
  filter: grayscale(0) saturate(1.2);
  box-shadow: 0 0 0 2px var(--accent);
}

.picker-person strong,
.picker-person small {
  display: block;
}

.picker-person strong {
  color: var(--bone-soft);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
}

.picker-person small {
  margin-top: 4px;
  color: #61615c;
  font-size: 8px;
}

.picker-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 10px;
}

.picker-person.is-selected .picker-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #080808;
}

.dialog-confirm {
  display: block;
  width: 100%;
  min-height: 47px;
  margin-top: 20px;
  border-radius: 7px;
  background: var(--bone);
  color: var(--void);
  font-size: 10px;
}

.dialog-confirm:hover {
  background: var(--signal);
}

.person-hero {
  display: grid;
  grid-template-columns: minmax(210px, 310px) 1fr;
  gap: clamp(28px, 5vw, 65px);
  align-items: end;
}

.person-large-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50% 50% 8px 8px;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.35) contrast(1.06);
}

.person-large-portrait::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  content: "";
}

.person-identity h2 {
  margin: 10px 0 9px;
  font-family: var(--display);
  font-size: clamp(45px, 7vw, 82px);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.person-meta {
  margin: 0;
  color: #75756f;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.portrait-source {
  margin: 12px 0 0;
  color: #50504c;
  font-size: 7px;
  line-height: 1.55;
}

.portrait-source a {
  color: #777771;
  text-underline-offset: 3px;
}

.person-lens {
  margin: 45px 0 35px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(25px, 4vw, 46px);
  line-height: 1.35;
}

.person-details,
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.person-details article,
.method-grid article {
  padding-top: 12px;
  border-top: 2px solid var(--accent, var(--coral));
}

.person-details h3,
.method-grid h3 {
  margin: 0 0 9px;
  color: var(--bone-soft);
  font-size: 10px;
  font-weight: 500;
}

.person-details p,
.method-grid p {
  margin: 0;
  color: #777771;
  font-size: 10px;
  line-height: 1.75;
}

.method-grid article > span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--signal);
  font-family: var(--utility);
  font-size: 8px;
}

.api-config-dialog {
  width: min(900px, calc(100vw - 36px));
}

.api-config-shell {
  overflow: auto;
  background:
    radial-gradient(circle at 88% 12%, rgba(215, 255, 87, 0.08), transparent 30%),
    radial-gradient(circle at 4% 95%, rgba(255, 104, 77, 0.08), transparent 32%);
}

.api-config-shell::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 1px;
  background: linear-gradient(transparent, rgba(231, 225, 213, 0.14), transparent);
  content: "";
}

.api-config-shell > h2 {
  max-width: 680px;
  margin: 15px 0 18px;
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.api-config-intro {
  max-width: 610px;
  margin: 0 0 30px;
  color: #85857f;
  font-size: 11px;
  line-height: 1.8;
}

.api-privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.api-privacy-grid article {
  min-height: 132px;
  padding: 17px 18px 18px 0;
  border-right: 1px solid var(--line);
}

.api-privacy-grid article + article {
  padding-left: 18px;
}

.api-privacy-grid article:last-child {
  border-right: 0;
}

.api-privacy-grid article > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.api-privacy-grid strong {
  display: block;
  margin-top: 16px;
  color: var(--bone-soft);
  font-size: 11px;
  font-weight: 500;
}

.api-privacy-grid p {
  margin: 8px 0 0;
  color: #6f6f69;
  font-size: 9px;
  line-height: 1.65;
}

.api-apply-guide {
  margin: 0 0 28px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
}

.api-apply-guide > .micro-label {
  margin-bottom: 10px;
}

.api-apply-guide h3 {
  max-width: 640px;
  margin: 0 0 10px;
  color: var(--bone);
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.api-apply-lead {
  max-width: 640px;
  margin: 0 0 18px;
  color: #85857f;
  font-size: 11px;
  line-height: 1.8;
}

.api-apply-lead a,
.api-apply-steps a {
  color: var(--coral);
  text-decoration: none;
}

.api-apply-lead a:hover,
.api-apply-steps a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.api-apply-steps {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.api-apply-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.api-apply-steps li > span {
  padding-top: 2px;
  color: var(--coral);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.api-apply-steps strong {
  display: block;
  margin-bottom: 6px;
  color: var(--bone-soft);
  font-size: 12px;
  font-weight: 500;
}

.api-apply-steps p {
  margin: 0;
  color: #6f6f69;
  font-size: 11px;
  line-height: 1.75;
}

.api-apply-steps code {
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(242, 239, 229, 0.06);
  color: var(--bone-soft);
  font-size: 10px;
}

.api-config-form > label {
  display: block;
  margin-bottom: 9px;
  color: #777771;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.api-key-field {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(4, 4, 4, 0.72);
}

.api-key-field:focus-within {
  border-color: rgba(215, 255, 87, 0.48);
  box-shadow: 0 0 0 3px rgba(215, 255, 87, 0.05);
}

.api-key-field input {
  min-width: 0;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bone);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.api-key-field button {
  min-width: 66px;
  margin: 8px;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #8b8b84;
  font-size: 9px;
}

.api-config-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #72726c;
  font-size: 9px;
  line-height: 1.6;
}

.api-config-status.is-success {
  color: var(--signal);
}

.api-config-status.is-error {
  color: var(--coral);
}

.api-config-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.api-config-actions button {
  min-height: 48px;
  border-radius: 6px;
  font-size: 10px;
}

.api-save-button {
  background: var(--bone);
  color: var(--void);
}

.api-save-button:hover {
  background: var(--signal);
}

.api-clear-button {
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #777771;
}

.api-config-footer {
  display: flex;
  margin-top: 28px;
  padding-top: 15px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #5f5f5a;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.api-config-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: flex-end;
}

.api-config-footer a {
  color: var(--coral);
  text-decoration: none;
}

.api-config-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.account-dialog {
  width: min(560px, calc(100vw - 36px));
}

.account-shell > h2 {
  max-width: 520px;
  margin: 15px 0 16px;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
}

.account-intro,
.account-signed-name {
  margin: 0 0 22px;
  color: #85857f;
  font-size: 11px;
  line-height: 1.8;
}

.account-signed-name strong {
  color: var(--bone);
}

.account-storage {
  margin: -12px 0 18px;
  color: var(--muted);
  font-size: 10px;
}

.account-profile-form {
  margin: 0 0 22px;
}

.account-profile-form select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--void-soft);
  color: var(--bone);
}

.account-usage,
.account-sessions {
  margin: 0 0 20px;
}

.account-usage h3,
.account-sessions h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.account-usage p {
  margin: 0 0 10px;
  color: var(--bone-soft);
  font-size: 11px;
  line-height: 1.7;
}

.account-usage ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 6px;
  list-style: none;
}

.account-usage li {
  color: var(--muted);
  font-size: 10px;
}

.account-sessions ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  list-style: none;
}

.account-sessions li {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-sessions p {
  margin: 0;
  color: var(--bone-soft);
  font-size: 11px;
  line-height: 1.5;
}

.account-sessions small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.account-sessions button {
  flex: 0 0 auto;
  color: var(--coral);
  background: transparent;
  font-size: 10px;
}

.account-tabs {
  display: flex;
  margin-bottom: 18px;
  gap: 10px;
}

.account-tabs button {
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.account-tabs button.is-active {
  border-bottom-color: var(--signal);
  color: var(--bone);
}

.account-form,
.account-delete-form {
  display: grid;
  gap: 8px;
}

.account-form label,
.account-delete-form label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.account-form input,
.account-delete-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--void-soft);
}

.account-status {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.account-status.is-error {
  color: var(--coral);
}

.account-status.is-success {
  color: var(--signal);
}

.account-actions {
  display: flex;
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.account-primary,
.account-secondary,
.account-danger {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 11px;
}

.account-primary {
  background: var(--signal);
  color: #15160c;
}

.account-secondary {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--bone-soft);
}

.account-delete-form {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-danger {
  justify-self: start;
  border: 1px solid rgba(255, 104, 77, 0.4);
  background: transparent;
  color: var(--coral);
}

.works-row {
  display: flex;
  margin-top: 30px;
  gap: 6px;
  flex-wrap: wrap;
}

.works-row span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #777771;
  font-size: 8px;
}

.person-dialog-actions {
  display: flex;
  margin-top: 28px;
  gap: 8px;
}

.person-dialog-actions button {
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--bone-soft);
  font-size: 9px;
}

.person-dialog-actions button:first-child {
  border-color: var(--accent);
}

.method-warning {
  margin: 35px 0 0;
  padding: 13px;
  border: 1px dashed #44443f;
  color: #696963;
  font-size: 9px;
  line-height: 1.7;
}

.method-beian {
  margin: 12px 0 0;
  color: #5f5f59;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
}

.method-beian .beian-link:hover {
  color: var(--bone-soft);
}

.note-detail-header {
  display: flex;
  padding-bottom: 22px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.note-detail-person {
  display: flex;
  gap: 10px;
  align-items: center;
}

.note-detail-person span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
}

.note-detail-person strong,
.note-detail-person small {
  display: block;
}

.note-detail-person strong { color: var(--bone-soft); font-size: 11px; }
.note-detail-person small { margin-top: 3px; color: #65655f; font-size: 8px; }

.note-detail-title {
  margin: 40px 0 23px;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.16;
}

.note-context {
  margin-bottom: 25px;
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: #8e8e87;
  font-size: 10px;
  line-height: 1.7;
}

.note-body {
  color: #cfcbc2;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.95;
  white-space: pre-wrap;
}

.note-evidence-label {
  margin-top: 34px;
  color: var(--coral);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-sources {
  display: flex;
  margin-top: 28px;
  gap: 6px;
  flex-wrap: wrap;
}

.note-sources span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #6f6f69;
  font-size: 8px;
}

.note-dialog-actions {
  display: flex;
  margin-top: 32px;
  gap: 8px;
}

.note-dialog-actions button {
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: #9b9b94;
  font-size: 9px;
}

.note-dialog-actions .danger-button:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.entry-transition-flash,
.tunnel-hud {
  position: absolute;
  pointer-events: none;
}

.entry-transition-flash {
  z-index: 12;
  inset: 0;
  background: #eeece7;
  opacity: 0;
}

.tunnel-hud {
  z-index: 11;
  inset: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: #111;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  mix-blend-mode: multiply;
  opacity: 0;
  text-transform: uppercase;
  transition: opacity 500ms ease;
}

.tunnel-hud > div {
  display: grid;
  gap: 4px;
}

.tunnel-hud > div > span {
  margin-bottom: 4px;
}

.tunnel-hud > div:nth-child(2) {
  text-align: right;
}

.tunnel-hud strong {
  color: #111;
  font-size: inherit;
  font-weight: 700;
}

.tunnel-hud footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #111;
}

.tunnel-skip {
  position: absolute;
  z-index: 15;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 148px;
  min-height: 48px;
  padding: 9px 13px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(17, 17, 17, 0.72);
  background: rgba(242, 241, 237, 0.82);
  color: #111;
  font-family: var(--utility);
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(8px);
  transition: background 180ms ease, color 180ms ease, opacity 240ms ease, transform 240ms ease;
}

.tunnel-skip span {
  font-size: 13px;
}

.tunnel-skip small {
  font-size: 10px;
}

.entry-gate.is-tunneling .tunnel-skip:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 420ms;
}

.tunnel-skip:hover,
.tunnel-skip:focus-visible {
  background: #111;
  color: #f2f1ed;
}

.entry-gate.is-tunneling .entry-frame,
.entry-gate.is-tunneling .entry-rail {
  animation: entry-tunnel-ui-out 480ms ease forwards;
}

.entry-gate.is-tunneling .entry-field {
  animation: none;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 180ms linear;
}

.entry-gate.is-tunneling .tunnel-field {
  opacity: 1;
  transition: opacity 180ms linear;
}

.entry-gate.is-tunneling .entry-vignette {
  opacity: 0;
  transition: opacity 120ms linear;
}

.entry-gate.is-tunneling::after {
  opacity: 0;
  transition: opacity 120ms linear;
}

.entry-gate.is-tunneling .tunnel-hud {
  opacity: 1;
  transition-delay: 300ms;
}

.entry-gate.is-arriving .tunnel-hud {
  opacity: 0;
  transition-delay: 0s;
}

.entry-gate.is-arriving .entry-transition-flash {
  animation: entry-arrival-flash 620ms cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

body.is-gallery-view {
  overflow: hidden;
  background: #050505;
}

.is-gallery-view .ambient-grid,
.is-gallery-view .app-rail,
.is-gallery-view .workspace-header {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.is-gallery-view .workspace-header {
  display: none;
}

.is-gallery-view .workspace {
  min-height: 100svh;
  margin-left: 0;
  padding-bottom: 0;
}

.is-gallery-view .community-view {
  color: #e7e1d5;
  animation: gallery-arrive 900ms 120ms cubic-bezier(0.16, 0.82, 0.16, 1) both;
}

.gallery-community {
  --gallery-paper: #050505;
  --gallery-ink: #e7e1d5;
  --gallery-faint: rgba(231, 225, 213, 0.38);
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(100, 86, 70, 0.16) 0%, rgba(27, 25, 22, 0.12) 34%, transparent 68%),
    radial-gradient(circle at 18% 16%, rgba(111, 149, 135, 0.05), transparent 28%),
    linear-gradient(180deg, #080808 0%, #050505 48%, #030303 100%);
}

.gallery-community::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  content: "";
  mix-blend-mode: screen;
  opacity: 0.11;
  filter: contrast(1.75) brightness(0.55);
}

.gallery-header {
  position: absolute;
  z-index: 60;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 68px;
  padding: 15px 28px;
  align-items: center;
  border-bottom: 1px solid rgba(231, 225, 213, 0.11);
}

.gallery-brand {
  display: flex;
  width: max-content;
  padding: 0;
  gap: 10px;
  align-items: center;
  background: transparent;
  color: var(--gallery-ink);
  text-align: left;
}

.gallery-brand > span:first-child {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(231, 225, 213, 0.54);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 12px;
  transition: color 200ms ease, background 200ms ease;
}

.gallery-brand:hover > span:first-child {
  background: var(--gallery-ink);
  color: var(--gallery-paper);
}

.gallery-brand strong,
.gallery-brand small {
  display: block;
}

.gallery-brand strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.gallery-brand small,
.gallery-header-center,
.gallery-nav,
.gallery-filter-row,
.gallery-active-profile > span,
.gallery-footer,
.carousel-card-top,
.carousel-invite,
.carousel-detail {
  font-family: var(--utility);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-brand small {
  margin-top: 3px;
  color: var(--gallery-faint);
  font-size: 6px;
}

.gallery-header-center {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--gallery-faint);
  font-size: 11px;
}

.gallery-header-center strong {
  color: var(--gallery-ink);
  font-weight: 500;
}

.gallery-header-center i,
.gallery-nav i {
  font-style: normal;
}

.gallery-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-self: end;
  color: var(--gallery-faint);
  font-size: 11px;
}

.gallery-nav button {
  min-height: 40px;
  padding: 9px 2px;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--gallery-ink);
  font-size: 12px;
}

.gallery-nav button:hover {
  border-bottom-color: var(--gallery-ink);
}

.gallery-filter-row {
  position: absolute;
  z-index: 55;
  top: 84px;
  right: 28px;
  left: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  color: var(--gallery-faint);
  font-size: 10px;
}

.gallery-filter-row > p {
  margin: 0;
  color: rgba(231, 225, 213, 0.62);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: none;
}

#communityHeading:focus {
  outline: 2px solid var(--gallery-ink);
  outline-offset: 5px;
}

.gallery-filter-row > span {
  justify-self: end;
}

.gallery-filter-row .import-person-trigger {
  justify-self: end;
  white-space: nowrap;
}

.gallery-filter-row .feed-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(231, 225, 213, 0.12);
  border-radius: 99px;
  background: rgba(8, 8, 8, 0.5);
}

.gallery-filter-row .feed-tabs button {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 99px;
  color: rgba(231, 225, 213, 0.48);
  font-size: 11px;
}

.gallery-filter-row .feed-tabs button:hover,
.gallery-filter-row .feed-tabs button.is-active {
  background: var(--gallery-ink);
  color: var(--gallery-paper);
}

.mobile-filter-control {
  display: none;
}

.gallery-scene {
  position: absolute;
  z-index: 10;
  top: 116px;
  right: 0;
  bottom: 162px;
  left: 0;
  overflow: hidden;
  outline: none;
  perspective: 1300px;
  cursor: grab;
  touch-action: pan-y;
}

.gallery-scene.is-dragging {
  cursor: grabbing;
}

.gallery-scene:focus-visible {
  outline: 1px solid rgba(231, 225, 213, 0.22);
  outline-offset: -8px;
}

.gallery-haze {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--gallery-paper), transparent 16%, transparent 84%, var(--gallery-paper)),
    radial-gradient(ellipse at 50% 78%, rgba(182, 143, 104, 0.13), transparent 46%);
  opacity: 0.68;
}

.thinker-carousel {
  position: absolute;
  z-index: 4;
  inset: 0;
  transform:
    translate3d(
      calc(var(--carousel-hover-x, 0px) + var(--carousel-drag-x, 0px)),
      var(--carousel-hover-y, 0px),
      0
    )
    rotateX(var(--carousel-hover-rotate-x, 0deg))
    rotateY(var(--carousel-hover-rotate-y, 0deg));
  transition: transform 180ms cubic-bezier(0.16, 0.78, 0.18, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

.gallery-scene.is-dragging .thinker-carousel {
  transition-duration: 0ms;
}

.carousel-thinker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(166px, 18vw, 252px);
  height: clamp(270px, 50vh, 430px);
  opacity: var(--carousel-opacity, 0);
  transform:
    translate(-50%, -50%)
    translate3d(var(--carousel-x, 0), var(--carousel-y, 0), 0)
    rotateY(var(--carousel-rotate, 0deg))
    scale(var(--carousel-scale, 1));
  transform-origin: center bottom;
  transform-style: preserve-3d;
  transition:
    transform 680ms cubic-bezier(0.16, 0.78, 0.18, 1),
    opacity 480ms ease,
    filter 480ms ease;
}

.carousel-thinker.is-outside {
  pointer-events: none;
}

.carousel-focus {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(231, 225, 213, 0.15);
  border-radius: 2px;
  background: #11100f;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.72);
  color: #f4f0e7;
  text-align: left;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.carousel-focus:focus-visible {
  outline: 2px solid var(--gallery-ink);
  outline-offset: 5px;
}

.carousel-focus::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 7, 7, 0.22), transparent 30%, transparent 55%, rgba(4, 4, 4, 0.8)),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%);
  content: "";
}

.carousel-portrait {
  position: absolute;
  z-index: 1;
  inset: 0;
  background-image: var(--portrait);
  background-position: var(--portrait-position, 50% 25%);
  background-size: cover;
  filter: grayscale(0.82) contrast(1.04);
  transform: scale(1.035);
  transition: filter 520ms ease, transform 800ms cubic-bezier(0.16, 0.78, 0.18, 1);
}

.carousel-thinker.is-active .carousel-focus {
  border-color: rgba(231, 225, 213, 0.62);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.82);
}

.carousel-thinker.is-active .carousel-portrait {
  filter: grayscale(0.08) saturate(1.02) contrast(1.02);
  transform: scale(1);
}

.carousel-thinker.is-selected .carousel-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 30px 90px rgba(0, 0, 0, 0.82);
}

.carousel-card-top,
.carousel-card-name,
.carousel-invite {
  position: absolute;
  z-index: 3;
  right: 13px;
  left: 13px;
}

.carousel-card-top {
  top: 13px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

.carousel-card-top i,
.carousel-invite i {
  font-style: normal;
}

.carousel-card-name {
  bottom: 42px;
}

.carousel-card-name strong,
.carousel-card-name small {
  display: block;
}

.carousel-card-name strong {
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
  max-width: 100%;
  text-wrap: balance;
}

.carousel-card-name small {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.carousel-invite {
  bottom: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 99px;
  background: rgba(5, 5, 5, 0.56);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.carousel-invite i {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.carousel-thinker.is-selected .carousel-invite {
  color: #fff;
}

.carousel-thinker.is-selected .carousel-invite i {
  border-color: var(--accent);
  background: var(--accent);
  color: #101010;
}

.carousel-detail {
  position: absolute;
  right: 0;
  bottom: -28px;
  padding: 4px 0;
  background: transparent;
  color: rgba(231, 225, 213, 0.55);
  min-height: 32px;
  font-size: 10px;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.carousel-thinker.is-active .carousel-detail {
  opacity: 1;
  transform: translateY(0);
}

.carousel-arrow {
  position: absolute;
  z-index: 52;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(231, 225, 213, 0.2);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.62);
  color: rgba(231, 225, 213, 0.68);
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.carousel-arrow:hover {
  background: var(--gallery-ink);
  color: var(--gallery-paper);
  transform: translateY(-50%) scale(1.06);
}

.carousel-arrow.is-prev { left: 24px; }
.carousel-arrow.is-next { right: 24px; }

.carousel-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.gallery-active-profile {
  position: absolute;
  z-index: 42;
  bottom: 50px;
  left: 28px;
  width: min(250px, 20vw);
  color: var(--gallery-ink);
}

.gallery-active-profile > span {
  color: var(--gallery-faint);
  font-size: 10px;
}

.gallery-active-profile > strong {
  display: block;
  margin-top: 7px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.gallery-active-profile > p {
  margin: 5px 0 0;
  color: rgba(231, 225, 213, 0.52);
  font-family: var(--display);
  font-size: 12px;
  line-height: 1.55;
}

.gallery-starters {
  display: none;
}

.gallery-footer {
  position: absolute;
  z-index: 40;
  right: 28px;
  bottom: 42px;
  left: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gallery-faint);
  font-size: 10px;
}

.is-gallery-view .composer-dock {
  z-index: 65;
  bottom: 56px;
  width: min(620px, calc(100vw - 570px));
  border-color: rgba(231, 225, 213, 0.2);
  background: rgba(12, 12, 11, 0.84);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68);
  color: var(--gallery-ink);
}

body.is-gallery-view .site-beian .beian-link {
  color: rgba(231, 225, 213, 0.58);
}

body.is-gallery-view .site-beian .beian-link:hover {
  color: rgba(231, 225, 213, 0.72);
}

.is-gallery-view .composer-dock.is-awaiting-selection {
  width: min(390px, calc(100vw - 64px));
}

.is-gallery-view .selection-line,
.is-gallery-view .composer-dock form {
  border-color: rgba(231, 225, 213, 0.12);
}

.is-gallery-view .selected-portraits span {
  border-color: #11100f;
}

.is-gallery-view .selection-button strong,
.is-gallery-view .composer-dock textarea {
  color: var(--gallery-ink);
}

.is-gallery-view .selection-button small,
.is-gallery-view .composer-foot,
.is-gallery-view .composer-dock textarea::placeholder {
  color: rgba(231, 225, 213, 0.38);
}

.is-gallery-view .conversation-style {
  border-color: rgba(231, 225, 213, 0.14);
}

.is-gallery-view .conversation-style button {
  color: rgba(231, 225, 213, 0.44);
}

.is-gallery-view .conversation-style button.is-active {
  background: var(--gallery-ink);
  color: var(--gallery-paper);
}

.is-gallery-view .send-button {
  background: var(--gallery-ink);
  color: var(--gallery-paper);
}

.is-gallery-view .send-button:hover:not(:disabled) {
  background: #a94822;
  color: #fff4e7;
}

body.is-chat-view {
  height: 100vh;
  overflow: hidden;
}

.is-chat-view .workspace {
  height: 100vh;
  padding-bottom: 0;
  overflow: hidden;
}

.is-chat-view .chat-view {
  height: calc(100vh - 58px);
  overflow: hidden;
}

.chat-lab {
  display: grid;
  grid-template-columns: minmax(300px, 0.36fr) minmax(520px, 0.64fr);
  height: 100%;
  background: #060606;
}

.voice-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid rgba(231, 225, 213, 0.12);
  background:
    radial-gradient(ellipse at 48% 58%, rgba(166, 79, 45, 0.1), transparent 47%),
    linear-gradient(145deg, #080808, #030303);
}

.voice-stage::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(231, 225, 213, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 225, 213, 0.028) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 84%, transparent);
}

#voiceFieldCanvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 420ms ease;
}

.voice-stage-grain {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.07;
}

.voice-stage-header,
.voice-stage-footer,
.voice-stage-readout > span,
.voice-stage-readout > p {
  font-family: var(--utility);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voice-stage-header {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: 45px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(231, 225, 213, 0.1);
  color: rgba(231, 225, 213, 0.42);
  font-size: 6px;
}

.voice-stage-header i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: #6f9587;
  box-shadow: 0 0 12px rgba(111, 149, 135, 0.65);
  animation: entry-pulse 2.2s ease-in-out infinite;
}

.voice-stage-readout {
  position: absolute;
  z-index: 4;
  top: 72px;
  left: 22px;
  max-width: 290px;
  pointer-events: none;
}

.voice-stage-readout > span {
  color: rgba(231, 225, 213, 0.36);
  font-size: 6px;
}

.voice-stage-readout > strong {
  display: block;
  margin-top: 8px;
  color: rgba(231, 225, 213, 0.92);
  font-family: var(--display);
  font-size: clamp(25px, 3.1vw, 48px);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.voice-stage-readout > p {
  margin: 8px 0 0;
  color: #a64f2d;
  font-size: 11px;
}

.voice-stage-footer {
  position: absolute;
  z-index: 4;
  right: 20px;
  bottom: 16px;
  left: 20px;
  display: flex;
  justify-content: space-between;
  color: rgba(231, 225, 213, 0.38);
  font-size: 6px;
}

.is-chat-view .chat-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 24px 180px;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 18%),
    #090909;
}

.is-chat-view .chat-header {
  min-height: 126px;
  flex: 0 0 auto;
}

.is-chat-view .chat-header h2 {
  max-width: 520px;
  margin-bottom: 14px;
  font-size: clamp(35px, 4vw, 59px);
}

.is-chat-view .chat-participants {
  min-height: 53px;
  flex: 0 0 auto;
}

.is-chat-view .conversation-stream {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(231, 225, 213, 0.2) transparent;
  scrollbar-width: thin;
}

.is-chat-view .chat-empty {
  min-height: 100%;
}

.is-chat-view .message,
.is-chat-view .message.is-user,
.is-chat-view .message.is-topic {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 20px;
}

.is-chat-view .round-marker,
.is-chat-view .conversation-relay {
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 20px;
}

.is-chat-view .round-marker {
  grid-template-columns: 92px minmax(0, 1fr);
}

.is-chat-view .message-content > p {
  font-size: clamp(16px, 1.45vw, 20px);
}

.is-chat-view .message.is-user .message-content > p,
.is-chat-view .message.is-topic .message-content > p {
  font-size: clamp(20px, 2.1vw, 29px);
}

.is-chat-view .composer-dock {
  left: calc(var(--rail-width) + (100vw - var(--rail-width)) * 0.68);
  width: min(760px, calc((100vw - var(--rail-width)) * 0.64 - 48px));
}

body.has-conversation-reply:not(.is-generating) #voiceFieldCanvas {
  opacity: 0.42;
}

body.has-conversation-reply:not(.is-generating) .voice-stage-readout > strong {
  font-size: clamp(22px, 2vw, 32px);
  opacity: 0.76;
}

body.has-conversation-reply:not(.is-generating) .voice-stage-readout > p {
  color: rgba(231, 225, 213, 0.52);
}

@keyframes entry-arrival-flash {
  0% { opacity: 0; }
  38% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes entry-tunnel-ui-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.015); }
}

@keyframes gallery-arrive {
  from { opacity: 0; transform: scale(1.025); filter: blur(10px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

.toast {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  max-width: 340px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--bone);
  color: var(--void);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.45);
  font-size: 10px;
  animation: toast-in 240ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes card-arrive {
  from { opacity: 0; transform: translateY(18px); }
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(12px); }
}

@keyframes thinking {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1120px) {
  .community-layout {
    grid-template-columns: minmax(235px, 0.54fr) minmax(470px, 1.46fr);
    gap: 25px;
  }

  .community-thesis h2 {
    font-size: clamp(45px, 6vw, 68px);
  }

  .thinker-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-name h3 {
    font-size: 29px;
  }

  .note-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .gallery-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .gallery-filter-row {
    right: 16px;
    left: 16px;
    grid-template-columns: 1fr auto auto;
  }

  .gallery-filter-row > p {
    display: none;
  }

  .gallery-filter-row > span {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .gallery-filter-row .feed-tabs {
    grid-column: 2;
    grid-row: 1;
  }

  .gallery-filter-row .import-person-trigger {
    grid-column: 3;
    grid-row: 1;
  }

  .gallery-active-profile {
    left: 16px;
    width: 180px;
  }

  .gallery-footer {
    right: 16px;
    left: 16px;
  }

  .gallery-footer span:first-child {
    visibility: hidden;
  }

  .is-gallery-view .composer-dock {
    width: min(520px, calc(100vw - 230px));
  }

  .community-layout {
    display: block;
    padding-top: 8px;
  }

  .community-thesis {
    position: relative;
    top: auto;
    height: auto;
    min-height: 520px;
    padding: 30px 0 55px;
  }

  .community-thesis h2 {
    margin-top: 50px;
    font-size: clamp(56px, 11vw, 84px);
  }

  .starter-prompts {
    margin-top: 45px;
  }

  .feed-toolbar {
    position: sticky;
    z-index: 30;
    top: 58px;
    background: rgba(7, 7, 7, 0.94);
    backdrop-filter: blur(12px);
  }

  .person-hero {
    grid-template-columns: minmax(180px, 260px) 1fr;
  }

  .person-details,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .message {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 18px;
  }

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

@media (max-width: 620px) {
  :root {
    --rail-width: 48px;
  }

  .site-beian {
    right: 12px;
    left: 12px;
  }

  body.is-chat-view .site-beian {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .entry-rail {
    width: 48px;
    padding-top: 13px;
  }

  .entry-frame {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 58px;
  }

  .entry-header {
    height: 45px;
    padding: 0 10px;
  }

  .entry-header nav {
    gap: 12px;
  }

  .entry-header nav span:not(:first-child),
  .entry-status,
  .entry-aside {
    display: none;
  }

  .entry-coordinate {
    gap: 0;
  }

  .entry-identity {
    right: 12px;
    bottom: 54px;
    left: 18px;
  }

  .entry-identity > p {
    margin-bottom: 13px;
    font-size: 9px;
  }

  .entry-title-row {
    gap: 12px;
  }

  .entry-title-row h1 {
    gap: 0.06em;
    font-size: clamp(62px, 19vw, 84px);
  }

  .entry-action {
    min-width: 102px;
    padding: 4px 0;
    gap: 8px;
  }

  .entry-action-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .entry-action-copy strong {
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .entry-action-copy small,
  .entry-footer span:nth-child(2) {
    display: none;
  }

  .entry-footer {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .tunnel-hud {
    inset: 16px;
    font-size: 9px;
  }

  .tunnel-skip {
    right: 16px;
    bottom: 52px;
    min-width: 138px;
  }

  .gallery-header {
    grid-template-columns: 1fr auto;
    min-height: 58px;
    padding: 10px 13px;
  }

  .gallery-brand > span:nth-child(2),
  .gallery-header-center,
  .gallery-nav > span {
    display: none;
  }

  .gallery-brand > span:first-child {
    width: 33px;
    height: 33px;
  }

  .gallery-nav {
    gap: 13px;
  }

  .gallery-filter-row {
    top: 68px;
    right: 10px;
    left: 10px;
    display: block;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gallery-filter-row .import-person-trigger {
    margin-left: 8px;
    vertical-align: middle;
  }

  .gallery-filter-row::-webkit-scrollbar {
    display: none;
  }

  .gallery-filter-row > span {
    display: none;
  }

  .gallery-filter-row .feed-tabs {
    display: none;
  }

  .mobile-filter-control {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    color: rgba(231, 225, 213, 0.62);
    font-family: var(--utility);
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .mobile-filter-control select {
    min-width: 150px;
    min-height: 44px;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(231, 225, 213, 0.22);
    border-radius: 99px;
    background: #111;
    color: var(--gallery-ink);
    font-size: 13px;
  }

  .gallery-scene {
    top: 122px;
    bottom: 168px;
  }

  .carousel-thinker {
    width: min(56vw, 210px);
    height: min(48vh, 340px);
  }

  .carousel-card-name strong {
    font-size: clamp(27px, 9vw, 38px);
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
  }

  .carousel-arrow.is-prev { left: 8px; }
  .carousel-arrow.is-next { right: 8px; }

  .gallery-footer {
    top: 62px;
    bottom: auto;
    justify-content: center;
  }

  .gallery-footer span {
    display: none;
  }

  .gallery-active-profile {
    right: 10px;
    bottom: 170px;
    left: 10px;
    width: auto;
    padding: 9px 11px;
    border: 1px solid rgba(231, 225, 213, 0.12);
    background: rgba(8, 8, 8, 0.68);
    backdrop-filter: blur(10px);
  }

  .gallery-active-profile > span {
    display: none;
  }

  .gallery-active-profile > strong {
    display: inline;
    margin-top: 0;
    font-size: 16px;
  }

  .gallery-active-profile > p {
    display: inline;
    margin-left: 8px;
    font-size: 11px;
  }

  .is-gallery-view .composer-dock {
    right: 8px;
    bottom: 52px;
    left: 8px;
    width: auto;
    transform: none;
  }

  .is-gallery-view .composer-dock.is-hidden {
    transform: translateY(18px);
  }

  .app-rail {
    padding-top: 10px;
  }

  .rail-button {
    width: 44px;
    height: 44px;
  }

  .workspace-header {
    padding: 0 12px;
  }

  .header-meta span {
    display: none;
  }

  .community-layout {
    padding-right: 10px;
    padding-left: 10px;
  }

  .community-thesis {
    min-height: 500px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .community-thesis h2 {
    font-size: clamp(48px, 15vw, 69px);
  }

  .thesis-copy {
    font-size: 12px;
  }

  .feed-toolbar {
    overflow-x: auto;
  }

  .feed-toolbar > span {
    display: none;
  }

  .feed-tabs {
    min-width: max-content;
  }

  .thinker-feed {
    grid-template-columns: 1fr;
  }

  .thinker-card:nth-child(2n) .portrait-stage,
  .portrait-stage {
    aspect-ratio: 4 / 3.75;
  }

  .composer-dock {
    right: 8px;
    bottom: 52px;
    left: calc(var(--rail-width) + 8px);
    width: auto;
    transform: none;
  }

  .composer-dock.is-hidden {
    transform: translateY(18px);
  }

  .selection-line {
    gap: 6px;
  }

  .selection-button small,
  .composer-foot span:last-child {
    display: none;
  }

  .conversation-style button {
    padding: 5px 6px;
  }

  .chat-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .chat-header {
    min-height: 100px;
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-header h2 {
    margin-bottom: 8px;
    font-size: 42px;
  }

  .chat-actions {
    margin-bottom: 11px;
  }

  .message,
  .message.is-user,
  .message.is-topic {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 28px 2px;
  }

  .engine-notice {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .engine-notice > button {
    grid-column: 1;
    justify-self: start;
  }

  .evidence-card summary {
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .evidence-card summary > small {
    display: none;
  }

  .evidence-card blockquote,
  .evidence-card > a {
    margin-left: 74px;
  }

  .message-profile {
    display: grid;
    grid-template-columns: 44px 1fr;
    column-gap: 9px;
    align-items: center;
  }

  .message-avatar {
    grid-row: span 2;
    width: 42px;
    height: 48px;
    margin: 0;
  }

  .message-content > p {
    font-size: 17px;
  }

  .message.is-user .message-content > p,
  .message.is-topic .message-content > p {
    font-size: 24px;
  }

  .save-note-button {
    width: 100%;
    margin: 7px 0 0;
    justify-content: center;
  }

  .notes-view {
    width: calc(100% - 20px);
    padding-top: 8px;
  }

  .notes-heading {
    min-height: 210px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
  }

  .notes-heading h2 {
    font-size: 50px;
  }

  .notes-heading .primary-outline {
    width: 100%;
  }

  .note-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

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

  .dialog-shell {
    padding: 48px 20px 28px;
  }

  .dialog-shell > h2 {
    font-size: 45px;
  }

  .thread-map-topic {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .thread-map-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .thread-map-stats span:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .thread-map-stats span:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .thread-map-stats span {
    min-height: 62px;
    flex-direction: column;
    gap: 2px;
  }

  .thread-map-stats span + span {
    padding-left: 12px;
  }

  .thread-map-turn {
    grid-template-columns: 40px 1fr 18px;
    gap: 11px;
  }

  .thread-map-avatar {
    width: 40px;
    height: 40px;
  }

  .thread-map-turns::before {
    left: 19px;
  }

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

  .picker-person,
  .picker-person:nth-child(even) {
    border-right: 0;
  }

  .person-hero {
    grid-template-columns: 105px 1fr;
    gap: 17px;
  }

  .person-identity h2 {
    font-size: 40px;
  }

  .person-lens {
    margin-top: 30px;
    font-size: 26px;
  }

  .portrait-source {
    display: none;
  }

  .toast {
    right: 8px;
    bottom: 8px;
    left: calc(var(--rail-width) + 8px);
    max-width: none;
  }
}

@media (max-width: 1120px) and (min-width: 821px) {
  .chat-lab {
    grid-template-columns: minmax(300px, 0.38fr) minmax(430px, 0.62fr);
  }

  .is-chat-view .composer-dock {
    left: calc(var(--rail-width) + (100vw - var(--rail-width)) * 0.69);
    width: min(620px, calc((100vw - var(--rail-width)) * 0.62 - 32px));
  }
}

@media (max-width: 820px) {
  body.is-chat-view,
  .is-chat-view .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .is-chat-view .chat-view {
    height: auto;
    min-height: calc(100vh - 58px);
    overflow: visible;
  }

  .chat-lab {
    grid-template-columns: 1fr;
    grid-template-rows: 96px minmax(520px, auto);
    height: auto;
    min-height: calc(100vh - 58px);
  }

  .voice-stage {
    min-height: 96px;
    border-right: 0;
    border-bottom: 1px solid rgba(231, 225, 213, 0.12);
  }

  .voice-stage-header {
    top: 8px;
    right: 12px;
    bottom: auto;
    left: auto;
    min-height: 32px;
    padding: 0;
    border-bottom: 0;
    font-size: 10px;
  }

  .voice-stage-header span:first-child,
  .voice-stage-footer,
  .voice-stage-readout > span {
    display: none;
  }

  .voice-stage-readout {
    top: 17px;
    right: 120px;
    left: 18px;
    max-width: none;
  }

  .voice-stage-readout > strong {
    margin-top: 0;
    overflow: hidden;
    font-size: 20px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .voice-stage-readout > p {
    margin-top: 5px;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: none;
  }

  .is-chat-view .chat-shell {
    height: auto;
    min-height: 520px;
    padding: 0 18px calc(190px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .is-chat-view .conversation-stream {
    min-height: 380px;
    overflow: visible;
  }

  .is-chat-view .composer-dock {
    left: calc(var(--rail-width) + (100vw - var(--rail-width)) / 2);
    width: min(700px, calc(100vw - var(--rail-width) - 28px));
    bottom: max(36px, calc(28px + env(safe-area-inset-bottom)));
  }

  body.has-conversation-reply:not(.is-generating) .chat-lab {
    grid-template-rows: 72px minmax(520px, auto);
  }

  body.has-conversation-reply:not(.is-generating) .voice-stage {
    min-height: 72px;
  }

  body.has-conversation-reply:not(.is-generating) .voice-stage-readout {
    top: 13px;
  }

  body.has-conversation-reply:not(.is-generating) .voice-stage-readout > strong {
    font-size: 17px;
  }

  body.has-conversation-reply:not(.is-generating) .voice-stage-readout > p {
    margin-top: 2px;
  }
}

@media (max-width: 620px) {
  .is-chat-view .chat-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .is-chat-view .message,
  .is-chat-view .message.is-user,
  .is-chat-view .message.is-topic {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .is-chat-view .round-marker,
  .is-chat-view .conversation-relay {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .conversation-relay {
    padding: 20px 4px 24px;
  }

  .relay-track {
    width: 110px;
  }

  .conversation-relay > button {
    width: 100%;
    justify-content: space-between;
  }

  .round-marker > p {
    line-height: 1.6;
  }

  .is-chat-view .composer-dock {
    right: 8px;
    bottom: 52px;
    left: calc(var(--rail-width) + 8px);
    width: auto;
    transform: none;
  }

  .session-restore {
    top: 66px;
    right: 8px;
    left: calc(var(--rail-width) + 8px);
    max-width: none;
    gap: 10px;
    align-items: stretch;
    flex-direction: column;
  }

  .is-gallery-view .session-restore {
    top: 122px;
  }

  .session-restore > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .header-meta {
    gap: 8px;
  }

  .header-meta .api-config-trigger {
    min-width: 92px;
    min-height: 36px;
    justify-content: center;
  }

  .api-onboarding {
    top: 66px;
    right: 8px;
    left: calc(var(--rail-width) + 8px);
    width: auto;
    gap: 10px;
    align-items: stretch;
    flex-direction: column;
  }

  .api-onboarding > button {
    width: 100%;
  }

  .api-config-shell {
    padding: 48px 20px 28px;
  }

  .api-config-shell::before {
    left: 10px;
  }

  .api-config-shell > h2 {
    font-size: clamp(40px, 12.5vw, 56px);
  }

  .api-privacy-grid {
    grid-template-columns: 1fr;
  }

  .api-privacy-grid article,
  .api-privacy-grid article + article {
    min-height: 0;
    padding: 15px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .api-privacy-grid article:last-child {
    border-bottom: 0;
  }

  .api-privacy-grid strong {
    margin-top: 7px;
  }

  .api-config-actions {
    grid-template-columns: 1fr;
  }

  .api-config-footer {
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .api-config-links {
    justify-content: flex-start;
  }

  .api-apply-steps li {
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }
}

@media (pointer: coarse) {
  .rail-button,
  .carousel-arrow,
  .gallery-filter-row .feed-tabs button,
  .conversation-style button,
  .chat-actions button,
  .primary-outline,
  .reply-link,
  .notes-empty button,
  .chat-empty button,
  .engine-notice > button {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* The salon transcript reads as a real exchange: people enter from the left,
   while the visitor's later contributions enter from the right. */
.message-list {
  display: flex;
  flex-direction: column;
}

.is-chat-view .message.is-assistant,
.is-chat-view .message.is-source {
  width: min(74%, 920px);
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-self: flex-start;
  padding: 28px 0 18px;
  border-bottom: 0;
}

.is-chat-view .message.is-assistant::before,
.is-chat-view .message.is-source::before,
.is-chat-view .message.is-user.is-reply::before {
  display: none;
}

.is-chat-view .message.is-assistant .message-avatar,
.is-chat-view .message.is-source .message-avatar {
  width: 48px;
  height: 56px;
  margin-bottom: 9px;
  border-radius: 24px 24px 4px 4px;
}

.is-chat-view .message.is-assistant .message-content,
.is-chat-view .message.is-source .message-content {
  position: relative;
  min-width: 0;
  padding: 2px 0 24px 20px;
  border-left: 1px solid color-mix(in srgb, var(--accent, var(--coral)) 42%, transparent);
}

.is-chat-view .message.is-assistant .message-content::before,
.is-chat-view .message.is-source .message-content::before {
  position: absolute;
  top: 0;
  left: -2px;
  width: 3px;
  height: 38px;
  background: linear-gradient(180deg, var(--accent, var(--coral)), transparent);
  content: "";
}

.is-chat-view .message.is-assistant .message-content > p,
.is-chat-view .message.is-source .message-content > p {
  max-width: none;
}

.is-chat-view .message.is-user.is-reply {
  width: min(57%, 680px);
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 13px;
  align-self: flex-end;
  margin-left: auto;
  padding: 22px 0;
  border-bottom: 0;
  background: none;
}

.is-chat-view .message.is-user.is-reply .message-profile {
  grid-column: 2;
  grid-row: 1;
  padding-top: 5px;
  text-align: right;
}

.is-chat-view .message.is-user.is-reply .message-profile > span,
.is-chat-view .message.is-user.is-opening .message-profile > span,
.is-chat-view .message.is-topic.is-opening .message-profile > span {
  display: block;
  color: var(--coral);
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.is-chat-view .message.is-user.is-reply .message-profile > strong,
.is-chat-view .message.is-user.is-opening .message-profile > strong,
.is-chat-view .message.is-topic.is-opening .message-profile > strong {
  display: block;
  margin-top: 5px;
  color: #8d8b84;
  font-family: var(--body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.is-chat-view .message.is-user.is-reply .message-content {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.is-chat-view .message.is-user.is-reply .message-content > p {
  max-width: none;
  padding: 16px 18px;
  border: 1px solid rgba(231, 225, 213, 0.13);
  border-right: 2px solid rgba(231, 225, 213, 0.62);
  border-radius: 7px 2px 2px 7px;
  background:
    linear-gradient(110deg, rgba(231, 225, 213, 0.055), rgba(231, 225, 213, 0.015)),
    rgba(13, 13, 13, 0.88);
  color: #e5e0d6;
  font-family: var(--body);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.75;
}

.is-chat-view .message.is-user.is-opening,
.is-chat-view .message.is-topic.is-opening {
  width: 100%;
  align-self: stretch;
}

.is-chat-view .message.is-user.is-opening .message-content > p,
.is-chat-view .message.is-topic.is-opening .message-content > p {
  font-size: clamp(20px, 2.1vw, 29px);
}

@media (max-width: 820px) {
  .reply-link small {
    max-width: 22ch;
  }

  .is-chat-view .message.is-assistant,
  .is-chat-view .message.is-source {
    width: 94%;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 11px;
    padding: 22px 0 14px;
  }

  .is-chat-view .message.is-assistant .message-profile,
  .is-chat-view .message.is-source .message-profile {
    display: block;
  }

  .is-chat-view .message.is-assistant .message-avatar,
  .is-chat-view .message.is-source .message-avatar {
    width: 38px;
    height: 45px;
    margin-bottom: 7px;
  }

  .is-chat-view .message.is-assistant .message-profile small,
  .is-chat-view .message.is-source .message-profile small {
    display: none;
  }

  .is-chat-view .message.is-assistant .message-content,
  .is-chat-view .message.is-source .message-content {
    padding: 0 0 19px 13px;
  }

  .is-chat-view .message.is-assistant .message-content > p {
    font-size: 16px;
    line-height: 1.78;
  }

  .is-chat-view .message.is-user.is-reply {
    width: 89%;
    grid-template-columns: minmax(0, 1fr) 35px;
    gap: 8px;
    padding: 17px 0;
  }

  .is-chat-view .message.is-user.is-reply .message-profile {
    display: block;
    padding-top: 3px;
  }

  .is-chat-view .message.is-user.is-reply .message-profile > strong {
    display: none;
  }

  .is-chat-view .message.is-user.is-reply .message-content > p {
    padding: 13px 14px;
    font-size: 15px;
    line-height: 1.7;
  }

  .is-chat-view .message.is-user.is-opening,
  .is-chat-view .message.is-topic.is-opening {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 24px 0;
  }

  .is-chat-view .message.is-user.is-opening .message-profile,
  .is-chat-view .message.is-topic.is-opening .message-profile {
    display: block;
  }

  .is-chat-view .message.is-user.is-opening .message-content > p,
  .is-chat-view .message.is-topic.is-opening .message-content > p {
    font-size: 22px;
  }

  .is-chat-view .message-tools {
    gap: 6px;
  }

  .is-chat-view .source-chip,
  .is-chat-view .ai-chip {
    font-size: 8px;
  }
}
