/* dashboard-analytics.css: the Analytics page (analytics-live-1129, lane W2). Layout and chart ink only; every colour is a
   theme token or a --d-* mix from dashboard.css, so all twelve themes, light and dark, draw it right. Square corners,
   1px rules only between rows. Classes start with .an-
   Calm: the range in the page header, a quiet tab row, then cards for the accounts, the charts, the top posts and
   every post. Sections sit straight on the desk; the account cards and the stat tiles are the only quiet panels.
   The charts follow the dataviz rules on these tokens: one series in the accent, a 2px line with a wash under it,
   hairline solid grid and axes in --line, the posts published each day as de-emphasised bars of their own, ink for
   text only from --text and --muted. */

/* ---------- the range, top right; the tab row ---------- */
.an-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.an-range{flex-wrap:nowrap}
.an-tabs{margin:-8px 0 var(--d-gap)}
.an-main{min-width:0}
.an-main[aria-busy="true"]{cursor:progress}
.an-scope{margin:0 0 20px}
.an-loading{margin:0 0 16px}
.an-main .stat,.an-drawer .stat{justify-content:flex-start}
.an-main .stat-note,.an-drawer .stat-note{font-variant-numeric:tabular-nums}

/* ---------- the account cards ---------- */
.an-accts{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:16px;margin:0}
.an-accts.one{grid-template-columns:minmax(0,1fr)}
.an-acct{display:flex;flex-direction:column;gap:14px;min-width:0;padding:18px 20px;background:var(--panel)}
.an-acct-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;min-width:0}
.an-acct-name{margin:0;font-size:15px;line-height:1.25;color:var(--text)}
.an-acct-who{min-width:0;overflow-wrap:anywhere}
.an-acct-hero{display:grid;gap:6px}
/* a big standalone figure keeps proportional digits (dataviz: tabular only in columns) */
.an-acct-num{font-family:var(--display);font-weight:var(--display-weight);font-size:clamp(28px,2.6vw,38px);line-height:1;color:var(--text);white-space:nowrap}
.an-acct-hero .stat-note{max-width:44ch}
.an-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr));gap:12px 20px;margin:0}
.an-fact{display:grid;gap:4px;min-width:0}
.an-fact dt{font:800 10.5px/1.3 var(--d-body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.an-fact dd{display:grid;gap:2px;margin:0}
.an-fact-v{font-size:18px;line-height:1.15;color:var(--text);font-weight:600}
.an-fact-n{font-size:12px;color:var(--muted)}
.an-acct-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-top:auto;padding-top:12px;border-top:1px solid var(--line);font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.an-acct .note{margin:0}
.an-acct.wide{padding:20px 24px}
.an-acct.wide .an-facts{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))}
.an-acct-all{background:none;border:1px solid var(--line)}
.an-recon{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.an-recon p{margin:0;color:var(--text)}
.an-wait{color:var(--text)}
.an-sync{min-width:104px;font-variant-numeric:tabular-nums}
.an-skel .an-acct .skeleton{margin:6px 0}
.an-accounts{margin-bottom:40px}

/* ---------- in this range ---------- */
.an-cohort-line{margin:0 0 12px;color:var(--text)}
.an-cohort-tiles{grid-template-columns:repeat(auto-fit,minmax(min(100%,132px),1fr));gap:12px;margin:0 0 12px}
.an-cohort-tiles .stat{min-height:84px;padding:12px 14px}
.an-cohort-tiles .stat-num{font-size:22px}

/* ---------- views per day ---------- */
.an-trends{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:24px 48px}
.an-trend.small{margin:0}
.an-trend.small .section-head{margin:0 0 6px}
.an-trend.small h3{margin:0;font-size:13px;letter-spacing:.12em;text-transform:uppercase}
.an-what{margin:-8px 0 12px}
.an-trend.small .an-what{margin:0 0 10px}
.an-fallback{margin:-4px 0 12px}
.an-fig{min-width:0;margin:0}
.an-fig-sub{margin:0 0 8px;font:800 10.5px/1.2 var(--d-body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.an-fig-foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;margin-top:8px}
.an-sum{margin:0;font-variant-numeric:tabular-nums}
.an-chart{position:relative;min-width:0}
.an-chart:focus-visible{outline-offset:2px}
.an-svg{display:block;width:100%;height:auto;overflow:visible}
.an-gridline{stroke:var(--line);stroke-width:1}
.an-axis{stroke:var(--line);stroke-width:1}
.an-line{fill:none;stroke:var(--accent);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.an-area{fill:color-mix(in srgb, var(--accent) 10%, transparent);stroke:none}
/* the dot carries a 2px ring in the page's own colour, so it reads where it crosses the line */
.an-dot{fill:var(--accent);stroke:var(--bg);stroke-width:2}
/* the posts published: de-emphasised (65% clears 3:1 on every theme, Parlor the lowest), never on the line's scale */
.an-postbar{fill:color-mix(in srgb, var(--muted) 65%, transparent)}
.an-pick{fill:var(--d-wash)}
.an-pick-rule{stroke:var(--accent);stroke-width:1}
.an-tick{fill:var(--muted);font:400 11px/1 var(--d-body);font-variant-numeric:tabular-nums}
.an-tip{position:absolute;top:2px;z-index:5;transform:translateX(-50%);padding:6px 9px;background:var(--panel-deep);border:1px solid var(--d-edge);box-shadow:6px 6px 0 0 var(--shadow-ink);color:var(--muted);font-size:12.5px;line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none}
.an-tip strong{color:var(--text);font-weight:700}
.an-tip[data-side="start"]{transform:none}
.an-tip[data-side="end"]{transform:translateX(-100%)}
.an-data{margin-left:auto}
.an-data[open]{flex:1 1 100%;margin-left:0}
.an-data summary{display:inline-flex;align-items:center;min-height:28px;color:var(--muted);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.an-data summary:hover{color:var(--text)}
.an-data .table-wrap{max-height:320px;overflow:auto;margin-top:8px}
.an-data .table td,.an-data .table th{height:32px;padding-top:4px;padding-bottom:4px}
.an-data .table thead th{position:sticky;top:0;z-index:1;background:var(--bg)}
.an-data tbody th{border-bottom:1px solid var(--line);color:var(--text);font:400 13px/1.2 var(--d-body);letter-spacing:0;text-transform:none;text-align:left}
.an-data tbody tr:last-child > th{border-bottom:0}

/* ---------- top posts beside every post, only where both have room ---------- */
.an-pair{display:grid;grid-template-columns:minmax(0,1fr);column-gap:48px}
.an-pair > .section{margin-bottom:var(--d-section)}
.an-best-list > li{display:block;min-height:0;padding:0}
.an-best-row{display:grid;grid-template-columns:20px 28px minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;min-height:64px;padding:8px 8px 8px 0;border:0;background:none;color:var(--text);font:inherit;text-align:left;cursor:pointer}
.an-best-row:hover{background:var(--d-hover)}
.an-best-row:focus-visible{outline-offset:-3px}
.an-rank{font-size:13px;color:var(--muted);text-align:right}
.an-best-text{display:grid;gap:2px;min-width:0}
.an-cap{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.an-best-text .sub,.an-dr-meta{display:block;font-size:12px;color:var(--muted)}
.an-n{display:grid;justify-items:end;min-width:72px}
.an-n-v{font-size:15px;color:var(--text)}
.an-n-l{font-size:11px;color:var(--muted)}

/* ---------- thumbnails: the dashboard's own only ---------- */
.an-thumb{flex:none;display:block;width:28px;height:48px;background:var(--field);border:1px solid var(--line)}
.an-thumb.big{width:90px;height:160px}
.an-thumb-none{display:grid;place-items:center;color:var(--muted)}

/* ---------- every post ---------- */
.an-count{font:400 12px/1 var(--d-body);letter-spacing:0;text-transform:none;color:var(--muted);font-variant-numeric:tabular-nums}
.an-every-what{margin:-8px 0 12px}
.an-search{position:relative;width:min(100%,320px);margin:0 0 8px}
.an-search .icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.an-search input{width:100%;padding-left:34px}
.an-table th.num{text-align:right}
.an-table th.num button{flex-direction:row-reverse}
.an-table th .icon{display:none}
.an-table th.is-sorted .icon{display:block}
.an-table th[aria-sort="ascending"] .icon{transform:rotate(180deg)}
.an-table th button:hover{color:var(--text)}
.an-table th :focus-visible{outline-offset:-3px}
.an-table tbody tr{cursor:pointer}
.an-post-col{min-width:200px}
.an-post-btn{display:block;max-width:44ch;padding:0;border:0;background:none;color:var(--text);font:inherit;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.an-post-btn:hover{text-decoration:underline;text-underline-offset:3px}
.an-table .an-row-sub{display:none}
td.an-plat-col{color:var(--muted);white-space:nowrap}
td.an-muted{color:var(--muted)}
.an-when{white-space:nowrap}
.an-more{padding:16px 0 0}
.an-foot{margin:8px 0 0}
.an-foot .note,.an-pnote{margin:0 0 4px}

/* ---------- the post drawer ---------- */
.dash-dialog.an-drawer{inset:0 0 0 auto;width:min(560px,100vw);max-width:100vw;height:100vh;height:100dvh;max-height:none;margin:0;padding:0 24px 24px;border-width:0 0 0 1px;box-shadow:none;overscroll-behavior:contain}
.an-dr-head{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:56px;margin:0 -24px 16px;padding:0 16px 0 24px;background:var(--panel);border-bottom:1px solid var(--line)}
.an-dr-head h2{font-size:13px;line-height:1.2;letter-spacing:.12em;text-transform:uppercase;color:var(--text)}
.an-dr-top{display:grid;grid-template-columns:90px minmax(0,1fr);gap:16px;margin:0 0 20px}
.an-dr-text{display:grid;align-content:start;justify-items:start;gap:8px;min-width:0}
.an-dr-links{display:flex;flex-wrap:wrap;gap:8px}
.an-dr-cap{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;margin:0;overflow-wrap:anywhere}
.an-dr-cap.open{display:block}
.an-dr-meta{margin:0;font-variant-numeric:tabular-nums}
.an-drawer .stats{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;margin:0 0 12px}
.an-drawer .stat{min-height:84px;padding:12px 14px;background:var(--panel-deep)}
.an-dr-life{margin:0 0 4px}
.an-drawer h3.an-dr-over{margin:24px 0 12px;font-size:15px;line-height:1.25;color:var(--text)}
.an-drawer .an-data .table thead th{background:var(--panel)}

/* ---------- wide screens ---------- */
@media (min-width:1700px){
  .an-pair{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)}
}

/* ---------- narrow screens ---------- */
@media (max-width:1100px){
  td.an-plat-col,th.an-plat-col{display:none}
  .an-table .an-row-sub{display:block}
}
@media (max-width:720px){
  .an-wide{display:none}
}
@media (max-width:640px){
  .dash-actions:has(> .an-bar){flex:1 1 100%}
  .an-bar{flex:1 1 100%}
  .an-range{display:flex;width:100%}
  .an-range label{flex:1 1 0}
  .an-range span{justify-content:center;width:100%;padding:0 6px}
  .an-accounts{margin-bottom:var(--d-section)}
  .an-acct,.an-acct.wide{padding:16px}
  .an-trends{grid-template-columns:minmax(0,1fr)}
  .an-table td,.an-table th{padding-left:6px;padding-right:6px}
  .an-table th{letter-spacing:.08em}
  .an-post-col{min-width:0}
  .an-post-btn{max-width:17ch}
  .an-pub{display:none}
  .an-search{width:100%}
  .an-best-row{gap:10px}
  .an-n{min-width:56px}
  .dash-dialog.an-drawer{width:100vw;border-width:0;padding:0 16px 20px}
  .an-dr-head{margin:0 -16px 14px;padding:0 8px 0 16px}
  .an-dr-top{grid-template-columns:72px minmax(0,1fr);gap:12px}
  .an-thumb.big{width:72px;height:128px}
}
