*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0d12;
  --surface: #141824;
  --surface2: #1d2333;
  --border: #2a3148;
  --text: #e9ecf5;
  --muted: #8b93ab;
  --accent: #5b8cff;
  --ai: #ff5d7a;
  --human: #3ecf8e;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

header {
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-logo {
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.brand-text {
  text-align: left;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface2);
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.panel.active {
  display: block;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 14px;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 14px;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 14px;
  transition: border-color 0.2s, color 0.2s;
}

.file-label:hover {
  border-color: var(--accent);
  color: var(--text);
}

.preview {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2);
}

.preview img,
.preview video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.file-name {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  word-break: break-all;
}

.primary-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.verdict {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.verdict.ai {
  color: var(--ai);
}

.verdict.human {
  color: var(--human);
}

.prob-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.prob-row {
  display: grid;
  grid-template-columns: 90px 1fr 52px;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.bar-track {
  height: 10px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bar.ai {
  background: var(--ai);
}

.bar.human {
  background: var(--human);
}

.pct {
  text-align: right;
  color: var(--muted);
}

.details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.reason-summary {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 12px;
}

.reason-points {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.reason-points li + li {
  margin-top: 6px;
}

@media (max-width: 520px) {
  .prob-row {
    grid-template-columns: 72px 1fr 48px;
    gap: 8px;
  }
}
