:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f5f7f4;
  --surface-soft: #fafbfa;
  --line: #e4eae1;
  --line-strong: #d5ddd2;
  --text: #0e0f0c;
  --muted: #6f756d;
  --muted-soft: #868d84;
  --primary: #04d16a;
  --primary-deep: #163300;
  --primary-soft: #e9fbf0;
  --warning: #ffefbf;
  --warning-text: #805c00;
  --danger: #ffe3e3;
  --danger-text: #a53434;
  --shadow: 0 1px 0 rgba(14, 15, 12, 0.05), 0 18px 40px rgba(14, 15, 12, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

button,
input {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.page-content {
  display: grid;
  gap: 22px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(4, 209, 106, 0.24);
  background: linear-gradient(180deg, #effcf4 0%, #e4f8ed 100%);
  display: grid;
  place-items: center;
}

.brand-mark span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary) 0%, #2fdf83 100%);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.68);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-pill,
.ghost-button,
.status-badge,
.result-model {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.header-pill,
.status-badge,
.result-model,
.ghost-button,
.metric-label,
.eyebrow,
.field-label,
.progress-label,
.field-icon,
.history-time,
.text-link {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  letter-spacing: 0.02em;
}

.header-pill,
.ghost-button,
.status-badge,
.result-model {
  padding: 10px 14px;
  font-size: 0.8rem;
}

.ghost-button {
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.ghost-button:hover,
.text-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.hero-block,
.main-panel,
.status-panel,
.result-panel,
.secondary-panel,
.faq-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.hero-block {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  padding: 28px 28px;
}

.eyebrow,
.field-label,
.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

h2,
h3,
p {
  margin: 0;
}

h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 0.94rem;
  font-weight: 700;
}

.hero-copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.hero-text {
  max-width: 720px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-stats {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero-stat {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 22px;
  padding: 18px;
}

.hero-stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 16px;
}

.text-link {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.main-panel,
.status-panel,
.result-panel,
.secondary-panel,
.faq-panel {
  padding: 24px;
}

.config-grid {
  display: grid;
  gap: 16px;
}

.config-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-shell {
  display: grid;
  gap: 8px;
}

.field-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-input:focus-within {
  background: var(--surface);
  border-color: rgba(4, 209, 106, 0.45);
  box-shadow: 0 0 0 4px rgba(4, 209, 106, 0.1);
}

.field-icon {
  font-size: 0.74rem;
  color: var(--muted-soft);
}

input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
}

input::placeholder {
  color: #9aa298;
}

.notice-card {
  height: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 16px 18px;
  display: grid;
  gap: 6px;
}

.notice-card p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
}

.picker-wrap {
  display: grid;
  gap: 8px;
}

.profile-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.profile-card {
  position: relative;
  width: 100%;
  min-height: 84px;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: 14px 42px 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.profile-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 6px 16px rgba(14, 15, 12, 0.06);
}

.profile-card.active {
  border-color: rgba(4, 209, 106, 0.42);
  background: #fcfffd;
  box-shadow: 0 0 0 2px rgba(4, 209, 106, 0.12);
}

.profile-card .model-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.profile-card .model-id {
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-all;
}

.profile-card .pick {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.profile-card.active .pick {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.85);
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.safety-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.safety-copy p {
  font-size: 0.92rem;
  color: var(--muted);
}

.safety-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
  background: var(--primary);
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--primary);
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 8px 18px rgba(4, 209, 106, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button[disabled] {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.progress-shell {
  display: grid;
  gap: 8px;
}

.progress-bar {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #edf2eb;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #71ebaa 0%, var(--primary) 100%);
  transition: width 220ms ease;
}

.progress-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.stage-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.stage-item,
.check-item,
.history-item,
.method-item,
.faq-item,
.metric-pill {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.stage-item,
.check-item {
  padding: 15px 16px;
}

.stage-line,
.check-head,
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.stage-state,
.check-status {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.stage-state.pending,
.status-badge.idle {
  background: #f2f4f1;
  color: var(--muted);
}

.stage-state.active,
.status-badge.running,
.check-status.pass {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.stage-state.done,
.status-badge.done {
  background: #eef8f2;
  color: #19562c;
}

.check-status.warn {
  background: var(--warning);
  color: var(--warning-text);
}

.check-status.fail,
.status-badge.error {
  background: var(--danger);
  color: var(--danger-text);
}

.results-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.score-card,
.checks-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 24px;
  padding: 20px;
}

.score-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: start;
}

.score-ring {
  --ring-value: 0;
  width: min(240px, 100%);
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #ffffff 0 57%, transparent 58%),
    conic-gradient(var(--primary) calc(var(--ring-value) * 1%), #ecf1eb 0);
}

.score-ring-inner {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.score-ring strong {
  font-size: 3rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.score-ring span {
  color: var(--muted);
}

.score-footnote,
.check-item p,
.method-item p,
.faq-item p,
.history-item p {
  color: var(--muted);
  line-height: 1.6;
}

.check-list,
.history-list,
.methodology-list,
.faq-list {
  display: grid;
  gap: 12px;
}

.check-meta {
  color: var(--muted-soft);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-line {
  color: var(--text);
  line-height: 1.55;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.metric-pill {
  padding: 12px 14px;
  min-width: 120px;
}

.metric-pill strong,
.history-title {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
}

.history-item,
.method-item,
.faq-item {
  padding: 16px 18px;
}

.history-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.history-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(14, 15, 12, 0.05);
}

.history-score {
  min-width: 68px;
  text-align: right;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.history-time {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted-soft);
}

.faq-item h3 {
  margin-bottom: 8px;
}

.toast {
  position: sticky;
  top: 16px;
  z-index: 40;
  width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease, padding 180ms ease;
}

.toast.show {
  padding: 14px 16px;
  opacity: 1;
  transform: translateY(0);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(14, 15, 12, 0.08);
}

.toast.info {
  background: #f4f7f3;
  border-color: var(--line);
}

.toast.success {
  background: var(--primary-soft);
  border-color: rgba(4, 209, 106, 0.2);
}

.toast.error {
  background: #fff2f2;
  border-color: #ffd4d4;
}

@media (max-width: 1080px) {
  .profile-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header,
  .panel-head,
  .action-row,
  .hero-block,
  .results-grid,
  .config-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .site-header,
  .panel-head,
  .action-row {
    align-items: flex-start;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .results-grid {
    display: grid;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 16px 0 36px;
  }

  .hero-block,
  .main-panel,
  .status-panel,
  .result-panel,
  .secondary-panel,
  .faq-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .profile-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-ring {
    width: min(220px, 100%);
  }
}

@media (max-width: 520px) {
  .profile-picker {
    grid-template-columns: 1fr;
  }

  .field-input {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
    height: auto;
    padding: 12px 14px;
  }

  .primary-button {
    width: 100%;
    justify-content: center;
  }

  .results-grid {
    gap: 12px;
  }
}
