/* =============================================================================
   App loading screen + button/link busy spinners
   -----------------------------------------------------------------------------
   #app-loader covers the viewport with the same dark tone as <body> and shows a
   spinner while the app boots. It is hidden the instant <body> gets `loaded`
   (added by /js/app-boot.js from DOMContentLoaded/load/pageshow + a watchdog),
   so it can never get stuck — replacing the old indefinite grey screen.
   ============================================================================ */
#app-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #24252b;
    z-index: 400000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

body.loaded #app-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loader-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ffffff;
    animation: app-spin 0.8s linear infinite;
}

@keyframes app-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Busy state for buttons (form submit) and links (e.g. logout): the label/icon
   is hidden and a centered spinner is shown; further clicks are blocked. Driven
   by the `is-loading` class toggled in app-boot.js. */
.is-loading {
    position: relative !important;
    pointer-events: none;
    cursor: default;
}

.is-loading > * {
    visibility: hidden !important;
}

.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    animation: app-spin 0.7s linear infinite;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .app-loader-spinner,
    .is-loading::after {
        animation-duration: 1.6s;
    }

    #app-loader {
        transition: none;
    }
}

.login {
    background-image:
        linear-gradient(90deg, rgba(26, 27, 33, 0.88) 0%, rgba(26, 27, 33, 0.78) 45%, rgba(26, 27, 33, 0.86) 100%),
        url("/img/bg/ICulaz.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.page-login #page-header .site-logo {
    display: none;
}

.page-login .login-bg {
    width: min(410px, 34vw);
    opacity: 0.48;
    top: 7%;
    left: 6%;
}

.page-login .login-bg img {
    /* removed: old-logo override (content:url MClogo-bijeli.png) that hid the new <img> src logo */
    transform: translateZ(0);
}

.app-page #page-header.header-app .site-logo {
    width: 230px;
}

@media screen and (max-width: 1200px) {
    .app-page #page-header.header-app .site-logo {
        width: 180px;
    }
}

/* App header — tidy the greeting / language / bell cluster.
   The base sheet leaves .header-options as a plain flex row and nudges the
   "Pozdrav …" text down with a margin-top so it roughly lines up with the HRV
   button and the bell — but text, button and icon still land on three slightly
   different heights, which is what reads as "off". Center the row properly and
   drop the nudge so all three share one baseline with even spacing. Scoped to
   the app header so the login header is untouched. */
#page-header.header-app .header-options {
    align-items: center;
    gap: 4px;
}

#page-header.header-app .header-options p {
    margin-top: 0;
    margin-bottom: 0;
}

#page-header.header-app .header-nav {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

#page-header.header-app .header-nav li {
    display: inline-flex;
    align-items: center;
}

/* Idea 2 — narrow-screen header on one row.
   Base sheet floats the logo, absolutely pins the hamburger top-right and lets
   the whole .header-options block wrap onto a second line, which reads as
   clumsy. Here (<=1000px, where the hamburger appears) the header becomes a
   single flex row: logo left, then HRV + bell + hamburger right, all
   vertically centred. The "Pozdrav …" greeting drops onto its own full-width
   second row (and is hidden on very narrow phones — see below). */
@media screen and (max-width: 1000px) {
    #page-header.header-app > .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    #page-header.header-app .site-logo {
        order: 1;
        margin-right: auto; /* pushes the icon cluster + hamburger to the right */
        left: 0;
        top: 0;
    }

    /* Dissolve the wrapper so the greeting and the HRV/bell list become direct
       flex children of the header row and can be ordered independently. */
    #page-header.header-app .header-options {
        display: contents;
    }

    #page-header.header-app .header-nav {
        order: 2;
    }

    /* Hamburger joins the flow (relative, not absolute) so it lines up with the
       logo and icons. It MUST stay positioned — its animated bars (.btn-inner)
       anchor to it; position:static would reparent them to the header. */
    #page-header.header-app .menu-btn {
        order: 3;
        position: relative;
        top: auto;
        right: auto;
        margin-left: 16px;
    }

    /* Greeting wraps onto a full-width second row, right-aligned under the icons. */
    #page-header.header-app .header-options p {
        order: 4;
        flex-basis: 100%;
        width: 100%;
        margin: 6px 0 0;
        text-align: right;
    }
}

/* Very narrow phones: drop the greeting entirely to keep the header clean. */
@media screen and (max-width: 480px) {
    #page-header.header-app .header-options p {
        display: none;
    }
}

.registration-panel {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* Password policy hint on Settings → Change password. Rules are server-rendered
   from Inka's Application record so users see only the constraints that
   actually apply (no false "must contain a digit" hint if the policy doesn't
   require it). Styled as a compact bullet list under the New Password input. */
.password-policy-hint {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #2d77ab;
    border-radius: 6px;
}

.password-policy-list {
    list-style: disc inside;
    margin: 0;
    padding-left: 4px;
    color: #c7c7cc;
    font-size: 13px;
    line-height: 1.7;
}

.password-policy-list li {
    padding: 0;
}

/* Password strength meter (zxcvbn): colour-only bar on password-set pages. data-score
   0-4 fills + colours the bar (green at >= 3 = the server's accept threshold). Track bg
   is theme-aware (dark auth reset + light/dark Settings); the red/amber/green bar colours
   read fine on both. */
.pw-strength {
    height: 6px;
    margin-top: 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.2s ease, background-color 0.2s ease;
}
.pw-strength[data-score="0"] .pw-strength-bar { width: 20%;  background: #e5484d; }
.pw-strength[data-score="1"] .pw-strength-bar { width: 40%;  background: #e5484d; }
.pw-strength[data-score="2"] .pw-strength-bar { width: 60%;  background: #f5a623; }
.pw-strength[data-score="3"] .pw-strength-bar { width: 80%;  background: #3dd68c; }
.pw-strength[data-score="4"] .pw-strength-bar { width: 100%; background: #30a46c; }
html[data-theme="light"] .pw-strength { background: rgba(0, 0, 0, 0.1); }

.registration-copy h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.registration-copy p {
    color: #c7c7cc;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 14px;
}

.registration-link {
    display: block;
}

.login-inner .col-1 .login-quote {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 18px;
    max-width: 560px;
}

.login-inner .col-1 .login-copy {
    max-width: 560px;
}

.main-layout .portfolio-title-select.dk-select,
.main-layout select.portfolio-title-select,
.main-layout .portfolio-title-select.custom-select {
    width: 360px;
    max-width: min(360px, calc(100vw - 40px));
}

.main-layout .portfolio-title-select .dk-selected,
.main-layout .portfolio-title-select .dk-option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-layout .portfolio-title-select .dk-selected {
    padding-right: 48px;
}

.portfolio-summary-only .values-widget {
    min-height: 280px;
}

.portfolio-summary-only .values-widget .currency-status {
    flex-wrap: wrap;
}

.empty-value {
    color: #89898d;
}

.trade-side {
    min-width: 28px;
    text-align: center;
    font-weight: 900;
}

.trade-side-buy {
    color: #7bd47c;
}

.trade-side-sell {
    color: #d75360;
}

.transaction-portfolio-filter {
    flex: 1 1 360px;
    min-width: 280px;
}

.transaction-portfolio-filter .dk-select,
.transaction-portfolio-filter .custom-select,
.transaction-portfolio-filter select.transaction-portfolio-select {
    width: 100%;
    min-width: 280px;
    max-width: 520px;
}

.transaction-portfolio-filter .dk-selected,
.transaction-portfolio-filter .dk-option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-layout .button.button-disabled,
.main-layout .button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.widget-support .support-status {
    color: #fff;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 24px;
    padding: 12px 14px;
}

.widget-support .support-form {
    display: grid;
    gap: 20px;
}

.widget-support .support-form textarea {
    color: #fff;
    min-height: 92px;
    line-height: 1.5;
    opacity: 1;
}

.widget-support .support-form textarea:disabled {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.72);
    cursor: not-allowed;
}

.widget-support .support-form .btn-3:disabled {
    background: rgba(255, 255, 255, 0.72);
    color: #2d77ab;
    cursor: not-allowed;
}

.pwa-install-prompt[hidden],
.pwa-install-card[hidden],
.pwa-install-modal[hidden] {
    display: none !important;
}

.pwa-install-prompt {
    bottom: 22px;
    max-width: 380px;
    position: fixed;
    right: 22px;
    width: calc(100vw - 44px);
    z-index: 300000;
}

.pwa-install-card {
    align-items: center;
    background: rgba(44, 45, 52, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
    display: flex;
    gap: 14px;
    padding: 14px;
}

.pwa-install-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.pwa-install-copy strong {
    color: #fff;
    display: block;
    font-size: 14px;
    font-weight: 900;
    line-height: 18px;
    margin-bottom: 4px;
}

.pwa-install-copy span {
    color: #c7c7cc;
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
}

.pwa-install-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.pwa-install-primary,
.pwa-install-dismiss,
.pwa-install-modal-close {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0;
}

.pwa-install-primary {
    background: #2d77ab;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    line-height: 16px;
    margin: 0;
    min-width: 92px;
    padding: 10px 14px;
}

.pwa-install-primary:hover {
    background: #379fe8;
}

.pwa-install-dismiss,
.pwa-install-modal-close {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    font-size: 22px;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 34px;
}

.pwa-install-dismiss:hover,
.pwa-install-modal-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.pwa-install-modal {
    align-items: center;
    background: rgba(18, 19, 23, 0.74);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 300002;
}

.pwa-install-dialog {
    background: #2c2d34;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
    color: #fff;
    max-width: 420px;
    padding: 24px;
    position: relative;
    width: 100%;
}

.pwa-install-dialog h4 {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    line-height: 26px;
    margin-bottom: 10px;
    padding-right: 40px;
}

.pwa-install-dialog p,
.pwa-install-dialog li {
    color: #c7c7cc;
    font-size: 13px;
    font-weight: 700;
    line-height: 19px;
}

.pwa-install-dialog p {
    margin-bottom: 16px;
}

.pwa-install-dialog ol {
    counter-reset: pwa-install-step;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.pwa-install-dialog li {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.pwa-install-dialog li::before {
    align-items: center;
    background: #2d77ab;
    border-radius: 50%;
    color: #fff;
    content: counter(pwa-install-step);
    counter-increment: pwa-install-step;
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 12px;
    font-weight: 900;
    height: 22px;
    justify-content: center;
    line-height: 22px;
    width: 22px;
}

.pwa-ios-share-hint {
    align-items: center;
    background: rgba(55, 159, 232, 0.12);
    border: 1px solid rgba(55, 159, 232, 0.35);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px 14px;
}

.pwa-ios-share-hint-icon {
    color: #379fe8;
    flex: 0 0 auto;
    height: 34px;
    width: 34px;
}

.pwa-ios-share-hint-label {
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 18px;
}

.pwa-ios-location {
    color: #c7c7cc;
}

/* Gentle attention pulse on the Share icon; only when the user hasn't asked for
   reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .pwa-ios-share-hint-icon {
        animation: pwa-ios-share-pulse 1.8s ease-in-out infinite;
    }
}

@keyframes pwa-ios-share-pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.6;
        transform: translateY(-3px);
    }
}

.pwa-install-modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
}

/* Non-Safari iOS branch: "open in Safari" note under the Copy-link button. */
.pwa-ios-copy-hint {
    margin-top: 14px !important;
    font-size: 13px;
    color: #9a9aa2;
}

[data-pwa-ios-other] .pwa-install-primary {
    margin-top: 4px;
}

body.pwa-install-modal-open {
    overflow: hidden;
}

@media screen and (max-width: 600px) {
    /* Settings tabs (Promijeni lozinku / Postavke 2FA / Passkeys) — the base
       sheet forces every .widget-nav.style-2 li to 50% width with float:left,
       producing a 2-column grid where the third tab lands awkwardly by itself
       on a second row (see iPhone 13-ish screenshot of my.inter.capital
       Settings). Stack them one-per-row on narrow viewports; float:none clears
       the row layout so each tab is its own line. */
    .widget-nav.style-2 li {
        width: 100%;
        float: none;
    }

    /* Compact vertical spacing between the stacked tabs so we don't push the
       actual form (change-password / 2FA toggle / passkey list) further down
       the screen than necessary. */
    .widget-nav.style-2 li + li {
        margin-top: 4px;
    }

    .registration-panel {
        margin-top: 18px;
        padding-top: 18px;
    }

    .transaction-portfolio-filter {
        flex-basis: 100%;
        min-width: 100%;
    }

    .transaction-portfolio-filter .dk-select,
    .transaction-portfolio-filter .custom-select,
    .transaction-portfolio-filter select.transaction-portfolio-select {
        min-width: 100%;
        max-width: 100%;
    }

    .main-layout .portfolio-title-select.dk-select,
    .main-layout select.portfolio-title-select,
    .main-layout .portfolio-title-select.custom-select {
        width: 100%;
        max-width: 100%;
    }

    /* On narrow viewports the base sheet keeps .login-bg absolutely positioned
       at the top of .login-inner, but .login-inner's own top padding is only
       22vw. That padding was tuned assuming the ~500px absolute logo would fit
       in that gap; at real mobile widths the logo is taller than the padding
       and the quote paragraph renders on top of it (see mobile screenshot of
       my.inter.capital). Flipping the logo into normal flow (position:relative)
       makes it consume real vertical space so everything below — quote, copy,
       login form — flows underneath without overlap. */
    .page-login .login-bg {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: min(280px, 60vw);
        /* Left-lean instead of dead-center so the logo's right edge stays
           clear of the HRV/SLO/ENG culture selector pinned to the top-right
           corner of #page-header. `margin-right: auto` on its own would
           center; combining with a small explicit left margin pulls the
           logo left without touching the language switcher. */
        margin: 0 auto 24px 4%;
        opacity: 0.6;
    }

    /* With the logo now taking flow, .login-inner no longer needs the huge
       22vw top-padding safety margin. A modest header gap looks less empty. */
    .page-login .login-inner {
        padding-top: 32px;
    }

    .app-page #page-header.header-app .site-logo {
        width: 140px;
    }

    .login-inner .col-1 .login-quote {
        font-size: 13px;
        line-height: 1.55;
        margin-bottom: 14px;
    }

    .pwa-install-prompt {
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        max-width: none;
        right: 12px;
        width: auto;
    }

    .pwa-install-card {
        align-items: flex-start;
        display: block;
    }

    .pwa-install-copy {
        margin-bottom: 12px;
    }

    .pwa-install-actions {
        justify-content: space-between;
    }

    .pwa-install-primary {
        flex: 1 1 auto;
    }
}

/* ---- Traffic & Transactions filter row: even, readable spacing ----
   The base .fg-inner uses justify-content:space-between, which pushed each
   label far from its own control and left lopsided gaps. Hug labels to their
   controls and space the filter groups evenly, on both filter forms. */
.main-layout .filter-widget .transaction-filter-form .filter-grid {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px 28px;
}

.main-layout .filter-widget .transaction-filter-form .fg-inner {
    justify-content: flex-start;
    gap: 10px;
}

/* Keep the currency / portfolio dropdown a sensible width instead of stretching. */
.main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter {
    flex: 0 1 auto;
    min-width: 0;
}

.main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter .dk-select,
.main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter .custom-select,
.main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter select {
    width: 260px;
    min-width: 220px;
    max-width: 320px;
}

/* With even gaps the search button no longer needs the large left margin. */
.main-layout .filter-widget .transaction-filter-form .button {
    margin-left: 8px;
}

/* Center all app data tables consistently: Pozicije, Transakcije, Traffic. */
.main-layout .table-widget table th,
.main-layout .table-widget table td,
.main-layout .table-widget table td:not(:first-child),
.main-layout .table-widget table thead td,
.main-layout .table-widget table thead td:not(:first-child),
.main-layout .table-widget table tbody td,
.main-layout .table-widget table tbody td:not(:first-child),
.main-layout .table-widget .positions-inka-table td.position-text-cell {
    text-align: center !important;
}

.main-layout .table-widget table .sorter,
.main-layout .table-widget table thead td:not(:first-child) .sorter,
.main-layout .table-widget .positions-inka-table td.position-text-cell .sorter {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    text-align: center !important;
    width: max-content !important;
}

.main-layout .table-widget table tbody .t-inner,
.main-layout .table-widget table tbody td .t-inner,
.main-layout .table-widget .positions-inka-table tbody td .t-inner,
.main-layout .table-widget .positions-inka-table .position-number,
.main-layout .table-widget .positions-inka-table .position-text,
.main-layout .table-widget .transactions-table .t-inner,
.main-layout .table-widget .traffic-table .t-inner {
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center !important;
}

/* Page-size selector rendered next to the pagination widget by
   DOM.Methods.pagination when a view opts in via data-page-size-options. */
.page-size-selector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    color: #b7b8bf;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}
.page-size-selector .page-size-label {
    white-space: nowrap;
}
.page-size-selector .page-size-select {
    background-color: #36373D;
    color: #fff;
    border: 1px solid #89898D;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    cursor: pointer;
}
.page-size-selector .page-size-select:focus {
    outline: none;
    border-color: #b7b8bf;
}

/* Sidebar "Security settings" + "Logout" buttons: left-align them so the icons
   stack in a single column and each label sits directly to the right of its
   icon. Overrides the template's centered .logout (which also offset the icon
   with a stray margin-bottom / top:3px). */
.sidenav .sidenav-block .logout {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 8px;
    text-align: left;
}

/* Label fills the remaining width; justified so the wrapped "Sigurnosne
   postavke" spreads evenly across the button width. */
.sidenav .sidenav-block .logout .logout-label {
    flex: 1 1 auto;
    text-align: justify;
    text-justify: inter-word;
}

/* PWA "Install" button in Settings sits on the blue .widget-support card, where
   `.widget-support .btn-3` forces a white background (overriding .color-2) and
   `.btn-3 span` keeps white text -> white-on-white / invisible. Match the
   Customer-support button below it: white bg + blue label, inverting on hover. */
.widget-support [data-pwa-settings-install] {
    background: #fff;
}
.widget-support [data-pwa-settings-install] span {
    color: #2d77ab;
}
.widget-support [data-pwa-settings-install]:hover span {
    color: #fff;
}

/* Mobile: keep the portfolio switcher visible + full width on all three data
   tabs. Positions uses the title-frame select; Transactions/Traffic use the
   in-filter select. On narrow screens the fixed-width dropdowns could overflow
   off-canvas and read as "missing". */
@media screen and (max-width: 767px) {
    .main-layout .page-title-frame .portfolio-title-select.custom-select,
    .main-layout .page-title-frame select.portfolio-title-select,
    .main-layout .page-title-frame .portfolio-title-select.dk-select {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 8px;
    }

    .main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter,
    .main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter .dk-select,
    .main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter .custom-select,
    .main-layout .filter-widget .transaction-filter-form .transaction-portfolio-filter select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

.sidenav .sidenav-block .logout i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
}

.sidenav .sidenav-block .logout svg {
    margin: 0;
    top: 0;
    flex: 0 0 auto;
}

/* Thin divider between the two stacked buttons. */
.sidenav .sidenav-block .logout + .logout {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* "New version available" toast (see /js/app-update.js). Fixed bottom-centre,
   above everything, honouring the iOS safe-area. Slides up on show. */
.app-update-toast {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom));
    transform: translate(-50%, 24px);
    z-index: 300010;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 28px);
    padding: 12px 12px 12px 18px;
    background: rgba(44, 45, 52, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, transform 250ms ease, visibility 250ms ease;
}

.app-update-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.app-update-toast-text {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.app-update-toast-refresh {
    flex: 0 0 auto;
    border: 0;
    border-radius: 6px;
    background: #2d77ab;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    padding: 9px 16px;
    cursor: pointer;
}

.app-update-toast-refresh:hover {
    background: #379fe8;
}

.app-update-toast-dismiss {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.app-update-toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.18);
}

@media screen and (max-width: 480px) {
    .app-update-toast {
        left: 12px;
        right: 12px;
        transform: translateY(24px);
        max-width: none;
    }

    .app-update-toast.is-visible {
        transform: translateY(0);
    }
}

/* Promet info notice (empty result / range-limited). Calm, non-alarming card
   — distinct from the red .traffic-error — so "nothing found" reads as a normal
   state, not a failure. */
.traffic-notice {
    margin: 8px 0 4px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid #2d77ab;
    border-radius: 6px;
    color: #c7c7cc;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

/* ---- Mobile slide-in nav: make it scrollable ----
   At <=1000px .sidenav becomes a fixed, full-height off-canvas overlay holding
   the main nav (Pozicije / Transakcije / Promet ...) plus the Settings/Logout
   block. The base sheet gives .nav-wrap a *fixed* height (calc(100vh - 200px),
   min-height 300px) and sets no overflow anywhere, so on short viewports —
   most importantly landscape phones — a menu taller than the screen runs past
   the bottom edge with no way to reach the lower entries. As more nav items
   get added this only gets worse.

   Fix: let the overlay itself scroll vertically, and let .nav-wrap grow with
   its content (height:auto) while still filling the panel on tall/portrait
   screens via min-height. The Settings/Logout block scrolls along with it. */
@media screen and (max-width: 1000px) {
    .sidenav {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidenav .nav-wrap {
        height: auto;
        min-height: calc(100vh - 200px);
    }
}

/* ---- Positions table live-refresh flash ----
   The Pozicije table quietly re-fetches every 30s (see Portfolios.cshtml). To
   signal that fresh data just landed, we pulse a translucent wash + ring over
   the whole table for ~0.9s: green when the portfolio's total value rose, red
   when it fell, and a soft white pulse when the refresh brought no change.
   The overlay is a pointer-events:none ::after so it never blocks clicks or
   sorting, and it lives inside the table box so it scrolls with the (wide)
   table rather than the viewport. Colours match the app's gain/loss palette
   (green #7bd47c, red #d75360). */
.positions-inka-table.positions-refresh-flash {
    position: relative;
}

.positions-inka-table.positions-refresh-flash::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    border-radius: 6px;
    opacity: 0;
    background: var(--pos-flash-bg, transparent);
    box-shadow: var(--pos-flash-ring, none);
}

.positions-inka-table.positions-refresh-flash-up {
    --pos-flash-bg: rgba(123, 212, 124, 0.22);
    --pos-flash-ring: inset 0 0 0 2px rgba(123, 212, 124, 0.75);
}

.positions-inka-table.positions-refresh-flash-down {
    --pos-flash-bg: rgba(215, 83, 96, 0.22);
    --pos-flash-ring: inset 0 0 0 2px rgba(215, 83, 96, 0.75);
}

.positions-inka-table.positions-refresh-flash-none {
    --pos-flash-bg: rgba(255, 255, 255, 0.14);
    --pos-flash-ring: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* Only animate when the user hasn't asked for reduced motion (matches the
   PWA share-hint pulse convention above). */
@media (prefers-reduced-motion: no-preference) {
    .positions-inka-table.positions-refresh-flash::after {
        animation: positions-refresh-flash-anim 900ms ease-out;
    }
}

/* Reduced motion: still confirm the refresh, but with a single gentle,
   shorter fade and no ring shadow build-up. */
@media (prefers-reduced-motion: reduce) {
    .positions-inka-table.positions-refresh-flash::after {
        box-shadow: none;
        animation: positions-refresh-flash-anim 500ms ease-out;
    }
}

@keyframes positions-refresh-flash-anim {
    0% {
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* ------------------------------------------------------------------------
   Notifications panel: hide the native (chunky) scrollbars. The custom
   optiscroll bar (.optiscroll-v) is enough; an empty list was showing both
   native horizontal + vertical scrollbars. Horizontal is killed outright.
   ------------------------------------------------------------------------ */
.notifications-list-wrap,
.notifications-list-wrap .optiscroll-content {
    overflow-x: hidden !important;
    scrollbar-width: none;            /* Firefox */
    -ms-overflow-style: none;         /* legacy Edge */
}
.notifications-list-wrap::-webkit-scrollbar,
.notifications-list-wrap .optiscroll-content::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none;                    /* Chromium / Edge / Safari */
}

/* Header greeting ("Pozdrav X!") wrapped to a second row once the header gets
   cramped (hamburger mode). Hide it there so the header stays on one row; it
   still shows on wide desktop. */
@media (max-width: 1000px) {
    .header-options .header-greeting { display: none !important; }
}


/* The culture dropdown's <li> (HRV/ENG/SLO) are DESCENDANTS of .header-nav, so they
   inherited the header's item separators (.header-nav li:not(:last-child){border-right:...})
   and the header item padding (.header-nav li{padding:0 10px}). That showed as stray vertical
   lines inside the opened dropdown (one per non-last item). Reset them here. */
.culture-menu li { display: block !important; border: 0 !important; padding: 0 !important; }
