/* Strat responsive adaugat peste style.css (care rămâne neatins, ca desktop-ul
   sa arate identic cu explorerul PHP de pe cp1).
   - tabletă (<=1089px): coloanele nu se mai ascund, tabelele fac scroll orizontal
   - mobil (<=767px): fiecare rand de tabel devine un card cu etichete
   Ordinea de incarcare: style.css, apoi responsive.css. */

/* ---------------------------------------------------------------- globals */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    height: auto !important;
    min-height: 100vh;
}

img,
canvas,
video {
    max-width: 100%;
}

.mdl-layout__content {
    width: 100%;
    max-width: 100%;
}

#page-content {
    width: 100%;
    max-width: 100%;
}

.tableDiv,
.assetDiv,
.aliasDiv,
.poolsDiv,
.charts,
.charts1st,
.calcsDiv,
.rowDiv {
    max-width: 100%;
    box-sizing: border-box;
}

.mdl-data-table {
    margin-right: 0 !important;
    max-width: 100%;
}

/* bara de meniu are acum 14 butoane: le lasam sa alunece orizontal in loc sa
   impinga continutul in afara ecranului */
.mdl-button-group {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    padding-left: 8px;
    scrollbar-width: thin;
}

.mdl-button-group button {
    float: none !important;
    flex: 0 0 auto;
    font-size: 12px !important;
    padding: 0 10px !important;
}

@media screen and (max-width: 1400px) {
    .mdl-layout-title span {
        display: none !important;
    }
}

/* filtrele din pagina de tranzactii */
.txFilterBox select {
    min-width: 260px;
    max-width: 100%;
    height: 32px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-size: 12px;
}

.tbHeaderDiv {
    display: inline-block !important;
    line-height: 1.4 !important;
}

/* -------------------------------------------------------- tableta (<=1089) */

@media screen and (max-width: 1089px) {
    /* Meniul orizontal nu incape pe tableta: butoanele ieseau din ecran si se
       vedea doar o fasie. Navigarea se face din sertar (hamburger), care are
       toate cele 14 intrari. (Grupul e copil direct al .mdl-layout si avea deja
       clasa MDL large-screen-only, dar regula noastra de display:flex o anula.) */
    .mdl-button-group.mdl-layout--large-screen-only,
    .mdl-layout__header .mdl-button-group {
        display: none !important;
    }

    /* coloanele ascunse de style.css revin: mai bine scroll decat date lipsa */
    .removeMedium,
    .removeSmall,
    .removeTiny,
    .removeLarge {
        display: table-cell !important;
    }

    th.removeMedium,
    th.removeSmall,
    th.removeTiny,
    th.removeLarge {
        display: table-cell !important;
    }

    /* containerul de tabel face scroll orizontal in loc sa taie continutul */
    .tableDiv {
        display: block !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* pagina de assets: fara dropdown, lista completa sub forma de tabel */
    .dropAssets {
        display: none !important;
    }

    .assetDiv {
        display: block !important;
        overflow-x: auto;
    }

    .assetDiv > .assetScrollTable,
    .assetSide {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .assetScrollTable tbody {
        display: table-row-group !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .assetScrollTable tbody tr {
        display: table-row !important;
        height: auto !important;
    }

    .assetScrollTable tbody tr td {
        padding-top: 0 !important;
    }

    .assetSide tbody tr {
        height: auto !important;
    }

    #asset-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .mobAliasTable {
        display: none !important;
    }

    /* graficele: cate unul pe rand, full width */
    .charts1st,
    .charts,
    .poolsDiv {
        display: block !important;
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .charts1st .mdl-card,
    .charts .mdl-card,
    .poolsDiv .mdl-card {
        width: 100% !important;
        margin-bottom: 10px;
    }
}

/* --------------------------------------- tableta stricta (768 - 1089px) */

@media screen and (min-width: 768px) and (max-width: 1089px) {
    /* aici tabelele late fac scroll orizontal in loc sa se rupa */
    .tableDiv > table,
    .tableDiv .mainTable {
        width: 100%;
        min-width: 720px;
        margin-bottom: 10px;
    }
}

/* ----------------------------------------------------------- mobil (<=767) */

@media screen and (max-width: 767px) {
    /* ------- tabele ca lista de carduri ------- */
    table.resp-cards {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
        margin: 0 0 10px !important;
        background: transparent !important;
    }

    table.resp-cards > thead {
        display: none !important;
    }

    table.resp-cards > tbody {
        display: block !important;
        width: 100% !important;
    }

    table.resp-cards > tbody > tr {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        background: #fff;
        border-radius: 4px;
        margin: 0 0 8px !important;
        padding: 8px 10px !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
    }

    table.resp-cards > tbody > tr > td {
        display: flex !important;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 3px 0 !important;
        border: none !important;
        font-size: 12px !important;
        text-align: right;
        overflow-wrap: anywhere;
    }

    table.resp-cards > tbody > tr > td::before {
        content: attr(data-label);
        flex: 0 0 40%;
        text-align: left;
        font-weight: 500;
        color: #777;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .2px;
    }

    /* valoarea poate conține mai multe noduri (link + <br> + nume): le punem
       unele sub altele, nu alături, altfel se rup cuvintele în două */
    table.resp-cards > tbody > tr > td > * {
        display: block;
    }

    /* valoarea secundară (numele contului sub RS) se aliniază la dreapta și
       se vede mai mică, ca să se citească drept sub-etichetă, nu câmp nou */
    table.resp-cards > tbody > tr > td .smallNumber {
        text-align: right;
        color: #888;
    }

    table.resp-cards > tbody > tr > td > br {
        display: none;
    }

    table.resp-cards > tbody > tr > td {
        flex-wrap: wrap;
    }

    /* coloanele ascunse de style.css trebuie sa apara in card */
    table.resp-cards > tbody > tr > td.removeMedium,
    table.resp-cards > tbody > tr > td.removeSmall,
    table.resp-cards > tbody > tr > td.removeTiny,
    table.resp-cards > tbody > tr > td.removeLarge {
        display: flex !important;
    }

    /* celule fara eticheta (randuri expandate, colspan) */
    table.resp-cards > tbody > tr > td[colspan] {
        display: block !important;
        text-align: left;
    }

    table.resp-cards > tbody > tr > td[colspan]::before {
        display: none;
    }

    table.resp-cards > tbody > tr > td:empty,
    table.resp-cards > tbody > tr > td[data-label=""] {
        display: none !important;
    }

    table.resp-cards > tbody > tr.resp-empty {
        display: none !important;
    }

    /* tabelul din interiorul unui rand expandat rămâne tabel normal */
    table.resp-cards td table {
        display: table !important;
        width: 100% !important;
    }

    /* tooltip-urile de pret nu au sens pe card (valoarea e deja in text) */
    table.resp-cards .mdl-tooltip {
        display: none !important;
    }

    /* ------- tabelele "eticheta / valoare" (cont, tranzactie, bloc) ------- */
    /* nu au rand de header real, deci nu pot deveni carduri cu data-label;
       pe mobil le aranjam pe vertical: eticheta deasupra valorii */
    #page-content .tableDiv > table:not(.resp-cards),
    #page-content .scrollDiv > table:not(.resp-cards) {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
        background: #fff;
        border-radius: 4px;
        padding: 6px 10px;
        margin-bottom: 10px !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
    }

    #page-content .tableDiv > table:not(.resp-cards) > thead,
    #page-content .scrollDiv > table:not(.resp-cards) > thead {
        display: block !important;
    }

    #page-content .tableDiv > table:not(.resp-cards) > thead > tr,
    #page-content .tableDiv > table:not(.resp-cards) > tbody,
    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr,
    #page-content .scrollDiv > table:not(.resp-cards) > thead > tr,
    #page-content .scrollDiv > table:not(.resp-cards) > tbody,
    #page-content .scrollDiv > table:not(.resp-cards) > tbody > tr {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr,
    #page-content .scrollDiv > table:not(.resp-cards) > tbody > tr {
        padding: 6px 0;
        border-bottom: 1px solid #eee;
    }

    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr:last-child,
    #page-content .scrollDiv > table:not(.resp-cards) > tbody > tr:last-child {
        border-bottom: none;
    }

    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr > td,
    #page-content .scrollDiv > table:not(.resp-cards) > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        padding: 2px 0 !important;
        border: none !important;
        font-size: 12px !important;
        overflow-wrap: anywhere;
    }

    /* prima celula de tip eticheta */
    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr > td.blockThTable,
    #page-content .tableDiv > table:not(.resp-cards) > tbody > tr > td:first-child {
        font-weight: 500;
        color: #777;
        font-size: 11px !important;
        text-transform: uppercase;
        letter-spacing: .2px;
    }

    /* tabelul cu detaliile contului are deja etichete scrise: le lasam normale */
    #page-content table.slimTable > tbody > tr > td:first-child {
        font-weight: 500;
        color: #777;
        font-size: 11px !important;
        text-transform: uppercase;
    }

    /* tabelele cu o singura coloana (lista de assets) nu au nevoie de eticheta:
       continutul celulei isi explica singur randul */
    table.resp-cards.resp-single > tbody > tr > td,
    table.resp-cards.resp-single > tbody > tr > td.removeMedium,
    table.resp-cards.resp-single > tbody > tr > td.removeSmall {
        display: block !important;
        text-align: left;
    }

    table.resp-cards.resp-single > tbody > tr > td::before {
        display: none !important;
    }

    table.resp-cards.resp-single > tbody > tr > td .floatRight {
        float: right !important;
    }

    /* ------- paginare ------- */
    .tbHeaderPagination {
        float: none !important;
        display: inline-block;
        margin-top: 6px;
    }

    .mdl-paging {
        margin-left: 0 !important;
    }

    /* ------- assets: lista de assets ca lista scurta, scroll ------- */
    .assetDiv {
        display: block !important;
        overflow-x: visible !important;
    }

    table.resp-cards.assetSide {
        display: block !important;
    }

    .assetScrollTable > tbody,
    table.resp-cards > tbody.scrollShort {
        display: block !important;
        max-height: 45vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #asset-content {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px;
    }

    #asset-content .mdl-data-table {
        display: block !important;
    }

    #asset-content .mdl-data-table > tbody > tr {
        display: block !important;
        height: auto !important;
    }

    #asset-content .mdl-data-table > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    /* ------- monitor ------- */
    .realTimeInfo .mdl-card__supporting-text {
        font-size: 20px !important;
        line-height: 26px !important;
    }

    #countNext {
        width: 100% !important;
        max-width: 460px;
        zoom: .5 !important;
        margin: 0 auto;
        display: block;
    }

    .flip-clock-wrapper {
        max-width: 100%;
        text-align: center;
    }

    /* ------- calculator ------- */
    .calcsDiv {
        display: block !important;
        width: 100% !important;
    }

    .miningCard,
    .calcCard {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 12px !important;
    }

    .calcsDiv .mdl-layout-spacer {
        display: none !important;
    }

    .mdl-textfield {
        width: 100% !important;
    }

    /* ------- peers: globul nu mai ocupa tot ecranul ------- */
    #globe {
        width: 100% !important;
        height: 55vh !important;
    }

    /* daca globul 3D nu s-a randat, containerul negru nu are rost */
    /* WebGL indisponibil: pastram cutia (are fundalul cu stele) si scriem de ce */
    #globe.resp-globe-empty {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 24px !important;
    }

    /* ------- header / meniu ------- */
    .mdl-layout-title {
        margin-left: 40px !important;
        font-size: 15px !important;
    }

    /* width:auto obligatoriu: fara el, height:24px striveste logo-ul 128x30
       (raport 5.33 in loc de 4.27) si arata turtit pe verticala */
    .mdl-layout-title img {
        height: 24px;
        width: auto;
    }

    .mdl-layout__header-row {
        padding: 0 8px 0 0 !important;
    }

    .mdl-layout__drawer button {
        margin: 4px 0 !important;
        width: 100%;
    }

    /* ------- transaction / account: tabelele de tip "eticheta: valoare" ------- */
    .blockThTable {
        font-weight: 500;
        color: #777;
        font-size: 11px !important;
        text-transform: uppercase;
    }

    .longTd,
    .dateTd {
        min-width: 0 !important;
    }

    /* ------- aliases / marketplace ------- */
    .aliasDiv .rowDiv,
    .aliasDiv .mdl-textfield {
        width: 100% !important;
    }

    #good-content .mdl-card {
        width: 100% !important;
        margin: 0 0 10px !important;
    }

    .numGoods,
    .goodsTags {
        padding-left: 0 !important;
    }

    footer .floatRight {
        float: none !important;
        text-align: center;
    }
}

/* ------------------------------------------------------ f mobil (<=420px) */

@media screen and (max-width: 420px) {
    #page-content {
        padding: 6px !important;
    }

    table.resp-cards > tbody > tr > td::before {
        flex: 0 0 45%;
    }

    .realTimeInfo .mdl-card__supporting-text {
        font-size: 17px !important;
    }

    #countNext {
        zoom: .42 !important;
    }
}

/* --- reguli de card valabile la ORICE latime: clasa .resp-cards este pusa de
       responsive.js doar cand tabelul nu incape in container (tableta, ferestre inguste) --- */

table.resp-cards {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    border: none !important;
    margin: 0 0 10px !important;
    background: transparent !important;
}

/* titlul paginii si filtrele stau tot in <thead> (randuri cu colspan), deci
   nu putem ascunde thead-ul intreg - ascundem doar randul de etichete */
table.resp-cards > thead {
    display: block !important;
    width: 100% !important;
    margin-bottom: 10px;
}

/* celulele din randurile de titlu/filtru trebuie sa curga normal, altfel
   dropdown-ul de tip iese peste primul card */
table.resp-cards > thead > tr > th {
    display: block !important;
    width: auto !important;
    height: auto !important;
    white-space: normal !important;
}

table.resp-cards > thead > tr {
    display: block !important;
    width: 100% !important;
}

table.resp-cards > thead > tr:last-child {
    display: none !important;
}

table.resp-cards > tbody {
    display: block !important;
    width: 100% !important;
}

table.resp-cards > tbody > tr {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    background: #fff;
    border-radius: 4px;
    margin: 0 0 8px !important;
    padding: 8px 10px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
}

table.resp-cards > tbody > tr > td {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 3px 0 !important;
    border: none !important;
    font-size: 12px !important;
    text-align: right;
    overflow-wrap: anywhere;
}

table.resp-cards > tbody > tr > td::before {
    content: attr(data-label);
    flex: 0 0 40%;
    text-align: left;
    font-weight: 500;
    color: #777;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .2px;
}

/* valoarea poate conține mai multe noduri (link + <br> + nume): le punem
   unele sub altele, nu alături, altfel se rup cuvintele în două */
table.resp-cards > tbody > tr > td > * {
    display: block;
}

/* valoarea secundară (numele contului sub RS) se aliniază la dreapta și
   se vede mai mică, ca să se citească drept sub-etichetă, nu câmp nou */
table.resp-cards > tbody > tr > td .smallNumber {
    text-align: right;
    color: #888;
}

table.resp-cards > tbody > tr > td > br {
    display: none;
}

table.resp-cards > tbody > tr > td {
    flex-wrap: wrap;
}

/* coloanele ascunse de style.css trebuie sa apara in card */
table.resp-cards > tbody > tr > td.removeMedium,
table.resp-cards > tbody > tr > td.removeSmall,
table.resp-cards > tbody > tr > td.removeTiny,
table.resp-cards > tbody > tr > td.removeLarge {
    display: flex !important;
}

/* celule fara eticheta (randuri expandate, colspan) */
table.resp-cards > tbody > tr > td[colspan] {
    display: block !important;
    text-align: left;
}

table.resp-cards > tbody > tr > td[colspan]::before {
    display: none;
}

table.resp-cards > tbody > tr > td:empty,
table.resp-cards > tbody > tr > td[data-label=""] {
    display: none !important;
}

table.resp-cards > tbody > tr.resp-empty {
    display: none !important;
}

/* tabelul din interiorul unui rand expandat rămâne tabel normal */
table.resp-cards td table {
    display: table !important;
    width: 100% !important;
}

/* tooltip-urile de pret nu au sens pe card (valoarea e deja in text) */
table.resp-cards .mdl-tooltip {
    display: none !important;
}

table.resp-cards.resp-single > tbody > tr > td,
table.resp-cards.resp-single > tbody > tr > td.removeMedium,
table.resp-cards.resp-single > tbody > tr > td.removeSmall {
    display: block !important;
    text-align: left;
}

table.resp-cards.resp-single > tbody > tr > td::before {
    display: none !important;
}

/* ------------------------------------------------------- căutarea din header */
/* Pe ecrane mici, câmpul de căutare expandat are 300px (valoare MDL) și
   împinge tot layout-ul în dreapta: pagina se muta la stânga și conținutul
   apărea tăiat. Îl scoatem din flux și îl întindem peste header. */
@media screen and (max-width: 700px) {
    .mdl-layout__header-row {
        position: relative;
        /* fara asta, randul devine scrollabil (535px) si browserul deruleaza
           pagina in lateral ca sa aduca inputul in ecran */
        overflow: hidden;
    }

    .mdl-layout__header-row .mdl-textfield--expandable.is-focused,
    .mdl-layout__header-row .mdl-textfield--expandable.is-dirty {
        position: absolute !important;
        left: 54px;
        right: 8px;
        top: 4px;
        width: auto !important;
        z-index: 30;
        background: #eee;
        border-radius: 3px;
    }

    .mdl-layout__header-row .mdl-textfield--expandable.is-focused .mdl-textfield__expandable-holder,
    .mdl-layout__header-row .mdl-textfield--expandable.is-dirty .mdl-textfield__expandable-holder {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .mdl-layout__header-row .mdl-textfield--expandable .mdl-textfield__input {
        width: 100% !important;
    }
}

/* căutarea deschisă pe mobil: MDL nu reușește să extindă câmpul (holder-ul
   rămâne 0), așa că pornim extinderea din clasa noastră .resp-search-open */
@media screen and (max-width: 700px) {
    /* bara de căutare se deschide SUB header, pe toată lățimea: dacă stă peste
       el, acoperă hamburgerul și logo-ul */
    .mdl-layout__header-row .mdl-textfield--expandable.resp-search-open {
        position: fixed !important;
        left: 0;
        right: 0;
        top: 40px;
        width: 100% !important;
        height: 44px;
        background: #f2f2f2;
        border-bottom: 1px solid #ccc;
        box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
        padding: 6px 12px;
        z-index: 90;
    }

    /* MDL ține câmpul strâns cu max-width: .1px și îl lărgește doar la
       .is-focused; fără max-width aici, width:100% nu are efect */
    .mdl-layout__header-row .mdl-textfield--expandable.resp-search-open .mdl-textfield__expandable-holder {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        background: transparent;
    }

    .mdl-layout__header-row .mdl-textfield--expandable.resp-search-open .mdl-textfield__input {
        width: 100% !important;
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        color: #333;
        border-bottom: 1px solid #999;
    }
}

/* câmpul de căutare are 300px și când e strâns (doar iconița se vede), ceea ce
   împinge rândul header-ului peste marginea ecranului; pe mobil îl strângem
   la lățimea iconiței, iar deschiderea se face cu .resp-search-open */
@media screen and (max-width: 700px) {
    .mdl-layout__header-row .mdl-textfield--expandable:not(.resp-search-open) {
        width: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
    }
}

/* graficele de pe pagina de token: pe toată lățimea și una sub alta, ca să se
   citească (Chart.js le desena 300x150, înghesuite) */
#tokenCharts .canvasDiv {
    width: 100% !important;
    height: 280px;
    margin: 0 0 16px;
    padding: 0 8px;
    box-sizing: border-box;
}

#tokenCharts canvas {
    width: 100% !important;
    height: 280px !important;
    max-height: 280px;
}

@media screen and (max-width: 767px) {
    #tokenCharts .canvasDiv,
    #tokenCharts canvas {
        height: 220px;
    }
}

/* ------------------------------------------------ calculatoare (Mining/Price) */
/* .calcsDiv nu era flex, iar .mdl-layout-spacer ocupa spațiul: cele două carduri
   se îngrămădeau pe ~340px în stânga și restul paginii rămânea gol. */
@media screen and (min-width: 701px) {
    .calcsDiv {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 16px;
        padding: 12px 14px;
        box-sizing: border-box;
    }

    .calcsDiv .mdl-layout-spacer {
        display: none !important;
    }

    .calcsDiv .mdl-card {
        flex: 1 1 340px;
        max-width: 560px;
        min-width: 0;
        margin: 0 !important;
    }

    .calcsDiv .mdl-card canvas {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* titlurile din capul tabelelor pot fi lungi ("Top Accounts (300 ...)") și
   ieșeau din ecran pe mobil - le lăsăm să se rupă pe două rânduri */
.tbHeaderDiv,
.tbHeaderDiv span {
    white-space: normal !important;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* celulele de titlu nu trebuie să impingă tabelul peste margine */
#page-content th,
.mdl-layout__content th {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* Bara de meniu orizontală stă peste conținut, dar avea fundal transparent:
   la derulare se vedeau cifrele tabelului printre butoane. */
.mdl-button-group.mdl-layout--large-screen-only {
    background: #eeeeee;
    position: relative;
    z-index: 4;
    border-bottom: 1px solid #dcdcdc;
    /* .mdl-layout e flex column și împărțea spațiul: bara rămânea cu 7px din
       36 cât au butoanele, deci etichetele apăreau tăiate */
    flex: 0 0 auto !important;
    min-height: 36px;
}

/* În tabelele „etichetă / valoare" (cont, tranzacție, contract, bloc) pe mobil:
   eticheta stă în stânga, valoarea în dreapta. Înainte amândouă erau
   aliniate la dreapta și parcă eticheta era titlu de card. */
#page-content .tableDiv > table:not(.resp-cards) > tbody > tr > td:first-child,
#page-content .scrollDiv > table:not(.resp-cards) > tbody > tr > td:first-child {
    text-align: left !important;
    padding-right: 8px !important;
}

#page-content .tableDiv > table:not(.resp-cards) > tbody > tr > td:not(:first-child),
#page-content .scrollDiv > table:not(.resp-cards) > tbody > tr > td:not(:first-child) {
    text-align: right !important;
}

/* ============================================================
   Clasamentul pool-urilor (Blocks Per Pools, prima pagină)
   Înlocuiește rândurile colorate în stil curcubeu din PHP cu o
   listă lizibilă: loc, nume, bară de pondere, număr de blocuri, %.
   Se aplică pe toate ecranele; pe mobil se rearanjează pe două linii.
   ============================================================ */
.poolRankCard { width: 100%; }
.poolRankHead {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 6px; padding-bottom: 8px;
}
.poolRankToday {
    font-size: 12px; color: #8a8a8a; text-transform: uppercase;
    letter-spacing: .04em; margin-left: auto;
}
.poolRank { list-style: none; margin: 0; padding: 0; }

.poolRankRow {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) minmax(60px, 26%) 52px 52px;
    align-items: center;
    column-gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid #f0f0f0;
}
.poolRankRow:last-child { border-bottom: 0; }
.poolRankRow:hover { background: #fafafa; }

.poolRankPos {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: #eceff1; color: #607d8b;
    font-size: 12px; font-weight: 700;
}
.poolRankRow.isTop .poolRankPos { background: #ff4081; color: #fff; }
.poolRankRow.isTop .poolRankName { color: #d81b60; }

.poolRankName {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600; font-size: 14px; color: #37474f;
}
.poolRankBar {
    display: block; height: 6px; border-radius: 4px;
    background: #eef1f4; overflow: hidden;
}
.poolRankBar > i {
    display: block; height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #ff4081, #ff8a65);
}
.poolRankBlocks {
    text-align: right; font-weight: 700; font-size: 14px; color: #37474f;
}
.poolRankPct {
    text-align: right; font-size: 12px; color: #90a4ae; font-variant-numeric: tabular-nums;
}

/* tabletă: barele mai scurte, dar tot pe un rând */
@media (max-width: 1089px) and (min-width: 601px) {
    .poolRankRow { grid-template-columns: 26px minmax(0, 1fr) minmax(50px, 18%) 46px 46px; }
}

/* mobil: loc + nume pe prima linie, bara + blocuri + procent pe a doua */
@media (max-width: 600px) {
    .poolRankRow {
        grid-template-columns: 26px minmax(0, 1fr) auto;
        grid-template-areas:
            "pos name blocks"
            "pos bar  pct";
        row-gap: 6px;
        padding: 10px 2px;
    }
    .poolRankPos { grid-area: pos; align-self: center; }
    .poolRankName { grid-area: name; white-space: normal; overflow-wrap: anywhere; }
    .poolRankBlocks { grid-area: blocks; }
    .poolRankBar { grid-area: bar; }
    .poolRankPct { grid-area: pct; }
    .poolRankName { font-size: 13px; }
    .poolRankHead { flex-wrap: wrap; }
    .poolRankToday { margin-left: 0; width: 100%; }
}

/* Pe mobil, blocurile cu .margin5 (5px stânga/dreapta) au lățime 100% din
   părinte, deci ies 10px în afara ecranului și apare o bară de scroll
   orizontală gri sub clasament. Lățimea automată rezolvă fără să mut nimic. */
@media (max-width: 1089px) {
    .charts, .charts1st, .poolsDiv { width: auto !important; }
}

/* Culorile pool-urilor: stabilite din JS (--pool-color), ca să fie IDENTICE
   cu felia corespunzătoare din graficul pie de deasupra. */
.poolRankRow { --pool-color: #ff4081; }
.poolRankPos {
    background: var(--pool-color);
    color: #fff;
}
.poolRankRow.isTop .poolRankPos { background: var(--pool-color); }
.poolRankRow.isTop .poolRankName { color: #37474f; }
.poolRankBar > i { background: var(--pool-color); }

/* ---------------------------------------------------------------- header mobil
   Pe ecrane mici, `.vertDivider` (linia verticală de lângă căutare) separă
   căutarea de blocul de informații de piață - dar acel bloc are
   `.mdl-layout--large-screen-only`, deci pe mobil rămânea o linie fără rost,
   lipită de marginea din dreapta. Îl scoatem și dăm spațiu câmpului de căutare. */
@media (max-width: 1089px) {
    .mdl-layout__header .vertDivider { display: none !important; }
    .mdl-layout__header-row { padding-right: 14px !important; }
    .mdl-textfield--expandable { margin-right: 0 !important; }
    /* butonul de meniu ocupă 0-48px, dar style.css lasă rândul cu padding-left
       20px => logo-ul intra 8px peste buton, iar tap-ul pe marginea logo-ului
       deschidea meniul în loc să ducă la pagina principală */
    .mdl-layout__header .mdl-layout__header-row { padding-left: 56px !important; }
}

/* Meniul din sertar trebuie să poată derula pe telefoane scurte
   (14 butoane ≈ 630px; pe un ecran de 568px ultimele ar fi tăiate). */
.mdl-layout__drawer {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mdl-layout__drawer .mdl-navigation { padding: 8px 6px 16px; }

/* Căutarea din header era aliniată pentru rândul MDL de 64px, dar header-ul
   nostru e forțat la 40px (style.css) => iconița ieșea 8px sub bara neagră.
   O centrăm pe verticală în 40px: buton 32px la top 4, iconiță 24px la top 8. */
@media (max-width: 1089px) {
    .mdl-layout__header .mdl-textfield {
        height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
    }
    .mdl-layout__header .mdl-textfield > label.mdl-button {
        top: 4px !important;
    }
    /* iconița NU se poziționează manual: MDL o centrează în butonul de 32px,
       iar butonul e centrat în bara de 40px (top 4px) */
}

/* --- Paritatea SIGNA → BTC / USD / EUR (tooltip de piață) ---------------------
   MDL poziționează tooltipul „la dreapta" țintei cu left/top inline și NU îl limitează
   la viewport: pe telefon ieșea complet din ecran (41px lățime × 760px înălțime), iar
   pe tabletă/desktop acoperea valoarea sau ieșea parțial. Poziționarea o face acum
   responsive.js, clampat în ecran; aici doar aspectul.
     - .resp-tip-open = deschis de noi (hover pe desktop, tap pe touch);
     - .is-active     = clasa MDL (o neutralizăm vizual, dar o lăsăm pe telefon ca fallback). */
.mdl-tooltip.resp-tip-open {
    position: fixed !important;
    margin: 0 !important;
    width: -moz-max-content;
    width: max-content;
    min-width: 0 !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    border-radius: 8px;
    padding: 10px 12px !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    text-align: left !important;
    white-space: normal;
    /* fundal opac: peste tabel textul gri translucid era greu de citit */
    background: #2b2b2b !important;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
    z-index: 100000 !important;
}
.mdl-tooltip.resp-tip-open br { display: block; }

/* Telefon: card ancorat jos, lizibil, indiferent unde e valoarea în pagină. */
@media (max-width: 767px) {
    .mdl-tooltip.resp-tip-open,
    .mdl-tooltip.is-active {
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: 12px !important;
        width: auto !important;
        max-width: none !important;
        max-height: 45vh;
        overflow-y: auto;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        border-radius: 10px;
        padding: 12px 16px !important;
        font-size: 15px !important;
        line-height: 1.7 !important;
        text-align: left !important;
        background: #2b2b2b !important;
        color: #fff !important;
        z-index: 100000 !important;
    }
    .mdl-tooltip.resp-tip-open br,
    .mdl-tooltip.is-active br { display: block; }
    .mdl-tooltip.resp-tip-open::after {
        content: "tap anywhere to close";
        display: block;
        margin-top: 8px;
        font-size: 11px;
        opacity: .7;
    }
}

/* Banda compactă de sub header, doar pe mobil: înălțimea blocului + prețul SIGNA.
   MDL ascunde #marketSpan cu `mdl-layout--large-screen-only`, deci fără banda asta
   telefonul rămânea fără informația de piață care pe desktop e în header. */
.resp-ticker { display: none; }
@media (max-width: 767px) {
    .resp-ticker {
        display: block;
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 5px 10px;
        font-size: 11.5px;
        line-height: 1.5;
        letter-spacing: .2px;
        color: #e8e8e8;
        background: #333;
        border-bottom: 1px solid #444;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- Peers: globul 3D -----------------------------------------------------
   Înainte: width:100vw + height:calc(100vh - 120px) → placa neagră pe tot ecranul,
   fără niciun indiciu că se poate roti/zooma, iar renderer-ul se dimensiona după
   fereastră (pe telefon imaginea ieșea deformată). Acum: încadrat în container,
   înălțime limitată, colțuri rotunjite și un indiciu vizibil de interacțiune. */
.globeBox {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    padding: 0 !important;
    line-height: 0;
}
#globe {
    width: 100% !important;
    height: clamp(300px, 50vh, 520px) !important;
    max-height: 520px !important;
    background-size: cover;
    background-position: center center;
}
.globeHint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}
.globeHint .material-icons { font-size: 15px; }

@media (max-width: 767px) {
    #globe { height: 44vh !important; max-height: 380px !important; }
    .globeHint { font-size: 11px; padding: 4px 9px; bottom: 8px; }
}

/* Mesaj cand WebGL nu e disponibil: globul nu se poate desena, dar pagina ramane utila */
#globe.resp-globe-empty {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 24px !important;
}
.globeFallback {
    max-width: 520px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
#globe.resp-globe-empty .globeHint { display: none; }

/* Nota de context a marketplace-ului: o linie discreta, nu in coloana laterala */
.goodsNote {
    margin: 8px 0 10px;
    padding: 8px 12px;
    border-left: 3px solid #9e9e9e;
    background: #f5f5f5;
    color: #555;
    font-size: 12px;
    line-height: 1.5;
}
@media (max-width: 767px) {
    .goodsNote { font-size: 11.5px; padding: 7px 10px; }
}

/* --- Marketplace pe ecrane mici -------------------------------------------
   Lista de categorii are 566 rânduri și, pe telefon, împingea produsele cu câteva
   mii de pixeli în jos; cardurile aveau lățime fixă (310px) și ieșeau din ecran.
   Categoriile rămân folosibile, dar într-o casetă cu scroll. */
@media (max-width: 767px) {
    .goodSide {
        max-height: 190px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
    }
    .goodSide tbody tr td { padding: 4px 8px !important; }
    #goodsDiv { display: block !important; }
    #good-content { display: block !important; }
    #good-content .mdl-card,
    #good-content .mdl-card.goods,
    .goods {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 12px !important;
        box-sizing: border-box;
    }
    .goods .mdl-card__title-text { white-space: normal !important; }
    .goods .goodPrice { margin-right: 44px; }
}
@media (min-width: 768px) and (max-width: 1100px) {
    .goodSide { max-height: 62vh; overflow-y: auto; }
}

/* --- Marketplace: selector de sortare ------------------------------------- */
.goodsSortBox { display: inline-block; vertical-align: middle; margin: 0 8px 0 2px; }
.goodsSortBox select {
    padding: 6px 26px 6px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%23666'/></svg>") no-repeat right 8px center;
    font-size: 13px;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
@media (max-width: 767px) {
    .goodsSortBox { display: block; width: 100%; margin: 6px 0; }
    .goodsSortBox select { width: 100%; padding: 9px 28px 9px 10px; font-size: 14px; }
}

/* --- Aliases: bara de căutare --------------------------------------------- */
.aliasSearchForm { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.aliasSearchForm .material-icons { color: #777; }
.aliasSearchForm input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 13px;
}
.aliasSearchForm button { flex: 0 0 auto; }
@media (max-width: 767px) {
    .aliasSearchForm { flex-wrap: wrap; }
    .aliasSearchForm input[type="text"] { width: 100%; flex: 1 1 100%; font-size: 15px; padding: 10px; }
    .aliasSearchForm button { width: 100%; }
}

/* --- Aliases: nota explicativa (in afara tabelului, ca sa se poata impacheta) --- */
.aliasesNote {
    margin: 8px 0 10px;
    padding: 8px 12px;
    border-left: 3px solid #9e9e9e;
    background: #f5f5f5;
    color: #555;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}
/* valorile lungi (URI, chei) nu au voie sa iasa din card pe mobil */
@media (max-width: 767px) {
    .aliasesNote { font-size: 11.5px; padding: 7px 10px; }
    table.resp-cards > tbody > tr > td { word-break: break-word; overflow-wrap: anywhere; }
}

/* --- Contracte: bara de filtrare, chips de tip, nota ---------------------- */
.contToolbar { margin: 0 0 8px; }
.contSearchForm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contSearchForm .material-icons { color: #777; }
.contSearchForm input[type="text"] {
    flex: 1 1 220px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 13px;
}
.contSearchForm select {
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
}
.contClear { font-size: 12px; color: #777; text-decoration: underline; }
.contTypes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.contTypesLabel { font-size: 12px; color: #666; margin-right: 2px; }
.contTypeChip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eee;
    color: #444 !important;
    font-size: 12px;
    text-decoration: none !important;
    white-space: nowrap;
}
.contTypeChip.is-on { background: #ff4081; color: #fff !important; }
.contNote {
    margin: 8px 0 10px;
    padding: 8px 12px;
    border-left: 3px solid #9e9e9e;
    background: #f5f5f5;
    color: #555;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
}
@media (max-width: 767px) {
    .contSearchForm input[type="text"], .contSearchForm select, .contSearchForm button { width: 100%; flex: 1 1 100%; }
    .contNote { font-size: 11.5px; padding: 7px 10px; }
    .contTypes { max-height: 120px; overflow-y: auto; }
}

/* --- Top accounts: bare HTML (înlocuiesc graficul canvas) ------------------ */
/* .tableDiv e display:flex pe rând (style.css:229), deci titlul și conținutul
   stăteau unul lângă altul și barele erau înghesuite la ~470px din 1400 */
.chartBlock { display: block !important; }
.topBars { padding: 4px 10px 10px; width: 100%; box-sizing: border-box; }

/* un singur rând per adresă: #rank · adresa · (nume) · bară · procent */
.topBar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.topBar:last-child { border-bottom: 0; }
.topBarRank {
    flex: 0 0 32px;
    color: #9e9e9e !important;
    font-size: 12px;
    text-decoration: none !important;
    text-align: right;
}
.topBarAddr {
    flex: 0 0 auto;
    font-family: monospace, monospace;
    font-size: 13px;
    color: #1565c0 !important;
    text-decoration: none;
    white-space: nowrap;      /* adresa stă pe un rând, niciodată tăiată */
}
.topBarAddr:hover { text-decoration: underline; }
.topBarName {
    flex: 0 0 190px;          /* lățime FIXĂ: barele pornesc toate din acelaşi x */
    min-width: 0;
    padding-right: 6px;       /* numele nu se mai lipește de bară */
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;  /* numele lung se scurtează, adresa nu */
}
.topBarTrack {
    flex: 1 1 60px;
    min-width: 40px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}
.topBarFill {
    display: block;
    height: 100%;
    background: rgba(233,30,99,0.65);
    border-radius: 3px;
}
.topBarPct {
    flex: 0 0 62px;
    text-align: right;
    font-size: 12.5px;
    color: #444;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* sub 1100px coloana de nume se strânge, ca bara să rămână vizibilă */
@media (max-width: 1100px) {
    .topBarName { flex: 0 0 140px; }
}
@media (max-width: 900px) {
    .topBarName { flex: 0 0 110px; }
}
@media (max-width: 767px) {
    .topBar { gap: 5px; }
    .topBarRank { flex: 0 0 22px; font-size: 11px; }
    .topBarAddr { font-size: 11.5px; }
    /* numele se strânge cât să rămână bară vizibilă (~45px); adresa nu se atinge */
    .topBarName { flex: 0 0 62px; font-size: 11px; padding-right: 2px; }
    .topBarTrack { min-width: 44px; }
    .topBarPct { flex: 0 0 48px; font-size: 11px; }
}

/* --- Token: grafice SVG + bare de distribuții ----------------------------- */
#tokenCharts { display: block !important; }
#tokenCharts .chartBox {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px 8px;
}
#tokenCharts .chartSvg {
    display: block;
    width: 100%;
    height: 280px;
}
.chartEmpty {
    padding: 14px 10px;
    color: #777;
    font-size: 12.5px;
    background: #f7f7f7;
    border-radius: 4px;
}
.distBars { padding: 2px 0 4px; }
.distBar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #444;
}
.distDate { flex: 0 0 92px; color: #777; font-variant-numeric: tabular-nums; }
.distTrack { flex: 1 1 auto; min-width: 40px; height: 10px; background: #eee; border-radius: 5px; overflow: hidden; }
.distFill { display: block; height: 100%; background: rgba(95,156,199,.75); border-radius: 5px; }
.distAmount { flex: 0 0 190px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
    #tokenCharts .chartSvg { height: 220px; }
    .distBar { flex-wrap: wrap; }
    .distDate { flex: 0 0 82px; font-size: 11px; }
    .distAmount { flex: 1 1 auto; text-align: left; font-size: 11px; }
    .distTrack { flex: 1 1 100%; order: 3; }
}

.chartMeta { padding: 0 10px 6px; color: #777; font-size: 11.5px; line-height: 1.4; }


/* ---------------------------------------- homepage: cardul cu pie chart
   Așezarea rămâne cea dinainte (cele 3 coloane pe un rând). Singura problemă era
   cardul „Blocks Per Pool": canvasul primea aspect 2:1 pe lățimea coloanei, deci
   cercul avea ~122px. Acum cardul are înălțime proprie și cercul umple lățimea. */
.poolChartCard .mdl-card__supporting-text {
    height: 320px;
    padding: 6px 6px 0;
    box-sizing: border-box;
}
.poolChartCard canvas {
    width: 100% !important;
    height: 100% !important;
}
@media screen and (min-width: 1090px) {
    /* coloana de info iese din lățimea conținutului (canvasul cu width:100% o umfla
       la 466px și strângea graficele din stânga la 196px). Lățime fixă, moderată:
       cercul devine ~314px, iar cele două grafice rămân peste 420px la 1440. */
    .charts { flex: 0 1 340px; max-width: 340px; }
}
@media screen and (max-width: 767px) {
    .poolChartCard .mdl-card__supporting-text { height: 280px; }
}
