:root {
  --navy: #1e3a8a;
  --slate: #334155;
  --muted: #64748b;
  --ice: #f1f5f9;
  --white: #ffffff;
  --green: #ccff00;
  --red: #dc2626;
  --border: rgba(30, 58, 138, 0.1);
  --shadow: 0 12px 40px rgba(30, 58, 138, 0.1);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--navy);
  background: var(--ice);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(204, 255, 0, 0.12), transparent 36rem),
    var(--ice);
}

button,
input { font: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.audit-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.audit-logo { display: flex; }
.audit-logo img { width: auto; height: 30px; }
.audit-logo:focus-visible,
.audit-channel-card a:focus-visible {
  outline: 2px solid rgba(30, 58, 138, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
}

.audit-beta {
  padding: 5px 11px;
  color: var(--white);
  background: var(--navy);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.audit-main {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 80px;
}

.audit-intro { text-align: center; }

.audit-eyebrow,
.audit-results-eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.audit-intro h1 {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.audit-description {
  max-width: 520px;
  margin: 20px auto 0;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.7;
}

.audit-form {
  margin-top: 34px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.audit-input-row {
  display: flex;
  gap: 10px;
}

.audit-input-row input {
  min-width: 0;
  flex: 1;
  padding: 14px 16px;
  color: var(--navy);
  background: var(--ice);
  border: 1.5px solid transparent;
  border-radius: 12px;
  outline: none;
}

.audit-input-row input:focus {
  background: var(--white);
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.audit-input-row input::placeholder { color: #94a3b8; }

.audit-input-row button {
  padding: 14px 22px;
  color: var(--white);
  background: var(--navy);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.audit-input-row button:hover { opacity: 0.88; }
.audit-input-row button:focus-visible {
  outline: 3px solid rgba(30, 58, 138, 0.25);
  outline-offset: 2px;
}
.audit-input-row button:disabled {
  color: var(--muted);
  background: #e2e8f0;
  cursor: wait;
}

.audit-input-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.audit-notify-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--slate);
  font-size: 13px;
  cursor: pointer;
}

.audit-notify-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--navy);
}

.audit-notify-option:focus-within {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.audit-notify-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.audit-error {
  margin: 16px 0 0;
  padding: 12px 16px;
  color: var(--red);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 10px;
  font-size: 13px;
}

.audit-channel-card,
.audit-status,
.audit-results {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.audit-channel-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.audit-channel-card img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  background: var(--ice);
  border-radius: 50%;
}

.audit-channel-card h2 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 17px;
}

.audit-channel-card a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.audit-channel-card a:hover { color: var(--navy); text-decoration: underline; }

.audit-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
}

.audit-status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  flex: 0 0 auto;
  background: var(--navy);
  border-radius: 50%;
}

.audit-status[data-state="busy"] .audit-status-dot {
  animation: statusPulse 1.5s ease-in-out infinite;
}
.audit-status[data-state="ready"] .audit-status-dot { background: #16a34a; }
.audit-status[data-state="waiting"] .audit-status-dot { background: #d97706; }
.audit-status[data-state="error"] .audit-status-dot { background: var(--red); }

@keyframes statusPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.audit-status h2 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.audit-status p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.audit-results { padding: 24px; }

.audit-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.audit-results-eyebrow { margin-bottom: 5px; }
.audit-results-heading h2 { margin: 0; font-size: 22px; }

.audit-result-count {
  padding: 5px 10px;
  color: var(--navy);
  background: rgba(204, 255, 0, 0.45);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.audit-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-video-card {
  padding: 18px;
  background: var(--ice);
  border-radius: 14px;
}

.audit-video-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.audit-video-heading h3 {
  margin: 0;
  color: var(--slate);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.audit-video-heading a,
.audit-equipment-link {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.audit-video-heading a:hover,
.audit-equipment-link:hover { text-decoration: underline; }

.audit-equipment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-equipment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.audit-equipment-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.audit-equipment-name {
  display: block;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

.audit-equipment-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.audit-empty {
  margin: 0;
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 600px) {
  .audit-header { padding: 13px 18px; }
  .audit-main {
    width: min(100% - 28px, 760px);
    padding: 48px 0 56px;
  }
  .audit-description { font-size: 14px; }
  .audit-form { padding: 14px; border-radius: 16px; }
  .audit-input-row { flex-direction: column; }
  .audit-input-row button { width: 100%; }
  .audit-results { padding: 18px 14px; }
  .audit-equipment-item { align-items: flex-start; }
}
