/* Shared companion layout. Existing forms and account-backed flows stay intact. */
:root {
  --bg-main: #2e3440; --panel-dark: #343c4a; --panel-dark-2: #282e38;
  --panel-blue: #465b73; --panel-blue-hover: #536e89; --panel-blue-dark: #3c4b60;
  --text-main: #eceff4; --text-muted: #bbc6d5; --text-dark: #202b39;
  --accent-gold: #ebcb8b; --accent-yellow: #ebcb8b; --accent-cyan: #88c0d0;
  --border-dark: #4b576a; --shadow: transparent;
  color-scheme: dark;
}
body { background: var(--bg-main); font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.5; }
h1,h2,h3,.primary-nav a,.primary-nav button,.button,.primary-action,.secondary-action { font-family: inherit; font-weight: 600; }
h1 { font-size: 30px; color: #a9cce5; }
h2 { font-size: 24px; }
.panel,.auth-panel,.memory-card,.profile-card,.create-dialog { border: 1px solid var(--border-dark); border-radius: 10px; box-shadow: none; }
input,select,textarea { border: 1px solid #64758b; border-radius: 6px; background: #2e3440; color: var(--text-main); }
button,.button,.primary-action,.secondary-action,.icon-button { border-radius: 6px; box-shadow: none; }
.primary-action { background: #9bc2df; color: #202b39; border: 1px solid #9bc2df; }
a { color: #bce1f4; }
:focus-visible { outline: 2px solid #ebcb8b; outline-offset: 3px; }
body:has(.primary-nav) > .app-shell { padding: 32px 32px 32px 272px; }
.app-shell > .product-topbar {
  position: fixed; inset: 0 auto 0 0; width: 232px; margin: 0; padding: 30px 20px;
  display: flex; flex-direction: column; align-items: stretch; gap: 24px;
  background: #282e38; border-right: 1px solid #465265; z-index: 1100;
}
.brand-lockup { padding: 0 6px; }
.brand-lockup h1 { font-size: 28px; letter-spacing: -1px; }
.brand-lockup span { font: 12px 'Segoe UI',Arial,sans-serif; color: #adbacc; }
.product-topbar .primary-nav { display: flex; flex-direction: column; width: 100%; min-width: 0; gap: 8px; margin: 0; }
.product-topbar .primary-nav a,.product-topbar .primary-nav button {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  width: 100%; min-height: 48px; padding: 10px 12px; gap: 12px;
  background: transparent; border: 0; color: #c7d0dc; border-radius: 6px;
  font-size: 15px; text-decoration: none; box-shadow: none;
}
.product-topbar .primary-nav :is(a,button)>span {
  display: inline-grid; place-items: center; width: 25px; height: 25px;
  padding: 0; border: 0; background: none; color: #88c0d0; font-size: 17px;
}
.product-topbar .primary-nav .active { background: #3c4b60; color: #bce1f4; box-shadow: inset 3px 0 #88c0d0; }
.product-topbar .primary-nav :is(a,button):hover { background: #384356; }
.product-topbar .topbar-controls { margin-top: auto; justify-content: flex-start; min-width: 0; }
.product-topbar .auth-badge { max-width: 100%; overflow-wrap: anywhere; white-space: normal; font-size: 12px; background: none; border: 0; padding: 6px; box-shadow: none; }
.app-shell.assistant-app-shell { height: 100dvh; padding-bottom: 24px; }
.assistant-chat-shell { width: min(100%, 1100px); }
.assistant-chat-header .eyebrow { color: #bbc6d5; }
.assistant-message-label { color: #a3be8c; }
.assistant-chat-panel .assistant-thread { background: #2e3440; }
.assistant-chat-panel .assistant-composer { border-top: 1px solid #4b576a; }
.release-dashboard[data-current-view="journal"] { display: block; max-width: 1180px; }
.release-dashboard[data-current-view="journal"] > .agent-panel,
.release-dashboard[data-current-view="journal"] > .right-panel { display: none; }
.journal-panel { width: 100%; padding: 28px; }
.journal-panel .mission-board { display: grid; grid-template-columns: 1fr; gap: 30px; }
.journal-panel .mission-board > div { padding: 0; border: 0; background: none; box-shadow: none; }
.journal-panel h3 { text-transform: none; color: #d8dee9; font-size: 18px; }
.journal-panel .daily-columns { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.journal-panel .day-drop { min-width: 0; background: #3b4555; border: 1px solid #526175; border-radius: 8px; padding: 12px; }
.journal-panel .mission-line,.journal-panel .scheduled-block { background: #465b73; border: 1px solid #64758b; border-radius: 6px; box-shadow: none; overflow-wrap: anywhere; }
.journal-panel .hourly-board { margin-top: 28px; background: #343c4a; max-height: none; overflow: visible; }
.journal-panel .hourly-board h3 { position: static; width: auto; min-height: 0; background: none; box-shadow: none; }
.companion-day-picker { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: #bbc6d5; }
.companion-day-picker select { min-height: 44px; max-width: 220px; padding: 8px 12px; }
.journal-panel .hour-grid { min-width: 0; grid-template-columns: 68px minmax(0,1fr); }
.journal-panel .hour-grid [data-companion-hidden] { display: none; }
.journal-panel .hour-grid :is(.hour-cell,[data-hour-day]):not([data-companion-hidden]) { grid-column: 2 !important; }
.journal-panel .hour-grid .hour-axis { grid-column: 1; }
.journal-panel .hour-heading { position: static; background: #3b4555; }
.journal-panel .hour-cell { min-height: 48px; }
.bottom-nav { display: none !important; }
@media (max-width: 780px) {
  body:has(.primary-nav) > .app-shell { padding: 86px 16px calc(90px + env(safe-area-inset-bottom)); }
  .app-shell > .product-topbar { inset: 0 0 auto; width: auto; min-height: 68px; padding: 12px 20px; border-right: 0; border-bottom: 1px solid #465265; flex-direction: row; align-items: center; }
  .brand-lockup h1 { font-size: 23px; }
  .brand-lockup span { font-size: 11px; }
  .product-topbar .topbar-controls { display: none; }
  .product-topbar .primary-nav.ai-primary-nav { position: fixed; inset: auto 0 0; display: grid; grid-template-columns: repeat(8,minmax(60px,1fr)); overflow-x:auto; gap: 2px; padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); background: #282e38; border-top: 1px solid #526175; }
  .product-topbar .primary-nav a,.product-topbar .primary-nav button { flex-direction: column; justify-content: center; gap: 2px; padding: 5px 1px; min-height: 54px; font-size: 9px; }
  .product-topbar .primary-nav .active { box-shadow: inset 0 2px #88c0d0; }
  .app-shell.assistant-app-shell { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .assistant-chat-header h2 { font-size: 22px; }
  .companion-changelog { max-height: 30dvh; }
  .journal-panel { padding: 18px 14px; }
  .journal-panel .daily-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .journal-panel .quest-header { flex-wrap: wrap; gap: 12px; }
  .journal-panel h2 { font-size: 23px; }
  .journal-panel .section-copy { font-size: 14px; }
  .quest-toast { bottom: 90px; max-height: 70dvh; overflow: auto; }
}
/* Profile is a settings page, not a multi-column quest dashboard. */
.release-dashboard[data-current-view="profile"],
.release-dashboard.character-collapsed[data-current-view="profile"] { display:block; width:100%; min-width:0; max-width:1100px; margin:0 auto; }
.release-dashboard[data-current-view="profile"] > .agent-panel,
.release-dashboard[data-current-view="profile"] > .right-panel { display:none; }
.release-dashboard[data-current-view="profile"] .profile-panel { display:block; width:100%; min-width:0; padding:0; border:0; background:transparent; }
.profile-panel .detail-top { margin-bottom:24px; gap:16px; align-items:center; }
.profile-panel .detail-top h2 { overflow-wrap:anywhere; }
.profile-panel .profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.profile-panel .profile-card { min-width:0; padding:24px; }
.profile-panel .profile-card h3 { margin:0 0 18px; font:600 20px/1.3 'Segoe UI',Arial,sans-serif; }
.profile-panel .profile-account { order:1; }
.profile-panel .profile-progress { order:2; }
.profile-panel .profile-planner { order:3; grid-column:1/-1; }
.profile-panel .agent-credential-card { order:4; grid-column:1/-1; }
.profile-panel .profile-character { order:0; }
.profile-panel .version-card { order:6; }
.profile-panel .feedback-card { order:7; }
.profile-panel .profile-agent-stage { height:170px; max-width:240px; margin:16px auto; }
.profile-panel .reward-line { padding:12px 0; border:0; border-bottom:1px solid var(--border-dark); background:transparent; gap:16px; font-size:14px; }
.profile-panel .reward-line strong { min-width:0; overflow-wrap:anywhere; text-align:right; }
.profile-panel .description-box { padding:0; border:0; background:transparent; margin:12px 0; line-height:1.6; }
.profile-panel .planner-days-grid { grid-template-columns:repeat(auto-fit,minmax(66px,1fr)); }
.profile-panel .planner-time-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.profile-panel .settings-field,.profile-panel fieldset,.profile-panel input,.profile-panel select { min-width:0; max-width:100%; }
.profile-panel .settings-field { font-size:14px; }
.profile-panel .settings-field input,.profile-panel .settings-field select { width:100%; font-size:16px; }
.profile-panel .agent-credential-form { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.profile-panel .agent-credential-form > button { justify-self:start; }
@media(max-width:1100px) {
  .profile-panel .profile-grid { grid-template-columns:minmax(0,1fr); }
  .profile-panel .profile-card { grid-column:1; }
}
@media(max-width:780px) {
  .profile-panel .profile-card { padding:18px; }
  .profile-panel .detail-top { align-items:start; flex-wrap:wrap; }
  .profile-panel .agent-credential-form { grid-template-columns:minmax(0,1fr); }
  .profile-panel .reward-line { flex-wrap:wrap; gap:6px 14px; }
  .profile-panel .reward-line strong { text-align:left; }
}
