:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #152424;
  background: #f7faf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
}

.relationship-v11-shell,
.companion-home-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 22px;
  background:
    linear-gradient(140deg, rgba(12, 78, 74, 0.12), transparent 36%),
    linear-gradient(26deg, rgba(204, 89, 70, 0.11), transparent 34%),
    #f7faf8;
}

.living-intro,
.match-card,
.living-home-topbar,
.companion-home {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}

.living-intro {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: end;
}

.living-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #183231;
}

.living-brand strong,
.living-brand span {
  display: block;
}

.living-brand span {
  color: #60716e;
  font-size: 13px;
}

.living-brand.compact {
  gap: 10px;
}

.living-copy h1 {
  margin: 0;
  color: #142c2b;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.living-copy p {
  max-width: 620px;
  margin: 16px 0 0;
  color: #526764;
  font-size: 17px;
  line-height: 1.7;
}

.match-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.match-portrait,
.match-body,
.relationship-memory-strip > div {
  border: 1px solid rgba(29, 75, 70, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(20, 53, 50, 0.08);
}

.match-portrait {
  min-height: 560px;
  position: relative;
  overflow: hidden;
  background: #eaf1ed;
}

.match-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.match-status {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 16px;
  border-radius: 8px;
  color: #f8fffd;
  background: rgba(18, 42, 40, 0.72);
  backdrop-filter: blur(14px);
}

.match-status span,
.presence-state,
.match-body small,
.relationship-memory-strip span {
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.match-status p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.match-body {
  min-height: 560px;
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.match-body small {
  color: #c76650;
}

.match-body h2,
.home-presence h1 {
  margin: 12px 0 0;
  color: #152a29;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.match-body p,
.home-presence p {
  margin: 20px 0 0;
  color: #4d6360;
  font-size: 17px;
  line-height: 1.75;
}

.trait-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
}

.trait-row span {
  padding: 8px 10px;
  border: 1px solid #d6e4df;
  border-radius: 8px;
  color: #0d5c55;
  background: #f7fbf9;
  font-size: 13px;
  font-weight: 800;
}

.voice-preview {
  margin: 28px 0 0;
  padding: 16px;
  border: 1px solid #d9e5e1;
  border-radius: 8px;
  text-align: left;
  color: #1f3331;
  background: #fff;
}

.voice-preview span {
  display: block;
  color: #60716e;
  font-size: 12px;
  font-weight: 800;
}

.voice-preview strong {
  display: block;
  margin-top: 7px;
  line-height: 1.5;
}

.voice-inline-note {
  margin-top: 10px;
  color: #60716e;
  font-size: 13px;
  line-height: 1.5;
}

.match-actions,
.home-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.match-actions button,
.home-actions button {
  min-height: 46px;
  border: 1px solid #0d5c55;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: #0d5c55;
  font-weight: 850;
}

.match-actions button.secondary,
.home-actions button.secondary,
.quiet-login {
  color: #0d5c55;
  background: #fff;
}

.match-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.candidate-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.candidate-picker button {
  min-height: 64px;
  border: 1px solid #d9e5e1;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: #263a38;
  background: #fbfdfc;
}

.candidate-picker button.selected {
  border-color: #0d5c55;
  color: #0d5c55;
  background: #eef8f5;
  box-shadow: inset 0 0 0 1px rgba(13, 92, 85, 0.1);
}

.candidate-picker span,
.candidate-picker small {
  display: block;
}

.candidate-picker span {
  font-weight: 850;
}

.candidate-picker small {
  margin-top: 5px;
  color: #60716e;
  font-size: 12px;
  line-height: 1.35;
}

.quiet-login {
  align-self: flex-start;
  margin-top: 18px;
  border: 0;
  padding: 0;
  font-weight: 800;
}

.living-home-topbar {
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.companion-home {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(320px, 1fr);
  grid-template-rows: minmax(420px, auto) auto;
  gap: 16px;
}

.home-portrait {
  grid-row: span 2;
  overflow: hidden;
  border-radius: 8px;
  background: #e7f0ec;
  box-shadow: 0 20px 56px rgba(20, 53, 50, 0.1);
}

.home-portrait img {
  width: 100%;
  height: 100%;
  min-height: 640px;
  display: block;
  object-fit: cover;
}

.home-presence {
  align-self: center;
  padding: clamp(24px, 4vw, 56px);
}

.presence-state {
  color: #c76650;
}

.relationship-memory-strip {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.relationship-memory-strip > div {
  padding: 16px;
  box-shadow: none;
}

.relationship-memory-strip span {
  color: #71817e;
}

.relationship-memory-strip strong {
  display: block;
  margin-top: 8px;
  color: #19302f;
  font-size: 18px;
  line-height: 1.35;
}

.relationship-memory-strip small {
  display: block;
  margin-top: 8px;
  color: #60716e;
  line-height: 1.5;
}

button, a {
  font: inherit;
}

button {
  cursor: pointer;
  line-height: 1.18;
}

.nav-action,
.user-form button,
.admin-form button,
.auth-tabs button,
.secondary-action,
.delete-relationship,
.relationship-head button,
.chat-form button,
.voice-controls button,
.voice-delete-confirm,
.voice-delete-cancel,
.create-relationship {
  white-space: nowrap;
  word-break: keep-all;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 18px;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(20, 94, 84, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(216, 101, 79, 0.09), transparent 32%),
    #f7faf8;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1480px;
  margin: 0 auto 16px;
  padding: 0 8px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: block;
  border-radius: 10px;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: #647270;
  font-size: 13px;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #425452;
  font-size: 14px;
}

.nav-action {
  border: 1px solid #d9e2df;
  border-radius: 8px;
  padding: 8px 10px;
  color: #0d5c55;
  background: #fff;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  color: #0d5c55;
  background: #fff;
}

.workspace {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 132px minmax(350px, 0.94fr) minmax(260px, 0.66fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}

.workspace > * {
  min-width: 0;
}

.relationship-summary-panel {
  padding-bottom: 16px;
}

.summary-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.summary-hero span,
.summary-trait span {
  display: block;
  color: #667673;
  font-size: 12px;
  font-weight: 800;
}

.summary-hero strong {
  display: block;
  margin-top: 5px;
  color: #172827;
  font-size: 22px;
}

.summary-hero small {
  display: block;
  margin-top: 6px;
  color: #0d5c55;
  line-height: 1.4;
}

.summary-traits {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.summary-trait {
  padding: 11px;
  border: 1px solid #e1ebe7;
  border-radius: 8px;
  background: #fbfdfc;
}

.summary-trait strong {
  display: block;
  margin-top: 4px;
  color: #263a38;
  font-size: 15px;
}

.summary-trait small {
  display: block;
  margin-top: 5px;
  color: #667673;
  line-height: 1.45;
  text-wrap: balance;
}

.onboarding-shell {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.relationship-entry {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rail,
.config-panel,
.preview-panel,
.relationship-panel,
.user-create-panel,
.user-memory-note {
  border: 1px solid rgba(29, 75, 70, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(20, 53, 50, 0.06);
}

.rail {
  padding: 14px;
}

.step {
  padding: 14px 10px;
  border-left: 2px solid #dfe7e4;
}

.step span {
  color: #bf7255;
  font-size: 12px;
  font-weight: 800;
}

.step p {
  margin: 5px 0 0;
  color: #52625f;
  font-size: 13px;
}

.step.active {
  border-left-color: #0d5c55;
}

.step.active p {
  color: #152424;
  font-weight: 700;
}

.config-panel,
.preview-panel,
.relationship-panel,
.user-create-panel,
.user-memory-note {
  padding: 20px;
}

.user-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.user-form label {
  display: grid;
  gap: 7px;
}

.user-form label span {
  color: #263a38;
  font-size: 14px;
  font-weight: 800;
}

.user-form .check-row {
  display: flex;
  grid-template-columns: none;
  gap: 9px;
  align-items: center;
}

.user-form .check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: #0d5c55;
}

.user-form .check-row span {
  color: #425452;
  font-size: 13px;
  line-height: 1.35;
}

.consent-box,
.complaint-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe9e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.consent-box small {
  color: #667673;
  line-height: 1.45;
}

.consent-box a {
  color: #0d5c55;
  font-weight: 800;
}

.user-form input,
.user-form select,
.user-form textarea {
  width: 100%;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 12px;
  color: #172827;
  background: #fff;
  line-height: 1.5;
  outline: none;
}

.user-form input:focus,
.user-form select:focus,
.user-form textarea:focus {
  border-color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.user-form .check-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  box-shadow: none;
}

.user-form button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-weight: 900;
}

.user-memory-note h2,
.user-memory-note h3 {
  margin: 0 0 12px;
}

.user-memory-note h3 {
  margin-top: 20px;
  font-size: 16px;
}

.memory-rule {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid #e7eeeb;
  color: #4a5c59;
  line-height: 1.5;
}

.memory-rule strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-size: 12px;
}

.existing-users {
  display: grid;
  gap: 8px;
}

.existing-users button {
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 11px;
  background: #fff;
  text-align: left;
}

.relationship-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  align-items: stretch;
}

.relationship-row > button:first-child {
  min-width: 0;
}

.delete-action-group,
.danger-action-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.delete-action-group.confirming,
.danger-action-group.confirming {
  grid-template-columns: minmax(0, 1fr) 56px;
}

.delete-relationship {
  display: grid;
  place-items: center;
  border: 1px solid #f0d2ca !important;
  color: #9a3b2c;
  background: #fff8f5 !important;
  text-align: center !important;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 900;
}

.delete-relationship.confirming {
  color: #fff;
  background: #a83a2b !important;
  border-color: #a83a2b !important;
}

.cancel-delete {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid #d9e2df !important;
  border-radius: 8px;
  color: #48635f !important;
  background: #fff !important;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 6px;
}

.existing-users strong,
.existing-users small {
  display: block;
}

.existing-users small {
  margin-top: 4px;
  color: #667673;
}

.admin-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e3ebe8;
}

.admin-head small {
  display: block;
  color: #667673;
  line-height: 1.5;
}

.admin-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-form.compact {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf2f0;
}

.admin-form label {
  display: grid;
  gap: 6px;
}

.admin-form span {
  color: #263a38;
  font-size: 13px;
  font-weight: 800;
}

.admin-form input {
  width: 100%;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 10px;
  color: #172827;
}

.admin-form button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-weight: 900;
}

.admin-users {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-user {
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.admin-user strong,
.admin-user small,
.admin-user em {
  display: block;
}

.admin-user small,
.admin-user em {
  margin-top: 4px;
  color: #667673;
  font-size: 12px;
  line-height: 1.4;
}

.admin-user em {
  color: #a06047;
  font-style: normal;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.auth-tabs button,
.secondary-action {
  min-height: 42px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  background: #fff;
  color: #263a38;
  font-weight: 800;
}

.auth-tabs button.selected {
  border-color: #0d5c55;
  color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.secondary-action {
  width: 100%;
  margin-top: 14px;
}

.muted {
  color: #667673;
  line-height: 1.5;
}

.error-note {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #8f2e1f;
  background: #fff1ed;
  line-height: 1.5;
}

.success-note {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #0d5c55;
  background: #edf7f3;
  line-height: 1.5;
}

.section-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.section-title p {
  margin: 10px 0 20px;
  color: #596966;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.option-block {
  margin-top: 18px;
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.block-head h2 {
  margin: 0;
  font-size: 16px;
}

.block-head span {
  color: #75827f;
  font-size: 12px;
}

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

.option-card,
.profession-card,
.mini-choice,
.line-choice {
  border: 1px solid #dce5e2;
  border-radius: 8px;
  background: #fff;
  color: #172827;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.option-card:hover,
.profession-card:hover,
.mini-choice:hover,
.line-choice:hover {
  border-color: #8eb7ae;
}

.option-card.selected,
.profession-card.selected,
.mini-choice.selected,
.line-choice.selected {
  border-color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.option-card {
  min-height: 96px;
  padding: 13px;
}

.option-card strong,
.option-card small,
.option-card em {
  display: block;
  text-wrap: balance;
}

.option-card small,
.profession-card small,
.option-card em {
  color: #667673;
  line-height: 1.45;
  font-size: 12px;
}

.option-card small {
  margin-top: 8px;
}

.option-card em {
  margin-top: 7px;
  font-style: normal;
  color: #a06047;
}

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

.profession-card {
  min-height: 118px;
  padding: 12px;
}

.profession-card span {
  display: inline-block;
  margin-bottom: 8px;
  color: #bd6b4b;
  font-size: 12px;
  font-weight: 800;
}

.profession-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  text-wrap: balance;
}

.mbti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.mbti-card {
  min-height: 228px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 12px;
  color: #172827;
  background: #fff;
  text-align: left;
}

.mbti-card.selected {
  border-color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.mbti-card strong {
  font-size: 14px;
  line-height: 1.35;
  display: block;
}

.mbti-card small {
  color: #667673;
  line-height: 1.45;
  font-size: 12px;
  display: block;
  flex: 1;
}

.mbti-avatar-shell,
.mbti-fallback-avatar,
.mbti-original-avatar,
.mbti-avatar-svg {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.mbti-avatar-shell,
.mbti-fallback-avatar {
  display: block;
  overflow: hidden;
  border-radius: 14px;
}

.mbti-original-avatar {
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 8px 14px rgba(18, 53, 49, 0.14));
}

.mbti-avatar-svg {
  display: block;
  filter: drop-shadow(0 8px 14px rgba(18, 53, 49, 0.14));
}

.companion-card {
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7eeeb;
}

.avatar-wrap {
  position: relative;
  width: 98px;
  height: 98px;
  margin: 4px auto 12px;
}

.avatar-wrap.large {
  width: 118px;
  height: 118px;
  margin: 0;
}

.avatar {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #0d5c55, #d86650);
  font-size: 42px;
  font-weight: 900;
}

.avatar-img {
  width: 98px;
  height: 98px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 12px 28px rgba(18, 53, 49, 0.18);
}

.avatar-img.large {
  width: 118px;
  height: 118px;
}

.companion-editor {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin: 16px 0 4px;
}

.name-field,
.upload-field {
  display: grid;
  gap: 6px;
}

.name-field span,
.upload-field span {
  color: #263a38;
  font-size: 13px;
  font-weight: 800;
}

.name-field input,
.upload-field input:not([type="file"]) {
  width: 100%;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.avatar-upload-button {
  width: fit-content;
  min-height: 32px;
  border: 1px solid #0d5c55;
  border-radius: 7px;
  color: #fff !important;
  background: #0d5c55;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 12px;
}

.file-picker .avatar-upload-button {
  pointer-events: none;
}

.file-picker:has(input:disabled) .avatar-upload-button {
  border-color: #dce5e2;
  color: #8b9895 !important;
  background: #f2f5f4;
}

.file-picker {
  position: relative;
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
}

.file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker input[type="file"]:disabled {
  cursor: not-allowed;
}

.file-button {
  min-height: 32px;
  display: inline-grid !important;
  place-items: center;
  padding: 7px 12px;
  border: 1px solid #dce5e2;
  border-radius: 7px;
  color: #0d5c55 !important;
  background: #fff;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap;
}

.file-picker:has(input:disabled) .file-button {
  color: #8b9895 !important;
  background: #f2f5f4;
}

.status-dot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #d6a33d;
}

.companion-card h2 {
  margin: 0;
  font-size: 24px;
}

.companion-card p {
  margin: 8px 0 12px;
  color: #667673;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.chips span {
  padding: 6px 9px;
  border-radius: 8px;
  background: #edf5f2;
  color: #0d5c55;
  font-size: 12px;
  font-weight: 700;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.mini-choice {
  padding: 9px 10px;
  font-size: 13px;
}

.split-controls {
  display: grid;
  gap: 18px;
}

.split-controls h3,
.memory-list h3 {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0 0 10px;
  color: #263a38;
  font-size: 15px;
}

.line-choice {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
}

.line-choice small {
  display: block;
  color: #75827f;
  font-size: 11px;
  line-height: 1.35;
}

.line-choice svg:last-child {
  margin-left: auto;
  color: #0d5c55;
}

.line-choice b {
  margin-left: auto;
  color: #0d5c55;
}

.create-relationship {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.create-relationship:disabled {
  color: #6c7774;
  background: #dfe7e4;
  cursor: not-allowed;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13, 92, 85, 0.2);
  border-top-color: #0d5c55;
  border-radius: 50%;
  animation: spin 780ms linear infinite;
}

.spinner.small {
  width: 13px;
  height: 13px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.locked-panel {
  background: rgba(246, 248, 247, 0.92);
}

.locked-panel button,
.locked-panel input,
.locked-panel select,
.locked-panel textarea {
  cursor: not-allowed;
}

.option-card:disabled,
.profession-card:disabled,
.mini-choice:disabled,
.line-choice:disabled,
.name-field input:disabled,
.upload-field input:disabled {
  opacity: 0.58;
  background: #f2f5f4;
}

.relationship-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.relationship-head small {
  display: block;
  margin-top: 4px;
  color: #667673;
  font-size: 12px;
}

.relationship-head h2 {
  margin: 0;
  font-size: 20px;
}

.relationship-head button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  background: #0d5c55;
  font-weight: 800;
}

.chat-panel {
  grid-column: 3 / -1;
  min-height: 760px;
}

.chat-preview {
  padding: 14px;
  border: 1px solid #e4ece9;
  border-radius: 8px;
  background: #fbfdfc;
}

.chat-window {
  height: 292px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #e4ece9;
  border-radius: 8px;
  background: #fbfdfc;
}

.message {
  max-width: 92%;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.52;
  font-size: 14px;
}

.message.user {
  margin-left: auto;
  color: #fff;
  background: #245a56;
}

.message.ai {
  margin-top: 10px;
  color: #263a38;
  background: #eef5f2;
}

.message.ai.readable {
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.message.ai.readable:hover,
.message.ai.readable:focus-visible {
  background: #e3f0ec;
  box-shadow: 0 0 0 2px rgba(13, 92, 85, 0.15);
  outline: none;
}

.message.ai strong,
.message.user strong {
  font-weight: 800;
}

.message.ai em {
  font-style: italic;
}

.message.ai p {
  margin: 0;
}

.message.ai p + p {
  margin-top: 0.55em;
}

.message.thinking {
  color: #667673;
  font-style: italic;
}

.chat-playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.chat-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  background: #f2f6f4;
}

.chat-mode-switch button,
.chat-speak-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  color: #526461;
  background: transparent;
  font-weight: 800;
}

.chat-mode-switch button.selected {
  color: #fff;
  background: #0d5c55;
}

.chat-speak-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #0d5c55;
  background: #edf7f3;
}

.chat-speak-button.busy {
  min-width: 112px;
}

.chat-speak-button .spinner.small {
  border-color: rgba(13, 92, 85, 0.24);
  border-top-color: #0d5c55;
}

.chat-speak-button:disabled {
  opacity: 1;
  cursor: wait;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  margin-top: 10px;
}

.composer-box {
  position: relative;
  min-height: 138px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.chat-form textarea {
  width: 100%;
  height: 100%;
  resize: vertical;
  min-height: 138px;
  max-height: 260px;
  border: 0;
  border-radius: 0;
  padding: 13px 14px;
  color: #172827;
  background: transparent;
  line-height: 1.5;
  outline: none;
}

.composer-box.has-image textarea {
  padding-top: 124px;
}

.composer-image-chips {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  z-index: 1;
}

.composer-image-chip {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  overflow: hidden;
  background: #f7faf8;
}

.composer-image-chip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.composer-image-chip button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  font-size: 16px;
  line-height: 1;
}

.composer-image-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  max-width: calc(100% - 8px);
  border-radius: 4px;
  padding: 2px 5px;
  color: #fff;
  background: rgba(23, 40, 39, 0.72);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.composer-image-status.completed {
  background: rgba(13, 92, 85, 0.86);
}

.composer-image-status.failed {
  background: rgba(159, 63, 49, 0.9);
}

.chat-form textarea:focus {
  box-shadow: none;
}

.composer-box:focus-within {
  border-color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.chat-form button,
.chat-image-upload {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-weight: 800;
  min-height: 42px;
}

.chat-form button:disabled,
.chat-image-upload.disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-actions {
  display: grid;
  gap: 8px;
}

.chat-actions button:first-child,
.chat-image-upload {
  color: #0d5c55;
  background: #edf7f3;
}

.chat-image-upload {
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-image-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.vision-notice,
.background-jobs-panel,
.pending-image-panel,
.visual-people-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e0e9e6;
  border-radius: 8px;
  background: #fbfdfc;
}

.background-jobs-panel {
  display: grid;
  gap: 8px;
}

.background-jobs-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.background-jobs-head small {
  color: #667673;
}

.background-job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e0e9e6;
  border-radius: 8px;
  background: #fff;
}

.background-job strong,
.background-job small {
  display: block;
}

.background-job small {
  margin-top: 3px;
  color: #667673;
  line-height: 1.4;
}

.background-job.failed {
  border-color: #efc8bd;
  background: #fff8f5;
}

.background-job-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efec;
}

.background-job-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #0d5c55;
  transition: width 0.25s ease;
}

.background-job.processing .background-job-progress span {
  animation: job-pulse 1.2s ease-in-out infinite;
}

.background-job button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  color: #9f3f31;
  background: #fff0ec;
  font-size: 12px;
  font-weight: 800;
}

@keyframes job-pulse {
  50% { opacity: 0.55; }
}

.vision-notice {
  display: grid;
  gap: 5px;
  color: #4c5f5c;
  font-size: 13px;
  line-height: 1.45;
}

.pending-image-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(240px, 1fr);
  gap: 12px;
}

.pending-image-panel p {
  margin: 6px 0;
  color: #536461;
  line-height: 1.55;
  font-size: 13px;
}

.visual-profile-form {
  display: grid;
  gap: 8px;
}

.visual-profile-form label {
  display: grid;
  gap: 5px;
  color: #667673;
  font-size: 12px;
  font-weight: 800;
}

.visual-profile-form input,
.visual-profile-form select {
  width: 100%;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 9px 10px;
  color: #172827;
  background: #fff;
}

.visual-profile-form button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #0d5c55;
  font-weight: 800;
}

.visual-profile-form button:disabled {
  opacity: 0.55;
}

.visual-duplicate-prompt {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e6c98d;
  border-radius: 8px;
  background: #fffaf0;
}

.visual-duplicate-prompt small {
  color: #667673;
  line-height: 1.45;
}

.visual-duplicate-prompt button {
  min-height: 38px;
  padding: 7px 10px;
  text-align: left;
}

.visual-duplicate-prompt button.secondary {
  color: #526461;
  background: #eef3f1;
}

.visual-consent-row {
  display: flex !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  font-weight: 700 !important;
}

.visual-profile-form .visual-consent-row input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.visual-consent-row span {
  flex: 1 1 auto;
  text-align: left;
}

.visual-people-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.visual-people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.visual-person-card {
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid #e0e9e6;
  border-radius: 8px;
  background: #fff;
}

.visual-person-card img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

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

.visual-person-card small {
  margin-top: 3px;
  color: #667673;
  line-height: 1.35;
}

.visual-delete,
.visual-delete-actions button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  color: #9f3f31;
  background: #fff0ec;
  font-size: 12px;
  font-weight: 800;
}

.visual-delete-actions {
  display: grid;
  gap: 5px;
}

.visual-delete-actions button:last-child {
  color: #536461;
  background: #eef3f1;
}

.chat-image-thumb {
  display: block;
  width: min(150px, 36vw);
  max-height: 180px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.voice-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #e4ece9;
  border-radius: 8px;
  background: #fbfdfc;
}

.voice-panel-intro strong,
.voice-panel-intro p {
  display: block;
}

.voice-panel-intro p {
  margin: 4px 0 0;
  color: #596966;
  font-size: 12px;
  line-height: 1.4;
}

.voice-panel-note {
  margin: 0;
}

.voice-panel strong,
.voice-panel small {
  display: block;
}

.voice-panel p {
  margin: 4px 0;
  color: #596966;
  font-size: 12px;
  line-height: 1.4;
}

.voice-panel small {
  color: #667673;
  font-size: 11px;
  line-height: 1.35;
}

.voice-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  align-items: start;
  width: 100%;
}

.voice-choice-row {
  display: block;
  width: 100%;
  min-height: 78px;
}

.voice-choice-row.confirming-delete {
  height: auto;
}

.voice-choice-row .voice-choice {
  width: 100%;
  height: 78px;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  color: #172827;
  background: #fff;
  text-align: left;
}

.voice-choice-row.confirming-delete .voice-choice {
  height: auto;
  min-height: 78px;
  border-radius: 8px 8px 0 0;
  border-bottom-color: #f0d2ca;
}

.voice-choice-row.selected .voice-choice {
  border-color: #0d5c55;
  box-shadow: 0 0 0 3px rgba(13, 92, 85, 0.11);
}

.voice-choice-row.warning .voice-choice {
  border-color: #efc7bc;
  background: #fff8f5;
}

.voice-choice strong,
.voice-choice small {
  display: block;
  min-width: 0;
}

.voice-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.voice-choice small {
  margin-top: 3px;
  overflow: hidden;
  color: #667673;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-choice-copy {
  min-width: 0;
}

.voice-choice b {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 22px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #0d5c55;
  background: #edf7f3;
  font-size: 11px;
}

.voice-choice-actions {
  display: grid;
  gap: 5px;
  justify-items: stretch;
  min-width: 42px;
}

.voice-delete {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 22px;
  padding: 4px 6px;
  border: 1px solid #f0d2ca;
  border-radius: 6px;
  color: #9a3b2c;
  background: #fff8f5;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.voice-delete-banner {
  width: 100%;
  padding: 10px 12px 12px;
  border: 1px solid #f0d2ca;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff8f5;
}

.voice-delete-banner p {
  margin: 0 0 10px;
  color: #6d4a42;
  font-size: 11px;
  line-height: 1.45;
}

.voice-delete-banner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.voice-delete-confirm,
.voice-delete-cancel {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.voice-delete-confirm {
  border: 1px solid #a83a2b;
  color: #fff;
  background: #a83a2b;
}

.voice-delete-cancel {
  border: 1px solid #d9e2df;
  color: #48635f;
  background: #fff;
}

.voice-error {
  color: #8f2e1f !important;
}

.voice-ok {
  color: #0d5c55 !important;
}

.voice-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.voice-name-field {
  display: grid;
  gap: 5px;
}

.voice-name-field span {
  color: #263a38;
  font-size: 11px;
  font-weight: 800;
}

.voice-name-field input {
  width: 100%;
  min-height: 32px;
  border: 1px solid #dce5e2;
  border-radius: 7px;
  padding: 7px 8px;
  color: #172827;
  background: #fff;
  font-size: 12px;
}

.voice-upload {
  display: grid;
  gap: 4px;
}

.voice-upload span {
  color: #263a38;
  font-size: 11px;
  font-weight: 800;
}

.voice-upload input:not([type="file"]) {
  width: 100%;
  font-size: 11px;
}

.voice-upload-guide {
  display: block;
  width: 100%;
  max-width: 100%;
  color: #667673;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
}

.voice-upload-guide-wide {
  grid-column: 1 / -1;
}

.voice-action-row {
  display: grid;
  grid-template-columns: minmax(112px, 1fr);
  gap: 8px;
}

.file-chosen {
  display: block;
  margin-top: 2px;
  padding: 4px 6px;
  border-radius: 5px;
  background: #edf7f3;
  color: #0d5c55;
  font-size: 11px;
  font-weight: 700;
  word-break: break-all;
}

.relationship-voice-upload {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #b9cbc6;
  border-radius: 8px;
  background: #fbfdfc;
}

.relationship-voice-upload span {
  color: #263a38;
  font-size: 13px;
  font-weight: 800;
}

.relationship-voice-upload input:not([type="file"]) {
  width: 100%;
  font-size: 12px;
}

.relationship-voice-upload small,
.relationship-voice-upload .voice-upload-guide {
  color: #667673;
  line-height: 1.45;
  text-align: left;
}

.voice-controls button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #0d5c55;
  font-size: 11px;
  font-weight: 700;
}

.voice-controls button:disabled {
  color: #71817e;
  background: #e3ebe8;
  cursor: not-allowed;
}

.gentle-intake {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f2f8f5;
  color: #40524f;
}

.gentle-intake strong,
.gentle-intake small {
  display: block;
}

.gentle-intake p {
  margin: 6px 0;
  line-height: 1.5;
  font-size: 13px;
}

.gentle-intake small {
  color: #0d5c55;
  line-height: 1.45;
}

.insight-card,
.safety-card,
.memory-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.insight-card,
.safety-card {
  margin-top: 14px;
  padding: 13px;
  border-radius: 8px;
  background: #fff6f1;
  color: #34413f;
}

.insight-card svg,
.safety-card svg {
  color: #bd684b;
  flex: 0 0 auto;
}

.card-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fff;
  background: #bd684b;
  font-size: 12px;
  font-weight: 800;
}

.card-icon.small {
  width: 22px;
  height: 22px;
  background: #0d5c55;
}

.insight-card strong,
.safety-card strong {
  display: block;
  margin-bottom: 5px;
}

.insight-card p,
.safety-card p {
  margin: 0;
  color: #5f6c69;
  line-height: 1.5;
  font-size: 13px;
}

.memory-list {
  margin-top: 16px;
}

.memory-item {
  min-height: 44px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #e4ece9;
  border-radius: 8px;
  background: #fff;
  color: #4a5c59;
  line-height: 1.45;
  font-size: 13px;
}

.memory-item svg {
  color: #0d5c55;
  flex: 0 0 auto;
}

.safety-card {
  background: #eef7f4;
}

.safety-card svg {
  color: #0d5c55;
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.data-actions button,
.complaint-box button {
  min-height: 40px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  color: #0d5c55;
  background: #fff;
  font-weight: 900;
}

.data-actions .danger-action-group > button {
  width: 100%;
}

.data-actions .danger-confirm {
  color: #fff;
  border-color: #a83a2b;
  background: #a83a2b;
}

.danger-action-note {
  margin-top: 10px;
}

.complaint-box {
  margin-top: 10px;
}

.complaint-box textarea {
  width: 100%;
  border: 1px solid #dce5e2;
  border-radius: 8px;
  padding: 11px;
  resize: vertical;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 130px 1fr 360px;
  }

  .mbti-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relationship-panel {
    grid-column: 2 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .topbar nav {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar nav a {
    display: none;
  }

  .topbar nav .nav-action {
    flex: 1;
    min-height: 40px;
  }

  .workspace {
    width: calc(100vw - 24px);
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-shell {
    width: calc(100vw - 24px);
    grid-template-columns: minmax(0, 1fr);
  }

  .relationship-entry {
    width: calc(100vw - 24px);
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .step {
    border-left: 0;
    border-top: 2px solid #dfe7e4;
    padding: 10px 6px;
  }

  .option-grid,
  .profession-grid,
  .mbti-grid {
    grid-template-columns: 1fr;
  }

  .config-panel,
  .preview-panel,
  .relationship-panel,
  .user-create-panel,
  .user-memory-note {
    width: 100%;
    max-width: calc(100vw - 24px);
    padding: 18px;
  }

  .rail {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .companion-editor {
    grid-template-columns: 1fr;
  }

  .section-title h1 {
    font-size: 26px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-playback-bar {
    align-items: stretch;
  }

  .chat-mode-switch,
  .chat-speak-button {
    flex: 1;
  }

  .composer-box {
    min-height: 156px;
  }

  .chat-form textarea {
    min-height: 156px;
  }

  .chat-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pending-image-panel {
    grid-template-columns: 1fr;
  }

  .background-job {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .background-job-progress {
    grid-column: 1 / -1;
  }

  .visual-people-grid {
    grid-template-columns: 1fr;
  }

  .visual-person-card {
    grid-template-columns: 54px minmax(0, 1fr) auto;
  }

  .voice-panel {
    grid-template-columns: 1fr;
  }

  .voice-library {
    grid-template-columns: 1fr;
  }

  .voice-choice-row,
  .voice-delete-banner {
    width: 100%;
  }

  .voice-action-row {
    grid-template-columns: 1fr;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }

  .chat-form button {
    min-height: 44px;
  }

  .relationship-panel {
    grid-column: auto;
  }

  .chat-panel {
    order: 1;
    min-height: 0;
  }

  .relationship-summary-panel {
    order: 2;
  }

  .rail {
    order: 3;
  }

  .summary-hero {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .summary-hero .avatar-wrap.large,
  .summary-hero .avatar-img.large {
    width: 76px;
    height: 76px;
  }

  .summary-hero strong {
    font-size: 20px;
  }

  .summary-traits {
    grid-template-columns: 1fr;
  }

  .chat-window {
    height: 360px;
  }

  .relationship-row {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .relationship-v11-shell,
  .companion-home-shell {
    align-content: start;
    padding: 14px 0 24px;
  }

  .living-intro,
  .match-card,
  .living-home-topbar,
  .companion-home {
    width: calc(100vw - 24px);
  }

  .living-intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .living-copy h1 {
    font-size: 42px;
  }

  .living-copy p {
    font-size: 15px;
  }

  .match-card,
  .companion-home,
  .relationship-memory-strip {
    grid-template-columns: 1fr;
  }

  .candidate-picker {
    grid-template-columns: 1fr;
  }

  .match-portrait,
  .match-body {
    min-height: 0;
  }

  .match-portrait {
    aspect-ratio: 4 / 5;
  }

  .match-body {
    padding: 22px;
  }

  .match-body h2,
  .home-presence h1 {
    font-size: 48px;
  }

  .home-portrait {
    grid-row: auto;
    aspect-ratio: 4 / 5;
  }

  .home-portrait img {
    min-height: 0;
  }

  .home-presence {
    padding: 10px 2px 4px;
  }

  .relationship-memory-strip {
    grid-column: auto;
  }
}
