/* Hola Prime palette: near-black surfaces, electric blue -> cyan accent (holaprime.com) */
:root {
  --bg: #050607;
  --surface: #0f1114;
  --surface-2: #15181c;
  --surface-3: #1c2026;
  --border: #23272e;
  --text: #f3f5f8;
  --muted: #8a919b;
  --faint: #5d646e;
  --blue: #007aff;
  --cyan: #0dd6ec;
  --navy: #083b70;
  --grad: linear-gradient(90deg, #007aff 0%, #0dd6ec 100%);
  --good: #2fd480;
  --bad: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(0, 122, 255, .14), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 6, 7, .82);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.category-picker select {
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230dd6ec' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 44px 10px 16px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; min-width: 170px;
  transition: border-color .15s;
}
.category-picker select:hover, .category-picker select:focus { border-color: var(--blue); outline: none; }
.category-picker option { background: var(--surface-2); }

.brand { display: flex; align-items: center; gap: 12px; text-align: right; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.brand h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none; order: 2;
  background: var(--grad); background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 20px rgba(0, 122, 255, .35);
}

/* ---------------------------------------------------------------- toolbar */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1360px; margin: 0 auto; padding: 22px 32px 0;
}
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(47, 212, 128, .15); }
.status.updating .dot { background: var(--cyan); animation: pulse 1.2s infinite; }
.status.error .dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(255, 107, 107, .15); }
@keyframes pulse { 50% { opacity: .3; } }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 14px; width: 200px; outline: none;
}
.actions input:focus { border-color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); border: 0; border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; color: #fff;
  box-shadow: 0 4px 18px rgba(0, 122, 255, .3);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0, 122, 255, .42); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); box-shadow: none; color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.badge { background: #fff; color: var(--blue); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }

main { max-width: 1360px; margin: 0 auto; padding: 18px 32px 40px; }

/* ---------------------------------------------------------------- Hola Prime spotlight */
.spotlight {
  position: relative; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(0, 122, 255, .16), rgba(13, 214, 236, .05) 60%), var(--surface);
  border: 1px solid rgba(0, 122, 255, .35);
}
.spot-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.spot-head .logo { width: 44px; height: 44px; }
.spot-head h2 { margin: 0; font-size: 18px; }
.spot-head p { margin: 2px 0 0; color: var(--muted); }
.spot-rank {
  margin-left: auto; text-align: right;
}
.spot-rank strong { font-size: 30px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.spot-rank span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: rgba(5, 6, 7, .55); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 20px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.01em; }
.tile .value.small { font-size: 15px; line-height: 1.3; }
.tile .compare { font-size: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.tag.good { color: var(--good); background: rgba(47, 212, 128, .12); }
.tag.bad { color: var(--bad); background: rgba(255, 107, 107, .12); }
.tag.even { color: var(--muted); background: var(--surface-3); }
.spot-empty { color: var(--muted); margin: 0; }
.spot-empty strong { color: var(--text); }

/* ---------------------------------------------------------------- table */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; flex-wrap: wrap; }
.table-head h2 { margin: 0; font-size: 16px; }
.table-head p { margin: 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1060px; }
th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
tbody tr.firm { cursor: pointer; transition: background .12s; }
tbody tr.firm:hover { background: var(--surface-2); }
tbody tr.firm.open { background: var(--surface-2); }
tbody tr.hp { background: linear-gradient(90deg, rgba(0, 122, 255, .16), rgba(0, 122, 255, .03)); }
tbody tr.hp td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
tbody tr.hp:hover, tbody tr.hp.open { background: linear-gradient(90deg, rgba(0, 122, 255, .24), rgba(0, 122, 255, .06)); }
.c-rank { width: 64px; }
.rank { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.rank.top { background: var(--grad); color: #fff; }
.rank.none { background: transparent; color: var(--faint); font-weight: 500; }
.firm-cell { display: flex; align-items: center; gap: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); }
.logo img { width: 72%; height: 72%; object-fit: contain; }
.firm-name { font-weight: 600; }
.firm-meta { color: var(--muted); font-size: 12px; }
.hp-pill { font-size: 10px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
.star { color: #ffc93c; }
.sub { color: var(--muted); font-size: 12px; }
.na { color: var(--faint); }
.c-offer { width: 28%; }
td.offer { white-space: normal; min-width: 220px; max-width: 320px; }
.offer-code { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 11px; font-weight: 600; color: var(--cyan); border: 1px dashed rgba(13, 214, 236, .45); border-radius: 6px; padding: 0 6px; margin-bottom: 3px; }
.offer-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #cdd2d8; font-size: 13px; }
tr.divider td { background: var(--bg); color: var(--muted); font-size: 12px; padding: 14px; font-weight: 500; cursor: default; }
tr.divider td strong { color: var(--text); font-weight: 600; }

/* expanded firm details */
tr.details td { background: var(--surface-2); padding: 0; white-space: normal; cursor: default; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 28px; padding: 18px 22px 22px 92px; }
.details-grid h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.details-grid p { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { background: var(--surface-3); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 12px; }
.details-link { grid-column: 1 / -1; }

.empty { padding: 30px; text-align: center; color: var(--muted); margin: 0; }
footer { color: var(--faint); font-size: 12px; text-align: center; margin-top: 22px; }

/* ---------------------------------------------------------------- changes drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); z-index: 50;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 6px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; width: 34px; height: 34px; cursor: pointer; }
.icon-btn:hover { border-color: var(--blue); }
.drawer-filters { display: flex; align-items: center; gap: 16px; padding: 12px 24px 0; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.segmented button { background: none; border: 0; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; }
.segmented button.on { background: var(--blue); color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); user-select: none; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--blue); border-color: var(--blue); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.switch input:checked ~ * { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 24px 0; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip.on { border-color: var(--cyan); color: var(--text); background: rgba(13, 214, 236, .1); }
.drawer-sub { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.drawer-body { overflow-y: auto; padding: 4px 24px 30px; flex: 1; }
.day { margin-top: 20px; }
.day h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; display: flex; justify-content: space-between; }
.change {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.change.hp { border-color: rgba(0, 122, 255, .55); background: linear-gradient(90deg, rgba(0, 122, 255, .12), var(--surface-2)); }
.change-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-firm { font-weight: 600; }
.change-type { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; background: var(--surface-3); color: var(--muted); }
.change-type.Price { color: #7cc4ff; background: rgba(0, 122, 255, .15); }
.change-type.Offer { color: var(--cyan); background: rgba(13, 214, 236, .12); }
.change-type.PFMrank { color: #c9a7ff; background: rgba(150, 100, 255, .15); }
.change-type.Rules { color: #ffc46b; background: rgba(255, 180, 60, .13); }
.change-type.Listing, .change-type.Challenge { color: var(--good); background: rgba(47, 212, 128, .12); }
.change-cat { font-size: 11px; color: var(--faint); text-transform: capitalize; }
.change-time { margin-left: auto; font-size: 12px; color: var(--faint); }
.change-what { margin-top: 4px; color: #d5dae0; }
.fromto { font-variant-numeric: tabular-nums; }
.fromto .old { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(138, 145, 155, .6); }
.fromto .arrow { color: var(--faint); margin: 0 6px; }
.fromto .new { color: var(--text); font-weight: 600; }
.fromto .new.up { color: var(--good); }
.fromto .new.down { color: var(--bad); }
.change details { margin-top: 6px; }
.change summary { cursor: pointer; color: var(--cyan); font-size: 12px; list-style: none; }
.change summary::-webkit-details-marker { display: none; }
.change summary::before { content: "▸ "; }
.change details[open] summary::before { content: "▾ "; }
.items { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px dashed var(--border); }
.items li .name { color: #c3c9d0; }
.items li .fromto { white-space: nowrap; }
.items li.block { display: block; }
.textdiff { margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--border); font-size: 13px; line-height: 1.5; }
.textdiff .del { color: var(--bad); }
.textdiff .add { color: var(--good); }
.textdiff .sign { display: inline-block; width: 14px; opacity: .75; }
.textdiff details { margin-top: 2px; }

@media (max-width: 760px) {
  .topbar { padding: 12px 16px; }
  .brand p { display: none; }
  .brand h1 { font-size: 14px; }
  .brand h1 span { display: block; }
  .brand-mark { width: 30px; height: 30px; }
  .category-picker select { min-width: 0; padding: 8px 36px 8px 12px; }
  .toolbar, main { padding-left: 16px; padding-right: 16px; }
  .actions { width: 100%; }
  .actions input { flex: 1; width: auto; }
  .spot-rank { margin-left: 0; text-align: left; }
  .details-grid { padding-left: 22px; }
  .drawer-head, .drawer-filters, .chips, .drawer-sub, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
