@charset "UTF-8";

:root {
  --bg: #e9ecf0;
  --surface: #fff;
  --ink: #303946;
  --muted: #687586;
  --line: #aab7c7;
  --blue: #263f73;
  --blue-light: #e6edf6;
  --font: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  --mono: "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 13px/1.6 var(--font); }
button, input, textarea, select { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--blue); }
button:focus-visible, a:focus-visible { outline: 2px solid #b36b16; outline-offset: 2px; }
input:focus, textarea:focus, select:focus { outline: 2px solid #567bb2; outline-offset: -2px; }
input, textarea, select { background: #fff; border: 1px solid #9caabd; padding: 5px 8px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #84909e; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: #d6e3f5; }

/* A compact, framed web chat: transcript on the left, directory on the right. */
.app-shell { max-width: 1600px; height: 100dvh; min-height: 680px; margin: auto; padding: 0 32px; display: flex; flex-direction: column; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 94px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--blue); text-decoration: none; flex-shrink: 0; }
.brand strong { font-size: 28px; line-height: 1.2; letter-spacing: 3px; }
.brand strong > span { font-weight: 400; }
.brand small { display: block; color: #667489; font-size: 11px; letter-spacing: 1px; margin-top: 6px; }
.brand-mark { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 35px; padding: 8px; border: 2px solid var(--blue); position: relative; }
.brand-mark::after { content: ""; position: absolute; width: 8px; height: 8px; left: 7px; bottom: -6px; background: var(--bg); border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: skewY(-35deg); }
.brand-mark i { display: block; border-top: 2px solid var(--blue); }
.brand-mark i:nth-child(2) { width: 65%; }
.settings-button { border: 0; background: transparent; padding: 5px 8px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.settings-button:hover { color: var(--blue); text-decoration: underline; }
#settings-dialog { width: min(420px, calc(100vw - 28px)); }
.settings-content h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.theme-picker { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.theme-picker button { flex: 1; min-height: 29px; padding: 4px 10px; border: 1px solid #9aaabd; background: #e5ebf3; color: #566b88; box-shadow: inset 1px 1px #fff; font-size: 12px; }
.theme-picker button:hover { background: #d7e2f2; }
.theme-picker button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: none; }
.site-bar { background: var(--blue); color: #eaf0fa; border: 1px solid #1a305c; border-top: 3px solid #456395; padding: 5px 12px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.site-bar b { font-weight: 400; color: #fff; }
.bar-divider { color: #8196ba; margin: 0 12px; }
.connection { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 11px; }
.status-dot { width: 7px; height: 7px; background: #e1b35e; border: 1px solid #f4d69d; }
.status-dot.connected { background: #98cda5; border-color: #c3e4c9; }
.status-dot.failed { background: #e99780; border-color: #f5beae; }
.workspace { flex: 1; min-height: 0; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr) 234px; gap: 8px; border: 1px solid var(--line); border-top: 0; background: #dce2e9; }
.main-shell { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-heading { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 13px; background: #f5f7fa; border: 1px solid var(--line); }
.room-heading-copy { min-width: 0; }
.room-prefix { color: #7c8798; font-size: 11px; margin-right: 9px; }
h1 { display: inline; font-size: 17px; color: #243c68; overflow-wrap: anywhere; }
.room-heading p { font-size: 11px; color: var(--muted); margin-top: 5px; }
.button, .new-room-button, .search-field button, .filter-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 11px; min-height: 28px; font-size: 12px; border: 1px solid #8797ac; background: #e9edf3; box-shadow: inset 1px 1px #fff, inset -1px -1px #c3cbd7; white-space: nowrap; }
.button:hover, .new-room-button:hover, .search-field button:hover, .filter-button:hover { background: #dbe6f5; }
.button:active, .new-room-button:active, .search-field button:active, .filter-button:active { box-shadow: inset 1px 1px #9aaac1; }
.button.primary { background: var(--blue); color: #fff; border-color: #19315f; box-shadow: inset 1px 1px #657ca2, inset -1px -1px #14274b; }
.button.primary:hover { background: #34558d; }
.workspace-nav { display: flex; align-items: end; justify-content: space-between; padding-top: 8px; border-bottom: 1px solid var(--line); gap: 4px; }
.tabs { display: flex; gap: 3px; align-items: end; }
.tab { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-bottom: 0; background: #d6dee9; color: #56677f; padding: 5px 14px; min-height: 29px; font-size: 12px; }
.tab:hover { background: #edf2f9; }
.tab.active { background: #fff; color: var(--blue); border-top: 2px solid var(--blue); padding-top: 6px; font-weight: bold; position: relative; top: 1px; }
.tab > span:not(.small-tag) { font: 10px var(--mono); color: #617692; }
.small-tag { font-size: 10px; font-weight: normal; color: #7a6f55; }
.refresh-button { border: 0; background: transparent; color: #405b80; font-size: 12px; padding: 4px 8px; }
.refresh-button:hover { text-decoration: underline; }
#room-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.discussion-layout, .conversation-card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.conversation-card { background: var(--surface); border: 1px solid var(--line); border-top: 0; }
.conversation-tools { display: flex; justify-content: space-between; gap: 16px; padding: 8px 11px; align-items: center; background: #f6f7f9; border-bottom: 1px solid #d0d8e3; }
.search-field { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; }
.search-field label { white-space: nowrap; color: #57677d; }
.search-field input { width: 220px; min-width: 0; height: 26px; font-size: 12px; padding: 3px 7px; }
.search-field button, .filter-button { min-height: 26px; font-size: 11px; }
.filter-button[aria-pressed="true"] { background: #d2dff2; border-color: #4b6792; color: #233e72; }
.record-caption { display: flex; justify-content: space-between; gap: 10px; padding: 5px 12px; color: #768295; font-size: 11px; border-bottom: 1px dotted #d1d8e3; }
.system-notice { padding: 7px 12px; color: #86622c; background: #fffbed; font-size: 12px; border-bottom: 1px solid #eee5cd; }
.system-notice b { font-weight: normal; color: #93631f; }
.messages { flex: 1; min-height: 100px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0; scrollbar-color: #acb8c9 #edf0f5; scrollbar-width: thin; }
.message { padding: 9px 14px; overflow-wrap: anywhere; }
.message > .message-avatar { display: none; }
.message:nth-child(even) { background: #f8f9fc; }
.message-line { line-height: 1.85; font-size: 14px; }
.message-line time { font: 11px var(--mono); color: #77869b; margin-right: 8px; }
.message-author { color: var(--identity-color); font-weight: bold; }
.message-verb { color: #788497; font-size: 12px; }
.message-text { white-space: pre-wrap; }
.user { --identity-color: #865921; }
.codex { --identity-color: #18715d; }
.claude { --identity-color: #ac5235; }
.gemini { --identity-color: #614ca0; }
.deepseek { --identity-color: #2a64a4; }
.qwen { --identity-color: #955184; }
.mention { color: #2b5d9b; text-decoration: underline; text-decoration-color: #b9cae1; text-underline-offset: 2px; }
.message-details { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 3px; font-size: 10px; line-height: 1.8; color: #778396; }
.source-badge { color: #7b6c56; }
.source-badge::before { content: "["; }
.source-badge::after { content: "]"; }
.source-badge.real { color: #60776d; }
.message-id, .quote-link, .message-actions button { border: 0; background: transparent; padding: 0; font-size: 10px; color: #627a9a; }
.message-id:hover, .quote-link:hover, .message-actions button:hover { color: #1e427d; text-decoration: underline; }
.message-actions { display: inline-flex; gap: 12px; margin-left: auto; }
.quote-link { text-align: left; }
.pagination { border-top: 1px solid #d3dbe5; background: #f3f6fa; padding: 4px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #526782; }
.pagination button { border: 0; padding: 2px 0; color: var(--blue); background: none; }
.composer { background: #e8edf4; border-top: 1px solid #9aaac0; padding: 8px 11px 6px; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; }
.author-picker { display: flex; align-items: center; gap: 7px; }
.author-picker label { color: #4a5c75; }
.author-picker select { width: 105px; padding: 1px 6px; height: 25px; font-size: 12px; }
#author-note { color: #68798e; font-size: 11px; }
.composer-hint { color: #7a879b; font-size: 11px; }
.composer-body { display: flex; align-items: stretch; gap: 8px; }
.composer-body textarea { width: 100%; min-width: 0; height: 72px; min-height: 72px; resize: none; line-height: 1.7; box-shadow: inset 1px 1px #e0e5ec; }
#send-message { width: 100px; flex-shrink: 0; flex-direction: column; font-size: 17px; font-weight: bold; }
#send-message span { font: normal 10px var(--mono); color: #bbcce7; }
.composer-footer { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: #748298; margin-top: 5px; }
.reply-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 7px; margin-bottom: 5px; color: #496086; background: #f5f8fc; border-left: 2px solid #6886b5; font-size: 11px; }
.reply-preview button { border: 0; background: none; font-size: 18px; line-height: 1; }

/* Selectable identities are listed without fabricating presence. */
.room-aside { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.aside-card { background: #f8fafc; border: 1px solid var(--line); }
.card-kicker { display: flex; align-items: center; justify-content: space-between; padding: 5px 9px; background: #d5dfec; color: #344e75; border-bottom: 1px solid var(--line); }
.card-kicker h2 { font-size: 12px; }
.card-kicker > span { color: #657a95; font-size: 10px; }
.card-kicker b { font-weight: normal; }
#room-list { max-height: 132px; overflow-y: auto; padding: 5px; }
.room-item { display: grid; grid-template-columns: 13px minmax(0, 1fr) auto; gap: 5px; width: 100%; padding: 6px; text-align: left; border: 1px solid transparent; background: transparent; font-size: 12px; color: #5c6d83; }
.room-item:hover { background: #edf2f8; }
.room-item.active { background: #e4ecf8; border: 1px dotted #8099bc; color: #254c84; }
.room-symbol { color: #8a9bb2; font: 13px var(--mono); }
.room-item.active .room-symbol { color: #305e9c; }
.room-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-item-number { font: 10px/1.8 var(--mono); color: #7f8da2; }
.new-room-button { display: flex; width: calc(100% - 14px); margin: 3px 7px 7px; }
.participants { padding: 5px 10px; }
.participant { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 21px; font: 10px var(--mono); color: var(--identity-color); background: #fff; border: 1px solid #c1cbd9; box-shadow: 1px 1px #e2e7ef; }
.participant-name { color: var(--identity-color); font-weight: bold; font-size: 12px; }
.participant-role { font-size: 10px; color: #7c8797; margin-left: auto; }
.aside-footnote { color: #788599; padding: 7px 10px; font-size: 10px; border-top: 1px dotted #c7d0dc; background: #f1f4f8; }
.goal-card { background: #fffdf4; }
.goal-card .card-kicker { background: #eee9d6; border-color: #cdc7b2; color: #716240; }
.goal-card .card-kicker > span { color: #8a7c5e; }
.goal-card > p { padding: 10px; color: #756a52; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.goal-footer { display: flex; justify-content: space-between; margin: 0 10px; border-top: 1px dotted #d9d1bc; padding-top: 6px; font-size: 11px; color: #8a7b60; }
.goal-footer b { font-family: var(--mono); font-weight: normal; }
.goal-card .text-button { margin: 7px 10px 10px; }
.text-button, .icon-button { color: #345c90; font-size: 11px; background: transparent; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.aside-signoff { text-align: center; color: #77879c; padding: 5px 0; margin-top: auto; font-size: 11px; letter-spacing: 2px; }
.aside-signoff small { display: block; font: 9px var(--mono); letter-spacing: 1px; color: #8b97a8; margin-top: 4px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 14px; padding: 10px 1px 12px; color: #7b8798; font-size: 10px; }
.footer-dot { margin: 0 7px; }

/* Secondary screens and dialogs use the same window and form treatment. */
.state-panel, .access-panel { flex: 1; overflow-y: auto; padding: 16px; background: #f7f9fc; border: 1px solid var(--line); border-top: 0; }
.section-intro { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.eyebrow { display: block; font: 10px var(--font); color: #7c8ca2; margin-bottom: 6px; letter-spacing: 1px; }
.section-intro h2 { font-size: 20px; color: var(--blue); }
.section-intro p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.state-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; }
.state-card { background: #fff; border: 1px solid var(--line); min-width: 0; }
.state-card-header { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; background: var(--blue-light); border-bottom: 1px solid var(--line); }
.state-card-header h3 { font-size: 12px; color: #3a547d; }
.muted-chip { font-size: 11px; color: #697d99; }
.state-card > textarea { display: block; border: 0; width: 100%; min-height: 280px; padding: 14px; line-height: 1.9; }
.state-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid #c5cfdd; background: #edf1f7; }
.state-footer small { font-size: 10px; color: #708199; }
.state-explanation { padding: 10px 0; font-size: 12px; color: #65758c; }
.state-explanation h3 { font-size: 14px; color: #3c567d; margin-bottom: 10px; }
.state-explanation h4 { font-size: 12px; }
.state-explanation hr { border: 0; border-top: 1px dotted #bbc6d4; margin: 16px 0; }
.state-explanation ul { padding-left: 18px; line-height: 2; }
.soft-note { background: #e8eef7; border: 1px solid #ccd6e4; padding: 10px; }
.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.access-card { border: 1px solid var(--line); padding: 14px; background: #fff; min-width: 0; }
.card-step { margin: -14px -14px 14px; padding: 6px 12px; background: var(--blue-light); border-bottom: 1px solid var(--line); color: #436086; font-size: 12px; }
.access-card h3 { font-size: 16px; color: #334d77; margin-bottom: 8px; }
.access-card > p { font-size: 12px; color: #758398; margin-bottom: 16px; }
.url-box { display: flex; align-items: center; gap: 10px; padding: 9px; background: #f1f5fa; border: 1px solid #c5d1e0; margin-bottom: 8px; }
.url-box code { font: 11px/1.7 var(--mono); color: #406292; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.icon-button { flex-shrink: 0; }
.endpoint-list { border-top: 1px dotted #c1cddd; margin-top: 18px; padding-top: 8px; }
.endpoint { padding: 7px 0; font-size: 11px; color: #596e8d; }
.endpoint code { display: block; font: 10px/1.7 var(--mono); color: #7a8ba3; overflow-wrap: anywhere; margin-top: 3px; }
.local-note { border-left: 2px solid #9bacc5; padding-left: 10px; margin-top: 16px; }
.access-card label, #room-form label { display: block; margin-bottom: 12px; color: #596b85; font-size: 12px; }
.access-card input, .access-card textarea, .access-card select, #room-form input, #room-form textarea { display: block; width: 100%; margin-top: 5px; min-height: 30px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.experiment-label { padding: 3px 7px; border: 1px solid #c6b78d; background: #f7f0dc; color: #8a7444; font-size: 11px; white-space: nowrap; }
.experiment-note { margin-top: 16px; padding-top: 12px; border-top: 1px dotted #c8ced8; font-size: 11px; color: #8a7957; }
.generated-link { border-top: 1px solid #c5cfdd; margin-top: 15px; padding-top: 10px; }
.generated-link textarea { font: 10px/1.7 var(--mono); background: #f6f8fb; }
.link-actions { display: flex; gap: 8px; margin-top: 8px; }
.generated-link p { font-size: 11px; color: #527764; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; margin-top: 10px; }
.empty-state { flex: 1; text-align: center; background: #fff; border: 1px solid var(--line); padding: 70px 20px; }
.empty-symbol { color: #91a0b6; font-size: 14px; }
.empty-state h2 { font-size: 22px; color: var(--blue); margin-top: 14px; }
.empty-state p { color: #74839a; margin: 12px 0 20px; }
.empty-messages { padding: 40px 15px; text-align: center; color: #7e8ca0; }
.empty-messages strong { color: #526c91; font-weight: normal; }
.empty-messages p { font-size: 12px; margin-top: 8px; }
dialog { width: min(530px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); color: var(--ink); padding: 3px; background: #e4e9f0; border: 1px solid #7c8da6; box-shadow: 3px 3px 0 #53678055, inset 1px 1px #fff; }
dialog::backdrop { background: #26385255; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 5px 8px; color: #fff; background: var(--blue); }
.dialog-heading h2 { font-size: 14px; }
.dialog-close { width: 21px; height: 21px; line-height: 16px; font-size: 18px; color: #3b4f6d; background: #dce4ef; border: 1px solid #9babc1; box-shadow: inset 1px 1px #fff; }
.dialog-content { padding: 18px; }
.full-width { width: 100%; }
#detail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.9; max-height: 65vh; overflow: auto; background: #fff; margin-top: 3px; }
#detail-body button { display: block; border: 0; background: none; color: #305a94; padding: 10px 0 0; text-decoration: underline; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 20; background: #fffbe9; color: #6c5735; border: 1px solid #bdaa7a; padding: 9px 18px; box-shadow: 2px 2px #6f684a25; max-width: calc(100vw - 28px); font-size: 12px; }
.toast.error { background: #fff0eb; border-color: #bc836c; color: #9a4a35; }

@media (max-width: 1100px) {
  .app-shell { padding: 0 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 210px; }
  .room-heading { gap: 10px; }
  .room-prefix { display: block; }
  .state-grid, .access-grid { grid-template-columns: minmax(0, 1fr); }
  .state-explanation { padding-top: 0; }
}

@media (max-width: 700px) {
  .app-shell { height: auto; min-height: 100dvh; padding: 0 8px; }
  .masthead { min-height: 82px; gap: 12px; }
  .brand { gap: 11px; }
  .brand strong { font-size: 24px; }
  .brand small { font-size: 9px; letter-spacing: .3px; }
  .brand-mark { width: 34px; height: 30px; padding: 6px; gap: 4px; }
  .site-bar { padding: 5px 8px; gap: 8px; }
  .site-bar > span:first-child { font-size: 0; }
  .site-bar b { font-size: 11px; }
  .bar-divider { display: none; }
  .connection { font-size: 10px; }
  .workspace { display: flex; flex-direction: column; padding: 5px; gap: 8px; }
  .room-heading { align-items: start; padding: 9px; gap: 8px; }
  h1 { font-size: 15px; }
  .room-heading .button { font-size: 10px; padding: 4px 6px; }
  .room-heading p { font-size: 10px; }
  .tab { font-size: 11px; padding: 5px 9px; gap: 4px; }
  .small-tag { font-size: 9px; }
  .refresh-button { padding: 4px; font-size: 11px; }
  .conversation-tools { padding: 7px; gap: 7px; }
  .search-field { flex: 1; gap: 5px; }
  .search-field label { display: none; }
  .search-field input { width: 100%; }
  .filter-button { flex-shrink: 0; }
  .record-caption { padding: 5px 8px; font-size: 10px; }
  .record-caption > span:last-child { display: none; }
  .system-notice { padding: 6px 8px; font-size: 11px; }
  .messages { flex: none; height: clamp(220px, 34dvh, 360px); }
  .message { padding: 8px 10px; }
  .message-line { font-size: 13px; }
  .message-details { gap: 7px; }
  .message-actions { margin-left: 0; }
  .composer { padding: 7px; }
  .composer-hint { display: none; }
  .author-picker { gap: 4px; }
  .composer-body { gap: 6px; }
  #send-message { width: 70px; font-size: 16px; }
  #send-message span { font-size: 8px; }
  .composer-footer > span:last-child { display: none; }
  .room-aside { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  #room-list { max-height: 125px; }
  .aside-signoff { display: none; }
  .section-intro { align-items: start; flex-wrap: wrap; gap: 12px; }
  .section-intro h2 { font-size: 18px; }
  .state-panel, .access-panel { padding: 12px; overflow: visible; }
  .state-footer { align-items: start; }
  .workspace-footer { flex-direction: column; gap: 2px; padding: 9px 3px 13px; font-size: 9px; }
}

/* Millennium chat: restrained steel-blue window chrome and an aligned transcript. */
:root[data-theme="millennium"] {
  --bg: #e5eaed;
  --surface: #fdfdfb;
  --ink: #2e3d48;
  --muted: #647783;
  --line: #b7c5cf;
  --blue: #345b76;
  --blue-light: #e7eef3;
  --font: "Segoe UI", "Microsoft YaHei", sans-serif;
  --transcript-indent: 166px;
  color-scheme: light;
}
:root[data-theme="millennium"] body { font-size: 14px; background: linear-gradient(#dce4e9, #edf0f1 400px); }
/* Vue's portal remains mounted after switching; the classic renderer has its own toast. */
:root[data-theme="millennium"] body > [role="region"]:has(> [data-slot="viewport"]) { display: none; }
:root[data-theme="millennium"] .app-shell { position: relative; max-width: 1760px; height: 100dvh; min-height: 620px; padding: 16px 24px 0; }
:root[data-theme="millennium"] .masthead { height: 66px; min-height: 66px; flex-shrink: 0; padding: 8px 22px; border: 1px solid #304c60; border-radius: 6px 6px 0 0; background: linear-gradient(115deg, #2e485b, #48677c); box-shadow: inset 0 1px #ffffff35; }
:root[data-theme="millennium"] .brand { gap: 13px; color: #fff; }
:root[data-theme="millennium"] .brand strong { font-size: 24px; letter-spacing: 1px; font-weight: 650; }
:root[data-theme="millennium"] .brand strong > span { font-size: 22px; font-weight: 400; margin-left: 5px; color: #e4edf1; }
:root[data-theme="millennium"] .brand small { color: #bdcfdc; font-size: 10px; letter-spacing: .6px; margin-top: 3px; }
:root[data-theme="millennium"] .brand-mark { width: 34px; height: 29px; padding: 7px; border: 1px solid #d7e4eb; border-radius: 8px; background: linear-gradient(#f6fafb, #bacfdb); box-shadow: 0 2px 2px #142f4540; gap: 4px; }
:root[data-theme="millennium"] .brand-mark::after { width: 6px; height: 6px; left: 6px; bottom: -4px; background: #bacfdb; border: 0; transform: skewY(-35deg); }
:root[data-theme="millennium"] .brand-mark i { border-color: #5e7b90; border-width: 1px; }
:root[data-theme="millennium"] .settings-button { color: #eff4f7; border: 1px solid #ffffff40; padding: 5px 14px; border-radius: 3px; background: linear-gradient(#ffffff15, #ffffff05); box-shadow: inset 0 1px #ffffff12; }
:root[data-theme="millennium"] .settings-button:hover { background: #ffffff20; color: #fff; text-decoration: none; }
:root[data-theme="millennium"] .site-bar { position: absolute; top: 38px; right: 130px; padding: 0; border: 0; background: transparent; font-size: 11px; }
:root[data-theme="millennium"] .site-bar > span:first-child { display: none; }
:root[data-theme="millennium"] .site-bar b { color: #405c70; }
:root[data-theme="millennium"] .bar-divider { color: #a6b6c1; }
:root[data-theme="millennium"] .connection { color: #d5e3e9; }
:root[data-theme="millennium"] .status-dot { border-radius: 50%; border: 1px solid #497864; }
:root[data-theme="millennium"] .status-dot.connected { background: #70a18b; }
:root[data-theme="millennium"] .workspace { padding: 0; gap: 0; grid-template-columns: minmax(0, 1fr) 272px; background: var(--surface); border-color: var(--line); border-radius: 0 0 5px 5px; overflow: hidden; box-shadow: 0 3px 10px #2842580c; }
:root[data-theme="millennium"] .room-heading { min-height: 58px; flex-shrink: 0; padding: 11px 24px; border: 0; border-bottom: 1px solid #d5dfe5; background: #f7f9f9; }
:root[data-theme="millennium"] .room-heading-copy { display: flex; align-items: baseline; gap: 12px; }
:root[data-theme="millennium"] .room-prefix { flex-shrink: 0; margin: 0; font-size: 10px; letter-spacing: .5px; color: #6d8392; }
:root[data-theme="millennium"] h1 { font-size: 19px; font-weight: 600; color: #2e4c62; letter-spacing: .2px; }
:root[data-theme="millennium"] .room-heading p { display: none; }
:root[data-theme="millennium"] :is(.button, .new-room-button, .search-field button, .filter-button) { min-height: 32px; border-color: #aebfcb; color: #3c5b71; background: linear-gradient(#fdfefe, #e4ecf1); border-radius: 3px; box-shadow: inset 0 1px #fff, 0 1px 1px #34496e0d; padding: 5px 12px; font-size: 12px; }
:root[data-theme="millennium"] :is(.button, .new-room-button, .search-field button, .filter-button):hover { background: linear-gradient(#f8fbfd, #d9e6ee); border-color: #829fb2; }
:root[data-theme="millennium"] :is(.button, .new-room-button, .search-field button, .filter-button):active { background: #dbe5eb; box-shadow: inset 0 1px 2px #2b465c20; }
:root[data-theme="millennium"] .button.primary { background: linear-gradient(#52758d, #3e6078); border-color: #35566e; color: #fff; box-shadow: inset 0 1px #ffffff40, 0 1px 2px #29405615; }
:root[data-theme="millennium"] .button.primary:hover { background: linear-gradient(#456b85, #34566f); }
:root[data-theme="millennium"] .workspace-nav { flex-shrink: 0; padding: 6px 16px 0; align-items: end; background: linear-gradient(#e9eff3, #e0e8ed); border-color: #b7c7d2; }
:root[data-theme="millennium"] .tabs { gap: 4px; }
:root[data-theme="millennium"] .tab { min-height: 34px; padding: 6px 15px; color: #5b7384; background: linear-gradient(#f2f6f8, #e2eaf0); border: 1px solid #b9c9d4; border-bottom: 0; border-radius: 4px 4px 0 0; font-size: 12px; }
:root[data-theme="millennium"] .tab.active { top: 1px; padding-top: 5px; background: var(--surface); border-top: 2px solid #486e87; color: #2c4d65; box-shadow: inset 0 1px #fff; }
:root[data-theme="millennium"] .tab:hover { color: #2c4d65; background: #f7fafb; }
:root[data-theme="millennium"] .tab > span:not(.small-tag) { padding: 0 4px; background: #e6edf2; border-radius: 3px; color: #536f83; font-size: 10px; }
:root[data-theme="millennium"] .refresh-button { color: #5c7688; font-size: 12px; margin-bottom: 5px; }
:root[data-theme="millennium"] .conversation-card { border: 0; display: grid; grid-template-areas: "tools" "notice" "messages" "caption" "pagination" "composer"; grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
:root[data-theme="millennium"] .conversation-tools { grid-area: tools; background: var(--surface); border-color: #e0e7ea; padding: 8px 24px; gap: 12px; }
:root[data-theme="millennium"] .search-field label { font-size: 12px; color: #647987; }
:root[data-theme="millennium"] .search-field input { width: 248px; height: 30px; border-color: #bacad4; border-radius: 3px; font-size: 12px; background: #fff; box-shadow: inset 0 1px 2px #28425808; }
:root[data-theme="millennium"] :is(.search-field button, .filter-button) { min-height: 30px; }
:root[data-theme="millennium"] .filter-button[aria-pressed="true"] { background: #dce8ef; color: #2e536d; border-color: #7899b0; box-shadow: inset 0 1px 2px #28425812; }
:root[data-theme="millennium"] .system-notice { grid-area: notice; padding: 7px 24px; background: #f0f4f5; border-color: #dfe7e9; color: #617780; font-size: 11px; }
:root[data-theme="millennium"] .system-notice b { color: #416776; }
:root[data-theme="millennium"] .messages { grid-area: messages; min-height: 0; padding: 12px 0; scrollbar-color: #b7c8d3 #f4f7f8; }
:root[data-theme="millennium"] .message { padding: 12px 24px; }
:root[data-theme="millennium"] .message:nth-child(even) { background: transparent; }
:root[data-theme="millennium"] .message:hover, :root[data-theme="millennium"] .message:focus-within { background: #f1f5f7; }
:root[data-theme="millennium"] .message-line { display: grid; grid-template-columns: 54px 88px minmax(0, 1fr); column-gap: 12px; align-items: baseline; font-size: 16px; line-height: 1.8; }
:root[data-theme="millennium"] .message-line time { margin: 0; font-size: 11px; color: #728591; font-variant-numeric: tabular-nums; }
:root[data-theme="millennium"] .message-author { white-space: nowrap; text-align: right; font-size: 14px; font-weight: 650; padding-right: 12px; border-right: 1px solid #d4dfe6; }
:root[data-theme="millennium"] .message-verb { display: none; }
:root[data-theme="millennium"] .message-text { min-width: 0; max-width: 88ch; }
:root[data-theme="millennium"] .message-receipt { padding: 3px 10px; border-left: 2px solid #bac9d3; background: #f2f6f8; font-size: 14px; color: #617583; }
:root[data-theme="millennium"] .message-receipt > summary { cursor: pointer; font-size: 12px; line-height: 24px; }
:root[data-theme="millennium"] .message-receipt[open] > summary { margin-bottom: 7px; }
:root[data-theme="millennium"] .message-details { max-width: 120ch; margin: 5px 0 0 var(--transcript-indent); gap: 4px 10px; color: #75848e; font-size: 11px; line-height: 1.7; }
:root[data-theme="millennium"] .message-actions { margin-left: 6px; gap: 10px; }
:root[data-theme="millennium"] :is(.message-id, .quote-link, .message-actions button) { color: #637f92; font-size: 11px; }
:root[data-theme="millennium"] :is(.message-id, .quote-link, .message-actions button):hover { color: #2c5875; }
:root[data-theme="millennium"] .source-badge { color: #687d89; }
:root[data-theme="millennium"] .source-badge.real { color: #4c786e; }
:root[data-theme="millennium"] .mention { color: #31647d; background: #eaf1f5; text-decoration-color: #b7cbd8; }
:root[data-theme="millennium"] .user { --identity-color: #526b7a; }
:root[data-theme="millennium"] .codex { --identity-color: #347369; }
:root[data-theme="millennium"] .claude { --identity-color: #53697d; }
:root[data-theme="millennium"] .gemini { --identity-color: #456c94; }
:root[data-theme="millennium"] .deepseek { --identity-color: #2d6483; }
:root[data-theme="millennium"] .qwen { --identity-color: #487e83; }
:root[data-theme="millennium"] .record-caption { grid-area: caption; padding: 5px 24px; background: #f6f8f9; color: #728591; border-top: 1px solid #dce5ea; border-bottom: 0; font-size: 11px; }
:root[data-theme="millennium"] .pagination { grid-area: pagination; background: #eaf0f4; border-color: #d0dce4; padding: 5px 24px; }
:root[data-theme="millennium"] .composer { grid-area: composer; padding: 10px 18px 8px; background: linear-gradient(#dfe8ee, #edf2f5); border-color: #adbfcb; box-shadow: inset 0 1px #ffffffcc; }
:root[data-theme="millennium"] .composer-toolbar { margin-bottom: 8px; gap: 8px; }
:root[data-theme="millennium"] .author-picker { min-width: 0; }
:root[data-theme="millennium"] .author-picker label { font-size: 12px; color: #4f6a7c; white-space: nowrap; }
:root[data-theme="millennium"] .author-picker select { height: 28px; width: 116px; border-color: #a6bdcc; border-radius: 3px; color: #34566f; }
:root[data-theme="millennium"] #message-kind { height: 28px; color: #4f6777; border-color: #b6c7d1; }
:root[data-theme="millennium"] :is(#author-note, .composer-hint, .composer-footer) { color: #687f8c; }
:root[data-theme="millennium"] .composer-body { gap: 10px; }
:root[data-theme="millennium"] .composer-body textarea { height: 68px; min-height: 68px; padding: 9px 12px; border: 1px solid #9eb6c6; border-radius: 3px; box-shadow: inset 0 2px 3px #29465d09; font-size: 15px; }
:root[data-theme="millennium"] #send-message { width: 94px; font-size: 16px; font-weight: 600; letter-spacing: 2px; }
:root[data-theme="millennium"] #send-message span { color: #d6e4ed; font-size: 9px; letter-spacing: 0; margin-top: 2px; }
:root[data-theme="millennium"] .composer-footer { margin-top: 6px; font-size: 10px; }
:root[data-theme="millennium"] .reply-preview { padding: 5px 9px; background: #f8fafb; border-color: #66899e; color: #46677e; }
:root[data-theme="millennium"] .room-aside { display: flex; gap: 0; background: #eaf0f4; border-left: 1px solid #b7c7d2; }
:root[data-theme="millennium"] .aside-card { background: transparent; border: 0; border-bottom: 1px solid #c6d4dd; padding-bottom: 12px; }
:root[data-theme="millennium"] .card-kicker { padding: 8px 16px; background: linear-gradient(#e4ecf2, #d5e1e9); border: 0; border-bottom: 1px solid #bfced9; box-shadow: inset 0 1px #ffffff90; color: #3e5f76; }
:root[data-theme="millennium"] .card-kicker h2 { font-size: 13px; font-weight: 600; }
:root[data-theme="millennium"] .card-kicker > span { color: #698293; font-size: 11px; }
:root[data-theme="millennium"] #room-list { padding: 8px; max-height: 170px; }
:root[data-theme="millennium"] .room-item { min-height: 36px; padding: 7px 9px; gap: 8px; border-radius: 3px; font-size: 12px; }
:root[data-theme="millennium"] .room-item:hover { background: #f5f9fb; }
:root[data-theme="millennium"] .room-item.active { background: linear-gradient(#fdfefe, #eef4f7); border: 1px solid #a8bfce; color: #2f536e; box-shadow: inset 3px 0 #5c8098, 0 1px 2px #29425808; }
:root[data-theme="millennium"] .room-item.active .room-symbol { color: #486d86; }
:root[data-theme="millennium"] .room-item-number { color: #6c8493; }
:root[data-theme="millennium"] .new-room-button { width: calc(100% - 28px); margin: 3px 14px 0; }
:root[data-theme="millennium"] .participants { padding: 8px 16px; }
:root[data-theme="millennium"] .participant { padding: 5px 0; gap: 10px; }
:root[data-theme="millennium"] .participant .avatar { width: 26px; height: 26px; font-size: 10px; background: linear-gradient(#fff, #dde7ed); border: 1px solid #b3c5d1; border-radius: 4px; box-shadow: inset 0 1px #fff, 0 1px 1px #35546b0d; }
:root[data-theme="millennium"] .participant-name { font-size: 13px; font-weight: 600; }
:root[data-theme="millennium"] .participant-role { color: #6e8390; font-size: 11px; }
:root[data-theme="millennium"] .aside-footnote { padding: 2px 16px 0; border: 0; background: transparent; color: #708591; font-size: 11px; line-height: 1.8; }
:root[data-theme="millennium"] .goal-card { background: #f1f5f6; }
:root[data-theme="millennium"] .goal-card .card-kicker { color: #45636e; background: linear-gradient(#e9eff1, #dce6e9); border-color: #c4d3d9; }
:root[data-theme="millennium"] .goal-card .card-kicker > span { color: #6d8590; }
:root[data-theme="millennium"] .goal-card > p { padding: 12px 16px; color: #526d7c; font-size: 13px; line-height: 1.8; }
:root[data-theme="millennium"] .goal-footer { margin: 0 16px; color: #6d8492; border-color: #cad7de; }
:root[data-theme="millennium"] .goal-card .text-button { margin: 10px 16px 0; color: #466f88; font-size: 12px; }
:root[data-theme="millennium"] .aside-signoff { padding: 12px 0; color: #728996; letter-spacing: 1px; }
:root[data-theme="millennium"] .workspace-footer { flex-shrink: 0; padding: 8px 2px; color: #748692; }
:root[data-theme="millennium"] :is(input, select, textarea) { border-color: #b6c7d1; border-radius: 3px; }
:root[data-theme="millennium"] :is(button, a):focus-visible { outline-color: #406f8f; }
:root[data-theme="millennium"] :is(input, textarea, select):focus { outline-color: #789db6; }
:root[data-theme="millennium"] ::selection { background: #cfdee8; }
:root[data-theme="millennium"] :is(.topic-panel, .state-panel, .access-panel) { min-height: 0; border: 0; padding: 24px; background: #f8faf9; }
:root[data-theme="millennium"] :is(.state-card, .access-card, .turn-card) { border-color: #bacbd5; border-radius: 4px; overflow: hidden; }
:root[data-theme="millennium"] :is(.state-card-header, .card-step) { background: linear-gradient(#eaf0f4, #dfe9ef); border-color: #c0d0db; color: #45677f; padding-top: 10px; padding-bottom: 10px; }
:root[data-theme="millennium"] :is(.state-card-header h3, .access-card h3, .state-explanation h3) { color: #34566e; }
:root[data-theme="millennium"] .state-footer { background: #eaf0f4; border-color: #c6d5de; }
:root[data-theme="millennium"] .state-card > textarea { font-size: 14px; }
:root[data-theme="millennium"] .soft-note { background: #e9f0f3; border-color: #c7d6df; }
:root[data-theme="millennium"] .url-box { border-radius: 3px; background: #eff4f6; border-color: #c5d5df; }
:root[data-theme="millennium"] dialog { padding: 0; border: 1px solid #809baa; border-radius: 5px; background: #f2f6f8; box-shadow: 0 16px 64px #20354340; }
:root[data-theme="millennium"] dialog::backdrop { background: #24374466; }
:root[data-theme="millennium"] .dialog-heading { padding: 12px 16px; background: linear-gradient(#4d6d82, #37576c); box-shadow: inset 0 1px #ffffff30; }
:root[data-theme="millennium"] .dialog-heading h2 { font-size: 15px; font-weight: 600; }
:root[data-theme="millennium"] .dialog-close { width: 26px; height: 26px; border-color: #99b0c0; color: #3d5d72; background: linear-gradient(#fff, #d4e0e8); border-radius: 3px; }
:root[data-theme="millennium"] .dialog-content { padding: 22px; }
:root[data-theme="millennium"] #detail-body { font-size: 15px; }
:root[data-theme="millennium"] .theme-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
:root[data-theme="millennium"] .theme-picker button { min-height: 42px; padding: 9px 10px; border-radius: 3px; color: #536e80; border-color: #afc3d0; background: linear-gradient(#fff, #e5edf2); box-shadow: inset 0 1px #fff; }
:root[data-theme="millennium"] .theme-picker button[aria-pressed="true"] { background: #4a6c83; color: #fff; border-color: #3e6077; box-shadow: inset 0 1px #ffffff30; }
:root[data-theme="millennium"] .toast { color: #365e76; border-color: #9eb8c9; background: #f0f6f8; border-radius: 3px; box-shadow: 0 3px 14px #28425616; }
:root[data-theme="millennium"] .toast.error { color: #394955; background: #f4f6f7; border-color: #637e90; border-left-width: 4px; }

@media (max-width: 1100px) {
  :root[data-theme="millennium"] .app-shell { padding: 12px 14px 0; }
  :root[data-theme="millennium"] .site-bar { top: 34px; right: 120px; }
  :root[data-theme="millennium"] .room-prefix { display: none; }
  :root[data-theme="millennium"] .workspace { grid-template-columns: minmax(0, 1fr) 232px; }
  :root[data-theme="millennium"] .room-heading { padding: 12px 18px; }
  :root[data-theme="millennium"] .conversation-tools { padding: 8px 18px; }
  :root[data-theme="millennium"] .search-field { flex: 1; }
  :root[data-theme="millennium"] .search-field label { display: none; }
  :root[data-theme="millennium"] .search-field input { width: 100%; }
  :root[data-theme="millennium"] .message { padding: 12px 18px; }
  :root[data-theme="millennium"] .message-line { grid-template-columns: auto 1fr; gap: 3px 10px; }
  :root[data-theme="millennium"] .message-line time { grid-column: 2; grid-row: 1; }
  :root[data-theme="millennium"] .message-author { grid-column: 1; grid-row: 1; text-align: left; border: 0; padding: 0; }
  :root[data-theme="millennium"] .message-text { grid-column: 1 / -1; }
  :root[data-theme="millennium"] .message-details { margin-left: 0; }
  :root[data-theme="millennium"] .tabs { gap: 3px; }
  :root[data-theme="millennium"] .tab { padding-left: 10px; padding-right: 10px; }
  :root[data-theme="millennium"] .workspace-nav { padding-left: 10px; padding-right: 10px; }
  :root[data-theme="millennium"] .brand-tagline { display: none; }
  :root[data-theme="millennium"] #author-note { display: none; }
  :root[data-theme="millennium"] .composer-toolbar { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  :root[data-theme="millennium"] .app-shell { height: auto; min-height: 100dvh; padding: 8px; }
  :root[data-theme="millennium"] .masthead { height: 60px; min-height: 60px; padding: 8px 14px; gap: 10px; }
  :root[data-theme="millennium"] .brand { gap: 10px; }
  :root[data-theme="millennium"] .brand strong { font-size: 21px; letter-spacing: 0; }
  :root[data-theme="millennium"] .brand strong > span { font-size: 19px; }
  :root[data-theme="millennium"] .brand small { font-size: 9px; letter-spacing: .2px; }
  :root[data-theme="millennium"] .brand-mark { width: 28px; height: 25px; padding: 6px; }
  :root[data-theme="millennium"] .settings-button { font-size: 11px; padding: 5px 9px; }
  :root[data-theme="millennium"] .site-bar { position: static; min-height: 26px; padding: 4px 12px; border: 1px solid var(--line); border-top: 0; background: #e6edf1; justify-content: flex-end; }
  :root[data-theme="millennium"] .connection { color: #526e70; }
  :root[data-theme="millennium"] .site-bar > span:first-child { font-size: 0; }
  :root[data-theme="millennium"] .workspace { gap: 0; overflow: visible; }
  :root[data-theme="millennium"] .room-heading { min-height: 66px; padding: 10px 12px; align-items: center; gap: 10px; }
  :root[data-theme="millennium"] h1 { font-size: 16px; }
  :root[data-theme="millennium"] .room-heading .button { padding: 5px 8px; font-size: 10px; min-width: 82px; white-space: normal; }
  :root[data-theme="millennium"] .room-prefix { font-size: 9px; }
  :root[data-theme="millennium"] .workspace-nav { padding: 5px 6px 0; gap: 2px; }
  :root[data-theme="millennium"] .tabs { gap: 2px; }
  :root[data-theme="millennium"] .tab { padding: 7px; gap: 3px; font-size: 11px; min-height: 34px; }
  :root[data-theme="millennium"] .refresh-button { padding: 4px; font-size: 10px; }
  :root[data-theme="millennium"] .conversation-tools { padding: 8px 12px; gap: 8px; }
  :root[data-theme="millennium"] :is(.search-field button, .filter-button) { padding: 5px 7px; font-size: 11px; }
  :root[data-theme="millennium"] .system-notice { padding: 7px 12px; font-size: 10px; }
  :root[data-theme="millennium"] .messages { height: clamp(220px, 34dvh, 420px); padding: 6px 0; }
  :root[data-theme="millennium"] .message { padding: 12px; }
  :root[data-theme="millennium"] .message-line { font-size: 15px; line-height: 1.8; }
  :root[data-theme="millennium"] .message-author { font-size: 13px; }
  :root[data-theme="millennium"] .message-details { gap: 3px 8px; font-size: 10px; }
  :root[data-theme="millennium"] :is(.message-id, .quote-link, .message-actions button) { font-size: 10px; }
  :root[data-theme="millennium"] .message-actions { margin-left: 0; }
  :root[data-theme="millennium"] .record-caption { padding: 5px 12px; font-size: 10px; }
  :root[data-theme="millennium"] .composer { padding: 10px 12px 8px; }
  :root[data-theme="millennium"] .author-picker label { font-size: 11px; }
  :root[data-theme="millennium"] .author-picker select { width: 96px; }
  :root[data-theme="millennium"] #message-kind { max-width: 45%; font-size: 10px; }
  :root[data-theme="millennium"] .composer-body { gap: 8px; }
  :root[data-theme="millennium"] .composer-body textarea { font-size: 14px; padding: 8px; }
  :root[data-theme="millennium"] #send-message { width: 68px; font-size: 15px; }
  :root[data-theme="millennium"] #send-message span { font-size: 8px; }
  :root[data-theme="millennium"] .composer-footer { font-size: 9px; }
  :root[data-theme="millennium"] .room-aside { border-left: 0; border-top: 1px solid #b7c7d2; }
  :root[data-theme="millennium"] .participants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
  :root[data-theme="millennium"] .participant { flex-wrap: wrap; gap: 5px 8px; }
  :root[data-theme="millennium"] .participant-role { width: 100%; margin-left: 36px; }
  :root[data-theme="millennium"] :is(.topic-panel, .state-panel, .access-panel) { padding: 16px; overflow: visible; }
  :root[data-theme="millennium"] .dialog-content { padding: 18px; }
}

/* Topic disclosure and hosting reuse each theme's colors and controls. */
.directory-row { display: flex; align-items: center; position: relative; }
.directory-grip { flex-shrink: 0; padding: 6px; color: var(--muted); cursor: grab; touch-action: none; user-select: none; border: 0; background: transparent; box-shadow: none; }
.directory-row.drop-before { box-shadow: inset 0 2px var(--blue); }
.directory-row.drop-after { box-shadow: inset 0 -2px var(--blue); }
.directory-row > .room-item { display: flex; flex: 1; min-width: 0; gap: 8px; }
.directory-row .room-item-name { flex: 1; }
.room-actions { flex-shrink: 0; }
.room-actions > summary { cursor: pointer; padding: 6px 8px; list-style: none; }
.room-actions > div { position: absolute; right: 0; z-index: 5; min-width: 120px; padding: 4px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 5px 15px #0002; }
.room-actions button { display: block; width: 100%; text-align: left; padding: 7px; }
.room-actions button:hover { background: #6685aa20; }
.room-actions button[data-room-action="delete"] { color: #a52d35; }
#archive-toggle { margin: 10px; }
#manage-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.topic-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; background: var(--surface); }
.topic-overview { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px 18px; margin: 20px 0; }
.topic-overview h3, .topic-reading h3, .topic-detail-content h3 { font-size: 13px; color: var(--blue); }
.topic-overview p, .topic-detail-content p, #topic-experts, #turn-question { white-space: pre-wrap; overflow-wrap: anywhere; }
.turn-card { border: 1px solid var(--line); background: var(--surface); }
.turn-content { padding: 16px; display: grid; gap: 12px; }
#turn-expert { color: var(--blue); font-weight: 600; }
.topic-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.topic-reading { padding: 20px 0; display: grid; gap: 10px; }
.topic-reading > p, #schedule-note { color: var(--muted); font-size: 12px; }
.topic-details { border-top: 1px solid var(--line); }
.topic-details > summary { padding: 13px 0; cursor: pointer; color: var(--blue); font-weight: 600; }
.topic-detail-content { padding: 4px 0 18px; display: grid; gap: 12px; }
.topic-form { display: grid; gap: 14px; padding: 18px 0; border-top: 1px dotted var(--line); }
.topic-form label, .expert-mode-grid label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.topic-form input, .topic-form textarea, .topic-form select, .expert-mode-grid select { width: 100%; }
.topic-form .button { justify-self: start; }
.topic-form-grid, .expert-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.topic-form fieldset { border: 1px solid var(--line); padding: 14px; min-width: 0; }
.topic-form legend { color: var(--blue); padding: 0 6px; }
#room-form select { width: 100%; }
#room-dialog { max-height: calc(100dvh - 40px); overflow-y: auto; }
#message-kind { max-width: 48%; font-size: 11px; }
@media (max-width: 700px) {
  .topic-panel { padding: 14px; }
  .topic-overview { grid-template-columns: 1fr; gap: 6px; }
  .topic-overview p { margin-bottom: 12px; }
  .topic-form-grid, .expert-mode-grid { grid-template-columns: 1fr; }
  .topic-actions { gap: 8px; }
  .topic-actions .button { white-space: normal; }
  .topic-panel .section-intro { align-items: start; flex-wrap: wrap; gap: 12px; }
  #message-kind { font-size: 10px; padding: 3px; }
}
