:root {
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  color-scheme: light;
  --page-bg: #f4f7fb;
  --panel-bg: #ffffff;
  --summary-bg: #eef6f2;
  --text: #172033;
  --muted-text: #5c677a;
  --accent: #116149;
  --accent-strong: #0b4936;
  --border: #d8e0ea;
  --field-bg: #ffffff;
  --shadow: 0 18px 50px rgba(25, 39, 66, 0.1);
  --toggle-bg: #ffffff;
  --toggle-text: #172033;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #111827;
  --panel-bg: #182033;
  --summary-bg: #10251f;
  --text: #f8fafc;
  --muted-text: #cbd5e1;
  --accent: #38b68d;
  --accent-strong: #5bd0aa;
  --border: #334155;
  --field-bg: #0f172a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --toggle-bg: #0f172a;
  --toggle-text: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page-bg);
}

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

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: 2.4rem;
  line-height: 1.2;
  letter-spacing: 0;
}

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

p,
li {
  line-height: 1.75;
  color: var(--muted-text);
}

.theme-toggle,
.submit-button {
  cursor: pointer;
  border: 0;
  font-weight: 800;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 86px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--toggle-text);
  background: var(--toggle-bg);
}

.theme-toggle:hover,
.submit-button:hover {
  transform: translateY(-1px);
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
  align-items: start;
}

.contact-summary,
.contact-form {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.contact-summary {
  padding: 28px;
  background: var(--summary-bg);
}

.contact-summary ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.contact-form {
  display: grid;
  gap: 12px;
  padding: 28px;
  background: var(--panel-bg);
}

label {
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--field-bg);
  font: inherit;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #8c98aa;
}

.consent-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 6px;
  color: var(--muted-text);
  font-weight: 600;
}

.consent-row input {
  min-height: 18px;
  margin: 4px 0 0;
  accent-color: var(--accent);
}

.submit-button {
  min-height: 50px;
  margin-top: 8px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 1rem;
}

.submit-button:hover {
  background: var(--accent-strong);
}

.classifier-section {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.classifier-copy p:last-child {
  margin-bottom: 0;
}

.classifier-tool {
  display: grid;
  gap: 16px;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 76px;
  padding: 18px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: var(--summary-bg);
  text-align: center;
  cursor: pointer;
}

.upload-box span {
  font-weight: 800;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preview-panel {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field-bg);
  overflow: hidden;
}

.preview-panel img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

#emptyPreviewText {
  margin: 0;
  padding: 24px;
  text-align: center;
}

.prediction-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--summary-bg);
}

.prediction-panel p {
  margin-bottom: 0;
}

.prediction-result {
  display: grid;
  gap: 12px;
}

.prediction-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.prediction-row {
  display: grid;
  gap: 6px;
}

.prediction-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-text);
  font-weight: 700;
}

.prediction-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.prediction-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.comments-section {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.comments-section h2 {
  margin-bottom: 20px;
}

#disqus_thread {
  min-height: 180px;
}

noscript {
  display: block;
  width: min(1040px, calc(100% - 32px));
  margin: -36px auto 48px;
  color: var(--muted-text);
  line-height: 1.7;
}

noscript a {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 640px);
    padding: 32px 0;
  }

  .page-header,
  .contact-layout,
  .classifier-section {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
  }

  .theme-toggle {
    width: 100%;
  }

  .contact-summary,
  .contact-form,
  .classifier-section,
  .comments-section {
    padding: 22px;
  }

  .preview-panel {
    min-height: 220px;
  }

  noscript {
    width: min(100% - 24px, 640px);
    margin: -20px auto 32px;
  }
}
