:root{
  --bg:#f6f7fb;
  --ink:#0f172a;
  --muted:#6b7280;
  --card:#ffffffd9;
  --glass:#ffffffee;
  --stroke:#e5e7eb;
  --stroke-strong:#d1d5db;
  --acc1:#2563eb;
  --acc2:#22d3ee;
  --ok:#10b981;
  --danger:#ef4444;
  --shadow:0 18px 48px rgba(2,6,23,.12), 0 3px 10px rgba(2,6,23,.06);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;color:var(--ink);
  background:
    radial-gradient(1200px 520px at 85% -10%, #e7f7ff 0%, transparent 70%),
    radial-gradient(900px 460px at -10% 10%, #eef0ff 0%, transparent 60%),
    var(--bg);
  font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3,.brand strong{font-family:"Plus Jakarta Sans", Inter, system-ui, sans-serif}
h1{letter-spacing:-.01em}
a{color:inherit;text-decoration:none}
code{background:#f1f5f9;border:1px solid #e2e8f0;padding:.1rem .35rem;border-radius:.35rem}
.muted{color:var(--muted)}

.sg-wrap{max-width:1100px;margin:0 auto;padding:0 24px}

/* Header */
.sg-header{position:sticky;top:0;z-index:10;background:#ffffffcc;border-bottom:1px solid var(--stroke);backdrop-filter:saturate(1.1) blur(6px)}
.sg-header .sg-wrap{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:.6rem;font-weight:800}
.brand svg{color:var(--acc1)}

/* Hero */
.sg-hero{padding:64px 0 40px}
.sg-title{font-size:44px;line-height:1.08;margin:0 0 10px;font-weight:800}
.sg-title span{background:linear-gradient(90deg,var(--acc1),var(--acc2));-webkit-background-clip:text;background-clip:text;color:transparent}
.sg-sub{margin:0 0 18px;color:var(--muted)}
.sg-input{display:flex;gap:12px;align-items:center}
.sg-input input{
  flex:1;padding:14px 16px;border-radius:12px;border:1px solid var(--stroke-strong);
  background:#fff;color:var(--ink);outline:none;font-size:16px;box-shadow:inset 0 1px 0 rgba(2,6,23,.03)
}
.sg-input input:focus{border-color:#b6cdfd; box-shadow:0 0 0 4px #e3ecff}
.sg-btn{
  border:1px solid var(--stroke-strong);background:#fff;padding:12px 18px;border-radius:12px;
  color:var(--ink);font-weight:700;cursor:pointer;box-shadow:var(--shadow)
}
.sg-btn:hover{border-color:#cbd5e1}
.sg-btn-primary{
  background:linear-gradient(180deg,#60a5fa,#3b82f6 60%,#2563eb);
  color:#fff;border-color:#1d4ed8;box-shadow:0 12px 26px rgba(37,99,235,.22)
}
.sg-btn-ghost{background:#fff}

/* Helpers */
.hidden{display:none}
.row{display:flex;gap:10px;flex-wrap:wrap}

/* Modal (crawl popup) */
.sg-backdrop{
  position:fixed;inset:0;background:rgba(15,23,42,.45);
  backdrop-filter:blur(10px) saturate(1.1);
  z-index:30;
}
.sg-modal{
  position:fixed;left:50%;top:80px;transform:translateX(-50%);
  width:min(760px,92vw);z-index:40;filter:drop-shadow(0 24px 36px rgba(2,6,23,.18));
}
.sg-modal-head{
  border:1px solid var(--stroke); background:#fff; border-bottom:none;border-radius:18px 18px 0 0;
  padding:12px 16px;font-weight:800;letter-spacing:.01em;box-shadow:var(--shadow)
}
.sg-modal .dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--acc1);box-shadow:0 0 10px var(--acc1);margin-right:8px}
.sg-modal-body{
  border:1px solid var(--stroke);background:var(--glass);
  border-top:none;border-radius:0 0 18px 18px;padding:14px;box-shadow:var(--shadow)
}
.sg-preview{display:flex;gap:12px;align-items:center}
.sg-preview img{width:120px;height:76px;object-fit:cover;border-radius:10px;border:1px solid var(--stroke);background:#f3f4f6}
.sg-preview .meta div{font-weight:800}
.sg-preview .meta small{display:block;color:var(--muted);margin-top:2px}
.sg-meter{height:10px;border:1px solid var(--stroke);border-radius:999px;overflow:hidden;background:#eef2ff;margin:12px 0}
.sg-meter span{display:block;height:100%;background:linear-gradient(90deg,var(--acc1),var(--acc2));width:0}
.sg-modal-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0 6px}
.sg-modal-kpis div{background:#fff;border:1px solid var(--stroke);border-radius:10px;padding:8px;text-align:center}
.sg-modal-kpis label{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.sg-timings{font-size:12px;color:var(--muted);margin:4px 2px 10px}
.sg-ready-note{color:var(--ok);font-weight:800;margin:10px 0}

/* Result note */
.sg-done{margin-top:18px;border:1px solid var(--stroke);background:#fff;border-radius:16px;padding:12px;box-shadow:var(--shadow)}
.sg-done .ok{color:var(--ok);font-weight:800;margin-bottom:8px}

/* ---------- DETAILS PAGE POLISH ---------- */
.sg-details-page .sg-wrap{max-width:1120px}
.sg-details-page .sg-title{margin:26px 0 14px;font-size:40px}

/* grid like competitor, with clean gutters */
.details-grid{
  display:grid; grid-template-columns: 1fr 360px; gap:20px; align-items:start;
}
@media (max-width: 980px){ .details-grid{ grid-template-columns: 1fr; } }

/* generic card */
.card{background:#fff;border:1px solid var(--stroke);border-radius:16px;box-shadow:var(--shadow)}
.card-head{padding:14px 16px;border-bottom:1px solid var(--stroke)}
.card-body{padding:14px 16px}

/* left hero card */
.hero-card{padding:0}
.hero-title{
  display:flex; align-items:center; gap:10px; font-weight:800; padding:14px 16px;
}
.badge-icon{width:22px;height:22px;border-radius:6px;background:linear-gradient(135deg,var(--acc1),var(--acc2));box-shadow:0 2px 10px rgba(37,99,235,.25)}
.hero-meta{padding:0 16px 6px;color:var(--muted);font-size:14px}
.whats-next{padding:8px 16px 4px;font-weight:800;font-size:18px}
.hero-cta{padding:0 16px 12px;display:flex;gap:10px;flex-wrap:wrap}
.hero-cta .sg-btn{padding:12px 16px}
.hero-hint{padding:0 16px 14px;color:var(--muted);font-size:14px;border-top:1px solid var(--stroke);margin-top:8px}

/* preview table card (left, below) */
.preview-card{padding:0}
.preview-card .card-head{display:flex;align-items:center;justify-content:space-between}
.preview-icon{width:18px;height:18px;display:inline-block;border-radius:4px;background:#eef2ff;border:1px solid var(--stroke);margin-right:8px;vertical-align:-3px}
.card-title{font-weight:800;font-family:"Plus Jakarta Sans", Inter, sans-serif;display:flex;align-items:center}
.table-wrap{max-height:62vh;overflow:auto;border-top:1px solid var(--stroke)}
.sg-table{width:100%;border-collapse:separate;border-spacing:0}
.sg-table thead th{
  position:sticky;top:0;background:#fafafa;border-bottom:1px solid var(--stroke);
  text-align:left;padding:10px 12px;font-size:13px;color:var(--muted);z-index:1
}
.sg-table tbody td{padding:10px 12px;border-bottom:1px solid #f1f5f9;word-break:break-all;font-size:14px}
.sg-table tbody tr:last-child td{border-bottom:none}
.sg-table .ok{color:var(--ok);font-weight:600}
.sg-table .bad{color:var(--danger);font-weight:600}

/* right sidebar */
.details-side .side-card{padding:0}
.side-head{padding:12px 14px;border-bottom:1px solid var(--stroke);font-weight:800}
.kv{display:grid;gap:8px;font-size:14px;padding:12px 14px}
.kv > div{display:flex;justify-content:space-between;gap:8px}
.kv dt{color:var(--muted)}
.kv dd{margin:0;font-weight:600}
.thumb-wrap{padding:0 14px 14px}
.thumb-wrap img{width:100%;height:170px;object-fit:cover;border:1px solid var(--stroke);border-radius:12px;background:#f8fafc}

/* Trust + footer */
.sg-trust{padding:40px 0 64px}
.trust-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:900px){.trust-grid{grid-template-columns:1fr}}
.trust-card{border:1px solid var(--stroke);background:#fff;border-radius:16px;padding:14px;box-shadow:var(--shadow)}
.trust-card img{width:28px;height:28px}
.trust-card h3{margin:10px 0 6px}
.sg-footer{border-top:1px solid var(--stroke);background:#fff}
.sg-footer .sg-wrap{display:flex;align-items:center;justify-content:space-between;padding:14px 24px}
.sg-footer .muted{color:var(--muted)}

/* Errors in modal */
.sg-error{
  background:#fee2e2;border:1px solid #fecaca;color:#991b1b;
  padding:8px 10px;border-radius:10px;margin-bottom:10px;font-size:14px;
}