:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-border: #e2e8f0;
  --app-text: #172033;
  --app-muted: #64748b;
  --app-primary: #2563eb;
  --app-primary-soft: #eff6ff;
  --app-danger: #dc2626;
  --app-warning: #d97706;
  --app-success: #059669;
  --app-radius: 14px;
  --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
}

body {
  background: var(--app-bg) !important;
  color: var(--app-text);
}

.legacy-global-nav {
  display: none !important;
}

.btn-backfill {
  display: none !important;
}

.portfolio-deep-analysis {
  margin-top: 22px;
}

.portfolio-deep-analysis > summary {
  padding: 12px 15px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  color: #475569;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.portfolio-deep-analysis[open] > summary {
  margin-bottom: 12px;
}

.app-shell {
  position: sticky;
  top: 0;
  z-index: 45;
  width: calc(100% + var(--app-body-pad-left, 0px) + var(--app-body-pad-right, 0px));
  margin-top: calc(-1 * var(--app-body-pad-top, 0px));
  margin-left: calc(-1 * var(--app-body-pad-left, 0px));
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-shell__inner {
  max-width: 1400px;
  min-height: 62px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.app-shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-text);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.app-shell__mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .22);
}

.app-shell__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.app-shell__nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition: .16s ease;
}

.app-shell__nav a:hover {
  color: var(--app-text);
  background: #f8fafc;
}

.app-shell__nav a.active {
  color: var(--app-primary);
  background: var(--app-primary-soft);
}

.app-shell__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell__select,
.app-shell__button {
  min-height: 36px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.app-shell__select {
  width: auto;
  max-width: 150px;
  padding: 0 30px 0 10px;
}

.app-shell__button {
  position: relative;
  min-width: 36px;
  padding: 0 10px;
  cursor: pointer;
}

.app-shell__button:hover {
  color: var(--app-text);
  background: #f8fafc;
}

.app-shell__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: none;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 99px;
  color: #fff;
  background: var(--app-danger);
  font-size: 10px;
  line-height: 1;
}

.app-shell__badge.visible {
  display: grid;
}

.app-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: min(400px, 100vw);
  padding: 18px;
  transform: translateX(102%);
  transition: transform .2s ease;
  background: #fff;
  box-shadow: -20px 0 60px rgba(15, 23, 42, .16);
  overflow-y: auto;
}

.app-drawer.open {
  transform: translateX(0);
}

.app-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-drawer__title {
  font-size: 18px;
  font-weight: 800;
}

.app-reminder {
  display: block;
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  color: var(--app-text);
  background: #fff;
  text-decoration: none;
}

.app-reminder:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.app-reminder__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 750;
}

.app-reminder__body {
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-reminder--high {
  border-left: 4px solid var(--app-danger);
}

.app-reminder--medium {
  border-left: 4px solid var(--app-warning);
}

.app-empty {
  padding: 36px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  background: rgba(15, 23, 42, .26);
}

.app-overlay.open {
  display: block;
}

.app-priority-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .34);
  backdrop-filter: blur(3px);
}

.app-priority-modal.open {
  display: grid;
}

.app-priority-modal__card {
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.app-priority-modal__title {
  margin-bottom: 8px;
  font-size: 19px;
  font-weight: 850;
}

.app-priority-modal__copy {
  margin-bottom: 18px;
  color: var(--app-muted);
  font-size: 14px;
  line-height: 1.65;
}

.app-priority-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-action {
  padding: 9px 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.app-action--primary {
  border-color: var(--app-primary);
  color: #fff;
  background: var(--app-primary);
}

.app-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 8px;
}

.app-toast {
  max-width: 360px;
  padding: 11px 14px;
  border: 1px solid var(--app-border);
  border-radius: 11px;
  color: var(--app-text);
  background: #fff;
  box-shadow: var(--app-shadow);
  font-size: 13px;
}

.app-toast.error {
  border-left: 4px solid var(--app-danger);
}

@media (max-width: 760px) {
  body {
    padding-top: 58px !important;
  }

  .app-shell {
    position: fixed;
    width: 100%;
    margin: 0;
  }

  .app-shell__inner {
    min-height: 58px;
    padding: 0 10px;
    gap: 8px;
  }

  .app-shell__brand span:last-child,
  .app-shell__actions .app-shell__select,
  .app-shell__actions .app-shell__button[data-kind="lang"],
  .app-shell__actions .app-shell__button[data-kind="currency"] {
    display: none;
  }

  .app-shell__nav {
    justify-content: center;
    gap: 0;
  }

  .app-shell__nav a {
    padding: 8px 9px;
    font-size: 12px;
  }

  .app-shell__actions {
    margin-left: auto;
  }
}
