/* Shared V4 assistant/account navigation. Scoped to activated V4 pages. */
body.v4-body .v4-sidebar { overflow-y: auto; overflow-x: hidden; }
body.v4-body .v4-account-area {
  margin-top: auto; padding: 13px 10px 8px;
  border-top: 1px solid #253c57; display: grid; gap: 9px;
  min-width: 0; color: #eaf2ff;
}
body.v4-body .v4-account-identity {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; color: #eaf2ff; min-width: 0;
}
body.v4-body .v4-account-avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%; background: #243a58; display: grid;
  place-items: center; font-weight: 700;
}
body.v4-body .v4-account-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: .85rem; font-weight: 650;
}
body.v4-body .v4-account-link, body.v4-body .v4-account-signout {
  display: block; color: #bfcee2; font-size: .79rem;
  text-decoration: none; padding: 6px 5px;
}
body.v4-body .v4-account-signout {
  width: 100%; text-align: left; font: inherit; font-size: .79rem;
  background: transparent; border: 0; cursor: pointer;
}
body.v4-body .v4-account-link:hover, body.v4-body .v4-account-signout:hover {
  color: white; text-decoration: underline;
}
.v4-mobile-menu-toggle { display: none; }

/* The assistant uses the same V4 sidebar without loading the whole dashboard. */
body.v4-assistant-body { background: #071222; color: #eaf2ff; overflow-x: hidden; }
body.v4-assistant-body .topbar, body.v4-assistant-body .footer,
body.v4-assistant-body .ambient-light, body.v4-assistant-body .page-grid { display: none; }
body.v4-assistant-body .page {
  box-sizing: border-box; width: calc(100% - 250px);
  max-width: none; min-width: 0; margin: 0 0 0 250px;
  padding: 24px clamp(16px, 3vw, 42px);
}
body.v4-assistant-body .v4-sidebar {
  position: fixed; inset: 0 auto 0 0; box-sizing: border-box;
  width: 250px; z-index: 70; display: flex; flex-direction: column;
  gap: 4px; padding: 15px 10px; background: #061225;
  border-right: 1px solid #1b3049;
}
body.v4-assistant-body .v4-brand {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px 18px;
  margin-bottom: 10px; border-bottom: 1px solid #20344c;
  color: white; text-decoration: none;
}
body.v4-assistant-body .v4-brand-symbol { width: 44px; height: 44px; object-fit: contain; }
body.v4-assistant-body .v4-brand-name { display: flex; flex-direction: column; gap: 4px; }
body.v4-assistant-body .v4-brand-name b { letter-spacing: .12em; }
body.v4-assistant-body .v4-brand-name small { color: #a9bed8; font-size: .51rem; letter-spacing: .15em; }
body.v4-assistant-body .v4-nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 34px;
  border-radius: 8px; padding: 6px 12px;
  text-decoration: none; color: #c4d1e5; font-size: .82rem;
}
body.v4-assistant-body .v4-nav-icon { width: 19px; flex: 0 0 19px; text-align: center; }
body.v4-assistant-body .v4-nav-item.active {
  background: #e00642; color: white; font-weight: 750;
}
body.v4-assistant-body .assistant-page { width: 100%; max-width: 980px; min-width: 0; }
body.v4-assistant-body .assistant-shell,
body.v4-assistant-body .assistant-log,
body.v4-assistant-body .assistant-form,
body.v4-assistant-body .assistant-form textarea { min-width: 0; box-sizing: border-box; }
body.v4-assistant-body .assistant-shell { background: #112138; border-color: #2c405b; }
body.v4-assistant-body .assistant-form textarea { max-width: 100%; }
body.v4-assistant-body .intel-hero { max-width: 100%; }
@media (max-width: 900px) {
  body.v4-assistant-body .page { width: 100%; margin: 0; padding: 64px 16px 22px; }
  body.v4-body .v4-sidebar {
    display: flex !important; transform: translateX(-105%);
    transition: transform .2s ease; width: min(285px, 83vw) !important;
    z-index: 1001; box-shadow: 8px 0 24px #0008;
  }
  body.v4-body.v4-nav-open .v4-sidebar { transform: translateX(0); }
  body.v4-body .v4-mobile-menu-toggle {
    display: block; position: fixed; left: 12px; top: 10px; z-index: 1002;
    padding: 8px 12px; border-radius: 8px;
    border: 1px solid #35516d; color: white;
    background: #10233b; font: inherit; font-size: .83rem;
  }
  body.v4-body .v4-shell { padding-top: 52px; }
  body.v4-assistant-body .assistant-message,
  body.v4-assistant-body .assistant-suggestions button { overflow-wrap: anywhere; }
}
@media (max-width: 390px) {
  body.v4-assistant-body .page { padding-left: 12px; padding-right: 12px; }
  body.v4-assistant-body .assistant-actions { flex-wrap: wrap; }
}

/* BEREON_V4_SHARED_SHELL_V1: matches web/static/css/v4_app.css */
.v4-brand-mark { flex: 0 0 44px; width: 44px; height: 48px; overflow: hidden; position: relative; }
.v4-sidebar .v4-brand-mark .v4-brand-symbol { display: block; width: auto !important; height: 66px !important; max-width: none; object-fit: initial; transform: translate(-11px, -6px); filter: drop-shadow(0 0 10px rgba(235, 31, 59, .34)); }
.v4-sidebar-help {
    margin: auto 3px 3px; display: flex; flex-direction: column; gap: 2px; text-decoration: none;
    background: #10233b; border: 1px solid #253c57; border-radius: 10px; padding: 12px 13px;
}
.v4-sidebar-help b { color: #eaf2ff; font-size: .8rem; }
.v4-sidebar-help small { color: #ff3d6b; font-size: .7rem; }
.v4-top .v4a-account { position: relative; }
.v4-top .v4a-account summary {
    list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid #1f3450; color: #eaf2ff;
}
.v4-top .v4a-account summary::-webkit-details-marker { display: none; }
.v4-top .v4a-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #e8194d, #8b1030); font-weight: 750; font-size: .78rem; color: #fff;
}
.v4-top .v4a-account-name { font-size: .8rem; font-weight: 650; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v4-top .v4a-account-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 90;
    display: flex; flex-direction: column; padding: 6px;
    background: #11223a; border: 1px solid #2c4566; border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.v4-top .v4a-account-menu a, .v4-top .v4a-account-menu button {
    text-align: left; padding: 9px 12px; border-radius: 7px; text-decoration: none;
    color: #c4d1e5; background: none; border: 0; font: inherit; font-size: .82rem; cursor: pointer;
}
.v4-top .v4a-account-menu a:hover, .v4-top .v4a-account-menu button:hover { background: #1a2e4a; color: #fff; }
.v4-top .v4a-account-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid #1f3450; }
.v4-top .v4a-account-menu button { width: 100%; color: #ff3d6b; }
@media (max-width: 1200px) { .v4-top .v4a-account-name { display: none; } }
@media (max-width: 1000px) { .v4-top .v4-top-nav { display: none; } }
body.v4-body .v4-sidebar .v4-brand { height: auto !important; min-height: 0 !important; overflow: visible !important; padding: 4px 8px 20px !important; gap: 11px !important; align-items: center !important; }
body.v4-body .v4-sidebar .v4-brand .v4-brand-mark .v4-brand-symbol { width: auto !important; height: 66px !important; flex: none !important; object-fit: initial !important; clip-path: none !important; transform: translate(-11px, -6px) !important; }
body.v4-body .v4-sidebar .v4-brand-name { display: flex !important; flex-direction: column; gap: 2px; background: transparent !important; padding: 0 !important; }
body.v4-body .v4-sidebar .v4-brand-name b { font-size: 1.1rem !important; letter-spacing: .14em !important; font-weight: 750 !important; }
body.v4-body .v4-sidebar .v4-brand-name small { font-size: .56rem !important; letter-spacing: .1em !important; color: #8ea2bd !important; }

/* "Upload its ILS Part Stats report" link in the empty market chart. */
.v4-ils-upload-link { display: inline; margin-left: 4px; padding: 0; border: 0; background: none; color: #ff4d6d; font: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; }
