/* Signed-in application shell. Header and WP admin offsets must never stack. */
body.mfx-no-topnav #main.mfx-legal-page { box-sizing: border-box; width: min(100%, 900px); padding: 32px !important; margin: 0 auto !important; color: #17233b; }
.mfx-legal-brand { display: inline-block; font-size: 14px; margin-bottom: 24px; color: #17233b; }
body.mfx-no-topnav .mfx-legal-page .pagetitle { margin-bottom: 24px; }
body.mfx-no-topnav .mfx-legal-page .pagetitle h1 { font-size: 18px !important; font-weight: 400 !important; line-height: 1.6; margin: 0; }
.mfx-legal-content { padding: 24px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.mfx-legal-content :is(h1,h2,h3,h4) { font-size: 14px; font-weight: 400; line-height: 1.7; margin: 28px 0 10px; color: #17233b; }
.mfx-legal-content > :first-child { margin-top: 0; }
.mfx-legal-content p { margin: 0 0 16px; }
.mfx-legal-content > :last-child { margin-bottom: 0; }
.mfx-legal-content :is(ul,ol) { padding-left: 20px; }
.mfx-legal-content a { text-decoration: underline; text-underline-offset: 3px; }
.mfx-legal-links { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 20px 0; font-size: 12px; }
body:has(.mfx-legal-public) #footer { margin-left: 0; }
@media (min-width: 1200px) {
  body.mfx-no-topnav #main.mfx-legal-signed-in { width: calc(100% - 300px); margin-left: 300px !important; }
}
@media (max-width: 768px) {
  body.mfx-no-topnav #main.mfx-legal-page { padding: 24px 16px !important; }
  body.mfx-no-topnav .mfx-legal-page .pagetitle h1 { font-size: 15px !important; }
  .mfx-legal-content { padding: 16px; font-size: 12px; }
  .mfx-legal-content :is(h1,h2,h3,h4) { font-size: 13px; margin-top: 24px; }
}
.mfx-faq-page .faq-section { margin-bottom: 24px; }
.mfx-faq-page .faq-section h2 { font-size: 13px; font-weight: 400; margin: 0 0 12px; color: #526178; }
.mfx-faq-page .faq-list { display: grid; gap: 12px; }
.mfx-faq-page .faq-item { padding: 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.mfx-faq-page .faq-q { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 28px; cursor: pointer; font-size: 13px; font-weight: 400; }
.mfx-faq-page .faq-a { display: none; margin-top: 12px; font-size: 13px; line-height: 1.75; color: #526178; }
.mfx-faq-page .faq-item.active .faq-q i { transform: rotate(180deg); }

/* Desktop uses the same restrained hierarchy, with one shared content rail. */
@media (min-width: 769px) {
  body.mfx-desktop-unified { background: #f5f7fb; color: #17233b; font-size: 13px; line-height: 1.65; }
  body.mfx-desktop-unified #main { box-sizing: border-box; width: calc(100% - 300px); max-width: 1160px; margin: 0 0 0 300px !important; padding: 32px !important; }
  body.mfx-desktop-unified #main .pagetitle { margin: 0 0 24px; }
  body.mfx-desktop-unified #main .breadcrumb { display: none; }
  body.mfx-desktop-unified #main :is(.pagetitle h1,.chart-index .app-title) { font-size: 18px !important; line-height: 1.5; margin: 0; font-weight: 400 !important; color: #17233b; }
  body.mfx-desktop-unified #main :is(h2,h3,h4,h5,h6,strong,b,label,th,summary,.label,.value,.btn,.badge) { font-weight: 400 !important; }
  body.mfx-desktop-unified #main :is(.col-lg-8,.col-lg-10) { width: 100%; }
  body.mfx-desktop-unified #main :is(.card,.mfx-mt4-card,.chart-portfolio,.totals-card,.acc-card) { border: 1px solid #e2e8f0 !important; border-radius: 12px !important; box-shadow: none !important; margin-bottom: 16px; overflow: hidden; }
  body.mfx-desktop-unified #main .card-header { padding: 16px 20px; border-bottom: 1px solid #edf1f6; }
  body.mfx-desktop-unified #main :is(.card-header h5,.mfx-mt4-page h2,.accounts-section-heading h2) { font-size: 14px !important; line-height: 1.6; }
  body.mfx-desktop-unified #main :is(.card-body,.mfx-mt4-pad) { padding: 20px; }
  body.mfx-desktop-unified #main .card-footer { padding: 16px 20px; }
  body.mfx-desktop-unified #main :is(.form-label,.form-check-label,.user-info-item .value,.mfx-mt4-lead) { font-size: 13px; }
  body.mfx-desktop-unified #main :is(.form-control,.form-select,.chart-portfolio__period select) { font-size: 14px; min-height: 40px; border-radius: 8px; }
  body.mfx-desktop-unified #main .btn { font-size: 13px; min-height: 40px; border-radius: 8px; }
  body.mfx-desktop-unified #main :is(.table th,.table td,.revenue-table td) { font-size: 13px; padding: 12px 10px; }
  body.mfx-desktop-unified #main :is(small,.badge,.accounts-intro,.mfx-mt4-note) { font-size: 12px; }
  body.mfx-desktop-unified #main .chart-index { padding: 0; margin: 0; max-width: none; }
  body.mfx-desktop-unified #main .accounts-eyebrow { display: none; }
  body.mfx-desktop-unified #main .chart-index .app-header { margin-bottom: 24px; }
  body.mfx-desktop-unified #main .chart-index .totals-card__primary { background: #fff; padding: 20px; }
  body.mfx-desktop-unified #main .chart-index .totals-card__primary .value { font-size: 18px; color: #17233b; }
  body.mfx-desktop-unified #main .chart-index .totals-card__item .value { font-size: 16px; }
  body.mfx-desktop-unified #main .chart-index .acc-metric .value { font-size: 14px; color: #17233b; }
  body.mfx-desktop-unified #main .chart-index .acc-card__accno { font-size: 13px; font-weight: 400; }
  body.mfx-desktop-unified #main .chart-index .acc-card { padding: 20px; }
  body.mfx-desktop-unified #main .chart-portfolio { max-width: none; width: 100%; margin: 0; padding: 20px; }
  body.mfx-desktop-unified #main .chart-portfolio #total-revenue { font-size: 18px; }
  body.mfx-desktop-unified #main .revenue-table td * { font-weight: 400 !important; }
  body.mfx-desktop-unified #main .chart-portfolio__visual.is-empty { min-height: 0; padding: 24px 0; }
  body.mfx-desktop-unified #main .mfx-mt4-page { max-width: none; }
  body.mfx-desktop-unified #main .mfx-mt4-page :is(.mfx-mt4-account strong,details.mfx-mt4-card summary) { font-size: 14px; }
  body.mfx-desktop-unified #main .calendar-container { width: 100%; max-width: none; margin: 0; }
  body.mfx-desktop-unified #main #calendar-capture { padding: 20px; border: 1px solid var(--border); border-radius: 12px; box-shadow: none; }
  body.mfx-desktop-unified #main .calendar-header { background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; }
  body.mfx-desktop-unified #main .calendar-title { font-size: 18px; color: var(--text); }
  body.mfx-desktop-unified #main .calendar-btn { color: var(--text); background: transparent; }
  body.mfx-desktop-unified #main :is(.month-total,.calendar-table td strong) { font-size: 14px; font-weight: 400; }
  body.mfx-desktop-unified #footer { font-size: 12px; }
}
@media (min-width: 769px) and (max-width: 1199px) {
  body.mfx-desktop-unified #main { width: 100%; margin-left: 0 !important; }
}
html.mfx-app-document { margin-top: 0 !important; }
.mfx-app-document #wpadminbar { display: none; }
.chart-portfolio__total-label { display: block; font-size: 13px; line-height: 1.5; color: #64748b; margin-bottom: 6px; font-weight: 500; }

.mfx-release-page { max-width: 900px; padding: 24px 20px; margin: 80px auto 24px; }
.mfx-release-page .pagetitle h1 { font-size: 18px; font-weight: 400; color: #17233b; }
.mfx-release-page .release-notes { display: grid; gap: 16px; }
.mfx-release-page .release-item { padding: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.mfx-release-page .release-item h2 { margin: 0 0 12px; font-size: 13px; font-weight: 400; color: #526178; line-height: 1.6; }
.mfx-release-page .release-item h3 { margin: 12px 0 6px; font-size: 12px; font-weight: 400; color: #526178; line-height: 1.6; }
.mfx-release-page .release-item :is(p,li) { font-size: 12px; line-height: 1.75; color: #17233b; overflow-wrap: anywhere; }
.mfx-release-page .release-item ul { margin: 0; padding-left: 18px; }
.mfx-release-page .release-item li + li { margin-top: 6px; }

@media (max-width: 768px) {
  body.mfx-mobile-unified {
    --mfx-bg: #f5f7fb;
    --mfx-text: #17233b;
    --mfx-text-2: #526178;
    --mfx-text-3: #64748b;
    --mfx-border: #e2e8f0;
    --mfx-shadow: none;
    margin: 0;
    padding: 56px 0 calc(88px + env(safe-area-inset-bottom)) !important;
    background: var(--mfx-bg);
    color: var(--mfx-text);
    font-size: 12px;
    line-height: 1.65;
  }
  body.mfx-mobile-unified #main {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding: 24px 16px 16px !important;
    box-sizing: border-box;
  }
  body.mfx-mobile-unified #main .pagetitle { margin: 0 0 16px; }
  body.mfx-mobile-unified #main .pagetitle h1,
  body.mfx-mobile-unified #main .chart-index .app-title {
    font-size: 15px !important; font-weight: 400; line-height: 1.6;
    letter-spacing: -.025em; margin: 0; color: var(--mfx-text);
  }
  body.mfx-mobile-unified #main .card,
  body.mfx-mobile-unified #main .mfx-mt4-card,
  body.mfx-mobile-unified #main .chart-portfolio,
  body.mfx-mobile-unified #main .chart-index .totals-card,
  body.mfx-mobile-unified #main .chart-index .acc-card {
    border: 1px solid var(--mfx-border) !important;
    border-radius: 12px !important;
    background: #fff;
    box-shadow: var(--mfx-shadow) !important;
    margin-bottom: 16px !important;
    overflow: hidden;
  }
  body.mfx-mobile-unified #main .card-header {
    padding: 12px 16px; gap: 12px; flex-wrap: wrap;
    border-radius: 0; border-bottom: 1px solid #edf1f6 !important;
  }
  body.mfx-mobile-unified #main .card-header h5,
  body.mfx-mobile-unified #main .mfx-mt4-page h2 {
    font-size: 13px !important; line-height: 1.6; font-weight: 400;
    color: var(--mfx-text); letter-spacing: -.01em;
  }
  body.mfx-mobile-unified #main .card-body { padding: 16px; border-radius: 0; }
  body.mfx-mobile-unified #main .card-footer { padding: 16px 18px; background: #fff; }
  body.mfx-mobile-unified #main .card-header .small { font-size: 12px; }
  body.mfx-mobile-unified #main .form-label { font-size: 13px; margin-bottom: 8px; color: var(--mfx-text-2); line-height: 1.5; }
  body.mfx-mobile-unified #main .form-control,
  body.mfx-mobile-unified #main .form-select,
  body.mfx-mobile-unified #main .chart-portfolio__period select,
  body.mfx-mobile-unified #main .mfx-mt4-key input {
    min-height: 46px; width: 100%; max-width: 100%; border: 1px solid #d7e0ec;
    border-radius: 10px; padding: 10px 12px; font-size: 16px; line-height: 1.5;
    color: var(--mfx-text); background-color: #fff;
  }
  body.mfx-mobile-unified #main .form-select { padding-right: 36px; }
  body.mfx-mobile-unified #main .btn,
  body.mfx-mobile-unified #main .chart-portfolio__period button {
    min-height: 44px; border-radius: 10px; padding: 10px 16px; font-size: 13px; line-height: 1.5; font-weight: 500;
  }
  body.mfx-mobile-unified #main .btn-primary { background: #2563eb; border-color: #2563eb; }
  body.mfx-mobile-unified #main .btn-outline-primary { color: #2563eb; border-color: #c9d8f7; }
  body.mfx-mobile-unified #main .card-body small { font-size: 12px; line-height: 1.75; margin-top: 6px; }
  body.mfx-mobile-unified #main .table td { font-size: 13px; line-height: 1.6; padding: 12px 8px; }
  body.mfx-mobile-unified #main .table th { font-size: 12px; padding: 12px 8px; }
  body.mfx-mobile-unified #main .user-info-item .value { font-size: 13px; overflow-wrap: anywhere; }
  body.mfx-page-mypage #main .account-table-container .badge { font-size: 12px; font-weight: 500; padding: 0; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
  body.mfx-mobile-unified #main .mfx-ob-done { border-radius: 12px; margin-bottom: 16px !important; }
  body.mfx-mobile-unified #main .mfx-ob-done summary { padding: 12px 16px; font-size: 13px; line-height: 1.6; }
  body.mfx-page-mypage #main .list-unstyled > li { margin-bottom: 16px !important; }
  body.mfx-page-mypage #main .list-unstyled > li:last-child { margin-bottom: 0 !important; }
  body.mfx-page-mypage #main .list-unstyled .ms-2,
  body.mfx-page-mypage #main .list-unstyled .ms-4 { margin-left: 0 !important; }
  body.mfx-page-mypage #main .list-unstyled div.small { font-size: 13px; line-height: 1.8; color: #526178 !important; }
  body.mfx-page-settings #main .card-body > .mb-3 { margin-bottom: 20px !important; }

  /* Stack labels above controls instead of squeezing a two-column edit table. */
  body.mfx-page-tag-edit #main .table-responsive { overflow: visible; }
  body.mfx-page-tag-edit #main .table,
  body.mfx-page-tag-edit #main .table tbody,
  body.mfx-page-tag-edit #main .table tr,
  body.mfx-page-tag-edit #main .table td { display: block; width: 100% !important; }
  body.mfx-page-tag-edit #main .table td { padding: 0; border: 0; box-shadow: none; background: transparent; }
  body.mfx-page-tag-edit #main .table tr.input-row { margin: 0 0 16px; }
  body.mfx-page-tag-edit #main .table tr.input-row td:first-child { margin-bottom: 8px; }
  body.mfx-page-tag-edit #main .table tr.account-row { padding: 12px; background: #f5f7fb; border-radius: 10px; margin: 24px 0 16px; }
  body.mfx-page-tag-edit #main .table tr.account-row:first-child { margin-top: 0; }
  body.mfx-page-tag-edit #main .account-row .mt-3 { margin-top: 0 !important; gap: 8px; flex-wrap: wrap; }
  body.mfx-page-tag-edit #main .account-row strong { font-size: 13px; }
  body.mfx-page-tag-edit #main .account-row .form-check { margin: 0; font-size: 12px; }
  body.mfx-page-tag-edit #main .card-body > .btn-primary { width: 100%; }
  body.mfx-page-tag-edit #main .col-lg-10 > .mb-2 { margin-bottom: 16px !important; }

  /* Accounts use the same left edge and heading as the other five screens. */
  body.mfx-mobile-unified #main .chart-index { width: 100%; padding: 0; margin: 0; }
  body.mfx-mobile-unified #main .chart-index .app-header { margin: 0 0 16px; gap: 12px; }
  body.mfx-mobile-unified #main .chart-index .accounts-eyebrow { display: none; }
  body.mfx-mobile-unified #main .chart-index .accounts-intro { font-size: 13px; line-height: 1.65; margin-top: 8px; }
  body.mfx-mobile-unified #main .chart-index .app-subtitle { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
  body.mfx-mobile-unified #main .chart-index .totals-card { padding: 0; }
  body.mfx-mobile-unified #main .chart-index .totals-card__primary { padding: 16px; background: #fff; }
  body.mfx-mobile-unified #main .chart-index .totals-card__primary .value { font-size: 16px; font-weight: 400; line-height: 1.5; color: var(--mfx-text); }
  body.mfx-mobile-unified #main .chart-index .totals-card__primary p { font-size: 12px; margin: 10px 0 0; }
  body.mfx-mobile-unified #main .chart-index .totals-card__item { padding: 16px 18px; }
  body.mfx-mobile-unified #main .chart-index .totals-card__item .value { font-size: 14px; font-weight: 400; }
  body.mfx-mobile-unified #main .chart-index .accounts-section-heading { margin: 24px 0 12px; }
  body.mfx-mobile-unified #main .chart-index .accounts-section-heading h2 { font-size: 13px; font-weight: 400; }
  body.mfx-mobile-unified #main .chart-index .accounts-section-heading h2 span { font-size: 13px; }
  body.mfx-mobile-unified #main .chart-index .acc-card__accno { font-size: 13px; font-weight: 400; }
  body.mfx-mobile-unified #main .chart-index .acc-metric .value { font-size: 13px; font-weight: 400; }
  body.mfx-mobile-unified #main .chart-index .acc-metric--equity .value { font-size: 14px; color: var(--mfx-text); }
  body.mfx-mobile-unified #main .chart-index .acc-card { padding: 18px; margin-bottom: 0 !important; }
  body.mfx-mobile-unified #main .chart-index .accounts-list { gap: 16px; }

  /* Portfolio title is outside the card, matching the other page titles. */
  body.mfx-mobile-unified #main .chart-portfolio { width: 100%; max-width: none; margin: 0; padding: 18px; }
  body.mfx-mobile-unified #main .chart-portfolio__period { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 20px; }
  body.mfx-mobile-unified #main .chart-portfolio__period label { grid-column: 1 / -1; font-size: 13px; color: var(--mfx-text-2); }
  body.mfx-mobile-unified #main .chart-portfolio__period button { background: #f0f5ff; color: #2457b7; border: 1px solid #cbdaf6; }
  body.mfx-mobile-unified #main .chart-portfolio #total-revenue { font-size: 16px; line-height: 1.5; }
  body.mfx-mobile-unified #main .chart-portfolio #total-revenue strong { font-weight: 400; }
  body.mfx-mobile-unified #main .chart-portfolio .form-check-label { font-size: 13px; font-weight: 400; }
  body.mfx-mobile-unified #main .chart-portfolio__visual.is-empty { min-height: 0; padding: 20px 0; }
  body.mfx-mobile-unified #main .chart-portfolio__empty { margin: 0; padding: 8px; font-size: 13px; }
  body.mfx-mobile-unified #main .chart-portfolio .form-check { margin: 0 0 16px; padding: 12px; }
  body.mfx-mobile-unified #main .chart-portfolio .revenue-table th { font-size: 11px; }
  body.mfx-mobile-unified #main .chart-portfolio .revenue-table td { font-size: 13px; }
  body.mfx-mobile-unified #main .chart-portfolio .revenue-table th,
  body.mfx-mobile-unified #main .chart-portfolio .revenue-table td { padding: 12px 4px; }

  /* MT4 plug-in cards inherit the same rhythm without changing key handling. */
  body.mfx-mobile-unified #main .mfx-mt4-pad { padding: 18px; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-lead { font-size: 13px; line-height: 1.75; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-eyebrow { font-size: 11px; margin-bottom: 8px; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-key { gap: 10px; margin-top: 16px; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-note { font-size: 12px; line-height: 1.7; }
  body.mfx-mobile-unified #main .mfx-mt4-page details.mfx-mt4-card summary { padding: 16px 18px; font-size: 14px; font-weight: 600; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-steps p { font-size: 13px; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-account strong { font-size: 14px; font-weight: 600; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-steps { padding: 0 18px 18px; }
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-account { padding: 16px 18px; }
  /* Quiet typography: structure and spacing, rather than bold text, distinguish sections. */
  body.mfx-mobile-unified #main .revenue-table td,
  body.mfx-mobile-unified #main .revenue-table td * { font-weight: 400 !important; }
  /* Heading, amount and control emphasis comes from ui-refinement.css. */
  body.mfx-mobile-unified #main :is(.form-label,.user-info-item .value,.table td,.accounts-intro,.chart-portfolio__empty,.chart-portfolio__period label,.form-check-label,.mfx-mt4-lead,.mfx-mt4-steps p) { font-size: 12px; }
  body.mfx-page-mypage #main .list-unstyled div.small { font-size: 12px; line-height: 1.7; }
  body.mfx-mobile-unified #main .chart-index .app-subtitle strong { font-size: 13px; }
  body.mfx-mobile-unified #main .mfx-mt4-page details.mfx-mt4-card summary,
  body.mfx-mobile-unified #main .mfx-mt4-page .mfx-mt4-account strong { font-size: 13px; }
  body.mfx-mobile-unified #mfx-bottom-nav { padding: 6px 0 max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #e5eaf2; }
  body.mfx-mobile-unified #mfx-bottom-nav .mfx-nav-item { min-height: 48px; padding: 4px 0; gap: 4px; }
  body.mfx-mobile-unified #mfx-bottom-nav .mfx-nav-label { font-size: 10px; line-height: 1.4; }
  body.mfx-mobile-unified #footer.footer { margin: 0; padding: 16px; font-size: 12px; }
}
