@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.css');

:root {
  --bg: #F4F5FA;
  --surface: #FFFFFF;
  --surface-2: #F7F7FB;
  --surface-3: #EFF0F6;
  --primary: #5546E0;
  --primary-dark: #4335C4;
  --primary-tint: #EEEBFC;
  --primary-tint-strong: #DFD9F8;
  --ink: #14151F;
  --text: #22232E;
  --text-muted: #6B6E80;
  --text-faint: #9A9DAE;
  --border: #E6E7F0;
  --border-strong: #D7D9E6;
  --green: #17B378;
  --green-tint: #E4FBF1;
  --blue: #2F6FE0;
  --blue-tint: #E8EFFD;
  --orange: #C5790F;
  --orange-tint: #FBF0DD;
  --red: #D8384E;
  --red-tint: #FBE9EC;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --control-h: 46px;
  --shadow-sm: 0 1px 2px rgba(20,21,31,0.05);
  --shadow-card: 0 1px 2px rgba(20,21,31,0.03), 0 10px 26px rgba(35,32,74,0.05);
  --shadow-pop: 0 14px 34px rgba(28,25,58,0.16);
}

* { box-sizing: border-box; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  word-break: keep-all;
}

.container { max-width: 560px; margin: 0 auto; padding: 0 18px 90px; }
.container.wide { max-width: 980px; }

h1 { font-size: 22px; font-weight: 800; margin: 22px 0 6px; letter-spacing: -0.02em; color: var(--ink); }
.subtitle { color: var(--text-muted); font-size: 13.5px; margin-bottom: 26px; line-height: 1.6; }

.admin-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header-row .subtitle { margin-bottom: 0; }
.admin-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.admin-header-actions .btn-secondary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  padding: 9px 16px;
}

a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ── Top nav ─────────────────────────────────────────── */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 17px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.topnav .brand-mark {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: -0.02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(85,70,224,0.28);
}
.topnav .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.topnav .brand-text .name { font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; color: var(--ink); }
.topnav .brand-text .by { font-weight: 500; font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.01em; }
.topnav .links { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--text-muted); }
.topnav .links .who { display: flex; align-items: center; gap: 6px; }
.topnav .links .who .avatar {
  width: 20px; height: 20px; border-radius: 50%; background: var(--primary-tint); color: var(--primary);
  font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.topnav .links b { color: var(--text); font-weight: 600; }
.topnav .links a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.topnav .links a:hover { color: var(--text); }
.topnav .links a.danger { color: var(--red); }
.topnav .links .sep { width: 1px; height: 13px; background: var(--border-strong); }

@media (max-width: 480px) {
  .topnav { flex-wrap: wrap; row-gap: 10px; padding: 16px 0; }
  .topnav .brand-text .by { white-space: nowrap; }
  .topnav .links { width: 100%; flex-wrap: wrap; row-gap: 8px; column-gap: 12px; }
}

/* ── Stepper (numbered card sequence) ─────────────────── */
.step { display: flex; gap: 14px; align-items: stretch; }
.step-marker { flex: none; width: 30px; display: flex; flex-direction: column; align-items: center; }
.step-num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--primary-tint);
  margin-top: 26px;
}
.step-marker .line { flex: 1; width: 2px; background: var(--border-strong); margin: 8px 0; min-height: 20px; }
.step:last-of-type .step-marker .line { display: none; }
.step .card { flex: 1; min-width: 0; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.card h2 .required { color: var(--red); font-weight: 600; font-size: 12px; }
.card h2 .step-badge { display: none; } /* legacy, superseded by .step-num */

/* ── Form fields ──────────────────────────────────────── */
.field { margin-bottom: 18px; display: flex; flex-direction: column; }
.field:last-child { margin-bottom: 0; }

.field-label, .field > label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
}
.field-label .required, .field > label .required { color: var(--red); font-weight: 600; font-size: 11px; white-space: nowrap; }

/* legacy inline hint (kept for spots below inputs, e.g. helper text under a field) */
.field .hint, .hint {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.field-note { font-size: 12px; color: var(--text-muted); margin-top: 7px; line-height: 1.55; }
.field-note-inline { font-size: 12px; font-weight: 400; color: var(--text-muted); }
small { color: var(--text-muted); font-size: 12px; }

/* 인증정보(공동인증서·간편인증) 처리 안내 — 저장하지 않는다는 신뢰 메시지 */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--green-tint);
  border: 1px solid rgba(23,179,120,0.25);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #0F7A52;
  line-height: 1.55;
}
.security-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.security-note b { font-weight: 700; }

/* Info tooltip — keeps every label a single line so paired fields always align */
.tip { position: relative; display: inline-flex; flex: none; }
.tip-trigger {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  border: none;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: help;
  flex: none;
}
.tip-trigger:hover, .tip.open .tip-trigger { background: var(--primary-tint); color: var(--primary); }
.tip-bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.55;
  white-space: normal;
  padding: 9px 11px;
  border-radius: 9px;
  width: max-content;
  max-width: 220px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 30;
}
.tip-bubble::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.tip:hover .tip-bubble, .tip.open .tip-bubble { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

input[type=text], input[type=password], input[type=date], select {
  width: 100%;
  height: var(--control-h);
  padding: 0 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=password]:focus, input[type=date]:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
input::placeholder { color: var(--text-faint); }
input[readonly] {
  background: #E4E6ED;
  color: var(--text-muted);
  border-color: #D3D6E0;
  cursor: default;
  box-shadow: none;
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none'%3E%3Cpath d='M1 1L5.5 5.5L10 1' stroke='%236B6E80' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.row { display: flex; gap: 12px; align-items: flex-start; }
.row > .field { flex: 1; min-width: 0; }

@media (max-width: 480px) {
  .row { flex-direction: column; gap: 0; }
}

/* ── Segmented / pill radio group ────────────────────── */
.seg {
  display: flex;
  gap: 8px;
  margin-top: 0;
  flex-wrap: wrap;
}
.seg label {
  font-weight: 500 !important;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 0 !important;
}
.seg label:has(input:checked) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(85,70,224,0.28);
}
.seg input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }

/* ── Toggle box (conditionally shown sub-section) ────── */
.toggle-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  background: var(--surface-2);
  transition: opacity .15s;
}
.toggle-box.dim { opacity: 0.4; pointer-events: none; }
.toggle-box input[type=text], .toggle-box input[type=password], .toggle-box select {
  background: var(--surface);
  border-color: var(--border);
}
.toggle-box .field { margin-bottom: 16px; }

/* ── Optional-section disclosure button (accuracy-boosting fields) ──── */
.optional-disclosure {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.optional-disclosure:hover { border-color: var(--primary); background: var(--primary-tint); }
.optional-disclosure-badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: 999px;
  padding: 3px 9px;
}
.optional-disclosure-text { flex: 1; color: var(--text-muted); font-weight: 500; }
.optional-disclosure-chevron {
  flex: none;
  color: var(--text-faint);
  transition: transform .15s;
  font-size: 12px;
}
.optional-disclosure[aria-expanded="true"] .optional-disclosure-chevron { transform: rotate(180deg); }
.toggle-box .field:last-child { margin-bottom: 0; }

/* ── Buttons ──────────────────────────────────────────── */
button.submit, a.submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 15px 28px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: center;
  display: block;
  text-decoration: none;
  box-sizing: border-box;
  box-shadow: 0 10px 22px rgba(85,70,224,0.24);
  transition: background .15s, transform .1s, box-shadow .15s;
}
button.submit:hover, a.submit:hover { background: var(--primary-dark); box-shadow: 0 10px 22px rgba(67,53,196,0.3); }
button.submit:active, a.submit:active { transform: translateY(1px); }
button.submit:disabled { background: #CFCBEE; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  height: var(--control-h);
  background: var(--primary-tint);
  color: var(--primary);
  border: none;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--primary-tint-strong); }
.btn-confirm {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(85,70,224,0.24);
}
.btn-confirm:hover { background: var(--primary-dark); }

.btn-danger { background: var(--red-tint); color: var(--red); }
.btn-danger:hover { background: #F7D3D8; }

/* ── Flash (actionable warning) ───────────────────────── */
.flash {
  background: var(--orange-tint);
  border: none;
  color: #7A4F0E;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ── Note (calm, non-alarming inline info) ───────────── */
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 13px 15px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.55;
}
.note .icon { flex: none; font-size: 15px; line-height: 1.4; }

/* ── Icon avatar (colored circle) ─────────────────────── */
.icon-badge {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.icon-badge svg { width: 19px; height: 19px; }
.icon-badge.purple { background: var(--primary-tint); color: var(--primary); }
.icon-badge.green { background: var(--green-tint); color: var(--green); }
.icon-badge.orange { background: var(--orange-tint); color: var(--orange); }
.icon-badge.blue { background: var(--blue-tint); color: var(--blue); }

/* ── List row (used on result/summary screens) ───────── */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row .main { flex: 1; min-width: 0; }
.list-row .main .title { font-weight: 700; font-size: 14.5px; }
.list-row .main .desc { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* ── Table ────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); word-break: keep-all; overflow-wrap: break-word; }
th, td { padding: 12px 12px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.wrap { white-space: normal; }
th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

.table-scroll {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
}

/* ── Row action buttons (table cells with multiple small forms) ── */
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: center; }
.row-actions form { display: flex; align-items: center; gap: 6px; margin: 0; }
.row-actions input[type=text] {
  height: 32px; width: 96px; padding: 0 10px; font-size: 12px;
}
.row-actions .btn-secondary, .row-actions .btn-danger {
  height: 32px; padding: 0 12px; font-size: 12px;
}

/* ── Pagination ───────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; }
.pager a, .pager span {
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none; color: var(--text-muted);
  background: var(--surface-2);
}
.pager a:hover { background: var(--primary-tint); color: var(--primary); }
.pager span.current { background: var(--primary); color: #fff; }
.pager span.ellipsis { background: transparent; color: var(--text-faint); }
.pager a.disabled, .pager span.disabled { opacity: 0.35; pointer-events: none; }

/* ── Tags (soft pill) ─────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.tag.cancel { background: var(--green-tint); color: var(--green); }
.tag.loss { background: var(--orange-tint); color: var(--orange); }
.tag.none { background: var(--surface-2); color: var(--text-muted); }
.tag.officer { background: var(--primary-tint); color: var(--primary); }

.pill-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-tint);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
}

/* ── Summary stat cards ───────────────────────────────── */
.summary-box { display: flex; gap: 14px; margin-bottom: 18px; }
.summary-box .stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.summary-box .stat .num { font-size: 25px; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.summary-box .stat .label { font-size: 12.5px; color: var(--text-muted); margin-top: 7px; }

.btn-download {
  display: block;
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.btn-download:hover { background: #34363F; }

a.back-link { color: var(--text-muted); font-size: 13px; text-decoration: none; }
a.back-link:hover { color: var(--text); }

/* 이미 채워진 값을 "직접 고치고 싶을 때" 누르는 링크 — 그냥 텍스트처럼 안
   보이게 칩(pill) 모양으로 확실히 눌러지는 느낌을 준다. */
a.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-tint);
  transition: background .15s;
}
a.edit-link:hover { background: var(--primary-tint-strong); }
.delete-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--red); font-size: 13px; font-family: inherit; text-decoration: none;
}
.delete-link-btn:hover { text-decoration: underline; }

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.bulk-actions label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.bulk-actions .btn-danger {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.search-bar input[type=text] {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  width: 160px;
}
.search-bar button {
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-bar a.clear-search { font-size: 12.5px; color: var(--text-muted); text-decoration: none; }
.search-bar a.clear-search:hover { text-decoration: underline; }

/* login */
.login-wrap { max-width: 380px; margin: 0 auto; padding-top: 88px; }
.login-mark {
  width: 44px; height: 44px;
  margin: 0 auto 18px;
  border-radius: 13px;
  background: linear-gradient(155deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(85,70,224,0.3);
}
.login-wrap .card { box-shadow: var(--shadow-card); }

/* ── File upload: large dropzone (primary uploads) ────── */
.file-drop {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--primary); background: var(--primary-tint); }
.file-drop-icon {
  width: 42px; height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.file-drop-icon svg { width: 19px; height: 19px; }
.file-drop-text { font-size: 13.5px; color: var(--text); }
.file-drop-text b { font-weight: 700; }
.file-drop-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }

.file-drop-filled[hidden] { display: none; }
.file-drop-filled { display: flex; align-items: center; gap: 12px; text-align: left; }
.file-chip-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary-tint); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.file-chip-icon svg { width: 17px; height: 17px; }
.file-chip-info { flex: 1; min-width: 0; }
.file-chip-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.file-chip-remove {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--surface-3); color: var(--text-muted); cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.file-chip-remove:hover { background: var(--red-tint); color: var(--red); }

/* ── File upload: compact picker (paired inline w/ a text field) ─ */
.file-picker {
  height: var(--control-h);
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-faint);
  transition: border-color .15s, background .15s;
}
.file-picker:hover, .file-picker.dragover { border-color: var(--primary); background: var(--surface); }
.file-picker.has-file { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.file-picker-icon { flex: none; display: flex; color: var(--text-faint); }
.file-picker.has-file .file-picker-icon { color: var(--primary); }
.file-picker-icon svg { width: 16px; height: 16px; }
.file-picker-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker-remove[hidden] { display: none; }
.file-picker-remove {
  flex: none; width: 21px; height: 21px; border-radius: 50%; border: none;
  background: var(--surface-3); color: var(--text-muted); cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.file-picker-remove:hover { background: var(--red-tint); color: var(--red); }

/* ── 약관/개인정보 동의 (terms.html) ───────────────────────── */
.consent-row {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 4px; cursor: pointer; list-style: none;
}
.consent-row::-webkit-details-marker { display: none; }
.consent-item { border-top: 1px solid var(--border); }
.consent-item:first-of-type { border-top: none; }
.consent-all { padding: 8px 4px 15px; }
.consent-divider { height: 1px; background: var(--border-strong); margin: 0 0 4px; }

.consent-row input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-check {
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.consent-check::after {
  content: ""; width: 6px; height: 10px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px); opacity: 0;
}
.consent-row input[type="checkbox"]:checked + .consent-check {
  background: var(--primary); border-color: var(--primary);
}
.consent-row input[type="checkbox"]:checked + .consent-check::after { opacity: 1; }
.consent-all .consent-check { width: 22px; height: 22px; }

.consent-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.consent-title { font-size: 14px; font-weight: 600; color: var(--text); }
.consent-all .consent-label b { font-size: 15px; }
.consent-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.consent-chevron {
  flex: none; color: var(--text-faint); font-size: 18px; transition: transform .15s;
}
.consent-item[open] .consent-chevron { transform: rotate(90deg); }
.consent-body {
  padding: 4px 4px 20px 37px; font-size: 12.5px; line-height: 1.7;
  color: var(--text-muted); white-space: pre-line;
  max-height: 260px; overflow-y: auto;
}

/* ── Modal / popup (used for 이용약관 동의) ───────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,21,31,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  padding: 4px;
}
.modal-card .modal-inner { padding: 24px 22px 22px; }
.modal-card h1 { font-size: 19px; margin: 4px 0 6px; }
.modal-card .subtitle { margin-bottom: 18px; }
.modal-close {
  position: sticky; top: 0; display: flex; justify-content: flex-end;
  padding: 10px 10px 0;
}
.modal-close a {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 15px;
}
.modal-close a:hover { background: var(--surface-3); color: var(--text); }

/* ── 개인사업자 간편인증 2차 인증 예고 팝업 ─────────────────── */
.second-auth-steps { margin: 16px 0 22px; }
.second-auth-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.second-auth-step:last-child { margin-bottom: 0; }
.second-auth-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--border);
  color: var(--text-muted);
}
.second-auth-step.is-done { background: var(--green-tint); }
.second-auth-step.is-done .second-auth-check { background: var(--green); color: #fff; }
.second-auth-step span:nth-child(2) { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.second-auth-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.second-auth-step.is-done .second-auth-status { color: var(--green); }

/* 지금 진행할 단계 — 옅은 회색이라 눈에 안 띈다는 피드백이 있어서, 완료
   단계(초록)만큼 뚜렷하게 강조색+테두리+살짝 커지는 느낌을 준다. */
.second-auth-step.is-current {
  background: var(--primary-tint);
  border: 1.5px solid var(--primary);
  padding: 11px 13px;
  box-shadow: 0 4px 12px rgba(85,70,224,0.16);
}
.second-auth-step.is-current .second-auth-check {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px var(--primary-tint-strong);
}
.second-auth-step.is-current span:nth-child(2) { color: var(--ink); font-weight: 800; }
.second-auth-step.is-current .second-auth-status { color: var(--primary); font-weight: 800; }

/* ── Breakdown list (임원/가족 등 원인 유발 명단) ──────── */
.breakdown-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.breakdown-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.breakdown-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breakdown-row .who .nm { font-weight: 600; color: var(--text); white-space: nowrap; }
.breakdown-row .amt { font-weight: 700; color: var(--text); white-space: nowrap; }
.tag.family { background: var(--orange-tint); color: var(--orange); }

/* ── Full-screen loading overlay (form 제출 중 표시) ─────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(20,21,31,0.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
}
.loading-overlay.show { display: flex; }
.loading-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  max-width: 320px;
}
.loading-spinner {
  width: 44px; height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid var(--primary-tint);
  border-top-color: var(--primary);
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.loading-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* ── 환급 결과 히어로 카드 ────────────────────────────────── */
.refund-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-xl);
  padding: 34px 28px 30px;
  text-align: center;
  color: #fff;
  box-shadow: 0 16px 36px rgba(85,70,224,0.32);
  margin-bottom: 14px;
}
.refund-hero .eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.82;
  margin-bottom: 10px;
}
.refund-hero .amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.refund-hero .amount.amount-zero {
  font-size: 22px;
  font-weight: 700;
  opacity: 0.92;
}
.refund-hero .amount-label {
  font-size: 12.5px;
  opacity: 0.85;
  margin-top: 8px;
}
.refund-hero .hero-note {
  font-size: 11.5px;
  opacity: 0.78;
  line-height: 1.6;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.22);
}
.refund-hero .hero-note-warn {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 1;
  color: #FFD873;
  margin-top: 14px;
  padding-top: 0;
  border-top: none;
}
.hero-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.22);
  text-align: left;
}
.hero-split-label { font-size: 12.5px; opacity: 0.88; }
.hero-split-amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.hero-split-total .hero-split-label,
.hero-split-total .hero-split-amount { font-size: 15px; font-weight: 800; }

/* ── 정보 스트립(수신/발신/검토일 등) ──────────────────────── */
.info-strip {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.info-strip .cell {
  flex: 1;
  padding: 16px 18px;
  text-align: center;
}
.info-strip .cell + .cell { border-left: 1px solid var(--border); }
.info-strip .cell .k { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; }
.info-strip .cell .v { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ── 향후 진행절차 스텝퍼 ─────────────────────────────────── */
.proc-steps { display: flex; flex-direction: column; }
.proc-step { display: flex; gap: 14px; }
.proc-step .dot-col { flex: none; width: 26px; display: flex; flex-direction: column; align-items: center; }
.proc-step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-faint);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.proc-step.current .dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-tint); }
.proc-step .dot-col .bar { flex: 1; width: 2px; background: var(--border); margin: 4px 0; min-height: 18px; }
.proc-step:last-child .dot-col .bar { display: none; }
.proc-step .body { flex: 1; min-width: 0; padding-bottom: 20px; }
.proc-step:last-child .body { padding-bottom: 0; }
.proc-step .title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.proc-step.current .title { color: var(--primary); }
.proc-step .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.proc-step .now-badge {
  display: inline-block; margin-left: 7px;
  font-size: 10.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-tint); padding: 2px 8px; border-radius: 999px;
  vertical-align: middle;
}

/* ── 담백한 안내 목록(소멸시효 등 유의사항) ─────────────────── */
.notice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.notice-list li {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  padding-left: 14px; position: relative;
}
.notice-list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint);
}

/* ── 소개 페이지 ──────────────────────────────────────────── */
.intro-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-tint); padding: 6px 13px; border-radius: 999px;
  margin-bottom: 14px;
}
.intro-lead { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0 0 4px; }

.intro-item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
}
.intro-item:last-child { border-bottom: none; }
.intro-item-icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: var(--primary-tint); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
/* 체크리스트/안심 섹션까지 전부 보라색 아이콘이면 화면이 온통 보라색
   반복으로만 보인다는 피드백 — 정보성 섹션은 중립 톤/그린 톤으로 갈라서
   보라는 "지금 할 행동"(단계 번호, 비교표 강조, CTA)에만 남긴다. */
.intro-item-icon.neutral { background: var(--surface-3); color: var(--text-muted); }
.intro-item-icon.safe { background: var(--green-tint); color: var(--green); }
.intro-item-body { min-width: 0; }
.intro-item-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.intro-item-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

.intro-compare { display: flex; flex-direction: column; gap: 10px; }
.intro-compare-col { border-radius: var(--radius-md); padding: 16px 17px; }
.intro-compare-col.old { background: var(--surface-2); }
.intro-compare-col.new { background: var(--primary-tint); }
.intro-compare-col-title { font-size: 12.5px; font-weight: 800; color: var(--text-muted); margin-bottom: 10px; }
.intro-compare-col.new .intro-compare-col-title { color: var(--primary); }
.intro-compare-row { font-size: 13px; color: var(--text-muted); padding: 6px 0; }
.intro-compare-col.new .intro-compare-row { color: var(--ink); font-weight: 600; }

.intro-faq-item { padding: 15px 0; border-bottom: 1px solid var(--border); }
.intro-faq-item:last-child { border-bottom: none; }
.intro-faq-q { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.intro-faq-a { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.6; }

.intro-final {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-xl); padding: 28px 24px; text-align: center; color: #fff;
}
.intro-final h2 { color: #fff; font-size: 17px; margin: 0 0 8px; }
.intro-final p { font-size: 12.5px; opacity: 0.85; margin: 0 0 18px; }
.intro-final .cta {
  display: inline-block; background: #fff; color: var(--primary-dark);
  font-weight: 800; font-size: 14px; padding: 12px 24px; border-radius: var(--radius-md);
  text-decoration: none;
}

/* 소개 페이지 전용 — 스크롤 내내 화면 하단에 떠 있는 CTA 버튼.
   흰 바탕 바 없이 버튼 자체만 고정한다. 컨테이너에 하단 여백을 줘서
   마지막 카드가 버튼에 가려지지 않게 한다. */
.container.has-sticky-cta { padding-bottom: 88px; }
.sticky-cta-btn {
  position: fixed;
  left: 18px; right: 18px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: 524px; margin: 0 auto; box-sizing: border-box; text-align: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 15px;
  padding: 15px 20px; border-radius: var(--radius-md); text-decoration: none;
  box-shadow: 0 12px 28px rgba(85,70,224,0.38);
}
.sticky-cta-btn:hover { background: var(--primary-dark); }

/* ── 대리인 선임 서명 모달 ─────────────────────────────────── */
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.action-buttons button { flex: 1; min-width: 150px; }
.action-buttons .btn-secondary { height: var(--control-h); width: 100%; }

.sig-modal-card { max-width: 560px; }
.sig-modal-card .modal-inner { padding: 20px 18px 22px; }

.pdf-preview-wrap { position: relative; width: 100%; line-height: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin-bottom: 14px; }
.pdf-preview-wrap img { width: 100%; display: block; }

/* 회사명/대표자 성명 미리보기 — 실제 PDF와 같은 위치(%)에 겹쳐서 보여준다 */
.pdf-preview-text {
  position: absolute;
  display: flex;
  align-items: center;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.6vw;
  color: #111;
  pointer-events: none;
}
@media (min-width: 640px) {
  .pdf-preview-text { font-size: 9px; }
}
/* 주소는 길어서 한 줄로 안 잘리게 여러 줄로 감싸 보여준다(실제 PDF도 최대
   3줄까지 자동 줄바꿈함 — agent_consent.py의 _draw_wrapped_text와 맞춤) */
#ceoAddressPreview {
  white-space: normal;
  text-overflow: clip;
  overflow: visible;
  line-height: 1.25;
  font-size: 1.35vw;
}
@media (min-width: 640px) {
  #ceoAddressPreview { font-size: 7.6px; }
}
/* 서명줄 옆 대표자 이름은 그 칸 안에서 가운데 정렬(왼쪽에 붙어 보이는 것 방지) */
#sigNamePreview { justify-content: center; }

/* 서명 위치 마커 — "(서명 또는 인)" 칸 자리에 정확히 배치, 탭 영역은 살짝 넓게 */
.sig-marker {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(85,70,224,0.10);
  border: 1.5px dashed var(--primary);
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-style 0.15s ease;
}
.sig-marker:active { background: rgba(85,70,224,0.18); }
.sig-marker.is-signed {
  background: rgba(255,255,255,0.65);
  border-style: solid;
  border-color: var(--green, #1f9d55);
}
.sig-marker-label {
  font-size: 10px;
  line-height: 1.25;
  color: var(--primary);
  font-weight: 700;
  text-align: center;
  padding: 2px;
  pointer-events: none;
}
.sig-marker-stamp {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  pointer-events: none;
}

/* 크게 보이는 서명 패드 */
.sig-pad-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2.6 / 1;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.sig-pad-wrap canvas {
  width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.sig-pad-baseline {
  position: absolute;
  left: 6%; right: 6%; bottom: 20%;
  border-bottom: 1.5px dashed var(--border);
  pointer-events: none;
}

.sig-pad-cancel {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
  text-decoration: underline;
}

.sig-controls { display: flex; gap: 10px; margin-top: 14px; }
.sig-controls .btn-secondary { flex: none; }
.sig-controls .submit { flex: 1; }

.sig-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 10px; line-height: 1.5; }

.sig-success { text-align: center; padding: 30px 10px; }
.sig-success .check {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-tint); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 16px;
}
.sig-success .title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sig-success .desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── 모바일 최적화 ────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 0 14px 70px; }
  .container.wide { padding: 0 12px 70px; }

  h1 { font-size: 19px; margin-top: 18px; }
  .subtitle { font-size: 12.5px; margin-bottom: 18px; }

  .card { padding: 20px 16px; }
  .card h2 { font-size: 14.5px; margin-bottom: 15px; }

  button.submit, a.submit { padding: 14px 18px; font-size: 14.5px; }
  .btn-secondary { padding: 0 14px; font-size: 13px; }

  .seg label { padding: 9px 14px; font-size: 13px; }

  /* 히어로 카드 */
  .refund-hero { padding: 26px 18px 22px; border-radius: var(--radius-lg); }
  .refund-hero .amount { font-size: 30px; }
  .refund-hero .hero-note { font-size: 11px; }

  /* 정보 스트립 — 좁은 화면에서는 세로로 쌓기 */
  .info-strip { flex-direction: column; }
  .info-strip .cell + .cell { border-left: none; border-top: 1px solid var(--border); }

  /* 표는 가로 스크롤 유지하되 셀 여백만 축소 */
  th, td { padding: 9px 8px; font-size: 12px; }

  .summary-box { flex-direction: column; gap: 10px; }

  .modal-card { max-width: 100%; }
  .modal-card .modal-inner { padding: 20px 16px 18px; }

  .loading-card { padding: 28px 22px; max-width: 280px; }
}
