:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --primary: #2563eb;
  --accent: #16a34a;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --radius: 16px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1120px;margin:0 auto;padding:0 16px}
.topbar{
  position: sticky; top:0; z-index:50;
  background: rgba(248,250,252,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

/* Compact header once user starts scrolling */
.topbar.scrolled .nav{ padding:10px 0; }
.topbar.scrolled .logo{ width:30px; height:30px; }
.topbar.scrolled .brand{ gap:8px; }
.nav{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; padding:14px 0;
}
.brand{display:flex;align-items:center;gap:10px; min-width:0; flex:0 1 auto}
.logo{
  width:34px;height:34px;border-radius:10px;
  background: conic-gradient(from 0deg, var(--primary), #60a5fa, var(--accent), #f59e0b, var(--primary));
  box-shadow: 0 6px 18px rgba(37,99,235,.25);
}
.brand span{font-weight:800; letter-spacing:.2px; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.navlinks{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;flex:1;min-width:0;align-items:center}
.navlinks a{
  font-size:14px; color: var(--text);
  padding:8px 10px; border-radius:999px;
  border:1px solid transparent;
}
.navlinks a:hover{border-color:var(--border); text-decoration:none; background:#fff}

@media (max-width: 640px){
  .nav{padding:14px 0;}
  .brand span{max-width:160px; font-size:20px;}
  .navlinks{flex-wrap:nowrap; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch}
  .navlinks a{font-size:13px; padding:6px 8px; white-space:nowrap}
  .topbar.scrolled .nav{padding:8px 0;}
  .topbar.scrolled .brand img{width:28px; height:28px;}
  .topbar.scrolled .brand span{max-width:140px; font-size:18px;}
  .topbar.scrolled .navlinks a{padding:5px 7px;}
}

/* Keep the button in the DOM (so layout/JS doesn't break), but hide it from users. */
#btnCopy{display:none !important;}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; color: var(--muted);
  border:1px solid var(--border); background:#fff;
  border-radius:999px; padding:6px 10px;
}
.hero{padding:28px 0 10px}
.herogrid{display:grid; grid-template-columns:1.25fr .75fr; gap:16px; align-items:start}
@media (max-width: 940px){.herogrid{grid-template-columns:1fr}}
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.padded{padding:18px}
.h1{font-size:34px; line-height:1.15; margin:0 0 10px; letter-spacing:-.3px}
@media (max-width: 520px){.h1{font-size:28px}}
.lead{color:var(--muted); margin:0 0 14px}
.kv{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.kv .pill{font-size:12px; border:1px solid var(--border); background:#fff; padding:6px 10px; border-radius:999px; color:var(--muted)}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width: 720px){.grid2{grid-template-columns:1fr}}
label{display:block; font-size:13px; color:#334155; margin:0 0 6px}
input, select{
  width:100%; padding:11px 12px; font-size:15px;
  border:1px solid var(--border); border-radius:12px;
  background:#fff; outline:none;
}
input:focus, select:focus{border-color:#93c5fd; box-shadow: 0 0 0 4px rgba(147,197,253,.35)}
.btnrow{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
button{
  appearance:none; border:0; cursor:pointer;
  padding:11px 14px; border-radius:12px;
  font-weight:700; font-size:14px;
}
.btn-primary{background:var(--primary); color:#fff}
.btn-secondary{background:#fff; border:1px solid var(--border); color:var(--text)}
button:hover{filter:brightness(.98)}
.result{
  display:grid; grid-template-columns: 1fr 1fr; gap:14px; align-items:center;
  margin-top:14px;
}
@media (max-width: 720px){.result{grid-template-columns:1fr}}
.big{
  font-size:34px; font-weight:900; letter-spacing:-.3px;
}
.muted{color:var(--muted)}
.hr{height:1px;background:var(--border);margin:14px 0}
.notice{
  font-size:13px; color:var(--muted);
  background:#fff; border:1px solid var(--border);
  border-radius:12px; padding:10px 12px;
}
.table{
  width:100%; border-collapse:separate; border-spacing:0;
  overflow:hidden; border-radius:14px; border:1px solid var(--border);
}
.table th,.table td{text-align:left; padding:10px 12px; font-size:14px; border-bottom:1px solid var(--border)}
.table th{background:#f1f5f9; color:#0f172a; font-weight:800}
.table tr:last-child td{border-bottom:0}
.section{padding:10px 0 22px}
.h2{font-size:20px; margin:0 0 8px}
.h3{font-size:16px; margin:0 0 8px}
.cards{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 960px){.cards{grid-template-columns: repeat(2,1fr)}}
@media (max-width: 640px){.cards{grid-template-columns: 1fr}}
.toolcard{padding:14px}
.toolcard .title{font-weight:900}
.toolcard .meta{color:var(--muted); font-size:13px; margin-top:6px}
.footer{
  margin-top:28px;
  border-top:1px solid var(--border);
  background:#f1f5f9;
}
.footergrid{display:grid; grid-template-columns: 1.15fr 1fr 1fr; gap:18px; padding:18px 0}
@media (max-width: 860px){.footergrid{grid-template-columns:1fr}}

/* Hide the "Copy result link" button for now (kept in DOM so nothing breaks). */
#btnCopy{display:none !important;}
.footbrand{display:flex; gap:12px; align-items:flex-start}
.footbrand .logo{width:42px;height:42px;border-radius:14px}
.small{font-size:13px; color:var(--muted)}
.footlinks a{display:block; padding:6px 0; color:#0f172a}
.footlinks a:hover{text-decoration:underline}
.footbar{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 0; border-top:1px solid var(--border)}
kbd{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px}
/* Chart */
.donut-wrap{display:flex; gap:14px; align-items:center}
.donut{width:140px; height:140px}
.legend{display:flex; flex-direction:column; gap:6px}
.legend .item{display:flex; align-items:center; gap:8px; font-size:14px}
.swatch{width:12px;height:12px;border-radius:4px}
.swatch.base{background:#f59e0b}
.swatch.var{background:var(--accent)}
.swatch.other{background:#60a5fa}
/* Sticky recommended for desktop */
.reco-sticky{position:sticky; top:78px}
@media (max-width: 940px){.reco-sticky{position:static}}

/* v1.5 enhancements */
.cta-row{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0 8px}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text);font-weight:800;text-decoration:none}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn:hover{transform:translateY(-1px);box-shadow:0 10px 20px rgba(2,6,23,.08)}
.section{padding:20px 0}
.sectionhead{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:10px}
.icon-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.iconcard{padding:14px}
.iconcard .icon{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:rgba(37,99,235,.10);font-weight:900}
.iconcard .title{font-weight:900;margin-top:8px}
.iconcard .meta{font-size:14px;color:var(--muted);margin-top:2px}
.affiliate-box{border:1px dashed var(--border);border-radius:14px;padding:12px;background:linear-gradient(180deg, rgba(37,99,235,.06), rgba(37,99,235,.02))}
.aff-items{display:grid;gap:10px}
.aff-item{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:10px}
.aff-title{font-weight:900}
.guidegrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.gcard{padding:14px}
.gmeta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.tag{font-size:12px;padding:4px 8px;border:1px solid var(--border);border-radius:999px;color:var(--muted);background:rgba(2,6,23,.02)}
.readtime{font-size:12px;color:var(--muted)}
@media (max-width: 860px){
  .icon-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .guidegrid{grid-template-columns:repeat(1,minmax(0,1fr))}
  .sectionhead{flex-direction:column;align-items:flex-start}
}
