/* Cielo-style wallet dashboard */
main.container-xl { max-width: 1500px; }

.wallet-head { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 18px 24px; align-items: center; margin-bottom: 16px; }
@media (max-width: 1100px) { .wallet-head { grid-template-columns: 1fr; } }
.wallet-id { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: #0b0f17;
    background: radial-gradient(circle at 30% 30%, hsl(var(--h) 85% 72%), hsl(calc(var(--h) + 40) 70% 45%)); text-transform: uppercase; }
.wallet-title { font-size: 1.35rem; font-weight: 750; margin: 0; }
.wallet-sub { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 3px; vertical-align: middle; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 0 6px; font-size: .85rem; line-height: 1.6; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.chain-chip { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chain-chip.chain-solana { color: #c4b5fd; border-color: rgba(153, 69, 255, .5); }
.chain-chip.chain-base { color: #93c5fd; border-color: rgba(0, 82, 255, .6); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: .74rem; padding: 2px 9px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); color: #cbd5e1; }
.tag-style { color: #fde68a; border-color: rgba(245, 158, 11, .45); }
.tag-danger { color: #fca5a5; border-color: rgba(239, 68, 68, .5); }

.head-stats { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.hstat { padding: 10px 16px; border-right: 1px solid var(--line); min-width: 110px; }
.hstat:last-child { border-right: 0; }
.hstat span { display: block; color: var(--muted); font-size: .74rem; }
.hstat strong { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.hstat em { color: var(--muted); font-style: normal; font-size: .8rem; }
.hstat-score b { font-size: 1.15rem; }
.hstat-score b.score-ok { color: #4ade80; }
.hstat-score b.score-warn { color: #fbbf24; }
.hstat-score b.score-bad { color: #f87171; }
.hstat-score small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.hstat-score small.label-warn { color: #fbbf24; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; background: #334155; border-radius: 1px; }
.bars i:nth-child(1) { height: 4px; }
.bars i:nth-child(2) { height: 7px; }
.bars i:nth-child(3) { height: 10px; }
.bars i:nth-child(4) { height: 14px; }
.bars-1 i:nth-child(-n+1), .bars-2 i:nth-child(-n+2), .bars-3 i:nth-child(-n+3), .bars-4 i:nth-child(-n+4) { background: #fbbf24; }
.head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 1100px) { .head-actions { align-items: flex-start; } }
.period-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.period-tabs a { padding: 4px 12px; color: var(--muted); text-decoration: none; font-size: .82rem; }
.period-tabs a.active { background: var(--panel-2); color: var(--text); font-weight: 700; }

.dash-grid { display: grid; grid-template-columns: 1.05fr 1.25fr 1fr; gap: 14px; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-panel { padding: 16px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; }
.kv-label { color: var(--muted); font-size: .8rem; }
.kv-big { font-size: 1.55rem; font-weight: 750; letter-spacing: -.3px; }
.kv-big small { font-size: .85rem; font-weight: 600; }
.kv-mid { font-size: 1.05rem; font-weight: 700; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.cal-h { color: var(--muted); font-size: .68rem; text-align: center; }
.cal-cell { min-height: 42px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); padding: 3px 4px; display: flex; flex-direction: column; justify-content: space-between; }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.pos { background: rgba(34, 197, 94, var(--a)); border-color: rgba(34, 197, 94, .5); }
.cal-cell.neg { background: rgba(239, 68, 68, var(--a)); border-color: rgba(239, 68, 68, .5); }
.cal-d { font-size: .62rem; color: var(--muted); }
.cal-cell.pos .cal-d, .cal-cell.neg .cal-d { color: rgba(255, 255, 255, .75); }
.cal-v { font-size: .7rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; }

.stat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 12px 0 8px; }
.stat-cols dl { margin: 0; }
.stat-cols dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: .84rem; }
.stat-cols dt { color: var(--muted); font-weight: 400; }
.stat-cols dd { margin: 0; font-weight: 600; white-space: nowrap; }
.warn-text { color: #fbbf24 !important; }
.danger-text { color: #f87171 !important; }
.warn-ico { margin-left: 4px; color: #fbbf24; }
.cum-chart svg { width: 100%; height: 150px; display: block; }
.cum-chart .zero { stroke: var(--line); stroke-dasharray: 3 3; }
.cum-chart .line-pos { stroke: #22c55e; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cum-chart .line-neg { stroke: #ef4444; stroke-width: 2; vector-effect: non-scaling-stroke; }

.dist-row { display: grid; grid-template-columns: 92px 1fr 78px; gap: 8px; align-items: center; font-size: .82rem; margin: 5px 0; }
.dist-l { color: var(--muted); }
.dist-bar { height: 12px; background: rgba(148, 163, 184, .1); border-radius: 3px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 3px; }
.dist-bar .pos-strong { background: #16a34a; }
.dist-bar .pos { background: #22c55e; }
.dist-bar .pos-weak { background: #4ade80; }
.dist-bar .neg { background: #f87171; }
.dist-bar .neg-strong { background: #dc2626; }
.dist-v { text-align: right; font-weight: 600; }
.dist-v small, .mc-row small { color: var(--muted); font-weight: 400; }
.mc-row { display: flex; justify-content: space-between; font-size: .82rem; padding: 3px 0; border-bottom: 1px dashed rgba(36, 48, 73, .7); }
.mc-row:last-child { border-bottom: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.mc-small { background: #a78bfa; }
.dot.mc-mid { background: #60a5fa; }
.dot.mc-large { background: #34d399; }
.trust-title { color: #fbbf24; font-weight: 600; }

.warn-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 8px; }
.warn { border-radius: 10px; padding: 9px 12px; font-size: .84rem; border: 1px solid; }
.warn strong { display: block; font-size: .86rem; }
.warn span { color: #cbd5e1; }
.warn-danger { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .45); }
.warn-danger strong { color: #fca5a5; }
.warn-caution { background: rgba(245, 158, 11, .07); border-color: rgba(245, 158, 11, .4); }
.warn-caution strong { color: #fcd34d; }
.warn-info { background: rgba(148, 163, 184, .06); border-color: var(--line); }

.token-panel { overflow: hidden; }
.tokens thead th { padding: 10px 12px; background: var(--panel-2); line-height: 1.15; }
.tokens thead th small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tokens td { padding: 8px 12px; }
.tokens td small { font-size: .74rem; }
.sort-h { cursor: pointer; user-select: none; }
.sort-h[data-dir="desc"]::after { content: " \2193"; color: var(--accent); }
.sort-h[data-dir="asc"]::after { content: " \2191"; color: var(--accent); }
.tok { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.tok:hover b { color: var(--accent); }
.tok-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #0b0f17;
    background: linear-gradient(135deg, hsl(var(--h) 80% 70%), hsl(calc(var(--h) + 50) 70% 50%)); }
.score-pill { font-size: .78rem; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); margin-left: 6px; }
.score-pill.score-ok { color: #4ade80; }
.score-pill.score-warn { color: #fbbf24; }
.score-pill.score-bad { color: #f87171; }
.verdict-inline { background: none !important; border: 0 !important; }
.verdict-inline.verdict-ok { color: #4ade80; }
.verdict-inline.verdict-warn { color: #fbbf24; }
.verdict-inline.verdict-bad { color: #f87171; }

.verdict-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-radius: 14px; padding: 16px 20px; border: 1px solid; }
.verdict-bar .verdict-text { font-size: 1.5rem; }
.verdict-score { text-align: right; line-height: 1.1; }
.verdict-score strong { font-size: 2.2rem; font-weight: 800; }
.verdict-score strong.score-ok { color: #4ade80; }
.verdict-score strong.score-warn { color: #fbbf24; }
.verdict-score strong.score-bad { color: #f87171; }
.verdict-score span { color: var(--muted); margin-left: 4px; }
.verdict-score em { display: block; color: var(--muted); font-style: normal; font-size: .78rem; }
.linked-warn { border: 1px solid rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .07); border-radius: 10px; padding: 10px 14px; font-size: .88rem; }

/* Header: score top-right */
.wallet-head { grid-template-columns: minmax(260px, 1fr) auto auto; }
.head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
@media (max-width: 1100px) { .head-right { align-items: flex-start; } }
.score-card { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 14px; border: 1px solid; background: var(--panel); }
.score-card.verdict-ok { border-color: rgba(34, 197, 94, .45); }
.score-card.verdict-warn { border-color: rgba(245, 158, 11, .45); }
.score-card.verdict-bad { border-color: rgba(239, 68, 68, .45); }
.score-card-text { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.score-card-text strong { font-size: .95rem; }
.score-card-text .label-warn { color: #fbbf24; }
.score-card .verdict-chip { font-size: .7rem; padding: 1px 8px; }
.score-ring.sm { width: 72px; height: 72px; }
.score-ring.sm .score-inner { width: 58px; height: 58px; }
.score-ring.sm .score-inner strong { font-size: 1.5rem; }
.score-ring.sm .score-inner span { font-size: .62rem; }

/* Calendar months */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.cal-nav .icon-btn { font-size: 1rem; padding: 0 9px; }
.cal-nav .icon-btn:disabled { opacity: .3; cursor: default; }
.cal-title { font-weight: 650; text-transform: capitalize; }
.cal-total { margin-left: auto; margin-right: 4px; font-weight: 700; font-size: .9rem; }
.cal-month .cal { margin-top: 8px; }
.cal-cell.out { opacity: .35; }
.cal-hint { margin-top: 8px; font-size: .75rem; color: var(--muted); }

/* "Why" dropdown under the score card */
.why { position: relative; align-self: stretch; }
.why > summary { list-style: none; cursor: pointer; font-size: .8rem; color: var(--accent); text-align: right; }
.why > summary::-webkit-details-marker { display: none; }
.why > summary::after { content: " \25BE"; }
.why[open] > summary::after { content: " \25B4"; }
.why-panel { position: absolute; right: 0; top: 22px; z-index: 20; width: min(440px, 92vw); background: var(--panel-2); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 8px; text-align: left; }
.why-reason { font-weight: 600; }
.why-score { font-size: .82rem; color: var(--muted); }
.why-item { font-size: .84rem; border-top: 1px dashed var(--line); padding-top: 6px; }
.usage-line { font-size: .72rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sim-summary { border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; border: 1px solid var(--line); }
.sim-summary.ok { border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .06); }
.sim-summary.warn { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .06); }
.sim-summary.bad { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .06); }
