:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #20252b;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button,
.button-link {
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: #205072;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  background: #173b54;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

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

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

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

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

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

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

h1 {
  font-size: 42px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 17px;
}

.secondary-button {
  background: #fff;
  border: 1px solid #c8d3da;
  color: #23313b;
}

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

.button-link.secondary-button:hover {
  background: #eef4f7;
}

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

.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.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.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(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.summary-grid article {
  padding: 17px;
}

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

.summary-grid 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;
}

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

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

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

.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;
}

.subject-list,
.error-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.subject-card {
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  overflow: hidden;
}

.subject-header {
  align-items: center;
  background: #f9fbfc;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 13px;
}

.subject-title {
  display: grid;
  gap: 5px;
}

.subject-title span {
  color: #60707b;
  font-size: 13px;
  font-weight: 800;
}

.status-line {
  color: #65747e;
  font-size: 13px;
}

.assessment-list {
  display: grid;
}

.assessment-row {
  align-items: center;
  border-top: 1px solid #e9eff2;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 96px 94px minmax(220px, 0.8fr);
  min-height: 62px;
  padding: 11px 13px;
}

.assessment-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assessment-name strong,
.assessment-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assessment-name span,
.assessment-meta {
  color: #66747e;
  font-size: 13px;
}

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

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

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

.badge.pending {
  background: #eceff2;
  color: #5d6871;
}

.error-card {
  border: 1px solid #f2c7c1;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.error-card-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.error-card h3 {
  color: #8e241b;
}

.error-message {
  background: #fff7f6;
  border: 1px solid #f7d8d4;
  border-radius: 6px;
  color: #43515b;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  overflow-x: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.error-card button {
  justify-self: start;
}

.small-button {
  font-size: 12px;
  min-height: 30px;
  padding: 0 9px;
}

.empty-state {
  color: #6c7982;
  line-height: 1.5;
  padding: 18px 4px;
}

.guide-page {
  background: #fff;
  border: 1px solid #dbe3e8;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(32, 37, 43, 0.06);
  overflow: hidden;
  width: min(1040px, 100%);
}

.guide-header {
  border-bottom: 1px solid #e5ecef;
  padding: 28px;
}

.guide-lead {
  color: #53636e;
  font-size: 16px;
  line-height: 1.7;
  margin-top: 12px;
  max-width: 840px;
}

.guide-section {
  border-bottom: 1px solid #edf2f4;
  display: grid;
  gap: 14px;
  padding: 24px 28px;
}

.guide-section:last-child {
  border-bottom: 0;
}

.guide-section p,
.guide-section li,
.guide-table {
  color: #41505b;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.guide-section h2 {
  color: #1f2d36;
  font-size: 21px;
}

.guide-section h3 {
  color: #24323c;
  margin-bottom: 7px;
}

.guide-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
}

.guide-grid section {
  background: #f9fbfc;
  border: 1px solid #e2e9ee;
  border-radius: 8px;
  padding: 16px;
}

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

.guide-steps li,
.guide-list li {
  margin: 6px 0;
}

.guide-example {
  color: #53636e;
  padding-left: 4px;
}

.guide-table-wrap {
  overflow-x: auto;
}

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

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

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

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

  .upload-band,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    order: -1;
  }

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

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

@media (max-width: 680px) {
  .app-shell {
    padding: 18px 10px 32px;
  }

  h1 {
    font-size: 31px;
  }

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

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  button,
  input[type="search"],
  .button-link {
    width: 100%;
  }

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

  .guide-header,
  .guide-section {
    padding: 20px;
  }
}
