
:root {
  --bg:#0d0e13;
  --panel:#13151d;
  --panel2:#191c26;
  --line:#292d3a;
  --text:#f5f6fb;
  --muted:#969bac;
  --accent:#8879ff;
  --accent2:#b7adff;
  --danger:#ff7087;
  --success:#70d7a0;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
  overflow:hidden
}
button,input,textarea,select{font:inherit}
button{border:0;cursor:pointer}
.hidden{display:none!important}

#app{height:100vh;display:grid;grid-template-columns:1fr}
.sidebar{
  background:#101117;border-right:1px solid var(--line);
  padding:18px;display:flex;flex-direction:column;min-width:0
}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:18px}
.brand-mark{
  width:42px;height:42px;border-radius:13px;
  display:grid;place-items:center;font-weight:900;
  background:linear-gradient(135deg,var(--accent),#5143c0)
}
.brand h1{margin:0;font-size:17px}
.brand span{color:var(--muted);font-size:12px}
.section-label{
  margin:10px 4px 9px;color:var(--muted);font-size:11px;
  text-transform:uppercase;letter-spacing:.12em
}
.character-list{flex:1;overflow:auto}
.character-card{
  display:flex;align-items:center;gap:11px;padding:10px;
  border-radius:13px;margin-bottom:5px;cursor:pointer;
  border:1px solid transparent
}
.character-card:hover{background:#171923}
.character-card.active{background:#1d2030;border-color:#35394c}
.avatar,.msg-avatar,.profile-avatar{background:#2c3040 center/cover no-repeat}
.avatar{
  width:42px;height:42px;border-radius:50%;display:grid;
  place-items:center;font-weight:800;flex:none
}
.avatar.large{width:48px;height:48px}
.meta{min-width:0}
.name{font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tagline{
  color:var(--muted);font-size:12px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis
}
.guest-hint{
  font-size:11px;line-height:1.45;color:#d0b777;padding:11px;
  border:1px solid #594b2e;background:#241f16;border-radius:11px
}

.main{
  min-width:0;height:100vh;position:relative;
  background:radial-gradient(circle at 75% 5%,rgba(98,78,190,.11),transparent 32%),var(--bg)
}
.page-view{height:calc(100vh - 72px);overflow:auto}
.page-shell{width:min(1120px,100%);margin:0 auto;padding:34px 34px 90px}
.page-heading{
  display:flex;justify-content:space-between;align-items:flex-start;
  gap:20px;margin-bottom:24px
}
.page-heading h2{font-size:30px;margin:4px 0 6px}
.page-heading p{color:var(--muted);margin:0;max-width:650px;line-height:1.5}
.eyebrow{color:var(--accent2);letter-spacing:.14em;font-size:10px;font-weight:800}

.primary,.ghost,.send,.icon-button{
  border-radius:11px;padding:10px 13px;transition:.15s ease
}
.primary{
  color:white;background:linear-gradient(135deg,#8576ff,#6051d4);font-weight:750
}
.primary:hover{filter:brightness(1.08);transform:translateY(-1px)}
.ghost,.icon-button{background:var(--panel2);color:var(--text);border:1px solid var(--line)}
.ghost:hover,.icon-button:hover{background:#212432}
.full{width:100%}
.danger-text{color:var(--danger)}

.discover-search{
  display:flex;gap:10px;align-items:center;background:#151720;
  border:1px solid var(--line);padding:0 14px;height:52px;
  border-radius:15px;margin-bottom:20px
}
.discover-search span{font-size:24px;color:var(--muted)}
.discover-search input{
  width:100%;border:0;outline:0;background:transparent;
  color:var(--text);font-size:15px
}
.discover-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(225px,1fr));gap:14px
}
.discover-card,.recent-chat-card,.account-card,.auth-card,.account-explainer{
  background:#141720;border:1px solid var(--line);border-radius:17px
}
.discover-card{overflow:hidden;cursor:pointer;transition:.15s ease}
.discover-card:hover{transform:translateY(-2px);border-color:#454a60}
.discover-card-top{
  height:170px;background:radial-gradient(circle at 50% 25%,rgba(139,124,255,.22),transparent 55%),#1b1e28;
  display:grid;place-items:center
}
.discover-avatar{
  width:98px;height:98px;border-radius:50%;background:#303444 center/cover no-repeat;
  display:grid;place-items:center;font-size:24px;font-weight:900;
  border:3px solid rgba(255,255,255,.06)
}
.discover-card-body{padding:14px}
.discover-card-body h3{margin:0 0 5px;font-size:16px}
.discover-card-body p{margin:0;color:var(--muted);font-size:12px;line-height:1.45;min-height:35px}

.recent-chats-grid{display:grid;gap:10px}
.recent-chat-card{
  display:flex;align-items:center;gap:14px;padding:14px;cursor:pointer
}
.recent-chat-card:hover{background:#191c26}
.recent-chat-card .chat-copy{min-width:0;flex:1}
.recent-chat-card h3{margin:0 0 4px}
.recent-chat-card p{margin:0;color:var(--muted);font-size:12px}
.empty-list{
  padding:45px 20px;text-align:center;color:var(--muted);
  border:1px dashed #343847;border-radius:16px
}

.chat-view{
  height:calc(100vh - 72px);display:grid;
  grid-template-rows:auto auto 1fr auto auto
}
.chat-header{
  height:78px;padding:14px 24px;border-bottom:1px solid var(--line);
  background:rgba(16,17,23,.9);display:flex;align-items:center;gap:14px
}
.header-character{display:flex;gap:12px;align-items:center;min-width:0}
.header-character h2{margin:0;font-size:18px}
.header-character p{
  margin:3px 0 0;color:var(--muted);font-size:12px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px
}
.header-actions{margin-left:auto;display:flex;gap:7px}
.icon-button{width:40px;height:40px;padding:0;font-size:20px}
.relationship-bar{
  min-height:60px;display:grid;grid-template-columns:150px repeat(3,1fr);
  align-items:center;gap:18px;padding:10px 24px;
  border-bottom:1px solid var(--line);background:#11131a
}
.relationship-bar span,.meter-group label{color:var(--muted);font-size:11px}
.relationship-bar strong{display:block;margin-top:3px}
.meter-group label{display:flex;justify-content:space-between}
.meter{height:5px;margin-top:5px;border-radius:99px;background:#292d3a;overflow:hidden}
.meter i{
  display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),#c77dff);
  transition:width .3s
}

.messages{overflow:auto;padding:30px max(28px,calc((100vw - 900px)/2))}
.message{
  max-width:760px;margin:0 auto 23px;display:grid;
  grid-template-columns:38px 1fr;gap:12px
}
.message.user{grid-template-columns:1fr}
.message.user .bubble{
  justify-self:end;max-width:72%;background:#242838;
  border-radius:17px 17px 4px 17px;padding:11px 14px
}
.message.assistant .bubble{line-height:1.65;color:#e9eaf1}
.speaker{font-weight:800;font-size:12px;margin-bottom:5px;color:var(--accent2)}
.action{color:#abb0c2;font-style:italic}
.msg-avatar{
  width:34px;height:34px;border-radius:50%;display:grid;
  place-items:center;font-size:11px;font-weight:800
}
.composer{
  padding:16px 24px 20px;border-top:1px solid var(--line);
  display:flex;gap:10px;background:#0e0f14
}
.composer textarea{
  width:100%;max-height:160px;resize:none;color:var(--text);
  background:#191c25;border:1px solid #303442;border-radius:15px;
  outline:none;padding:13px 15px
}
.composer textarea:focus{border-color:#5e56a4}
.send{width:48px;color:white;background:var(--accent);font-size:18px}
.fallback-notice{
  margin:0 24px 4px;padding:7px 11px;border:1px solid #5b4e2c;
  background:#2b2518;color:#e2c985;border-radius:9px;font-size:12px
}

.typing-dots{
  display:inline-flex;align-items:center;gap:5px;height:24px;padding:2px 4px
}
.typing-dots span,.chat-loading span{
  width:7px;height:7px;border-radius:50%;background:#8f94a7;
  display:block;animation:pfTypingBounce 1.15s infinite ease-in-out
}
.typing-dots span:nth-child(2),.chat-loading span:nth-child(2){animation-delay:.16s}
.typing-dots span:nth-child(3),.chat-loading span:nth-child(3){animation-delay:.32s}
@keyframes pfTypingBounce{
  0%,60%,100%{transform:translateY(0);opacity:.45}
  30%{transform:translateY(-5px);opacity:1}
}
.streaming-text{min-height:1.4em}
#streamingMessage .streaming-text::after{
  content:"";display:inline-block;width:2px;height:1em;margin-left:3px;
  vertical-align:-2px;background:#a9adc0;animation:pfCursor .8s steps(1) infinite
}
@keyframes pfCursor{0%,49%{opacity:1}50%,100%{opacity:0}}
.chat-loading{min-height:120px;display:flex;align-items:center;justify-content:center;gap:7px}

.account-shell{max-width:1000px}
.auth-layout,.account-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.auth-card,.account-explainer,.account-card{padding:20px}
.auth-tabs{
  display:grid;grid-template-columns:1fr 1fr;background:#0f1118;
  border-radius:11px;padding:4px;margin-bottom:17px
}
.auth-tab{background:transparent;color:var(--muted);padding:9px;border-radius:8px}
.auth-tab.active{background:#242837;color:var(--text)}
.auth-form{display:grid;gap:8px}
.auth-form label{color:var(--muted);font-size:12px;margin-top:4px}
.auth-form input,.form-field input,.form-field textarea,.form-field select{
  width:100%;background:#0f1118;border:1px solid #303442;
  border-radius:10px;color:var(--text);padding:10px;outline:none
}
.auth-form .primary{margin-top:9px}
.account-explainer h3,.account-card h3{margin-top:0}
.account-explainer>p,.account-card>p{color:var(--muted);line-height:1.5;font-size:13px}
.feature-row{display:flex;gap:10px;align-items:center;padding:8px 0;color:#dfe1e8;font-size:13px}
.feature-row b{color:var(--success)}
.feature-row.muted{color:#777d8d}
.feature-row.muted b{color:#777d8d}

.profile-hero{
  display:flex;align-items:center;gap:16px;background:#141720;
  border:1px solid var(--line);border-radius:18px;padding:18px;margin-bottom:16px
}
.profile-avatar{
  width:72px;height:72px;border-radius:50%;display:grid;
  place-items:center;font-weight:900;font-size:20px
}
.profile-hero h3{margin:3px 0}
.profile-hero p{margin:0;color:var(--muted);font-size:12px}
.profile-label{font-size:10px;color:var(--accent2);letter-spacing:.1em}
.profile-hero .ghost{margin-left:auto}
.profile-details{margin:14px 0;display:grid;gap:8px}
.profile-detail{
  background:#0f1118;border:1px solid var(--line);
  border-radius:10px;padding:10px
}
.profile-detail span{display:block;color:var(--muted);font-size:10px;margin-bottom:3px}

.bottom-nav{
  position:absolute;left:0;right:0;bottom:0;height:72px;
  display:grid;grid-template-columns:repeat(3,1fr);
  background:rgba(13,14,19,.96);border-top:1px solid var(--line);
  backdrop-filter:blur(15px);z-index:10
}
.bottom-nav-item{
  background:transparent;color:#777c8d;display:flex;
  flex-direction:column;align-items:center;justify-content:center;
  gap:3px;font-size:11px
}
.bottom-nav-item.active{color:white}
.nav-symbol{font-size:23px;line-height:1}
.bottom-nav-item.active .nav-symbol{color:var(--accent2)}

.modal-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.68);
  display:grid;place-items:center;padding:25px;z-index:30
}
.modal{
  width:min(720px,100%);max-height:90vh;overflow:auto;
  background:#151720;border:1px solid #323647;border-radius:18px;
  box-shadow:0 24px 90px rgba(0,0,0,.45);padding:22px
}
.modal h2{margin-top:0}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.form-field{display:grid;gap:6px}
.form-field.full-width{grid-column:1/-1}
.form-field label{color:var(--muted);font-size:12px}
.form-field textarea{min-height:92px;resize:vertical}
.form-field small{color:var(--muted);font-size:11px;line-height:1.4}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.setting-block{
  background:#10121a;border:1px solid var(--line);
  border-radius:13px;padding:13px;margin-bottom:10px
}
.setting-block h3{margin:0 0 7px;font-size:14px}
.setting-block p{margin:0;color:var(--muted);font-size:12px;line-height:1.45}
.memory-item{
  background:#10121a;border:1px solid var(--line);border-radius:12px;
  padding:11px;display:flex;gap:10px;justify-content:space-between;margin:8px 0
}
.memory-kind{color:var(--accent2);font-size:9px;text-transform:uppercase;letter-spacing:.1em}
.icon-preview{
  width:70px;height:70px;border-radius:50%;background:#242836 center/cover no-repeat;
  display:grid;place-items:center;margin-top:8px;font-weight:800
}

@media(max-width:900px){
  #app{grid-template-columns:1fr}
  .sidebar{display:none}
  .messages{padding-left:18px;padding-right:18px}
  .header-actions .ghost:nth-last-child(n+3){display:none}
}
@media(max-width:700px){
  .auth-layout,.account-grid{grid-template-columns:1fr}
  .relationship-bar{grid-template-columns:1fr 1fr}
  .page-shell{padding:25px 16px 90px}
  .page-heading{flex-direction:column}
  .discover-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* v0.9 Community */
.discover-title-row{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.discover-title-row h3{min-width:0;flex:1}
.community-badge{
  flex:none;
  font-size:8px;
  letter-spacing:.09em;
  font-weight:900;
  color:#d8d1ff;
  border:1px solid #514a88;
  background:#26223f;
  border-radius:999px;
  padding:4px 6px;
}
.creator-line{
  margin-top:7px;
  color:#777d90;
  font-size:10px;
}
.community-publish-box{margin-top:14px}
.publish-check{
  display:flex;
  gap:9px;
  align-items:center;
  margin-top:10px;
  color:#e3e5ee;
  font-size:13px;
}
.publish-check input{accent-color:var(--accent)}
button:disabled{
  opacity:.48;
  cursor:not-allowed;
  transform:none!important;
  filter:none!important;
}

/* ================================================================
   PersonaForge v1.0 pre-launch polish
   ================================================================ */
.main-area{min-width:0}
.discover-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:14px 0 8px;flex-wrap:wrap}
.filter-chips{display:flex;gap:7px;flex-wrap:wrap}
.filter-chip{background:#171a24;border:1px solid var(--line);color:var(--muted);padding:8px 11px;border-radius:999px;font-size:12px}
.filter-chip.active{background:#2a2650;border-color:#655ba8;color:#f4f1ff}
.discover-selects{display:flex;gap:8px}
.discover-selects select{background:#151821;color:var(--text);border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.result-count{color:var(--muted);font-size:11px;margin:0 0 11px}
.discover-card{position:relative}
.favorite-float{position:absolute;right:11px;top:11px;width:36px;height:36px;border-radius:50%;background:rgba(10,11,16,.76);border:1px solid rgba(255,255,255,.1);color:#d5d7e1;font-size:20px;z-index:2;backdrop-filter:blur(8px)}
.favorite-float.active{color:#ff7898;background:rgba(62,24,39,.82)}
.official-badge{font-size:8px;letter-spacing:.09em;font-weight:900;color:#d8f2ff;border:1px solid #315c6b;background:#18313a;border-radius:999px;padding:4px 6px}
.card-meta{display:flex;justify-content:space-between;gap:8px;margin-top:9px;color:#777d90;font-size:10px;white-space:nowrap;overflow:hidden}
.card-meta span{overflow:hidden;text-overflow:ellipsis}
.chat-title-line{display:flex;align-items:baseline;gap:8px;min-width:0}
.chat-title-line h3{flex:none}
.chat-title-line span{font-size:11px;color:var(--accent2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-stage{font-size:10px;color:var(--accent2);border:1px solid #3b3659;padding:5px 7px;border-radius:999px}
.chev{color:var(--muted);font-size:22px}
.thread-title{color:var(--accent2);font-size:10px;margin-top:3px;letter-spacing:.04em}
.message .bubble{position:relative}
.message-actions{display:flex;gap:5px;margin-top:8px;opacity:0;transition:opacity .15s}
.message:hover .message-actions{opacity:1}
.message-actions button{padding:3px 7px;border-radius:7px;background:#171a23;color:#8f95a8;border:1px solid #2c3040;font-size:9px}
.message.user .message-actions{justify-content:flex-end}
.edited{display:block;margin-top:5px;color:#777d8d;font-size:9px;text-align:right}
.character-detail-hero{display:flex;gap:18px;align-items:center;border-bottom:1px solid var(--line);padding-bottom:18px}
.character-detail-hero h2{margin:3px 0 5px;font-size:26px}
.character-detail-hero p{margin:0;color:var(--muted)}
.detail-avatar{width:112px;height:112px;flex:none;border-radius:24px;background:#262a37 center/cover no-repeat;display:grid;place-items:center;font-size:26px;font-weight:900;border:1px solid #373c4e}
.badge-row{display:flex;gap:6px;margin-bottom:6px}
.detail-actions{display:flex;gap:8px;margin:16px 0;flex-wrap:wrap}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.detail-grid>div{background:#10121a;border:1px solid var(--line);border-radius:13px;padding:13px}
.detail-grid h3{font-size:12px;margin:0 0 7px;color:var(--accent2)}
.detail-grid p{font-size:12px;line-height:1.55;color:#c7cad5;margin:0;white-space:pre-wrap}
.tag-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}
.tag-row span{font-size:9px;color:#aeb3c6;background:#1b1e28;border:1px solid #303442;padding:5px 7px;border-radius:999px}
.wizard-note{background:#10121a;border:1px solid var(--line);color:var(--muted);padding:10px 12px;border-radius:11px;margin-bottom:14px;font-size:11px}
.memory-actions{display:flex;gap:5px;align-items:flex-start}
.thread-menu-grid,.stack-buttons{display:grid;gap:8px}
.thread-menu-grid{grid-template-columns:1fr 1fr;margin-top:14px}
.stack-buttons button{width:100%;text-align:left}
.toggle-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:10px;color:#d7d9e1;font-size:12px}
.muted{color:var(--muted)!important}

@media(max-width:700px){
  .discover-toolbar{align-items:stretch}
  .discover-selects{width:100%}.discover-selects select{flex:1;min-width:0}
  .discover-grid{grid-template-columns:1fr 1fr}
  .discover-card-top{height:145px}
  .detail-grid{grid-template-columns:1fr}
  .detail-avatar{width:88px;height:88px;border-radius:20px}
  .chat-header{padding:10px 12px;gap:7px;height:72px}
  .header-actions{gap:4px}.header-actions .ghost{font-size:10px;padding:7px}
  .relationship-bar{padding:9px 12px;gap:10px}
  .message-actions{opacity:1}
  .thread-menu-grid{grid-template-columns:1fr}
}


/* PersonaForge v1.1 — World Memory */
.world-strip{
  min-height:34px;display:flex;align-items:center;gap:8px;padding:7px 18px;
  border-bottom:1px solid var(--line);background:rgba(255,255,255,.018);
  font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden
}
.world-strip strong{color:var(--text);font-weight:650;overflow:hidden;text-overflow:ellipsis}
.world-strip span{overflow:hidden;text-overflow:ellipsis}
.world-dot{width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--accent);box-shadow:0 0 14px color-mix(in srgb,var(--accent) 60%,transparent)}
.world-modal-intro,.modal-copy{color:var(--muted);line-height:1.55;margin:-4px 0 18px}
.variant-switch{display:flex;align-items:center;gap:7px;margin-top:10px;width:max-content;padding:3px 5px;border:1px solid var(--line);border-radius:999px;background:rgba(255,255,255,.025);font-size:11px;color:var(--muted)}
.variant-switch button{width:24px;height:24px;border:0;border-radius:50%;background:transparent;color:var(--text);cursor:pointer;font-size:18px;line-height:18px}
.variant-switch button:hover{background:rgba(255,255,255,.08)}
.lore-list{display:grid;gap:10px;max-height:56vh;overflow:auto;padding-right:3px}
.lore-entry{border:1px solid var(--line);border-radius:14px;padding:14px;background:rgba(255,255,255,.025)}
.lore-entry-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.lore-entry-head span{font-size:9px;letter-spacing:.14em;color:var(--accent);font-weight:800}
.lore-entry-head h3{font-size:14px;margin:3px 0 0}
.lore-entry-head b{font-size:10px;color:var(--muted);font-weight:600}
.lore-entry p{font-size:13px;line-height:1.52;white-space:pre-wrap;margin:11px 0;color:var(--text)}
.lore-entry small{color:var(--muted);font-size:10px}
.lore-actions{display:flex;gap:7px;margin-top:11px}
@media(max-width:760px){
  .chat-header .header-actions{gap:4px}
  .chat-header .header-actions button{padding:7px 8px;font-size:11px}
  .world-strip{padding-left:12px;padding-right:12px}
  #worldGoal{display:none}
}


/* PersonaForge v1.1.2 — Living World */
.world-modal-title{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.world-modal-title h2{margin-top:3px}
.world-live-label{font-size:10px;color:var(--muted);padding:7px 10px;border:1px solid var(--line);border-radius:999px;white-space:nowrap}
.world-novel-section{margin:16px 0 20px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.018);overflow:hidden}
.world-section-heading{padding:14px 18px 9px;border-bottom:1px solid rgba(255,255,255,.045)}
.world-section-heading span{font-size:9px;letter-spacing:.18em;font-weight:800;color:var(--accent)}
.world-section-heading h3{margin:4px 0 0;font-size:15px}
.world-novel{padding:20px 22px 18px;font-family:Georgia,"Times New Roman",serif;font-size:15px;line-height:1.82;letter-spacing:.005em}
.world-novel p{margin:0 0 1.25em}
.world-novel p:last-child{margin-bottom:0}
.world-chronicle{font-size:14px;line-height:1.78;max-height:360px;overflow:auto}
.novel-empty{font-family:inherit;color:var(--muted);font-style:italic}
.world-facts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0 20px}
.world-facts-grid>div{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.02)}
.world-facts-grid span{display:block;font-size:8px;letter-spacing:.15em;color:var(--muted);font-weight:800;margin-bottom:5px}
.world-facts-grid strong{font-size:12px;line-height:1.45}
.quest-list{display:grid;gap:9px;padding:12px}
.quest-card{padding:13px 15px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.018)}
.quest-card.completed{opacity:.68}.quest-card.failed{opacity:.72}
.quest-head{display:flex;justify-content:space-between;gap:12px}
.quest-head h3{font-size:14px;margin:3px 0 0}
.quest-status{font-size:8px;letter-spacing:.14em;color:var(--accent);font-weight:850}
.quest-card p{font-size:12px;line-height:1.55;color:var(--muted);margin:8px 0}
.quest-objectives{display:grid;gap:5px;margin-top:9px}
.quest-objectives>div{display:flex;gap:8px;font-size:11px;line-height:1.45}
.quest-objectives>div.done{text-decoration:line-through;color:var(--muted)}
.quest-objectives span{width:14px;color:var(--accent);flex:0 0 14px}
.quest-progress{margin-top:10px;padding-top:9px;border-top:1px solid rgba(255,255,255,.05);font-size:10px;color:var(--muted)}
.quest-empty{padding:18px;color:var(--muted);font-size:12px;text-align:center}
.world-edit-details{border:1px solid var(--line);border-radius:13px;padding:0 14px;margin:10px 0 18px}
.world-edit-details summary{cursor:pointer;padding:13px 2px;color:var(--muted);font-size:12px;font-weight:650}
.world-edit-details[open] summary{margin-bottom:10px;border-bottom:1px solid rgba(255,255,255,.05)}
@media(max-width:650px){
  .world-modal-title{display:block}.world-live-label{display:inline-block;margin-top:8px}
  .world-facts-grid{grid-template-columns:1fr}
  .world-novel{padding:17px;font-size:14px;line-height:1.75}
}


/* PersonaForge v1.1.3 — portrait crop polish */
.avatar,.msg-avatar,.discover-avatar,.detail-avatar{
  background-size:cover !important;
  background-position:center 18% !important;
}


/* PersonaForge v1.1.5 — canonical-source headshot crops */
.avatar,.msg-avatar,.discover-avatar,.detail-avatar{
  background-repeat:no-repeat !important;
  background-size:var(--pf-icon-zoom,100%) auto !important;
  background-position:var(--pf-icon-x,50%) var(--pf-icon-y,18%) !important;
}


/* PersonaForge v1.1.7 — Pinterest PFP circle crop
   Keep the Pinterest pick, but crop/fill it nicely inside the circular avatar. */
.avatar,.msg-avatar,.discover-avatar,.detail-avatar{
  background-size:cover !important;
  background-position:center center !important;
  background-repeat:no-repeat !important;
}


/* PersonaForge v1.1.8 — generated circular PFP assets
   The icon itself is already a square SVG with a circular crop. */
.avatar,.msg-avatar,.discover-avatar,.detail-avatar{
  background-size:100% 100% !important;
  background-position:center !important;
  background-repeat:no-repeat !important;
}


/* PersonaForge v1.2.0 — Universe-aware group chats */
.heading-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.group-avatar-stack{position:relative;width:58px;height:48px;flex:none}
.group-avatar-stack.large{width:68px;height:52px}
.group-avatar-stack .group-mini{position:absolute;width:38px;height:38px;top:6px;left:calc(var(--stack) * 13px);border:2px solid #11131a;box-shadow:0 3px 10px rgba(0,0,0,.28);font-size:10px}
.group-avatar-stack.large .group-mini{width:42px;height:42px}
.group-plus{position:absolute;right:-3px;bottom:-1px;min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:#7164df;border:2px solid #141720;display:grid;place-items:center;font-size:9px;font-weight:850;color:white}
.group-chat-card{border-color:rgba(133,118,255,.20)}
.group-world-tag{display:block;margin-top:6px;color:#9f96ff;font-size:10px;font-weight:700;letter-spacing:.02em}
.group-selection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:360px;overflow:auto;padding:3px;margin-top:8px}
.group-pick{display:flex;gap:9px;align-items:center;padding:9px;border:1px solid var(--line);border-radius:12px;background:#151821;cursor:pointer;transition:.12s ease}
.group-pick:hover,.group-pick.selected{border-color:#6860bb;background:#1d2030}
.group-pick input{display:none}.group-pick .avatar{width:38px;height:38px}.group-pick strong{display:block;font-size:12px}.group-pick small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.group-world-preview{margin-top:12px;padding:13px 14px;border-radius:13px;border:1px solid #34384a;background:#151821;display:grid;gap:5px}
.group-world-preview strong{font-size:12px}.group-world-preview span{font-size:11px;line-height:1.45;color:var(--muted)}
.group-world-card{margin:14px 0 18px;padding:16px;border-radius:16px;border:1px solid #3a3e52;background:linear-gradient(145deg,#171a24,#13151d)}
.group-world-card.crossover{border-color:#5b518e;background:radial-gradient(circle at 90% 10%,rgba(112,88,220,.18),transparent 38%),#171822}
.group-world-kicker{font-size:9px;letter-spacing:.14em;color:#9f96ff;font-weight:850;margin-bottom:5px}.group-world-card h3{margin:0 0 8px}.group-world-card p{white-space:pre-line;color:#c9cbd4;font-size:11px;line-height:1.55;max-height:230px;overflow:auto}.group-world-universes{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.group-world-universes span{font-size:9px;padding:4px 7px;border-radius:999px;background:#242736;color:#b8b2ff}
.group-assistant>.group-avatar-stack{width:42px;height:42px;margin-top:2px}.group-assistant>.group-avatar-stack .group-mini{width:29px;height:29px;top:4px;left:calc(var(--stack) * 8px);font-size:8px}.group-assistant>.group-avatar-stack .group-plus{display:none}
.group-empty-scene{margin:auto;padding:24px;border:1px dashed #3b4053;border-radius:16px;color:var(--muted);text-align:center;max-width:430px;font-size:12px;line-height:1.55}
@media(max-width:650px){.group-selection{grid-template-columns:1fr}.heading-actions{width:100%}.heading-actions button{flex:1}}

/* ==============================================================
   PersonaForge v1.3.0 — Persistent RPG UI
   ============================================================== */
.rpg-title{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:12px}.rpg-title h2{margin:3px 0 2px}.rpg-title p{margin:0;color:var(--muted)}
.rpg-tabs{display:flex;gap:7px;overflow:auto;padding:7px 0 14px;margin-bottom:12px;border-bottom:1px solid var(--line)}.rpg-tabs button{white-space:nowrap;border:1px solid var(--line);background:#171923;color:var(--muted);padding:8px 11px;border-radius:999px}.rpg-tabs button.active{background:#262a3d;color:var(--text);border-color:#555b78}
.rpg-hero-card{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:18px;border:1px solid #393f5a;border-radius:16px;background:linear-gradient(135deg,rgba(122,105,255,.12),rgba(38,42,55,.35));margin-bottom:13px}.rpg-hero-card h3{margin:4px 0 7px;font-size:21px}.rpg-hero-card p{margin:0;color:#c6cad7;line-height:1.55}.rpg-kicker{font-size:10px;letter-spacing:.14em;color:var(--accent2);font-weight:850}
.rpg-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:12px 0}.rpg-stat-grid>div{padding:14px;border:1px solid var(--line);border-radius:13px;background:#151720;display:flex;flex-direction:column}.rpg-stat-grid b{font-size:22px}.rpg-stat-grid span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.09em}
.rpg-inline{display:flex;gap:9px;align-items:center}.rpg-inline select,.rpg-inline input{flex:1}.rpg-toggle{display:flex;gap:9px;align-items:center;margin:12px 0}.rpg-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:8px;margin:13px 0 18px}.rpg-longtext{white-space:pre-wrap;line-height:1.6;color:#c7cad5}
.rpg-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin:6px 0 14px}.rpg-section-head h3,.rpg-section-head h4{margin:0 0 4px}.rpg-section-head p{margin:0;color:var(--muted);line-height:1.45}.rpg-section-head.small{align-items:center;margin-bottom:9px}
.rpg-entity-section{margin:17px 0}.rpg-entity-section>h4{font-size:11px;letter-spacing:.12em;color:var(--muted);margin:0 0 8px}.rpg-entity-card{display:flex;justify-content:space-between;gap:14px;padding:13px 14px;margin-bottom:8px;border:1px solid var(--line);border-radius:13px;background:#151720}.rpg-entity-main{min-width:0;flex:1}.rpg-entity-main h3{display:inline;margin:0 0 5px;font-size:15px}.rpg-entity-main p{margin:6px 0 7px;line-height:1.45}.rpg-entity-main small{display:block;color:var(--muted);margin-top:4px}.rpg-card-actions{display:flex;gap:6px;align-items:flex-start}
.rpg-badge{display:inline-block;font-size:8px;font-weight:900;letter-spacing:.11em;padding:3px 6px;border-radius:999px;background:#262a36;color:#bfc4d4;margin-right:7px;vertical-align:2px}.rpg-badge.critical{background:#4b2430;color:#ffb5c5}.rpg-badge.important{background:#42371f;color:#f2d896}.rpg-badge.temporary{opacity:.65}
.rpg-knowledge-group{margin:14px 0}.rpg-knowledge-group h4{margin:0 0 8px}.rpg-fact{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--line);background:#151720;border-radius:10px;margin:6px 0}.rpg-fact small{color:var(--muted);white-space:nowrap}.rpg-fact.pass{border-color:#31533e}.rpg-fact.fail{border-color:#5a3540}
.rpg-goal{display:flex;justify-content:space-between;gap:16px;padding:13px;border:1px solid var(--line);border-radius:13px;background:#151720;margin:8px 0}.rpg-goal h3{display:inline;font-size:13px;margin:0}.rpg-goal p{margin:7px 0 0}.rpg-goal>span{font-size:10px;color:var(--muted);text-transform:uppercase}.rpg-goal.completed{opacity:.7}
.rpg-timeline{position:relative;margin-left:8px}.rpg-timeline:before{content:"";position:absolute;left:6px;top:6px;bottom:6px;width:1px;background:#3b4054}.rpg-timeline article{display:grid;grid-template-columns:22px 1fr;position:relative;padding:0 0 19px}.rpg-timeline-dot{width:13px;height:13px;border-radius:50%;background:#7a6dff;border:3px solid #171923;z-index:1;margin-top:4px}.rpg-timeline h3{display:inline;margin:0;font-size:14px}.rpg-timeline p{margin:6px 0 0;color:#c8cbd6}.rpg-timeline small{display:block;color:var(--muted);margin-top:4px}
.rpg-two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px}.rpg-two-col>section{border:1px solid var(--line);background:#141720;border-radius:14px;padding:13px}.rpg-rep{display:flex;justify-content:space-between;gap:14px;padding:10px;border-bottom:1px solid rgba(255,255,255,.05)}.rpg-rep:last-child{border-bottom:0}.rpg-rep small{display:block;color:var(--muted);margin-top:3px}.rpg-rep b{font-size:17px}.rpg-consequence{padding:11px;border:1px solid rgba(255,255,255,.06);border-radius:11px;margin:7px 0}.rpg-consequence h3{display:inline;font-size:14px}.rpg-consequence p{margin:6px 0;color:#c9ccd7}.rpg-consequence small{color:var(--muted)}
.rpg-chapter{padding:20px;border:1px solid var(--line);border-radius:15px;background:#151720;margin:12px 0}.rpg-chapter h3{font-family:Georgia,serif;font-size:22px;margin:5px 0 12px}.rpg-chapter-prose{font-family:Georgia,serif;line-height:1.72;color:#d8d9df}.rpg-chapter-prose p{margin:0 0 12px}.rpg-recap{font-family:Georgia,serif;line-height:1.72}.rpg-recap h3{font-family:system-ui,sans-serif;margin-top:20px}.rpg-recap p{margin:0 0 13px}
.rpg-library-section{margin:18px 0 26px}.rpg-library-row{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#151720;margin:7px 0}.rpg-library-row>div:first-child{min-width:0;flex:1}.rpg-library-row strong{display:block}.rpg-library-row small{display:block;color:var(--muted);margin-top:3px}.rpg-library-row p{margin:6px 0 0;color:#c9ccd7}.rpg-rec-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.rpg-rec-card{display:flex;gap:10px;align-items:center;text-align:left;border:1px solid var(--line);background:#151720;color:var(--text);padding:9px;border-radius:12px}.rpg-rec-card:hover{border-color:#4e546c}.rpg-rec-card .avatar{width:38px;height:38px}.rpg-rec-card small{display:block;color:var(--muted);margin-top:2px}
.rpg-draft-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.rpg-draft-grid>div{padding:12px;border:1px solid var(--line);border-radius:12px;background:#151720}.rpg-draft-grid p{white-space:pre-wrap;color:#c9ccd7}.rpg-test{display:flex;justify-content:space-between;gap:16px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;margin:6px 0}.rpg-test.pass{border-color:#31533e}.rpg-test.fail{border-color:#5a3540}.rpg-test span{color:var(--muted);text-align:right}
.rpg-memory .memory-actions{flex-wrap:wrap}.rpg-memory select{max-width:110px;background:#1d202b;color:var(--text);border:1px solid var(--line);border-radius:8px;padding:7px}.memory-history{margin-top:14px;border:1px solid var(--line);border-radius:12px;padding:10px}.memory-history summary{cursor:pointer;color:var(--muted)}
@media(max-width:760px){.rpg-stat-grid{grid-template-columns:1fr 1fr}.rpg-two-col,.rpg-draft-grid{grid-template-columns:1fr}.rpg-hero-card,.rpg-section-head,.rpg-library-row{flex-direction:column}.rpg-rec-grid{grid-template-columns:1fr}.rpg-card-actions{width:100%}.rpg-card-actions button{flex:1}.rpg-inline{align-items:stretch;flex-direction:column}}


/* PersonaForge v1.3.1 — separate group speakers */
.group-assistant.separate-speaker>.msg-avatar{width:38px;height:38px;border-radius:50%;flex:none;margin-top:2px;background:#2c3040 center/cover no-repeat}
.group-assistant.separate-speaker .speaker{font-weight:800}

/* ================================================================
   PersonaForge v1.4.0 — Interface Overhaul
   ================================================================ */
:root{
  --bg:#0a0b10;
  --panel:#11131a;
  --panel2:#171a23;
  --panel3:#1d202b;
  --line:#272b38;
  --line-soft:rgba(255,255,255,.065);
  --text:#f7f7fb;
  --muted:#9398a8;
  --accent:#8e7cff;
  --accent2:#c2b8ff;
  --accent-soft:rgba(142,124,255,.14);
  --danger:#ff7188;
  --success:#72d7a2;
  --shadow:0 22px 70px rgba(0,0,0,.32);
}
html,body{background:var(--bg)}
body{
  background:
    radial-gradient(circle at 12% -10%,rgba(116,91,255,.13),transparent 30%),
    radial-gradient(circle at 95% 20%,rgba(66,105,255,.07),transparent 28%),
    var(--bg);
  letter-spacing:.005em;
}
body::-webkit-scrollbar,.page-view::-webkit-scrollbar,.messages::-webkit-scrollbar,.modal::-webkit-scrollbar{width:8px;height:8px}
body::-webkit-scrollbar-thumb,.page-view::-webkit-scrollbar-thumb,.messages::-webkit-scrollbar-thumb,.modal::-webkit-scrollbar-thumb{background:#2b2f3c;border-radius:99px}

/* Desktop navigation becomes a slim app rail. */
@media(min-width:961px){
  #app{padding-left:92px}
  .bottom-nav{
    position:fixed;left:0;top:0;bottom:0;right:auto;width:92px;height:auto;
    grid-template-columns:1fr;grid-template-rows:116px repeat(3,78px) 1fr;
    padding:0 10px 18px;background:rgba(10,11,16,.90);border:0;border-right:1px solid var(--line-soft);
    backdrop-filter:blur(24px);box-shadow:8px 0 30px rgba(0,0,0,.08)
  }
  .bottom-nav::before{
    content:"PF";grid-row:1;align-self:center;justify-self:center;width:46px;height:46px;border-radius:16px;
    display:grid;place-items:center;font-weight:950;letter-spacing:-.06em;font-size:17px;color:white;
    background:linear-gradient(145deg,#9a8aff,#6550df);box-shadow:0 12px 35px rgba(100,78,226,.28)
  }
  .bottom-nav-item{height:68px;border-radius:18px;gap:5px;font-size:10px;color:#737887;transition:.18s;background:transparent}
  .bottom-nav-item:hover{background:rgba(255,255,255,.035);color:#c7cad5}
  .bottom-nav-item.active{background:var(--accent-soft);color:#fff}
  .bottom-nav-item.active::after{content:"";position:absolute;left:0;width:3px;height:30px;border-radius:0 8px 8px 0;background:var(--accent)}
  .bottom-nav-item{position:relative}
  .nav-symbol{font-size:22px}
  .page-view{height:100vh}
  .chat-view{height:100vh}
}

.main-area{position:relative;min-width:0}
.page-shell{width:min(1260px,100%);padding:48px 48px 112px}
.page-heading{align-items:center;margin-bottom:30px}
.page-heading h1{font-size:38px;letter-spacing:-.045em;margin:4px 0 7px;line-height:1.05}
.page-heading p{font-size:13px;max-width:720px}
.eyebrow{font-size:9px;letter-spacing:.20em;color:#aaa0f8}
.heading-actions{display:flex;gap:9px;flex-wrap:wrap}
.primary,.ghost,.send,.icon-button{transition:transform .16s ease,background .16s ease,border-color .16s ease,filter .16s ease}
.primary{background:linear-gradient(135deg,#917fff,#6856df);box-shadow:0 7px 24px rgba(106,84,222,.16)}
.primary:hover,.send:hover{transform:translateY(-1px);filter:brightness(1.08)}
.ghost{background:rgba(255,255,255,.035);border-color:var(--line-soft)}
.ghost:hover{background:rgba(255,255,255,.065);border-color:#3a3f4d}

/* Discover */
.discover-search{
  height:58px;margin-bottom:16px;border:1px solid var(--line-soft);border-radius:18px;
  background:rgba(18,20,28,.82);box-shadow:0 10px 40px rgba(0,0,0,.08);backdrop-filter:blur(18px)
}
.discover-search:focus-within{border-color:rgba(142,124,255,.52);box-shadow:0 0 0 3px rgba(142,124,255,.08)}
.discover-search input{font-size:14px}
.discover-toolbar{margin:0 0 20px}
.filter-chip{background:rgba(255,255,255,.025);border-color:var(--line-soft);padding:9px 13px}
.filter-chip.active{background:var(--accent-soft);border-color:rgba(142,124,255,.35);color:#fff}
.discover-selects select{background:#12141c;border-color:var(--line-soft);border-radius:12px;padding:9px 12px}
.result-count{margin-bottom:13px;color:#707686}
.discover-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
.discover-card{
  border-radius:22px;border:1px solid var(--line-soft);background:rgba(17,19,26,.76);
  box-shadow:0 14px 45px rgba(0,0,0,.10);overflow:hidden;isolation:isolate
}
.discover-card:hover{transform:translateY(-4px);border-color:rgba(151,137,255,.35);box-shadow:0 24px 60px rgba(0,0,0,.22)}
.discover-card-top{
  height:184px;position:relative;background:
    radial-gradient(circle at 50% 40%,rgba(142,124,255,.20),transparent 44%),
    linear-gradient(180deg,#181b25,#11131b)
}
.discover-card-top::after{content:"";position:absolute;inset:auto 0 0;height:46px;background:linear-gradient(transparent,rgba(10,11,16,.38));pointer-events:none}
.discover-avatar{width:112px;height:112px;border:4px solid rgba(255,255,255,.07);box-shadow:0 17px 45px rgba(0,0,0,.27)}
.discover-card-body{padding:15px 16px 17px}
.discover-card-body h3{font-size:15px;letter-spacing:-.015em}
.discover-card-body p{font-size:11.5px;line-height:1.5;min-height:34px}
.favorite-float{top:12px;right:12px;width:34px;height:34px;border-color:rgba(255,255,255,.08);background:rgba(7,8,12,.62)}
.card-meta{margin-top:11px;font-size:9px}

/* Chat list */
.recent-chats-grid{gap:11px;max-width:1040px}
.recent-chat-card{
  border:1px solid var(--line-soft);border-radius:18px;padding:13px 15px;background:rgba(17,19,26,.72);
  box-shadow:0 9px 30px rgba(0,0,0,.07);transition:.16s
}
.recent-chat-card:hover{background:#171a23;transform:translateX(2px);border-color:#343947}
.recent-chat-card .avatar.large{width:50px;height:50px}
.chat-title-line h3{font-size:14px;letter-spacing:-.01em}
.chat-title-line span{font-size:9px;text-transform:uppercase;letter-spacing:.10em}
.chat-stage,.group-world-tag{background:rgba(142,124,255,.08);border-color:rgba(142,124,255,.22)}
.group-avatar-stack{filter:drop-shadow(0 7px 14px rgba(0,0,0,.18))}

/* Chat */
.chat-view{
  background:
    radial-gradient(circle at 50% 15%,rgba(111,85,231,.055),transparent 33%),
    #0b0c11;
  grid-template-rows:auto auto auto auto 1fr auto auto
}
.chat-header{
  min-height:76px;height:auto;padding:11px 20px;border-bottom:1px solid var(--line-soft);
  background:rgba(11,12,17,.78);backdrop-filter:blur(24px);position:relative;z-index:4
}
.chat-header::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:linear-gradient(90deg,transparent,rgba(142,124,255,.25),transparent)}
#headerAvatar{width:44px;height:44px}
.header-character h2{font-size:16px;letter-spacing:-.02em}
.header-character p{font-size:10px;text-transform:uppercase;letter-spacing:.10em;color:#8b90a0;max-width:520px}
.thread-title{font-size:9px;color:#7066b8;display:none}
.header-actions{gap:5px}
.header-actions .ghost{font-size:10px;padding:8px 10px;border-radius:10px;color:#b2b5c0}
.icon-button{border-radius:12px}

.group-header-stack{background:none!important;width:58px!important;display:flex!important;align-items:center;position:relative;overflow:visible}
.header-mini-avatar{width:34px;height:34px;border-radius:50%;background:#252936 center/cover no-repeat;display:grid;place-items:center;font-size:8px;font-weight:900;border:2px solid #0d0e13;position:absolute;left:0}
.header-mini-avatar:nth-child(2){left:18px}.header-mini-avatar:nth-child(3){left:36px}
.group-participants-bar{
  min-height:48px;padding:8px 20px;border-bottom:1px solid var(--line-soft);display:flex;align-items:center;gap:12px;
  background:rgba(14,15,21,.74);backdrop-filter:blur(15px);overflow:hidden
}
.group-participant-scroll{display:flex;gap:7px;overflow-x:auto;min-width:0;scrollbar-width:none}.group-participant-scroll::-webkit-scrollbar{display:none}
.group-participant-chip{flex:none;display:grid;grid-template-columns:26px auto;grid-template-rows:auto auto;column-gap:7px;align-items:center;padding:5px 9px 5px 5px;border-radius:999px;background:rgba(255,255,255,.035);border:1px solid var(--line-soft)}
.group-participant-chip .avatar{width:26px;height:26px;grid-row:1/3;font-size:7px}
.group-participant-chip span{font-size:10px;font-weight:760;line-height:1.05}.group-participant-chip small{font-size:7px;color:#737887;line-height:1.05}
.group-world-pill{margin-left:auto;flex:none;font-size:9px;color:#b9b1f1;padding:6px 9px;border-radius:999px;background:rgba(142,124,255,.08);border:1px solid rgba(142,124,255,.18)}

.relationship-bar{min-height:54px;padding:8px 20px;background:rgba(15,17,23,.80);border-color:var(--line-soft)}
.world-strip{min-height:32px;background:rgba(255,255,255,.012);border-color:var(--line-soft);font-size:10px;padding:6px 20px}

.messages{padding:34px max(28px,calc((100vw - 920px)/2)) 28px;scroll-behavior:smooth}
.message{max-width:820px;grid-template-columns:40px minmax(0,1fr);gap:11px;margin-bottom:21px}
.msg-avatar{width:36px;height:36px;border:2px solid rgba(255,255,255,.055);box-shadow:0 8px 20px rgba(0,0,0,.12)}
.message.assistant .bubble{
  width:fit-content;max-width:min(680px,88%);padding:11px 14px 12px;border:1px solid rgba(255,255,255,.045);
  border-radius:5px 18px 18px 18px;background:rgba(18,20,28,.58);line-height:1.68;color:#e8eaf2;
  box-shadow:0 8px 24px rgba(0,0,0,.07)
}
.message.user .bubble{
  max-width:min(620px,78%);padding:11px 14px;border-radius:18px 18px 5px 18px;
  background:linear-gradient(145deg,#272a3c,#222535);border:1px solid rgba(155,142,255,.12);box-shadow:0 8px 28px rgba(0,0,0,.10)
}
.speaker-row{display:flex;align-items:center;gap:9px;min-height:18px;margin-bottom:5px;flex-wrap:wrap}
.speaker{margin:0;color:#c1b8ff;font-size:11px;letter-spacing:.005em}
.reply-context{font-size:8px;color:#727888;padding:3px 6px;border-radius:999px;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.045)}
.message.group-assistant{position:relative}
.message.group-assistant.group-burst-follow{margin-top:-10px}
.message.group-assistant.group-burst-follow::before{content:"";position:absolute;left:17px;top:-14px;height:15px;width:1px;background:rgba(142,124,255,.25)}
.message.group-assistant .bubble{border-color:rgba(142,124,255,.09)}
.group-thinking .bubble,.group-director-thinking .bubble{min-width:190px;color:#9a9faf}
.thinking-line{display:flex;align-items:center;gap:8px}.thinking-line small{font-size:9px;color:#707586}
.message-actions{margin-top:9px}.message-actions button{background:transparent;border-color:transparent;color:#6f7483;padding:3px 5px}.message-actions button:hover{color:#b9bdc9;background:rgba(255,255,255,.04)}
.action{color:#a9adbb}
.group-empty-scene{max-width:520px;margin:70px auto;text-align:center;color:#6e7382;border:1px dashed var(--line-soft);border-radius:18px;padding:26px}

.composer{
  width:min(900px,calc(100% - 38px));margin:0 auto 18px;padding:8px 8px 8px 14px;border:1px solid rgba(255,255,255,.075);
  border-radius:21px;background:rgba(22,24,33,.90);backdrop-filter:blur(22px);box-shadow:0 18px 55px rgba(0,0,0,.30);gap:8px
}
.composer textarea{padding:11px 5px;background:transparent;border:0;border-radius:0;font-size:13px;line-height:1.5}
.composer textarea:focus{border:0}
.send{width:44px;height:44px;align-self:flex-end;border-radius:15px;background:linear-gradient(145deg,#917fff,#6957e0)}
.fallback-notice{width:min(900px,calc(100% - 38px));margin:0 auto 8px;font-size:10px;background:#221f17}

/* Account */
.account-shell{max-width:1080px}
.auth-card,.account-explainer,.account-card,.profile-hero{background:rgba(17,19,26,.72);border-color:var(--line-soft);box-shadow:0 12px 45px rgba(0,0,0,.08)}
.profile-hero{border-radius:22px;padding:20px}.account-card{border-radius:18px}
.profile-detail{background:rgba(255,255,255,.018);border-color:var(--line-soft)}

/* Modal / forms */
.modal-backdrop{background:rgba(3,4,7,.74);backdrop-filter:blur(8px);padding:20px}
.modal{width:min(790px,100%);background:rgba(18,20,27,.96);border-color:rgba(255,255,255,.09);border-radius:24px;box-shadow:0 35px 120px rgba(0,0,0,.58);padding:24px 25px}
.modal h2{letter-spacing:-.035em}
.auth-form input,.form-field input,.form-field textarea,.form-field select{background:#101219;border-color:rgba(255,255,255,.08);border-radius:12px;padding:11px 12px}
.auth-form input:focus,.form-field input:focus,.form-field textarea:focus,.form-field select:focus{border-color:rgba(142,124,255,.48);box-shadow:0 0 0 3px rgba(142,124,255,.06)}
.setting-block,.memory-item,.detail-grid>div,.wizard-note{background:rgba(255,255,255,.018);border-color:var(--line-soft)}
.detail-avatar{border-radius:28px;border-color:var(--line-soft);box-shadow:0 18px 50px rgba(0,0,0,.22)}

/* RPG surfaces */
.rpg-tabs{background:rgba(255,255,255,.018)!important;border-color:var(--line-soft)!important}
.rpg-hero-card,.rpg-entity-card,.rpg-library-row,.rpg-fact,.rpg-test{border-color:var(--line-soft)!important;background:rgba(255,255,255,.018)!important}

/* Mobile remains a proper bottom-nav app. */
@media(max-width:960px){
  #app{padding-left:0}
  .bottom-nav{position:absolute;left:0;right:0;bottom:0;top:auto;width:auto;height:68px;grid-template-columns:repeat(3,1fr);grid-template-rows:1fr;padding:0;background:rgba(10,11,16,.94);border-top:1px solid var(--line-soft);border-right:0}
  .page-view{height:calc(100vh - 68px)}
  .chat-view{height:calc(100vh - 68px)}
  .page-shell{padding:30px 20px 92px}
  .page-heading h1{font-size:31px}
  .messages{padding:24px 18px 18px}
  .composer{width:calc(100% - 24px);margin-bottom:12px}
  .fallback-notice{width:calc(100% - 24px)}
}
@media(max-width:700px){
  .page-shell{padding:26px 14px 86px}
  .discover-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .discover-card{border-radius:17px}.discover-card-top{height:142px}.discover-avatar{width:88px;height:88px}.discover-card-body{padding:12px}.discover-card-body p{display:none}
  .chat-header{padding:9px 10px;gap:7px;min-height:66px}.header-actions .ghost{padding:7px;font-size:9px}.header-character h2{font-size:14px}.header-character p{max-width:180px;font-size:8px}
  .group-participants-bar{padding:6px 10px}.group-world-pill{display:none}
  .relationship-bar{padding:8px 10px}
  .world-strip{padding:6px 10px}
  .message{grid-template-columns:32px 1fr;gap:8px;margin-bottom:17px}.msg-avatar{width:30px;height:30px}.message.assistant .bubble{max-width:94%;font-size:13px}.message.user .bubble{max-width:86%;font-size:13px}
  .message.group-assistant.group-burst-follow::before{left:14px}
  .composer textarea{font-size:13px}.send{width:42px;height:42px}
  .modal{border-radius:20px;padding:18px 16px}.form-grid{grid-template-columns:1fr}.form-field.full-width{grid-column:1}
}


/* PersonaForge v1.4.2 — stable solo-chat layout */
.chat-view{
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
}
.chat-header,.group-participants-bar,.relationship-bar,.world-strip,.fallback-notice,.composer{flex:0 0 auto}
.messages{flex:1 1 auto !important;min-height:0 !important;width:100%}
.world-strip{height:34px;min-height:34px !important;max-height:34px}
.world-strip strong,.world-strip span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#worldLocation{max-width:42vw}
#worldGoal{max-width:42vw}
.hidden{display:none !important}

/* v1.4.3 shared universe picker */
.required-mark{margin-left:7px;padding:2px 7px;border-radius:999px;background:#292541;color:#b9adff;font-size:9px;font-weight:800}.universe-input-wrap{position:relative}.universe-suggestions{position:absolute;z-index:90;left:0;right:0;top:calc(100% + 7px);max-height:300px;overflow:auto;padding:6px;background:#151720;border:1px solid #3d4254;border-radius:13px;box-shadow:0 18px 50px #0008}.universe-option{width:100%;display:flex;justify-content:space-between;gap:10px;text-align:left;padding:10px;border-radius:9px;background:transparent;color:var(--text)}.universe-option:hover{background:#242838}.universe-option span{display:grid;min-width:0}.universe-option small,.universe-status,.universe-no-result{color:var(--muted);font-size:10px}.universe-option small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.universe-option b{color:#aa9fff}.universe-status{display:block;margin-top:7px;line-height:1.4}.universe-no-result{padding:10px}

/* ================================================================
   PersonaForge v1.5.0 — Character Intelligence + Creator Experience
   ================================================================ */
.generation-status{display:flex;align-items:center;gap:9px;margin:0 auto 8px;width:min(860px,calc(100% - 28px));padding:7px 12px;border:1px solid var(--line);background:rgba(17,19,27,.88);backdrop-filter:blur(14px);border-radius:12px;color:var(--muted);font-size:11px}
.status-pulse{width:7px;height:7px;border-radius:50%;background:var(--accent2);box-shadow:0 0 0 0 rgba(139,124,255,.4);animation:pfPulse 1.4s infinite}
@keyframes pfPulse{70%{box-shadow:0 0 0 7px rgba(139,124,255,0)}100%{box-shadow:0 0 0 0 rgba(139,124,255,0)}}
.stop-generation{width:42px;height:42px;border-radius:12px;border:1px solid #60393e;background:#301b20;color:#ff9aa5;flex:none;font-size:12px}
.creator-section{margin:18px 0;padding:17px;border:1px solid var(--line);background:linear-gradient(180deg,rgba(138,119,255,.055),rgba(255,255,255,.015));border-radius:16px}
.creator-section-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:10px}.creator-section-head span{font-size:9px;letter-spacing:.15em;color:var(--accent2);font-weight:900}.creator-section-head h3{margin:4px 0 0}.creator-section>p{color:var(--muted);font-size:12px;line-height:1.55}
.lock-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.lock-grid label,.switch-label{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid var(--line);background:var(--panel2);border-radius:10px;font-size:12px}.lock-grid input,.switch-label input{accent-color:var(--accent)}
.universe-quick-row{display:flex;gap:8px;margin-top:8px}.universe-quick-row .ghost{padding:7px 10px;font-size:11px}
.starter-quest-preview{padding:15px;border:1px solid rgba(139,124,255,.28);background:rgba(139,124,255,.07);border-radius:14px}.starter-quest-preview span{font-size:9px;color:var(--accent2);letter-spacing:.14em;font-weight:900}.starter-quest-preview h3{margin:5px 0}.starter-quest-preview p{color:var(--muted);font-size:12px}
.intel-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:12px 0 18px}.intel-cards>div{padding:12px;border-radius:12px;border:1px solid var(--line);background:var(--panel2)}.intel-cards span{display:block;font-size:8px;letter-spacing:.12em;color:var(--muted);margin-bottom:5px}.intel-cards strong{font-size:12px;text-transform:capitalize}
.feedback-grid,.tune-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:12px 0 16px}.feedback-choice,.tune-choice{text-align:left}
.search-hit{border-bottom:1px solid var(--line);padding:10px 2px}.search-hit>span{font-size:9px;letter-spacing:.13em;color:var(--accent2);font-weight:800}.search-hit p{margin:5px 0;line-height:1.45;font-size:13px}
.command-palette{min-width:min(560px,85vw)}.command-palette>input{width:100%;height:48px;border-radius:12px;border:1px solid var(--line);background:#10121a;color:var(--text);padding:0 14px;font-size:15px;outline:none;margin-bottom:8px}.command-item{width:100%;text-align:left;padding:11px 12px;border-radius:9px;color:var(--text);background:transparent}.command-item:hover{background:var(--panel2)}
html[data-pf-density="compact"] .message{margin-bottom:8px}html[data-pf-density="compact"] .bubble{padding:9px 11px}html[data-pf-density="compact"] .page-shell{padding-top:22px}html[data-pf-density="compact"] .discover-grid{gap:9px}
html[data-pf-theme="graphite"]{--bg:#101113;--panel:#161719;--panel2:#1c1e21;--line:#2d3034;--accent:#b8bcc5;--accent2:#d5d8df}
html[data-pf-theme="violet"]{--bg:#0d0b14;--panel:#15101f;--panel2:#1c1629;--line:#342746;--accent:#9677ff;--accent2:#c2acff}
html[data-pf-theme="warm"]{--bg:#15110f;--panel:#1d1714;--panel2:#261e19;--line:#3b2e27;--accent:#d58b62;--accent2:#e8b18f}
body.pf-immersive .bottom-nav,body.pf-immersive .relationship-bar,body.pf-immersive .world-strip,body.pf-immersive .chat-header .header-actions>*:not(#immersiveBtn),body.pf-immersive #backToChatsBtn{display:none!important}body.pf-immersive .chat-header{justify-content:center;border-bottom-color:transparent;background:linear-gradient(180deg,var(--bg),transparent)}body.pf-immersive .chat-view{height:100vh}body.pf-immersive .messages{padding-top:20px}body.pf-immersive .composer{margin-bottom:18px}
@media(max-width:760px){.intel-cards{grid-template-columns:repeat(2,1fr)}.feedback-grid,.tune-grid{grid-template-columns:1fr}.creator-section{padding:13px}.generation-status{width:calc(100% - 18px)}}

/* ================================================================
   PersonaForge v1.6.0 — Mobile-first Hub Navigation + UI Overhaul
   ================================================================ */
body.pf160-ui .page-shell{padding-top:34px}
body.pf160-ui .page-heading{align-items:flex-end;gap:18px;margin-bottom:34px}
body.pf160-ui .heading-actions{display:flex;gap:10px;flex-wrap:wrap}
body.pf160-ui .chat-header{
  position:sticky;top:0;z-index:25;
  background:linear-gradient(180deg,rgba(14,16,24,.98),rgba(14,16,24,.88));
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(255,255,255,.05);
  box-shadow:0 14px 34px rgba(0,0,0,.22);
}
body.pf160-ui .header-character h2{font-size:21px;letter-spacing:-.03em}
body.pf160-ui .header-character p{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8f93a3}
body.pf160-ui .thread-title{font-size:12px;color:#c5c8d4}
body.pf160-ui .header-actions{
  margin-left:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  max-width:min(56vw,620px);
}
body.pf160-ui .header-actions .ghost{
  min-width:68px;
  padding:10px 14px;
  border-radius:14px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
  background:rgba(255,255,255,.035);
  border-color:rgba(255,255,255,.08);
  color:#d4d8e5;
}
body.pf160-ui .header-actions .ghost:hover{background:rgba(255,255,255,.06);transform:translateY(-1px)}
body.pf160-ui .header-actions .header-pill-primary{background:linear-gradient(135deg,rgba(139,124,255,.22),rgba(91,197,255,.12));border-color:rgba(139,124,255,.34);color:#fff}
body.pf160-ui .pf160-hidden-action{display:none!important}
body.pf160-ui .relationship-bar{background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,.008));border-top:1px solid rgba(255,255,255,.03);border-bottom:1px solid rgba(255,255,255,.04)}
body.pf160-ui .world-strip{background:rgba(255,255,255,.02);border-color:rgba(255,255,255,.05);margin-top:2px}
body.pf160-ui .composer{box-shadow:0 -10px 28px rgba(0,0,0,.22)}
body.pf160-ui .composer textarea{border-radius:16px}
body.pf160-ui .send{border-radius:16px}

.hub-lead{color:var(--muted);line-height:1.6;margin:4px 0 14px}
.hub-hero-card{padding:16px 17px;border-radius:18px;border:1px solid rgba(139,124,255,.2);background:linear-gradient(180deg,rgba(139,124,255,.09),rgba(255,255,255,.02));margin:0 0 16px}
.hub-hero-card h3{margin:6px 0 6px;font-size:20px;letter-spacing:-.03em}
.hub-hero-card p{margin:0;color:var(--muted);line-height:1.55}
.hub-hero-kicker{display:block;font-size:9px;letter-spacing:.16em;font-weight:900;color:var(--accent2)}
.hub-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.hub-button{display:block;text-align:left;padding:15px 15px 14px;border-radius:16px;border:1px solid rgba(255,255,255,.08);background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,.015));color:var(--text);min-height:108px;transition:.18s transform,.18s background,.18s border-color}
.hub-button:hover{transform:translateY(-1px);background:linear-gradient(180deg,rgba(139,124,255,.07),rgba(255,255,255,.02));border-color:rgba(139,124,255,.26)}
.hub-button strong{display:block;font-size:15px;letter-spacing:-.02em;margin-bottom:6px}
.hub-button span{display:block;color:var(--muted);font-size:12px;line-height:1.5}
.hub-stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:6px 0 14px}
.hub-stats-grid>div{padding:13px 12px;border-radius:14px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.025)}
.hub-stats-grid span{display:block;font-size:9px;letter-spacing:.14em;color:var(--muted);margin-bottom:6px}
.hub-stats-grid strong{font-size:14px;text-transform:capitalize}

@media(max-width:1100px){
  body.pf160-ui .header-actions{max-width:min(60vw,560px)}
  body.pf160-ui .header-actions .ghost{min-width:62px;padding:9px 12px}
}
@media(max-width:860px){
  body.pf160-ui .header-actions{max-width:none;gap:6px}
  body.pf160-ui .header-actions .ghost{min-width:56px;padding:8px 11px;font-size:10px}
  .hub-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  body.pf160-ui .page-heading{align-items:flex-start}
  body.pf160-ui .chat-header{padding:10px 10px 9px;display:grid;grid-template-columns:auto auto 1fr;grid-template-areas:'back avatar info' 'actions actions actions';height:auto;gap:8px}
  body.pf160-ui #backToChatsBtn{grid-area:back}
  body.pf160-ui #headerAvatar{grid-area:avatar}
  body.pf160-ui .header-character{grid-area:info;min-width:0}
  body.pf160-ui .header-actions{grid-area:actions;margin-left:0;justify-content:flex-start;overflow:auto;flex-wrap:nowrap;padding-bottom:2px}
  body.pf160-ui .header-actions::-webkit-scrollbar{display:none}
  body.pf160-ui .header-actions .ghost{flex:0 0 auto;min-width:70px;font-size:10px;border-radius:13px}
  body.pf160-ui .header-character h2{font-size:16px}
  body.pf160-ui .header-character p{font-size:9px}
  .hub-grid,.hub-stats-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:520px){
  .hub-grid,.hub-stats-grid{grid-template-columns:1fr}
  .hub-button{min-height:unset}
  body.pf160-ui .chat-header{padding-top:9px}
  body.pf160-ui .header-actions .ghost{min-width:66px;padding:8px 10px}
}

/* ===== PersonaForge v1.7 Giant Visual Overhaul ===== */
:root{
  --pf-bg-0:#090b12;
  --pf-bg-1:#0d1018;
  --pf-bg-2:#121726;
  --pf-bg-3:#171d31;
  --pf-surface:rgba(19,24,38,.86);
  --pf-surface-2:rgba(255,255,255,.045);
  --pf-line:rgba(255,255,255,.08);
  --pf-line-strong:rgba(255,255,255,.14);
  --pf-text:#f5f7ff;
  --pf-text-soft:#c2c7d8;
  --pf-text-dim:#8f95ab;
  --pf-accent:#8b7cff;
  --pf-accent-2:#5bc5ff;
  --pf-glow:0 14px 44px rgba(5,9,20,.42);
  --pf-card-glow:0 8px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
}
body.pf170-ui{
  background:
    radial-gradient(1000px 500px at 10% -20%, rgba(139,124,255,.16), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(91,197,255,.10), transparent 55%),
    linear-gradient(180deg,var(--pf-bg-0),var(--pf-bg-1) 22%,#0b0f18 100%);
  color:var(--pf-text);
}
body.pf170-ui #app{max-width:1600px;margin:0 auto;position:relative}
body.pf170-ui .page-view{opacity:1;transform:none;transition:opacity .25s ease, transform .25s ease}
body.pf170-ui .page-view.hidden{display:none!important}
body.pf170-ui .page-shell,
body.pf170-ui #chatListView,
body.pf170-ui #accountView{padding-inline:24px;padding-bottom:110px}
body.pf170-ui .page-heading{position:relative;gap:16px;margin-bottom:22px}
body.pf170-ui .page-heading h1{font-size:clamp(28px,3.8vw,42px);letter-spacing:-.04em;line-height:1.02;margin:4px 0 8px}
body.pf170-ui .page-heading p{max-width:760px;color:var(--pf-text-soft)}
body.pf170-ui .eyebrow{display:inline-flex;align-items:center;gap:8px;color:#a9aef5;letter-spacing:.16em;font-weight:700}
body.pf170-ui .eyebrow::before{content:"";width:24px;height:1px;background:linear-gradient(90deg,var(--pf-accent),transparent);display:inline-block}
body.pf170-ui button,
body.pf170-ui input,
body.pf170-ui select,
body.pf170-ui textarea{transition:background .22s ease,border-color .22s ease,box-shadow .22s ease,transform .22s ease,opacity .22s ease}
body.pf170-ui .ghost,
body.pf170-ui .primary,
body.pf170-ui .send{
  border-radius:16px;
  border:1px solid var(--pf-line);
  box-shadow:var(--pf-card-glow);
}
body.pf170-ui .primary,
body.pf170-ui .send{
  background:linear-gradient(135deg,rgba(139,124,255,.9),rgba(91,197,255,.88));
  color:#fff;
  border-color:rgba(255,255,255,.12)
}
body.pf170-ui .primary:hover,
body.pf170-ui .send:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(100,120,255,.28)}
body.pf170-ui .ghost{
  background:rgba(255,255,255,.035);
  color:var(--pf-text);
}
body.pf170-ui .ghost:hover{background:rgba(255,255,255,.07);border-color:var(--pf-line-strong)}

body.pf170-ui .pf170-hero-strip{display:grid;grid-template-columns:1.35fr 1fr 1fr;gap:14px;margin:0 0 18px}
body.pf170-ui .pf170-hero-card{
  position:relative;overflow:hidden;padding:18px 18px 20px;border-radius:26px;
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
  border:1px solid var(--pf-line);box-shadow:var(--pf-glow)
}
body.pf170-ui .pf170-hero-card::after{content:"";position:absolute;inset:auto -20% -40% auto;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,rgba(139,124,255,.22),transparent 70%);pointer-events:none}
body.pf170-ui .pf170-hero-card.primary{background:linear-gradient(135deg,rgba(43,48,82,.86),rgba(18,26,43,.92));border-color:rgba(139,124,255,.28)}
body.pf170-ui .pf170-hero-kicker{font-size:11px;letter-spacing:.16em;color:#b7bcfb;font-weight:800;margin-bottom:10px}
body.pf170-ui .pf170-hero-card h3{font-size:22px;letter-spacing:-.03em;margin:0 0 8px}
body.pf170-ui .pf170-hero-card p{margin:0;color:var(--pf-text-soft);max-width:56ch;line-height:1.5}

body.pf170-ui .discover-search,
body.pf170-ui .discover-toolbar,
body.pf170-ui .account-card,
body.pf170-ui .auth-card,
body.pf170-ui .account-explainer,
body.pf170-ui .profile-hero,
body.pf170-ui .relationship-bar,
body.pf170-ui .world-strip,
body.pf170-ui .composer,
body.pf170-ui .chat-header,
body.pf170-ui .recent-chat-card,
body.pf170-ui .discover-card,
body.pf170-ui .modal,
body.pf170-ui .character-detail-hero,
body.pf170-ui .detail-grid>div{
  background:var(--pf-surface);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border:1px solid var(--pf-line);
  box-shadow:var(--pf-card-glow);
}
body.pf170-ui .discover-search,
body.pf170-ui .discover-toolbar{border-radius:20px}
body.pf170-ui .discover-search{margin-bottom:12px;padding-inline:18px}
body.pf170-ui .discover-search input{font-size:15px}
body.pf170-ui .discover-toolbar{padding:14px 16px;gap:14px;margin-bottom:10px}
body.pf170-ui .filter-chip,
body.pf170-ui select{
  border-radius:999px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  color:var(--pf-text)
}
body.pf170-ui .filter-chip.active{background:linear-gradient(135deg,rgba(139,124,255,.22),rgba(91,197,255,.18));border-color:rgba(139,124,255,.28)}
body.pf170-ui .result-count{margin:12px 4px 14px;color:var(--pf-text-dim)}
body.pf170-ui .discover-grid{gap:18px}
body.pf170-ui .discover-card{
  border-radius:28px;overflow:hidden;position:relative;transform:translateY(0);
}
body.pf170-ui .discover-card::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(255,255,255,0) 22%,rgba(0,0,0,.12));pointer-events:none}
body.pf170-ui .discover-card:hover{transform:translateY(-3px);border-color:rgba(139,124,255,.28);box-shadow:0 22px 44px rgba(8,10,18,.42)}
body.pf170-ui .discover-card-top{min-height:164px;background:linear-gradient(180deg,rgba(120,120,255,.10),rgba(255,255,255,.02));display:flex;align-items:center;justify-content:center}
body.pf170-ui .discover-avatar{width:108px;height:108px;border-radius:50%;box-shadow:0 16px 28px rgba(0,0,0,.25);border:2px solid rgba(255,255,255,.12);background-color:rgba(255,255,255,.04)}
body.pf170-ui .favorite-float{top:16px;right:16px;width:42px;height:42px;border-radius:50%;background:rgba(7,10,18,.6);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.10)}
body.pf170-ui .favorite-float.active{background:linear-gradient(135deg,rgba(255,93,154,.24),rgba(255,255,255,.10));color:#fff;border-color:rgba(255,123,187,.25)}
body.pf170-ui .discover-card-body{padding:18px}
body.pf170-ui .discover-title-row h3{font-size:24px;letter-spacing:-.03em}
body.pf170-ui .discover-card p{color:var(--pf-text-soft);line-height:1.5}
body.pf170-ui .card-meta{font-size:13px;color:var(--pf-text-dim)}
body.pf170-ui .official-badge,
body.pf170-ui .community-badge{border-radius:999px;padding:6px 10px;font-size:11px;font-weight:800;letter-spacing:.08em}
body.pf170-ui .official-badge{background:rgba(56,176,255,.11);border:1px solid rgba(56,176,255,.26)}
body.pf170-ui .community-badge{background:rgba(139,124,255,.12);border:1px solid rgba(139,124,255,.22)}

body.pf170-ui .recent-chat-card{
  border-radius:24px;padding:16px;align-items:center;gap:16px
}
body.pf170-ui .recent-chat-card:hover{transform:translateY(-2px);border-color:rgba(139,124,255,.28)}
body.pf170-ui .chat-copy h3{font-size:18px;letter-spacing:-.02em}
body.pf170-ui .chat-copy p{color:var(--pf-text-soft)}
body.pf170-ui .chat-stage,
body.pf170-ui .group-world-tag{border-radius:999px;padding:8px 10px;background:rgba(255,255,255,.06);color:#d8dcf0;border:1px solid rgba(255,255,255,.08)}

body.pf170-ui .chat-view{padding-bottom:120px}
body.pf170-ui .chat-header{
  position:sticky;top:0;z-index:30;border-radius:0 0 24px 24px;
  margin:0 -6px 10px;padding:14px 16px 12px;box-shadow:var(--pf-glow)
}
body.pf170-ui .header-character h2{font-size:22px;letter-spacing:-.04em}
body.pf170-ui .header-character p{color:var(--pf-text-dim)}
body.pf170-ui .header-actions{gap:8px}
body.pf170-ui .header-actions .ghost{border-radius:14px;padding:10px 14px;background:rgba(255,255,255,.045)}
body.pf170-ui .header-actions .ghost.header-pill-primary{background:linear-gradient(135deg,rgba(139,124,255,.22),rgba(91,197,255,.14))}
body.pf170-ui .avatar,
body.pf170-ui .msg-avatar,
body.pf170-ui .profile-avatar{border:1px solid rgba(255,255,255,.12);box-shadow:0 10px 20px rgba(0,0,0,.22)}
body.pf170-ui .relationship-bar,
body.pf170-ui .world-strip{border-radius:22px;padding:16px 18px;margin:0 0 12px}
body.pf170-ui .relationship-bar{display:grid;grid-template-columns:minmax(140px,220px) 1fr 1fr 1fr;align-items:center;gap:16px}
body.pf170-ui .relationship-bar strong{font-size:20px;letter-spacing:-.02em}
body.pf170-ui .meter{height:10px;background:rgba(255,255,255,.05);border-radius:999px;overflow:hidden}
body.pf170-ui .meter i{background:linear-gradient(90deg,var(--pf-accent),var(--pf-accent-2));box-shadow:0 0 20px rgba(114,148,255,.35)}
body.pf170-ui .world-strip{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
body.pf170-ui .world-dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(135deg,var(--pf-accent),var(--pf-accent-2));box-shadow:0 0 18px rgba(139,124,255,.55)}

body.pf170-ui .messages{padding:8px 6px 10px;display:flex;flex-direction:column;gap:12px}
body.pf170-ui .message{opacity:0;transform:translateY(10px) scale(.995);animation:pf170MsgIn .36s cubic-bezier(.2,.8,.2,1) forwards;animation-delay:var(--delay,0ms)}
@keyframes pf170MsgIn{to{opacity:1;transform:translateY(0) scale(1)}}
body.pf170-ui .message.assistant .bubble,
body.pf170-ui .message.user .bubble{
  border-radius:24px;
  box-shadow:var(--pf-card-glow);
  border:1px solid rgba(255,255,255,.08);
}
body.pf170-ui .message.assistant .bubble{
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.028));
}
body.pf170-ui .message.user .bubble{
  background:linear-gradient(135deg,rgba(139,124,255,.19),rgba(91,197,255,.13));
}
body.pf170-ui .speaker{font-size:13px;color:#bdb5ff;letter-spacing:.03em;margin-bottom:8px}
body.pf170-ui .bubble{line-height:1.75;font-size:16px}
body.pf170-ui .bubble em.action{color:#cfd6ee;font-style:italic}
body.pf170-ui .message-actions{opacity:0;transform:translateY(4px);transition:all .18s ease}
body.pf170-ui .bubble:hover .message-actions{opacity:1;transform:none}

body.pf170-ui .composer{
  position:sticky;bottom:86px;z-index:15;padding:12px;border-radius:24px;display:grid;grid-template-columns:1fr auto;gap:10px
}
body.pf170-ui .composer textarea{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);padding:14px 16px;font-size:15px;color:var(--pf-text)}
body.pf170-ui .composer textarea::placeholder{color:#9aa0b7}
body.pf170-ui .send{min-width:58px;font-size:18px}
body.pf170-ui .pf170-suggestions{display:flex;flex-wrap:wrap;gap:8px;grid-column:1/-1;padding-top:2px}
body.pf170-ui .pf170-suggestion-chip{padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);font-size:12px;color:#d4d8ea;cursor:pointer}
body.pf170-ui .pf170-suggestion-chip:hover{background:rgba(255,255,255,.08);border-color:rgba(139,124,255,.22)}

body.pf170-ui .bottom-nav{
  left:50%;transform:translateX(-50%);bottom:18px;width:min(720px,calc(100% - 22px));border-radius:24px;padding:10px 12px;
  background:rgba(8,10,18,.78);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border:1px solid rgba(255,255,255,.09);box-shadow:0 20px 50px rgba(0,0,0,.38)
}
body.pf170-ui .bottom-nav-item{position:relative;border-radius:18px;padding:12px 16px;color:var(--pf-text-dim)}
body.pf170-ui .bottom-nav-item.active{color:#fff;background:linear-gradient(135deg,rgba(139,124,255,.20),rgba(91,197,255,.13))}
body.pf170-ui .bottom-nav-item .nav-symbol{font-size:16px}

body.pf170-ui .modal-backdrop{background:rgba(5,8,14,.68);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
body.pf170-ui .modal{border-radius:28px;box-shadow:0 28px 80px rgba(0,0,0,.5);max-height:min(88vh,900px)}
body.pf170-ui .modal h2{letter-spacing:-.03em}
body.pf170-ui .detail-grid{gap:12px}
body.pf170-ui .detail-grid>div{border-radius:20px;padding:16px}
body.pf170-ui .tag-row span{background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.08);border-radius:999px}
body.pf170-ui .modal-actions{gap:10px;flex-wrap:wrap}

body.pf170-ui .auth-layout,
body.pf170-ui .account-grid{gap:18px}
body.pf170-ui .auth-card,
body.pf170-ui .account-card,
body.pf170-ui .account-explainer,
body.pf170-ui .profile-hero{border-radius:28px;padding:20px}
body.pf170-ui .profile-hero{background:linear-gradient(135deg,rgba(30,34,58,.92),rgba(16,20,34,.92));border-color:rgba(139,124,255,.18)}
body.pf170-ui .profile-avatar{width:88px;height:88px;border-radius:24px}
body.pf170-ui .profile-detail{padding:12px 0;border-bottom:1px solid rgba(255,255,255,.06)}

body.pf170-ui .empty-list,
body.pf170-ui .chat-loading,
body.pf170-ui .group-empty-scene{border-radius:22px;background:rgba(255,255,255,.035);border:1px dashed rgba(255,255,255,.12)}
body.pf170-ui .empty-list{padding:28px}
body.pf170-ui .chat-loading{padding:22px}
body.pf170-ui .chat-loading span{background:linear-gradient(90deg,rgba(139,124,255,.8),rgba(91,197,255,.9))}

body.pf170-ui .pf170-section-enter{animation:pf170SectionIn .28s ease both}
@keyframes pf170SectionIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
body.pf170-ui .pf170-card-reveal{opacity:0;transform:translateY(10px);animation:pf170CardIn .42s cubic-bezier(.2,.8,.2,1) forwards;animation-delay:var(--delay,0ms)}
@keyframes pf170CardIn{to{opacity:1;transform:none}}
body.pf170-ui .pf170-modal-enter .modal{animation:pf170Pop .22s ease both}
@keyframes pf170Pop{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}

@media (max-width: 1040px){
  body.pf170-ui .pf170-hero-strip{grid-template-columns:1fr;gap:12px}
  body.pf170-ui .relationship-bar{grid-template-columns:1fr;gap:12px}
}
@media (max-width: 720px){
  body.pf170-ui .page-shell,
  body.pf170-ui #chatListView,
  body.pf170-ui #accountView{padding-inline:12px;padding-bottom:108px}
  body.pf170-ui .pf170-hero-card{padding:16px 16px 18px}
  body.pf170-ui .pf170-hero-card h3{font-size:19px}
  body.pf170-ui .discover-card-top{min-height:132px}
  body.pf170-ui .discover-avatar{width:88px;height:88px}
  body.pf170-ui .chat-header{padding:12px 12px 10px;border-radius:0 0 20px 20px}
  body.pf170-ui .header-actions{overflow:auto;flex-wrap:nowrap;padding-bottom:4px}
  body.pf170-ui .header-actions::-webkit-scrollbar{display:none}
  body.pf170-ui .header-actions .ghost{flex:0 0 auto;min-width:72px;padding:9px 11px;font-size:11px}
  body.pf170-ui .header-character h2{font-size:17px}
  body.pf170-ui .header-character p{font-size:10px}
  body.pf170-ui .bubble{font-size:15px;line-height:1.68}
  body.pf170-ui .composer{bottom:84px;padding:10px;border-radius:20px}
  body.pf170-ui .bottom-nav{width:calc(100% - 14px);bottom:8px;border-radius:20px}
  body.pf170-ui .bottom-nav-item{padding:11px 12px;font-size:12px}
}
@media (max-width: 480px){
  body.pf170-ui .discover-title-row h3{font-size:20px}
  body.pf170-ui .chat-copy h3{font-size:16px}
  body.pf170-ui .favorite-float{width:38px;height:38px}
  body.pf170-ui .relationship-bar,
  body.pf170-ui .world-strip{padding:14px}
}

/* =====================================================================
   PersonaForge v1.8.0 — Radical Layout Redesign
   This intentionally changes the app structure, not just the color skin.
   ===================================================================== */
body.pf180-ui{
  --pf180-rail:88px;
  --pf180-aside:292px;
  background:#070910;
  overflow:hidden;
}
body.pf180-ui::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;
  background:
    radial-gradient(850px 500px at 22% -20%,rgba(120,96,255,.15),transparent 70%),
    radial-gradient(760px 460px at 92% 8%,rgba(55,154,255,.09),transparent 66%),
    linear-gradient(180deg,#080a11,#0b0e16 48%,#090b12);
}
body.pf180-ui #app{max-width:none;width:100%;height:100vh;display:block}
body.pf180-ui .main-area{height:100vh;margin-left:var(--pf180-rail);position:relative;overflow:hidden}
body.pf180-ui .page-view{height:100vh;overflow:auto}
body.pf180-ui .page-shell{width:min(1380px,100%);margin:0 auto;padding:44px 40px 130px}

/* Desktop navigation becomes a real app rail. */
body.pf180-ui .bottom-nav{
  position:fixed;left:0;top:0;bottom:0;transform:none;width:var(--pf180-rail);height:100vh;
  display:flex;flex-direction:column;justify-content:center;gap:10px;padding:88px 10px 20px;
  border-radius:0;border:0;border-right:1px solid rgba(255,255,255,.07);
  background:rgba(8,10,17,.86);backdrop-filter:blur(24px);z-index:100;
  box-shadow:18px 0 44px rgba(0,0,0,.18)
}
body.pf180-ui .bottom-nav::before{
  content:"PF";position:absolute;top:20px;left:16px;width:55px;height:55px;border-radius:18px;
  display:grid;place-items:center;font-size:14px;font-weight:950;letter-spacing:.08em;color:white;
  background:linear-gradient(145deg,#8476ff,#4ab7ff);box-shadow:0 15px 32px rgba(82,104,255,.25)
}
body.pf180-ui .bottom-nav-item{
  width:68px;height:68px;padding:0;border-radius:20px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  font-size:9px;letter-spacing:.02em;background:transparent;color:#777e93
}
body.pf180-ui .bottom-nav-item .nav-symbol{font-size:20px}
body.pf180-ui .bottom-nav-item:hover{background:rgba(255,255,255,.045);color:#c7ccdc}
body.pf180-ui .bottom-nav-item.active{background:linear-gradient(145deg,rgba(132,118,255,.20),rgba(74,183,255,.10));color:#fff;box-shadow:inset 0 0 0 1px rgba(139,124,255,.18)}
body.pf180-ui .bottom-nav-item.active::after{display:none}

/* Discover becomes editorial, with a featured rail instead of dashboard blocks. */
body.pf180-ui #discoverView .page-heading{margin-bottom:26px;align-items:flex-end}
body.pf180-ui #discoverView .page-heading h1{font-size:52px;line-height:.96;letter-spacing:-.055em}
body.pf180-ui .pf180-featured{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(320px,.8fr);gap:18px;margin:0 0 28px}
body.pf180-ui .pf180-feature-main{
  min-height:330px;border-radius:34px;overflow:hidden;position:relative;border:1px solid rgba(255,255,255,.08);box-shadow:0 30px 70px rgba(0,0,0,.32);
  background:linear-gradient(120deg,#17192b,#111521)
}
body.pf180-ui .pf180-feature-main::before{content:"";position:absolute;inset:0;background-image:var(--feature-art);background-size:cover;background-position:center 20%;filter:blur(2px) saturate(.9);opacity:.30;transform:scale(1.08)}
body.pf180-ui .pf180-feature-main::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(8,10,17,.97) 0%,rgba(8,10,17,.82) 36%,rgba(8,10,17,.24) 78%,rgba(8,10,17,.45) 100%)}
body.pf180-ui .pf180-feature-content{position:relative;z-index:2;max-width:560px;padding:42px}
body.pf180-ui .pf180-feature-content .kicker{color:#aeb7ff;letter-spacing:.15em;font-size:11px;font-weight:900}
body.pf180-ui .pf180-feature-content h2{font-size:48px;line-height:.98;letter-spacing:-.055em;margin:14px 0 12px}
body.pf180-ui .pf180-feature-content p{color:#c1c7d8;font-size:15px;line-height:1.65;margin:0 0 24px}
body.pf180-ui .pf180-feature-actions{display:flex;gap:10px;flex-wrap:wrap}
body.pf180-ui .pf180-feature-list{display:grid;grid-template-rows:repeat(3,1fr);gap:12px}
body.pf180-ui .pf180-feature-mini{position:relative;overflow:hidden;border-radius:24px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.03);display:flex;align-items:center;gap:14px;padding:14px;cursor:pointer;transition:.2s ease}
body.pf180-ui .pf180-feature-mini:hover{transform:translateX(3px);border-color:rgba(139,124,255,.28);background:rgba(255,255,255,.05)}
body.pf180-ui .pf180-feature-mini .avatar{width:62px;height:62px;border-radius:18px;flex:0 0 auto}
body.pf180-ui .pf180-feature-mini strong{display:block;font-size:16px;margin-bottom:5px}
body.pf180-ui .pf180-feature-mini span{display:block;color:#868ca0;font-size:11px;line-height:1.35}
body.pf180-ui .discover-search{height:56px;border-radius:18px;margin-bottom:14px}
body.pf180-ui .discover-toolbar{border-radius:18px;padding:12px 14px}
body.pf180-ui .discover-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
body.pf180-ui .discover-card{border-radius:24px;background:#11141e;border-color:rgba(255,255,255,.06);box-shadow:none}
body.pf180-ui .discover-card:hover{transform:translateY(-5px);box-shadow:0 20px 55px rgba(0,0,0,.34);border-color:rgba(139,124,255,.25)}
body.pf180-ui .discover-card-top{height:184px;background:linear-gradient(180deg,#181c2b,#121620)}
body.pf180-ui .discover-avatar{width:116px;height:116px}
body.pf180-ui .discover-card-body{padding:16px 17px 18px}
body.pf180-ui .discover-title-row h3{font-size:19px}

/* Chat becomes a true two-pane story workspace. */
body.pf180-ui #chatsView{height:100vh;overflow:hidden}
body.pf180-ui .chat-view{height:100vh!important;display:grid!important;grid-template-columns:var(--pf180-aside) minmax(0,1fr);padding:0!important;overflow:hidden;position:relative}
body.pf180-ui .chat-view::before{
  content:"";position:absolute;inset:0 0 0 var(--pf180-aside);pointer-events:none;z-index:0;
  background-image:var(--pf180-chat-art);background-size:700px auto;background-repeat:no-repeat;background-position:right -80px top -80px;
  opacity:.055;filter:blur(16px) saturate(.7);mask-image:linear-gradient(to left,#000,transparent 85%);
}
body.pf180-ui .pf180-chat-aside{grid-column:1;grid-row:1;z-index:4;height:100vh;padding:20px 18px;display:flex;flex-direction:column;gap:14px;background:linear-gradient(180deg,rgba(14,17,28,.98),rgba(9,12,19,.98));border-right:1px solid rgba(255,255,255,.07);overflow:auto}
body.pf180-ui .pf180-aside-art{height:190px;border-radius:28px;display:grid;place-items:center;position:relative;overflow:hidden;background:radial-gradient(circle at 50% 20%,rgba(139,124,255,.22),transparent 58%),#121622;border:1px solid rgba(255,255,255,.07)}
body.pf180-ui .pf180-aside-art::before{content:"";position:absolute;inset:-15%;background-image:var(--pf180-chat-art);background-size:cover;background-position:center;filter:blur(26px);opacity:.18}
body.pf180-ui .pf180-aside-avatar{width:128px;height:128px;border-radius:34px;background:center/cover no-repeat;position:relative;z-index:1;box-shadow:0 20px 44px rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.14)}
body.pf180-ui .pf180-aside-kicker{font-size:9px;letter-spacing:.15em;color:#8f96ab;font-weight:900;margin-bottom:6px}
body.pf180-ui .pf180-aside-copy h2{font-size:28px;letter-spacing:-.045em;margin:0 0 5px}
body.pf180-ui .pf180-aside-copy p{margin:0;color:#858ca1;font-size:12px}
body.pf180-ui .pf180-aside-status{display:grid;grid-template-columns:1fr;gap:8px}
body.pf180-ui .pf180-aside-status>div{padding:12px 13px;border-radius:15px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.06)}
body.pf180-ui .pf180-aside-status span{font-size:9px;text-transform:uppercase;letter-spacing:.09em;color:#777f95;display:block;margin-bottom:4px}
body.pf180-ui .pf180-aside-status strong{font-size:13px;color:#e4e8f4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
body.pf180-ui .pf180-aside-meters{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
body.pf180-ui .pf180-aside-meters label{padding:10px 7px;text-align:center;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.055)}
body.pf180-ui .pf180-aside-meters span{display:block;font-size:8px;color:#6f778c;margin-bottom:4px}
body.pf180-ui .pf180-aside-meters b{font-size:13px;color:#f0f2fa}
body.pf180-ui .pf180-aside-actions{display:grid;gap:7px;margin-top:auto}
body.pf180-ui .pf180-aside-actions .ghost{text-align:left;padding:11px 12px;border-radius:13px;font-size:11px}
body.pf180-ui .pf180-aside-tip{font-size:9px;color:#676f84;line-height:1.6;padding:4px 3px}
body.pf180-ui .pf180-aside-tip kbd{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);padding:2px 5px;border-radius:5px;color:#9ea5b8}
body.pf180-ui .pf180-chat-main{grid-column:2;min-width:0;height:100vh;display:flex;flex-direction:column;position:relative;z-index:1;overflow:hidden}
body.pf180-ui .pf180-chat-main .chat-header{position:relative;top:auto;margin:0;border-radius:0;background:rgba(9,12,19,.74);box-shadow:none;border-bottom:1px solid rgba(255,255,255,.05);min-height:74px;padding:12px 22px}
body.pf180-ui .pf180-chat-main .chat-header #headerAvatar{display:none}
body.pf180-ui .pf180-chat-main .chat-header .header-character h2{font-size:17px;margin:0}
body.pf180-ui .pf180-chat-main .chat-header .header-character p{font-size:9px}
body.pf180-ui .pf180-chat-main .header-actions .ghost{padding:8px 11px;min-width:auto;font-size:10px;border-radius:12px}
body.pf180-ui .pf180-chat-main .relationship-bar{display:none!important}
body.pf180-ui .pf180-chat-main .world-strip{margin:10px 22px 0;border-radius:14px;padding:9px 12px;min-height:36px;height:auto;background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.055);font-size:10px}
body.pf180-ui .pf180-chat-main .messages{flex:1;overflow:auto;width:100%;max-width:none;padding:28px max(32px,calc((100vw - var(--pf180-rail) - var(--pf180-aside) - 880px)/2)) 30px;gap:20px}
body.pf180-ui .pf180-chat-main .message{max-width:920px;width:100%;margin-inline:auto}
body.pf180-ui .pf180-chat-main .message.assistant{grid-template-columns:42px minmax(0,1fr);gap:13px}
body.pf180-ui .pf180-chat-main .message.assistant .msg-avatar{width:40px;height:40px;border-radius:13px}
body.pf180-ui .pf180-chat-main .message.assistant .bubble{background:transparent!important;border:0!important;box-shadow:none!important;padding:2px 0 14px;max-width:820px;font-size:15px;line-height:1.8;color:#e6e9f1}
body.pf180-ui .pf180-chat-main .message.assistant .speaker{font-size:12px;color:#9ea6ff;margin-bottom:9px;font-weight:800}
body.pf180-ui .pf180-chat-main .message.user{justify-content:flex-end}
body.pf180-ui .pf180-chat-main .message.user .bubble{max-width:72%;border-radius:22px 22px 6px 22px;background:linear-gradient(135deg,#292944,#20283e)!important;border:1px solid rgba(139,124,255,.20)!important;box-shadow:0 10px 24px rgba(0,0,0,.20)!important;padding:12px 15px;font-size:14px;line-height:1.55}
body.pf180-ui .pf180-chat-main .message-actions{font-size:10px}
body.pf180-ui .pf180-chat-main .composer{position:relative;bottom:auto;margin:0 auto 16px;width:min(900px,calc(100% - 44px));padding:10px 11px;border-radius:20px;background:rgba(15,19,29,.90);border:1px solid rgba(255,255,255,.08);box-shadow:0 20px 60px rgba(0,0,0,.30)}
body.pf180-ui .pf180-chat-main .composer textarea{min-height:48px;background:transparent;border:0;padding:13px 12px;font-size:14px}
body.pf180-ui .pf180-chat-main .send{width:48px;height:48px;min-width:48px;border-radius:15px}
body.pf180-ui .pf180-chat-main .pf170-suggestions{padding:0 2px 2px;gap:6px}
body.pf180-ui .pf180-chat-main .pf170-suggestion-chip{font-size:10px;padding:6px 9px;background:transparent;border-color:rgba(255,255,255,.06);color:#7f879b}
body.pf180-ui .pf180-chat-main .pf170-suggestion-chip:hover{color:#cfd4e5;background:rgba(255,255,255,.035)}

/* Chat list changes to visual story cards. */
body.pf180-ui .recent-chats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px}
body.pf180-ui .recent-chat-card{min-height:126px;border-radius:22px;padding:18px;background:linear-gradient(135deg,#111621,#0e121a);position:relative;overflow:hidden}
body.pf180-ui .recent-chat-card .avatar.large{width:72px;height:72px;border-radius:22px}
body.pf180-ui .recent-chat-card .chat-copy h3{font-size:19px}
body.pf180-ui .recent-chat-card .chat-copy p{font-size:12px;line-height:1.45;max-width:46ch}
body.pf180-ui .recent-chat-card .chev{font-size:24px;color:#596176}

/* Account becomes cleaner dashboard. */
body.pf180-ui .account-shell{max-width:1120px;margin:0 auto}
body.pf180-ui .profile-hero{min-height:170px;border-radius:30px;background:linear-gradient(135deg,#171b2b,#10141f);position:relative;overflow:hidden}
body.pf180-ui .profile-hero::after{content:"";position:absolute;width:280px;height:280px;right:-80px;top:-120px;border-radius:50%;background:radial-gradient(circle,rgba(139,124,255,.22),transparent 68%)}
body.pf180-ui .account-grid{grid-template-columns:1fr 1fr;gap:16px}
body.pf180-ui .account-card{border-radius:24px;padding:20px}

/* Modals become centered sheets, mobile becomes bottom sheet. */
body.pf180-ui .modal-backdrop{background:rgba(3,5,10,.78);backdrop-filter:blur(12px)}
body.pf180-ui .modal{width:min(760px,calc(100vw - 36px));max-height:86vh;border-radius:28px;background:#11151f;border:1px solid rgba(255,255,255,.08);box-shadow:0 38px 90px rgba(0,0,0,.56);padding:24px}
body.pf180-ui .hub-grid{gap:9px}
body.pf180-ui .hub-button{background:#151a26;border-color:rgba(255,255,255,.06);border-radius:18px}
body.pf180-ui .hub-button:hover{background:#181e2c;border-color:rgba(139,124,255,.22)}

/* Transition language is now structural. */
body.pf180-ui .pf180-enter{animation:pf180Enter .34s cubic-bezier(.2,.75,.2,1) both}
@keyframes pf180Enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
body.pf180-ui .pf180-card-in{animation:pf180Card .42s cubic-bezier(.2,.75,.2,1) both;animation-delay:var(--delay,0ms)}
@keyframes pf180Card{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
body.pf180-ui .modal-backdrop:not(.hidden) .modal{animation:pf180Sheet .26s cubic-bezier(.2,.75,.2,1) both}
@keyframes pf180Sheet{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}

@media(max-width:1100px){
  body.pf180-ui{--pf180-aside:250px}
  body.pf180-ui .pf180-featured{grid-template-columns:1fr}
  body.pf180-ui .pf180-feature-list{grid-template-columns:repeat(3,1fr);grid-template-rows:1fr}
  body.pf180-ui .pf180-feature-mini{min-width:0}
  body.pf180-ui .pf180-feature-mini .avatar{width:48px;height:48px;border-radius:15px}
}

@media(max-width:820px){
  body.pf180-ui{--pf180-rail:0px;overflow:hidden}
  body.pf180-ui .main-area{margin-left:0}
  body.pf180-ui .bottom-nav{left:8px;right:8px;top:auto;bottom:8px;width:auto;height:68px;transform:none;display:grid;grid-template-columns:repeat(3,1fr);padding:7px 8px;border:1px solid rgba(255,255,255,.08);border-radius:20px;background:rgba(8,10,17,.90)}
  body.pf180-ui .bottom-nav::before{display:none}
  body.pf180-ui .bottom-nav-item{width:auto;height:54px;border-radius:15px;font-size:9px;gap:3px}
  body.pf180-ui .bottom-nav-item .nav-symbol{font-size:17px}
  body.pf180-ui .page-shell{padding:26px 14px 100px}
  body.pf180-ui #discoverView .page-heading h1{font-size:36px}
  body.pf180-ui .pf180-feature-main{min-height:260px;border-radius:26px}
  body.pf180-ui .pf180-feature-content{padding:26px}
  body.pf180-ui .pf180-feature-content h2{font-size:34px}
  body.pf180-ui .pf180-feature-list{display:flex;overflow:auto;gap:9px;padding-bottom:2px}
  body.pf180-ui .pf180-feature-mini{min-width:230px}
  body.pf180-ui .discover-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body.pf180-ui .discover-card-top{height:140px}
  body.pf180-ui .discover-avatar{width:88px;height:88px}
  body.pf180-ui .chat-view{display:block!important;height:100vh!important}
  body.pf180-ui .pf180-chat-aside{display:none}
  body.pf180-ui .pf180-chat-main{height:100vh;width:100%}
  body.pf180-ui .chat-view::before{inset:0;background-size:520px auto;opacity:.045}
  body.pf180-ui .pf180-chat-main .chat-header{min-height:68px;padding:9px 10px;display:grid;grid-template-columns:auto auto 1fr;grid-template-areas:'back avatar info' 'actions actions actions';gap:7px}
  body.pf180-ui .pf180-chat-main .chat-header #headerAvatar{display:block;grid-area:avatar;width:40px;height:40px}
  body.pf180-ui .pf180-chat-main #backToChatsBtn{grid-area:back}
  body.pf180-ui .pf180-chat-main .header-character{grid-area:info;min-width:0}
  body.pf180-ui .pf180-chat-main .header-actions{grid-area:actions;overflow:auto;flex-wrap:nowrap;justify-content:flex-start;padding-bottom:2px}
  body.pf180-ui .pf180-chat-main .header-actions::-webkit-scrollbar{display:none}
  body.pf180-ui .pf180-chat-main .header-actions .ghost{flex:0 0 auto;padding:7px 9px;font-size:9px}
  body.pf180-ui .pf180-chat-main .relationship-bar{display:grid!important;margin:7px 10px 0;padding:10px;grid-template-columns:auto 1fr 1fr 1fr;gap:8px;border-radius:14px}
  body.pf180-ui .pf180-chat-main .relationship-bar strong{font-size:12px}
  body.pf180-ui .pf180-chat-main .relationship-bar span,body.pf180-ui .pf180-chat-main .relationship-bar label{font-size:8px}
  body.pf180-ui .pf180-chat-main .world-strip{margin:7px 10px 0}
  body.pf180-ui .pf180-chat-main .messages{padding:18px 14px 20px;gap:16px}
  body.pf180-ui .pf180-chat-main .message.assistant{grid-template-columns:34px minmax(0,1fr);gap:9px}
  body.pf180-ui .pf180-chat-main .message.assistant .msg-avatar{width:32px;height:32px;border-radius:11px}
  body.pf180-ui .pf180-chat-main .message.assistant .bubble{font-size:14px;line-height:1.72}
  body.pf180-ui .pf180-chat-main .message.user .bubble{max-width:88%;font-size:13px}
  body.pf180-ui .pf180-chat-main .composer{margin:0 10px 82px;width:auto;border-radius:18px}
  body.pf180-ui .pf180-chat-main .pf170-suggestions{display:none}
  body.pf180-ui .recent-chats-grid{grid-template-columns:1fr}
  body.pf180-ui .account-grid{grid-template-columns:1fr}
  body.pf180-ui .modal-backdrop{align-items:flex-end;padding:0}
  body.pf180-ui .modal{width:100%;max-height:89vh;border-radius:26px 26px 0 0;border-left:0;border-right:0;border-bottom:0;padding:20px 16px calc(20px + env(safe-area-inset-bottom))}
}

@media(max-width:520px){
  body.pf180-ui .discover-grid{grid-template-columns:1fr 1fr}
  body.pf180-ui .discover-card-body{padding:12px}
  body.pf180-ui .discover-title-row h3{font-size:15px}
  body.pf180-ui .discover-card-body p{display:none}
  body.pf180-ui .card-meta{font-size:10px}
  body.pf180-ui .pf180-feature-content h2{font-size:30px}
}


/* =====================================================================
   PersonaForge v1.8.3 — Top HUD + Dashboard polish
   ===================================================================== */
body.pf180-ui .pf180-chat-aside{background:linear-gradient(180deg,rgba(13,18,29,.98),rgba(8,11,18,.98));border-right:1px solid rgba(255,255,255,.05)}
body.pf180-ui .pf183-aside-shell{height:100%;display:flex;flex-direction:column;gap:18px;padding:28px 18px 18px;position:relative;overflow:hidden}
body.pf180-ui .pf183-aside-shell::before{content:"";position:absolute;inset:14px;border-radius:28px;background:linear-gradient(180deg,rgba(139,124,255,.05),rgba(255,255,255,.02));border:1px solid rgba(255,255,255,.04);pointer-events:none}
body.pf180-ui .pf183-aside-shell > *{position:relative;z-index:1}
body.pf180-ui .pf183-aside-art{min-height:250px;display:grid;place-items:center;border-radius:28px;background:radial-gradient(circle at 50% 28%,rgba(139,124,255,.26),transparent 50%),linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.015));border:1px solid rgba(255,255,255,.06);overflow:hidden}
body.pf180-ui .pf183-aside-ring{position:absolute;width:142px;height:142px;border-radius:50%;border:1px solid rgba(255,255,255,.10);box-shadow:0 0 0 16px rgba(255,255,255,.022),0 0 60px rgba(139,124,255,.18)}
body.pf180-ui .pf183-aside-copy{gap:6px}
body.pf180-ui .pf183-aside-copy h2{font-size:28px;line-height:1.05}
body.pf180-ui .pf183-aside-copy p{font-size:12px;color:#b8bed0;text-transform:uppercase;letter-spacing:.16em}
body.pf180-ui .pf183-dashboard-stack{display:flex;flex-direction:column;gap:12px;margin-top:4px}
body.pf180-ui .pf183-dashboard-card,body.pf180-ui .pf183-mini-card{padding:15px 15px 14px;border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.015));border:1px solid rgba(255,255,255,.055);box-shadow:0 12px 30px rgba(0,0,0,.16)}
body.pf180-ui .pf183-dashboard-label,body.pf180-ui .pf183-mini-card span{display:block;color:#8b93a9;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.16em;margin-bottom:8px}
body.pf180-ui .pf183-dashboard-card strong,body.pf180-ui .pf183-mini-card strong{display:block;color:#f1f3f8;font-size:15px;line-height:1.35}
body.pf180-ui .pf183-dashboard-card p{margin:8px 0 0;color:#aeb5c7;font-size:12px;line-height:1.55}
body.pf180-ui .pf183-mini-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
body.pf180-ui .pf183-aside-tip{margin-top:auto;padding:12px 14px;border-radius:16px;background:rgba(255,255,255,.028);border:1px solid rgba(255,255,255,.05);color:#9099ae}

body.pf180-ui .pf183-chat-hud{display:grid;grid-template-columns:minmax(200px,1.05fr) minmax(240px,1.2fr) minmax(430px,2fr);gap:12px;padding:12px 22px 0;align-items:stretch}
body.pf180-ui .pf183-hud-card{min-width:0;border-radius:20px;padding:14px 16px;background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.018));border:1px solid rgba(255,255,255,.055);box-shadow:0 14px 28px rgba(0,0,0,.16)}
body.pf180-ui .pf183-hud-label{display:block;color:#8b93a9;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.16em;margin-bottom:7px}
body.pf180-ui .pf183-hud-card strong{display:block;color:#f2f4fa;font-size:15px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.pf180-ui .pf183-hud-card small{display:block;margin-top:4px;color:#b0b7ca;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.pf180-ui .pf183-chat-hud .relationship-bar{display:grid!important;grid-template-columns:minmax(110px,.9fr) 1fr 1fr 1fr;gap:12px;margin:0;min-height:auto;padding:14px 16px;border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.038),rgba(255,255,255,.018));border:1px solid rgba(255,255,255,.055);box-shadow:0 14px 28px rgba(0,0,0,.16)}
body.pf180-ui .pf183-chat-hud .pf183-stage-block{display:flex;flex-direction:column;justify-content:center;padding-right:6px;border-right:1px solid rgba(255,255,255,.05)}
body.pf180-ui .pf183-chat-hud .pf183-stage-block span{color:#8b93a9;font-size:10px;font-weight:800;letter-spacing:.16em;text-transform:uppercase}
body.pf180-ui .pf183-chat-hud .pf183-stage-block strong{margin-top:8px;font-size:18px;color:#f2f4fa}
body.pf180-ui .pf183-chat-hud .meter-group{display:flex;flex-direction:column;justify-content:center;gap:7px;min-width:0}
body.pf180-ui .pf183-chat-hud .meter-group label{font-size:11px;color:#b0b7ca;display:flex;justify-content:space-between;gap:10px}
body.pf180-ui .pf183-chat-hud .meter{height:9px;background:rgba(255,255,255,.06);border-radius:999px;overflow:hidden}
body.pf180-ui .pf180-chat-main .world-strip{margin:10px 22px 0;border-radius:16px;padding:11px 14px;min-height:42px;background:linear-gradient(180deg,rgba(255,255,255,.028),rgba(255,255,255,.012));border:1px solid rgba(255,255,255,.055);font-size:11px;box-shadow:0 10px 24px rgba(0,0,0,.13)}

@media(max-width:1260px){
  body.pf180-ui .pf183-chat-hud{grid-template-columns:1fr 1.1fr;grid-template-areas:'char scene' 'bond bond'}
  body.pf180-ui .pf183-hud-character{grid-area:char}
  body.pf180-ui .pf183-hud-scene{grid-area:scene}
  body.pf180-ui .pf183-chat-hud .relationship-bar{grid-area:bond}
}
@media(max-width:820px){
  body.pf180-ui .pf183-chat-hud{padding:10px 10px 0;grid-template-columns:1fr;gap:9px}
  body.pf180-ui .pf183-chat-hud .relationship-bar{grid-template-columns:1fr 1fr;gap:8px;padding:12px}
  body.pf180-ui .pf183-chat-hud .pf183-stage-block{grid-column:1/-1;border-right:0;border-bottom:1px solid rgba(255,255,255,.05);padding-bottom:8px;margin-bottom:2px}
  body.pf180-ui .pf180-chat-main .world-strip{margin:8px 10px 0}
}
@media(max-width:560px){
  body.pf180-ui .pf183-chat-hud .relationship-bar{grid-template-columns:1fr}
  body.pf180-ui .pf183-chat-hud .meter-group label{font-size:10px}
}


/* =====================================================================
   PersonaForge v1.8.4 — Desktop cleanup + breathing room
   ===================================================================== */
body.pf180-ui .pf183-dashboard-card strong{font-size:15px;line-height:1.55;letter-spacing:-.01em;text-wrap:pretty;word-break:break-word}
body.pf180-ui .pf183-dashboard-card p{font-size:13px;line-height:1.82;color:#b9c0d2;margin-top:10px;text-wrap:pretty}
body.pf180-ui .pf183-mini-grid{grid-template-columns:1fr;gap:10px}
body.pf180-ui .pf183-mini-card{padding:14px 15px 15px}
body.pf180-ui .pf183-mini-card strong{font-size:15px;line-height:1.6;text-wrap:pretty;word-break:break-word}
body.pf180-ui .pf183-aside-copy h2{margin-bottom:6px}
body.pf180-ui .pf183-aside-copy p{line-height:1.7;max-width:90%}
body.pf180-ui .pf183-dashboard-stack{gap:14px}
body.pf180-ui .pf183-dashboard-card{padding:16px 16px 15px}
body.pf180-ui .pf183-aside-tip{line-height:1.6}

/* Desktop only: remove duplicate info buttons from top header */
@media(min-width:1025px){
  body.pf180-ui .chat-header .header-actions #characterInfoBtn,
  body.pf180-ui .chat-header .header-actions #rpgBtn,
  body.pf180-ui .chat-header .header-actions #chatPersonaBtn{display:none !important}
}

/* On tighter desktop widths keep left panel readable */
@media(max-width:1420px) and (min-width:1025px){
  body.pf180-ui .pf183-aside-shell{padding:24px 16px 16px}
  body.pf180-ui .pf183-aside-art{min-height:220px}
  body.pf180-ui .pf183-dashboard-card strong{font-size:14px}
}

/* =====================================================================
   PersonaForge v1.9.0 — UX Rebuild + Scene Awareness
   Spacious by default. Detailed systems are progressive, not permanent.
   ===================================================================== */
:root{
  --pf190-sidebar:248px;
  --pf190-reading:1040px;
  --pf190-chat-font:16px;
  --pf190-line-height:1.86;
  --pf190-message-gap:34px;
}
html[data-pf190-reading-width="focused"]{--pf190-reading:820px}
html[data-pf190-reading-width="wide"]{--pf190-reading:1040px}
html[data-pf190-reading-width="full"]{--pf190-reading:1400px}
html[data-pf190-text-size="small"]{--pf190-chat-font:14px}
html[data-pf190-text-size="medium"]{--pf190-chat-font:16px}
html[data-pf190-text-size="large"]{--pf190-chat-font:18px}
html[data-pf190-density="spacious"]{--pf190-message-gap:36px;--pf190-line-height:1.9}
html[data-pf190-density="comfortable"]{--pf190-message-gap:26px;--pf190-line-height:1.78}
html[data-pf190-density="compact"]{--pf190-message-gap:18px;--pf190-line-height:1.65}
html[data-pf190-sidebar="compact"]{--pf190-sidebar:196px}
html[data-pf190-sidebar="hidden"]{--pf190-sidebar:0px}

body.pf190-ui.pf180-ui .chat-view{grid-template-columns:var(--pf190-sidebar) minmax(0,1fr)!important;transition:grid-template-columns .24s ease}
body.pf190-ui.pf180-ui .chat-view::before{inset:0 0 0 var(--pf190-sidebar)!important;transition:inset .24s ease}
body.pf190-ui.pf180-ui .pf180-chat-main{min-width:0}
body.pf190-ui .pf190-force-hidden{display:none!important}

/* The story rail is context, not a second dashboard. */
body.pf190-ui .pf190-story-rail{padding:0!important;background:linear-gradient(180deg,#0f1420,#0a0e17)!important;overflow:hidden!important;transition:width .24s ease,opacity .2s ease,border-color .2s ease}
body.pf190-ui .pf190-rail-inner{height:100%;display:flex;flex-direction:column;padding:24px 20px 18px;gap:22px;overflow:auto;scrollbar-width:thin}
body.pf190-ui .pf190-rail-collapse{position:absolute;right:10px;top:14px;z-index:6;width:30px;height:30px;border-radius:10px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.035);color:#9aa3b7;cursor:pointer}
body.pf190-ui .pf190-character-portrait-wrap{display:grid;place-items:center;padding:14px 0 4px}
body.pf190-ui .pf190-character-portrait{width:134px!important;height:160px!important;border-radius:30px!important;background-size:cover!important;background-position:center top!important;border:1px solid rgba(255,255,255,.09)!important;box-shadow:0 22px 48px rgba(0,0,0,.34),0 0 0 9px rgba(139,124,255,.035)!important}
body.pf190-ui .pf190-character-title{padding:0 2px}
body.pf190-ui .pf190-character-title>span{display:block;color:#7f89a0;font-size:9px;font-weight:850;letter-spacing:.18em;margin-bottom:7px}
body.pf190-ui .pf190-character-title h2{font-size:27px;line-height:1.08;letter-spacing:-.04em;margin:0 0 7px;color:#f4f6fb}
body.pf190-ui .pf190-character-title p{font-size:11px;line-height:1.55;color:#929bb0;text-transform:uppercase;letter-spacing:.13em;margin:0}
body.pf190-ui .pf190-scene-context{padding-top:18px;border-top:1px solid rgba(255,255,255,.055);display:flex;flex-direction:column;gap:18px}
body.pf190-ui .pf190-context-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
body.pf190-ui .pf190-context-heading>span{font-size:9px;letter-spacing:.17em;font-weight:850;color:#79839a}
body.pf190-ui .pf190-context-heading button{font-size:10px;padding:5px 8px;border:0;border-radius:8px;background:rgba(139,124,255,.09);color:#b9b4ff;cursor:pointer}
body.pf190-ui .pf190-context-row{display:block;min-width:0}
body.pf190-ui .pf190-context-row>span{display:block;color:#788297;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.14em;margin-bottom:7px}
body.pf190-ui .pf190-context-row strong{display:block;color:#e5e8ef;font-size:13px;line-height:1.6;font-weight:680;word-break:break-word;text-wrap:pretty}
body.pf190-ui .pf190-context-row p{margin:0;color:#b1b8c9;font-size:13px;line-height:1.78;text-wrap:pretty;word-break:break-word}
body.pf190-ui .pf190-surroundings-row{padding-left:12px;border-left:2px solid rgba(139,124,255,.23)}
body.pf190-ui .pf190-rail-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.05);padding-top:14px;color:#687288;font-size:10px}
body.pf190-ui .pf190-rail-footer span{padding:3px 6px;border:1px solid rgba(255,255,255,.07);border-radius:6px;color:#929bad}
body.pf190-ui.pf190-rail-collapsed .pf190-story-rail{opacity:0;pointer-events:none;border-color:transparent}
body.pf190-ui.pf190-rail-collapsed .pf190-rail-collapse{display:none}
html[data-pf190-sidebar="compact"] body.pf190-ui .pf190-character-portrait{width:106px!important;height:128px!important}
html[data-pf190-sidebar="compact"] body.pf190-ui .pf190-rail-inner{padding-inline:14px}
html[data-pf190-sidebar="compact"] body.pf190-ui .pf190-context-row p{font-size:12px;line-height:1.66}

/* Header: only Story / Character / More remain visible. */
body.pf190-ui .pf180-chat-main .chat-header{min-height:72px!important;padding:14px 28px!important;background:rgba(9,12,18,.82)!important;backdrop-filter:blur(18px);border-bottom:1px solid rgba(255,255,255,.045)!important}
body.pf190-ui .header-character h2{font-size:19px!important}
body.pf190-ui .header-character p{font-size:9px!important;color:#777f91!important;letter-spacing:.12em!important}
body.pf190-ui .pf190-header-actions{gap:9px!important}
body.pf190-ui .pf190-header-actions .ghost{min-width:auto!important;padding:9px 14px!important;border-radius:12px!important;font-size:11px!important;background:rgba(255,255,255,.025)!important}
body.pf190-ui .pf190-header-actions .pf190-nav-primary{background:linear-gradient(135deg,rgba(139,124,255,.17),rgba(91,197,255,.08))!important;border-color:rgba(139,124,255,.2)!important}

/* Relationship is one compact strip, no duplicated character/scene cards. */
body.pf190-ui .pf190-relationship-strip{margin:14px 28px 0;display:grid;grid-template-columns:minmax(120px,.8fr) repeat(3,minmax(110px,1fr)) auto;gap:18px;align-items:center;padding:14px 17px;border:1px solid rgba(255,255,255,.055);border-radius:18px;background:rgba(255,255,255,.018);transition:padding .2s ease,opacity .2s ease}
body.pf190-ui .pf190-stage{padding-right:14px;border-right:1px solid rgba(255,255,255,.055)}
body.pf190-ui .pf190-stage>span{display:block;font-size:9px;font-weight:850;letter-spacing:.16em;color:#737d92}
body.pf190-ui .pf190-stage>strong{display:block;margin-top:6px;font-size:16px;letter-spacing:-.02em;color:#edf0f6}
body.pf190-ui #pf190RelationshipDelta{display:block;min-height:14px;margin-top:5px;color:#8ad2a8;font-size:9px;opacity:0;transform:translateY(2px);transition:.22s ease}
body.pf190-ui #pf190RelationshipDelta.show{opacity:1;transform:none}
body.pf190-ui .pf190-relationship-strip .meter-group{min-width:0}
body.pf190-ui .pf190-relationship-strip .meter-group label{display:flex;justify-content:space-between;color:#929bad;font-size:10px;margin-bottom:7px}
body.pf190-ui .pf190-relationship-strip .meter{height:7px;border-radius:99px;background:rgba(255,255,255,.055);overflow:hidden}
body.pf190-ui .pf190-relationship-strip .meter i{height:100%;display:block;border-radius:99px;background:linear-gradient(90deg,#8b7cff,#63b9ff);transition:width .42s ease}
body.pf190-ui #pf190CollapseRelationship{border:0;background:transparent;color:#697389;font-size:14px;cursor:pointer;padding:8px}
body.pf190-ui .pf190-relationship-strip.compact{grid-template-columns:auto auto;padding-block:9px}
body.pf190-ui .pf190-relationship-strip.compact .meter-group{display:none}
body.pf190-ui .pf190-relationship-strip.compact .pf190-stage{display:flex;align-items:center;gap:10px;border:0;padding:0}
body.pf190-ui .pf190-relationship-strip.compact .pf190-stage>strong{margin:0}
body.pf190-ui .pf190-relationship-strip.compact .pf190-stage>small{display:none}

/* Desktop scene strip is redundant; rail already owns location/surroundings. */
@media(min-width:821px){body.pf190-ui .pf180-chat-main .world-strip{display:none!important}}

/* Chat gets actual breathing room. */
body.pf190-ui .pf180-chat-main .messages{padding:54px max(38px,calc((100% - var(--pf190-reading))/2)) 54px!important;gap:var(--pf190-message-gap)!important;scroll-behavior:smooth}
body.pf190-ui .pf180-chat-main .message{max-width:var(--pf190-reading)!important;margin-inline:auto!important}
body.pf190-ui .pf180-chat-main .message.assistant{grid-template-columns:44px minmax(0,1fr)!important;gap:17px!important}
body.pf190-ui .pf180-chat-main .message.assistant .msg-avatar{width:42px!important;height:42px!important;border-radius:14px!important;margin-top:2px}
body.pf190-ui .pf180-chat-main .message.assistant .bubble{max-width:900px!important;font-size:var(--pf190-chat-font)!important;line-height:var(--pf190-line-height)!important;padding:0 0 6px!important;color:#e7e9f0!important}
body.pf190-ui .pf180-chat-main .message.assistant .speaker{margin-bottom:13px!important;font-size:12px!important;letter-spacing:.015em}
body.pf190-ui .pf180-chat-main .message.user .bubble{font-size:calc(var(--pf190-chat-font) - 1px)!important;line-height:1.68!important;max-width:min(72%,720px)!important;padding:14px 17px!important;border-radius:22px 22px 7px 22px!important}
body.pf190-ui .bubble em.action{font-style:italic;color:#c3c9d8;letter-spacing:.005em}
body.pf190-ui .bubble br+br{line-height:2.1}
body.pf190-ui .message-actions{opacity:0!important;pointer-events:none;transform:translateY(4px);transition:.16s ease!important}
body.pf190-ui .message:hover .message-actions,body.pf190-ui .message:focus-within .message-actions{opacity:1!important;pointer-events:auto;transform:none}

/* Composer floats but doesn't become a giant dark slab. */
body.pf190-ui .pf180-chat-main .composer{width:min(var(--pf190-reading),calc(100% - 64px))!important;margin:0 auto 22px!important;padding:10px 11px!important;border-radius:18px!important;background:rgba(14,18,27,.92)!important;border:1px solid rgba(255,255,255,.07)!important;box-shadow:0 18px 48px rgba(0,0,0,.28)!important}
body.pf190-ui .pf180-chat-main .composer textarea{min-height:52px!important;max-height:180px!important;font-size:15px!important;line-height:1.55!important;padding:14px!important}
body.pf190-ui .pf180-chat-main .send{width:50px!important;height:50px!important;min-width:50px!important;border-radius:15px!important;transition:transform .16s ease,box-shadow .16s ease!important}
body.pf190-ui .pf180-chat-main .send:hover{transform:translateY(-1px)}
body.pf190-ui .pf170-suggestions{gap:7px!important;padding-top:2px!important;transition:opacity .18s ease,max-height .18s ease,padding .18s ease}
body.pf190-ui .pf170-suggestions.pf190-suggestions-hidden{opacity:0;max-height:0;overflow:hidden;padding:0!important;pointer-events:none}
body.pf190-ui .pf170-suggestion-chip{font-size:10px!important;padding:6px 9px!important;color:#777f92!important;background:transparent!important}

body.pf190-ui .pf190-jump-latest{position:absolute;right:30px;bottom:120px;z-index:12;border:1px solid rgba(255,255,255,.08);border-radius:999px;background:rgba(15,19,29,.94);color:#d7dbea;padding:9px 13px;box-shadow:0 12px 30px rgba(0,0,0,.28);cursor:pointer}

/* Story / Character hubs use whitespace instead of box soup. */
body.pf190-ui .pf190-hub-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}
body.pf190-ui .pf190-hub-card{min-height:104px;text-align:left;padding:16px;border:1px solid rgba(255,255,255,.055);border-radius:17px;background:rgba(255,255,255,.022);color:#eef0f5;cursor:pointer;transition:.18s ease}
body.pf190-ui .pf190-hub-card:hover{background:rgba(139,124,255,.055);border-color:rgba(139,124,255,.17);transform:translateY(-1px)}
body.pf190-ui .pf190-hub-card strong{display:block;font-size:14px;margin-bottom:7px}
body.pf190-ui .pf190-hub-card span{display:block;color:#9aa3b7;font-size:12px;line-height:1.55}
body.pf190-ui .pf190-world-facts{grid-template-columns:1fr 1fr!important}
body.pf190-ui .pf190-world-surroundings{grid-column:1/-1}
body.pf190-ui .pf190-world-surroundings strong{line-height:1.65!important}

/* Settings / toasts */
body.pf190-ui .pf190-layout-settings{margin-top:16px}
body.pf190-ui .pf190-toast-host{position:fixed;right:18px;bottom:100px;z-index:10050;display:flex;flex-direction:column;gap:8px;pointer-events:none}
body.pf190-ui .pf190-toast{padding:10px 13px;border-radius:12px;background:#151a25;border:1px solid rgba(255,255,255,.08);box-shadow:0 15px 36px rgba(0,0,0,.34);color:#e7eaf2;font-size:12px;opacity:0;transform:translateY(6px);transition:.2s ease}
body.pf190-ui .pf190-toast.show{opacity:1;transform:none}

/* General app polish: less border soup and more whitespace. */
body.pf190-ui .page-heading{margin-bottom:30px}
body.pf190-ui .discover-grid{gap:18px!important}
body.pf190-ui .discover-card{border-color:rgba(255,255,255,.045)!important;background:rgba(255,255,255,.018)!important}
body.pf190-ui .recent-chats-grid{gap:16px!important}
body.pf190-ui .recent-chat-card{padding:20px!important;border-color:rgba(255,255,255,.045)!important}
body.pf190-ui .account-card,body.pf190-ui .auth-card,body.pf190-ui .profile-hero{border-color:rgba(255,255,255,.05)!important}
body.pf190-ui .modal{padding:28px!important}

/* Reduced motion respect. */
@media(prefers-reduced-motion:reduce){
  body.pf190-ui *,body.pf190-ui *::before,body.pf190-ui *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* Mobile: no desktop rail; scene context becomes the compact world strip. */
@media(max-width:820px){
  body.pf190-ui .chat-view{grid-template-columns:1fr!important}
  body.pf190-ui .pf190-story-rail{display:none!important}
  body.pf190-ui .pf180-chat-main .chat-header{padding:10px 11px!important}
  body.pf190-ui .pf190-header-actions .ghost{padding:8px 10px!important;font-size:10px!important}
  body.pf190-ui .pf190-relationship-strip{margin:8px 10px 0;grid-template-columns:1fr 1fr;gap:9px;padding:11px 12px}
  body.pf190-ui .pf190-stage{grid-column:1/-1;border-right:0;border-bottom:1px solid rgba(255,255,255,.05);padding:0 0 8px}
  body.pf190-ui .pf190-relationship-strip .meter-group:nth-of-type(3){grid-column:1/-1}
  body.pf190-ui .pf180-chat-main .world-strip{display:flex!important;margin:8px 10px 0!important;line-height:1.5!important;white-space:normal!important;height:auto!important;max-height:none!important;flex-wrap:wrap!important}
  body.pf190-ui #worldSurroundings{display:block;width:100%;color:#8f98ac;font-size:10px;white-space:normal!important}
  body.pf190-ui .pf180-chat-main .messages{padding:30px 14px 32px!important;gap:28px!important}
  body.pf190-ui .pf180-chat-main .message.assistant{grid-template-columns:34px minmax(0,1fr)!important;gap:10px!important}
  body.pf190-ui .pf180-chat-main .message.assistant .msg-avatar{width:32px!important;height:32px!important}
  body.pf190-ui .pf180-chat-main .message.assistant .bubble{font-size:15px!important;line-height:1.78!important}
  body.pf190-ui .pf180-chat-main .message.user .bubble{max-width:88%!important;font-size:14px!important}
  body.pf190-ui .pf180-chat-main .composer{width:auto!important;margin:0 10px 82px!important}
  body.pf190-ui .pf190-jump-latest{right:14px;bottom:154px}
  body.pf190-ui .pf190-hub-grid{grid-template-columns:1fr}
  body.pf190-ui .pf190-world-facts{grid-template-columns:1fr!important}
}

@media(max-width:520px){
  body.pf190-ui .pf190-relationship-strip{grid-template-columns:1fr}
  body.pf190-ui .pf190-stage{grid-column:auto}
  body.pf190-ui .pf190-relationship-strip .meter-group:nth-of-type(3){grid-column:auto}
  body.pf190-ui .modal{padding:20px 16px calc(20px + env(safe-area-inset-bottom))!important}
}

/* v1.9 header visibility wins over old compatibility CSS. */
body.pf190-ui .chat-header .header-actions #worldBtn,
body.pf190-ui .chat-header .header-actions #characterInfoBtn,
body.pf190-ui .chat-header .header-actions #threadMenuBtn{display:inline-flex!important;align-items:center;justify-content:center}
body.pf190-ui .chat-header .header-actions #rpgBtn,
body.pf190-ui .chat-header .header-actions #loreBtn,
body.pf190-ui .chat-header .header-actions #chatPersonaBtn,
body.pf190-ui .chat-header .header-actions #memoryBtn,
body.pf190-ui .chat-header .header-actions #intelligenceBtn,
body.pf190-ui .chat-header .header-actions #immersiveBtn{display:none!important}
