:root {
  --bg: #121212;
  --bg-alt: #1a1a1a;
  --row-odd: #1c1c1c;
  --row-even: #252525;
  --text: #ffffff;
  --muted: #cceff3;
  --cyan: #00ffff;
  --line: #555;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at center, rgba(0, 255, 255, 0.15) 0%, transparent 60%), var(--bg);
  color: var(--text);
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding: 10px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(5, 18, 20, 0.75);
}

.header-image {
  width: 74px;
  filter: drop-shadow(0 0 10px var(--cyan));
}

h1 {
  margin: 0;
  font-size: 30px;
  color: #f2fcff;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.15);
}

h1 span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  justify-content: center;
}

.top-nav,
.bottom-nav {
  width: min(96vw, 1450px);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.top-nav a,
.bottom-nav a {
  padding: 7px 10px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: #0f0f0f;
  color: white;
}

.top-nav a:hover,
.bottom-nav a:hover {
  background: #1a1a1a;
}

.affiliate-disclosure {
  width: min(96vw, 1450px);
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(0, 255, 255, 0.06);
  color: #d6fafe;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.affiliate-disclosure strong {
  color: #f2fcff;
}

.affiliate-disclosure span {
  color: #bceff2;
}

.site-meta {
  width: min(96vw, 1450px);
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(0, 255, 255, 0.05);
  color: #c7f9fd;
  font-size: 13px;
  text-align: center;
}

button,
input {
  background: #0f0f0f;
  color: white;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  padding: 7px 10px;
}

button {
  cursor: pointer;
  font-weight: 700;
}

#globalSearch {
  min-width: min(320px, 70vw);
}

.column-chooser {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 14px;
  justify-content: center;
}

.results-count-popout {
  border: 1px solid var(--cyan);
  padding: 8px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(0, 255, 255, 0.08);
}

.filament-table-wrapper {
  width: min(96vw, 1450px);
  height: 70vh;
  overflow: auto;
  background: var(--bg-alt);
  border: 2px solid var(--cyan);
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.3);
}

.filament-table {
  width: 100%;
  border-collapse: collapse;
}

.filament-table thead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-alt);
  box-shadow: 0 2px 0 var(--cyan);
}

.filament-table thead tr,
.filament-table thead th {
  background: var(--bg-alt);
}

.filament-table th,
.filament-table td {
  border: 1px solid var(--line);
  text-align: center;
  padding: 8px 6px;
  height: 36px;
}

.filament-table th {
  color: var(--cyan);
  white-space: nowrap;
  font-weight: 700;
  cursor: grab;
  position: relative;
  overflow: hidden;
  background-clip: padding-box;
}

.filament-table th.dragging {
  opacity: 0.45;
}

.filament-table th.drag-over {
  outline: 2px solid #8efcff;
  outline-offset: -2px;
}

.col-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.col-label {
  cursor: pointer;
}

.sort-indicator {
  min-width: 12px;
  line-height: 1;
  font-size: 14px;
  color: #b9fdff;
  text-shadow: 0 0 4px rgba(185, 253, 255, 0.6);
  cursor: pointer;
}

.drag-handle {
  color: #8efcff;
  opacity: 0.7;
  font-size: 13px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.drag-handle:hover {
  opacity: 1;
}

.mobile-browser .app {
  padding: 8px 6px 10px;
}

.mobile-browser .app-header,
.mobile-browser .top-nav,
.mobile-browser .bottom-nav,
.mobile-browser .table-actions,
.mobile-browser .affiliate-disclosure,
.mobile-browser .site-meta,
.mobile-browser .column-chooser,
.mobile-browser .results-count-popout,
.mobile-browser .filament-table-wrapper {
  width: min(98vw, 980px);
}

.mobile-browser .app-header {
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.mobile-browser .header-image {
  width: 58px;
}

.mobile-browser h1 {
  font-size: 24px;
  line-height: 1.15;
}

.mobile-browser h1 span {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.mobile-browser .table-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.mobile-browser .table-actions > * {
  width: 100%;
  min-height: 42px;
}

.mobile-browser .top-nav,
.mobile-browser .bottom-nav {
  justify-content: flex-start;
  gap: 7px;
}

.mobile-browser .top-nav a,
.mobile-browser .bottom-nav a {
  font-size: 12px;
  padding: 5px 8px;
}

.mobile-browser .affiliate-disclosure {
  margin-bottom: 8px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
}

.mobile-browser .site-meta {
  margin-bottom: 8px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
}

.mobile-browser #globalSearch {
  grid-column: 1 / -1;
  min-width: 0;
}

.mobile-browser #searchBtn {
  grid-column: 1 / -1;
}

.mobile-browser .column-chooser {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 2px;
  font-size: 13px;
}

.mobile-browser .column-chooser strong,
.mobile-browser .column-chooser label {
  white-space: nowrap;
}

.mobile-browser .column-chooser label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mobile-browser .column-chooser::-webkit-scrollbar {
  height: 6px;
}

.mobile-browser .results-count-popout {
  margin-bottom: 8px;
  text-align: center;
}

.mobile-browser .filament-table-wrapper {
  height: 62vh;
  border-radius: 10px;
}

.mobile-browser .filament-table th,
.mobile-browser .filament-table td {
  padding: 10px 7px;
  min-height: 40px;
}

.mobile-browser .filament-table th {
  cursor: default;
}

.mobile-browser .col-head {
  gap: 6px;
}

.mobile-browser .facet-trigger {
  min-height: 28px;
  padding: 1px 7px;
}

.mobile-browser .filter-row input {
  min-height: 36px;
  font-size: 14px;
}

.mobile-browser .facet-dropdown {
  right: 4px;
  min-width: 190px;
  max-width: min(88vw, 300px);
  max-height: 260px;
}

.facet-trigger {
  border: 1px solid var(--cyan);
  background: #122027;
  color: #b9fdff;
  border-radius: 4px;
  padding: 0 6px;
  line-height: 1.2;
  font-size: 13px;
  cursor: pointer;
}

.facet-trigger.open {
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.45);
}

.facet-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 28px;
  z-index: 30;
  min-width: 220px;
  max-width: 320px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #121a21;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  padding: 8px;
  text-align: left;
}

.facet-clear {
  width: 100%;
  text-align: left;
  background: #0f151c;
  border: 1px solid #205460;
  color: #d6fafe;
  border-radius: 6px;
  margin: 0 0 8px;
  padding: 7px 8px;
  cursor: pointer;
}

.facet-clear:hover {
  border-color: var(--cyan);
  background: #13232d;
}

.facet-clear {
  font-weight: 700;
}

.facet-section-title {
  margin: 10px 2px 6px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8efcff;
}

.facet-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid #1a3b44;
  background: #0f151c;
  cursor: pointer;
}

.facet-check:hover {
  border-color: #32d9e5;
  background: #132129;
}

.facet-check input[type="checkbox"] {
  margin: 0;
}

.facet-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d6fafe;
}

.facet-count {
  color: #8ed3d9;
  font-size: 12px;
}

.facet-empty {
  margin: 6px 4px;
  color: #9acdd3;
  font-size: 12px;
  text-align: left;
}

.filter-row th {
  padding: 4px 6px;
  background: #171717;
}

.filter-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--cyan);
  background: #1a1a1a;
  color: white;
  text-align: center;
  font-size: 12px;
}

.price-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.filament-table tbody tr:nth-child(odd) { background: var(--row-odd); }
.filament-table tbody tr:nth-child(even) { background: var(--row-even); }
.filament-table tbody tr:hover { background: #333; }

a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
}

.doc-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.doc-shell {
  width: min(760px, 94vw);
  padding: 18px 20px;
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 14px;
  background: rgba(8, 22, 26, 0.78);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.doc-shell h1 {
  margin-bottom: 12px;
}

.doc-shell p {
  margin: 0 0 10px;
  color: #def7fa;
  line-height: 1.5;
}

@media (max-width: 720px) {
  h1 { font-size: 23px; }
  h1 span {
    display: block;
    font-size: 14px;
  }

  .header-image { width: 58px; }
  .filament-table-wrapper { height: 64vh; }

  .price-range {
    grid-template-columns: 1fr;
  }

  .facet-dropdown {
    right: 6px;
    min-width: 180px;
    max-width: 260px;
    max-height: 200px;
  }
}
