/* Gaiergy Borefield Studio. Gaiergy Corp tricolor palette. */
:root {
  --indigo: #1F3883;
  --blue: #3175B1;
  --cyan: #47C8E3;
  --sage: #83B895;
  --peri: #8B8ECF;
  --ink: #1B2233;
  --muted: #5A6478;
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --border: #D8E0EC;
  --pass: #2F7D55;
  --fail: #B42318;
  --warn: #B26B00;
  --hot: #D0602A;
  --radius: 12px;
  --gut: 24px;
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(71, 200, 227, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(131, 184, 149, 0.14), transparent 60%),
    radial-gradient(rgba(31, 56, 131, 0.07) 1px, transparent 1.2px);
  background-size: auto, auto, 18px 18px;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3 { color: var(--indigo); margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 4px 0 10px; }
.lead { color: var(--muted); }
.basis { color: var(--muted); font-size: 13px; margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; }
a { color: var(--blue); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px var(--gut);
  background: linear-gradient(135deg, #142552 0%, #1F3883 55%, #245a8f 100%);
  background-image:
    radial-gradient(500px 160px at 85% 0%, rgba(71, 200, 227, 0.30), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.3px),
    linear-gradient(135deg, #142552 0%, #1F3883 55%, #245a8f 100%);
  background-size: auto, 16px 16px, auto;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { height: 26px; width: auto; align-self: center; }
.product { display: flex; flex-direction: column; border-left: 1px solid rgba(255,255,255,0.3); padding-left: 14px; }
.pname { font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }
.ptag { font-size: 12px; color: #cfe6f5; }
.topctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 5px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-native { background: rgba(131, 184, 149, 0.22); color: #dff5e6; border-color: rgba(131,184,149,0.6); }
.badge-browser { background: rgba(71, 200, 227, 0.20); color: #dff6fc; border-color: rgba(71,200,227,0.6); }
.badge-wait { background: rgba(255,255,255,0.12); color: #e8eef7; border-color: rgba(255,255,255,0.3); }
.badge-bad { background: rgba(180, 35, 24, 0.35); color: #ffe4e0; border-color: rgba(255,120,110,0.6); }
.seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; color: #e8eef7; border: 0; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--indigo); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--blue); background: #fff; color: var(--indigo); cursor: pointer;
}
.btn:hover { background: #eef5fc; }
.btn.ghost { border-color: var(--border); color: var(--ink); font-weight: 500; }
.btn.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.btn-run { background: linear-gradient(90deg, var(--cyan), var(--blue)); color: #fff; border: 0; padding: 8px 20px; }
.btn-run:hover { filter: brightness(1.05); background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.btn-run.busy { opacity: 0.75; cursor: progress; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 2px; padding: 0 var(--gut); background: #fff; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: thin; position: sticky; top: 0; z-index: 1000;
}
.tabs button {
  font: inherit; font-size: 14px; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 12px 12px 9px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button.on { color: var(--indigo); border-bottom-color: var(--cyan); font-weight: 600; }
.tabs button:hover { color: var(--indigo); }

main { padding: 18px var(--gut) 32px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; }
.tab.on { display: block; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(27, 34, 51, 0.04);
  min-width: 0;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }
.site-grid { grid-template-columns: 1.3fr 1fr; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.row + .row, .row + #map { margin-top: 10px; }

.banner { margin: 12px var(--gut) 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.banner.stub { background: #fdecea; border: 1px solid #f5b5ae; color: #7a1a12; }
.banner.info { background: #eaf6fb; border: 1px solid #b9e3f1; color: #0f4c63; }
.banner.warn { background: #fff5e5; border: 1px solid #f3d19c; color: #6b4300; }

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; margin: 8px 0; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.lbl, .fld > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.unit { font-weight: 500; color: var(--blue); font-size: 12px; margin-left: 4px; }
input[type=text], input[type=number], select, textarea {
  font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: #fbfdff; color: var(--ink); width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(71, 200, 227, 0.5); border-color: var(--cyan); }
input.src { font-size: 12px; padding: 5px 8px; background: #f6f9f4; border-style: dashed; color: #3b4a3f; }
input.src::placeholder { color: #8a9a8e; }
input.src.missing { border-color: var(--fail); background: #fff6f5; }
.help { font-size: 12px; color: var(--muted); }
.derived { font-size: 12px; color: var(--indigo); background: #eef3fb; border-radius: 6px; padding: 4px 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radios label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 14px; }
.radios label.on { border-color: var(--blue); background: #eef5fc; color: var(--indigo); font-weight: 600; }
.radios input { margin: 0; }
details.expert summary { cursor: pointer; list-style: none; }
details.expert summary h2 { display: inline; }
details.expert summary::before { content: "+ "; color: var(--blue); font-weight: 700; }
details.expert[open] summary::before { content: "- "; }
details.paste { margin: 10px 0; }
details.paste summary { cursor: pointer; color: var(--blue); font-size: 14px; }

/* ---------- map ---------- */
#map { height: 460px; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; }
.maptools .btn { font-size: 13px; padding: 6px 10px; }
#gotoLatLon { max-width: 280px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: 320px; }
.chart-sm { height: 260px; }
.chart-lg { height: 420px; }

/* ---------- verdict ---------- */
.verdict { border-left: 6px solid var(--border); }
.verdict.pass { border-left-color: var(--pass); }
.verdict.fail { border-left-color: var(--fail); }
.vhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.vhead h1 { font-size: 22px; margin: 0; }
.chip { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: 0.4px; }
.chip.pass { background: #e3f3e9; color: var(--pass); }
.chip.fail { background: #fdecea; color: var(--fail); }
.chip.none { background: #eef1f6; color: var(--muted); }
.chip.stub { background: var(--fail); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.stat { background: linear-gradient(180deg, #f7fbfe, #eef5fb); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat .v { font-size: 26px; font-weight: 700; color: var(--indigo); line-height: 1.15; }
.stat .v small { font-size: 14px; color: var(--blue); font-weight: 600; margin-left: 3px; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.bind { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.takeaways { margin: 0; padding-left: 18px; }
.takeaways li { margin: 3px 0; }
.stale { color: var(--warn); font-weight: 600; font-size: 13px; }
.msgs { font-size: 12px; color: var(--muted); margin-top: 8px; white-space: pre-wrap; max-height: 160px; overflow: auto; }

.steps { margin: 6px 0 14px; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #eef1f6; }
.steps li::before {
  content: counter(s); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--indigo); color: #fff;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.steps li.ok::before { background: var(--pass); content: "\2713"; }
.steps li.bad::before { background: var(--fail); }
.steps .go { margin-left: auto; font-size: 13px; }
.steps .st { font-size: 12px; color: var(--muted); display: block; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #eef1f6; text-align: center; vertical-align: middle; }
th { color: var(--indigo); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; background: #f6f9fd; }
td.l, th.l { text-align: left; }
.mtable input { width: 100%; min-width: 80px; text-align: right; padding: 5px 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 8px; }
.kv div { background: #f6f9fd; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.kv b { display: block; font-size: 17px; color: var(--indigo); }

/* ---------- report ---------- */
.report { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; }
.rhead { background: linear-gradient(135deg, #142552, #1F3883 60%, #245a8f); color: #fff; padding: 22px 28px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rhead img { height: 24px; display: block; margin-bottom: 14px; }
.rhead h1 { color: #fff; font-size: 26px; margin: 0 0 4px; }
.rhead p { color: #d7e6f5; margin: 0; font-size: 13px; }
.rbody { padding: 18px 28px 28px; }
.rbody h2 { margin-top: 22px; padding-bottom: 4px; border-bottom: 2px solid; border-image: linear-gradient(90deg, var(--cyan), var(--sage)) 1; }
.rbody table { font-size: 13px; margin: 6px 0 10px; }
.rbody td.src { text-align: left; color: var(--muted); font-size: 12px; }
.rbody img.rchart { width: 100%; max-width: 900px; display: block; margin: 8px auto; border: 1px solid #eef1f6; border-radius: 8px; }
.rbody .rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px var(--gut) 24px; }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .grid2, .site-grid, .rbody .rgrid { grid-template-columns: 1fr; }
  .grid2 > .card { margin-bottom: 0; }
}
@media (max-width: 640px) {
  :root { --gut: 16px; }
  body { font-size: 14px; }
  .topbar { padding: 10px var(--gut); gap: 8px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 4px; }
  .logo { height: 18px; align-self: flex-start; }
  .ptag { display: none; }
  .pname { font-size: 16px; }
  .product { padding-left: 0; border-left: 0; }
  .topctl { width: 100%; justify-content: space-between; }
  .card { padding: 14px; }
  .fields { grid-template-columns: 1fr; }
  .stat .v { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 10px; }
  #map { height: 340px; }
  .chart { height: 280px; }
  .chart-lg { height: 320px; }
  .rhead, .rbody { padding-left: 16px; padding-right: 16px; }
}

/* ---------- print: only the report ---------- */
@media print {
  body { background: #fff; }
  .topbar, .tabs, .banner, .foot, .noprint, .tab:not(#tab-report) { display: none !important; }
  #tab-report { display: block !important; }
  main { padding: 0; max-width: none; }
  .report { border: 0; border-radius: 0; }
  .rbody h2 { break-after: avoid; }
  table, img.rchart { break-inside: avoid; }
  table { table-layout: auto; }
}

/* validation round (2026-09-26) */
.errbox { background: #fdecea; border: 1px solid #f5b5ae; color: #7a1a12; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; white-space: pre-wrap; }
.chip.warn { background: #fff1db; color: var(--warn); }
.hint { font-size: 12px; color: var(--blue); }
.limits { background: #f6f9fd; border: 1px solid var(--border); border-left: 4px solid var(--peri); border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-size: 13px; }
.limits h3 { margin-bottom: 4px; }
.limits ul { margin: 4px 0 0; padding-left: 18px; }
.stat.failtile { border-color: var(--fail); box-shadow: inset 0 0 0 1px var(--fail); }
.stat.failtile .v { color: var(--fail); }
.verdict.check { border-left-color: var(--warn); }
.chip.check { background: #fff1db; color: var(--warn); }
