/* story.derekjperna.com — Story floor chrome (clean rebuild) */
body.story-app .nav-group[data-nav-group="builder"],
body.story-app .nav-group[data-nav-group="app"],
body.story-app .nav-group[data-nav-group="reference"],
body.story-app .nav-subtabs[data-nav-group="builder"],
body.story-app .nav-subtabs[data-nav-group="app"],
body.story-app .nav-subtabs[data-nav-group="reference"],
body.story-app #btn-voice-settings,
body.story-app .btn-install,
body.story-app .ui-mode-switch {
  display: none !important;
}

body.story-app .nav-group[data-nav-group="cinder"] {
  font-weight: 700;
}

body.story-app #auth-gate .auth-gate-avatar {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(200, 140, 100, 0.35);
}

/* Story mode pill — clickable toggle in Cinder chat (not header) */
body.story-app .story-mode-pill.cinder-story-mode-toggle {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(180, 120, 90, 0.22);
  border: 1px solid rgba(200, 140, 100, 0.45);
  color: #e8c4a8;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.story-app .story-mode-pill.cinder-story-mode-toggle:hover {
  background: rgba(200, 140, 100, 0.32);
  border-color: rgba(220, 160, 120, 0.55);
}

body.story-app .story-mode-pill.cinder-story-mode-toggle.is-on {
  background: rgba(180, 120, 90, 0.28);
  border-color: rgba(200, 140, 100, 0.55);
  color: #f0d4bc;
}

body.story-app .story-mode-pill.cinder-story-mode-toggle.is-off {
  background: rgba(90, 95, 110, 0.35);
  border-color: rgba(130, 135, 150, 0.45);
  color: #b8bcc8;
}

body.story-app .cinder-chat-chrome {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
  margin-bottom: 0.15rem;
}

body.story-app.cinder-view .cinder-chat-chrome {
  display: flex;
}

body.story-app.cinder-view .cinder-chat-chrome:not([hidden]) {
  display: flex;
}

body.story-app.reader-view .cinder-chat-chrome {
  display: none !important;
}

body.story-app #panel-reader {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.story-app .reader-lens-bar-top {
  display: none;
  flex-shrink: 0;
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius, 10px);
  border: 1px solid rgba(120, 160, 220, 0.42);
  background: rgba(120, 160, 220, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

body.story-app.reader-view .reader-lens-bar-top {
  display: block !important;
}

body.story-app.reader-view #panel-reader .chat-wrap.story-panel-lens {
  flex: 1;
  min-height: 0;
}

body.story-app.reader-view #reader-lens-chrome,
body.story-app.reader-view #reader-attach-row:not([hidden]) {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  width: 100%;
}

body.story-app.reader-view .reader-pov-toolbar {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.45rem;
}

body.story-app.reader-view .reader-mindset-bar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius, 10px);
  border: 1px solid rgba(120, 160, 220, 0.45);
  background: rgba(120, 160, 220, 0.12);
}

body.story-app.reader-view .reader-mindset-bar .reader-pov-persona-field {
  flex: 1 1 14rem;
  min-width: 12rem;
}

body.story-app.reader-view .reader-mindset-bar .reader-pov-preview {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted, #9aa0ad);
  font-style: italic;
}

body.story-app.cinder-view .reader-mindset-bar,
body.story-app:not(.reader-view) .reader-mindset-bar {
  display: none !important;
}

body.story-app.reader-view .reader-identity-row .chat-identity-avatar,
body.story-app.reader-view #reader-compose-avatar {
  object-fit: cover;
  object-position: 50% 22%;
}

body.story-app #reader-attach-row[hidden],
body.story-app .cinder-chat-chrome[hidden] {
  display: none !important;
}

body.story-app.cinder-view .reader-lens-bar-top,
body.story-app:not(.reader-view) .reader-lens-bar-top {
  display: none !important;
}

body.story-app.reader-view .chat-wrap.story-panel-lens {
  display: flex;
  flex-direction: column;
}

body.story-app.cinder-view .chat-compose-soul {
  display: none;
}

body.story-app.cinder-view #reader-hint {
  font-style: italic;
}

/* House controls — Help panel only */
body.story-app .help-house-controls-card {
  margin-top: 0.5rem;
}

body.story-app .help-house-banner.story-action-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.65rem 0;
  border: none;
  margin: 0;
}

body.story-app .help-house-banner .story-action-banner-hint {
  flex: 1 1 100%;
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #9aa0ad);
}

body.story-app .help-house-banner .story-action-banner-hint:not([hidden]) {
  display: block;
}

/* Legacy floor panels — not in DOM on story site */
body.story-app #panel-chat,
body.story-app #panel-setup,
body.story-app #panel-edit,
body.story-app #panel-build,
body.story-app #panel-shutterstock,
body.story-app #panel-app-setup,
body.story-app #panel-app-builder,
body.story-app #panel-versions,
body.story-app #panel-author,
body.story-app #panel-keeps,
body.story-app #voice-panel {
  display: none !important;
}

body.story-app .chat-bubble.assistant-message .chat-bubble-body {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

body.story-app .chat-bubble.assistant-message .chat-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

body.story-app.cinder-create-active #panel-create {
  display: flex !important;
}

body.story-app.cinder-create-active #panel-create .create-sub-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

body.story-app #panel-create .chat-identity-avatar,
body.story-app #panel-create .chat-compose-avatar,
body.story-app .chat-bubble-avatar.cinder-avatar {
  border-color: rgba(200, 140, 100, 0.55);
  animation: none;
}

/* Panel routing — Cinder Chat vs Brainstorm/Schedule vs Characters vs Readers */
body.story-app.cinder-view:not(.cinder-create-active) #panel-create {
  display: none !important;
}

body.story-app.cinder-create-active #panel-reader {
  display: none !important;
}

body.story-app.cinder-create-active #panel-elena,
body.story-app.cinder-create-active #panel-reader-setup,
body.story-app.cinder-create-active #panel-help {
  display: none !important;
}

body.story-app #panel-elena.active,
body.story-app #panel-reader-setup.active,
body.story-app #panel-help.active {
  display: block;
}

body.story-app #panel-create.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.story-app #panel-create .create-sub-panel:not(.active) {
  display: none !important;
}

/* Auth — story floor uses victis-desktop-* (not legacy floor class names) */
body.story-app.victis-desktop-unlocked #auth-gate,
html.victis-desktop-shell body.story-app.auth-locked #auth-gate {
  display: none !important;
  pointer-events: none !important;
}

body.story-app.victis-desktop-unlocked #app-shell {
  display: block !important;
}

html.victis-desktop-shell body.story-app #btn-install-pwa {
  display: none !important;
}

/* Assistant bubbles — Cinder / Elena / Reader replies */
body.story-app .chat-bubble.assistant-message .chat-bubble-body {
  background: rgba(126, 200, 227, 0.12);
  border: 1px solid rgba(126, 200, 227, 0.35);
  border-radius: var(--radius, 10px);
  padding: 0.55rem 0.7rem;
}

body.story-app.cinder-view .chat-bubble.assistant-message .chat-bubble-body {
  background: rgba(200, 140, 100, 0.14);
  border-color: rgba(200, 140, 100, 0.4);
}

body.story-app #panel-elena .chat-bubble.assistant-message .chat-bubble-body {
  background: rgba(160, 120, 200, 0.12);
  border-color: rgba(160, 120, 200, 0.35);
}