.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-w);
    background: var(--bg-2);
    border-right: 1px solid var(--line);
}
.sidebar-scroll {
    height: 100%;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 22px;
    padding: 18px 14px 28px;
}
.resize-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; }
.resize-handle::after { content: ''; position: absolute; inset: 0 3px; border-radius: var(--r-xs); transition: background .15s; }
.resize-handle:hover::after, .is-resizing .resize-handle::after { background: var(--line-2); }
.sidebar-resize { right: -4px; }

.container { margin-left: var(--sidebar-w); padding: 32px 40px 96px; min-height: 100vh; }
.card { display: none; }
.card.active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: var(--content-max); margin: 0 auto; }
.card-tab-pane { display: none; }
.card-tab-pane.active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
/* Bento rows: flex-wrap, so the items of a shorter last row stretch to fill it instead of leaving a hole. */
.grid-2 { display: flex; flex-wrap: wrap; gap: 24px; }
.grid-2 > * { flex: 1 1 340px; min-width: 0; }

.me {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: var(--r-md);
    background: var(--surface-2);
    text-align: left;
    transition: background .15s;
}
.me:hover { background: var(--surface-3); }
.me-photo { width: 48px; height: 48px; border-radius: var(--r-circle); object-fit: cover; background: var(--surface-2); }
.me-text { display: grid; min-width: 0; }
.me-name { font-size: 13px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-worth { font-size: 20px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; }
.me-gain { font-size: 13px; font-weight: 600; color: var(--muted); }

.nav { display: grid; gap: 2px; }
.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--r-pill);
    background: none;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    transition: background .15s, color .15s;
}
.nav-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-btn.active { background: var(--surface-2); color: var(--text); }
.nav-end { margin-left: auto; color: var(--faint); }

.list-section { display: grid; gap: 4px; }
.list-title { font-size: 13px; }
.list-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}
.list-toggle:hover { color: var(--text); }
.list-toggle .i { transition: transform .2s; }
.list-toggle[aria-expanded="false"] .i { transform: rotate(-90deg); }
.tabs { display: grid; gap: 6px; }
.tab-group { display: grid; gap: 2px; }
.group-title { padding: 6px 10px 2px; font-size: 12px; font-weight: 600; color: var(--faint); }
.tab-group:only-child > .group-title { display: none; }
.tab {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s;
}
.tab:hover { background-color: var(--surface-2); }
.tab.active { background-color: var(--surface-2); }
.tab.is-up .tab-change { color: var(--pos); }
.tab.is-down .tab-change { color: var(--neg); }
.tab.is-up { background-color: var(--pos-soft); }
.tab.is-down { background-color: var(--neg-soft); }
.tab.is-up:is(:hover, .active) { background-color: color-mix(in srgb, var(--pos-fill) 26%, transparent); }
.tab.is-down:is(:hover, .active) { background-color: color-mix(in srgb, var(--neg-fill) 26%, transparent); }
.tab.is-paused { opacity: .6; }
.tab-logo, .row-logo, .explorer-item-logo, .tk-logo {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}
.tab-logo { width: 34px; height: 34px; border-radius: var(--r-sm); }
.tab-logo img, .tk-logo img, .explorer-item-logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-fallback { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tab-info { display: grid; min-width: 0; }
.tab-name { font-size: 14px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active .tab-name { color: var(--text); }
.tab-sub { font-size: 12px; font-weight: 600; color: var(--faint); }
.tab-change { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.app-footer { display: grid; gap: 10px; padding: 0 10px; font-size: 12px; line-height: 1.5; color: var(--faint); }
.app-footer strong { color: var(--muted); font-weight: 600; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.legal-links a { color: var(--muted); }
