/* auto. — shared UI (Toss-style: white, blue accent, big type, flat surfaces) */
:root {
  --blue: #3182f6;
  --blue-press: #1b64da;
  --blue-weak: #e8f3ff;
  --ink: #191f28;
  --ink-2: #333d4b;
  --ink-3: #4e5968;
  --ink-4: #6b7684;
  --ink-5: #8b95a1;
  --line: #e5e8eb;
  --fill: #f2f4f6;
  --fill-2: #f9fafb;
  --red: #f04452;
  --green: #03b26c;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

body.ui {
  margin: 0; font-family: var(--font); color: var(--ink); background: #fff; min-height: 100vh;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
body.ui * { box-sizing: border-box; }
.ui a { color: inherit; text-decoration: none; cursor: pointer; }

.ui-shell { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 24px 120px; }
.ui-shell.wide { max-width: 1040px; }
.ui-fade { animation: uiFade .35s ease both; }
@keyframes uiFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- top bar ---- */
.ui-topbar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.ui-logo { font-size: 20px; font-weight: 800; color: var(--blue); letter-spacing: -0.03em; }
.ui-link { font-size: 14px; font-weight: 500; color: var(--ink-5); padding: 8px 0; }
.ui-link:hover { color: var(--ink-3); }
.ui-back { display: inline-flex; align-items: center; width: 40px; height: 40px; margin-left: -10px; justify-content: center; border-radius: 50%; }
.ui-back:hover { background: var(--fill); }
.ui-back svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- type ---- */
.ui-h1 { font-size: 28px; line-height: 1.4; font-weight: 700; margin: 20px 0 8px; letter-spacing: -0.03em; color: var(--ink); }
.ui-lead { font-size: 16px; line-height: 1.6; color: var(--ink-4); margin: 0 0 28px; }
.ui-h2 { font-size: 20px; font-weight: 700; margin: 0 0 16px; color: var(--ink); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.ui-h2 small { font-size: 13px; font-weight: 500; color: var(--ink-5); }
.ui-hint { font-size: 13px; color: var(--ink-5); margin-top: 8px; line-height: 1.5; }
.ui-req { font-size: 12px; font-weight: 600; color: var(--blue); background: var(--blue-weak); border-radius: 6px; padding: 3px 7px; }

/* ---- lists (toss-style rows) ---- */
.ui-list { background: var(--fill-2); border-radius: 20px; padding: 8px 20px; margin-bottom: 16px; }
.ui-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; min-height: 58px; }
.ui-row + .ui-row { border-top: 1px solid var(--line); }
.ui-row .k { font-size: 15px; color: var(--ink-4); flex-shrink: 0; }
.ui-row .v { font-size: 15px; font-weight: 600; color: var(--ink); text-align: right; word-break: break-all; }
.ui-row .v.blue { color: var(--blue); }
.ui-row .st { font-size: 16px; font-weight: 600; color: var(--ink); }
.ui-row .sd { font-size: 13px; color: var(--ink-5); margin-top: 3px; }
.ui-menu { margin: 0 -24px; }
.ui-menu a { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; font-size: 16px; font-weight: 500; color: var(--ink-2); }
.ui-menu a:hover { background: var(--fill-2); }
.ui-menu a svg, .ui-chev { width: 18px; height: 18px; stroke: #b0b8c1; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- buttons ---- */
.ui-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border: none;
  border-radius: 16px; background: var(--blue); color: #fff; font: 600 17px var(--font); cursor: pointer;
  transition: background .15s, transform .1s; letter-spacing: -0.01em;
}
.ui-btn:hover { background: #2272eb; }
.ui-btn:active { background: var(--blue-press); transform: scale(.985); }
.ui-btn:disabled { background: var(--fill); color: #b0b8c1; cursor: not-allowed; transform: none; }
.ui-btn.weak { background: var(--blue-weak); color: var(--blue-press); }
.ui-btn.weak:hover { background: #d4e8ff; }
.ui-btn.gray { background: var(--fill); color: var(--ink-3); }
.ui-btn.gray:hover { background: #e5e8eb; }
.ui-btn.sm { height: 44px; font-size: 15px; border-radius: 12px; width: auto; padding: 0 18px; }
.ui-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}
.ui-bottom .in { max-width: 432px; margin: 0 auto; display: flex; gap: 8px; }
.ui-bottom.wide .in { max-width: 992px; }

/* ---- profile summary (lobby) ---- */
.who { display: flex; align-items: center; gap: 16px; margin: 4px 0 28px; }
.who .ph { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--fill); flex-shrink: 0; }
.who .nm { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.who .mt { font-size: 14px; color: var(--ink-5); margin-top: 3px; }

.ui-error { display: none; background: #fff0f1; color: var(--red); padding: 14px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; margin-bottom: 16px; line-height: 1.5; }
.ui-notice { display: none; background: var(--blue-weak); color: var(--blue-press); padding: 14px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; margin-bottom: 16px; line-height: 1.5; }

/* ---- forms ---- */
.ui .field { margin-bottom: 20px; }
.ui .field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-4); margin: 0 0 8px; }
.ui .field input[type=text], .ui .field input[type=email], .ui .field input[type=password],
.ui .field input[type=number], .ui .field select, .ui .field textarea {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px; font: 500 16px var(--font); color: var(--ink);
  background: var(--fill); border: 1.5px solid transparent; outline: none; transition: border-color .15s, background .15s;
}
.ui .field textarea { height: auto; padding: 14px 16px; line-height: 1.6; resize: vertical; }
.ui .field input::placeholder, .ui .field textarea::placeholder { color: #b0b8c1; font-weight: 400; }
.ui .field input:focus, .ui .field select:focus, .ui .field textarea:focus { border-color: var(--blue); background: #fff; }
.ui .field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238b95a1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.ui .field input[type=file] { width: 100%; font-size: 14px; color: var(--ink-4); }
.ui .field input[type=file]::file-selector-button { margin-right: 12px; height: 40px; padding: 0 16px; border: none; border-radius: 10px; background: var(--fill); color: var(--ink-3); font: 600 14px var(--font); cursor: pointer; }
.ui .field.invalid input { border-color: var(--red); background: #fff; }
.ui .optional-tag { color: #b0b8c1; font-weight: 400; }
.ui .two-col { display: flex; gap: 12px; }
.ui .two-col .field { flex: 1; min-width: 0; }
.ui .nickname-row { display: flex; gap: 8px; }
.ui .nickname-row input { flex: 1; }
.ui .btn-small { height: 52px; padding: 0 18px; border: none; border-radius: 14px; background: var(--blue-weak); color: var(--blue-press); font: 600 15px var(--font); cursor: pointer; }
.ui .btn-small:hover { background: #d4e8ff; }

.ui .gender-toggle { display: flex; gap: 8px; }
.ui .gender-toggle label { flex: 1; margin: 0; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--fill); color: var(--ink-4); font: 600 16px var(--font); cursor: pointer; border: 1.5px solid transparent; transition: all .15s; }
.ui .gender-toggle label.male.active, .ui .gender-toggle label.female.active { background: var(--blue-weak); border-color: var(--blue); color: var(--blue-press); }

.switch { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d1d6db; cursor: pointer; transition: background .2s; }
.switch span::before { content: ''; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---- profile edit page ---- */
.ui .profile-layout { display: grid; grid-template-columns: 1fr 360px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .ui .profile-layout { grid-template-columns: 1fr; gap: 8px; } .ui .preview-col { display: none; } }
.ui .preview-col { position: sticky; top: 24px; }
.sec { padding: 28px 0; border-top: 8px solid var(--fill); margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.sec:first-child { border-top: none; }
@media (min-width: 861px) { .sec { margin: 0; padding-left: 0; padding-right: 0; border-top: 1px solid var(--line); } .sec:first-child { border-top: none; padding-top: 8px; } }
.ui .photo-picker { display: flex; align-items: center; gap: 20px; }
.ui .photo-preview { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--fill); display: flex; align-items: center; justify-content: center; }
.ui .photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.ui .photo-preview span { font-size: 12px; color: #b0b8c1; }
.ui .verify-block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.ui .verify-block:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.ui .vb-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--ink); }

#cropOverlay { background: rgba(0,0,0,.55); }
#cropModal { background: #fff; border-radius: 24px; padding: 24px; font-family: var(--font); }
#cropModal h3 { font-size: 18px; font-weight: 700; }
#cropModal .btn-secondary, #cropModal .btn-primary { height: 52px; border-radius: 14px; font: 600 16px var(--font); border: none; margin-top: 0; }
#cropModal .btn-secondary { background: var(--fill); color: var(--ink-3); }
#cropModal .btn-primary { background: var(--blue); color: #fff; }
.crop-controls button { border: none !important; background: var(--fill) !important; color: var(--ink-3) !important; }

/* ---- profile card (self-contained; used on pages and inside world modals) ---- */
.profile-card { background: #fff; color: var(--ink); font-family: var(--font); text-align: left; letter-spacing: -0.01em; }
.pc-head { display: flex; align-items: center; gap: 16px; padding: 4px 0 20px; }
.pc-photo { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--fill); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; }
.pc-noPhoto { font-size: 12px; color: #b0b8c1; }
.pc-name { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.pc-age { font-size: 14px; color: var(--ink-5); margin-top: 4px; }
.pc-gender { display: none; }
.pc-room { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--blue-press); background: var(--blue-weak); padding: 4px 10px; border-radius: 6px; }
.pc-bio { font-size: 15px; line-height: 1.7; color: var(--ink-3); background: var(--fill-2); border-radius: 16px; padding: 16px 18px; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.pc-stats { background: var(--fill-2); border-radius: 16px; padding: 4px 18px; margin: 12px 0 0; }
.pc-stat { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; font-size: 14px; }
.pc-stat + .pc-stat { border-top: 1px solid var(--line); }
.pc-stat .pc-k { color: var(--ink-4); }
.pc-stat .pc-v { font-weight: 600; color: var(--ink); text-align: right; }
.pc-verify { margin-top: 12px; background: var(--fill-2); border-radius: 16px; padding: 4px 18px; }
.badge { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; font-size: 14px; font-weight: 500; color: var(--ink-4); }
.badge + .badge { border-top: 1px solid var(--line); }
.badge b { font-weight: 600; }
.badge.on b { color: var(--blue); }
.badge.off b { color: #b0b8c1; }
.badge small { color: var(--ink-5); font-size: 12px; font-weight: 400; margin-left: 6px; }

/* ---- legal documents + site footer ---- */
.doc h1 { font-size: 28px; line-height: 1.4; font-weight: 800; letter-spacing: -0.04em; margin: 12px 0 8px; }
.doc .meta { font-size: 14px; color: var(--ink-5); margin-bottom: 28px; }
.doc .intro { font-size: 15px; line-height: 1.75; color: var(--ink-3); margin: 0 0 24px; }
.doc .toc { background: var(--fill-2); border-radius: 18px; padding: 18px 22px; margin-bottom: 36px; }
.doc .toc a { display: block; padding: 6px 0; font-size: 14px; color: var(--ink-4); }
.doc .toc a:hover { color: var(--blue); }
.doc h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 12px; padding-top: 8px; }
.doc p, .doc li { font-size: 15px; line-height: 1.8; color: var(--ink-3); }
.doc p { margin: 0 0 10px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 13.5px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); line-height: 1.6; color: var(--ink-3); }
.doc th { background: var(--fill-2); font-weight: 600; color: var(--ink-4); white-space: nowrap; }
.doc .note { background: var(--blue-weak); color: var(--blue-press); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.7; margin: 8px 0 14px; }
.doc .tbl { overflow-x: auto; }
.site-footer { margin-top: 56px; padding: 24px 0 8px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.8; color: var(--ink-5); }
.site-footer b { color: var(--ink-4); font-weight: 600; }
.site-footer .links { display: flex; gap: 14px; margin-bottom: 8px; }
.site-footer .links a { font-weight: 600; color: var(--ink-4); }

/* ---- danger + admin ---- */
.ui-btn.danger { background: #fff0f1; color: var(--red); }
.ui-btn.danger:hover { background: #ffe2e5; }
.ui-btn.red { background: var(--red); color: #fff; }
.ui-btn.red:hover { background: #d93a47; }
.ui-check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; color: var(--ink-3); cursor: pointer; margin: 8px 0 0; }
.ui-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.adm-tabs { display: flex; gap: 6px; margin: 4px 0 20px; }
.adm-tabs button { height: 40px; padding: 0 16px; border: none; border-radius: 999px; background: var(--fill); color: var(--ink-4); font: 600 14px var(--font); cursor: pointer; }
.adm-tabs button.on { background: var(--ink); color: #fff; }
.adm-tabs button i { font-style: normal; opacity: .7; margin-left: 4px; }
.adm-card { border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin-bottom: 14px; background: #fff; }
.adm-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.adm-name { font-size: 18px; font-weight: 700; } .adm-sub { font-size: 13px; color: var(--ink-5); margin-top: 3px; word-break: break-all; }
.adm-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: var(--fill); color: var(--ink-4); margin: 0 6px 6px 0; }
.adm-chip.warn { background: #fff4e0; color: #b25e00; } .adm-chip.blue { background: var(--blue-weak); color: var(--blue-press); } .adm-chip.red { background: #fff0f1; color: var(--red); }
.adm-reason { background: var(--fill-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: var(--ink-3); margin: 10px 0 14px; white-space: pre-wrap; word-break: break-word; }
.adm-actions { display: flex; gap: 8px; }
.adm-actions .ui-btn { height: 46px; font-size: 15px; border-radius: 12px; }
.adm-empty { text-align: center; color: var(--ink-5); padding: 60px 0; font-size: 15px; }

/* ---- 한글 줄바꿈: 단어 단위로 끊고, 제목은 균형 있게, 본문은 외톨이 글자가 없게 ---- */
body.ui, #landingScreen { word-break: keep-all; overflow-wrap: break-word; line-break: strict; }
.ui h1, .ui h2, .ui h3, .land-big, .big, .pv-title, .ui-h1, .ui-h2 { text-wrap: balance; }
.ui p, .ui li, .ui-lead, .land-sub, .slide-desc, .pv-desc, .ui-hint, .sd, .pc-bio, .mk-bio, .mk-bubble, .legal, .doc .intro { text-wrap: pretty; }
.land-sub { max-width: 30em; }
.ui-row .v { word-break: break-all; }
.ui textarea, .ui input { word-break: normal; }
