/* pnlhub: the only stylesheet of the site besides Bootstrap (views/base.html).
   Sections: tokens, base, header and navigation, layout, panels, buttons and forms, filter, tables, charts,
   pages (overview, balance, settings, enter, landing, documents), modals, loading. */

/* --- tokens ---------------------------------------------------------------------------------------------- */
:root, [data-bs-theme="dark"] {
    --bg: #0c1015;
    --surface: #151b23;
    --surface-2: #1c242e;
    --surface-3: #25303c;
    --line: #26303b;
    --line-strong: #3a4754;
    --text: #e8eef5;
    --text-2: #b3bfcc;
    --muted: #7f8c9b;
    --accent: #22d3ee;
    --accent-hover: #5ae0f4;
    --accent-soft: rgba(34, 211, 238, .12);
    --accent-line: rgba(34, 211, 238, .45);
    --pos: #34c77b;
    --pos-soft: rgba(52, 199, 123, .13);
    --neg: #f2646f;
    --neg-soft: rgba(242, 100, 111, .13);
    --warn: #f5b942;
    --warn-soft: rgba(245, 185, 66, .13);
    --icon-bg: #dfe6ee; /* behind coin icons: some of them are black */
    --radius: 14px;
    --radius-s: 9px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -16px rgba(0, 0, 0, .6);

    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text-2);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-secondary-bg: var(--surface-3);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-s);
    --bs-link-color: var(--accent);
    --bs-link-hover-color: var(--accent-hover);
    --bs-link-color-rgb: 34, 211, 238;
    --bs-link-hover-color-rgb: 90, 224, 244;
    --bs-heading-color: var(--text);
}

/* --- base ------------------------------------------------------------------------------------------------ */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-right: 0 !important;  /* Bootstrap modals must not shift the page */
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .9375rem;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { letter-spacing: -.01em; font-weight: 650; }
a { text-decoration: none; }
hr { border-color: var(--line); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(34, 211, 238, .3); }

.icon { flex-shrink: 0; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.text-green, .is-green, .side-green { color: var(--pos) !important; }
.text-red, .is-red, .side-red { color: var(--neg) !important; }
.text-orange, .side-orange { color: var(--warn) !important; }
.empty-asset-hidden { display: none !important; }
.disabled { pointer-events: none; opacity: .65; }

.exch-logo { flex-shrink: 0; width: 1.5rem; height: 1.5rem; padding: 2px; border-radius: 50%; object-fit: contain;
    background: #f4f6f8; }  /* a light tile: several logos are black */
.exch-logo-lg { width: 2.25rem; height: 2.25rem; padding: 4px; }

/* --- header and navigation ------------------------------------------------------------------------------- */
.container-app { width: 100%; max-width: 1560px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }

.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.app-header-row { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; }
.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; }
.header-link { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border: 0;
    border-radius: var(--radius-s); background: none; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.header-link:hover, .header-link[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }
.header-link.selected { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; min-width: 0; }
.avatar { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent); }
#headerUserName { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 50rem;
    background: var(--bg); }
.segmented button { padding: .15rem .7rem; border: 0; border-radius: 50rem; background: none; color: var(--muted);
    font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--accent); }

.dropdown-menu { --bs-dropdown-bg: var(--surface-2); --bs-dropdown-border-color: var(--line-strong);
    --bs-dropdown-link-color: var(--text-2); --bs-dropdown-link-hover-bg: var(--surface-3);
    --bs-dropdown-link-active-bg: var(--surface-3); min-width: 13rem; padding: .35rem; box-shadow: var(--shadow); }
.dropdown-item { display: flex; align-items: center; gap: .6rem; border-radius: 6px; padding: .4rem .6rem; }
.dropdown-uid { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .25rem .6rem; color: var(--muted); font-size: .75rem; }

.sub-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.sub-header-list { display: flex; gap: .25rem; margin: 0; padding-top: 0; padding-bottom: 0; list-style: none;
    overflow-x: auto; scrollbar-width: none; }
.sub-header-list::-webkit-scrollbar { display: none; }
.sub-header-list-item { padding: .45rem 0; border-bottom: 2px solid transparent; }
.sub-header-list-item.selected { border-bottom-color: var(--accent); }
.sub-header-link { display: flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border: 0;
    border-radius: var(--radius-s); background: none; color: var(--muted); font-weight: 550; white-space: nowrap;
    cursor: pointer; }
.sub-header-link:hover { color: var(--text); background: var(--surface-2); }
.sub-header-list-item.selected .sub-header-link { color: var(--text); }
.sub-header-list-item.selected .icon { color: var(--accent); }
.tabs { margin-bottom: 1rem; border-bottom: 1px solid var(--line); }

/* --- layout ---------------------------------------------------------------------------------------------- */
.app-main { flex: 1 0 auto; padding-top: 1.5rem; padding-bottom: 2.5rem; }
.page-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 860px) {
    .page-split { grid-template-columns: 290px minmax(0, 1fr); }
    .page-split.is-wide-side { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
}
.stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.narrow { width: 100%; max-width: 1120px; margin: 0 auto; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.page-title { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.35rem; }
.page-title-note { color: var(--muted); font-size: .8rem; font-weight: 500; }

.app-footer { border-top: 1px solid var(--line); padding: 1.75rem 0 1.5rem; font-size: .85rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem 4rem; align-items: flex-start; }
.footer-grid > :first-child { margin-right: auto; }
.footer-title { margin-bottom: .4rem; color: var(--text); font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; }
.app-footer a { color: var(--text-2); }
.app-footer a:hover { color: var(--accent); }
.social { display: flex; gap: .5rem; margin-top: .6rem; }
.social a { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--line);
    border-radius: 50%; }
.social a:hover { border-color: var(--accent-line); }

/* --- panels ---------------------------------------------------------------------------------------------- */
.panel { min-width: 0; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow); }
.panel-flush { padding: .5rem; }
.panel-title { margin: 0 0 .75rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; }
.panel-heading { display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem; font-size: 1.05rem; }
.panel-heading .icon { color: var(--accent); }

.stat-list { margin: 0; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .22rem 0; }
.stat-row dt { color: var(--muted); font-weight: 400; }
.stat-row dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere; }
.stat-group + .stat-group { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.stat-group-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
    margin-bottom: .2rem; color: var(--text); font-weight: 650; }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat-tile { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); }
.stat-tile-value { color: var(--text); font-size: 1.5rem; font-weight: 650; line-height: 1.25;
    overflow-wrap: anywhere; }
.stat-tile-label { color: var(--muted); font-size: .8rem; }

.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border: 1px solid var(--line);
    border-radius: 50rem; background: var(--surface-2); color: var(--text-2); font-size: .78rem; white-space: nowrap; }
a.chip:hover { border-color: var(--accent-line); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 3.5rem 1.5rem;
    border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-2); text-align: center; }
.empty-state > .icon { width: 3rem; height: 3rem; padding: .75rem; border-radius: 50%; background: var(--accent-soft);
    color: var(--accent); stroke-width: 1.75; }

.notice { display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .9rem; border: 1px solid
    rgba(245, 185, 66, .35); border-radius: var(--radius-s); background: var(--warn-soft); color: var(--text-2);
    font-size: .875rem; }
.notice .icon { margin-top: .15rem; color: var(--warn); }

.collapse-toggle { display: flex; justify-content: space-between; align-items: center; gap: .75rem; width: 100%;
    padding: .75rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    color: var(--text); font-weight: 600; }
.collapse-toggle:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.collapse-toggle > .icon { transition: transform .2s; }
.collapse-toggle[aria-expanded="false"] > .icon { transform: rotate(-90deg); }
.collapse-body { margin-top: .6rem; }

.pnlhub-badge { display: inline-block; padding: .22em .6em; border-radius: 50rem; font-size: .92em; font-weight: 700;
    line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pnlhub-badge-green { color: var(--pos); background: var(--pos-soft); }
.pnlhub-badge-red { color: var(--neg); background: var(--neg-soft); }
.pnlhub-badge-orange { color: var(--warn); background: var(--warn-soft); }

.status { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 50rem;
    font-size: .75rem; font-weight: 700; white-space: nowrap; }
.status::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--pos); background: var(--pos-soft); }
.status-bad { color: var(--neg); background: var(--neg-soft); }
.status-wait { color: var(--warn); background: var(--warn-soft); }

/* --- buttons and forms ----------------------------------------------------------------------------------- */
.pnlhub-button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .42rem 1rem;
    border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface-2);
    color: var(--text); font-size: .875rem; font-weight: 600; line-height: 1.35; text-decoration: none;
    white-space: nowrap; cursor: pointer; user-select: none; transition: background-color .12s, border-color .12s,
    color .12s; }
.pnlhub-button:hover { border-color: var(--accent-line); background: var(--surface-3); color: var(--text); }
.pnlhub-button:disabled { opacity: .55; cursor: default; }
.pnlhub-button.is-primary { border-color: var(--accent); background: var(--accent); color: #05252b; }
.pnlhub-button.is-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #05252b; }
.pnlhub-button.is-danger { border-color: rgba(242, 100, 111, .5); background: var(--neg-soft); color: #ffd7da; }
.pnlhub-button.btn-sm { padding: .25rem .65rem; font-size: .8rem; }
.pnlhub-button.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }

.icon-button { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0;
    border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--surface-3); color: var(--accent); }
.icon-button.is-danger:hover { color: var(--neg); }
.icon-button.is-small { width: 1.4rem; height: 1.4rem; }
.copied { color: var(--accent) !important; }

.form-control, .form-select { border-color: var(--line-strong); background-color: var(--bg); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--accent); background-color: var(--bg); color: var(--text);
    box-shadow: 0 0 0 3px var(--accent-soft); }
.form-control[readonly] { background-color: var(--surface-2); color: var(--muted); }
.form-control::placeholder { color: var(--muted); }
.form-label { color: var(--text-2); font-size: .85rem; font-weight: 550; margin-bottom: .3rem; }
.form-check-input { border-color: var(--line-strong); background-color: var(--bg); }
.form-check-input:checked, .form-check-input[type="checkbox"]:indeterminate { border-color: var(--accent);
    background-color: #0e9ab0; }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: .9rem; }
.input-action { display: flex; gap: .5rem; }
.input-action .form-control { min-width: 0; }
.form-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .75rem; }

/* --- main filter (views/ui_elements/main_filter.html) ----------------------------------------------------- */
.main-filter { display: flex; flex-direction: column; gap: .6rem; }
/* the buttons stay visible while the form is on the screen */
.filter-actions { position: sticky; top: 0; z-index: 20; display: flex; gap: .5rem; padding: .25rem 0;
    background: var(--bg); }
.filter-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filter-section-toggle { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; color: var(--text);
    font-weight: 600; }
.filter-section-toggle:hover { color: var(--text); }
.filter-section-toggle .counter { margin-left: auto; }
.filter-section-toggle > .icon:last-child { color: var(--muted); transition: transform .2s; }
.filter-section-toggle[aria-expanded="false"] > .icon:last-child { transform: rotate(-90deg); }
.filter-section-body { padding: 0 .6rem .6rem; }
.counter { display: inline-block; min-width: 1.6rem; padding: .1rem .5rem; border-radius: 50rem;
    background: var(--surface-3); color: var(--text-2); font-size: .75rem; font-weight: 700; text-align: center;
    font-variant-numeric: tabular-nums; }

/* long lists scroll inside the form; the height leaves the header and the controls above on the screen */
.filter-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent; }
.filter-scroll-keys { max-height: calc(100vh - 360px); min-height: 0; }
.filter-scroll-markets { max-height: calc(100vh - 400px); padding: 0 .4rem 0 .15rem; }
@media (max-height: 600px), (max-width: 859px) {
    .filter-scroll-keys, .filter-scroll-markets { max-height: 16rem; }
}

.filter-key { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .3rem .5rem; border-radius: 7px;
    cursor: pointer; }
.filter-key:hover { background-color: var(--surface-2); }
.filter-key:has(input:checked) { background-color: var(--accent-soft); }
.main-filter .filter-key .form-check-input, .main-filter .filter-group-header .form-check-input {
    flex-shrink: 0; float: none; margin: 0; width: 1.1em; height: 1.1em; cursor: pointer; }
.filter-key input:checked ~ .filter-key-name { color: var(--accent); }
.filter-key-name { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-key-kind { flex-shrink: 0; font-size: .68rem; padding: 0 .4rem; border: 1px solid var(--line-strong);
    border-radius: 50rem; color: var(--muted); }
.filter-key-inactive { opacity: .5; }
.filter-key-all { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: .25rem; }

.filter-group-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .55rem;
    margin-bottom: 2px; padding: 0 .5rem; border-radius: 7px; background-color: var(--surface-2); }
.filter-group-toggle { display: flex; flex-grow: 1; align-items: center; gap: .55rem; padding: .35rem 0; border: 0;
    background: none; color: var(--text); }
.filter-group-toggle .exch-logo, .filter-key-logo { width: 1.25rem; height: 1.25rem; }
.filter-group-title { font-weight: 600; }
.filter-group-count { margin-left: auto; font-size: .78rem; color: var(--muted); }
.filter-group-toggle .icon { transition: transform .15s; }
.filter-group-body { margin-bottom: .35rem; }
.filter-group .filter-key-logo { display: none; }  /* the logo is in the header of the group */
.filter-group.is-collapsed .filter-group-toggle .icon { transform: rotate(-90deg); }
/* while searching, the found keys of the collapsed groups are shown too */
[data-keys]:not(.is-searching) .filter-group.is-collapsed .filter-group-body { display: none; }
[data-keys].is-flat .filter-group { display: none; }

.market-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 1.75rem; }
.market-item .icon { color: var(--muted); }
.market-account { margin: .6rem 0 .25rem; }

.filter-time { padding: .75rem; }
.filter-time-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.filter-time-row label { width: 2.5rem; color: var(--muted); font-size: .8rem; }
.filter-periods { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }

/* --- tables ---------------------------------------------------------------------------------------------- */
.table-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow); overflow-x: auto; }
.data-table { --bs-table-bg: transparent; --bs-table-color: var(--text-2); --bs-table-border-color: var(--line);
    width: 100%; margin: 0; font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.data-table > :not(caption) > * > * { padding: .45rem .75rem; border-bottom: 1px solid var(--line);
    vertical-align: middle; }
.data-table > thead > tr > th { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; white-space: nowrap; background: var(--surface-2); }
.data-table > tbody > tr:last-child > * { border-bottom: 0; }
.data-table > tbody > tr:hover > * { background: rgba(255, 255, 255, .035); color: var(--text); }
.data-table tr[data-expand-row], .data-table tr[data-toggle-row] { cursor: pointer; }
.data-table .expanded-row > td { padding: .5rem; background: var(--bg); }
.data-table-inner { font-size: .76rem; }
.cell-break { overflow-wrap: anywhere; }
.coin { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 600; }
.coin img { width: 20px; height: 20px; border-radius: 50%; background: var(--icon-bg); }
.side-pill { display: inline-block; min-width: 3.2rem; padding: .08rem .45rem; border-radius: 5px; font-size: .72rem;
    font-weight: 700; text-align: center; }
.side-pill.is-green { background: var(--pos-soft); }
.side-pill.is-red { background: var(--neg-soft); }

/* DataTables (static/js/site-1.js initDataTables) */
div.dataTables_wrapper { min-width: 0; }
.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.dt-toolbar label { display: flex; align-items: center; gap: .45rem; margin: 0; color: var(--muted); font-size: .8rem; }
.dt-toolbar select, .dt-toolbar input { padding: .25rem .55rem; border: 1px solid var(--line-strong);
    border-radius: 7px; background: var(--surface); color: var(--text); }
.dt-toolbar .dataTables_filter { margin-left: auto; }
.dt-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem;
    margin-top: .6rem; color: var(--muted); font-size: .8rem; }
.dataTables_paginate { display: flex; flex-wrap: wrap; gap: .25rem; }
.dataTables_paginate span { display: contents; }
.paginate_button { min-width: 2rem; padding: .25rem .6rem; border: 1px solid transparent; border-radius: 7px;
    color: var(--text-2); text-align: center; cursor: pointer; user-select: none; }
.paginate_button:hover { background: var(--surface-2); color: var(--text); }
.paginate_button.current { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.paginate_button.disabled { opacity: .35; }
table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc { cursor: pointer; }
table.dataTable thead > tr > th.sorting::after { content: '↕'; margin-left: .35rem; opacity: .35; }
table.dataTable thead > tr > th.sorting_asc::after { content: '↑'; margin-left: .35rem; color: var(--accent); }
table.dataTable thead > tr > th.sorting_desc::after { content: '↓'; margin-left: .35rem; color: var(--accent); }
table.dataTable td.dataTables_empty { text-align: center; color: var(--muted); }

/* settings tables (not DataTables) */
.pnlhub-table { --bs-table-bg: transparent; --bs-table-color: var(--text-2); --bs-table-border-color: var(--line);
    margin: 0; font-size: .85rem; }
.pnlhub-table > :not(caption) > * > * { padding: .55rem .6rem; vertical-align: middle; }
.pnlhub-table > thead > tr > th { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; white-space: nowrap; }
.pnlhub-table > tbody > tr:hover > * { background: rgba(255, 255, 255, .035); }
.pnlhub-table > tbody > tr:last-child > * { border-bottom: 0; }

/* --- charts (static/js/charts.js) ------------------------------------------------------------------------ */
.chart { position: relative; width: 100%; min-width: 0; }
.chart:not(.is-ready)::after { content: ''; position: absolute; top: 50%; left: 50%; width: 1.75rem; height: 1.75rem;
    margin: -.875rem 0 0 -.875rem; border: 3px solid var(--accent-line); border-right-color: transparent;
    border-radius: 50%; animation: pnlhub-spin .75s linear infinite; }
.chart.is-failed::after { content: 'The chart could not be loaded'; inset: 45% 0 auto 0; width: auto; height: auto;
    margin: 0; border: 0; animation: none; color: var(--muted); text-align: center; }
.chart-panel { padding: .75rem; }
.highcharts-menu { padding: .35rem !important; border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-s) !important; background: var(--surface-2) !important; }
.highcharts-menu-item { border-radius: 6px; color: var(--text-2) !important; }
.highcharts-menu-item:hover { background: var(--surface-3) !important; color: var(--text) !important; }
.highcharts-credits { display: none; }
.highcharts-data-table { max-height: 24rem; margin-top: .75rem; overflow: auto; }
.highcharts-data-table table { width: 100%; font-size: .78rem; font-variant-numeric: tabular-nums; }
.highcharts-data-table th, .highcharts-data-table td { padding: .3rem .6rem; border-bottom: 1px solid var(--line); }
.chart-legend-item { display: inline-flex; align-items: center; gap: .45rem; min-width: 9.5rem; color: var(--text-2);
    font-weight: 500; font-variant-numeric: tabular-nums; }
.chart-legend-item i { width: .6rem; height: .6rem; border-radius: 3px; }
.chart-legend-item img { width: 18px; height: 18px; border-radius: 50%; background: var(--icon-bg); }
.chart-legend-item b { margin-left: auto; color: var(--text); font-weight: 600; }
.legend-note { display: flex; align-items: flex-start; gap: .55rem; margin-top: .4rem; font-size: .82rem; }
.legend-note i { flex-shrink: 0; width: .75rem; height: .75rem; margin-top: .25rem; border-radius: 3px; }

/* --- overview -------------------------------------------------------------------------------------------- */
.hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.hero-toggle { display: flex; align-items: center; gap: .75rem; padding: 0; border: 0; background: none;
    color: inherit; text-align: left; }
.hero-toggle .icon { color: var(--muted); }
.hero-toggle:hover .icon { color: var(--accent); }
.hero-value { color: var(--text); font-size: clamp(1.9rem, 5vw, 2.75rem); font-weight: 700; line-height: 1.1;
    letter-spacing: -.02em; }
.hero-unit { margin-left: .25rem; color: var(--muted); font-size: .9rem; font-weight: 600; letter-spacing: 0; }
.delta-list { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; color: var(--muted);
    font-size: .8rem; text-align: right; }

.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: .75rem;
    align-items: start; }
.key-card { --state: var(--pos); position: relative; min-width: 0; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
    transition: border-color .15s; }
.key-card:hover { border-color: var(--line-strong); }
.key-card::before { content: ''; position: absolute; inset: .85rem auto .85rem -1px; width: 3px; border-radius: 3px;
    background: var(--state); }
.key-card.is-bad { --state: var(--neg); }
.key-card.is-checking { --state: var(--warn); }
.key-card-body { padding: .8rem 1rem; }
.key-card-head { display: flex; align-items: center; gap: .6rem; }
.key-card-name { flex-grow: 1; min-width: 0; overflow: hidden; color: var(--text); font-weight: 600;
    text-overflow: ellipsis; white-space: nowrap; }
.sortable-grab { cursor: grab; touch-action: none; }
.key-card-balance { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.6rem;
    margin: .35rem 0; }
.key-card-value { color: var(--text); font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em;
    overflow-wrap: anywhere; }
.key-card-value small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.key-card-links { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 1.65rem; }
.key-card-details { padding: .75rem 1rem; border-top: 1px solid var(--line); }
.key-card-details .delta-list { align-items: flex-start; text-align: left; }

.add-card { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .85rem;
    border: 1px dashed var(--line-strong); border-radius: var(--radius); background: none; color: var(--text-2);
    font-weight: 600; }
.add-card:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.coins-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 1100px) { .coins-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
#overviewCoins:empty { display: none; }

/* --- balance tracking ------------------------------------------------------------------------------------ */
.total-value { color: var(--text); font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.wallet + .wallet { margin-top: 1rem; }
.wallet-head { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; padding: 0 .5rem;
    color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.asset-row { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem .5rem; border-radius: 7px;
    color: var(--text-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
a.asset-row:hover { background: var(--surface-2); color: var(--text); }
.asset-row.is-active { background: var(--accent-soft); color: var(--accent); }
body:has(#emptyAssetsSwitcher:checked) .empty-asset { display: none !important; }
.chart-table { max-height: 28rem; overflow: auto; }
.chart-table .data-table > thead > tr > th { position: sticky; top: 0; z-index: 1; }

/* --- settings -------------------------------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (min-width: 992px) { .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.table-scroll { overflow-x: auto; }
.table-scroll > .pnlhub-table { min-width: 640px; }
.table-scroll > .pnlhub-table.is-wide { min-width: 960px; }
.key-mask { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.tip { position: relative; display: inline-grid; place-items: center; color: var(--muted); cursor: help; }
.tip-text { position: absolute; top: -.4rem; right: calc(100% + .4rem); z-index: 30; display: none; width: 15rem;
    padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
    background: var(--surface-3); color: var(--text); font-size: .75rem; text-align: left; white-space: normal;
    overflow-wrap: anywhere; box-shadow: var(--shadow); }
.tip:hover .tip-text, .tip:focus .tip-text { display: block; }
.current-value { margin-bottom: .9rem; color: var(--text); overflow-wrap: anywhere; }
.current-value span { display: block; color: var(--muted); font-size: .75rem; }

/* --- sign in --------------------------------------------------------------------------------------------- */
.auth { width: 100%; max-width: 440px; margin: 1.5rem auto 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 1rem; padding: 4px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.auth-tabs .nav-link { border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 650; }
.auth-tabs .nav-link:hover { color: var(--text); }
.auth-tabs .nav-link.active { background: var(--surface-3); color: var(--text); }
.auth .panel { padding: 1.5rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0; color: var(--muted);
    font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth-note { margin-top: 1rem; color: var(--muted); font-size: .75rem; text-align: center; }
.grecaptcha-badge { visibility: hidden; }

/* --- landing --------------------------------------------------------------------------------------------- */
.landing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center;
    padding: clamp(1rem, 5vw, 4rem) 0; }
@media (min-width: 992px) { .landing { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.landing h1 { margin-bottom: 1rem; font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.03em; }
.landing h1 span { color: var(--accent); }
.landing p { max-width: 34rem; font-size: 1.1rem; }
.landing-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.landing-art { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 20px;
    background: radial-gradient(120% 90% at 90% 0%, rgba(34, 211, 238, .14), transparent 60%), var(--surface); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .75rem; }
.feature .icon { width: 2.4rem; height: 2.4rem; margin-bottom: .75rem; padding: .55rem; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent); }
.feature h2 { margin-bottom: .3rem; font-size: 1rem; }
.feature p { margin: 0; font-size: .875rem; }
.exchanges { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.75rem; margin-top: 2.5rem;
    padding: 1.5rem 0 0; list-style: none; }
.exchanges li { display: flex; align-items: center; gap: .6rem; color: var(--text); font-size: 1.15rem;
    font-weight: 650; }

/* --- documents (privacy, terms, release notes, docs) ------------------------------------------------------ */
.prose { width: 100%; max-width: 860px; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem); line-height: 1.7;
    overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-bottom: 1.25rem; font-size: 1.75rem; }
.prose h3 { margin: 1.75rem 0 .6rem; font-size: 1.15rem; }
.prose h4 { margin: 1.75rem 0 .6rem; font-size: 1.05rem; }
.prose b, .prose strong { color: var(--text); }
.prose pre { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-s);
    background: var(--bg); color: var(--text-2); white-space: pre-wrap; }
.release-notes [id^="v-"] { flex-wrap: wrap; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.release-notes [id^="v-"] h3 { margin: 0; }
.release-notes .badge { background: var(--accent-soft); color: var(--accent); font-size: .75rem !important; }
.docs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 860px) { .docs-layout { grid-template-columns: 240px minmax(0, 1fr); } }
.docs-layout .prose { max-width: none; margin: 0; }
ul.type-alpha { list-style: lower-alpha; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 860px) { .docs-nav { position: sticky; top: 1rem; } }
.docs-nav a { padding: .4rem .65rem; border-radius: 7px; color: var(--text-2); }
.docs-nav a:hover { background: var(--surface-2); color: var(--accent); }
@media (max-width: 859px) { .docs-nav.is-versions { flex-direction: row; flex-wrap: wrap; } }

/* --- admin ----------------------------------------------------------------------------------------------- */
.log-output { height: 420px; overflow: auto; background: var(--bg); }
.log-output pre { font-size: .78rem; white-space: pre-wrap; }
.admin-scroll { max-height: 460px; }

/* --- modals ---------------------------------------------------------------------------------------------- */
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--line-strong);
    --bs-modal-border-radius: 16px; --bs-modal-header-border-color: var(--line);
    --bs-modal-footer-border-color: var(--line); --bs-modal-header-border-width: 1px;
    --bs-modal-footer-border-width: 1px; }
.modal-title { font-size: 1.1rem; }
.modal-footer { gap: .5rem; }
#modal .htmx-indicator { width: 1.5rem; height: 1.5rem; }
.hint { color: var(--muted); font-size: .8rem; }
.api-key-form .passphrase-row { display: none; }
.api-key-form:has(option[data-passphrase]:checked) .passphrase-row, .api-key-form .passphrase-row.shown { display: flex; }
.notification-form:has(#notifPortfolio:checked) .not-for-portfolio { display: none; }

/* --- cookies consent ------------------------------------------------------------------------------------- */
.cookie-box { position: fixed; right: 1rem; bottom: 1rem; left: 1rem; z-index: 1040; display: flex;
    justify-content: flex-end; pointer-events: none; }
.cookie-box .toast { --bs-toast-bg: var(--surface-2); --bs-toast-border-color: var(--line-strong);
    width: 100%; max-width: 26rem; pointer-events: auto; box-shadow: var(--shadow); }

/* --- loading animations (static/js/site-1.js) ------------------------------------------------------------ */
@keyframes pnlhub-spin { to { transform: rotate(360deg); } }
@keyframes pnlhub-appear { from { opacity: 0; } to { opacity: 1; } }

.pnlhub-progress { position: fixed; top: 0; right: 0; left: 0; z-index: 2000; height: 3px; pointer-events: none; }
.pnlhub-progress-bar { height: 100%; background: var(--accent); box-shadow: 0 0 8px var(--accent);
    transition: width .6s ease; }

/* the button that started an htmx request */
.is-busy { position: relative; pointer-events: none; color: transparent !important; }
.is-busy > * { visibility: hidden; }
.is-busy::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 1rem; height: 1rem; margin: -.5rem 0 0 -.5rem;
    border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
    animation: pnlhub-spin .75s linear infinite;
}

/* an element that is being replaced by htmx */
.is-loading { position: relative; min-height: 3rem; }
.is-loading > * { opacity: .35; transition: opacity .2s; }
.is-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem;
    border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%;
    animation: pnlhub-spin .75s linear infinite; z-index: 5;
}

/* navigation to another page: shown only if the server takes longer than .4s */
body.page-leaving main { opacity: .35; transition: opacity .3s .4s; }
body.page-leaving::after {
    content: ''; position: fixed; top: 50%; left: 50%; width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem;
    border: 4px solid var(--accent); border-right-color: transparent; border-radius: 50%; z-index: 2000;
    opacity: 0; animation: pnlhub-spin .75s linear infinite, pnlhub-appear .2s .4s forwards;
}

@media (max-width: 575px) {
    .app-header-row { gap: .5rem; }
    .brand img { height: 28px; }
    #headerUserName { display: none; }
    .app-header .header-link { padding: .4rem; }
    .app-header [data-bs-toggle="dropdown"] > .icon:last-child { display: none; }
    .delta-list { align-items: flex-start; text-align: left; }
    .stat-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* narrow screens: a row of a settings table becomes a card, the column names stand left of the values */
@media (max-width: 575px) {
    .table-scroll > .pnlhub-table.is-stacked { display: block; min-width: 0; }
    .is-stacked thead { display: none; }
    .is-stacked tbody, .is-stacked tr { display: block; }
    .is-stacked tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
    .is-stacked tr:last-child { border-bottom: 0; }
    .pnlhub-table.is-stacked td { display: block; position: relative; min-height: 1.9rem; padding: .2rem 0 .2rem 7rem;
        border: 0; overflow-wrap: anywhere; }
    .is-stacked td:empty { display: none !important; }
    .is-stacked td::before { content: attr(data-label); position: absolute; top: .3rem; left: 0; color: var(--muted);
        font-family: var(--bs-body-font-family); font-size: .78rem; font-weight: 400; }
    .pnlhub-table.is-stacked td.text-end { padding-left: 0; }
    .is-stacked .tip-text { right: auto; left: calc(100% + .4rem); width: 11rem; }
}
@media (max-width: 379px) { /* the narrowest phones: "My keys" stays as its icon */
    .app-header nav .header-link { font-size: 0; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
