:root {
  --bg: #f7f8f6;
  --paper: #ffffff;
  --ink: #1b1d1f;
  --muted: #687078;
  --line: #dfe4df;
  --green: #1f5b3d;
  --dark: #173f2b;
  --mint: #eef6f1;
  --blue: #245075;
  --blue-soft: #e7eef7;
  --warn: #805b00;
  --warn-bg: #fff4dc;
  --danger: #94382f;
  --danger-bg: #fff0ef;
  --sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
}

button { font-family: inherit; }

.tool-nav {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(24px, calc((100vw - 1200px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.tool-nav a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 52px;
}

.hero {
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--line);
}

.badge,
.section-kicker {
  display: inline-block;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
}

.hero h1 {
  margin-top: 10px;
  color: var(--dark);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.16;
}

.hero p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.privacy {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 11px;
  border: 1px solid #cfe0d4;
  border-radius: 7px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
}

.error-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

.error-banner p {
  margin-top: 4px;
  font-size: 0.82rem;
}

.drop-zone {
  margin-top: 16px;
  padding: 38px 22px;
  border: 2px dashed #cdd1ca;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.drop-zone:hover,
.drop-zone.active {
  border-color: var(--green);
  background: var(--mint);
}

.file-icon {
  width: 52px;
  height: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
}

.drop-zone h2 { font-size: 1.04rem; }

.drop-zone p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.drop-actions,
.actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 7px;
  padding: 10px 17px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-primary { background: var(--green); color: #fff; }
.btn-light { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-large { padding: 13px 25px; font-size: 0.94rem; }

.file-panel,
.results,
.guide {
  margin-top: 20px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-heading h2,
.section-heading h2 {
  font-size: 1.18rem;
  line-height: 1.3;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 0.78rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eceeea;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f1ef;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.pill-ok { background: #e7f3ea; color: #23623e; }
.pill-check { background: var(--warn-bg); color: var(--warn); }
.pill-error { background: var(--danger-bg); color: var(--danger); }
.pill-dup { background: #edf0f2; color: #59616a; }

.progress {
  margin-top: 18px;
}

.progress > div {
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--line);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 0.16s;
}

.progress p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.summary > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.summary small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.summary strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1.65rem;
  font-weight: 800;
}

.summary span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 13px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.tab.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.row-check td { background: #fff9ed; }
.row-error td { background: #fff3f2; }

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

.sheet-list div {
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sheet-list strong,
.sheet-list span {
  display: block;
}

.sheet-list strong {
  color: var(--dark);
  font-size: 0.9rem;
}

.sheet-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.48;
  white-space: normal;
}

footer {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

footer strong { color: var(--green); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .summary,
  .sheet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tool-nav span { display: none; }
  .app { padding: 24px 14px 42px; }
  .panel-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .summary,
  .sheet-list {
    grid-template-columns: 1fr;
  }
}
