:root {
  --ink: #1d2915;
  --muted: #65705f;
  --canvas: #f7faf2;
  --surface: #ffffff;
  --surface-2: #edf3e7;
  --lime: #80ff00;
  --lime-strong: #68dc00;
  --brand: #3f811c;
  --brand-dark: #1d2915;
  --danger: #a13c32;
  --warning: #8a5a13;
  --ring: #80ff00;
  --line: #dbe4d3;
  --shadow: 0 16px 45px rgba(29, 41, 21, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.5;
}

a { color: #356f18; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 244px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 28px;
  color: var(--ink);
}

.wordmark:hover { text-decoration: none; }
.brand-logo { display: block; width: 146px; height: auto; }
.wordmark small { color: var(--muted); font-weight: 650; letter-spacing: 0.02em; }

nav { display: grid; gap: 6px; }
nav a { padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 650; }
nav a:hover { background: var(--surface-2); text-decoration: none; }
nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--lime) 22%, white);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--lime-strong);
}

.identity { margin-top: auto; padding: 12px; display: grid; gap: 2px; }
.identity span { font-size: 13px; color: var(--muted); text-transform: capitalize; }
.identity form { margin-top: 8px; }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 36px 64px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.035em; margin: 2px 0 8px; }
.page-header p { margin: 0; color: var(--muted); max-width: 720px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 850;
  color: var(--brand) !important;
}

.surface, .search-panel, .result-card, .run-summary {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.search-panel { padding: 24px; margin-bottom: 28px; }
.search-grid { display: grid; grid-template-columns: 2fr repeat(3, minmax(120px, 1fr)); gap: 16px; align-items: end; }
.search-grid .wide { grid-column: span 2; }
label { display: grid; gap: 6px; font-weight: 650; font-size: 14px; }

input, select {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  min-height: 44px;
}

input:hover, select:hover { border-color: #bdcbb3; }
input:focus, select:focus, button:focus, a:focus {
  outline: 3px solid color-mix(in srgb, var(--ring) 65%, transparent);
  outline-offset: 2px;
}

.hint { font-weight: 400; color: var(--muted); }
.form-action { display: flex; align-items: end; }
.button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 780;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary { background: var(--lime); color: var(--ink); border-color: #6ee000; }
.button.primary:hover { background: var(--lime-strong); text-decoration: none; }
.button.outline { background: transparent; border-color: #bac8b1; color: var(--brand-dark); }
.button.ghost { background: transparent; color: var(--muted); padding-left: 0; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.fine-print { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

.run-summary { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.run-summary h2 { margin: 2px 0; }
.run-summary p { margin: 0; color: var(--muted); }
.status-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}

.status-chip.success { background: #e2f4e9; color: #21623d; }
.status-chip.warning { background: #fff1d7; color: var(--warning); }
.status-chip.danger { background: #fae6e3; color: var(--danger); }
.result-grid, .source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-card, .source-card { padding: 22px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.result-card h3, .source-card h2 { margin: 18px 0 4px; }
.source-card h2 { font-size: 18px; margin: 0; }
.muted { color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.notice { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; }
.notice.danger { background: #fae6e3; color: var(--danger); }
.notice.success { background: #e2f4e9; color: #21623d; }
.empty-state { padding: 44px; text-align: center; grid-column: 1 / -1; }
.empty-state h2, .empty-state h3 { margin-top: 0; }
.table-wrap { overflow: auto; max-height: 70vh; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #edf0ed; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
td.number { font-variant-numeric: tabular-nums; }
.source-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-card dl div { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.source-card dt { font-size: 12px; color: var(--muted); }
.source-card dd { margin: 2px 0 0; font-weight: 700; }

.login-page {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(128, 255, 0, 0.16), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(29, 41, 21, 0.08), transparent 32%),
    var(--canvas);
}

.auth-shell {
  width: min(1100px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  overflow: hidden;
  border: 1px solid rgba(29, 41, 21, 0.09);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(29, 41, 21, 0.16);
}

.auth-brand {
  position: relative;
  isolation: isolate;
  padding: 52px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--canvas);
  background: var(--ink);
}

.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  background: var(--lime);
}

.auth-brand::before { width: 280px; height: 280px; right: -140px; top: -120px; opacity: 0.94; }
.auth-brand::after { width: 190px; height: 190px; left: -110px; bottom: -85px; opacity: 0.12; }

.auth-logo-wrap {
  width: max-content;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--canvas);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.auth-brand-logo { display: block; width: 170px; height: auto; }
.auth-brand-copy { margin: auto 0; max-width: 470px; }
.brand-kicker {
  margin: 0 0 18px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-brand h1 {
  max-width: 520px;
  margin: 0 0 22px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.auth-brand-copy > p:last-child { max-width: 460px; margin: 0; color: #cbd4c4; font-size: 17px; }
.auth-proof { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 34px 0 0; list-style: none; }
.auth-proof li,
.auth-access-note {
  width: max-content;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid rgba(247, 250, 242, 0.18);
  border-radius: 999px;
  color: #dce4d6;
  font-size: 12px;
  font-weight: 700;
}

.auth-access-note { margin-top: auto; }
.auth-access-note span { color: var(--lime); margin-right: 5px; }

.auth-panel {
  max-width: none;
  margin: 0;
  padding: 56px;
  display: grid;
  align-items: center;
  background: var(--surface);
}

.login-card { width: min(430px, 100%); margin: 0 auto; }
.login-card h2 { margin: 5px 0 10px; font-size: 40px; line-height: 1.05; letter-spacing: -0.045em; }
.login-card > .muted { margin: 0; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-card .button { margin-top: 5px; min-height: 48px; }
.login-card input { background: #f3f7ef; border-color: #dce5d6; }
.login-card input:focus { background: var(--surface); border-color: var(--lime-strong); }
.signup-card { padding: 12px 0; }
.signup-card form { gap: 13px; margin-top: 22px; }
.signup-card .hint { font-size: 12px; line-height: 1.35; }

@media (max-width: 900px) {
  .search-grid { grid-template-columns: 1fr 1fr; }
  .search-grid .wide { grid-column: 1 / -1; }
  .result-grid, .source-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: minmax(0, 0.9fr) minmax(400px, 1.1fr); }
  .auth-brand, .auth-panel { padding: 38px; }
  .auth-brand h1 { font-size: clamp(34px, 5vw, 50px); }
}

@media (max-width: 720px) {
  .login-page { padding: 0; background: var(--surface); }
  .auth-shell { min-height: 100vh; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .auth-brand { min-height: 300px; padding: 28px 24px 34px; }
  .auth-logo-wrap { padding: 9px 12px; border-radius: 12px; }
  .auth-brand-logo { width: 130px; }
  .auth-brand-copy { margin: 44px 0 0; }
  .auth-brand h1 { font-size: 38px; max-width: 420px; }
  .auth-brand-copy > p:last-child { font-size: 15px; }
  .auth-proof { margin-top: 24px; }
  .auth-access-note { margin-top: 24px; }
  .auth-panel { padding: 42px 24px 54px; }
  .login-card h2 { font-size: 34px; }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wordmark { margin: 0 0 8px; }
  .brand-logo { width: 126px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .identity { display: none; }
  main { padding: 28px 18px 52px; }
  .page-header, .run-summary { display: grid; }
  .search-grid { grid-template-columns: 1fr; }
  .search-grid .wide { grid-column: auto; }
  .result-card, .search-panel { padding: 18px; }
  .actions { flex-wrap: wrap; }
  .page-header h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
