:root {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #202124;
  --muted: #80868b;
  --border: #dadce0;
  --accent: #1f2937;
  --accent-soft: #e8f0fe;
  --accent-primary: #4285f4;
  --accent-secondary: #34a853;
  --good: #188038;
  --good-bg: #e6f4ea;
  --warn: #f57c00;
  --warn-bg: #fff3e0;
  --poor: #d33b27;
  --poor-bg: #fce5e0;
  --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --shadow-md: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-lg: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 6px 16px 4px rgba(60, 64, 67, 0.15);
  --gradient-primary: linear-gradient(135deg, #4285f4 0%, #1f73e6 100%);
  --gradient-success: linear-gradient(135deg, #34a853 0%, #188038 100%);
  --gradient-warn: linear-gradient(135deg, #fbbc04 0%, #f57c00 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f8f9fa 0%, #eef2f5 50%, #e8eef7 100%);
  min-height: 100vh;
  letter-spacing: 0.3px;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(66, 133, 244, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(52, 168, 83, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.shell {
  width: min(1320px, calc(100% - 20px));
  margin: 18px auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md), 0 0 40px rgba(66, 133, 244, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  animation: slideUp 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(66, 133, 244, 0.3), transparent);
  pointer-events: none;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.5px;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, #202124 0%, #3c4043 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 100ms both;
}

.lede {
  margin: 0 0 28px;
  max-width: 800px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 300ms both;
}

.card {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 300ms cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 500ms cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}

.card:hover {
  border-color: #c5cace;
  box-shadow: 0 1px 3px 0 rgba(66, 133, 244, 0.2), 0 8px 16px 4px rgba(66, 133, 244, 0.12);
  transform: translateY(-4px);
}

.card:hover::before {
  left: 100%;
}

.stack {
  display: grid;
  gap: 18px;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 350ms both;
}

label {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: 0.2px;
  transition: color 200ms ease;
}

textarea,
input[type="password"] {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
  transition: all 200ms cubic-bezier(0.2, 0, 0, 1);
  font-size: 0.95rem;
  position: relative;
}

textarea::placeholder,
input[type="password"]::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

textarea:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.12),
              0 0 0 1px rgba(66, 133, 244, 0.2);
}

textarea:hover:not(:focus),
input[type="password"]:hover:not(:focus) {
  border-color: #9aa0a6;
  background: #ffffff;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 280ms cubic-bezier(0.2, 0, 0, 1);
  font-size: 0.9rem;
  letter-spacing: 0.25px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 400ms ease, height 400ms ease;
  pointer-events: none;
}

button:active::before {
  width: 300px;
  height: 300px;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, #4285f4 0%, #1f73e6 100%);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.35);
  background: linear-gradient(135deg, #3b7de6 0%, #1968d4 100%);
}

.primary:active:not(:disabled) {
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.25);
}

.secondary {
  color: #1f2937;
  background: linear-gradient(135deg, #f0f4f9 0%, #e8eef7 100%);
  border: 1.5px solid #dadce0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #e8eef7 0%, #dfe6f3 100%);
  border-color: #bdc1c6;
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.15);
}

.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.status-bar {
  height: 8px;
  width: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8eaed 0%, #f0f2f5 100%);
  overflow: hidden;
  margin: 12px 0 16px 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.status-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4285f4 0%, #34a853 50%, #1f73e6 100%);
  transition: width 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(66, 133, 244, 0.4);
  position: relative;
}

.status-bar > span::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
  align-items: center;
  margin-bottom: 8px;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 400ms both;
}

.result-space {
  margin-top: 18px;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 400ms both;
}

.table-wrap {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm), 0 0 20px rgba(66, 133, 244, 0.04);
}

.report-shell {
  min-width: max-content;
}

.report-row {
  display: grid;
  align-items: stretch;
}

.report-head-group,
.report-head-sub {
  background: #6d98e8;
  color: #ffffff;
}

.report-group,
.report-subhead {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.report-group {
  font-size: 0.82rem;
}

.report-subhead {
  font-size: 0.72rem;
}

.report-group-desktop,
.report-head-sub > :nth-last-child(n+2):nth-child(n+2) {
  position: relative;
}

.report-group-desktop::before,
.report-head-sub > :nth-child(9)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(109, 152, 232, 0.2) 0%, #6D98E8 50%, rgba(109, 152, 232, 0.2) 100%);
}

.report-group-blank {
  background: #6d98e8;
}

.report-subhead-url,
.report-subhead-status {
  justify-content: flex-start;
}

.report-subhead-status {
  justify-content: center;
}

.report-body {
  background: #ffffff;
}

.report-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 5px 6px;
  border-right: 1px solid #e0e6f2;
  border-bottom: 1px solid #e0e6f2;
  background: #ffffff;
  font-size: 0.8rem;
  color: var(--text);
}

.report-url-cell {
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  color: var(--accent-primary);
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.report-cell-lab {
  background: linear-gradient(180deg, rgba(233, 225, 203, 0.18) 0%, rgba(233, 225, 203, 0.42) 45%, rgba(233, 225, 203, 0.7) 100%);
}

.report-placeholder {
  justify-content: flex-start;
  color: var(--muted);
  padding-left: 12px;
}

.report-status-cell {
  justify-content: center;
}

.report-error {
  margin-top: 4px;
  color: var(--poor);
  font-size: 0.68rem;
  font-weight: 500;
}

@media (max-width: 920px) {
  .report-group {
    font-size: 0.8rem;
  }

  .report-subhead,
  .report-cell {
    font-size: 0.76rem;
  }

  .report-url-cell {
    font-size: 0.72rem;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: all 250ms cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 400ms ease;
  pointer-events: none;
}

.pill:hover::before {
  left: 100%;
}

.good {
  color: #137333;
  background: linear-gradient(135deg, #e6f4ea 0%, #d1e8db 100%);
  border: 1px solid #a8d5ba;
  box-shadow: 0 2px 6px rgba(24, 128, 56, 0.15);
}

.good:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 128, 56, 0.25);
}

.warn {
  color: #b8860b;
  background: linear-gradient(135deg, #fff3e0 0%, #ffeaa7 100%);
  border: 1px solid #ffd699;
  box-shadow: 0 2px 6px rgba(245, 124, 0, 0.15);
}

.warn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.25);
}

.poor {
  color: #c5221f;
  background: linear-gradient(135deg, #fce5e0 0%, #f8bfb9 100%);
  border: 1px solid #f5a89a;
  box-shadow: 0 2px 6px rgba(211, 59, 39, 0.15);
}

.poor:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 59, 39, 0.25);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 400px;
  color: var(--muted);
  text-align: center;
  padding: 40px 24px;
  animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 500ms both;
}

.empty strong {
  color: var(--text);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #202124 0%, #5f6368 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty p {
  animation: slideUp 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 600ms both;
}

@media (max-width: 1200px) {
  .table-wrap {
    overflow-x: auto;
  }

  table.metrics-table {
    min-width: 1320px;
  }
}

@media (max-width: 920px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 24px;
    animation: fadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) 250ms both;
  }

  .shell {
    width: calc(100% - 20px);
    margin: 16px auto;
    padding: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  table.metrics-table {
    min-width: 1180px;
  }

  th,
  td {
    padding: 10px 6px;
    font-size: 0.8rem;
  }

  th {
    font-size: 0.7rem;
  }

  th:first-child,
  td:first-child {
    min-width: 200px;
    padding-left: 12px;
  }

  .pill {
    min-width: 90px;
    padding: 4px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 16px;
    animation: slideUp 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  h1 {
    font-size: 1.25rem;
  }

  .lede {
    font-size: 0.9rem;
  }

  button {
    width: 100%;
    padding: 12px 14px;
  }

  .controls {
    flex-direction: column;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  table.metrics-table {
    min-width: 980px;
    font-size: 0.75rem;
  }

  th,
  td {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  th {
    font-size: 0.65rem;
  }

  th:first-child,
  td:first-child {
    min-width: 150px;
    padding-left: 10px;
  }

  .url-cell {
    max-width: 150px;
    min-width: 150px;
  }
}

.compact-shell {
  min-width: max-content;
}

.report-divider-after,
.report-divider-before {
  position: relative;
}

.report-divider-after::after,
.report-divider-before::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, rgba(109, 152, 232, 0.12) 0%, rgba(109, 152, 232, 0.9) 50%, rgba(109, 152, 232, 0.12) 100%);
}

.report-divider-after::after {
  right: -1px;
}

.report-divider-before::before {
  left: -1px;
}

.report-status-cell .pill {
  min-width: 92px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

@media (max-width: 920px) {
  .shell {
    width: min(100% - 12px, 1320px);
    margin: 10px auto;
    padding: 14px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
