/*
 * ProjectGlass UI. Hand-authored, no build step: a from-scratch design
 * system and stylesheet, entirely original.
 */

:root {
  --pg-bg: #ffffff;
  --pg-bg-raised: #f6f7f8;
  --pg-border: #e2e5e9;
  --pg-text: #1a1d21;
  /* --pg-text-muted/--pg-text-faint/--pg-accent/--pg-link* are tuned to
     clear WCAG AAA's 7:1 text-contrast threshold against --pg-bg (verified
     by hand, not just eyeballed). Don't lighten these back toward the
     brighter original brand teal without re-checking the ratio. */
  --pg-text-muted: #40464f;
  --pg-text-faint: #444954;
  --pg-accent: #075850;
  --pg-accent-contrast: #ffffff;
  --pg-link: #075850;
  --pg-link-visited: #0a4b44;
  --pg-focus-ring: #075850;
  /* .pg-tooltip's background is var(--pg-text) (inverted), so this needs
     its own AAA-checked value rather than reusing --pg-text-faint, which
     is calibrated against --pg-bg instead. */
  --pg-tooltip-label: #b4b4b4;
  --pg-shadow: 0 1px 2px rgba(20, 20, 20, 0.06), 0 1px 8px rgba(20, 20, 20, 0.04);
  --pg-radius: 10px;
  --pg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pg-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root:not([data-pg-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --pg-bg: #16181d;
    --pg-bg-raised: #1e2126;
    --pg-border: #2b2f36;
    --pg-text: #eef0f2;
    --pg-text-muted: #b3bac4;
    --pg-text-faint: #adb4bf;
    --pg-accent: #2dd4bf;
    --pg-accent-contrast: #0a1210;
    --pg-link: #2dd4bf;
    --pg-link-visited: #5eead4;
    --pg-focus-ring: #2dd4bf;
    --pg-tooltip-label: #464646;
    --pg-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.25);
  }
}

:root[data-pg-theme="dark"] {
  --pg-bg: #16181d;
  --pg-bg-raised: #1e2126;
  --pg-border: #2b2f36;
  --pg-text: #eef0f2;
  --pg-text-muted: #b3bac4;
  --pg-text-faint: #adb4bf;
  --pg-accent: #2dd4bf;
  --pg-accent-contrast: #0a1210;
  --pg-link: #2dd4bf;
  --pg-link-visited: #5eead4;
  --pg-focus-ring: #2dd4bf;
  --pg-tooltip-label: #464646;
  --pg-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

/* Inline icon SVGs (see templates/icons.html) ship with no width/height of
   their own: without an explicit size they fall back to the browser's
   unconstrained-SVG default (~300px). */
.pg-icon {
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.pg-icon-sm {
  width: 14px;
  height: 14px;
}

.pg-icon-md {
  width: 16px;
  height: 16px;
}

.pg-icon-lg {
  width: 20px;
  height: 20px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--pg-bg);
  color: var(--pg-text);
  font-family: var(--pg-font);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--pg-link);
  text-decoration: none;
}

a:visited {
  color: var(--pg-link-visited);
}

a:hover {
  text-decoration: underline;
}

/* Links inside running prose need a non-color cue at all times (not just
   hover), so they're distinguishable without relying on color alone. */
.pg-doc p a,
.pg-doc-note a,
.pg-account-note a,
footer p a {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--pg-focus-ring);
  outline-offset: 2px;
}

/* Visually hidden but present for screen readers/AT (the standard
   clip-based pattern, not display:none which would remove it from the
   accessibility tree too). */
.pg-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pg-skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.pg-skip-link:focus {
  top: 0;
}

/* === layout shell === */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

#pg-topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  max-width: 1280px;
  margin: 0 auto;
}

#pg-topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--pg-text-muted);
  font-size: 13px;
  font-weight: 500;
}

#pg-topnav a:hover {
  background: var(--pg-bg-raised);
  color: var(--pg-text);
  text-decoration: none;
}

/* icon sizing/fill now comes from .pg-icon/.pg-icon-* (see templates/partials.html) */

.pg-theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 3px;
  border: 1px solid var(--pg-border);
  border-radius: 10px;
}

.pg-theme-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--pg-text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* #pg-topnav a (ID + type) outranks a plain .pg-theme-switch a[...]
   selector (class + attribute + type) no matter what order they're
   declared in, since an ID always wins over any number of classes. These
   two need the #pg-topnav prefix to actually override it. */
#pg-topnav .pg-theme-switch a:hover {
  background: var(--pg-bg-raised);
  color: var(--pg-text);
  text-decoration: none;
}

#pg-topnav .pg-theme-switch a[aria-current="true"] {
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
}

footer {
  padding: 24px 20px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--pg-text-faint);
}

footer a {
  color: var(--pg-text-muted);
}

.dialog-error {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: var(--pg-radius);
  background: #fee2e2;
  color: #8a1717;
  border: 1px solid #fecaca;
}

/* === homepage === */

.pg-home {
  /* Percentage, not a vh-minus-fixed-px calc: main already fills exactly
     "100vh minus however tall nav+footer actually render" via its own
     flex:1 in the body flex column, so sizing off that (a definite value
     once flex-resolved) tracks nav/footer height automatically instead
     of needing to be re-tuned by hand whenever either one changes. */
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.pg-wordmark {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pg-accent);
  margin: 0;
}

/* === search box === */

.pg-search-box {
  width: 100%;
  max-width: 620px;
  min-width: 0;
}

/* #search is the actual flex item inside #search_header (the .pg-search-box
   wrapper class only exists on the homepage, not here); without its own
   min-width:0 it wouldn't shrink below its content's preferred size,
   min-width:0 on the input and .pg-search-field alone isn't enough since
   each nesting level of a flex item needs the override applied itself. */
#search {
  min-width: 0;
}

#search .search_box,
.pg-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  border-radius: 999px;
  padding: 4px 6px 4px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#search .search_box:focus-within,
.pg-search-field:focus-within {
  border-color: var(--pg-accent);
  box-shadow: 0 0 0 3px var(--pg-focus-ring);
}

#search input#q {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--pg-text);
  font-size: 16px;
  font-family: var(--pg-font);
  padding: 12px 0;
  min-width: 0;
}

#search input#q::placeholder {
  color: var(--pg-text-faint);
}

#search button#send_search,
#search button#clear_search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--pg-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

#search button#send_search:hover {
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
}

#search button#clear_search:hover {
  background: var(--pg-border);
  color: var(--pg-text);
}

.autocomplete {
  position: relative;
}

.autocomplete ul {
  position: absolute;
  top: calc(100% + 8px);
  left: -20px;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--pg-bg);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  box-shadow: var(--pg-shadow);
  z-index: 20;
}

.autocomplete ul:empty {
  display: none;
}

.autocomplete li {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.autocomplete li:hover,
.autocomplete li.active {
  background: var(--pg-bg-raised);
}

.pg-result-count {
  font-size: 13.5px;
  color: var(--pg-text-faint);
  margin: -6px 0 14px;
}

#pg-more-form {
  text-align: center;
  margin: 28px 0 8px;
}

#pg-more-button {
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid var(--pg-border);
  background: var(--pg-bg-raised);
  color: var(--pg-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

#pg-more-button:hover {
  border-color: var(--pg-accent);
  color: var(--pg-accent);
}

/* Purely a scroll-trigger target for pg.js's IntersectionObserver, never
   meant to be seen: kept a real element in normal flow (not
   display:none) so it actually has a position to observe. */
#pg-scroll-sentinel {
  height: 1px;
}

/* === results-page header === */

#search_header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}

#search_logo {
  flex-shrink: 0;
  color: var(--pg-accent);
  display: flex;
  align-items: center;
}

#search_logo svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

#search_view {
  flex: 1;
  min-width: 240px;
}

#categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--pg-border);
  margin-bottom: 16px;
}

#categories .category_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--pg-text-muted);
  border: 1px solid transparent;
}

#categories .category_button:hover {
  background: var(--pg-bg-raised);
  text-decoration: none;
}

#categories .category_button.selected {
  color: var(--pg-accent);
  background: color-mix(in srgb, var(--pg-accent) 12%, transparent);
}

#categories svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.search_filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 13px;
}

.search_filters select {
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--pg-text);
  font-size: 13px;
}

/* === results layout === */

/* Single column: results.html never renders #sidebar/#answers/etc (those
   are unused SearXNG-style hooks left in place below in case a sidebar
   feature gets built later), so reserving a second grid track for them
   just steals width from the actual result cards. */
#results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* #results is a grid, so *every* direct child is a grid item, not just
   the two-column content (#urls/#sidebar) but also #answers, #corrections,
   #backToTop and #pagination if present. Each needs a deliberate
   placement: #urls/#sidebar into the two content columns (via `order`,
   since #sidebar comes first in results.html's DOM order but should
   render in the narrow *second* column), everything else spanning the
   full width as its own row. */
#answers,
#corrections,
#backToTop,
#pagination {
  grid-column: 1 / -1;
}

#urls {
  min-width: 0;
  order: 2;
}

#sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  color: var(--pg-text-muted);
  order: 3;
}

#backToTop {
  order: 4;
}

#pagination {
  order: 5;
}

#sidebar .sidebar-collapsible {
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  padding: 10px 14px;
}

#sidebar .title {
  font-weight: 600;
  color: var(--pg-text);
  cursor: pointer;
}

#engines_msg-title {
  cursor: pointer;
  color: var(--pg-text-faint);
}

@media (max-width: 760px) {
  #results {
    grid-template-columns: 1fr;
  }

  #sidebar {
    order: 2;
  }
}

@media (max-width: 640px) {
  /* Right-aligning (the desktop default) leaves a lopsided gap once nav
     items wrap to more than one row. Centering each wrapped row reads as
     intentional instead of broken. */
  #pg-topnav {
    justify-content: center;
  }

  .pg-theme-switch {
    margin-left: 0;
  }

  /* Search/About/Transparency/Account (and the theme switch) with
     visible labels need more width than even the widest common phone
     gives after main's padding. Icon-only keeps everything on one line
     next to the nav instead of the switch wrapping onto its own row;
     the label stays in the DOM (visually hidden, not display:none) so
     screen readers and text browsers still get it. */
  #pg-topnav a,
  .pg-theme-switch a {
    min-width: 44px;
    padding: 6px 10px;
    gap: 0;
  }

  #pg-topnav a span,
  .pg-theme-switch a span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* === result cards === */

.result {
  padding: 14px 0;
  border-bottom: 1px solid var(--pg-border);
  position: relative;
}

.result:first-child {
  padding-top: 0;
}

.result .url_header,
.result .url_wrapper {
  display: inline-block;
}

.result a.url_header {
  text-decoration: none;
}

.result .url_wrapper {
  font-size: 13px;
  color: var(--pg-text-faint);
  word-break: break-word;
}

.result .url_wrapper .url_i1 {
  color: var(--pg-text-muted);
}

.result h2 {
  margin: 2px 0 4px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.result h2 a {
  color: var(--pg-text);
}

.result h2 a:hover {
  color: var(--pg-accent);
  text-decoration: none;
}

.result .content {
  margin: 4px 0 8px;
  color: var(--pg-text-muted);
  font-size: 14px;
}

.result .content.empty_element {
  font-style: italic;
  color: var(--pg-text-faint);
}

.result .highlight {
  background: color-mix(in srgb, var(--pg-accent) 25%, transparent);
  border-radius: 3px;
  padding: 0 2px;
}

/* engine attribution row + transparency tooltip (Phase 6) */

.result .engines {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--pg-text-faint);
}

.pg-source-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  cursor: default;
}

.pg-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 10;
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  background: var(--pg-text);
  color: var(--pg-bg);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: var(--pg-shadow);
  white-space: normal;
}

.pg-source-tag:hover .pg-tooltip,
.pg-source-tag:focus-within .pg-tooltip,
.pg-intent-info:hover .pg-tooltip,
.pg-intent-info:focus-within .pg-tooltip {
  display: block;
}

.pg-tooltip dt {
  font-weight: 600;
  color: var(--pg-tooltip-label);
}

.pg-tooltip dd {
  margin: 0 0 6px;
  word-break: break-word;
}

.pg-tooltip-note {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--pg-bg) 25%, transparent);
  color: var(--pg-tooltip-label);
}

/* Info icon next to the search box explaining how the query was
   understood: same hover/focus tooltip mechanism as .pg-source-tag,
   just anchored to the search header instead of a result. */
.pg-intent-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  color: var(--pg-text-faint);
  flex-shrink: 0;
  cursor: default;
}

.pg-intent-info:hover {
  background: var(--pg-bg-raised);
  color: var(--pg-text-muted);
}

.pg-intent-info .pg-tooltip-intent {
  bottom: auto;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  min-width: 260px;
  max-width: 360px;
}

.result .cache_link {
  margin-left: auto;
  color: var(--pg-text-faint);
}

/* === pagination === */

#pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--pg-border);
}

#pagination button,
#pagination input[type="submit"],
#pagination input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--pg-border);
  background: var(--pg-bg-raised);
  color: var(--pg-text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

#pagination .page_number_current {
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
  border-color: var(--pg-accent);
}

#pagination .numbered_pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

#backToTop {
  text-align: center;
  margin-top: 12px;
}

#backToTop a {
  color: var(--pg-text-faint);
}

/* === plain document pages (about) === */

.pg-doc {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

.pg-doc h1 {
  font-size: 22px;
  margin: 0 0 18px;
}

.pg-doc h2 {
  font-size: 15.5px;
  margin: 30px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--pg-border);
}

.pg-doc h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pg-doc p {
  margin: 0 0 4px;
  color: var(--pg-text);
  line-height: 1.65;
  font-size: 14.5px;
}

.pg-doc .pg-doc-note {
  margin: 0 0 16px;
  color: var(--pg-text-faint);
  font-size: 12.5px;
  line-height: 1.55;
}

.pg-doc .pg-stat-table {
  margin: 4px 0 16px;
}

/* === account pages === */

.pg-account-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pg-account-h1 {
  font-size: 20px;
  margin: 0;
}

.pg-account-panel {
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  padding: 20px;
}

.pg-account-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  word-break: break-word;
}

.pg-account-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--pg-text-muted);
}

.pg-account-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fee2e2;
  color: #8a1717;
  border: 1px solid #fecaca;
  font-size: 13px;
}

.pg-account-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pg-account-form label {
  font-size: 13px;
  color: var(--pg-text-muted);
}

.pg-account-form .pg-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--pg-text);
}

.pg-account-form input[type="email"],
.pg-account-form input[type="password"],
.pg-account-form input[type="text"] {
  border: 1px solid var(--pg-border);
  background: var(--pg-bg);
  color: var(--pg-text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--pg-font);
}

.pg-account-form button {
  align-self: flex-start;
  margin-top: 4px;
  min-height: 44px;
  border: none;
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pg-account-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--pg-border);
  background: transparent;
  color: var(--pg-text-muted);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  cursor: pointer;
}

.pg-domain-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pg-domain-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pg-border);
  border-radius: 8px;
}

.pg-domain-name {
  flex: 1;
  word-break: break-word;
  font-size: 13.5px;
}

.pg-domain-type {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--pg-text-faint);
}

.pg-domain-add {
  padding-top: 14px;
  border-top: 1px solid var(--pg-border);
}

/* === admin dashboard === */

.pg-admin {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

.pg-admin h1 {
  font-size: 22px;
  margin: 0 0 18px;
}

.pg-admin h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pg-text-muted);
  margin: 30px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--pg-border);
}

.pg-admin h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pg-admin-note {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--pg-text-faint);
}

.pg-admin-empty {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--pg-text-faint);
}

.pg-stat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pg-stat-table th,
.pg-stat-table td {
  text-align: left;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--pg-border);
}

.pg-stat-table tbody tr:last-child th,
.pg-stat-table tbody tr:last-child td {
  border-bottom: none;
}

.pg-stat-table thead th {
  color: var(--pg-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.pg-stat-table tbody th {
  color: var(--pg-text-muted);
  font-weight: 400;
}

.pg-stat-table td {
  color: var(--pg-text);
}

.pg-admin-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  background: var(--pg-bg-raised);
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
}

.pg-admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--pg-text-muted);
}

.pg-admin-form input[type="text"] {
  border: 1px solid var(--pg-border);
  background: var(--pg-bg);
  color: var(--pg-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--pg-font);
  min-width: 140px;
}

.pg-admin-form button {
  min-height: 44px;
  border: none;
  background: var(--pg-accent);
  color: var(--pg-accent-contrast);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pg-admin-form button.pg-admin-danger {
  background: #991515;
  color: #ffffff;
}

.pg-admin-inline-form {
  display: inline;
}
