/* ponsGET — app shell components.
   Consumes the tokens in theme.css; defines no raw colors of its own
   except where a value is genuinely structural (overlay scrims, etc). */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--pg-bg);
  color: var(--pg-text);
  font: 400 14px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -.011em; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--pg-focus-ring);
  border-radius: 6px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  background: var(--pg-surface);
  border-right: 1px solid var(--pg-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 16px;
  text-decoration: none;
}

/* The chrome star has almost no contrast against a light surface — at this
   size it collapses into a grey smudge. It needs the red ground it was drawn
   on, so the sidebar mark is the star in a red tile, matching the favicon. */
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #C50102;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
}
.brand-mark img {
  display: block;
  width: 23px;
  height: 23px;
}

.brand-name {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -.02em;
}
/* "pons" quiet, "GET" in the signature red — the wordmark's whole trick */
.brand-name b { font-weight: 640; color: var(--pg-red); }

.nav-label {
  padding: 14px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pg-text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--pg-text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: background .14s var(--pg-ease), color .14s var(--pg-ease);
}

.nav-item svg { width: 17px; height: 17px; flex: none; }

.nav-item:hover { background: var(--pg-surface-2); color: var(--pg-text); }

.nav-item[aria-current="page"] {
  background: var(--pg-red);
  color: var(--pg-on-red);
}

.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--pg-surface-2);
  color: var(--pg-text-muted);
}
.nav-item[aria-current="page"] .count {
  background: rgba(255, 255, 255, .22);
  color: var(--pg-on-red);
}

.sidebar-foot { margin-top: auto; padding-top: 14px; }

.usage {
  padding: 12px;
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  background: var(--pg-bg);
}
.usage-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.usage-row span:last-child { color: var(--pg-text-muted); }

.meter {
  height: 5px;
  border-radius: 99px;
  background: var(--pg-surface-2);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--pg-red);
}

/* ==========================================================================
   Topbar
   ========================================================================== */

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--pg-border);
  background: color-mix(in srgb, var(--pg-bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--pg-text-muted);
  cursor: pointer;
  transition: background .14s var(--pg-ease), color .14s var(--pg-ease);
}
.icon-btn:hover { background: var(--pg-surface-2); color: var(--pg-text); }
.icon-btn svg { width: 18px; height: 18px; }

.menu-btn { display: none; }

.search {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--pg-text-muted);
  pointer-events: none;
}
.search input { padding-left: 32px; }
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--pg-text-muted);
  background: var(--pg-surface-2);
  border: 1px solid var(--pg-border);
  border-radius: 5px;
  padding: 3px 5px;
}

.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--pg-red);
  color: var(--pg-on-red);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  border: 0;
  cursor: pointer;
}

/* ==========================================================================
   Content
   ========================================================================== */

.content { padding-block: 24px; padding-inline: 20px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--pg-text-muted); margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; margin-left: auto; }

.section { margin-top: 30px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 15px; }
.section-head p { color: var(--pg-text-muted); font-size: 13px; }

/* ==========================================================================
   Cards & stat tiles
   ========================================================================== */

.card {
  background: var(--pg-surface);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius-lg);
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 14px; }
.card-head .actions { margin-left: auto; }

.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label {
  font-size: 12px;
  font-weight: 550;
  color: var(--pg-text-muted);
}
.stat .value {
  font-size: 25px;
  font-weight: 640;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}
.delta.up { color: #157F3D; }
.delta.down { color: var(--pg-red); }
.delta .rest { color: var(--pg-text-muted); font-weight: 500; }
:root[data-theme="dark"] .delta.up { color: #4ADE80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .delta.up { color: #4ADE80; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .14s var(--pg-ease), border-color .14s var(--pg-ease),
              color .14s var(--pg-ease), transform .06s var(--pg-ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--pg-red); color: var(--pg-on-red); }
.btn-primary:hover { background: var(--pg-red-hover); }
.btn-primary:active { background: var(--pg-red-press); }

.btn-secondary {
  background: var(--pg-bg);
  border-color: var(--pg-border);
  color: var(--pg-text);
}
.btn-secondary:hover { background: var(--pg-surface-2); }

.btn-ghost { background: transparent; color: var(--pg-text-muted); }
.btn-ghost:hover { background: var(--pg-surface-2); color: var(--pg-text); }

.btn-danger {
  background: transparent;
  border-color: var(--pg-red);
  color: var(--pg-red-ink);
}
.btn-danger:hover { background: var(--pg-red-tint); }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 550; }
.field .hint { font-size: 12px; color: var(--pg-text-muted); }
.field .error { font-size: 12px; color: var(--pg-red-ink); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--pg-border);
  border-radius: 8px;
  background: var(--pg-bg);
  color: var(--pg-text);
  font: inherit;
  transition: border-color .14s var(--pg-ease), box-shadow .14s var(--pg-ease);
}
.input::placeholder, .textarea::placeholder { color: var(--pg-text-muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--pg-red);
  box-shadow: var(--pg-focus-ring);
}
.textarea { resize: vertical; min-height: 76px; }
.input[aria-invalid="true"] { border-color: var(--pg-red); }

.select {
  appearance: none;
  padding-right: 30px;
  /* caret drawn inline so it inherits currentColor in both themes */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
}

/* Checkbox & radio */
.check { display: flex; align-items: flex-start; gap: 8px; }
.check input {
  appearance: none;
  width: 16px;
  height: 16px;
  flex: none;
  margin: 2px 0 0;
  border: 1.5px solid var(--pg-border);
  border-radius: 4px;
  background: var(--pg-bg);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background .12s var(--pg-ease), border-color .12s var(--pg-ease);
}
.check input[type="radio"] { border-radius: 50%; }
.check input::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform .12s var(--pg-ease);
  box-shadow: inset 1em 1em var(--pg-on-red);
  clip-path: polygon(14% 47%, 0 60%, 39% 96%, 100% 26%, 86% 14%, 38% 70%);
}
.check input[type="radio"]::before {
  border-radius: 50%;
  clip-path: none;
  width: 6px;
  height: 6px;
}
.check input:checked { background: var(--pg-red); border-color: var(--pg-red); }
.check input:checked::before { transform: scale(1); }
.check label { font-size: 13px; cursor: pointer; }
.check .hint { display: block; color: var(--pg-text-muted); font-size: 12px; }

/* Switch */
.switch { display: flex; align-items: center; gap: 9px; }
.switch input {
  appearance: none;
  width: 34px;
  height: 20px;
  flex: none;
  margin: 0;
  border-radius: 99px;
  background: var(--pg-surface-2);
  border: 1px solid var(--pg-border);
  position: relative;
  cursor: pointer;
  transition: background .16s var(--pg-ease), border-color .16s var(--pg-ease);
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pg-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: transform .16s var(--pg-ease);
}
.switch input:checked { background: var(--pg-red); border-color: var(--pg-red); }
.switch input:checked::after { transform: translateX(14px); }
.switch label { font-size: 13px; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--pg-border);
}

/* ==========================================================================
   Table
   ========================================================================== */

.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pg-text-muted);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--pg-border);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--pg-border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s var(--pg-ease); }
tbody tr:hover { background: var(--pg-surface-2); }
td .mono {
  font: 500 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--pg-text-muted);
}
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Badges & alerts
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--pg-border);
  background: var(--pg-bg);
  color: var(--pg-text-muted);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-brand { background: var(--pg-red); border-color: var(--pg-red); color: var(--pg-on-red); }
.badge-live { color: #157F3D; border-color: currentColor; }
.badge-warn { color: #8A5300; border-color: currentColor; }
.badge-plain::before { display: none; }
:root[data-theme="dark"] .badge-live { color: #4ADE80; }
:root[data-theme="dark"] .badge-warn { color: #FBBF24; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-live { color: #4ADE80; }
  :root:not([data-theme="light"]) .badge-warn { color: #FBBF24; }
}

.alert {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--pg-radius);
  border: 1px solid var(--pg-border);
  background: var(--pg-surface);
  font-size: 13px;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { color: var(--pg-text-muted); }
.alert-brand {
  border-color: var(--pg-red);
  background: var(--pg-red-tint);
}
.alert-brand svg { color: var(--pg-red); }
.alert-brand strong { color: var(--pg-red-ink); }
.alert-brand p { color: var(--pg-red-ink); opacity: .82; }

/* ==========================================================================
   The brand-red panel — the one place the logo's ground shows up whole
   ========================================================================== */

.brand-panel {
  border-radius: var(--pg-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  position: relative;
}
.brand-panel .star {
  width: 92px;
  height: 92px;
  flex: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .3));
}
.brand-panel h3 { font-size: 16px; margin-bottom: 5px; }
.brand-panel p { font-size: 13px; color: var(--pg-text-muted); max-width: 46ch; }
.brand-panel .actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
/* on the red ground, the primary button inverts to chrome */
.brand-panel .btn-primary {
  background: var(--pg-chrome-gradient);
  color: #16110F;
}
.brand-panel .btn-primary:hover { background: var(--pg-chrome-hi); }
.brand-panel .btn-secondary {
  background: transparent;
  border-color: var(--pg-border);
  color: var(--pg-text);
}
.brand-panel .btn-secondary:hover { background: rgba(255, 255, 255, .12); }

/* ==========================================================================
   Responsive
   ========================================================================== */

.scrim { display: none; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 262px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .22s var(--pg-ease);
  }
  .sidebar.open { transform: none; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--pg-ease);
  }
  .scrim.show { opacity: 1; pointer-events: auto; }

  .menu-btn { display: inline-flex; }
  .search kbd { display: none; }
  .brand-panel { flex-direction: column; align-items: flex-start; }
  .brand-panel .actions { margin-left: 0; }
}

@media (max-width: 620px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding-inline: 16px; }
  .topbar { padding-inline: 16px; }
  .page-head .actions { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ==========================================================================
   Page furniture added with the multi-page shell
   ========================================================================== */

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.strong { font-weight: 550; }
.muted { color: var(--pg-text-muted); }
td.right, th.right { text-align: right; }
.stat .value small { font-size: 15px; font-weight: 550; }

/* stat tiles double as links to the page that explains them */
a.card.stat, a.cell-link { text-decoration: none; color: inherit; }
a.card.stat { transition: border-color .14s var(--pg-ease); }
a.card.stat:hover { border-color: var(--pg-red); }
a.cell-link { font-weight: 550; }
a.cell-link:hover { color: var(--pg-red); }
a.avatar { text-decoration: none; }

/* Filter row — one row above the content, per the chart interaction rules */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.filters .search { flex: 0 1 280px; }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--pg-text-muted); }

.control-row { display: flex; flex-wrap: wrap; gap: 20px; }

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.meter-lg { height: 9px; }

.table-compact td { padding: 7px 10px; }
tbody tr.is-muted td { opacity: .6; }

.feed { display: flex; flex-direction: column; gap: 11px; font-size: 13px; }
.feed-row { display: flex; gap: 9px; align-items: baseline; }
.feed-meta { color: var(--pg-text-muted); font-size: 12px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 12.5px;
}

/* People */
.person { display: flex; align-items: center; gap: 9px; }
.avatar-sm {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  background: var(--pg-red);
  color: var(--pg-on-red);   /* dark ink in dark mode — the lifted red is bright */
  display: grid; place-items: center;
  font-size: 11px; font-weight: 650;
}
/* Non-brand avatars keep a fixed slate that reads in both themes, so they
   carry their own ink rather than inheriting the on-red token. */
.avatar-neutral { background: #4B5563; color: #FFFFFF; }
.avatar-empty {
  background: transparent;
  border: 1.5px dashed var(--pg-border);
  color: var(--pg-text-muted);
}

.select-sm { padding: 4px 26px 4px 8px; font-size: 12.5px; width: auto; background-size: 13px; }

/* Plans */
.plan { display: flex; flex-direction: column; gap: 12px; }
.plan-head { display: flex; align-items: center; gap: 8px; }
.plan-head h3 { font-size: 14px; }
.plan-head .badge { margin-left: auto; }
.plan.is-current { border-color: var(--pg-red); }
.plan-price { font-size: 27px; font-weight: 640; letter-spacing: -.025em; }
.plan-price span { font-size: 13px; font-weight: 500; color: var(--pg-text-muted); }
.plan-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--pg-text-muted);
  flex: 1;
}
.plan-list li { display: flex; gap: 7px; align-items: baseline; }
.plan-list li::before {
  content: "";
  width: 5px; height: 5px; flex: none;
  border-radius: 50%;
  background: var(--pg-red);
}

/* Payment method */
.pay { display: flex; align-items: center; gap: 11px; }
.pay-chip {
  display: grid; place-items: center;
  width: 44px; height: 29px; flex: none;
  border: 1px solid var(--pg-border);
  border-radius: 5px;
  background: var(--pg-bg);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
}

/* Danger zone */
.card-danger { border-color: var(--pg-red); padding: 0; }
.danger-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px;
}
.danger-row + .danger-row { border-top: 1px solid var(--pg-border); }
.danger-row > div { flex: 1; min-width: 200px; }
.danger-row p { font-size: 12.5px; margin-top: 2px; }

/* Status badge for 5xx — labelled, so state never rests on color alone */
.badge-bad { color: var(--pg-red-ink); border-color: currentColor; }

/* ==========================================================================
   Chart — one series, so the heading names it and no legend box is needed
   ========================================================================== */

.chart { margin: 0; }

.chart-plot {
  position: relative;
  height: 200px;
  padding-left: 48px;
}

.chart-grid {
  position: absolute;
  inset: 0 0 0 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* recessive: a hairline and small muted type, never competing with the marks */
.chart-line { position: relative; height: 0; border-top: 1px solid var(--pg-border); }
.chart-line span {
  position: absolute;
  right: 100%;
  top: -.62em;
  padding-right: 8px;
  font-size: 11px;
  color: var(--pg-text-muted);
  font-variant-numeric: tabular-nums;
}

.chart-bars {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 2px;              /* surface gap between adjacent bars */
}

/* the whole column is the hit target, not just the painted part */
.bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  outline: none;
}
.bar > i {
  display: block;
  position: relative;
  width: 100%;
  max-width: 24px;   /* keep the mark thin on wide screens */
  margin: 0 auto;
  background: var(--pg-red);
  border-radius: 4px 4px 0 0;   /* rounded data-end, anchored to the baseline */
  transition: background .12s var(--pg-ease);
}
.bar:hover > i, .bar.is-on > i { background: var(--pg-red-hover); }
.bar:focus-visible > i { box-shadow: var(--pg-focus-ring); }

/* One selective direct label on the peak — never a number on every bar, and
   never a different fill, which would encode rank in a color that means
   "this series". The label wears text tokens, not the series color. */
.bar > i > b {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 620;
  color: var(--pg-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chart-tip {
  position: absolute;
  top: 4px;
  z-index: 5;
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--pg-border);
  background: var(--pg-bg);
  box-shadow: var(--pg-shadow);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}
.chart-tip b { font-weight: 650; }
.chart-tip span { display: block; color: var(--pg-text-muted); }

.chart-x {
  display: flex;
  gap: 2px;
  padding-left: 48px;
  margin-top: 7px;
}
.chart-x span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 11px;
  color: var(--pg-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Share bar inside a table cell */
td.share { white-space: nowrap; }
.share-bar {
  display: inline-block;
  width: 54px;
  height: 5px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 99px;
  background: var(--pg-surface-2);
  overflow: hidden;
}
.share-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--pg-red); }

@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .filters .search { flex: 1 1 100%; max-width: none; }
  .filter-count { margin-left: 0; }
  .chart-plot, .chart-x { padding-left: 40px; }
  .chart-grid { inset: 0 0 0 40px; }
  /* bars are ~8px wide here — a 4px cap turns them into pills */
  .bar > i { border-radius: 2px 2px 0 0; }
}
