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

:root {
  --org: #23395b;        /* 기관 테마색 (관리자에서 바꿈) */
  --org-ink: #ffffff;
  --label: #fbfbf9;      /* 케어라벨 바탕 */
  --ground: #e4e7ea;     /* 바깥 바탕 */
  --ink: #18202b;
  --ink-2: #4c5663;
  --ink-3: #87909b;
  --line: #d3d8de;
  --line-2: #e8ebee;
  --stitch: #b9c0c8;
  --warn: #b4442c;
  --ok: #2c6e4f;
  --kakao: #fee500;
  --sans: 'Pretendard', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ground); }
body { font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.55; word-break: keep-all; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--org); outline-offset: 2px; }

/* 샘플 표시 */
.sample-strip { font-size: 11px; color: var(--ink-2); background: #fff; border-bottom: 1px solid var(--line); padding: 5px 16px; display: flex; justify-content: space-between; gap: 8px; }
.sample-strip b { font-weight: 600; color: var(--ink); }

/* ===== 모바일 ===== */
.phone { width: 100%; max-width: 390px; min-height: 100vh; margin: 0 auto; background: var(--label); position: relative; display: flex; flex-direction: column; }
@media (min-width: 520px) { .phone { box-shadow: 0 0 0 1px var(--line); } }

.top { background: var(--org); color: var(--org-ink); padding: 12px 16px 14px; display: flex; align-items: center; gap: 12px; }
.top .back { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; background: transparent; color: inherit; display: grid; place-items: center; flex: none; }
.top .back[hidden] { display: none; }
.org-mark { width: 36px; height: 36px; flex: none; }
.top .t1 { font-size: 12px; opacity: .8; }
.top .t2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }

/* 라벨 띠 (품번·로트) */
.tape { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; color: var(--ink-2); border-bottom: 1px dashed var(--stitch); background: #fff; }

main.view { flex: 1; padding: 0 0 24px; }

/* 메인 허브 */
.hub-hero { padding: 20px 16px 8px; }
.hub-hero h1 { font-size: 22px; line-height: 1.3; letter-spacing: -.02em; font-weight: 750; }
.hub-hero p { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.hub-spin { margin: 8px 16px 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; position: relative; overflow: hidden; }
.hub-spin canvas { display: block; width: 100%; height: 280px; touch-action: none; cursor: grab; }
.hub-spin .open { position: absolute; left: 12px; bottom: 12px; font-size: 13px; background: var(--ink); color: #fff; border: 0; border-radius: 3px; padding: 6px 10px; }

.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.hub-btn { text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--org); border-radius: 4px; padding: 14px 12px 14px; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; text-decoration: none; }
.hub-btn:active { background: var(--line-2); }
.hub-btn svg { width: 28px; height: 28px; color: var(--org); }
.hub-btn b { font-size: 16px; font-weight: 700; display: block; }
.hub-btn span { font-size: 12px; color: var(--ink-2); display: block; margin-top: 2px; }
.hub-btn.kakao { background: var(--kakao); border-color: #e3cc00; border-left-color: #3c1e1e; }
.hub-btn.kakao svg { color: #3c1e1e; }
.hub-btn.kakao span { color: #5a4a00; }

.hub-foot { margin: 4px 16px 0; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 12px; }

/* 섹션 공통 */
.sec { padding: 20px 16px 4px; }
.sec h2 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.sec .sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* 360 뷰어 */
.spin { background: #fff; border-bottom: 1px solid var(--line); position: relative; }
.spin canvas { display: block; width: 100%; height: 400px; touch-action: none; cursor: grab; }
.spin canvas.grabbing, .hub-spin canvas.grabbing { cursor: grabbing; }
.spin .hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; background: rgba(24,32,43,.82); color: #fff; padding: 4px 10px; border-radius: 3px; pointer-events: none; transition: opacity .4s; white-space: nowrap; }
.spin .hint.off { opacity: 0; }
.spin .zoombar { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: hidden; }
.spin .zoombar button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 20px; line-height: 1; }
.spin .zoombar button + button { border-top: 1px solid var(--line); }
.spin .zoombar .zv { font-size: 11px; text-align: center; padding: 3px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.dial { padding: 10px 16px 12px; display: flex; align-items: center; gap: 12px; }
.dial .play { flex: none; height: 32px; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 4px; font-size: 13px; }
.dial .play[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ruler { flex: 1; height: 32px; position: relative; }
.ruler svg { width: 100%; height: 100%; display: block; }
.dial .deg { flex: none; width: 44px; text-align: right; font-size: 13px; font-weight: 600; }
.spin-note { font-size: 11px; color: var(--ink-3); padding: 0 16px 12px; }

/* 원단·부자재 표 */
.spec { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.spec th { text-align: left; font-weight: 600; color: var(--ink-2); width: 92px; padding: 9px 0; border-top: 1px solid var(--line-2); vertical-align: top; }
.spec td { padding: 9px 0; border-top: 1px solid var(--line-2); }
.swatches { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.sw { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.sw i { display: block; height: 72px; }
.sw span { display: block; font-size: 12px; padding: 6px 8px; color: var(--ink-2); }
.sw .s1 { background: repeating-linear-gradient(45deg, #36424f 0 2px, #3d4a58 2px 4px); }
.sw .s2 { background: repeating-linear-gradient(0deg, #c9ced4 0 3px, #e6e9ec 3px 4px); }
.sw .s3 { background: radial-gradient(circle at 50% 50%, #9aa3ad 0 6px, transparent 7px) 0 0/18px 18px, #2a333e; }
.cap { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* 사용법 */
.video { margin: 12px 16px 0; background: #1e2631; border-radius: 4px; aspect-ratio: 16 / 9; position: relative; color: #fff; overflow: hidden; }
.video button.big { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; border: 2px solid #fff; background: transparent; color: #fff; display: grid; place-items: center; }
.video .vt { position: absolute; left: 12px; top: 10px; font-size: 13px; opacity: .9; }
.video .vbar { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 11px; }
.video .vbar i { flex: 1; height: 3px; background: rgba(255,255,255,.3); position: relative; }
.video .vbar i::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #fff; }
.chapters { list-style: none; margin: 10px 16px 0; font-size: 13px; }
.chapters li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.chapters li b { font-weight: 600; width: 40px; color: var(--org); }

.care { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.care div { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line-2); }
.care div:nth-child(odd) { border-right: 1px solid var(--line-2); }
.care div:nth-last-child(-n+2) { border-bottom: 0; }
.care svg { width: 40px; height: 40px; flex: none; color: var(--ink); }
.care b { display: block; font-size: 13px; font-weight: 650; }
.care span { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.4; }

.acc { margin-top: 12px; border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; padding: 13px 0; font-weight: 650; display: flex; justify-content: space-between; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; font-weight: 400; color: var(--ink-3); }
.acc details[open] summary::after { content: '−'; }
.acc ul { padding: 0 0 14px 18px; font-size: 14px; color: var(--ink-2); }
.acc li + li { margin-top: 4px; }

/* A/S 폼 */
.form { padding: 4px 16px 0; }
.fs { border: 0; margin-top: 18px; }
.fs legend { font-size: 13px; font-weight: 700; color: var(--org); padding-bottom: 6px; border-bottom: 2px solid var(--org); width: 100%; margin-bottom: 4px; }
.fld { display: block; margin-top: 12px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.fld > span em { color: var(--warn); font-style: normal; margin-left: 2px; }
.fld input[type=text], .fld input[type=tel], .fld input[type=email], .fld select, .fld textarea { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 0 12px; font-size: 16px; }
.fld textarea { height: 96px; padding: 10px 12px; resize: vertical; }
.fld .err { display: none; font-size: 12px; color: var(--warn); margin-top: 4px; }
.fld.bad .err { display: block; }
.fld.bad input, .fld.bad select { border-color: var(--warn); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.seg label { text-align: center; padding: 11px 0; font-size: 15px; position: relative; }
.seg label + label { border-left: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + i { position: absolute; inset: 0; background: var(--org); z-index: 0; }
.seg label span { position: relative; z-index: 1; }
.seg input:checked ~ span { color: #fff; font-weight: 600; }
.seg input:focus-visible ~ span { outline: 2px solid var(--ink); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 3px; padding: 7px 11px; font-size: 14px; }
.chips input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--org); outline-offset: 2px; }
.file { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--stitch); border-radius: 4px; padding: 12px; font-size: 13px; color: var(--ink-2); background: #fff; }
.agree { margin-top: 18px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.agree .box { font-size: 12px; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line-2); line-height: 1.6; }
.agree label { display: flex; gap: 8px; align-items: center; padding: 12px; font-size: 14px; font-weight: 600; }
.agree input { width: 20px; height: 20px; accent-color: var(--org); }
.agree.bad { border-color: var(--warn); }
.submit { width: 100%; height: 52px; margin-top: 18px; background: var(--org); color: var(--org-ink); border: 0; border-radius: 4px; font-size: 16px; font-weight: 700; }

/* 접수 완료 */
.done { padding: 28px 16px 0; }
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 4px; position: relative; }
.ticket .head { background: var(--org); color: var(--org-ink); padding: 14px 16px; font-size: 14px; }
.ticket .no { padding: 18px 16px 6px; }
.ticket .no small { display: block; font-size: 12px; color: var(--ink-2); }
.ticket .no strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: .01em; margin-top: 2px; }
.ticket dl { display: grid; grid-template-columns: 84px 1fr; padding: 8px 16px 16px; font-size: 14px; row-gap: 6px; border-top: 1px dashed var(--stitch); margin-top: 12px; padding-top: 14px; }
.ticket dt { color: var(--ink-2); }
.done p.note { font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.row-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.row-btn button, .row-btn a { height: 48px; border: 1px solid var(--line); background: #fff; border-radius: 4px; font-size: 15px; font-weight: 600; display: grid; place-items: center; text-decoration: none; }
.row-btn .k { background: var(--kakao); border-color: #e3cc00; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; padding: 9px 14px; border-radius: 4px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 20; max-width: 340px; text-align: center; }
.toast.on { opacity: 1; }

.wm { font-size: 11px; color: var(--ink-3); text-align: right; padding: 12px 16px 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
