:root {
  --bg: #0f1420;
  --panel: #171e2e;
  --panel2: #1e2740;
  --line: #2a3450;
  --text: #e8edf7;
  --muted: #93a0bd;
  --accent: #4f8cff;
  --accent2: #6ee7b7;
  --crit: #ff5d6c;
  --warn: #ffb547;
  --low: #7aa2ff;
  --good: #34d399;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 70% -10%, #1b2540 0%, var(--bg) 55%);
  color: var(--text); font: 15px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
.topbar {
  display: flex; align-items: baseline; gap: 18px; padding: 20px 28px;
  border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5; background: rgba(15,20,32,.75);
}
.brand { font-size: 22px; letter-spacing: .5px; }
.brand b { color: var(--accent); font-weight: 800; }
.brand .logo { color: var(--accent2); margin-right: 4px; }
.tagline { color: var(--muted); font-size: 13px; }
main { max-width: 1120px; margin: 0 auto; padding: 26px 20px 80px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.input-card { padding: 22px; }
.mode-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.mode { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; transition: .15s; }
.mode.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.url-row { display: flex; gap: 10px; }
#urlInput { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 13px 16px; border-radius: 11px; font-size: 15px; outline: none; }
#urlInput:focus { border-color: var(--accent); }
#analyzeBtn { background: linear-gradient(135deg, var(--accent), #7c5cff); color: #fff; border: 0; padding: 0 26px; border-radius: 11px; font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s; }
#analyzeBtn:hover { filter: brightness(1.1); }
#analyzeBtn:disabled { opacity: .5; cursor: default; }
.options { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.options input[type=number] { width: 70px; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 6px 8px; border-radius: 8px; margin-left: 6px; }
.chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hint { margin-top: 14px; color: var(--muted); font-size: 12.5px; }

.progress-card { margin-top: 20px; padding: 22px; display: flex; gap: 18px; align-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-info { flex: 1; min-width: 0; }
.progress-phase { font-weight: 600; }
.progress-url { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 3px 0 8px; }
.progress-bar { height: 7px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.progress-count { color: var(--muted); font-size: 12px; margin-top: 6px; }

.hidden { display: none !important; }

/* Sonuç düzeni */
#results { margin-top: 22px; display: flex; flex-direction: column; gap: 20px; }
.result-head { display: flex; gap: 20px; flex-wrap: wrap; align-items: stretch; }
.score-card { flex: 0 0 240px; padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge { --val: 0; --col: var(--good); width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--col) calc(var(--val)*1%), var(--panel2) 0);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.gauge-inner { width: 116px; height: 116px; background: var(--panel); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-num { font-size: 42px; font-weight: 800; line-height: 1; }
.gauge-max { color: var(--muted); font-size: 12px; }
.grade { font-weight: 700; font-size: 15px; margin-top: 2px; }
.summary-card { flex: 1; min-width: 280px; padding: 20px 22px; }
.summary-card h3 { margin: 0 0 14px; font-size: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat .n { font-size: 20px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 11.5px; }
.stat.bad .n { color: var(--crit); }
.stat.warn .n { color: var(--warn); }
.stat.good .n { color: var(--good); }

.sev-badges { display: flex; gap: 10px; margin-top: 14px; }
.badge { border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.badge.crit { background: rgba(255,93,108,.14); color: var(--crit); border-color: rgba(255,93,108,.3); }
.badge.warn { background: rgba(255,181,71,.14); color: var(--warn); border-color: rgba(255,181,71,.3); }
.badge.low { background: rgba(122,162,255,.14); color: var(--low); border-color: rgba(122,162,255,.3); }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 20px 22px; }
.cat { }
.cat-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.cat-top .cs { color: var(--muted); }
.cat-bar { height: 8px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.cat-bar > div { height: 100%; border-radius: 5px; }

.section { padding: 20px 22px; }
.section h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.section h3 .count { color: var(--muted); font-weight: 400; font-size: 13px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar button, .toolbar a { background: var(--panel2); border: 1px solid var(--line); color: var(--text); text-decoration: none; padding: 8px 14px; border-radius: 9px; font-size: 13px; cursor: pointer; }
.toolbar button:hover, .toolbar a:hover { border-color: var(--accent); }

/* Aksiyon planı */
.plan-group { margin-bottom: 18px; }
.plan-group h4 { margin: 0 0 8px; font-size: 14px; }
.plan-item { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.plan-item.crit { border-left-color: var(--crit); }
.plan-item.warn { border-left-color: var(--warn); }
.plan-item.low { border-left-color: var(--low); }
.plan-item .pt { font-weight: 600; }
.plan-item .pc { color: var(--muted); font-size: 12px; }
.plan-item .pf { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Tablo */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; top: 64px; background: var(--panel); cursor: pointer; }
tbody tr:hover { background: var(--panel2); }
.url-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.pill.s2 { background: rgba(52,211,153,.15); color: var(--good); }
.pill.s3 { background: rgba(255,181,71,.15); color: var(--warn); }
.pill.s4, .pill.s5, .pill.s0 { background: rgba(255,93,108,.15); color: var(--crit); }
.mini { display: inline-flex; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.c { background: var(--crit); } .dot.w { background: var(--warn); } .dot.l { background: var(--low); }
.row-btn { background: none; border: 1px solid var(--line); color: var(--accent); border-radius: 7px; padding: 3px 9px; cursor: pointer; font-size: 12px; }

/* Modal / URL detay */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 20; overflow: auto; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-width: 820px; width: 100%; padding: 26px; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; margin: 16px 0; font-size: 13.5px; }
.detail-grid .k { color: var(--muted); }
.detail-grid .v { word-break: break-word; }
.issue { border-left: 3px solid var(--muted); background: var(--panel2); border-radius: 8px; padding: 11px 14px; margin-bottom: 9px; }
.issue.critical { border-left-color: var(--crit); }
.issue.warning { border-left-color: var(--warn); }
.issue.low { border-left-color: var(--low); }
.issue.info { border-left-color: var(--accent); }
.issue .it { font-weight: 600; }
.issue .idetail { color: var(--muted); font-size: 12.5px; margin: 2px 0; }
.issue .why { font-size: 13px; margin-top: 5px; }
.issue .fix { font-size: 13px; margin-top: 3px; color: var(--accent2); }
.issue .why b, .issue .fix b { color: var(--text); }
h2.rtitle { margin: 0; font-size: 18px; word-break: break-all; }
a.ext { color: var(--accent); text-decoration: none; }
a.ext:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .score-card { flex: 1 1 100%; }
  th { top: 0; }
}

@media print {
  .topbar, .input-card, .toolbar, .row-btn, .modal-close { display: none !important; }
  body { background: #fff; color: #000; }
  .panel { box-shadow: none; border-color: #ccc; }
}
