:root {
  --bg: #f4f6fb; --panel: #ffffff; --text: #171b2e; --muted: #646c85;
  --line: #e6e9f2;
  --p1: #6d28d9; --p2: #4f46e5; --p3: #06b6d4;
  --accent: #4f46e5;
  --good: #16a34a; --good-bg: #e9fbf1; --good-line: #a7f3d0;
  --warn: #b45309; --warn-bg: #fff6e5; --warn-line: #fcd34d;
  --danger: #be123c; --danger-bg: #fef1f4; --danger-line: #fda4af;
  --tag-bg: #eef0ff; --tag-text: #4338ca;
  --shadow: 0 10px 30px rgba(79,70,229,.08), 0 2px 8px rgba(23,27,46,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
h1, h2, h3, .brand { font-family: Sora, Inter, system-ui, sans-serif; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 38px; font-weight: 800; margin: 28px 0 10px; letter-spacing: -.02em; }
h2 { font-size: 24px; font-weight: 700; margin: 40px 0 14px; }
.lead { font-size: 19px; line-height: 1.6; color: var(--text); max-width: 760px; }
.lead b { color: var(--p1); }
.intro-block p { max-width: 720px; }
.mini { font-size: 13px; color: var(--muted); }
.breadcrumb { font-size: 13px; color: var(--muted); margin-top: 18px; }
.breadcrumb a { color: var(--muted); }

/* Header */
.site-header { background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 14px 0; position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.brand { font-weight: 800; color: var(--text); font-size: 19px; white-space: nowrap; }
.topnav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.topnav a { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.topnav .calc-link { background: linear-gradient(135deg, var(--p2), var(--p3)); color: #fff !important; padding: 8px 14px; border-radius: 999px; text-decoration: none !important; }
@media (max-width: 420px) {
  .brand { font-size: 16px; }
  .topnav a:not(.calc-link) { display: none; }
  .site-header .wrap { flex-wrap: nowrap; }
}

/* Hero (home page h1 block) */
.hero { background: linear-gradient(135deg, var(--p1) 0%, var(--p2) 55%, var(--p3) 100%); border-radius: 24px; padding: 48px 40px; margin: 28px 0; color: #fff; box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 44px; margin-top: 0; }
.hero .lead { color: #ece9ff; }
.hero .wa-btn { margin-top: 18px; }

.site-footer { margin-top: 70px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 14px 0; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--panel); min-width: 480px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: linear-gradient(180deg, #f7f7ff, #f1f2fc); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--p2); font-weight: 700; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaff; }
.spec-table th { width: 220px; background: var(--panel); text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); font-weight: 600; }

/* Grids / cards */
.grid2, .grid3, .grid4 { display: grid; gap: 14px; margin: 14px 0; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }

.card { display: block; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 16px; color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(79,70,229,.16); text-decoration: none; }
.card b { display: block; font-family: Sora, sans-serif; }
.card.good { border-color: var(--good-line); background: var(--good-bg); }
.card.warn { border-color: var(--warn-line); background: var(--warn-bg); }
.card ul { margin: 8px 0 0; padding-left: 18px; }

/* Use-case cards with per-category color */
.uc-card { --c1: var(--p2); --c2: var(--p3); position: relative; overflow: hidden; color: #fff !important; border: none; }
.uc-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--c1), var(--c2)); z-index: 0; }
.uc-card > * { position: relative; z-index: 1; }
.uc-card .icon { font-size: 26px; display: block; margin-bottom: 6px; }
.uc-card b { font-size: 16px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-text); font-size: 12px; font-weight: 700; }
a.tag:hover { text-decoration: none; filter: brightness(0.95); transform: translateY(-1px); }

/* Score badges */
.score-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.score-high { background: var(--good-bg); color: var(--good); border: 1px solid var(--good-line); }
.score-mid { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.score-low { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line); }
.rank-1 td:first-child { font-size: 20px; }

.callout { border: 1px solid #93c5fd; background: linear-gradient(180deg, #eff6ff, #f5f8ff); border-radius: 14px; padding: 16px 18px; margin: 16px 0; }
.disclaimer { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 14px; padding: 16px 18px; margin: 16px 0; font-size: 14px; }
.disclaimer::before { content: '⚠️ '; }
.good-inline { color: var(--good); font-weight: 700; }
.check-x li::marker { color: var(--danger); }

.calc-box { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 14px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin: 20px 0; box-shadow: var(--shadow); }
.calc-box label { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; gap: 6px; color: var(--muted); }
.calc-box input, .calc-box select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fafbff; }
.calc-box input:focus, .calc-box select:focus { outline: 2px solid var(--p3); }
.calc-box button { padding: 11px 18px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--p2), var(--p3)); color: #fff; font-weight: 700; cursor: pointer; height: 42px; }
@media (max-width: 700px) { .calc-box { grid-template-columns: 1fr; } }

.wa-btn { display: inline-block; padding: 12px 20px; border-radius: 12px; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff !important; font-weight: 700; text-decoration: none !important; box-shadow: 0 8px 20px rgba(249,115,22,.35); }

.device-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 700px) { .device-grid { grid-template-columns: 1fr 1fr; } }
.device-check { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; font-size: 14px; cursor: pointer; }
.device-check:hover { border-color: var(--p2); }
.device-check input { accent-color: var(--p2); }
.duration-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.dur-btn { padding: 10px 16px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 14px; }
.dur-btn:hover { border-color: var(--p2); }
.dur-btn.active { background: linear-gradient(135deg, var(--p2), var(--p3)); color: #fff; border-color: transparent; }

.pyramid-wrap { margin: 20px 0; }
.pyramid-title { text-align: center; font-size: 20px; margin-bottom: 16px; }
.pyramid { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pyramid-tier { width: var(--w); }
.pyramid-bar { background: linear-gradient(135deg, var(--tier-c1), var(--tier-c2)); border-radius: 14px; padding: 16px 20px; text-align: center; color: #fff; box-shadow: var(--shadow); }
.pyramid-label { font-size: 17px; margin-bottom: 4px; }
.pyramid-label b { font-family: Sora, sans-serif; }
.pyramid-spec { font-size: 13px; opacity: .92; margin-bottom: 6px; }
.pyramid-pick { font-size: 13px; font-weight: 700; background: rgba(255,255,255,.18); display: inline-block; padding: 4px 10px; border-radius: 999px; }
@media (max-width: 700px) { .pyramid-tier { width: 100% !important; } }

.entity-photo-wrap { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; border-radius: 16px; border: 1px solid var(--line); margin: 14px 0; box-shadow: var(--shadow); background: #fff; overflow: hidden; }
.entity-photo { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-thumb { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: contain; border-radius: 10px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); }
