/* ============================================================================
   灵魂董事会 · V5.1 视觉系统
   米白纸感 + 黄铜 + 墨色。侧栏为浅色议事厅目录，主区为席位台与聊天流。
   所有颜色与字体均为本地定义，不依赖外部字体或 CDN（与 CSP 一致）。
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --paper-2: #f2ede2;
  --rail: #f3efe5;
  --surface: #fffdf8;
  --surface-2: #faf6ed;
  --ink: #2b2721;
  --ink-2: #4a443a;
  --muted: #6f6759;
  --faint: #9b9384;
  --line: #e7dec9;
  --line-2: #d9cdb4;
  --brass: #a5814e;
  --brass-2: #c2a473;
  --brass-3: #efe4cf;
  --navy: #2f2b24;
  --green: #4a6f58;
  --red: #a4463c;
  --amber: #8a5a1e;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(43, 39, 33, .05);
  --shadow-2: 0 18px 40px -28px rgba(43, 39, 33, .45);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

body.is-auth { display: grid; place-items: center; padding: 24px; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p, dl, dd, dt, figure { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; border-radius: 6px; }

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

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 16px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fbf7ec; box-shadow: 0 10px 22px -16px rgba(47, 43, 36, .95); }
.btn-primary:not(:disabled):hover { background: #3c372d; }
.btn-ghost { background: rgba(255, 255, 255, .6); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:not(:disabled):hover { border-color: var(--line-2); background: #fff; }
.btn-danger { color: var(--red); border-color: #ecd9d3; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:not(:disabled):hover { background: #8d3b32; }
.btn-lg { min-height: 46px; padding: 10px 24px; font-size: 14.5px; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #e0c79b;
  box-shadow: 0 0 0 3px rgba(224, 199, 155, .18);
}

.link-btn {
  border: 0; background: none; padding: 0; color: var(--brass);
  font-size: 12px; font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  border: 0; background: none; color: #a89c86; line-height: 1;
  width: 24px; height: 24px; border-radius: 7px; font-size: 14px;
}
.icon-btn:hover { background: rgba(165, 129, 78, .12); color: var(--brass); }

/* -------------------------------------------------------------------- auth */

.auth {
  width: min(1080px, 100%);
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 90px -60px rgba(43, 39, 33, .6);
}
.auth-hero {
  position: relative;
  padding: 52px 50px;
  color: #f4f0e6;
  background:
    radial-gradient(560px 320px at 92% 6%, rgba(193, 155, 97, .34), transparent 60%),
    linear-gradient(158deg, #332e26 0%, #29251f 62%, #221f1a 100%);
}
.auth-hero::after {
  content: ""; position: absolute; inset: auto -60px -120px auto;
  width: 320px; height: 320px; border-radius: 50%;
  border: 1px solid rgba(201, 168, 116, .22);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 430px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--brass-2);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(201, 168, 116, .34);
  flex: none;
}
.brand-mark-lg { width: 56px; height: 56px; margin-bottom: 26px; color: #d9b989; }
.auth-hero .eyebrow { color: #b99a6d; margin-top: 22px; }
.auth-hero h1 {
  font-family: var(--serif); font-size: 42px; font-weight: 700;
  letter-spacing: .08em; line-height: 1.28; margin: 6px 0 18px;
}
.auth-hero-lead { color: #c8c1b3; font-size: 14.5px; line-height: 2; }
.auth-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  list-style: none; padding: 24px 0 0; margin: 32px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.auth-facts li { display: grid; gap: 4px; }
.auth-facts strong { font-family: var(--serif); font-size: 25px; color: #e6cba3; font-weight: 700; }
.auth-facts span { font-size: 11.5px; color: #9b9488; letter-spacing: .02em; }
.auth-hero-note { margin-top: 34px; font-size: 11.5px; line-height: 1.8; color: #8b8478; }

.auth-panel { display: grid; place-items: center; padding: 46px 42px; background: var(--surface); }
.auth-card { width: min(360px, 100%); }
.auth-card h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 4px 0 8px; letter-spacing: .02em; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-form { display: grid; gap: 16px; }
.auth-foot { margin-top: 20px; font-size: 11.5px; color: var(--faint); line-height: 1.8; }
.alert {
  border: 1px solid #f2d3cd; background: #fdf1ef; color: #96382f;
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 16px;
}

/* ------------------------------------------------------------------- field */

.field { display: grid; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > span { letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); padding: 10px 12px; font-size: 14px; font-weight: 400;
  color: var(--ink); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  background: #fff; border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(194, 164, 115, .18);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.8; }
.field textarea.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.75; min-height: 190px; }
.field-file input { padding: 8px; font-size: 12.5px; background: #fff; }
.field-narrow { max-width: 360px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ------------------------------------------------------------------- shell */

.app { display: flex; min-height: 100vh; }
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(43, 39, 33, .38);
  backdrop-filter: blur(2px);
}

.rail {
  width: 252px; flex: none;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  position: sticky; top: 0; height: 100vh; z-index: 50;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.rail-head { display: flex; align-items: center; gap: 11px; padding: 2px 6px 22px; }
.seal {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-family: var(--serif); font-size: 17px; font-weight: 700; color: #fbf6e9;
  background: linear-gradient(150deg, #c2a473, #96703c);
  box-shadow: 0 6px 14px -10px rgba(120, 88, 42, .9), inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.brand-text { display: grid; min-width: 0; }
.brand-text strong {
  font-family: var(--serif); font-size: 16px; letter-spacing: .14em; font-weight: 700; color: #2f2a22;
}
.brand-text small { font-size: 8.5px; letter-spacing: .2em; color: #a4977f; margin-top: 3px; }
.rail-close { display: none; margin-left: auto; border: 0; background: none; color: #9b9384; font-size: 15px; }

.rail-nav { display: grid; gap: 4px; margin-bottom: 22px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border-radius: 9px; border: 1px solid transparent;
  background: none; color: #5a5346; text-align: left; font-size: 13px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }
.nav-item.is-active {
  background: var(--surface); border-color: var(--line);
  color: var(--ink); font-weight: 600;
  box-shadow: 0 2px 6px -4px rgba(43, 39, 33, .5);
}
.nav-icon { display: grid; place-items: center; color: #a2916f; flex: none; }
.nav-item.is-active .nav-icon { color: var(--brass); }
.nav-label { flex: 1; min-width: 0; }
.nav-en {
  font-size: 8.5px; letter-spacing: .16em; color: #b0a48c; font-weight: 500;
  white-space: nowrap;
}
.nav-item.is-active .nav-en { color: var(--brass-2); }
.nav-quiet { color: #6f6759; }
.nav-quiet:hover { background: rgba(255, 255, 255, .5); }

.rail-section { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.rail-section-head {
  display: flex; align-items: center; gap: 7px;
  padding: 0 8px 8px; border-top: 1px solid var(--line); padding-top: 16px;
}
.rail-section-title { font-size: 12px; color: #6f6759; font-weight: 600; }
.rail-en { font-size: 8.5px; letter-spacing: .16em; color: #b0a48c; flex: 1; }
.history { overflow-y: auto; min-height: 60px; padding-right: 2px; scrollbar-width: thin; }
.history::-webkit-scrollbar { width: 6px; }
.history::-webkit-scrollbar-thumb { background: rgba(165, 129, 78, .22); border-radius: 99px; }
.rail-empty { font-size: 12px; color: #a1988a; padding: 8px; }

.hist {
  display: grid; gap: 5px; width: 100%; text-align: left;
  padding: 9px 10px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 9px;
  background: none; color: #4d4739;
  transition: background .16s ease, border-color .16s ease;
}
.hist:hover { background: rgba(255, 255, 255, .6); }
.hist.is-active { background: var(--surface); border-color: var(--line); box-shadow: 0 2px 6px -4px rgba(43, 39, 33, .5); }
.hist-title {
  font-size: 12.5px; font-weight: 500; line-height: 1.5; color: #3c372c;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hist-meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #a1988a; flex-wrap: wrap; }
.hist-dot { color: #cbbfa8; }
.hist-completed { color: #6d8a72; }
.hist-error { color: var(--red); }
.hist-running { color: var(--amber); }

.rail-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.account { display: flex; align-items: center; gap: 9px; padding: 0 6px 8px; }
.account-avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: #eae2d1; color: var(--brass);
  font-family: var(--serif); font-size: 14px;
}
.account-text { display: grid; min-width: 0; }
.account-text strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3c372c; }
.account-text small { font-size: 10px; color: #a1988a; }
.logout-form { margin: 0; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 clamp(16px, 3vw, 36px);
  background: rgba(247, 243, 234, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(231, 222, 201, .8);
}
.menu-btn {
  display: none; border: 1px solid var(--line); background: rgba(255, 255, 255, .7);
  border-radius: 8px; width: 32px; height: 32px; place-items: center; color: var(--ink-2);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.crumb-root { color: var(--faint); }
.crumb-sep { color: var(--line-2); }
.topbar-right { margin-left: auto; }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid #e4d7c1; background: #f9f3e6;
  font-size: 10.5px; color: var(--brass); letter-spacing: .02em;
}
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: #7aa88a; box-shadow: 0 0 0 3px rgba(122, 168, 138, .16); }

.main { flex: 1; padding: 26px clamp(16px, 3vw, 36px) 40px; }
.view { max-width: 1080px; margin: 0 auto; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 10px; letter-spacing: .24em; font-weight: 700;
  color: var(--brass); text-transform: uppercase;
}
.hero-lead { color: var(--muted); font-size: 14px; line-height: 1.9; max-width: 62ch; }

/* ---------------------------------------------------------- select: seats */

.assembly {
  padding: 18px 20px 16px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(43, 39, 33, .04), 0 20px 40px -38px rgba(43, 39, 33, .5);
}
.assembly-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.assembly-count { display: flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--ink-2); }
.assembly-count strong {
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.assembly-note { font-size: 11.5px; color: var(--faint); margin-left: 10px; }

.seats {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 16px 0 14px; padding-bottom: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.seats::-webkit-scrollbar { display: none; }
.seat {
  position: relative; flex: 1 1 0; min-width: 78px;
  display: grid; justify-items: center; gap: 6px;
  padding: 8px 4px 6px; border-radius: 12px;
  border: 1px solid transparent; background: none;
  transition: background .16s ease, border-color .16s ease;
}
.seat.is-filled:hover { background: var(--surface-2); border-color: var(--line); }
.seat-name {
  font-size: 11px; color: var(--ink-2); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seat-plus {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px dashed #d6c8ad; color: #bcae93; font-size: 16px;
  background: rgba(255, 255, 255, .5);
}
.seat.is-empty:hover .seat-plus { border-color: var(--brass-2); color: var(--brass); }
.assembly-topic {
  border-top: 1px solid #f0e9db; padding-top: 12px;
}
.assembly-topic textarea {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  padding: 4px 2px; font-size: 14.5px; line-height: 1.85; color: var(--ink);
  max-height: 220px; overflow-y: auto;
}
.assembly-topic textarea::placeholder { color: #ab9f8a; }
.assembly-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.assembly-meta { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.draft-note { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--brass); }
.draft-note button {
  border: 0; background: none; padding: 0; color: var(--brass); font-size: 11px;
  text-decoration: underline;
}
.model-switch {
  margin-left: auto; display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
}
.model-pill { position: relative; display: inline-flex; }
.model-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.model-pill span {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.model-pill input:checked + span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(43, 39, 33, .12); }
.model-pill input:focus-visible + span { outline: 2px solid var(--brass-2); outline-offset: 1px; }

.hint { font-size: 11.5px; color: var(--faint); margin-top: 8px; line-height: 1.75; }

/* --------------------------------------------------------- select: picker */

.picker { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 22px 0 10px; }
.search {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 1 1 220px; min-width: 180px;
  padding: 0 12px; height: 38px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--faint);
}
.search:focus-within { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(194, 164, 115, .16); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 12.5px; height: 100%;
}
.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
}
.seg {
  border: 0; background: none; border-radius: 999px; padding: 5px 12px;
  font-size: 11.5px; color: var(--muted);
}
.seg.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(43, 39, 33, .1); font-weight: 600; }
.picker-hint { font-size: 11.5px; color: var(--faint); margin: 0 0 14px; }

.groups { display: grid; gap: 4px; }
.group { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.group-en { font-size: 9px; letter-spacing: .2em; color: #b3a68d; font-weight: 600; }
.group-name { font-size: 14px; font-weight: 700; color: #3c372c; letter-spacing: .02em; }
.group-count { font-size: 10.5px; color: #b3a68d; font-variant-numeric: tabular-nums; }
.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }

.dc {
  position: relative; display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; min-height: 92px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.dc:hover { border-color: var(--line-2); box-shadow: 0 12px 26px -24px rgba(43, 39, 33, .8); transform: translateY(-1px); }
.dc.is-selected { border-color: var(--brass-2); background: #fffdf6; box-shadow: inset 0 0 0 1px rgba(194, 164, 115, .28); }
.dc.is-disabled { opacity: .62; cursor: not-allowed; background: #faf7f0; }
.dc.is-disabled:hover { transform: none; box-shadow: none; }
.dc-input {
  position: absolute; left: 12px; bottom: 8px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.dc-input:focus-visible ~ .dc-body .dc-name { outline: 2px solid var(--brass-2); outline-offset: 2px; }
.dc-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.dc-name { font-size: 13.5px; font-weight: 700; letter-spacing: .01em; color: #2f2a22; }
.dc-mode {
  font-size: 9px; padding: 0 6px; border-radius: 999px;
  border: 1px solid #ecdcc2; color: #9a7a4b; background: #fbf4e6; white-space: nowrap;
}
.dc-title {
  font-size: 11px; color: #8a7d64; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dc-focus {
  font-size: 10.5px; color: #a89d89; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dc-hit {
  justify-self: start; margin-top: 3px;
  font-size: 9.5px; color: var(--brass); background: #fbf3e4;
  border-radius: 999px; padding: 0 7px;
}
.dc-seat {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brass); color: #fff; font-size: 10px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fineprint { margin-top: 22px; font-size: 10.5px; line-height: 1.8; color: #b0a68f; }

/* --------------------------------------------------------------- meeting */

.view-meeting { max-width: 880px; }

.chamber-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.chamber-head-main { min-width: 0; }
.chamber-head h1 {
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700; line-height: 1.45; margin: 4px 0 8px;
  overflow-wrap: anywhere;
}
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; padding: 0; color: var(--brass);
  font-size: 11.5px; font-weight: 600;
}
.back-link:hover { text-decoration: underline; }
.meeting-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip {
  font-size: 10.5px; color: var(--muted); padding: 1px 9px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .6);
}
.meta-running { color: var(--amber); border-color: #ecdcc1; background: #fdf7ec; }
.meta-completed { color: var(--green); border-color: #d8e6dc; background: #f4f9f5; }
.meta-error { color: var(--red); border-color: #f0d9d4; background: #fdf3f1; }
.meeting-tools { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }

.runbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 253, 248, .9);
}
.runbar-main { flex: 1; min-width: 0; }
.runbar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11.5px; }
.runbar-state { font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
.runbar-count { font-size: 11px; color: var(--brass); font-variant-numeric: tabular-nums; }
.progress { height: 4px; border-radius: 999px; background: #eee6d6; overflow: hidden; margin: 7px 0 5px; }
.progress-fill {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c2a473, #ddc39a);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
.runbar-note { font-size: 11px; color: #a59a86; line-height: 1.65; }
.runbar-actions { display: flex; gap: 6px; flex: none; }

.stream { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }

.phase { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; }
.phase-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }
.phase-label {
  font-size: 9.5px; letter-spacing: .18em; color: #a89a80;
  padding: 3px 11px; border-radius: 999px;
  border: 1px solid #e9dfcb; background: #fbf7ee; white-space: nowrap;
}

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-body { flex: 1; min-width: 0; max-width: 84%; }
.msg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.msg-id { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.msg-name { font-size: 13px; font-weight: 700; letter-spacing: .01em; color: #2f2a22; }
.msg-role { font-size: 10.5px; color: #a89d89; }
.msg-tags { display: flex; gap: 5px; flex: none; }
.tag {
  font-size: 9.5px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--line); color: #a0937c; background: #fbf8f1; white-space: nowrap;
}
.tag-phase { color: #9a7a4b; border-color: #ece0c8; background: #fbf5e8; }
.tag-running { color: var(--amber); border-color: #eedcc0; background: #fdf6ea; }
.tag-error { color: var(--red); border-color: #f0d9d4; background: #fdf3f1; }

.md.msg-md {
  padding: 15px 18px;
  border: 1px solid var(--line); border-radius: 4px 14px 14px 14px;
  background: var(--surface);
  box-shadow: 0 10px 26px -26px rgba(43, 39, 33, .8);
}
.msg-chair .md.msg-md {
  border-color: #e5d5b8; background: linear-gradient(180deg, #fffdf7 0%, #fdf7ea 100%);
  border-radius: 14px;
  box-shadow: 0 16px 34px -30px rgba(120, 88, 42, .8);
}
.msg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; padding-left: 2px; font-size: 10.5px; color: #a89d89; }
.msg-foot .refs { order: 9; }
.msg-seat { font-variant-numeric: tabular-nums; }
.msg-meta-item { color: #b0a68f; }
.msg-pending {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 15px; border-radius: 4px 14px 14px 14px;
  border: 1px dashed #e2d8c6; background: rgba(253, 250, 244, .85);
  font-size: 12px; color: #9d9382;
}
.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--brass-2);
  animation: blink 1.25s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.msg-error {
  padding: 13px 15px; border-radius: 4px 14px 14px 14px;
  border: 1px solid #f0d9d4; background: #fdf4f2;
  font-size: 12.5px; color: #8e3b32;
}
.msg-error strong { display: block; margin-bottom: 4px; font-size: 12.5px; }
.msg-error p { font-size: 12px; line-height: 1.7; color: #a05a52; overflow-wrap: anywhere; }
.msg-error .btn { margin-top: 9px; }

.msg-chair { position: relative; }
.chair-stamp {
  position: absolute; top: 12px; right: 6px;
  font-family: var(--serif); font-size: 12px; letter-spacing: .3em;
  color: rgba(150, 108, 50, .3);
  border: 2px solid rgba(150, 108, 50, .2); border-radius: 5px;
  padding: 2px 7px 2px 9px; transform: rotate(4deg);
  pointer-events: none;
}
.msg-chair .msg-name { font-family: var(--serif); font-size: 14.5px; }
.msg-chair .md.msg-md { padding-right: 64px; }

/* 用户追问气泡 */
.msg-me { justify-content: flex-end; }
.me-body { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 78%; }
.me-bubble {
  padding: 11px 15px; border-radius: 14px 14px 4px 14px;
  background: var(--navy); color: #f8f3e7;
  font-size: 13.8px; line-height: 1.85;
  box-shadow: 0 10px 24px -20px rgba(47, 43, 36, .9);
}
.me-bubble p + p { margin-top: 6px; }
.me-time { font-size: 10px; color: #b0a68f; }
.avatar-me { background: #ece3d0; color: #8a6a3b; }

/* avatars --------------------------------------------------------------- */
.avatar {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: #f0e9da; color: #8a6a3b;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(194, 164, 115, .45);
}
.avatar[data-tone="0"] { background: #eeeae0; color: #6b7382; }
.avatar[data-tone="1"] { background: #f1e8d5; color: #9a7a4b; }
.avatar[data-tone="2"] { background: #e9ede3; color: #5f7a64; }
.avatar[data-tone="3"] { background: #ece8f0; color: #756288; }
.avatar[data-tone="4"] { background: #e5eded; color: #4c7a7d; }
.avatar[data-tone="5"] { background: #f0e6e6; color: #8d5f65; }
.avatar[data-tone="6"] { background: #f2e7dd; color: #9c6a4d; }
.avatar[data-tone="7"] { background: #ebeae4; color: #6f7360; }
.avatar-mono {
  font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .02em;
}
.avatar-md { width: 38px; height: 38px; }
.avatar-md .avatar-mono { font-size: 14px; }
.avatar-lg { width: 46px; height: 46px; }
.avatar-lg .avatar-mono { font-size: 17px; }
.avatar-xl { width: 62px; height: 62px; }
.avatar-xl .avatar-mono { font-size: 24px; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-photo .avatar-mono { visibility: hidden; }
.avatar-chair {
  background: linear-gradient(150deg, #cdb08a, #a5814e); color: #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 8px 18px -12px rgba(140, 102, 50, .9);
}
.avatar-chair .avatar-mono { font-size: 13px; letter-spacing: 0; }

/* references ------------------------------------------------------------ */
.refs {
  flex-basis: 100%; margin-top: 2px;
  border: 1px solid #ece4d6; border-radius: 9px; background: #fdfbf6;
  padding: 7px 11px;
}
.refs[open] { padding-bottom: 10px; }
.refs-summary {
  cursor: pointer; font-size: 11px; font-weight: 600; color: var(--brass);
  list-style: none;
}
.refs-summary::-webkit-details-marker { display: none; }
.refs-summary::before { content: "▸ "; }
.refs[open] .refs-summary::before { content: "▾ "; }
.refs-note { font-size: 10.5px; color: #9c9382; line-height: 1.7; margin: 6px 0 2px; }
.ref { margin-top: 7px; padding: 9px 11px; border-radius: 8px; background: #fff; border: 1px solid #f0e9dd; }
.ref-title { font-size: 11px; font-weight: 600; }
.ref-excerpt {
  font-size: 11px; color: #7b7466; line-height: 1.8; margin-top: 4px;
  max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* empty states ---------------------------------------------------------- */
.empty {
  grid-column: 1 / -1;
  padding: 26px 20px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: 12px;
  background: rgba(255, 255, 255, .55);
}
.empty strong { display: block; font-size: 13px; margin-bottom: 5px; }
.empty p { font-size: 12px; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }
.empty-stream { border: 0; background: none; padding: 40px 20px; }

/* composer -------------------------------------------------------------- */
.composer {
  position: sticky; bottom: 0; z-index: 20;
  margin-top: 10px; padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(247, 243, 234, 0) 0%, var(--paper) 26%);
}
.composer-suggest { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.suggest-chip {
  border: 1px solid var(--line); background: rgba(255, 253, 248, .9);
  color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 11.5px;
  transition: border-color .16s ease, color .16s ease;
}
.suggest-chip:hover { border-color: var(--brass-2); color: var(--brass); }
.composer-box {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 12px 30px -28px rgba(43, 39, 33, .8);
  padding: 10px 12px 8px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.composer-box:focus-within { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(194, 164, 115, .14); }
.composer-box textarea {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  font-size: 14px; line-height: 1.8; max-height: 160px; padding: 2px 4px;
}
.composer-box textarea::placeholder { color: #ada290; }
.composer-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.composer-hint { flex: 1; font-size: 10.5px; color: #a89d89; line-height: 1.6; }

/* ------------------------------------------------------------------- markdown */

.md { font-size: 14px; line-height: 1.92; color: #35302a; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md p { margin: 0 0 .8em; }
.md-h {
  font-family: var(--sans); font-weight: 700; color: #262119;
  margin: 1.3em 0 .55em; line-height: 1.55;
}
.md-h:first-child { margin-top: 0; }
h3.md-h { font-size: 15px; letter-spacing: .01em; }
h4.md-h { font-size: 13.8px; }
h5.md-h { font-size: 13px; color: #453f36; }
.md strong { font-weight: 700; color: #211d16; }
.md em { font-style: italic; color: #4a443a; }
.md del { color: #9b9384; }
.md-link { color: #8a6a3b; text-decoration: underline; text-decoration-color: rgba(138, 106, 59, .35); text-underline-offset: 2px; }
.md-list { margin: .3em 0 .9em; padding-left: 1.2em; }
.md-list li { margin: .25em 0; padding-left: .12em; }
.md-list li::marker { color: var(--brass-2); }
.md-list .md-list { margin: .25em 0 .15em; }
.md-quote {
  margin: .85em 0; padding: .5em 0 .5em .95em;
  border-left: 3px solid #ddc9a6; background: rgba(250, 245, 235, .7);
  color: #5d564a; border-radius: 0 7px 7px 0;
}
.md-quote p:last-child { margin-bottom: 0; }
.md-hr { border: 0; height: 1px; background: var(--line); margin: 1.2em 0; }
.md-pre {
  margin: .85em 0; padding: 12px 14px; overflow: auto;
  border-radius: 9px; background: #2f2b24; color: #e7dfd2;
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
}
.md-pre code { font-family: inherit; }
.md-code-inline {
  font-family: var(--mono); font-size: .9em; padding: 1px 5px;
  border-radius: 4px; background: #f2ecdf; color: #6d5634;
}
.md-table-wrap { margin: .85em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.md-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.md-table th, .md-table td { padding: 7px 10px; border-bottom: 1px solid #f0ebe1; text-align: left; vertical-align: top; }
.md-table th { background: #faf7f0; font-weight: 700; color: #4a4335; white-space: nowrap; }
.md-table tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------- library view */

.library-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.library-head h1 { font-family: var(--serif); font-size: clamp(22px, 2.8vw, 30px); margin: 8px 0 10px; letter-spacing: .04em; }
.library-toolbar { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.library-count { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 11px; }
.pcard {
  display: flex; flex-direction: column; gap: 8px;
  padding: 15px 16px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.pcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 18px 34px -30px rgba(43, 39, 33, .8); }
.pcard.is-muted { background: #faf7f0; }
.pcard-head { display: flex; align-items: center; gap: 10px; }
.pcard-id { display: grid; min-width: 0; flex: 1; }
.pcard-id strong { font-size: 13.5px; font-weight: 700; }
.pcard-id span { font-size: 11px; color: #9a7a4b; margin-top: 1px; }
.pcard-mode {
  font-size: 9px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid #ecdcc2; color: #9a7a4b; background: #fbf4e6;
}
.pcard-mode-framework_only { color: #6f6a8a; border-color: #e0dcf0; background: #f6f5fc; }
.pcard-mode-research_only { color: #97624f; border-color: #eedfd8; background: #fdf4f0; }
.pcard-mode-simulation { color: #4a6f5c; border-color: #d9e8df; background: #f4f9f5; }
.pcard-focus {
  font-size: 12px; color: var(--muted); line-height: 1.7; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 10px; color: #a89d89; padding-top: 8px; border-top: 1px solid #f2ede4; }
.pcard-quality { color: #a2917a; }
.pcard-actions { display: flex; gap: 6px; margin-top: auto; }

.profile-head { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-head-text { flex: 1; min-width: 0; }
.profile-head h2 { font-family: var(--serif); font-size: clamp(22px, 2.8vw, 28px); letter-spacing: .03em; line-height: 1.4; }
.profile-role { font-size: 12.5px; color: var(--brass); margin: 3px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.chip-mode { background: #f4f8f5; border-color: #dbe8df; color: #4a6f5c; }
.chip-soft { background: #faf8f4; color: #7c6f5c; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; flex: none; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; padding-top: 22px; align-items: start; }
.profile-main { min-width: 0; }
.profile-side { display: grid; gap: 14px; position: sticky; top: 76px; }
.side-block {
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 253, 248, .9);
}
.side-block h3 { font-size: 11.5px; letter-spacing: .08em; color: #8a8172; margin-bottom: 10px; font-weight: 700; }
.side-block h3 span { color: #b7ae9f; font-weight: 500; }
.profile-notes {
  margin-top: 22px; padding: 14px 16px; border-radius: 10px;
  border: 1px dashed #e2d5bf; background: #fdfaf3;
}
.profile-notes h4 { font-size: 11.5px; color: var(--brass); margin-bottom: 5px; letter-spacing: .06em; }
.profile-notes p { font-size: 12px; color: #6f6350; line-height: 1.85; white-space: pre-wrap; }
.src { padding: 9px 0; border-bottom: 1px solid #f2ede4; }
.src:last-child { border-bottom: 0; padding-bottom: 0; }
.src-title { font-size: 12px; font-weight: 600; display: block; overflow-wrap: anywhere; }
.src-meta { font-size: 10px; color: var(--faint); }
.src-note { font-size: 10px; color: #9b9488; line-height: 1.7; margin-top: 4px; }
.search-sm { height: 34px; margin-bottom: 7px; }
.source-results { margin-top: 10px; display: grid; gap: 8px; max-height: 400px; overflow: auto; }
.hit { padding: 10px 11px; border-radius: 9px; border: 1px solid #ece5d8; background: #fff; }
.hit-title { font-size: 11px; font-weight: 600; display: block; margin-bottom: 4px; }
.hit-text { font-size: 11px; color: #7b7466; line-height: 1.8; white-space: pre-wrap; max-height: 150px; overflow: auto; }

.persona-editor {
  max-width: 840px; padding: 24px 26px 28px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-1);
}
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.editor-head h2 { font-family: var(--serif); font-size: 21px; margin-top: 5px; }
.persona-editor .field { margin-bottom: 14px; }
.editor-actions { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ------------------------------------------------------------------- modal */

.modal-root {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: rgba(43, 39, 33, .42); backdrop-filter: blur(3px);
}
.modal {
  width: min(450px, 100%);
  padding: 22px 24px 18px;
  border-radius: 16px; background: var(--surface);
  box-shadow: 0 40px 80px -44px rgba(0, 0, 0, .55);
  animation: pop .18s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-title { font-family: var(--serif); font-size: 19px; margin-bottom: 13px; }
.modal-body { display: grid; gap: 11px; }
.modal-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.modal-warn {
  font-size: 11.5px; line-height: 1.8; color: #8d4a3f;
  background: #fdf3f0; border: 1px solid #f2dcd6; border-radius: 9px; padding: 9px 11px;
}
.modal-field { display: grid; gap: 6px; font-size: 11.5px; color: var(--muted); }
.modal-input {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; outline: none;
}
.modal-input:focus { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(194, 164, 115, .16); }
.modal-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.modal-check input { margin-top: 3px; accent-color: var(--brass); }
.modal-error { font-size: 11.5px; color: var(--red); margin-top: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; max-width: min(520px, calc(100vw - 32px));
  padding: 11px 17px; border-radius: 11px;
  background: #332f28; color: #f7f2e6; font-size: 12.5px; line-height: 1.6;
  box-shadow: 0 20px 50px -22px rgba(0, 0, 0, .55);
  animation: toastIn .2s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast-error { background: #7f2f28; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1160px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-side { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-101%); transition: transform .24s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 24px 0 60px -34px rgba(43, 39, 33, .5);
  }
  .rail.is-open { transform: none; }
  .rail-close { display: block; }
  .menu-btn { display: grid; }
  .main { padding-top: 22px; }
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 28px 28px; }
  .auth-hero h1 { font-size: 32px; }
  .auth-facts { margin-top: 22px; padding-top: 16px; }
  .auth-panel { padding: 32px 24px 36px; }
  .profile-head { flex-wrap: wrap; }
  .profile-actions { width: 100%; }
  .chamber-head { flex-direction: column; gap: 10px; }
  .meeting-tools { width: 100%; }
  .msg-chair .md.msg-md { padding-right: 16px; }
  .chair-stamp { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .main { padding: 18px 14px 30px; }
  .topbar { height: 52px; padding: 0 14px; }
  .assembly { padding: 14px 14px 12px; border-radius: 14px; }
  .assembly-count strong { font-size: 19px; }
  .assembly-note { display: block; margin-left: 0; }
  .seats { gap: 2px; }
  .seat { min-width: 64px; }
  .seat-plus, .seat .avatar-lg { width: 40px; height: 40px; }
  .seat-name { font-size: 10px; }
  .assembly-topic textarea { font-size: 14px; }
  .model-switch { margin-left: 0; }
  .picker { gap: 7px; }
  .search { flex-basis: 100%; }
  .group-grid { grid-template-columns: 1fr; }
  .dc { min-height: 0; padding: 11px 12px; }
  .dc-focus { display: none; }
  .meeting-tools .btn { flex: 1; }
  .runbar { flex-direction: column; align-items: stretch; gap: 9px; padding: 10px 12px; }
  .runbar-actions { justify-content: stretch; }
  .runbar-actions .btn { flex: 1; }
  .msg { gap: 8px; }
  .msg-body { max-width: 88%; }
  .me-body { max-width: 86%; }
  .avatar { width: 34px; height: 34px; }
  .avatar-mono { font-size: 13px; }
  .avatar-md { width: 34px; height: 34px; }
  .avatar-md .avatar-mono { font-size: 13px; }
  .md.msg-md { padding: 13px 14px; border-radius: 4px 12px 12px 12px; }
  .md { font-size: 13.6px; line-height: 1.88; }
  .msg-head { flex-direction: column; gap: 4px; }
  .msg-tags { order: -1; }
  .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .composer-suggest { display: none; }
  .persona-grid { grid-template-columns: 1fr; }
  .library-head { flex-direction: column; }
  .profile-side { grid-template-columns: 1fr; }
  .persona-editor { padding: 18px 15px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .rail, .topbar, .runbar-actions, .meeting-tools, .composer, .phase-line { display: none !important; }
  body { background: #fff; }
  .md.msg-md { box-shadow: none; border-color: #ddd; }
  .msg-me { justify-content: flex-start; }
  .me-bubble { background: #f2ede2; color: #2b2721; }
}
