:root {
  --ink: #f5f1f7;
  --muted: #a79daf;
  --line: rgba(255,255,255,.09);
  --bg: #0f0b12;
  --panel: #17121c;
  --panel-2: #211a29;
  --purple: #a65cff;
  --lilac: #ddc6ff;
  --rose: #ff7caa;
  --green: #6de3ad;
  --shadow: 0 22px 56px rgba(0,0,0,.34);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 85% 0%, #321747 0, transparent 34rem), var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 18px 20px; border-right: 1px solid var(--line); background: rgba(12,8,15,.76); backdrop-filter: blur(18px); display: flex; flex-direction: column; }
.brand { font-family: "Playfair Display", serif; font-size: 36px; letter-spacing: -2px; margin: 0 12px 4px; background: linear-gradient(120deg,#fff 15%,#e4b5ff 47%,#9e68ff 83%); color: transparent; background-clip: text; }
.brand span { font-style: italic; }
.vault-status { margin: 0 12px 34px; color: var(--muted); font-size: 12px; }
.vault-status i { width: 7px; height: 7px; display: inline-block; background: var(--green); box-shadow: 0 0 12px var(--green); border-radius: 99px; margin-right: 6px; }
.main-nav { display: grid; gap: 6px; }
.nav-item, .quiet-button { border: 0; background: transparent; cursor: pointer; text-align: left; border-radius: 13px; padding: 12px 13px; color: var(--muted); transition: .2s ease; }
.nav-item { font-size: 14px; display: flex; gap: 10px; align-items: center; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: rgba(182,112,255,.14); }
.nav-item.active { box-shadow: inset 2px 0 0 var(--purple); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 14px; padding: 12px 4px 0; }
.quiet-button { color: var(--lilac); font-size: 13px; }
.sidebar-bottom small { color: #776d80; font-size: 11px; padding-left: 13px; }
.content { max-width: 1440px; width: 100%; margin: 0 auto; padding: 48px clamp(24px, 5vw, 76px); }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.eyebrow { color: var(--lilac); text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: 11px; margin: 0 0 9px; }
h1,h2,h3,p { margin-top: 0; }
h1 { font: 700 clamp(35px, 5vw, 58px)/1.03 "Playfair Display", serif; letter-spacing: -2.6px; margin-bottom: 9px; }
h2 { font: 700 27px/1.1 "Playfair Display", serif; letter-spacing: -1px; margin-bottom: 8px; }
.subtle { color: var(--muted); margin-bottom: 0; }
.primary, .secondary, .small-button { border: 0; border-radius: 13px; cursor: pointer; font-weight: 700; transition: transform .18s ease, filter .18s ease; }
.primary { padding: 13px 17px; color: #180725; background: linear-gradient(135deg,#e8c8ff,#a65cff); box-shadow: 0 12px 30px rgba(166,92,255,.24); }
.secondary { padding: 12px 15px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.small-button { padding: 8px 10px; font-size: 12px; background: rgba(255,255,255,.08); color: var(--ink); }
.primary:hover,.secondary:hover,.small-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.character-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.character-card { min-height:0; padding:0; overflow:hidden; border:1px solid var(--line); background:var(--panel); border-radius:20px; cursor:pointer; text-align:left; position:relative; box-shadow:var(--shadow); transition:transform .22s ease,border-color .22s ease; display:flex; flex-direction:column; }
.character-card:hover { transform: translateY(-5px); border-color: rgba(221,198,255,.48); }
.portrait { height:auto; aspect-ratio:4 / 3; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; background:linear-gradient(145deg,#2c1d35,#17121c); flex:none; }
.portrait img { width:100%; height:100%; object-fit:cover; object-position:center 5%; }
.portrait .missing { color: var(--lilac); text-align: center; padding: 20px; font: 600 15px/1.4 "Playfair Display",serif; max-width: 150px; }
.portrait::after { content:""; position:absolute; inset: 35% 0 0; background:linear-gradient(transparent,rgba(23,18,28,.92)); pointer-events:none; }
.online-dot { position:absolute; top:14px; right:14px; width:10px; height:10px; border-radius:99px; background:var(--green); box-shadow: 0 0 12px var(--green); z-index:1; }
.card-copy { padding:0 15px 15px; position:relative; margin-top:-24px; z-index:2; }
.card-copy h3 { font:700 clamp(21px,1.9vw,27px)/1 "Playfair Display",serif; letter-spacing:-.8px; margin:0 0 8px; }
.card-copy p { color:var(--muted); font-size:12px; line-height:1.45; min-height:35px; margin-bottom:11px; }
.tags { display:flex; gap:6px; flex-wrap:wrap; }
.tag { background:rgba(210,176,255,.15); border:1px solid rgba(221,198,255,.12); padding:5px 8px; color:var(--lilac); border-radius:99px; font-size:10px; font-weight:700; }
.tag.rose { color:#ffc0d6; background:rgba(255,124,170,.14); }
.tag.green { color:#baffdf; background:rgba(109,227,173,.13); }
.card-footer { padding:12px 15px; border-top:1px solid var(--line); color:#8f8396; font-size:10px; display:flex; justify-content:space-between; gap:8px; margin-top:auto; }
.match-roulette { max-width:980px; }
.roulette-intro,.roulette-card { overflow:hidden; border:1px solid var(--line); border-radius:25px; background:linear-gradient(135deg,rgba(102,52,133,.34),rgba(23,18,28,.94)); box-shadow:var(--shadow); }
.roulette-intro { display:flex; align-items:center; gap:22px; padding:clamp(26px,5vw,52px); }
.roulette-intro > span { width:68px; height:68px; flex:none; display:grid; place-items:center; border-radius:22px; background:linear-gradient(135deg,#e8c8ff,#a65cff); color:#210b31; font-size:34px; }
.roulette-intro h2 { margin-bottom:7px; }
.roulette-intro p { max-width:600px; color:var(--muted); line-height:1.58; }
.roulette-intro .primary { margin-top:7px; }
.roulette-count { margin:0; color:var(--lilac); font-weight:700; font-size:12px; }
.roulette-card { display:grid; grid-template-columns:minmax(270px,.82fr) minmax(0,1.18fr); min-height:440px; }
.roulette-photo { min-height:100%; background:var(--panel-2); display:grid; place-items:center; overflow:hidden; color:var(--lilac); font:700 64px/1 "Playfair Display",serif; }
.roulette-photo img { width:100%; height:100%; min-height:440px; object-fit:cover; object-position:center top; }
.roulette-copy { align-self:center; padding:clamp(28px,5vw,54px); }
.roulette-copy h2 { font-size:clamp(36px,5vw,56px); margin-bottom:14px; }
.roulette-copy > p:not(.eyebrow) { color:#ddd4e2; line-height:1.6; font-size:15px; margin:22px 0 0; }
.roulette-copy .roulette-bio { color:var(--muted); font-size:13px; }
.profile-screen { display:grid; gap:24px; }
.profile-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.profile-toolbar .toolbar { margin:0; }
.profile-hero { min-height:470px; display:grid; grid-template-columns:minmax(290px,.82fr) minmax(0,1.18fr); overflow:hidden; border:1px solid var(--line); border-radius:25px; background:linear-gradient(130deg,rgba(84,42,109,.36),rgba(23,18,28,.96)); box-shadow:var(--shadow); }
.profile-image { min-height:100%; background:var(--panel-2); }
.profile-image img { width:100%; height:100%; min-height:470px; display:block; object-fit:cover; object-position:center top; }
.profile-image span { min-height:470px; display:grid; place-items:center; color:var(--muted); }
.profile-copy { padding:clamp(28px,5vw,56px); align-self:center; }
.profile-copy h1 { margin-bottom:8px; }
.profile-status { color:var(--green); font-size:13px; margin:0 0 20px; }
.profile-note { max-width:640px; margin:24px 0; color:#d7cfdb; font-size:16px; line-height:1.65; }
.profile-actions { display:flex; flex-wrap:wrap; gap:9px; }
.profile-detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.profile-panel { min-height:188px; padding:22px; border:1px solid var(--line); border-radius:20px; background:rgba(255,255,255,.035); }
.profile-panel h2 { margin-bottom:12px; }
.profile-panel p { color:var(--muted); line-height:1.55; font-size:13px; }
.profile-insights { display:grid; gap:12px; }
.profile-insights div { display:grid; gap:3px; padding-bottom:11px; border-bottom:1px solid var(--line); }
.profile-insights div:last-child { border-bottom:0; padding-bottom:0; }
.profile-insights b { font-size:12px; }
.profile-insights span { color:var(--muted); font-size:12px; line-height:1.4; }
.profile-insights small { display:block; margin-top:4px; color:var(--lilac); font-size:10px; }
.profile-gallery > div { display:flex; gap:8px; overflow:auto; }
.profile-gallery img { width:82px; height:108px; flex:none; object-fit:cover; object-position:center top; border-radius:10px; border:1px solid var(--line); }
.profile-gallery figure { margin:0; min-width:82px; }
.profile-gallery figcaption { max-width:82px; margin-top:5px; color:var(--muted); font-size:10px; line-height:1.25; }
.dossier-editor { grid-column:1 / -1; border:1px solid var(--line); border-radius:14px; padding:12px; background:rgba(255,255,255,.025); }
.dossier-editor > summary { cursor:pointer; color:var(--lilac); font-weight:700; }
.dossier-editor[open] > .dossier-fields { margin-top:14px; }
.modal pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:190px; overflow:auto; padding:12px; border-radius:12px; color:var(--muted); background:rgba(0,0,0,.16); border:1px solid var(--line); font:12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-workspace { min-height:calc(100vh - 96px); display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; }
.chat-roster { min-height:0; max-height:calc(100vh - 96px); overflow-y:auto; border:1px solid var(--line); border-radius:20px; background:rgba(12,8,15,.78); box-shadow:var(--shadow); }
.chat-roster-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:18px 15px 13px; border-bottom:1px solid var(--line); }
.chat-roster-head .eyebrow { margin:0; }
.chat-roster-head .small-button { padding:7px 8px; font-size:10px; }
.roster-list { display:grid; }
.roster-item { width:100%; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--ink); text-align:left; cursor:pointer; display:grid; grid-template-columns:38px minmax(0,1fr) 8px; align-items:center; gap:10px; padding:13px 12px; }
.roster-item:last-child { border-bottom:0; }
.roster-item:hover,.roster-item.active { background:rgba(166,92,255,.13); }
.roster-item.active { box-shadow:inset 3px 0 0 var(--purple); }
.roster-avatar { width:38px; height:38px; border-radius:50%; overflow:hidden; display:grid; place-items:center; background:linear-gradient(135deg,#6f3b97,#21152b); font:700 14px "Playfair Display",serif; }
.roster-avatar img { width:100%; height:100%; object-fit:cover; object-position:center top; }
.roster-copy { min-width:0; display:grid; gap:3px; }
.roster-copy b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.roster-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:11px; }
.roster-item i { width:7px; height:7px; border-radius:99px; background:var(--green); box-shadow:0 0 8px var(--green); }
.chat-main { min-width:0; display:flex; flex-direction:column; gap:12px; }
.chat-topbar { min-height:70px; display:flex; align-items:center; gap:12px; padding:11px 15px; border:1px solid var(--line); border-radius:20px; background:rgba(12,8,15,.8); box-shadow:var(--shadow); }
.chat-title { display:grid; gap:4px; min-width:0; }
.chat-title h2 { margin:0; font:700 22px/1 "Playfair Display",serif; }
.chat-title span { color:var(--green); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-actions { margin-left:auto; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.compact-primary { padding:9px 11px; font-size:12px; }
.chat-workspace .chat-panel { min-height:0; flex:1; display:flex; flex-direction:column; }
.chat-workspace .chat-messages { height:auto; min-height:430px; max-height:calc(100vh - 255px); flex:1; }
.chat-initiative { border-top:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; color:var(--muted); font-size:11px; }
.chat-initiative .small-button { padding:7px 9px; font-size:11px; }
.empty-panel { padding: 30px; border: 1px dashed rgba(221,198,255,.27); background: rgba(255,255,255,.025); border-radius: 20px; color: var(--muted); }
.chat-layout { display:grid; grid-template-columns:minmax(0,1fr) 312px; gap:22px; align-items:start; }
.chat-panel,.info-panel { border:1px solid var(--line); border-radius:23px; background:rgba(23,18,28,.78); box-shadow:var(--shadow); overflow:hidden; }
.chat-head { display:flex; align-items:center; gap:13px; padding:17px 20px; border-bottom:1px solid var(--line); }
.avatar { width:42px; height:42px; border-radius:13px; background:linear-gradient(135deg,#693b98,#21152b); overflow:hidden; display:grid; place-items:center; font-weight:700; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.chat-head h2 { font:700 19px/1 "Playfair Display",serif; margin:0 0 3px; }
.chat-head span { font-size:11px; color:var(--green); }
.persona-chip { margin-left:auto; color:var(--lilac) !important; background:rgba(166,92,255,.14); border:1px solid rgba(221,198,255,.18); border-radius:99px; padding:6px 9px; white-space:nowrap; }
.chat-messages { height:clamp(390px,56vh,640px); padding:28px 24px; display:flex; flex-direction:column; gap:14px; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:rgba(221,198,255,.35) transparent; scrollbar-width:thin; }
.chat-messages::-webkit-scrollbar { width:8px; }
.chat-messages::-webkit-scrollbar-thumb { background:rgba(221,198,255,.28); border-radius:99px; }
.chat-history-loader { align-self:center; display:flex; flex-direction:column; align-items:center; gap:6px; padding:4px 0 8px; text-align:center; }
.chat-history-loader small { color:var(--muted); font-size:11px; }
.message-row { position:relative; display:flex; flex-direction:column; max-width:min(78%,560px); }
.message-row.me { align-self:flex-end; align-items:flex-end; }
.message-row.them { align-self:flex-start; align-items:flex-start; }
.message { max-width:100%; padding:12px 14px; border-radius:16px 16px 16px 4px; background:#2a2231; color:#eee8f2; line-height:1.47; font-size:14px; }
.message.me { align-self:flex-end; border-radius:16px 16px 4px 16px; background:linear-gradient(135deg,#7940b4,#5a2f89); }
.message em { color:#efe4f8; }
.message.duo-message { padding:12px 14px; }
.duo-reply { display:grid; gap:8px; }
.duo-line { margin:0; color:#eee8f2; line-height:1.48; }
.duo-speaker { color:#d9b7ff; font-size:12px; font-weight:800; letter-spacing:.025em; }
.duo-line-1 .duo-speaker { color:#8af0c5; }
.message.system { align-self:center; text-align:center; padding:0; background:transparent; color:#867b8d; font-size:11px; }
.message.system.error { color:#ffadc6; }
.message-reaction-bar { min-height:24px; display:flex; align-items:center; gap:5px; padding:3px 2px 0; }
.message-row.me .message-reaction-bar { flex-direction:row-reverse; }
.message-reactions { display:flex; flex-wrap:wrap; gap:4px; }
.message-reaction { display:inline-flex; align-items:center; gap:3px; min-width:25px; padding:2px 5px; border:1px solid rgba(221,198,255,.2); border-radius:999px; background:#211a29; color:#f7eefc; font-size:13px; line-height:1; box-shadow:0 4px 10px rgba(0,0,0,.14); }
.message-reaction b { font:700 10px/1 Inter,ui-sans-serif,sans-serif; color:var(--lilac); }
.reaction-trigger { width:22px; height:22px; display:grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#8f8396; cursor:pointer; font-size:14px; opacity:.56; transition:.16s ease; }
.reaction-trigger:hover,.reaction-trigger.open { opacity:1; color:var(--lilac); background:rgba(221,198,255,.12); }
.message-speaker-trigger { width:22px; height:22px; display:grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#a99cad; cursor:pointer; font-size:14px; line-height:1; opacity:.58; transition:.16s ease; }
.message-speaker-trigger:hover,.message-speaker-trigger:focus-visible { opacity:1; color:var(--lilac); background:rgba(221,198,255,.12); }
.message-delete-trigger { width:22px; height:22px; display:grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#8f8396; cursor:pointer; font-size:17px; line-height:1; opacity:0; transition:.16s ease; }
.message-row:hover .message-delete-trigger,.message-delete-trigger:focus-visible { opacity:.72; }
.message-delete-trigger:hover { opacity:1; color:#ffadc6; background:rgba(255,104,154,.12); }
.message-delete-preview { margin:16px 0; padding:13px 14px; border:1px solid rgba(221,198,255,.16); border-radius:14px; background:#17121c; }
.message-delete-preview small { color:var(--lilac); font-weight:700; }
.message-delete-preview p { margin:6px 0 0; color:var(--muted); line-height:1.48; white-space:pre-wrap; }
.danger-action { background:linear-gradient(135deg,#b64573,#7e244f) !important; }
.reaction-picker { position:absolute; z-index:4; bottom:calc(100% - 4px); left:0; display:flex; align-items:center; gap:2px; padding:7px 9px; border:1px solid rgba(221,198,255,.42); border-radius:15px; background:#f9f6fb; box-shadow:0 15px 34px rgba(0,0,0,.42); }
.message-row.me .reaction-picker { left:auto; right:0; }
.reaction-option { width:31px; height:31px; display:grid; place-items:center; padding:0; border:0; border-radius:9px; background:transparent; color:#201827; cursor:pointer; font-size:20px; transition:transform .15s ease, background .15s ease; }
.reaction-option:hover { transform:translateY(-2px) scale(1.1); background:rgba(111,59,151,.12); }
.chat-compose { border-top:1px solid var(--line); padding:14px; display:flex; gap:10px; }
.chat-compose textarea { resize:none; min-height:48px; flex:1; border:1px solid rgba(255,255,255,.11); background:#110d15; color:var(--ink); border-radius:13px; padding:13px; outline:none; }
.chat-compose textarea:focus { border-color:var(--purple); }
.send { width:48px; border:0; border-radius:13px; background:var(--purple); color:#fff; cursor:pointer; font-size:18px; }
.info-panel { padding:22px; }
.info-panel h3 { margin-bottom:6px; font:700 19px/1.1 "Playfair Display",serif; }
.info-panel p { color:var(--muted); font-size:13px; line-height:1.5; }
.info-section { border-top:1px solid var(--line); padding-top:17px; margin-top:18px; }
.stat { display:flex; justify-content:space-between; gap:12px; font-size:12px; color:var(--muted); padding:7px 0; }
.stat b { color:var(--ink); font-weight:600; }
.toolbar { display:flex; flex-wrap:wrap; gap:9px; margin-top:18px; }
.modal-backdrop { position:fixed; inset:0; z-index:20; background:rgba(6,4,8,.72); backdrop-filter:blur(7px); }
.modal { position:fixed; z-index:21; left:50%; top:50%; transform:translate(-50%,-50%); width:min(620px,calc(100vw - 36px)); max-height:85vh; overflow:auto; border:1px solid rgba(221,198,255,.24); border-radius:23px; background:#1b1521; box-shadow:0 28px 90px rgba(0,0,0,.58); padding:26px; }
.modal-head { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom:18px; }
.modal-head h2 { margin:0; }
.close { background:transparent; border:0; color:var(--muted); cursor:pointer; font-size:21px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.field-label-row { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); }
.field-label-row .small-button { padding:5px 8px; font-size:10px; }
.field.full { grid-column:1 / -1; }
.field input,.field select,.field textarea { width:100%; border:1px solid var(--line); background:#110d15; color:var(--ink); border-radius:11px; padding:10px; outline:none; }
.field textarea { min-height:145px; resize:vertical; }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:18px; }
.field small { color:#81768a; line-height:1.4; }
.tag-picker { width:100%; border:1px solid var(--line); background:#110d15; border-radius:11px; overflow:hidden; }
.tag-picker summary { cursor:pointer; color:var(--ink); padding:10px; list-style:none; display:flex; align-items:center; justify-content:space-between; }
.tag-picker summary::-webkit-details-marker { display:none; }
.tag-picker summary::after { content:"⌄"; color:var(--lilac); font-size:15px; line-height:1; }
.tag-picker[open] summary { border-bottom:1px solid var(--line); }
.tag-picker[open] summary::after { transform:rotate(180deg); }
.tag-picker-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; max-height:190px; overflow:auto; padding:10px; }
.tag-picker-option { display:flex; align-items:center; gap:7px; min-width:0; padding:8px; border:1px solid rgba(221,198,255,.12); border-radius:9px; color:var(--muted); cursor:pointer; }
.tag-picker-option:has(input:checked) { border-color:rgba(184,90,255,.78); background:rgba(184,90,255,.14); color:var(--ink); }
.tag-picker-option input[type="checkbox"] { width:15px; min-width:15px; height:15px; margin:0; padding:0; accent-color:var(--accent); }
.tag-picker-option input[type="checkbox"]:disabled + span { opacity:.42; }
.tag-picker-option span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.import-replace { grid-column:1 / -1; display:flex; align-items:flex-start; gap:10px; padding:12px; border:1px solid rgba(221,198,255,.18); border-radius:12px; background:rgba(166,92,255,.08); cursor:pointer; }
.import-replace input { width:17px; height:17px; accent-color:var(--purple); margin:1px 0 0; }
.import-replace span { display:grid; gap:4px; }
.import-replace b { font-size:13px; }
.import-replace small { color:var(--muted); font-size:11px; line-height:1.45; }
.form-error { color:#ffadc6; font-size:13px; margin:14px 0 0; }
.form-status { color:#ffb6cf; font-size:13px; margin:14px 0 0; }
.form-status.connected { color:var(--green); }
.form-status.failed { color:#ffadc6; }
.connection-status { color:#ffb6cf !important; font-size:12px !important; font-weight:700; }
.connection-status.connected { color:var(--green) !important; }
.setup-steps { margin:16px 0; padding:15px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.035); color:var(--muted); font-size:13px; line-height:1.5; }
.setup-steps strong { color:var(--ink); }
.setup-steps ol { margin:7px 0 0; padding-left:19px; }
.setup-steps a { color:var(--lilac); }
.typing { color:var(--lilac); font-style:italic; }
.typing-indicator { align-self:flex-start; display:flex; align-items:center; gap:5px; min-width:47px; padding:12px 14px; border-radius:16px 16px 16px 4px; background:#2a2231; }
.typing-indicator i { width:7px; height:7px; border-radius:50%; background:#d9c2ed; opacity:.42; animation:typing-bounce 1.05s infinite ease-in-out; }
.typing-indicator i:nth-child(2) { animation-delay:.14s; }
.typing-indicator i:nth-child(3) { animation-delay:.28s; }
@keyframes typing-bounce { 0%,60%,100% { transform:translateY(0); opacity:.34; } 30% { transform:translateY(-5px); opacity:1; } }
.send:disabled,.chat-compose textarea:disabled { opacity:.55; cursor:not-allowed; }
.timeline { display:grid; gap:12px; }
.timeline-item { border:1px solid var(--line); background:rgba(255,255,255,.03); border-radius:16px; padding:16px; }
.timeline-item time { color:var(--lilac); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.timeline-item h3 { margin:6px 0; font-size:17px; }
.timeline-item p { color:var(--muted); font-size:13px; margin:0; line-height:1.45; }
.archive-manager { margin-top:16px; }
.archive-canon-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:14px 0; }
.archive-canon-grid > div { padding:12px; border:1px solid rgba(221,198,255,.12); border-radius:12px; background:rgba(0,0,0,.13); }
.archive-canon-grid h4,.archive-entry h4 { margin:0 0 7px; color:var(--ink); font-size:13px; }
.archive-fact-list { display:grid; gap:7px; margin:0; padding-left:18px; color:var(--muted); font-size:12px; line-height:1.45; }
.archive-entry-list { display:grid; gap:9px; margin-top:12px; }
.archive-entry { padding:12px; border:1px solid rgba(221,198,255,.12); border-radius:12px; background:rgba(0,0,0,.12); }
.archive-entry time { color:var(--lilac); font-size:10px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }
.archive-entry p { margin-top:4px; }
.archive-entry .toolbar { margin-top:11px; }
.archive-gallery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:13px; }
.archive-gallery figure { margin:0; overflow:hidden; border:1px solid rgba(221,198,255,.14); border-radius:13px; background:rgba(0,0,0,.13); }
.archive-gallery img { display:block; width:100%; height:154px; object-fit:cover; object-position:center top; }
.archive-gallery figcaption { display:grid; gap:4px; padding:10px; color:var(--muted); font-size:12px; line-height:1.35; }
.archive-gallery figcaption b { color:var(--ink); font-size:12px; }
.archive-gallery figcaption small { color:#8d8095; font-size:10px; }
.archive-gallery .toolbar { margin-top:5px; }
.sandbox-foundation { padding:12px; border:1px solid rgba(221,198,255,.14); border-radius:12px; background:rgba(0,0,0,.1); }
.sandbox-foundation summary,.sandbox-details summary { cursor:pointer; color:var(--ink); font-size:12px; font-weight:700; }
.sandbox-foundation .archive-canon-grid { margin-bottom:0; }
.sandbox-details { margin-top:14px; padding:12px; border:1px solid rgba(221,198,255,.14); border-radius:12px; background:rgba(0,0,0,.1); }
.sandbox-seed-list { display:grid; gap:9px; margin-top:12px; }
.sandbox-seed { display:flex; align-items:start; justify-content:space-between; gap:12px; padding:11px; border:1px solid rgba(221,198,255,.11); border-radius:11px; background:rgba(255,255,255,.025); }
.sandbox-seed > div { display:grid; gap:5px; min-width:0; }
.sandbox-seed em,.sandbox-log h4 em,.sandbox-log-review em { color:#e8d7fa; line-height:1.45; }
.sandbox-seed small,.sandbox-log small,.sandbox-log-review small { color:#8d8095; font-size:11px; line-height:1.4; }
.sandbox-seed label { display:grid; gap:5px; flex:none; color:#8d8095; font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
.sandbox-seed select { min-width:104px; border:1px solid var(--line); border-radius:9px; background:#110d15; color:var(--ink); padding:7px; font-size:11px; }
.sandbox-log { display:grid; gap:6px; padding:12px; border:1px solid rgba(221,198,255,.12); border-radius:12px; background:rgba(255,255,255,.025); }
.sandbox-log time { color:var(--lilac); font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.sandbox-log h4 { margin:0; font-size:13px; }
.sandbox-log p { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.sandbox-log .small-button { justify-self:start; margin-top:3px; }
.sandbox-log-review { display:grid; gap:8px; margin:0 0 14px; padding:13px; border:1px solid rgba(221,198,255,.15); border-radius:12px; background:rgba(166,92,255,.07); }
.sandbox-log-review p { margin:0; }
.story-chapters { display:grid; gap:10px; max-width:880px; }
.story-chapter { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:15px 17px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.025); }
.story-chapter-main { display:flex; align-items:center; gap:13px; min-width:0; }
.story-chapter-avatar { display:grid; place-items:center; width:48px; height:48px; flex:none; overflow:hidden; border-radius:50%; background:linear-gradient(135deg,#8650b6,#33213f); color:#fff; font:700 18px/1 "Playfair Display",serif; }
.story-chapter-avatar img { width:100%; height:100%; object-fit:cover; }
.story-chapter h2 { margin:1px 0 4px; font:700 21px/1.05 "Playfair Display",serif; }
.story-chapter .eyebrow { margin:0; font-size:9px; }
.story-chapter p { margin:0; color:var(--muted); font-size:12px; }
.story-chapter small { display:block; max-width:530px; margin-top:5px; overflow:hidden; color:#8d8095; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.story-chapter-actions { display:flex; flex:none; gap:7px; }
.chapter-event-list { display:grid; gap:8px; margin-top:18px; }
.chapter-event { display:grid; grid-template-columns:82px minmax(0,1fr); gap:3px 11px; width:100%; padding:12px 13px; border:1px solid rgba(221,198,255,.14); border-radius:12px; background:rgba(255,255,255,.028); color:var(--ink); cursor:pointer; text-align:left; }
.chapter-event:hover { border-color:rgba(221,198,255,.45); background:rgba(166,92,255,.09); }
.chapter-event time { grid-row:span 2; color:var(--lilac); font-size:10px; font-weight:700; letter-spacing:.08em; }
.chapter-event strong { overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.chapter-event span { overflow:hidden; color:var(--muted); font-size:12px; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.identity-intro { display:flex; align-items:center; gap:18px; padding:23px; margin-bottom:22px; border:1px solid rgba(221,198,255,.18); border-radius:22px; background:linear-gradient(120deg,rgba(110,55,145,.3),rgba(23,18,28,.86)); }
.identity-intro > div { flex:1; }
.identity-intro h2 { margin-bottom:6px; }
.identity-intro p { color:var(--muted); margin:0; line-height:1.5; }
.identity-symbol { display:grid; place-items:center; width:58px; height:58px; flex:none; border-radius:18px; background:linear-gradient(135deg,#e4b5ff,#6c3e9d); color:#180725; font-size:31px; }
.identity-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(285px,430px)); gap:16px; }
.identity-card { min-height:245px; padding:22px; border:1px solid var(--line); border-radius:20px; background:rgba(255,255,255,.03); display:flex; flex-direction:column; justify-content:space-between; gap:16px; }
.identity-card.active { border-color:rgba(221,198,255,.55); box-shadow:0 16px 44px rgba(112,54,166,.18); background:linear-gradient(155deg,rgba(166,92,255,.13),rgba(255,255,255,.025)); }
.self-identity-main { display:flex; align-items:flex-start; gap:15px; }
.self-profile-portrait { width:72px; height:72px; flex:none; display:grid; place-items:center; overflow:hidden; border:1px solid rgba(221,198,255,.32); border-radius:20px; background:linear-gradient(135deg,#c79bff,#5b2c80); color:#180725; font:700 29px/1 "Playfair Display",serif; box-shadow:0 8px 23px rgba(96,45,137,.24); }
.self-profile-portrait img { width:100%; height:100%; object-fit:cover; object-position:center top; }
.identity-card h2 { margin-bottom:14px; }
.identity-line { color:var(--muted); margin:6px 0; font-size:13px; line-height:1.45; }
.identity-line b { color:var(--ink); display:inline-block; min-width:105px; }
.identity-note { margin-top:22px; font-size:12px; }
.persona-date-note { margin:3px 0 18px; color:var(--lilac); font-size:13px; font-weight:700; }
.date-stage { max-width:820px; margin:0 auto; min-height:72vh; border:1px solid var(--line); border-radius:28px; background:linear-gradient(160deg,rgba(70,39,77,.68),rgba(22,15,27,.98)); box-shadow:var(--shadow); padding:clamp(24px,5vw,56px); display:flex; flex-direction:column; }
.date-stage .eyebrow { margin-top:20px; }
.scene-count { color:var(--lilac); font-weight:700; font-size:12px; }
.date-stage h2 { font-size:clamp(31px,5vw,52px); margin-top:0; }
.scene-copy { color:#d6cfd9; line-height:1.75; font-size:16px; max-width:690px; }
.date-living-note { margin:0 0 15px; color:#cbb4df; font-size:12px; font-weight:700; }
.date-director-last { margin:0 0 18px; padding:13px; border:1px solid rgba(221,198,255,.17); border-radius:14px; background:rgba(255,255,255,.035); }
.date-director-last span { color:var(--lilac); font-size:10px; font-weight:700; letter-spacing:.09em; }
.date-director-last p { margin:7px 0 4px; color:#e6ddec; line-height:1.45; }
.date-director-last small { color:var(--muted); line-height:1.45; }
.choices { display:grid; gap:10px; margin-top:auto; padding-top:30px; }
.choice { text-align:left; border:1px solid rgba(221,198,255,.19); border-radius:14px; color:#eee7f1; background:rgba(255,255,255,.045); padding:14px; cursor:pointer; transition:.18s ease; }
.choice:hover { background:rgba(166,92,255,.2); border-color:var(--purple); }
.free-answer { display:flex; gap:9px; margin-top:11px; }
.free-answer input { flex:1; background:rgba(0,0,0,.24); border:1px solid var(--line); color:var(--ink); border-radius:12px; padding:12px; }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:20px 0; }
.metric-grid div { border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.035); padding:11px; display:grid; gap:4px; }
.metric-grid span { color:var(--muted); font-size:11px; }
.metric-grid b { color:var(--lilac); font-size:15px; }
.story-writer { max-width:1040px; }
.story-writer-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; padding:25px; margin:-8px 0 24px; border:1px solid rgba(221,198,255,.2); border-radius:22px; background:linear-gradient(126deg,rgba(92,45,121,.34),rgba(23,18,28,.86)); box-shadow:var(--shadow); }
.story-writer-intro h2 { margin-bottom:8px; }
.story-writer-intro p { max-width:650px; color:var(--muted); line-height:1.55; margin:0; }
.story-writer-rules { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; max-width:270px; }
.story-writer-rules span { border:1px solid rgba(221,198,255,.2); border-radius:999px; padding:7px 9px; color:var(--lilac); background:rgba(255,255,255,.04); font-size:10px; font-weight:700; white-space:nowrap; }
.story-work-list { display:grid; gap:12px; }
.story-work-card { display:flex; align-items:center; justify-content:space-between; gap:22px; padding:18px; border:1px solid var(--line); border-radius:19px; background:rgba(255,255,255,.028); box-shadow:0 12px 32px rgba(0,0,0,.16); }
.story-work-card.generating { border-color:rgba(221,198,255,.42); background:linear-gradient(125deg,rgba(166,92,255,.13),rgba(255,255,255,.025)); }
.story-work-card.failed { border-color:rgba(255,124,170,.34); }
.story-work-main { min-width:0; display:flex; align-items:flex-start; gap:14px; }
.story-work-avatar { display:grid; place-items:center; width:54px; height:54px; flex:none; overflow:hidden; border-radius:16px; background:linear-gradient(135deg,#7e49ac,#2d1c38); color:#fff; font:700 22px/1 "Playfair Display",serif; }
.story-work-avatar img { width:100%; height:100%; object-fit:cover; object-position:center top; }
.story-work-main .eyebrow { margin:0 0 5px; font-size:9px; }
.story-work-main h2 { margin:0 0 7px; font-size:24px; }
.story-work-main p { max-width:680px; margin:0; color:var(--muted); font-size:13px; line-height:1.45; }
.story-work-main small { display:block; margin-top:7px; color:#9d90a5; font-size:11px; }
.story-work-main .story-work-error { color:#ffadc6; }
.story-work-actions { display:grid; flex:none; grid-template-columns:repeat(3,minmax(108px,1fr)); gap:8px; width:min(100%,396px); }
.story-work-actions button { min-height:38px; white-space:normal; text-align:center; }
.writer-range-fields { padding:13px; border:1px solid rgba(221,198,255,.17); border-radius:13px; background:rgba(255,255,255,.025); }
.writer-range-fields > span { color:var(--lilac); font-size:12px; font-weight:700; }
.writer-range-fields > small { display:block; margin-top:9px; color:#84788e; font-size:11px; line-height:1.4; }
.writer-range-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:10px; }
.writer-range-grid .field { gap:7px; }
.story-reader-meta { margin:14px 0 18px; color:var(--lilac); font-size:11px; font-weight:700; }
.story-reader { display:grid; gap:20px; }
.story-reader-chapter { padding-top:18px; border-top:1px solid var(--line); }
.story-reader-chapter:first-child { padding-top:0; border-top:0; }
.story-reader-chapter h2 { font-size:28px; }
.story-reader-text { color:#eee8f2; white-space:pre-wrap; overflow-wrap:anywhere; font:17px/1.76 Georgia, "Times New Roman", serif; }
.story-chapter-version-note { margin:0 0 15px; color:#8d8095; font-size:11px; }
.story-chapter-editor { min-height:52vh !important; font:15px/1.65 Georgia, "Times New Roman", serif; }
.story-version-list { display:grid; gap:10px; margin-top:16px; }
.story-version-card { padding:14px; border:1px solid rgba(221,198,255,.15); border-radius:14px; background:rgba(0,0,0,.15); }
.story-version-card.current { border-color:rgba(184,90,255,.48); background:rgba(166,92,255,.09); }
.story-version-card time { color:var(--lilac); font-size:10px; font-weight:700; letter-spacing:.08em; }
.story-version-card h3 { margin:6px 0 5px; font-size:17px; }
.story-version-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.story-version-card .story-version-preview { margin-top:8px; color:#c8bdce; }
.story-version-card .toolbar { margin-top:11px; }
.cloud-access-gate { width:100%; min-height:100vh; display:grid; place-items:center; padding:28px; }
.cloud-login-card { width:min(100%,420px); padding:34px; border:1px solid rgba(221,198,255,.24); border-radius:24px; background:linear-gradient(145deg,rgba(41,24,52,.98),rgba(23,16,29,.98)); box-shadow:0 28px 90px rgba(0,0,0,.45); }
.cloud-login-brand { margin-bottom:30px; color:#f5ecfb; font:400 46px/1 "Playfair Display",Georgia,serif; letter-spacing:-.06em; }
.cloud-login-brand span { letter-spacing:-.07em; }
.cloud-login-card .eyebrow { margin:0 0 10px; }
.cloud-login-card h1 { margin:0 0 10px; font-size:42px; }
.cloud-login-card > p:not(.eyebrow) { margin:0 0 24px; color:var(--muted); line-height:1.55; }
.cloud-login-form { display:grid; gap:14px; }
.cloud-login-form .primary { width:100%; margin-top:5px; }
.cloud-login-card > small { display:block; margin-top:20px; color:#887b91; font-size:11px; line-height:1.45; }
body.cloud-locked { overflow:hidden; background:radial-gradient(circle at 50% 8%,#301341 0,#150d1c 42%,#0f0b13 100%); }
body.cloud-locked .app-shell { display:block; min-height:100vh; }
body.cloud-locked .sidebar { display:none; }
body.cloud-locked .content { max-width:none; min-height:100vh; margin:0; padding:0; }
@media (max-width: 520px) { .cloud-access-gate { padding:20px; } .cloud-login-card { padding:27px 23px; border-radius:21px; } .cloud-login-card h1 { font-size:36px; } }
@media (max-width: 720px) { .story-writer-intro,.story-work-card { align-items:flex-start; flex-direction:column; } .story-writer-rules { justify-content:flex-start; max-width:none; } .story-work-actions { width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); } .writer-range-grid,.archive-canon-grid,.archive-gallery { grid-template-columns:1fr; } }
@media (max-width: 440px) { .story-work-actions { grid-template-columns:1fr; } }
@media (max-width: 1120px) { .character-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 940px) { .character-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 880px) { .profile-hero,.roulette-card { grid-template-columns:1fr; } .profile-image img,.profile-image span,.roulette-photo img { min-height:340px; max-height:480px; } .profile-detail-grid { grid-template-columns:1fr; } }
@media (max-width: 1080px) { .chat-workspace { grid-template-columns:190px minmax(0,1fr); } }
@media (max-width: 820px) { .chat-workspace { min-height:0; grid-template-columns:1fr; } .chat-roster { display:none; } .chat-topbar { align-items:flex-start; flex-wrap:wrap; } .chat-actions { width:100%; margin-left:0; justify-content:flex-start; } .chat-workspace .chat-messages { min-height:390px; max-height:60vh; } }
@media (max-width: 620px) { .story-chapter,.roulette-intro { align-items:flex-start; flex-direction:column; gap:12px; } .story-chapter-actions { width:100%; } .story-chapter-actions button { flex:1; } .chapter-event { grid-template-columns:1fr; } .chapter-event time { grid-row:auto; } }
@media (max-width: 820px) { .app-shell { grid-template-columns:1fr; } .sidebar { position:sticky; z-index:10; height:auto; padding:14px 14px 0; border-right:0; border-bottom:1px solid var(--line); flex-direction:row; align-items:center; gap:9px; overflow:auto; } .brand { font-size:29px; margin:0 6px; } .vault-status,.sidebar-bottom { display:none; } .main-nav { display:flex; gap:2px; white-space:nowrap; overflow:auto; } .nav-item { padding:10px 8px; font-size:12px; } .nav-item.active { box-shadow:inset 0 -2px 0 var(--purple); } .content { padding:30px 18px 50px; } .topline { align-items:flex-start; flex-direction:column; margin-bottom:24px; } .character-grid { grid-template-columns:minmax(0,1fr); } .character-card { min-height:0; } .chat-layout { grid-template-columns:1fr; } .info-panel { display:none; } .identity-intro { align-items:flex-start; flex-wrap:wrap; } .persona-chip { display:none; } h1 { font-size:42px; } }
