/* ui-studio kit — components. Every color is a token from tokens.css; state lives in
   data-attributes (data-level="ok|warn|serious|crit|info|unknown", aria-current, aria-pressed). */

/* --- icons ------------------------------------------------------------------- */
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -4px;
}
.icon.sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon.lg { width: 24px; height: 24px; }
.icon.xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* --- app shell: sidebar on wide screens, bottom bar on phones -------------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app-nav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-4) var(--s-3);
  background: var(--surface); border-right: 1px solid var(--border);
}
.app-brand { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3) var(--s-4); font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--tap); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-2); background: none;
  color: var(--text-2); text-decoration: none; cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-item[aria-current="page"] .icon { color: var(--accent); }
.nav-item .nav-count { margin-left: auto; }
.app-nav .nav-foot { margin-top: auto; }
.app-body { min-width: 0; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--header-h); padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-header h1 { font-size: var(--fs-4); }
.app-main { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s-6); }

@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-nav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 20;
    height: auto; flex-direction: row; justify-content: space-around; gap: 0;
    padding: var(--s-1) var(--s-1) calc(var(--s-1) + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .app-brand, .app-nav .nav-foot { display: none; }
  .nav-item {
    flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px;
    min-height: 54px; padding: var(--s-1) 0; font-size: 12px; text-align: center;
  }
  .nav-item[aria-current="page"] { background: none; }
  .nav-item .nav-count { position: absolute; margin: -18px 0 0 22px; }
  .nav-item { position: relative; }
  .nav-item.primary .icon {
    width: 40px; height: 40px; padding: 8px; border-radius: var(--r-full);
    background: var(--accent); color: var(--accent-text); stroke-width: 2.4;
  }
  .nav-item.primary[aria-current="page"] .icon { color: var(--accent-text); }
  .app-header { padding: 0 var(--s-4); }
  .app-main { padding: var(--s-4) var(--s-4) calc(var(--bottom-h) + var(--s-6) + env(safe-area-inset-bottom)); }
}

/* --- page structure -------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); }
.page-head h2 { font-size: var(--fs-6); }
.page-head .meta { color: var(--muted); font-size: var(--fs-2); }
.section { margin-top: var(--s-7); }
.section-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-3); }
.section-head h3 { font-size: var(--fs-4); }
.section-head .meta { color: var(--muted); font-size: var(--fs-2); }
.section-head a, .section-head .link { margin-left: auto; font-size: var(--fs-2); }
/* standalone links get a real tap target (WCAG 2.5.8: 24 px, phones: 44 px) */
.section-head a, .card-head a, .tap-link { display: inline-flex; align-items: center; min-height: 32px; }
@media (max-width: 719px) { .section-head a, .card-head a, .tap-link { min-height: var(--tap); } }

/* --- cards and tiles ----------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3);
  padding: var(--s-4); min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card.raised { box-shadow: var(--shadow); border-color: transparent; }
.card-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.card-head h3, .card-head h4 { font-size: var(--fs-3); font-weight: 600; }
.card-head .meta { margin-left: auto; color: var(--muted); font-size: var(--fs-2); }
a.card, button.card { display: block; color: inherit; text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
a.card:hover, button.card:hover { border-color: var(--border-strong); }

.tile {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3);
  padding: var(--s-3) var(--s-4); min-width: 0; color: inherit; text-decoration: none;
}
.tile-label { display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-2); }
.tile-label .icon { color: var(--muted); }
.tile-value { font-size: var(--fs-6); font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; }
.tile-value small { font-size: var(--fs-3); font-weight: 500; color: var(--text-2); margin-left: 2px; }
.tile-sub { color: var(--muted); font-size: var(--fs-2); min-height: 1.4em; }
.tile-spark { height: 32px; margin-top: var(--s-2); color: var(--muted); }
.tile-spark svg { display: block; width: 100%; height: 32px; overflow: visible; }
.tile .meter { margin-top: var(--s-2); }
.tile[data-level="warn"], .tile[data-level="serious"] { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.tile[data-level="crit"] { border-color: color-mix(in srgb, var(--bad) 65%, var(--border)); }
.tile .tile-flag { position: absolute; top: var(--s-3); right: var(--s-3); }

/* sparkline: de-emphasis line, accent on the latest point */
.spark-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: currentColor; opacity: 0.08; stroke: none; }
.spark-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.spark-limit { stroke: var(--grid); stroke-width: 1; }

/* --- meter: fill carries severity, track is a quiet step of the surface ---------- */
.meter { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter.sm { height: 4px; }
.meter.lg { height: 12px; }
.meter-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent);
  transition: width var(--dur-2) var(--ease); }
.meter-fill[data-level="warn"] { background: var(--warn); }
.meter-fill[data-level="serious"] { background: var(--serious); }
.meter-fill[data-level="crit"] { background: var(--bad); }
.meter-fill[data-level="ok"] { background: var(--ok); }

/* --- status: dot, badge, hero -------------------------------------------------------- */
.dot { display: inline-block; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.dot[data-level="ok"] { background: var(--ok); }
.dot[data-level="warn"] { background: var(--warn); }
.dot[data-level="serious"] { background: var(--serious); }
.dot[data-level="crit"] { background: var(--bad); }
.dot.live { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 1px 8px; border-radius: var(--r-full); font-size: var(--fs-1); font-weight: 600; line-height: 20px;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; vertical-align: -2px; }
.badge[data-level="ok"] { background: var(--ok-soft); color: var(--ok-text); }
.badge[data-level="warn"] { background: var(--warn-soft); color: var(--warn-text); }
.badge[data-level="serious"] { background: var(--serious-soft); color: var(--serious-text); }
.badge[data-level="crit"] { background: var(--bad-soft); color: var(--bad-text); }
.badge[data-level="info"] { background: var(--accent-soft); color: var(--text); }

.status-hero {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5); border-radius: var(--r-3);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
a.status-hero:hover { color: var(--text); filter: brightness(0.98); }
.status-hero .icon { width: 36px; height: 36px; flex: none; }
.status-hero h2 { font-size: var(--fs-5); }
.status-hero p { color: var(--text-2); font-size: var(--fs-2); }
.status-hero[data-level="ok"] { background: var(--ok-soft); border-color: transparent; }
.status-hero[data-level="ok"] .icon { color: var(--ok-text); }
.status-hero[data-level="warn"] { background: var(--warn-soft); border-color: transparent; }
.status-hero[data-level="warn"] .icon { color: var(--warn-text); }
.status-hero[data-level="crit"] { background: var(--bad-soft); border-color: transparent; }
.status-hero[data-level="crit"] .icon { color: var(--bad-text); }

/* --- alerts ---------------------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-2);
  background: var(--surface-2); border-left: 4px solid var(--muted);
}
.alert .icon { margin-top: 1px; }
.alert-title { font-weight: 600; }
.alert-meta { color: var(--muted); font-size: var(--fs-2); }
.alert[data-level="crit"] { background: var(--bad-soft); border-left-color: var(--bad); }
.alert[data-level="crit"] .icon { color: var(--bad-text); }
.alert[data-level="warn"] { background: var(--warn-soft); border-left-color: var(--warn); }
.alert[data-level="warn"] .icon { color: var(--warn-text); }
.alert[data-level="info"] { background: var(--accent-soft); border-left-color: var(--accent); }
.alert[data-level="info"] .icon { color: var(--accent); }
.alert[data-level="ok"] { background: var(--ok-soft); border-left-color: var(--ok); }

/* --- buttons ------------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-4);
  border: 1px solid transparent; border-radius: var(--r-2);
  background: var(--accent); color: var(--accent-text);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.subtle { background: transparent; color: var(--text-2); }
.btn.subtle:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--bad-soft); color: var(--bad-text); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 20%, var(--surface)); }
.btn.sm { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-2); border-radius: var(--r-1); }
.btn.icon-only { width: var(--tap); padding: 0; }
.btn.sm.icon-only { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 719px) {
  .btn.sm { min-height: 44px; }
  .btn.sm.icon-only { width: 44px; }
}

/* --- forms -------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field > label, .field-label { font-size: var(--fs-2); font-weight: 600; color: var(--text-2); }
.hint { font-size: var(--fs-2); color: var(--muted); }
.error-text { font-size: var(--fs-2); color: var(--bad-text); min-height: 1.4em; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-2);
  background: var(--surface); color: var(--text);
}
textarea.input { min-height: 140px; resize: vertical; line-height: var(--lh); }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.search { position: relative; flex: 1 1 220px; min-width: 0; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* segmented control and chips: one choice / several filters */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-2); background: var(--surface-2); }
.seg button {
  min-height: 34px; padding: 0 var(--s-3); border: 0; border-radius: calc(var(--r-2) - 3px);
  background: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-2); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 var(--s-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-full);
  background: var(--surface); color: var(--text-2); font-size: var(--fs-2); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
@media (max-width: 719px) { .seg button, .chip { min-height: 44px; } .seg button { min-width: 44px; } }

/* --- lists and tables ------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--row); padding: var(--s-2) var(--s-4);
  border: 0; border-bottom: 1px solid var(--border); background: none;
  color: inherit; text-decoration: none; text-align: left; width: 100%;
}
.list-item:last-child { border-bottom: 0; }
button.list-item, a.list-item { cursor: pointer; }
button.list-item:hover, a.list-item:hover { background: var(--surface-2); }
.list-item[aria-current="true"], .list-item[aria-current="page"] { background: var(--accent-soft); }
.list-item .icon { color: var(--muted); }
.list-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.list-item-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-sub { color: var(--muted); font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-meta { flex: none; color: var(--muted); font-size: var(--fs-2); text-align: right; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.table th, .table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-1) var(--s-4); font-size: var(--fs-2); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* horizontal bar list: per-core load, top processes */
.bars { display: flex; flex-direction: column; gap: var(--s-2); }
.bar-row { display: grid; grid-template-columns: minmax(64px, 30%) 1fr auto; align-items: center; gap: var(--s-3); font-size: var(--fs-2); }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row .value { font-variant-numeric: tabular-nums; color: var(--text); text-align: right; min-width: 56px; }

/* --- progress, skeleton, empty ------------------------------------------------------------------ */
.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit;
  transition: width var(--dur-2) var(--ease); }
.progress.indeterminate > span { width: 35%; animation: slide 1.2s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.skeleton {
  border-radius: var(--r-2); min-height: 16px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-7) var(--s-4); text-align: center; }
.empty .icon { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.5; }
.empty h3 { font-size: var(--fs-4); }
.empty p { color: var(--text-2); max-width: 42ch; }
.stale { opacity: 0.55; transition: opacity var(--dur-2) var(--ease); }

details > summary {
  display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); cursor: pointer;
  color: var(--text-2); font-weight: 600; font-size: var(--fs-2); list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--muted); transition: transform var(--dur-1) var(--ease); }
details[open] > summary::before { transform: rotate(90deg); }

/* --- code block with copy ------------------------------------------------------------------------- */
.code { position: relative; }
.code pre {
  margin: 0; padding: var(--s-3) 104px var(--s-3) var(--s-3);
  background: var(--surface-2); border-radius: var(--r-2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5;
}
.code .btn { position: absolute; top: 6px; right: 6px; }
pre.log {
  margin: 0; padding: var(--s-3); max-height: 420px; overflow: auto;
  background: var(--surface-2); border-radius: var(--r-2);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.5;
}

/* --- dialog / bottom sheet ----------------------------------------------------------------------------- */
dialog.sheet {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--r-3);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: var(--overlay); }
.sheet-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-2); }
.sheet-head h3 { font-size: var(--fs-5); }
.sheet-body { padding: var(--s-2) var(--s-5) var(--s-4); overflow-y: auto; }
.sheet-actions {
  position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2);
  padding: var(--s-3) var(--s-5) var(--s-5); background: var(--surface);
}
@media (max-width: 719px) {
  dialog.sheet {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-3) var(--r-3) 0 0;
    max-height: 88vh; padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-actions .btn { flex: 1 1 auto; }
}

/* --- toast and drag overlay ------------------------------------------------------------------------------- */
.toasts {
  position: fixed; left: 50%; bottom: var(--s-6); transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2); pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-full);
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); pointer-events: auto;
  animation: rise var(--dur-2) var(--ease);
}
.toast[data-level="crit"] { background: var(--bad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 899px) { .toasts { bottom: calc(var(--bottom-h) + var(--s-4) + env(safe-area-inset-bottom)); } }

.drop-overlay {
  position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--overlay)); pointer-events: none;
}
.drop-overlay.on { display: flex; }
.drop-overlay .drop-box {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: var(--s-7) var(--s-8); border: 2px dashed var(--accent); border-radius: var(--r-3);
  background: var(--surface); font-weight: 600;
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center;
  padding: var(--s-6) var(--s-4); border: 2px dashed var(--border-strong); border-radius: var(--r-3);
  background: var(--surface); color: var(--text-2);
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* --- charts (uPlot + our tooltip/legend) ------------------------------------------------------------------- */
.chart { position: relative; min-height: 180px; }
.chart .uplot { font-family: var(--font); }
.chart .u-legend { display: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-top: var(--s-2); font-size: var(--fs-2); color: var(--text-2); }
.chart-legend .key, .chart-tip .key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-2);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: var(--fs-2); display: none;
}
.chart-tip.on { display: block; }
.chart-tip .tip-time { color: var(--muted); margin-bottom: 2px; }
.chart-tip .tip-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.chart-tip .tip-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-tip .tip-label { color: var(--text-2); }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--fs-2); }

/* --- media previews --------------------------------------------------------------------------------------- */
.media { display: block; width: 100%; max-height: 70vh; border-radius: var(--r-2); background: var(--surface-2); }
audio.media { max-height: none; background: none; }
.thumb { width: 48px; height: 48px; border-radius: var(--r-1); object-fit: cover; background: var(--surface-2); flex: none; }
