/* Accounts page (classes prefixed acc-: every page stylesheet loads on every page) */
/* desktop: tighter rows; the width is shared by all columns (no column takes the leftover), so a row reads across */
@media (min-width: 721px) {
  .acc-page th, .acc-page td { padding-top: 6px; padding-bottom: 6px; }
  .acc-page th.item { width: 22%; }
  .acc-page td.act { width: 1%; }
}
.acc-page td.act .ico { stroke-width: 3; }
.acc-page .page-head .btn.busy .ico { display: none; } /* busy: the spinner takes the icon's place */
.acc-page td .small { line-height: 1.3; }
.acc-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acc-sid { font-size: 13.5px; color: var(--text); }
.acc-unknown { color: var(--muted); cursor: help; }
.acc-meta { color: var(--muted); font-size: 12px; font-weight: 400; }
.acc-cell .chip { padding: 0 7px; font-size: 11px; line-height: 17px; }
.acc-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.acc-dot.on { background: var(--pos); }
/* inactive rows are dimmed (not the menu cell: its button stays easy to see) */
.acc-page tr:has(.acc-cell.off) > td:not(.act) { opacity: .55; }
.acc-zero { color: var(--faint); }

/* row menu (popover, placed under its button by accounts.js) */
.acc-menu {
  position: fixed; inset: var(--y, 0) var(--r, 0) auto auto; margin: 4px 0 0; min-width: 190px; max-width: 250px; padding: 5px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45); font-size: 13px; text-align: left; white-space: normal;
}
.acc-menu:popover-open { animation: fade .15s ease-out both; }
.acc-menu.up { translate: 0 calc(-100% - 8px); }
.acc-menu button {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.acc-menu button:hover:not(:disabled) { background: var(--surface-3); }
.acc-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc-menu button.danger { color: var(--neg); }
.acc-menu button:disabled { color: var(--faint); cursor: default; }
.acc-menu-note { margin-top: 4px; padding: 7px 10px 4px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 1.4; }

/* number with a thin bar under it */
.acc-num { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 84px; }
.acc-meter { display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.acc-meter > span { display: block; height: 100%; border-radius: 4px; background: var(--viz-1); transform-origin: 0 50%; animation: bar-x .6s var(--ease) both; }
.acc-meter.bo > span { background: var(--viz-2); }
.acc-meter.bo.full > span { background: var(--warn); }
.acc-meter.kpi { margin: 8px 0 2px; height: 5px; max-width: 220px; }
.stat .sub .acc-meter.kpi { margin-top: 6px; }

/* toolbar: search, filter chips, visible total + export */
.acc-tools { gap: 10px 14px; }
.acc-tools .search { flex: 1 1 240px; max-width: 360px; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--muted); font: 500 12.5px/1 inherit; font-family: inherit; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent;
}
.acc-chip:hover { background: var(--surface-2); color: var(--text); }
.acc-chip[aria-pressed="true"] { background: rgba(138, 180, 255, .1); border-color: rgba(138, 180, 255, .35); color: var(--accent); }
.acc-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-count { color: var(--faint); font-variant-numeric: tabular-nums; }
.acc-chip[aria-pressed="true"] .acc-count { color: inherit; opacity: .75; }
.acc-tools-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.acc-shown { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-updated { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-right: 4px; }

.acc-kick-meta { margin-top: 4px; color: var(--muted); font-family: inherit; font-size: 12.5px; }
.acc-page .acc-kpis, .acc-page .dt { transition: opacity .2s; }
.acc-page.acc-loading .acc-kpis, .acc-page.acc-loading .dt { opacity: .5; }
.acc-add { width: 460px; }
.acc-add .field { color: var(--muted); }
.acc-add .field input { width: 100%; }
.acc-err { color: var(--neg); background: rgba(240, 97, 109, .08); border: 1px solid rgba(240, 97, 109, .25); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  /* header: "Updated" + Sync and Refresh as icons + Add account, on one row */
  .acc-page .page-head { margin-bottom: 14px; }
  .acc-page .page-head .sub { display: none; }
  .acc-page .page-head > .actions { flex-wrap: nowrap; }
  .acc-updated { flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acc-lbl { display: none; }
  .acc-page .page-head .btn:not(.primary) { flex: none; width: 40px; padding: 0; justify-content: center; }
  .acc-tools .search { max-width: none; flex-basis: 100%; }
  .acc-chip { min-height: 38px; }
  .acc-tools-end { flex: 1 1 100%; flex-wrap: wrap; justify-content: space-between; margin-left: 0; }
  .acc-tools-end .btn { flex: none; }
  /* compact row (base.css .dt-x): Steam ID line, then balance left and buy orders right; the rest and the menu on tap */
  .acc-page .table-wrap tbody tr { padding: 10px 16px; }
  .acc-page .table-wrap td.item { font-weight: 400; }
  .acc-page .table-wrap td.pri:not(.item) { flex: 1 1 0; padding-left: 19px; }
  .acc-page .table-wrap td.pri:not(.item) ~ td.pri { padding-left: 0; text-align: right; }
  .acc-page .table-wrap tr[aria-expanded="true"] > td:not(.pri) { padding-left: 19px; }
  .acc-page .table-wrap tr[aria-expanded="true"] > td.act { flex: 1 1 100%; margin-top: -40px; padding: 0; text-align: right; pointer-events: none; }
  .acc-page .table-wrap td.act .icon-btn { pointer-events: auto; }
  .table-wrap .acc-num { min-width: 0; gap: 3px; }
  .acc-menu button { padding: 12px; }
}
