/* Scoped navigation refinement. Existing routes, collapse, dropdowns and animations remain intact. */
body.ys .xg-nav-refresh .yinse-nav {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
    padding: 14px 18px !important;
    border-radius: 24px !important;
}
body.ys .xg-nav-refresh .yinse-brand-wrap {
    flex: 0 1 210px !important;
    width: auto !important;
    min-width: 0;
}
body.ys .xg-nav-refresh .yinse-brand { gap: 11px !important; min-width: 0; }
body.ys .xg-nav-refresh .yinse-brand-mark { width: 44px !important; height: 44px !important; flex: 0 0 44px; }
body.ys .xg-nav-refresh .yinse-brand-chip { padding: 0 5px !important; min-width: 0; }
body.ys .xg-nav-refresh .yinse-brand-name { font-size: 17px !important; white-space: nowrap; }
body.ys .xg-nav-refresh .yinse-nav-main {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border-top: 0 !important;
    padding-top: 0 !important;
    min-width: 0;
}
body.ys .xg-nav-refresh .yinse-nav-links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 5px !important;
    border: 1px solid rgba(124, 176, 210, .18);
    border-radius: 19px;
    background: rgba(255, 255, 255, .30);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
body.ys .xg-nav-refresh .yinse-nav-links .nav-item { width: auto !important; margin: 0 !important; }
body.ys .xg-nav-refresh .yinse-nav-link,
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button,
body.ys .xg-nav-refresh .yinse-language-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.25 !important;
    white-space: nowrap;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
body.ys .xg-nav-refresh .yinse-nav-link:not(:hover):not(.is-active) {
    border-color: transparent !important;
    background: transparent !important;
    color: #38556d !important;
    box-shadow: none !important;
}
body.ys .xg-nav-refresh .yinse-nav-link.is-active:not(:hover) {
    border-color: rgba(201, 170, 106, .66) !important;
    background: linear-gradient(135deg, #1f3c58, #346b92) !important;
    color: #fff8e9 !important;
    box-shadow: 0 4px 11px rgba(30, 72, 105, .18), inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}
body.ys .xg-nav-refresh .yinse-nav-link > i,
body.ys .xg-nav-refresh .yinse-nav-link > .yinse-nav-icon,
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button > i {
    flex: 0 0 18px;
    width: 18px;
    font-size: 16px;
    text-align: center;
}
body.ys .xg-nav-refresh .yinse-nav-tools {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    margin: 0 0 0 auto !important;
    padding-left: 14px;
    gap: 10px !important;
    border-left: 1px solid rgba(111, 153, 188, .22);
    flex: 0 0 auto;
}
body.ys .xg-nav-refresh .yinse-auth-actions { display: flex !important; width: auto !important; gap: 8px !important; }
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button { width: auto !important; min-width: 80px; }
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button-light:not(:hover) {
    border-color: rgba(96, 146, 182, .30) !important;
    background: rgba(255, 255, 255, .65) !important;
    color: #254c6d !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8) !important;
}
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button-dark:not(:hover) {
    padding-inline: 16px !important;
    border-color: rgba(206, 175, 112, .70) !important;
    background: linear-gradient(135deg, #203950, #3a7197) !important;
    color: #fff8e9 !important;
    box-shadow: 0 5px 14px rgba(30, 72, 105, .17), inset 0 1px 0 rgba(255, 255, 255, .17) !important;
}
body.ys .xg-nav-refresh .yinse-language-trigger { min-width: 60px; padding-inline: 10px !important; }
body.ys .xg-nav-refresh .yinse-nav-link:hover,
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button:hover { transform: translateY(-2px); }
body.ys .xg-nav-refresh .yinse-nav-link:active,
body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button:active { transform: translateY(0); }
body.ys .xg-nav-refresh :is(.yinse-nav-link, .yinse-button, .yinse-language-trigger, .yinse-nav-toggle):focus-visible {
    outline: 3px solid #bd9752 !important;
    outline-offset: 3px;
}
body.ys .xg-nav-refresh .yinse-nav-toggle { width: 44px !important; height: 44px !important; flex: 0 0 44px !important; border-radius: 14px !important; }
@media (min-width: 1200px) {
    body.ys .xg-nav-refresh .yinse-nav { flex-wrap: nowrap !important; }
    body.ys .xg-nav-refresh .navbar-collapse { flex: 1 1 auto !important; min-width: 0; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    body.ys .xg-nav-refresh .yinse-nav { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 12px !important; }
    body.ys .xg-nav-refresh .yinse-brand-wrap { grid-row: 1; grid-column: 1; width: auto !important; }
    body.ys .xg-nav-refresh .navbar-collapse,
    body.ys .xg-nav-refresh .yinse-nav-main { display: contents !important; }
    body.ys .xg-nav-refresh .yinse-nav-links { grid-row: 2; grid-column: 1 / -1; width: 100% !important; }
    body.ys .xg-nav-refresh .yinse-nav-tools { grid-row: 1; grid-column: 2; border-left: 0; padding-left: 0; }
}
@media (max-width: 767px) {
    body.ys .xg-nav-refresh .yinse-nav { flex-wrap: wrap !important; gap: 0 !important; padding: 13px !important; border-radius: 22px !important; }
    body.ys .xg-nav-refresh .yinse-brand-wrap { width: 100% !important; flex: 1 1 100% !important; }
    body.ys .xg-nav-refresh .yinse-brand-name { font-size: 16px !important; }
    body.ys .xg-nav-refresh .navbar-collapse { width: 100% !important; margin-top: 0 !important; }
    body.ys .xg-nav-refresh .yinse-nav-main { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; padding-top: 15px !important; }
    body.ys .xg-nav-refresh .yinse-nav-links { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100% !important; gap: 7px !important; padding: 7px !important; border-radius: 18px; }
    body.ys .xg-nav-refresh .yinse-nav-links .nav-item { min-width: 0; }
    body.ys .xg-nav-refresh .yinse-nav-link { width: 100% !important; min-height: 48px !important; justify-content: flex-start !important; padding-inline: 12px !important; font-size: 14px !important; }
    body.ys .xg-nav-refresh .yinse-nav-link:not(:hover):not(.is-active) { background: rgba(255, 255, 255, .48) !important; }
    body.ys .xg-nav-refresh .yinse-nav-tools { width: 100% !important; margin: 0 !important; padding: 12px 0 0; border-left: 0; border-top: 1px solid rgba(111, 153, 188, .20); gap: 9px !important; }
    body.ys .xg-nav-refresh .yinse-auth-actions { flex: 1 1 auto; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px !important; }
    body.ys .xg-nav-refresh .yinse-auth-actions .yinse-button { width: 100% !important; min-width: 0; min-height: 46px !important; font-size: 13px !important; padding-inline: 8px !important; }
    body.ys .xg-nav-refresh .yinse-user-dropdown { flex: 1 1 auto; min-width: 0; }
    body.ys .xg-nav-refresh .yinse-language-trigger { min-width: 54px; }
}
/* Keep the same compact rhythm after signing in. */
body.ys .xg-nav-refresh .yinse-user-chip { min-height: 44px !important; max-width: 210px; border-radius: 14px !important; }
body.ys .xg-nav-refresh .yinse-user-avatar { width: 32px !important; height: 32px !important; }
body.ys .xg-nav-refresh .yinse-user-meta { min-width: 0; }
body.ys .xg-nav-refresh .yinse-user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
