:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #637174;
  --line: #c9d5d3;
  --panel: #ffffff;
  --wash: #f3f7f7;
  --accent: #28666a;
  --accent-2: #9b3d2e;
  --good: #2e6f43;
  --focus: #f0bf4c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
}

button,
a.health {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

button.secondary,
.report-actions button,
#clearBtn {
  background: #fff;
  color: var(--accent);
}

button:focus-visible,
a.health:focus-visible,
.dropzone:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 48px) 42px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.upload-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.dropzone {
  min-height: 260px;
  border: 2px dashed #91a7a4;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px 18px;
  background: #f9fbfb;
}

.dropzone.is-dragging {
  border-color: var(--accent-2);
  background: #fff7f4;
}

.drop-icon {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0;
}

.dropzone h2,
.file-list h2 {
  margin: 12px 0 6px;
  font-size: 18px;
}

.dropzone p {
  margin: 0 0 18px;
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.file-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e4ebea;
  color: var(--muted);
}

.status {
  border-left: 5px solid var(--accent);
  background: #eef6f5;
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.5;
}

.diagnostics {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.report-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.report-head h2 {
  margin: 0;
  font-size: 20px;
}

.report-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.preview {
  width: 100%;
  height: 760px;
  border: 0;
  background: #fff;
}

@media (max-width: 900px) {
  .topbar,
  .report-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .upload-panel {
    position: static;
  }

  .report-actions {
    justify-content: stretch;
  }

  .report-actions button {
    flex: 1 1 140px;
  }
}
