﻿:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --ink: #182331;
  --muted: #66758a;
  --line: #dbe3ee;
  --soft-line: #edf2f7;
  --teal: #168878;
  --teal-dark: #0e655b;
  --blue: #386ca6;
  --coral: #df704a;
  --gold: #b9862d;
  --plum: #725aa3;
  --danger: #bf4545;
  --shadow: 0 18px 42px rgba(26, 39, 56, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

progress {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef5;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e8eef5;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--blue);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--blue);
}

button {
  min-height: 42px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1480px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 3px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.service-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.service-brief > div {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.service-brief strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.service-brief p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.main-column {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.panel,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.input-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.panel-header,
.skill-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header p,
.skill-header p,
.summary-label,
.summary-card p,
.range-note {
  color: var(--muted);
}

.panel-header p,
.skill-header p {
  line-height: 1.45;
  font-size: 12px;
  font-weight: 800;
}

.skill-header {
  margin-bottom: 14px;
}

.primary-button,
.ghost-button,
.tab-button {
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  border: 0;
  padding: 0 17px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 22px rgba(22, 136, 120, 0.24);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost-button {
  border: 1px solid var(--line);
  padding: 0 13px;
  background: #fff;
  color: var(--muted);
}

.ghost-button:hover {
  border-color: #b7c4d4;
  color: var(--ink);
}

.view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.tab-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.view-panel {
  display: grid;
  gap: 18px;
}

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

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.input-skill-group {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.skill-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.skill-actions span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.field-control {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field-label {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-note {
  font-size: 11px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 900;
}

input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(22, 136, 120, 0.15);
}

.skill-search {
  margin-bottom: 10px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.skill-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.skill-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.skill-toggle:has(input:checked) {
  border-color: rgba(22, 136, 120, 0.58);
  background: rgba(22, 136, 120, 0.12);
  color: var(--teal-dark);
}

.skill-toggle[hidden] {
  display: none;
}

.result-strip {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.85fr;
  gap: 18px;
}

.summary-card {
  min-height: 148px;
  padding: 18px;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.summary-card p {
  margin-top: 10px;
  line-height: 1.55;
  font-size: 13px;
  font-weight: 800;
}

.summary-label {
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.highlight-card {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-color: transparent;
}

.highlight-card .summary-label {
  color: rgba(255, 255, 255, 0.78);
}

.meter {
  height: 11px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 220ms ease;
}

.meter-progress {
  height: 11px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.28);
}

.meter-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.28);
}

.meter-progress::-webkit-progress-value,
.meter-progress::-moz-progress-bar {
  background: #fff;
}

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

.recommendation {
  min-height: 72px;
  border: 1px solid rgba(56, 108, 166, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(56, 108, 166, 0.06);
}

.recommendation strong {
  display: block;
  overflow: hidden;
  color: #254f80;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.bar-chart,
.skill-bars,
.roadmap-list,
.importance-list,
.overfit-chart {
  display: grid;
  gap: 10px;
}

.roadmap-item {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 14px;
}

.roadmap-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.roadmap-item strong {
  color: var(--ink);
  font-size: 14px;
}

.roadmap-item p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.roadmap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.roadmap-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(56, 108, 166, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(56, 108, 166, 0.06);
  color: #254f80;
  font-size: 11px;
  font-weight: 900;
}

.roadmap-chip.done {
  border-color: rgba(22, 136, 120, 0.24);
  background: rgba(22, 136, 120, 0.12);
  color: var(--teal-dark);
}

.chart-row,
.skill-row,
.importance-row,
.overfit-row {
  display: grid;
  grid-template-columns: minmax(116px, 0.85fr) minmax(120px, 1.5fr) 78px;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--soft-line);
  padding-bottom: 10px;
}

.chart-row:last-child,
.skill-row:last-child,
.importance-row:last-child,
.overfit-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chart-label,
.skill-label,
.importance-label,
.overfit-label {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track,
.skill-track,
.importance-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.chart-progress,
.skill-progress {
  height: 12px;
}

.chart-progress.secondary::-webkit-progress-value {
  background: var(--gold);
}

.chart-progress.secondary::-moz-progress-bar {
  background: var(--gold);
}

.skill-progress::-webkit-progress-value {
  background: var(--coral);
}

.skill-progress::-moz-progress-bar {
  background: var(--coral);
}

.chart-fill,
.chart-fill-secondary,
.skill-fill,
.importance-fill {
  height: 100%;
  border-radius: 999px;
}

.chart-fill {
  background: var(--blue);
}

.chart-fill-secondary {
  background: var(--gold);
}

.skill-fill {
  background: var(--coral);
}

.importance-fill {
  background: var(--teal);
}

.chart-value,
.skill-value,
.importance-value,
.overfit-value {
  text-align: right;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.importance-value,
.overfit-value {
  color: var(--muted);
  font-size: 11px;
}

.chart-meta,
.skill-meta {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.model-table {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--soft-line);
  padding: 12px 10px;
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table th {
  color: var(--muted);
  background: var(--panel-soft);
}

.comparison-table td {
  color: var(--ink);
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table strong {
  display: inline-block;
  margin-right: 8px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(22, 136, 120, 0.12);
  color: var(--teal-dark);
  font-size: 11px;
}

.metric-card,
.confusion-cell {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.metric-card {
  min-height: 84px;
}

.metric-card span,
.confusion-cell span,
.confusion-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.confusion-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.confusion-cell {
  min-height: 92px;
}

.confusion-cell strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 28px;
  line-height: 1;
}

.svg-chart {
  min-height: 300px;
}

.svg-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.axis-line {
  fill: none;
  stroke: #98a8bb;
  stroke-width: 1.2;
}

.diagonal-line {
  fill: none;
  stroke: #c8d2de;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.roc-line {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.overfit-bars {
  display: grid;
  gap: 4px;
}

.overfit-bar {
  height: 8px;
  border-radius: 999px;
}

.train-bar {
  background: var(--blue);
}

.cv-bar {
  background: var(--coral);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--danger);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
    max-height: none;
  }

  .recommendations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-brief {
    grid-template-columns: 1fr;
  }

  .solution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar,
  .topbar-actions,
  .panel-header,
  .skill-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .skill-actions,
  .view-tabs,
  .topbar-actions {
    width: 100%;
  }

  .skill-actions {
    justify-content: space-between;
  }

  .result-strip,
  .insight-grid,
  .recommendations,
  .metric-cards {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 250px;
  }

  .summary-card {
    min-height: 118px;
  }

  .primary-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 24px;
  }

  .status-pill {
    white-space: normal;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .chart-row,
  .skill-row,
  .importance-row,
  .overfit-row {
    grid-template-columns: 96px 1fr 64px;
  }
}
