/* Shared styles for /tools pages */
:root {
  --bg: #050815;
  --panel: #0b1224;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --border: #1e293b;
  --ok: #34d399;
  --warn: #fbbf24;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse at top left, rgba(79,70,229,0.25), transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(14,165,233,0.12), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: #a5b4fc; text-decoration: none; }
a:hover { text-decoration: underline; }
/* In-page CTA chips (not the site header CTA) */
.cta {
  display: inline-block; padding: 0.65rem 1.1rem; border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff !important;
  font-weight: 700; text-decoration: none !important;
}
html {
  overflow-x: hidden;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); margin: 0 0 0.75rem; line-height: 1.2; }
.lede { color: var(--muted); font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.75rem; }
.hub-hero {
  margin: 0 0 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #020617;
  aspect-ratio: 16 / 9;
}
.hub-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 0; display: flex; flex-direction: column; gap: 0;
  overflow: hidden; text-decoration: none !important; color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: rgba(99,102,241,0.55);
  transform: translateY(-2px);
  text-decoration: none !important;
}
.card-thumb {
  display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #020617;
  border-bottom: 1px solid var(--border);
}
.card-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.card-body {
  padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1;
}
.card h2 { margin: 0; font-size: 1.15rem; color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; flex: 1; }
.card .tag {
  align-self: flex-start; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-2); border: 1px solid rgba(34,211,238,0.35); border-radius: 999px; padding: 0.2rem 0.55rem;
}
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem;
}
.form-grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
input, select {
  background: #020617; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 0.65rem 0.75rem; font-size: 1rem;
  width: 100%; min-height: 44px;
}
button.run {
  margin-top: 1rem; border: 0; cursor: pointer; padding: 0.8rem 1.2rem; border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #0891b2); color: #fff; font-weight: 700; font-size: 1rem;
  min-height: 44px; width: 100%; max-width: 24rem;
}
.results {
  margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: 12px;
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.3);
}
.results h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.results ul { margin: 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.6; }
.metric { font-size: 1.6rem; font-weight: 800; color: #fff; }
.note { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); }
table.rank, table.specs { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.92rem; }
table.rank th, table.rank td, table.specs th, table.specs td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--border); }
table.rank th, table.specs th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .wrap { padding: 1.25rem 1rem 3rem; padding-bottom: max(3rem, calc(2rem + env(safe-area-inset-bottom))); }
  .panel { padding: 1rem; }
  .hub-hero { margin-bottom: 1.15rem; }
  .cta, button.run { width: 100%; max-width: none; text-align: center; }
  table.rank, table.specs { font-size: 0.82rem; }
  table.rank th, table.rank td, table.specs th, table.specs td { padding: 0.5rem 0.35rem; }
  table.rank, table.specs {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
