/* ============================================================
   Coindaily - Treasury holdings pages
   Complements styles.css.
   ============================================================ */

.page-hero { padding: 18px 0 22px; border-bottom: 1px solid var(--hairline); }
.page-hero .ph-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-hero .ph-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #16171b; }
.page-hero h1 { font-size: 24px; font-weight: 700; color: var(--tx-hi); letter-spacing: -0.025em; }
.page-hero .ph-sym { font-family: var(--mono); font-size: 12px; color: var(--tx-mid); background: var(--panel-2); border: 1px solid var(--hairline); padding: 2px 7px; border-radius: 5px; text-transform: uppercase; }
.page-hero .ph-sub { font-size: 13px; color: var(--tx-dim); margin-top: 6px; max-width: 720px; }
.page-hero .ph-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.trz-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.trz-tabs a { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 7px; font-size: 13px; color: var(--tx-mid); font-weight: 500; border: 1px solid transparent; transition: .12s; }
.trz-tabs a:hover { color: var(--tx-hi); background: var(--panel-2); }
.trz-tabs a.active { color: var(--amber); border-color: rgba(201,154,75,.3); background: rgba(201,154,75,.06); }
.trz-tabs a img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }

.note-banner { display: flex; gap: 10px; align-items: flex-start; background: rgba(201,154,75,.05); border: 1px solid rgba(201,154,75,.2); border-radius: var(--r); padding: 12px 15px; margin: 18px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--tx-mid); }
.note-banner b { color: var(--amber); }

/* stat strip */
.trz-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--hairline-2); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; margin: 20px 0; }
.trz-stat { background: var(--panel); padding: 15px 16px; }
.trz-stat .l { font-size: 10px; color: var(--tx-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px; }
.trz-stat .v { font-family: var(--mono); font-size: 18px; color: var(--tx-hi); font-weight: 600; letter-spacing: -0.01em; }
.trz-stat .d { font-family: var(--mono); font-size: 11px; margin-top: 6px; }

/* holder-type breakdown */
.brk-body { padding: 18px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.conc { border-top: 1px solid var(--hairline-2); padding-top: 15px; display: flex; flex-direction: column; gap: 11px; }
.conc-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.conc-row .cl { color: var(--tx-mid); }
.conc-row .cv { font-family: var(--mono); color: var(--tx-hi); font-weight: 600; }
.ff-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: var(--panel-2); margin-top: 9px; }
.ff-bar .held { background: var(--amber); } .ff-bar .free { background: var(--hairline); }
.ff-legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--tx-dim); margin-top: 7px; font-family: var(--mono); }
.brk-bar { height: 14px; border-radius: 4px; overflow: hidden; display: flex; margin: 4px 0 16px; }
.brk-bar i { display: block; height: 100%; }
.brk-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.brk-legend .lg { display: flex; align-items: center; gap: 9px; }
.brk-legend .sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.brk-legend .lk { font-size: 12px; color: var(--tx-mid); }
.brk-legend .lk b { color: var(--tx-hi); font-family: var(--mono); display: block; font-size: 13px; }

/* chart */
.trz-rtabs { display: flex; gap: 1px; background: var(--hairline-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); overflow: hidden; }
.trz-rtabs button { padding: 4px 11px; font-family: var(--mono); font-size: 11px; color: var(--tx-dim); background: var(--panel); transition: .12s; }
.trz-rtabs button.active { color: var(--amber); }
.trz-rtabs button:hover { color: var(--tx); }
.tchart-wrap { position: relative; padding: 16px 16px 8px; }
.tchart-svg { width: 100%; height: 300px; display: block; }
.tchart-ylab { position: absolute; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); transform: translateY(-50%); pointer-events: none; }
.tchart-ylab.l { left: 14px; } .tchart-ylab.r { right: 14px; color: var(--amber); }
.tchart-xlab { position: absolute; bottom: 6px; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); transform: translateX(-50%); }
.tchart-legend { display: flex; align-items: center; gap: 16px; padding: 11px 18px; border-top: 1px solid var(--hairline-2); font-size: 12px; color: var(--tx-mid); }
.tchart-legend .lg { display: flex; align-items: center; gap: 7px; }
.tchart-legend .sw { width: 11px; height: 11px; border-radius: 3px; } .tchart-legend .swl { width: 14px; height: 2px; }

/* treemap */
.tm-wrap { position: relative; width: 100%; height: 400px; }
.tm-tile { position: absolute; border: 1px solid rgba(8,8,9,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px; overflow: hidden; transition: filter .1s; }
.tm-tile:hover { filter: brightness(1.16); }
.tm-tile .ts { font-weight: 700; color: #fff; line-height: 1.05; }
.tm-tile .tc { font-family: var(--mono); color: rgba(255,255,255,.85); margin-top: 3px; }

/* entity table */
.ent-table { width: 100%; border-collapse: collapse; }
.ent-table thead th { text-align: right; font-size: 10px; color: var(--tx-dim); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.ent-table th:nth-child(1), .ent-table th:nth-child(2), .ent-table th:nth-child(3), .ent-table td:nth-child(1), .ent-table td:nth-child(2), .ent-table td:nth-child(3) { text-align: left; }
.ent-table td { padding: 11px 14px; border-bottom: 1px solid var(--hairline-2); text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--tx); }
.ent-table tbody tr:last-child td { border-bottom: none; }
.ent-table tbody tr:hover { background: rgba(255,255,255,.018); }
.ent-table .rk { color: var(--tx-dim); width: 32px; }
.ent-name { display: flex; flex-direction: column; gap: 1px; font-family: var(--sans); }
.ent-name .nm { font-weight: 600; color: var(--tx-hi); }
.ent-name .tk { font-family: var(--mono); font-size: 10px; color: var(--tx-dim); }
.ent-type { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--tx-mid); font-family: var(--sans); }
.ent-type i { width: 8px; height: 8px; border-radius: 2px; }
.hold-cell { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.hold-bar { width: 70px; height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.hold-bar i { display: block; height: 100%; }
.ent-table .pnl-v { font-size: 10px; color: var(--tx-dim); margin-left: 4px; }
.ov-asset { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); color: var(--tx-hi); }
.ov-asset img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: #16171b; }

/* toolbar: filters + search */
.ent-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.ent-filters { display: flex; gap: 3px; flex-wrap: wrap; }
.ent-filters button { padding: 5px 11px; border-radius: 7px; font-size: 12px; color: var(--tx-mid); font-weight: 500; border: 1px solid transparent; transition: .12s; font-family: var(--sans); display: inline-flex; align-items: center; gap: 6px; }
.ent-filters button:hover { color: var(--tx-hi); background: var(--panel-2); }
.ent-filters button.active { color: var(--amber); border-color: rgba(201,154,75,.3); background: rgba(201,154,75,.06); }
.ent-filters .ef-n { font-family: var(--mono); font-size: 10px; color: var(--tx-dim); }
.ent-search { display: flex; align-items: center; gap: 7px; background: var(--panel-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 6px 11px; }
.ent-search:focus-within { border-color: rgba(201,154,75,.4); }
.ent-search svg { width: 13px; height: 13px; stroke: var(--tx-dim); fill: none; stroke-width: 2; }
.ent-search input { background: none; border: none; outline: none; color: var(--tx-hi); font-size: 12.5px; width: 168px; font-family: var(--sans); }
.ent-search input::placeholder { color: var(--tx-faint); }

.ent-scroll { overflow-x: auto; }
.ent-scroll .ent-table { min-width: 880px; }
.ent-table thead th.cd-sortable { cursor: pointer; }
.ent-table thead th.ent-h { text-align: left; }

@media (max-width: 1080px) { .ent-table .col-mid { display: none; } .ent-scroll .ent-table { min-width: 680px; } }
@media (max-width: 1000px) { .trz-stats { grid-template-columns: repeat(3, 1fr); } .brk-legend { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .trz-stats { grid-template-columns: repeat(2, 1fr); } }

/* country code badge in the holders tables */
.ent-cc { font-family: var(--mono); font-size: 11px; color: var(--tx-mid); letter-spacing: .03em; }

/* ============================================================
   Loading skeleton (body.tz-loading) - shimmer EVERY treasury
   data VALUE until the real CoinGecko/CoinGlass feed lands.
   The page must NEVER flash modelled/fake numbers: while this
   class is on, every value element is masked with a shimmer;
   the JS only ever writes real data or a "-" dash (never
   modelled), so when the class is removed the page shows the
   truth or a dash. Covers BOTH overview + per-asset pages.
   ============================================================ */
@keyframes tz-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* reusable shimmer fill */
.tz-sk { display: inline-block; vertical-align: middle; width: 60px; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite; }
.tz-sk-row td { padding: 11px 12px; }

/* hero stat values (asset: #tz-*, overview: #ov-*) */
body.tz-loading .trz-stat .v {
  color: transparent !important; border-radius: 5px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite;
}

/* every holders/overview table CELL value: hide real text, shimmer a bar in its place.
   (the JS also injects .tz-sk-row skeletons, but this is the first-paint + belt-and-braces
   backstop so a modelled value can never flash between paints) */
body.tz-loading .ent-table tbody td { color: transparent !important; }
body.tz-loading .ent-table tbody td > * { visibility: hidden; }
body.tz-loading .ent-table tbody td::after {
  content: ""; display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite;
}
/* the .tz-sk spans the JS injects carry their own shimmer - don't double up */
body.tz-loading .ent-table tbody td:has(.tz-sk)::after { display: none; }
body.tz-loading .ent-table tbody td:has(.tz-sk) { color: transparent !important; }
body.tz-loading .ent-table tbody td .tz-sk { visibility: visible; width: 70%; }
body.tz-loading #ent-count { color: transparent !important; }

/* who-holds-it bar + legend + concentration block (asset page) and the
   value-by-asset bar + legend (overview) - mask the whole region while loading */
body.tz-loading .brk-bar { background: var(--panel-2); border-radius: 4px; overflow: hidden; }
body.tz-loading .brk-bar > i:not(.tz-sk) { visibility: hidden; }
body.tz-loading .brk-legend .lk b,
body.tz-loading .conc-row .cv { color: transparent !important; border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite; }
body.tz-loading .ff-bar > span { visibility: hidden; }
body.tz-loading .ff-legend { color: transparent !important; }

/* concentration (Pareto) chart - blank the svg + shimmer overlay across the plot */
body.tz-loading .tchart-svg { opacity: 0; }
.tz-chart-sk { position: relative; }
.tz-chart-sk::after { content: ""; position: absolute; inset: 10px 44px 28px 44px; border-radius: 8px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite; pointer-events: none; }

/* treemap heatmap */
.tz-tm-sk { width: 100%; height: 400px; border-radius: 8px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: tz-shimmer 1.3s ease-in-out infinite; }
body.tz-loading .tm-wrap > .tm-tile { visibility: hidden; }
