/* 주소365 (Juso365) — 자체 완결형 스타일. 외부 폰트·CDN 없음 */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f6f8fb;
  --card: #ffffff;
  --brand: #0f766e;
  --brand-2: #115e59;
  --brand-soft: #e6f4f1;
  --accent: #d97706;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3 { line-height: 1.28; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f7; padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip {
  position: absolute; left: -9999px; top: 0; background: #fff; padding: 10px 16px; z-index: 99;
}
.skip:focus { left: 8px; top: 8px; }

/* ── 헤더 ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), #0b5f59);
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -.04em;
  display: grid; place-items: center;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt strong { font-size: 17px; letter-spacing: -.02em; }
.brand-txt span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14.5px; font-weight: 600;
}
.site-nav a:hover { background: #eef2f7; text-decoration: none; color: var(--ink); }
.site-nav a.is-active { background: var(--brand-soft); color: var(--brand-2); }
.nav-toggle {
  display: none; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; padding: 9px; flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink-2); border-radius: 2px; }

/* ── 히어로 ───────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1100px 380px at 8% -12%, #d7efe9 0%, rgba(215, 239, 233, 0) 62%),
    radial-gradient(900px 320px at 92% -18%, #e8eefb 0%, rgba(232, 238, 251, 0) 60%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 44px 0 38px;
}
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-2); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(26px, 4.4vw, 42px); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { margin-top: 14px; max-width: 62ch; color: var(--ink-2); font-size: 16.5px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 22px 0 0; }
.hero-facts li {
  display: flex; align-items: baseline; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 13px; font-size: 13.5px; color: var(--muted);
}
.hero-facts b { color: var(--ink); font-size: 16px; }
.hero-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ── 버튼·폼 ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.2;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); cursor: pointer; transition: .15s;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: #f8fafc; }
.btn.small { padding: 8px 12px; font-size: 13.5px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.btn-row.tight { margin-top: 8px; gap: 7px; }
.link-btn {
  border: 0; background: none; padding: 0; color: var(--brand-2); font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.icon-btn {
  border: 1px solid var(--line); background: #fff; width: 34px; height: 34px; border-radius: 9px;
  cursor: pointer; font-size: 15px; color: var(--ink-2);
}
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.field > span { font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, select, input[type="text"], input[type="tel"], textarea {
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; width: 100%;
  min-height: 42px;
}
.field input:focus, .field select:focus, .field textarea:focus, input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 118, 110, .28); outline-offset: 1px; border-color: var(--brand);
}
input[readonly] { background: #f8fafc; color: var(--ink-2); }
.field-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid .span-2 { grid-column: span 2; }
.field-row { display: flex; gap: 9px; align-items: center; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.hint b { color: var(--ink-2); }

/* ── 탭 ───────────────────────────────────────────────── */
.tabbar {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 22px 0 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow);
  scrollbar-width: thin;
}
.tab {
  flex: 1 0 auto; font-family: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink-2);
  background: none; border: 0; border-radius: 9px; padding: 11px 14px; cursor: pointer; white-space: nowrap;
}
.tab:hover { background: #f1f5f9; }
.tab.is-active { background: var(--brand); color: #fff; }

/* ── 카드 ─────────────────────────────────────────────── */
.panel { display: none; }
.panel.is-active { display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 17.5px; font-weight: 800; }
.sub-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-2);
}
.badge.muted { background: #f1f5f9; color: var(--muted); }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.direct-box { margin-top: 14px; }
.direct-fields { margin-top: 12px; display: grid; gap: 10px; }

/* ── 복사 칸 ───────────────────────────────────────────── */
.copy-fields { display: grid; gap: 9px; }
.copy-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: center; }
.copy-row label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.copy-row input { font-size: 14px; }
.copy-btn {
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; cursor: pointer; color: var(--ink-2); min-height: 40px;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand-2); }
.copy-btn.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.out-line {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f8fafc;
  border: 1px dashed var(--line-2); font-size: 14px; color: var(--ink-2); word-break: break-word;
}

/* ── 기록 ─────────────────────────────────────────────── */
.history-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.history-list li.empty { color: var(--muted); font-size: 14px; }
.history-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.history-item.is-fav { border-color: #fcd34d; background: #fffbeb; }
.history-main { min-width: 0; }
.history-main b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-actions { display: flex; gap: 5px; }
.star-btn, .del-btn, .use-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12.5px;
  cursor: pointer; color: var(--ink-2); font-family: inherit; font-weight: 600;
}
.star-btn.on { color: #b45309; border-color: #fcd34d; background: #fef3c7; }

/* ── 라벨 ─────────────────────────────────────────────── */
.rec-list { display: grid; gap: 10px; margin-top: 10px; }
.rec-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fbfdff; }
.rec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rec-head b { font-size: 13.5px; color: var(--brand-2); }
.rec-fields { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rec-fields .span-2 { grid-column: span 2; }
.rec-fields input, .rec-fields select { font-size: 14px; padding: 8px 10px; min-height: 38px; }
.label-preview { display: grid; gap: 14px; }
.label-preview img {
  width: 100%; max-width: 520px; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .07); background: #fff;
}
.label-preview .empty { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* ── 관세 결과 ─────────────────────────────────────────── */
.result-card .result-list { margin: 0; display: grid; gap: 2px; }
.result-list > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
}
.result-list dt { font-size: 14px; color: var(--ink-2); }
.result-list dd { margin: 0; font-size: 15px; font-weight: 700; text-align: right; }
.result-list dd small { font-weight: 500; color: var(--muted); font-size: 12px; }
.result-list .total { border-bottom: 1px solid var(--line-2); }
.result-list .total dd { color: var(--brand-2); font-size: 18px; }
.result-list .grand {
  border: 0; margin-top: 8px; background: var(--brand-soft); border-radius: 10px; padding: 13px;
}
.result-list .grand dd { font-size: 20px; color: var(--brand-2); }
.rate-mini { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.rate-mini span {
  font-size: 12.5px; color: var(--ink-2); background: #f1f5f9; border-radius: 999px; padding: 4px 10px;
}

/* ── 표 ───────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
.data-table th, .data-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table thead th { background: #f8fafc; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr.fail td { background: #fff7f7; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 18px; box-shadow: var(--shadow); }
.table-card h3 { font-size: 16.5px; margin-bottom: 12px; }
#bulk-table { min-width: 980px; }

/* ── 가이드·FAQ ───────────────────────────────────────── */
.guide { margin-top: 30px; }
.guide > h2, .faq > h2 { font-size: clamp(21px, 2.6vw, 27px); font-weight: 800; }
.section-lede { color: var(--ink-2); margin-top: 8px; max-width: 70ch; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.guide-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.guide-card h3 { font-size: 16.5px; margin-bottom: 10px; color: var(--brand-2); }
.guide-card p, .guide-card li { font-size: 14.5px; color: var(--ink-2); }
.guide-card ol, .guide-card ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 5px; }
.guide-card .tip {
  margin-top: 12px; padding: 10px 12px; background: var(--brand-soft); border-radius: 9px;
  font-size: 13.5px; color: var(--brand-2);
}
.faq { margin: 30px 0 40px; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin-top: 9px;
}
.faq summary { font-weight: 700; cursor: pointer; font-size: 15px; }
.faq summary::marker { color: var(--brand); }
.faq details p { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }

/* ── 푸터 ─────────────────────────────────────────────── */
.site-foot { background: #0b1220; color: #cbd5e1; padding: 34px 0 20px; margin-top: 20px; }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; }
.site-foot .brand { color: #fff; }
.site-foot .brand-txt span { color: #94a3b8; }
.foot-note { margin-top: 12px; font-size: 13px; color: #94a3b8; line-height: 1.7; }
.foot-note a { color: #7dd3c8; }
.foot-col { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.foot-col b { color: #fff; font-size: 13px; letter-spacing: .02em; margin-bottom: 3px; }
.foot-col a { color: #cbd5e1; }
.copyright { width: min(1120px, 100% - 32px); margin: 22px auto 0; font-size: 12px; color: #64748b; border-top: 1px solid #1e293b; padding-top: 14px; }

/* ── 모달·토스트 ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.modal-body {
  position: relative; width: min(560px, 100%); background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); max-height: calc(100vh - 32px); overflow: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head h2 { font-size: 17px; }
.postcode-embed { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95;
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }

/* ── 인쇄 ─────────────────────────────────────────────── */
.print-area { display: none; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body > * { display: none !important; }
  body > .print-area { display: block !important; }
  .print-area img {
    display: block; margin: 0 !important; padding: 0 !important;
    page-break-after: always; break-after: page;
  }
  .print-area img:last-child { page-break-after: auto; break-after: auto; }
}

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 62px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 10px 16px 16px; gap: 2px; display: none; box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .copy-row { grid-template-columns: 1fr auto; }
  .copy-row label { grid-column: span 2; }
  .field-grid, .field-grid.small, .rec-fields { grid-template-columns: 1fr; }
  .field-grid .span-2, .rec-fields .span-2 { grid-column: span 1; }
  .hero { padding: 30px 0 26px; }
  .card { padding: 16px; }
  .foot-in { grid-template-columns: 1fr; }
  .postcode-embed { height: 60vh; }
  .tab { font-size: 13.5px; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
