/* ───────── Reviewer 2 — base ───────── */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg-0: #06060f;
  --bg-1: #0c0c1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e7e9f3;
  --text-muted: #9a9eb3;
  --accent: #00e0d4;
  --accent-2: #7b5cff;
  --accent-3: #ff5cc5;
  --danger: #f87171;
  --warn: #fbbf24;
  --major: #f87171;
  --minor: #fbbf24;
  --suggest: #5ff7e8;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 30px 80px -30px rgba(0, 0, 0, 0.7),
                 0 1px 0 0 rgba(255, 255, 255, 0.05) inset;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { position: relative; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ───────── Animated mesh background ───────── */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(123, 92, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 224, 212, 0.15), transparent 60%),
    linear-gradient(180deg, #050510 0%, #0a0a1c 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 24s ease-in-out infinite;
}
.blob-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, var(--accent-2), transparent 60%);
  top: -120px; left: -80px;
}
.blob-2 {
  width: 540px; height: 540px;
  background: radial-gradient(circle, var(--accent), transparent 60%);
  bottom: -160px; right: -120px;
  animation-delay: -8s;
}
.blob-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--accent-3), transparent 65%);
  top: 50%; left: 40%;
  opacity: 0.30;
  animation-delay: -16s;
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(40px, -30px, 0) scale(1.06); }
  66%      { transform: translate3d(-30px, 20px, 0) scale(0.96); }
}

/* ───────── Layout ───────── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand:hover { color: inherit; }
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(0, 224, 212, 0.35));
  animation: sealPulse 6s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 224, 212, 0.3)); }
  50%      { filter: drop-shadow(0 0 16px rgba(0, 224, 212, 0.55)); }
}
.brand-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.top-links a {
  color: var(--text-muted);
  font-size: 14px;
}
.top-links a:hover { color: var(--text); }

.hero {
  text-align: center;
  padding: 32px 12px 28px;
}
.hero h1 {
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 14px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto;
}

/* ───────── Cards (glass) ───────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-top: 22px;
  animation: cardIn 0.45s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hidden { display: none !important; }

/* ───────── Input card ───────── */
.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .input-grid { grid-template-columns: 1fr; }
}

.field-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 14px 0 8px;
}
.field-label:first-child { margin-top: 0; }
.opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

#manuscript {
  width: 100%;
  min-height: 280px;
  max-height: 60vh;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.15s ease;
}
#manuscript:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 224, 212, 0.15); }

.counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
}
.muted { color: var(--text-muted); margin: 0; font-size: 13px; }
.warn { color: var(--warn); font-weight: 600; }

.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dropzone {
  display: block;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0, 224, 212, 0.04);
}
.dropzone.dragover { box-shadow: 0 0 0 4px rgba(0, 224, 212, 0.12); }
.dz-inner p { margin: 6px 0; color: var(--text-muted); }
.dz-inner strong { color: var(--text); font-weight: 600; }
.dz-icon {
  color: var(--accent);
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hint { font-size: 12px; opacity: 0.7; }

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(0, 224, 212, 0.06);
  border: 1px solid rgba(0, 224, 212, 0.25);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }

/* Side controls */
.input-side input[type="text"],
.input-side select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease;
}
.input-side input[type="text"]:focus,
.input-side select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 224, 212, 0.15);
}
.input-side select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}
.check-row input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #0a0a1a;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.tiny-note {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  opacity: 0.85;
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.005em;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0a0a1a;
  box-shadow: 0 10px 30px -10px rgba(0, 224, 212, 0.55);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -12px rgba(123, 92, 255, 0.6);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-strong);
  border-color: var(--text-muted);
}
.btn-block {
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  font-size: 16px;
}
.btn-icon { font-size: 16px; line-height: 1; }

/* ───────── Loading ───────── */
.loader-shell {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 4px;
}
.loader-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  mask: radial-gradient(closest-side, transparent 60%, #000 62%);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 62%);
  animation: spin 1.2s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-label h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.loader-label p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ───────── Results ───────── */
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.results-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.review-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 820px) {
  .review-layout { grid-template-columns: 1fr; }
  .review-nav { position: static !important; max-height: none !important; }
}

.review-nav {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 6px 0;
  border-right: 1px solid var(--border);
}
@media (max-width: 820px) {
  .review-nav { border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 6px; }
}
.review-nav a {
  display: block;
  padding: 7px 14px 7px 12px;
  color: var(--text-muted);
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.35;
}
.review-nav a:hover { color: var(--text); }
.review-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 224, 212, 0.05);
}

/* ───────── Rendered markdown ───────── */
.review-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.review-body h1,
.review-body h2,
.review-body h3,
.review-body h4 {
  letter-spacing: -0.01em;
  font-weight: 700;
  line-height: 1.25;
  scroll-margin-top: 24px;
}
.review-body h1 {
  font-size: 26px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.review-body h2 {
  font-size: 20px;
  margin: 32px 0 12px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.review-body h2::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.review-body h3 {
  font-size: 16.5px;
  margin: 22px 0 8px;
  color: var(--text);
}
.review-body h4 {
  font-size: 14.5px;
  margin: 18px 0 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.review-body p { margin: 0 0 12px; }
.review-body ul,
.review-body ol { margin: 0 0 14px; padding-left: 22px; }
.review-body li { margin-bottom: 6px; }
.review-body li::marker { color: var(--accent); }
.review-body strong { color: var(--text); font-weight: 700; }
.review-body em { color: var(--text); }
.review-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
}
.review-body blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent-2);
  background: rgba(123, 92, 255, 0.06);
  color: var(--text);
  border-radius: 0 6px 6px 0;
}
.review-body blockquote p:last-child { margin-bottom: 0; }
.review-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}

/* Category-tinted h3 — only if Claude follows our convention */
.review-body h3:where([id*="major"]) { color: var(--major); }
.review-body h3:where([id*="minor"]) { color: var(--minor); }
.review-body h3:where([id*="suggest"]) { color: var(--suggest); }

.verdict-banner {
  margin-top: 26px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, rgba(0, 224, 212, 0.12), rgba(123, 92, 255, 0.12));
  border: 1px solid rgba(0, 224, 212, 0.3);
  font-weight: 600;
}
.verdict-banner strong { color: var(--accent); }

/* ───────── Error ───────── */
.error-card {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.05);
}
.error-card h3 { margin: 0 0 8px; color: var(--danger); }
.error-card p { margin: 0 0 16px; color: var(--text); }

/* ───────── Footer ───────── */
.foot {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}
.foot a { color: var(--accent); }

/* ───────── Accessibility ───────── */
@media (prefers-reduced-motion: reduce) {
  .blob, .loader-ring, .seal { animation: none !important; }
  .card { animation: none !important; }
  .btn, .dropzone { transition: none !important; }
}

/* ───────── Sign-in gate & user chip ───────── */
.auth-card {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
}
.auth-hero h2 {
  margin: 8px 0 12px;
  font-size: 24px;
  font-weight: 700;
}
.auth-hero p {
  color: var(--text-dim, #a4adc4);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 auto 20px;
  max-width: 480px;
}
.auth-hero p a { color: var(--accent, #00e0d4); }
.auth-hero .tiny-note {
  font-size: 11.5px;
  color: var(--muted, #6f7791);
  margin-top: 18px;
}
.google-signin-btn-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 6px;
  min-height: 44px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  margin-right: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 13px;
}
.user-chip img {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}
.user-chip img.hidden { display: none; }
.user-chip .chip-link {
  background: none;
  border: none;
  color: var(--text-dim, #a4adc4);
  font: inherit;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}
.user-chip .chip-link:hover {
  color: var(--accent, #00e0d4);
  background: rgba(0,224,212,0.06);
}

/* ───────── Admin page ───────── */
.admin-card {
  max-width: 880px;
  margin: 0 auto 22px;
}
.admin-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}
.admin-card > p { margin: 0 0 14px; }

.user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
}
.user-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.user-email {
  font-size: 13px;
  color: var(--text-dim, #a4adc4);
  word-break: break-all;
}
.user-sub { margin-top: 4px; }
.user-row-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.admin-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent, #00e0d4);
  background: rgba(0,224,212,0.1);
  border: 1px solid rgba(0,224,212,0.3);
  padding: 1px 6px;
  border-radius: 4px;
}
