:root {
  color-scheme: light;
  background: #f5f7f8;
  color: #20252b;
  font-family: Inter, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f7f8;
  word-break: keep-all;
}

button,
input {
  font: inherit;
}

button,
.button-link {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  display: flex;
  justify-content: center;
  padding: 28px 20px 44px;
}

.workspace {
  width: min(1480px, 100%);
}

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

.eyebrow {
  color: #6b6425;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

h1 {
  font-size: 36px;
  line-height: 1.12;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.secondary-button {
  align-items: center;
  background: #fff;
  border: 1px solid #c8d3da;
  border-radius: 6px;
  color: #23313b;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.secondary-button:hover:not(:disabled) {
  background: #eef4f7;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.upload-band,
.toolbar,
.panel,
.metric {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(32, 37, 43, 0.05);
}

.upload-band {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 14px;
}

.file-drop {
  border: 1px dashed #9eb2bf;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 7px;
  min-height: 86px;
  padding: 16px;
}

.file-drop.is-dragging {
  background: #eef7fb;
  border-color: #205072;
}

.file-drop span {
  color: #61707a;
  font-size: 13px;
  font-weight: 800;
}

.file-drop strong {
  color: #1f2d36;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-drop input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric {
  color: inherit;
  min-height: 96px;
  padding: 17px;
  text-align: left;
}

.metric:hover,
.metric.is-active {
  border-color: #205072;
  box-shadow: inset 0 0 0 1px #205072;
}

.metric span,
.muted {
  color: #66747e;
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 32px;
  margin-top: 6px;
}

.toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px;
}

.segmented-control {
  background: #edf3f6;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.grade-filter {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #31424d;
  min-height: 34px;
  padding: 0 12px;
}

.grade-filter:hover,
.grade-filter.is-active {
  background: #205072;
  color: #fff;
}

input[type="search"] {
  border: 1px solid #cfd8df;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 12px;
  width: min(340px, 100%);
}

.content-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  overflow: hidden;
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid #e5ecef;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 58px;
  padding: 15px 16px;
}

.result-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.result-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  overflow: hidden;
  padding: 12px;
}

.result-summary {
  align-content: start;
  background: #f8fafb;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.result-summary strong,
.result-summary span {
  display: block;
}

.result-summary > span:not(.badge) {
  color: #53636d;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.comparison-wrap {
  min-width: 0;
}

.comparison-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid #dbe3e8;
  line-height: 1.45;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.comparison-table thead th {
  background: #edf3f6;
  color: #53636d;
  font-size: 13px;
  font-weight: 900;
}

.comparison-table tbody th {
  background: #f8fafb;
  color: #354650;
  font-size: 13px;
  width: 110px;
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(4) {
  width: 20%;
}

.comparison-table td:nth-child(3) {
  width: 36%;
}

.overall-cell {
  width: 190px;
}

.overall-cell.warning {
  background: #fff8f7;
}

.overall-cell.missing {
  background: #f5f8fc;
}

.overall-cell.general_error {
  background: #fffaf0;
}

.overall-cell.ok {
  background: #f3fbf6;
}

.overall-cell strong,
.overall-cell span {
  display: block;
}

.overall-cell strong {
  margin-top: 8px;
}

.overall-cell > span:last-child {
  color: #4e5f68;
  font-size: 13px;
  margin-top: 6px;
}

.comparison-result span {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  min-height: 26px;
  align-items: center;
  padding: 3px 10px;
}

.comparison-result.match span {
  background: #d9f0e2;
  color: #146c3f;
}

.comparison-result.mismatch {
  background: #fff8f7;
}

.comparison-result.mismatch span {
  background: #fde2df;
  color: #a12b20;
}

.comparison-result.unavailable span {
  background: #eceff2;
  color: #5d6871;
}

.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  width: fit-content;
}

.badge.ok {
  background: #d9f0e2;
  color: #146c3f;
}

.badge.warning {
  background: #fde2df;
  color: #a12b20;
}

.badge.missing {
  background: #e5ecf6;
  color: #29466b;
}

.badge.general_error {
  background: #fff0c6;
  color: #765100;
}

.empty-state {
  color: #697880;
  padding: 8px 2px;
}

.guide-page {
  width: min(1080px, 100%);
}

.guide-header,
.guide-section {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(32, 37, 43, 0.05);
  margin-bottom: 14px;
  padding: 22px;
}

.guide-lead {
  color: #4f5f68;
  line-height: 1.65;
  margin-top: 12px;
}

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

.guide-grid section,
.guide-note {
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  padding: 16px;
}

.guide-section h2 {
  margin-bottom: 12px;
}

.guide-section p,
.guide-section li,
.guide-table th,
.guide-table td {
  line-height: 1.65;
}

.guide-steps,
.guide-list {
  margin: 0;
  padding-left: 22px;
}

.guide-table {
  border-collapse: collapse;
  width: 100%;
}

.guide-table th,
.guide-table td {
  border: 1px solid #dbe3e8;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  background: #edf3f6;
}

@media (max-width: 1080px) {
  .workspace-header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-band,
  .summary-grid,
  .guide-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

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

  .comparison-wrap {
    overflow-x: auto;
  }

  .comparison-table {
    min-width: 760px;
  }
}
