@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }

:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-2: #eef4f6;
  --ink: #111827;
  --muted: #607180;
  --soft: #8a98a6;
  --line: #dfe7ec;
  --brand: #0f6b78;
  --brand-dark: #0a3f48;
  --brand-soft: #dff5f6;
  --accent: #2176ff;
  --accent-soft: #e8f0ff;
  --danger: #cf3d36;
  --danger-soft: #ffeded;
  --warn: #ad6a0a;
  --warn-soft: #fff2d9;
  --ok: #147a45;
  --ok-soft: #e5f7ed;
  --shadow: 0 18px 45px rgba(15, 39, 52, 0.10);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: inherit; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.top-nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a { text-decoration: none; }
.top-nav a:hover { color: var(--brand); }

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: center;
  gap: 46px;
  padding: 46px 0 34px;
}

.eyebrow,
.panel-kicker,
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  max-width: 690px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-actions,
.export-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.62; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 25px rgba(15, 107, 120, 0.22); }
.btn-secondary { background: var(--accent-soft); color: #174ea6; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--brand-dark); }

.tool-panel,
.results-shell,
.content-band,
.trust-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tool-panel {
  border-radius: 16px;
  padding: 24px;
}

.panel-head,
.results-top,
.image-panel-head,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-head h2,
.results-top h2,
.section-heading h2,
.export-band h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 22px 0 14px;
  padding: 5px;
  background: var(--surface-2);
  border-radius: 10px;
}

.mode-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mode-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(20, 44, 56, 0.10);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#urlInput {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

#urlInput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 107, 120, 0.11);
}

.form-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 10px;
}

.error-box {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border-radius: 14px;
  margin: 0 0 28px;
}

.trust-strip div {
  min-height: 104px;
  padding: 20px;
  background: #fff;
}

.trust-strip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
}

.trust-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.results-shell {
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 34px;
}

.score-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0 16px;
}

.score-card,
.metric-card,
.issue-panel,
.image-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
}

.score-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) var(--pct), var(--line) 0deg);
}

.score-ring-inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
}

.score-num {
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand-dark);
}

.score-label {
  color: var(--soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

#scoreSummary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.metric-card {
  min-height: 116px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-card span {
  font-size: 32px;
  font-weight: 800;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card.danger span { color: var(--danger); }
.metric-card.warn span { color: var(--warn); }
.metric-card.info span { color: var(--accent); }

.scan-meta-note {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
}

.analysis-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.issue-panel,
.image-panel {
  padding: 16px;
}

.issue-panel h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.issue-list {
  display: grid;
  gap: 10px;
}

.issue-item {
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-2);
}

.issue-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.issue-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.chip.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.result-count {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.card-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
  padding: 14px 4px 2px 0;
}

.img-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.img-thumb {
  width: 74px;
  height: 74px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.img-body { min-width: 0; }

.img-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.img-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.img-url:hover { text-decoration: underline; }

.copy-btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.page-tag,
.img-alt,
.file-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.img-alt em {
  color: var(--danger);
  font-style: normal;
  font-weight: 800;
}

.pill-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--accent-soft); color: #174ea6; }
.pill-neutral { background: var(--surface-2); color: var(--muted); }

.empty-row {
  padding: 34px 12px;
  text-align: center;
  color: var(--soft);
  font-size: 14px;
}

.content-band {
  border-radius: 16px;
  padding: 34px;
  margin-bottom: 28px;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 22px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
}

.feature-grid h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-grid p,
.export-band p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 0;
}

.export-band {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  background: #fff;
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.footer-brand {
  color: var(--brand-dark);
}

.footer-copy { color: var(--soft); }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .hero,
  .analysis-layout,
  .export-band {
    grid-template-columns: 1fr;
  }

  .score-grid,
  .feature-grid,
  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header,
  main,
  .footer-inner {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    align-items: flex-start;
    padding: 16px 0;
    flex-direction: column;
  }

  .top-nav { gap: 16px; }

  .hero {
    min-height: 0;
    padding-top: 22px;
    gap: 26px;
  }

  h1 { font-size: 42px; }

  .hero-text { font-size: 16px; }

  .tool-panel,
  .results-shell,
  .content-band {
    padding: 18px;
  }

  .input-row,
  .score-grid,
  .feature-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .results-top,
  .image-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .img-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .img-thumb {
    width: 58px;
    height: 58px;
  }
}
