/* 유즈킷 — 택배·스마트스토어 엑셀 명단 정리기
   외부 폰트·아이콘·스크립트를 불러오지 않는 자체 완결형 스타일시트 */

:root {
  --bg: #f5f7fc;
  --bg-soft: #eef1f9;
  --card: #ffffff;
  --ink: #141b2d;
  --ink-2: #38415a;
  --muted: #68718a;
  --line: #e2e6f0;
  --line-strong: #cdd4e4;
  --brand: #3b5bfd;
  --brand-dark: #2b45d6;
  --brand-soft: #eef1ff;
  --ok: #0a8f52;
  --warn: #b45309;
  --danger: #c2413b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 32px -18px rgba(16, 24, 40, .28);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
          "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.3; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.62rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.22rem, 2.5vw, 1.6rem); margin-top: 0; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
canvas { display: block; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tiny { font-size: .8rem; }
.muted { color: var(--muted); }
a.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--brand-dark); font-weight: 700; padding: 10px 16px;
  border-radius: 0 0 10px 0;
}
a.skip:focus { left: 0; }

/* ---------------- 자체 헤더(통합 배포 시 공통 헤더로 교체됨) ---------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .head-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.site-head .brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.site-head .brand:hover { text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt strong { font-size: 1rem; letter-spacing: -.01em; }
.brand-txt span { font-size: .64rem; color: var(--muted); letter-spacing: .08em; }
.head-nav { display: flex; gap: 18px; margin-left: 10px; }
.head-nav a { color: var(--ink-2); font-size: .92rem; font-weight: 600; }

.btn {
  --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; font-size: .92rem;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 8px 18px -10px rgba(59, 91, 253, .9); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { --btn-fg: var(--ink-2); --btn-bd: transparent; --btn-bg: transparent; }
.btn-sm { padding: 7px 11px; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; margin-top: 16px; padding: 13px 16px; font-size: 1rem; }
.btn-sub { font-size: .68rem; font-weight: 600; opacity: .9; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: .9rem; line-height: 1; cursor: pointer;
}
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------------- 히어로 ---------------- */
.hero { padding: 42px 0 10px; }
.eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 4px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: .76rem; font-weight: 800; letter-spacing: .02em;
}
.hero h1 { margin-bottom: 14px; }
.h1-sub { display: block; margin-top: 6px; font-size: .5em; font-weight: 700; color: var(--ink-2); letter-spacing: -.01em; }
.lead { max-width: 820px; color: var(--ink-2); font-size: 1rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.hero-badges li {
  padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm);
}

/* ---------------- 도구 레이아웃 ---------------- */
.tool { padding: 22px 0 10px; }
.xl-app { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 22px; align-items: start; }
/* 결과 표는 .tbl-scroll 안에서 가로 스크롤되므로, 좁은 화면에서 표의 최소 폭이
   바깥 그리드 열을 밀어내지 않게 한다(모바일에서 페이지 전체가 옆으로 밀리는 현상 방지). */
.xl-app > * { min-width: 0; }
.xl-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 22px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }

.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 18px 14px; margin-bottom: 8px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: 14px; background: #fbfcff;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone strong { font-size: .92rem; color: var(--ink-2); }

.sheet-row { margin: 6px 0 10px; }
.paste-field { margin-top: 6px; }
.paste-field textarea { font-family: var(--mono); font-size: .82rem; line-height: 1.5; min-height: 108px; }

.grp { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 4px; min-width: 0; }
.grp:first-of-type { border-top: 0; }
.grp legend {
  float: left; width: 100%; padding: 0 0 8px; margin: 0;
  font-size: .92rem; font-weight: 800; color: var(--ink);
}
.grp legend small { font-weight: 600; color: var(--muted); font-size: .76rem; }
.grp legend + * { clear: both; }

.grid-2 { display: grid; gap: 10px 12px; grid-template-columns: 1fr 1fr; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .72rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); font-family: inherit; font-size: .92rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(59, 91, 253, .28); outline-offset: 1px; border-color: var(--brand);
}
.field textarea { resize: vertical; }
.opt-stack { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.phone-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.radio { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 9px; background: #fff; border: 1px solid var(--line-strong); font-size: .85rem; font-weight: 600; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.radio input { accent-color: var(--brand); }
.inline-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }

.status { margin: 9px 2px 4px; font-size: .84rem; min-height: 1.2em; color: var(--ok); font-weight: 700; }
.status.is-error { color: var(--danger); }
.status.is-busy { color: var(--brand-dark); }

/* 열 역할 표 */
.map { display: grid; gap: 4px; }
.map-head, .map-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) 128px minmax(0, 1.3fr);
  gap: 8px; align-items: center;
}
.map-head { font-size: .72rem; font-weight: 800; color: var(--muted); padding: 0 2px 2px; }
.map-row { padding: 5px 6px; border-radius: 9px; background: #fbfcff; border: 1px solid var(--line); }
.map-name { font-size: .84rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-name small { color: var(--muted); font-weight: 600; }
.map-row select { width: 100%; padding: 6px 7px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; font-family: inherit; font-size: .82rem; }
.map-sample { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 출력 열 */
.outcols { display: grid; gap: 5px; }
.out-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto minmax(0, .9fr); gap: 6px; align-items: center; }
.out-no { font-size: .72rem; color: var(--muted); text-align: center; }
.out-row input {
  width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-strong);
  font-family: inherit; font-size: .86rem; font-weight: 600;
}
.out-row input:focus { outline: 2px solid rgba(59, 91, 253, .25); border-color: var(--brand); }
.out-src { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 결과 패널 ---------------- */
.xl-preview {
  position: sticky; top: 80px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
}
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.preview-head strong { font-size: .96rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; text-align: center; }
.stat b { display: block; font-size: 1.16rem; color: var(--brand-dark); line-height: 1.15; }
.stat span { font-size: .7rem; color: var(--muted); font-weight: 700; }

.warn-line {
  margin: 4px 2px 8px; padding: 8px 10px; border-radius: 9px; font-size: .78rem;
  background: #fff8ec; border: 1px solid #f3d9ae; color: var(--warn); font-weight: 600;
}

.pv-title { font-size: .84rem; margin: 12px 0 5px; color: var(--ink-2); }
.preview-box { min-height: 34px; }
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.xl-table { border-collapse: collapse; width: 100%; font-size: .76rem; min-width: 100%; }
.xl-table th, .xl-table td {
  padding: 5px 7px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: left; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
.xl-table tr:last-child th, .xl-table tr:last-child td { border-bottom: 0; }
.xl-table th, .xl-table tr.is-head th { background: var(--bg-soft); font-weight: 800; color: var(--ink-2); font-size: .72rem; }
.xl-table tr.is-head td { background: var(--bg-soft); font-weight: 800; font-size: .72rem; color: var(--ink-2); }

.removed-box { max-height: 132px; overflow: auto; }
.removed-list { margin: 4px 0 0; padding-left: 16px; font-size: .76rem; color: var(--ink-2); }
.removed-list li { margin-bottom: 2px; }

.preview-actions { display: grid; grid-template-columns: auto 1fr; gap: 6px; margin-top: 12px; }
.preview-actions .btn { flex-direction: column; gap: 0; padding: 9px 12px; line-height: 1.25; }
.pv-note { margin: 8px 2px 0; }

.ad-slot {
  margin: 26px 0 0; padding: 16px; border-radius: 12px; border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(135deg, #fbfcff, #fbfcff 10px, #f4f6fd 10px, #f4f6fd 20px);
  text-align: center; min-height: 76px; display: grid; place-items: center; gap: 4px;
}
.ad-label { font-size: .68rem; color: var(--muted); letter-spacing: .08em; }

/* ---------------- 본문 섹션 ---------------- */
.section { padding: 40px 0 8px; }
.section-lead { color: var(--ink-2); max-width: 840px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
.steps-4 { grid-template-columns: repeat(4, 1fr); }
.step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px 8px; box-shadow: var(--shadow-sm); }
.step-no {
  position: absolute; top: -12px; left: 16px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: .82rem; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 4px 10px -4px rgba(59, 91, 253, .8);
}
.step h3 { margin-top: 4px; }
.step p { font-size: .9rem; color: var(--ink-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: .9rem; }
.table-wrap th, .table-wrap td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap thead th { background: var(--bg-soft); font-size: .82rem; color: var(--ink-2); }
.table-wrap tbody th { width: 104px; font-size: .84rem; color: var(--ink); font-weight: 800; background: #fbfbfe; }
.table-wrap tr:last-child th, .table-wrap tr:last-child td { border-bottom: 0; }

.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 12px; padding: 14px 15px 4px; }
.check-card h3 { font-size: .95rem; }
.check-card p { font-size: .86rem; color: var(--ink-2); }

.faq { display: grid; gap: 8px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.faq summary::marker { color: var(--brand); }
.faq p { margin: 9px 0 2px; font-size: .9rem; color: var(--ink-2); }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mini-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px 6px; box-shadow: var(--shadow-sm); }
.mini-card h3 { font-size: .96rem; }
.mini-card p { font-size: .86rem; color: var(--ink-2); }
.hub-badge {
  display: inline-block; margin-bottom: 4px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: .68rem; font-weight: 800;
}

/* ---------------- 푸터(통합 배포 시 공통 푸터로 교체됨) ---------------- */
.site-foot { margin-top: 48px; padding: 28px 0 16px; background: #0f1629; color: #c8cfe0; }
.site-foot .foot-in { display: grid; grid-template-columns: 1.8fr 1fr 1fr; gap: 24px; }
.site-foot .brand-txt strong { color: #fff; }
.site-foot .foot-note { font-size: .82rem; color: #98a2b8; margin-top: 10px; }
.site-foot .foot-col { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.site-foot .foot-col b { color: #fff; margin-bottom: 2px; }
.site-foot .foot-col a { color: #c8cfe0; }
.site-foot .foot-base { max-width: 1180px; margin: 18px auto 0; padding: 12px 20px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .76rem; color: #8d98af; }

/* ---------------- 반응형 ---------------- */
@media (max-width: 1120px) {
  /* 1fr 은 minmax(auto, 1fr) 이라 결과 표의 최소 폭이 열을 밀어낸다. 0 으로 낮춰 표가 자기 상자 안에서만
     가로 스크롤되게 한다. */
  .xl-app { grid-template-columns: minmax(0, 1fr); }
  .xl-preview { position: static; }
}
@media (max-width: 900px) {
  .steps-4, .check-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .steps, .steps-4, .check-grid, .cards-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .map-head, .map-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .map-sample { display: none; }
  .out-row { grid-template-columns: 20px minmax(0, 1fr) auto auto; }
  .out-src { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .head-nav { display: none; }
  .xl-panel { padding: 14px 12px 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .preview-actions { grid-template-columns: 1fr; }
  .site-foot .foot-in { grid-template-columns: 1fr; }
}

@media print {
  .site-head, .site-foot, .hero, .xl-panel, .section, .ad-slot,
  .preview-head, .preview-actions, .pv-note, a.skip { display: none !important; }
  .xl-app { display: block; }
  .xl-preview { position: static; border: 0; box-shadow: none; }
}

/* 통합 사이트 공통 껍데기와 겹치는 부분은 site-chrome.css 가 이긴다 */
body.sheet-app { background: var(--bg); }
