/* Webdex UI.
   No framework and no build step: the whole front end is three static files,
   which keeps deployment to a file copy and removes an entire class of
   toolchain breakage from a service whose value is uptime. */

:root {
  --bg: #0b0d10;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --border: #262b34;
  --text: #e6e9ef;
  --muted: #8b93a1;
  --accent: #4c8dff;
  --accent-dim: #2d5bb0;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --surface-2: #eef1f5;
    --border: #d8dee6;
    --text: #1a1f26;
    --muted: #5c6672;
    --accent: #0b62d6;
    --accent-dim: #6fa4f5;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- header ---- */
header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.hrow { display: flex; align-items: center; gap: 22px; height: 58px; }
.logo { font-weight: 650; font-size: 17px; letter-spacing: -0.2px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--accent); }
nav { display: flex; gap: 18px; margin-left: auto; align-items: center; font-size: 14px; }
nav a { color: var(--muted); }
nav a:hover, nav a.on { color: var(--text); text-decoration: none; }

/* ---- search ---- */
.hero { padding: 54px 0 26px; text-align: center; }
.hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.6px; font-weight: 650; }
.hero p { color: var(--muted); margin: 0 0 26px; font-size: 15px; }

.searchbar { display: flex; gap: 8px; }
.searchbar input[type="search"] {
  flex: 1; padding: 13px 16px; font-size: 15px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.searchbar input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

button, .btn {
  padding: 12px 20px; font-size: 14px; font-weight: 550;
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius); cursor: pointer;
  transition: background .15s, opacity .15s;
}
button:hover { background: var(--accent-dim); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.ghost:hover { color: var(--text); background: var(--surface); }
button.danger { background: transparent; color: var(--bad); border: 1px solid var(--border); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }
.chip {
  padding: 5px 12px; font-size: 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; user-select: none;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- results ---- */
.meta { color: var(--muted); font-size: 13px; margin: 22px 0 14px; }
.result { padding: 16px 0; border-bottom: 1px solid var(--border); }
.result:last-child { border-bottom: 0; }
.result .u { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; margin-bottom: 3px; }
.result .u .cat {
  background: var(--surface-2); padding: 1px 7px; border-radius: 4px;
  font-size: 11px; color: var(--muted);
}
.result h3 { margin: 0 0 5px; font-size: 16.5px; font-weight: 550; line-height: 1.35; }
.result p { margin: 0; color: var(--muted); font-size: 14px; }
.result .sig { margin-top: 6px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); opacity: .65; }

/* ---- cards / panels ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 24px; font-weight: 650; letter-spacing: -0.5px; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; padding: 10px 12px; font-size: 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }

code, pre { font-family: var(--mono); font-size: 13px; }
pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; overflow-x: auto; margin: 10px 0;
  line-height: 1.5;
}
code.inline { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }

.note { padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin: 12px 0; }
.note.ok { background: color-mix(in srgb, var(--good) 12%, transparent); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.note.err { background: color-mix(in srgb, var(--bad) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.note.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

.keybox {
  font-family: var(--mono); font-size: 13px; background: var(--bg);
  border: 1px dashed var(--accent); border-radius: 8px; padding: 12px;
  word-break: break-all; margin: 8px 0;
}

.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }

footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 24px 0; color: var(--muted); font-size: 13px; }

.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 23px; }
  nav { gap: 12px; font-size: 13px; }
  .searchbar { flex-direction: column; }
}

/* ------------------------------------------------------------- products -- */
/* A product answers a different question from a page, so it is shown
   differently: the price is the first thing the eye lands on, and the
   specifications sit under it because they are what distinguishes two
   otherwise identical listings. */
.prodfilters { gap: 14px; align-items: center; flex-wrap: wrap; }
.prodfilters label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.prodfilters input[type="number"] { width: 96px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--text); }
.prodfilters select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.pcard { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex;
  flex-direction: column; gap: 8px; background: var(--surface); }
.pcard .price { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.pcard .was { font-size: 14px; font-weight: 400; color: var(--muted); text-decoration: line-through; margin-left: 8px; }
.pcard h3 { font-size: 15px; font-weight: 550; margin: 0; line-height: 1.35; }
.pcard h3 a { text-decoration: none; }
.pcard h3 a:hover { text-decoration: underline; }
.pcard .shop { font-size: 13px; color: var(--muted); }
.pcard .stock-yes { color: #1a7f37; font-size: 13px; }
.pcard .stock-no { color: #b42318; font-size: 13px; }
.pcard .specs { font-size: 13px; color: var(--muted); line-height: 1.5; }
.pcard .specs b { font-weight: 500; color: var(--text); }
.pcard .crumbs { font-size: 12px; color: var(--muted); }


/* ------------------------------------------------------------- landing --- */
/* The home page is the first thing an agent's operator sees. It has to say
   what this is and prove it is real (live counts) before asking for a key. */
.badge-line {
  display: inline-block; font-size: 12.5px; letter-spacing: .3px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px; line-height: 1.1;
  background: linear-gradient(135deg, var(--text), color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { max-width: 620px; margin-left: auto; margin-right: auto; font-size: 16px; }
.statline { margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.statline b { color: var(--text); font-weight: 600; }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin: 40px 0;
}
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: left;
  transition: border-color .15s, transform .15s;
}
.feature:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-2px); }
.feature .fi {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-size: 19px; border-radius: 9px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.feature h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; }
.feature p { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.feature a { font-size: 13px; font-weight: 500; }

.quickstart { margin: 40px 0 20px; }
.qs-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.qs-head h2 { margin: 0; font-size: 18px; }
