:root {
    --fio-blue: #1c5a9c;
    --fio-blue-dark: #123f6e;
    --fio-green: #a3b418;
    --fio-grey: #444;
    --fio-line: #e2e2e2;
    --fio-bg: #f7f7f7;
}

body.fio {
    margin: 0;
    background-color: var(--fio-bg);
    background-image: url('../img/fio-watermark.svg');
    background-repeat: repeat;
    font-family: Arial, Helvetica, sans-serif;
    color: #222;
    font-size: 14px;
}

.fio-rule { height: 4px; background: var(--fio-green); }

.fio-topbar {
    background: #fff;
    border-bottom: 1px solid var(--fio-line);
}

.fio-topbar .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fio-wordmark {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.fio-flag { display: block; }

.fio-wordmark .text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--fio-blue);
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: -0.01em;
}

/* language dropdown */
.fio-langswitch { position: relative; }

.fio-langswitch .current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.45rem 0.9rem;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

.fio-langswitch .menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 150px;
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    z-index: 20;
    overflow: hidden;
}

.fio-langswitch:hover .menu,
.fio-langswitch:focus-within .menu { display: block; }

.fio-langswitch .menu a {
    display: block;
    padding: 0.55rem 0.9rem;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
}

.fio-langswitch .menu a:hover { background: #f2f2f2; }
.fio-langswitch .menu a.active { color: var(--fio-blue); font-weight: 700; }

.fio-subbar {
    background: #fbfbfb;
    border-bottom: 1px solid var(--fio-line);
    font-size: 0.82rem;
}

.fio-subbar .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.45rem 1.5rem;
}

.fio-subbar a { color: #888; text-decoration: none; }

.fio-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    position: relative;
}

.fio-title {
    font-size: 1.7rem;
    color: #1a1a1a;
    margin: 0.5rem 0 1.75rem;
    font-weight: 700;
    text-align: center;
}

.fio-headrow {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.fio-accountinfo p {
    margin: 0 0 0.3rem;
    font-size: 0.92rem;
}

.fio-accountinfo b { color: #111; }

.fio-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.55rem 0.9rem;
    background: #fff;
    min-width: 260px;
    color: #999;
}

.fio-search input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    background: transparent;
}

.fio-qr-block {
    text-align: center;
}

.fio-qr-block img {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto 0.4rem;
    border: 1px solid var(--fio-line);
    padding: 5px;
    background: #fff;
}

.fio-qr-block span {
    font-size: 0.72rem;
    color: #888;
    display: block;
    max-width: 140px;
}

.fio-summary-block { margin-bottom: 1.75rem; }

.fio-summary-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.fio-summary-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.fio-summary-values {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--fio-grey);
    margin-top: 0.6rem;
    font-variant-numeric: tabular-nums;
}

.fio-summary-values .pos { color: #1c7a2e; }
.fio-summary-values .neg { color: #b3261e; }

.fio-daterange {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.fio-table-card {
    background: #fff;
    border: 1px solid var(--fio-line);
    border-radius: 3px;
    overflow: hidden;
}

.fio-table-scroll {
    max-height: 65vh;
    overflow-y: auto;
}

table.fio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

table.fio-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    color: #555;
    text-align: left;
    padding: 0.6rem 0.7rem;
    font-weight: 700;
    font-size: 0.8rem;
    border-bottom: 3px solid var(--fio-green);
    z-index: 1;
}

table.fio-table th.narrow { width: 46px; }

table.fio-table tbody td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

table.fio-table tbody tr:nth-child(even) { background: #fafafa; }
table.fio-table tbody tr:hover { background: #eef4fb; }

table.fio-table .amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
table.fio-table .amount.pos { color: #1c7a2e; }
table.fio-table .amount.neg { color: #b3261e; }

.fio-message-col { white-space: normal; max-width: 240px; }

.fio-footer {
    background: #fff;
    border-top: 1px solid var(--fio-line);
    margin-top: 2rem;
}

.fio-footer .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    font-size: 0.78rem;
    color: #999;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fio-footer a { color: #999; }

.fio-disclaimer {
    max-width: 1200px;
    margin: 0.75rem auto 0;
    padding: 0 1.5rem 1.5rem;
    font-size: 0.72rem;
    color: #aaa;
}

@media (max-width: 800px) {
    .fio-headrow { flex-direction: column; }
    .fio-summary-row, .fio-summary-values { grid-template-columns: repeat(3, 1fr); row-gap: 0.75rem; }
}
