:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e0e8;
  --brand: #146c94;
  --brand-dark: #0f4f6c;
  --brand-soft: #e8f2f7;
  --warning: #8a5a00;
  --danger: #9f1d1d;
  --ok: #1d6b45;
  --shadow: 0 12px 32px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  gap: 16px;
}

.panel,
.result-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.intro {
  padding: 4px 2px 2px;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 8px;
  font-size: 16px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead,
.muted,
.section-head p,
.empty-state p {
  color: var(--muted);
}

.lead {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.7;
}

.about-title {
  margin: 14px 0 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

.positioning-note {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.beta-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--brand-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head p {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.5;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #f7f9fb;
}

.tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.tab.is-active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 2px 10px rgba(23, 32, 42, 0.12);
}

.is-hidden {
  display: none !important;
}

.diagnose-form,
.field {
  display: grid;
  gap: 8px;
}

.diagnose-form {
  gap: 14px;
}

.compact-field {
  max-width: 340px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

textarea {
  min-height: 230px;
  resize: vertical;
  line-height: 1.6;
}

.text-meter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.text-meter.is-warn {
  color: var(--warning);
}

.text-meter.is-ok {
  color: var(--ok);
}

.row {
  display: grid;
  gap: 12px;
}

.primary {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-weight: 700;
}

.secondary {
  min-height: 44px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0 18px;
  color: var(--brand-dark);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.primary:hover,
.primary:focus,
.secondary:hover,
.secondary:focus {
  background: var(--brand-dark);
  color: #fff;
}

.divider {
  margin: 20px 0;
  border-top: 1px solid var(--line);
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sample-chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--brand-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.sample-chip:hover,
.sample-chip:focus {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.file-drop {
  display: grid;
  gap: 8px;
  border: 1px dashed #adc1d1;
  border-radius: 10px;
  padding: 22px;
  background: #f8fbfd;
}

.file-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.file-copy {
  color: var(--muted);
  font-size: 13px;
}

.file-drop input[type="file"] {
  margin-top: 8px;
  padding: 10px;
  background: #fff;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
}

.privacy-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.privacy-note strong {
  color: #475467;
  font-weight: 700;
}

.feedback-box {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.feedback-box h2 {
  margin-bottom: 6px;
}

.feedback-box p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.feedback-form textarea {
  min-height: 108px;
}

.feedback-submit {
  width: fit-content;
  min-width: 140px;
}

.feedback-status {
  margin: 0;
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
}

.feedback-status.is-error {
  color: var(--danger);
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.score-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.score {
  display: block;
  margin-top: 4px;
  font-size: 42px;
  line-height: 1;
}

.meta-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.badge {
  flex: 0 0 auto;
  max-width: 52%;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  background: #eef4f7;
  color: var(--brand-dark);
}

.badge-likely_ai {
  background: #fff2e0;
  color: var(--warning);
}

.badge-likely_human {
  background: #eaf7f0;
  color: var(--ok);
}

.badge-uncertain {
  background: #f0f2f5;
  color: #475467;
}

.notice {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.evidence-grid {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

ul {
  margin: 0;
  padding-left: 18px;
}

li + li {
  margin-top: 6px;
}

.boundary {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.error-card {
  border-color: #f3c3c3;
  color: var(--danger);
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state .empty-note {
  max-width: 380px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.result-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
  border: 1px dashed #b7c7d4;
  border-radius: 50%;
  background: radial-gradient(circle at center, #fff 0 42%, var(--brand-soft) 43% 100%);
}

.result-orbit span {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid #8eb0c6;
  background: #fff;
}

@media (min-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr) 430px;
    align-items: start;
    padding-top: 36px;
  }

  .intro {
    grid-column: 1 / -1;
  }

  .result-slot {
    position: sticky;
    top: 20px;
  }

  .row,
  .evidence-grid {
    grid-template-columns: 1fr 1fr;
  }
}
