@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --brand: #e8783c;
  --brand-d: #cf6428;
  --brand-50: #fdf1ea;
  --ink: #1d1d1f;
  --ink-2: #4a4a4f;
  --ink-3: #8a8a90;
  --line: #ececef;
  --bg: #f5f5f7;
  --card: #ffffff;
  --ok: #1f9d55;
  --warn: #c2410c;
  --err: #d92d20;
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.5; letter-spacing: -0.01em;
  padding-bottom: 120px;
}
button, input, textarea, select { font: inherit; color: inherit; }

.top {
  background: var(--card); padding: 18px 20px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.top .brand { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: 0.08em; }
.top h1 { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.top .sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }

main { max-width: 560px; margin: 0 auto; padding: 12px 16px; }
.sec { background: var(--card); border-radius: var(--r); padding: 18px 16px; margin-bottom: 12px; }
.sec h2 { margin: 0 0 12px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec h2 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.hint { font-size: 13px; color: var(--ink-3); margin: -6px 0 12px; }

label.f { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 14px 0 6px; }
label.f:first-of-type { margin-top: 0; }
.in {
  width: 100%; border: 1px solid #dcdce0; border-radius: 10px; padding: 12px 14px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232, 120, 60, .15); }
.in.bad { border-color: var(--err); }
textarea.in { min-height: 76px; resize: vertical; }
.msg { font-size: 13px; margin-top: 6px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }
.msg.info { color: var(--ink-3); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px;
  padding: 14px 18px; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--brand); color: #fff;
}
.btn:disabled { background: #d8d8dc; color: #fff; cursor: default; }
.btn.ghost { background: #f0f0f2; color: var(--ink); }
.btn.sm { padding: 10px 14px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }

.seg { display: flex; background: #f0f0f2; border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px 0; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.opt {
  display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; background: #fff;
}
.opt.on { border-color: var(--brand); background: var(--brand-50); }
.opt .t { font-weight: 600; }
.opt .d { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #eef2ff; color: #3b4fd8; margin-right: 6px; vertical-align: 1px; }
.tag.h { background: #ecfdf3; color: #067647; }
.tag.q { background: #fef3f2; color: #b42318; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 10;
}
.bar .inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .sum { flex: 1; min-width: 0; }
.bar .sum .k { font-size: 12px; color: var(--ink-3); }
.bar .sum .v { font-size: 19px; font-weight: 800; }
.bar .btn { min-width: 132px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20; display: none; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 18px 18px 0 0; z-index: 21;
  padding: 20px 20px calc(16px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; transform: translateY(100%);
  transition: transform .22s ease;
}
.sheet.open { transform: none; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv .k { color: var(--ink-3); flex: none; }
.kv .v { text-align: right; }
.kv.total .v { font-weight: 800; font-size: 17px; }

.note { background: #fff7ed; color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.center { text-align: center; padding: 56px 20px; }
.center .ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--brand-50); color: var(--brand); font-size: 30px; }
.center h2 { margin: 0 0 8px; font-size: 21px; }
.center p { color: var(--ink-2); margin: 0 0 4px; }
.spinner { width: 28px; height: 28px; border: 3px solid #eee; border-top-color: var(--brand); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 80px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.hide { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: rgba(30, 30, 30, .92); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: 88vw; text-align: center;
}
