@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --ink: #171b1f;
  --ink-soft: #5f6973;
  --paper: #f4f5f3;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(25, 29, 33, 0.12);
  --dark-glass: rgba(25, 28, 31, 0.82);
  --accent: #891033;
  --accent-2: #2c83af;
  --success: #338323;
  --gold: #b89224;
  --shadow: 0 18px 50px rgba(21, 27, 32, 0.10);
}

html {
  scroll-behavior: smooth;
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(137, 16, 51, 0.08), transparent 29rem),
    radial-gradient(circle at 90% 20%, rgba(44, 131, 175, 0.08), transparent 27rem),
    linear-gradient(180deg, #f8f8f6 0%, #eef1ef 100%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body, button, input, textarea, select, .Select-control, .dash-table-container {
  font-family: 'Noto Sans KR', sans-serif !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Sans KR', sans-serif !important;
  letter-spacing: -0.035em;
}

.fixed-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1100;
}

.top-navbar {
  min-height: 58px;
  padding: 0.42rem 0;
  background: var(--dark-glass) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(17px);
  -webkit-backdrop-filter: blur(17px);
}

.navbar-brand {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: white !important;
}

.brand-mark {
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.brand-copy {
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: -0.02em;
}

.nav-link {
  color: rgba(255, 255, 255, 0.76) !important;
  font-size: 0.78rem;
  padding-left: 0.7rem !important;
  padding-right: 0.7rem !important;
}

.nav-link:hover {
  color: white !important;
}

.side-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 3rem;
  height: 100vh;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding-top: 78px;
  background: rgba(25, 28, 31, 0.86);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.side-rail a {
  text-decoration: none;
}

.rail-button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.80) !important;
  color: white !important;
  font-size: 0.75rem;
  line-height: 1.8rem;
  border-radius: 0.42rem;
  box-shadow: none !important;
}

.rail-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.rail-check { background: #891033 !important; }
.rail-model { background: #b87034 !important; }
.rail-eval { background: #338323 !important; }
.rail-standard { background: #2c83af !important; }

.main-content {
  width: min(1500px, calc(100% - 3rem));
  margin-left: 3rem;
  padding: 5.25rem clamp(1rem, 3vw, 3.5rem) 5.2rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: clamp(2rem, 5vw, 4.8rem);
  border-radius: 1.6rem;
  color: white;
  background:
    linear-gradient(120deg, rgba(18, 20, 22, 0.96), rgba(38, 45, 48, 0.90)),
    radial-gradient(circle at 80% 20%, rgba(137, 16, 51, 0.65), transparent 25rem);
  box-shadow: 0 30px 80px rgba(16, 20, 23, 0.20);
}

.hero-panel::before,
.hero-panel::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-panel::before {
  width: 24rem;
  height: 24rem;
  top: -13rem;
  right: -6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-panel::after {
  width: 15rem;
  height: 15rem;
  right: 7rem;
  bottom: -9rem;
  background: rgba(137, 16, 51, 0.19);
  filter: blur(5px);
}

.hero-kicker {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.71rem;
  letter-spacing: 0.17em;
  color: rgba(255, 255, 255, 0.58);
}

.hero-title {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  line-height: 1.13;
  font-weight: 700;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 1.45rem 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  line-height: 1.8;
}

.hero-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.55rem;
}

.hero-tag {
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.84);
}

.content-section {
  padding-top: 6rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.section-number {
  min-width: 2.5rem;
  padding-top: 0.38rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.section-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.7vw, 2.35rem);
  font-weight: 700;
}

.section-copy {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.glass-card {
  overflow: hidden;
  border: 1px solid rgba(25, 29, 33, 0.11) !important;
  border-radius: 1.05rem !important;
  background: var(--card) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
}

.glass-card > .card-header {
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid var(--line);
  background: rgba(235, 238, 237, 0.76);
  font-size: 0.82rem;
  font-weight: 700;
}

.glass-card > .card-body,
.glass-card .card-body {
  padding: 1.05rem;
}

.upload-box {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  border: 1px dashed rgba(25, 29, 33, 0.28);
  border-radius: 0.85rem;
  background: rgba(238, 240, 238, 0.62);
  cursor: pointer;
  transition: 0.18s ease;
}

.upload-box:hover {
  border-color: rgba(137, 16, 51, 0.62);
  background: rgba(137, 16, 51, 0.035);
  transform: translateY(-1px);
}

.upload-title {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.upload-copy {
  margin-top: 0.25rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.upload-hint {
  margin-top: 0.4rem;
  font-size: 0.68rem;
  color: rgba(95, 105, 115, 0.75);
}

.file-name {
  min-height: 1.4rem;
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.36rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #343b42;
}

.unit-chip {
  padding: 0.1rem 0.34rem;
  border-radius: 999px;
  background: #e7eae9;
  color: #6b747c;
  font-size: 0.62rem;
  font-weight: 500;
}

.metric-field {
  position: relative;
}

.metric-input,
.form-control {
  min-height: 38px;
  border: 1px solid rgba(25, 29, 33, 0.15) !important;
  border-radius: 0.58rem !important;
  background: rgba(255, 255, 255, 0.73) !important;
  font-size: 0.8rem !important;
  box-shadow: none !important;
}

.metric-input:focus,
.form-control:focus {
  border-color: rgba(137, 16, 51, 0.48) !important;
  box-shadow: 0 0 0 0.17rem rgba(137, 16, 51, 0.08) !important;
}

.field-unit {
  margin-top: 0.25rem;
  font-size: 0.65rem;
  color: var(--ink-soft);
}

.soft-rule {
  margin: 1.1rem 0;
  border-color: var(--line);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
}

.primary-action,
.secondary-action {
  min-width: 6.3rem;
  padding: 0.46rem 1rem !important;
  border-radius: 0.55rem !important;
  font-size: 0.76rem !important;
  box-shadow: none !important;
}

.primary-action {
  color: white !important;
  background: #1b2024 !important;
  border-color: #1b2024 !important;
}

.primary-action:hover {
  background: #000 !important;
}

.secondary-action {
  color: #22282d !important;
  background: transparent !important;
  border-color: rgba(25, 29, 33, 0.35) !important;
}

.compact-alert {
  padding: 0.58rem 0.8rem !important;
  margin-bottom: 0.9rem !important;
  border-radius: 0.55rem !important;
  font-size: 0.74rem;
}

.summary-label {
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.result-grade {
  margin-top: 0.15rem;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--accent);
}

.result-number {
  margin-top: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.download-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.metric-card {
  border: 1px solid rgba(25, 29, 33, 0.10) !important;
  border-radius: 0.85rem !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 10px 30px rgba(25, 29, 33, 0.07);
}

.metric-card .card-body {
  padding: 0.95rem !important;
}

.metric-name {
  font-size: 0.79rem;
  font-weight: 700;
}

.metric-role {
  padding: 0.13rem 0.38rem;
  border-radius: 999px;
  background: #edf0ef;
  color: #6d767e;
  font-size: 0.58rem;
}

.metric-value {
  margin-top: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.metric-grade {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.18rem 0.44rem;
  border-radius: 0.38rem;
  background: #ecefef;
  color: #626b72;
  font-size: 0.66rem;
  font-weight: 700;
}

.grade-1, .grade-2 { background: rgba(51, 131, 35, 0.13); color: #2b6c20; }
.grade-3, .grade-4 { background: rgba(184, 146, 36, 0.15); color: #745a12; }
.grade-5, .grade-6, .grade-7 { background: rgba(137, 16, 51, 0.11); color: #891033; }

.metric-source {
  margin-top: 0.55rem;
  min-height: 1.1rem;
  font-size: 0.63rem;
  color: var(--ink-soft);
}

.section-spacer { height: 1.2rem; }
.section-spacer-small { height: 0.9rem; }

.empty-panel {
  width: 100%;
  padding: 2rem 1rem;
  border: 1px dashed rgba(25, 29, 33, 0.20);
  border-radius: 0.8rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.48);
}

.preview-item + .preview-item {
  margin-top: 1rem;
}

.preview-label {
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  border-radius: 0.65rem;
  background: #1b1f22;
}

.summary-tile {
  padding: 0.8rem;
  border: 1px solid rgba(25, 29, 33, 0.10);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.76);
}

.summary-value {
  margin-top: 0.2rem;
  font-size: 1.08rem;
  font-weight: 700;
}

.evaluation-table-wrap {
  max-width: 100%;
  overflow: hidden;
}

.formula-box {
  height: 100%;
  padding: 0.9rem;
  border-radius: 0.75rem;
  background: #eef1f0;
  border: 1px solid rgba(25, 29, 33, 0.08);
}

.formula-title {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.formula-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  color: #374047;
}

.fixed-footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1100;
  min-height: 29px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.2rem 1rem;
  color: rgba(255, 255, 255, 0.58);
  background: var(--dark-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(15px);
  font-size: 0.64rem;
}

.Select-control,
.Select-menu-outer {
  border-color: rgba(25, 29, 33, 0.15) !important;
  font-size: 0.78rem;
}

.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
  border-collapse: collapse;
}

@media (max-width: 767.98px) {
  .side-rail {
    display: none;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: 4.6rem 0.75rem 4.8rem;
  }

  .brand-copy {
    display: none;
  }

  .nav-link {
    padding-left: 0.38rem !important;
    padding-right: 0.38rem !important;
    font-size: 0.69rem;
  }

  .hero-panel {
    min-height: auto;
    padding: 2rem 1.2rem;
    border-radius: 1rem;
  }

  .content-section {
    padding-top: 4.5rem;
  }

  .action-row {
    align-items: stretch;
  }

  .action-row .btn {
    flex: 1 1 auto;
  }
}

#leaf-input-container {
  display: grid;
  gap: 0.75rem;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.leaf-input-card {
  border-color: rgba(25, 29, 33, 0.08) !important;
  box-shadow: none !important;
}

.leaf-card-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.leaf-card-copy,
.microcopy {
  color: var(--ink-soft);
  font-size: 0.67rem;
}

.microcopy {
  margin-top: 0.6rem;
  line-height: 1.55;
}
