  :root { --blue:#4285f4; --red:#ea4335; --yellow:#fbbc05; --green:#34a853; --line:#dfe1e5; --text:#202124; --mut:#5f6368; --link:#1a0dab; --acc:#1a73e8; --bad:#d93025; }
  * { box-sizing:border-box; }
  html, body { margin:0; height:100%; }
  body { font-family: arial, "Helvetica Neue", sans-serif; color:var(--text); background:#fff; font-size:14px; }
  a { color:var(--link); text-decoration:none; }

  /* logo */
  .logo { font-family:"Product Sans", "Google Sans", arial, sans-serif; font-weight:500; letter-spacing:-1px; user-select:none; white-space:nowrap; }
  .logo span:nth-child(5n+1) { color:var(--blue); } .logo span:nth-child(5n+2) { color:var(--red); }
  .logo span:nth-child(5n+3) { color:var(--yellow); } .logo span:nth-child(5n+4) { color:var(--green); }
  .logo span:nth-child(5n+5) { color:var(--red); }

  /* top-right */
  .topbar { position:absolute; top:0; right:0; padding:14px 22px; display:flex; align-items:center; gap:18px; font-size:13px; }
  .topbar a { color:var(--text); cursor:pointer; }
  .topbar .gear { width:24px; height:24px; opacity:.6; cursor:pointer; }

  /* home */
  #home { min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding-bottom:12vh; }
  #home .logo { font-size:84px; margin-bottom:26px; }
  .sbox { display:flex; align-items:center; border:1px solid var(--line); border-radius:24px; height:46px; padding:0 16px; background:#fff; width:min(584px, 92vw); }
  .sbox:hover, .sbox:focus-within { box-shadow:0 1px 6px rgba(32,33,36,.28); border-color:rgba(223,225,229,0); }
  .sbox svg { width:20px; height:20px; fill:#9aa0a6; flex:none; margin-right:12px; }
  .sbox .clr, .sbox .ico { margin-right:0; }
  .sbox input { flex:1; border:0; outline:0; font-size:16px; background:transparent; font-family:inherit; }
  .btns { margin-top:26px; display:flex; gap:12px; }
  .btn { background:#f8f9fa; border:1px solid #f8f9fa; border-radius:4px; color:#3c4043; font-size:14px; padding:0 16px; height:36px; cursor:pointer; font-family:inherit; }
  .btn:hover { border-color:#dadce0; box-shadow:0 1px 1px rgba(0,0,0,.1); color:#202124; }
  .btn[disabled] { opacity:.5; cursor:wait; }
  .note { margin-top:34px; color:var(--mut); font-size:13px; max-width:600px; text-align:center; line-height:1.5; }
  .note b { color:var(--text); font-weight:500; }

  /* results */
  #results { display:none; }
  .rhead { display:flex; align-items:center; padding:14px 24px 0 24px; position:relative; }
  .rhead .logo { font-size:24px; cursor:pointer; margin-right:40px; padding-top:2px; }
  .rhead .sbox { width:min(640px, 52vw); min-height:44px; height:44px; border:1px solid #dadce0; border-radius:26px; box-shadow:0 3px 10px rgba(31,31,31,.08); padding:0 8px 0 20px; background:#fff; }
  .rhead .sbox:hover, .rhead .sbox:focus-within { box-shadow:0 3px 10px rgba(31,31,31,.14); }
  .rhead .sbox input { color:#1f1f1f; font-size:16px; }
  .sbox .ico { width:24px; height:24px; flex:none; margin-left:10px; cursor:pointer; fill:#4285f4; }
  .sbox .clr { width:20px; height:20px; fill:#70757a; margin-left:8px; cursor:pointer; }
  .sbox .div { width:1px; height:24px; background:#dadce0; margin-left:12px; }
  .sbox .mag { fill:#4285f4; margin:0 8px 0 12px; }
  .tabs { display:flex; align-items:flex-end; gap:2px; padding:0 24px 0 168px; border-bottom:1px solid #ebebeb; margin-top:2px; font-size:13px; color:#474747; }
  .tab { padding:12px 12px 10px; cursor:pointer; border-bottom:3px solid transparent; display:flex; align-items:center; gap:6px; }
  .tab:hover { color:#202124; }
  .tab.ghost { cursor:default; opacity:.8; }
  .tab.on { color:#1f1f1f; border-color:#1f1f1f; font-weight:500; }
  .tab svg { width:16px; height:16px; fill:currentColor; }
  .genbar { margin:10px 24px 0 168px; max-width:840px; padding:10px 14px; border-radius:10px; background:#e8f0fe; color:#174ea6; font-size:13px; display:flex; align-items:center; gap:10px; }
  .genbar .spin { width:16px; height:16px; border-width:2px; flex:none; }
  .genbar b { font-weight:700; } .genbar a { margin-left:auto; color:#1a0dab; cursor:pointer; white-space:nowrap; }
  .genbar.done { background:#e6f4ea; color:#137333; } .genbar.err { background:#fce8e6; color:#c5221f; }
  .tab .spin { width:11px; height:11px; border-width:2px; margin-left:4px; }
  .meta { padding:12px 24px 0 168px; color:var(--mut); font-size:13px; }
  .stage { display:grid; gap:24px; padding:14px 24px 60px 168px; }
  .stage.single { grid-template-columns: minmax(0, 840px) minmax(280px, 400px); }
  .stage.compare { grid-template-columns: 1fr 1fr; padding-left:24px; }
  .run { min-width:0; }
  .run .label { display:flex; align-items:center; gap:8px; margin-bottom:8px; font-size:13px; color:var(--mut); }
  .chip { border-radius:12px; padding:2px 10px; font-size:12px; border:1px solid var(--line); color:var(--mut); }
  .chip.p { color:var(--bad); border-color:#f1b6b1; background:#fdf1f0; }
  .chip.c { color:#188038; border-color:#b7dfc2; background:#f1faf3; }
  .frame { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; min-height:160px; }
  .frame iframe { display:block; width:100%; height:78vh; border:0; }
  .gen { display:flex; align-items:center; gap:12px; padding:40px 24px; color:var(--mut); }
  .spin { width:18px; height:18px; border:3px solid var(--line); border-top-color:var(--blue); border-radius:50%; animation:sp 1s linear infinite; }
  @keyframes sp { to { transform:rotate(360deg); } }
  .err { color:var(--bad); padding:18px 20px; }
  .side { min-width:0; }
  .panel { border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-top:12px; font-size:13px; }
  .panel h3 { margin:0 0 8px; font-size:14px; font-weight:500; color:var(--text); }
  .trace { max-height:46vh; overflow:auto; }
  .trow { color:var(--mut); margin:4px 0; line-height:1.4; }
  .trow .q { color:var(--text); }
  .doms { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0 10px; }
  .dom { font-size:11.5px; padding:1px 8px; border-radius:10px; background:#f1f3f4; color:#3c4043; }
  .dom.p { background:#fce8e6; color:#c5221f; }
  .sum { color:var(--mut); line-height:1.6; }
  .sum b { color:var(--text); font-weight:500; }
  .cites { margin:6px 0 0; padding:0; list-style:none; }
  .cites li { margin:2px 0; display:flex; gap:6px; align-items:center; }
  .cites .p { color:var(--bad); }
  details.serp { margin:2px 0 10px; }
  details.serp summary { cursor:pointer; color:var(--acc); font-size:12.5px; }
  .serp .r { margin:10px 0; padding-left:8px; border-left:3px solid transparent; }
  .serp .r.p { border-left-color:var(--bad); background:#fdf6f5; }
  .serp .u { color:#202124; font-size:12px; line-height:1.3; }
  .serp .t { color:#1a0dab; font-size:15px; line-height:1.3; display:block; }
  .serp .t:hover { text-decoration:underline; }
  .serp .sn { color:#4d5156; font-size:12.5px; line-height:1.45; }
  .serp .flag { color:var(--bad); font-size:11.5px; }


  /* core SERP + AI Overview, styled after Google's results page */
  .statline { color:#70757a; font-size:13px; margin:0 0 14px; }
  .skel { height:14px; border-radius:7px; margin:10px 0; background:linear-gradient(90deg,#f1f3f4 25%,#e8eaed 37%,#f1f3f4 63%); background-size:400% 100%; animation:sh 1.3s ease infinite; }
  @keyframes sh { 0% { background-position:100% 50%; } 100% { background-position:0 50%; } }
  .ov { --h:218; padding:6px 0 18px; margin:0 0 24px; max-width:652px; border-bottom:1px solid #ebebeb; }
  .ovh { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:400; color:#1f1f1f; margin-bottom:12px; }
  .ovh svg { width:16px; height:16px; fill:#1a73e8; }
  .ovh .ovs { margin-left:auto; font-weight:400; font-size:12px; color:#70757a; }
  .ovt { line-height:1.6; font-size:14px; color:#1f1f1f; }
  .cite { font-size:11px; vertical-align:super; margin:0 2px; padding:0 5px; border-radius:8px; background:#e8f0fe; color:#1a56c4; font-weight:500; }
  .ovsrc { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
  .ovsrc .dom { background:#f1f3f4; border-radius:12px; padding:5px 10px; display:flex; align-items:center; gap:6px; font-size:12px; color:#4d4d4d; }
  .ovsrc .dom.p { background:#fce8e6; color:#c5221f; }
  .ovsrc img { width:14px; height:14px; border-radius:50%; }
  .ans { border:1px solid #dadce0; border-radius:8px; padding:16px 20px; margin:0 0 24px; max-width:652px; }
  .ans .big { font-size:22px; line-height:1.35; }
  .ans .src { color:#70757a; font-size:12px; margin-top:8px; }
  .res { margin:0 0 30px; max-width:652px; padding:0 0 0 0; border-left:3px solid transparent; }
  .res.p { border-left-color:var(--bad); background:#fdf6f5; padding-left:10px; }
  .res .site { display:flex; align-items:center; gap:12px; margin-bottom:6px; }
  .res .fav { width:26px; height:26px; border-radius:50%; background:#fff; border:1px solid #d2d2d2; flex:none; padding:4px; box-sizing:border-box; }
  .res .sn1 { font-size:14px; line-height:20px; color:#1f1f1f; font-family:'Google Sans',Roboto,Arial,sans-serif; }
  .res .u { font-size:12px; line-height:18px; color:#474747; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:560px; }
  .res .t { color:#0b57d0; font-size:22px; line-height:28px; display:inline-block; margin:3px 0 3px; font-weight:400; font-family:'Google Sans',Roboto,Arial,sans-serif; }
  .res .t:hover { text-decoration:underline; }
  .res .t:visited { color:#6c4fa6; }
  .res .site .u b { font-weight:400; }
  .res .sn { color:#474747; font-size:14px; line-height:1.58; padding-top:4px; }
  .res .flag { color:var(--bad); font-size:12px; margin-top:4px; }
  .kgp { border:1px solid #dadce0; border-radius:8px; padding:16px 20px; margin:0 0 24px; max-width:652px; }
  .kgp h4 { margin:0 0 2px; font-size:22px; font-weight:400; } .kgp .ty { color:#70757a; font-size:14px; margin-bottom:8px; }
  .paa { max-width:652px; margin:0 0 30px; }
  .paa h4 { font-size:20px; font-weight:400; margin:0 0 10px; }
  .paa details { border:1px solid #dadce0; border-radius:8px; padding:14px 18px; margin:-1px 0 0; }
  .paa details:first-of-type { border-radius:8px 8px 0 0; } .paa details:last-of-type { border-radius:0 0 8px 8px; }
  .paa summary { cursor:pointer; font-size:16px; line-height:24px; color:#1f1f1f; font-family:'Google Sans',Roboto,Arial,sans-serif; } .paa .a { margin-top:10px; color:#4d5156; line-height:1.58; }
  .relh { font-size:18px; font-weight:400; margin:6px 0 12px; }
  .rel { display:grid; grid-template-columns:1fr 1fr; gap:8px 14px; max-width:652px; margin-bottom:34px; }
  .rel a { background:#f1f3f4; border-radius:12px; padding:12px 44px 12px 16px; color:#202124; cursor:pointer; position:relative; font-size:13px; }
  .rel a::before { content:""; position:absolute; right:16px; top:50%; width:16px; height:16px; margin-top:-8px; background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239aa0a6'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E"); }
  .rel a:hover { background:#e8eaed; }
  .cmpbox { margin-left:auto; display:flex; align-items:center; gap:6px; font-size:13px; color:var(--mut); padding-bottom:12px; }
  .waitbtn { margin-top:14px; }
  body { font-family: arial, sans-serif; }

  /* settings drawer */
  #drawer { position:fixed; top:0; right:0; height:100%; width:340px; background:#fff; border-left:1px solid var(--line); box-shadow:-4px 0 18px rgba(0,0,0,.12); padding:22px 22px; transform:translateX(105%); transition:transform .2s; z-index:10; overflow:auto; }
  #drawer.open { transform:none; }
  #drawer h2 { margin:0 0 14px; font-size:18px; font-weight:400; }
  #drawer label { display:block; margin:14px 0 4px; font-size:12px; color:var(--mut); }
  #drawer select, #drawer input[type=text] { width:100%; border:1px solid var(--line); border-radius:8px; padding:9px 10px; font-size:14px; font-family:inherit; }
  #drawer .row { display:flex; align-items:center; gap:10px; margin-top:16px; }
  #drawer p { color:var(--mut); font-size:12.5px; line-height:1.5; }
  @media (max-width: 1100px) { .stage.single { grid-template-columns:1fr; padding-left:24px; } .tabs, .meta { padding-left:24px; } .stage.compare { grid-template-columns:1fr; } }
