/* 레이아웃: 임차인 화면은 휴대폰 폭의 단일 열에서 한 번에 한 가지 일만 한다. 관리자 화면만 넓게 쓴다.
   글꼴은 기기에 깔린 한글 글꼴을 쓴다(외부 글꼴 서버에 접속하지 않음). */
:root {
  /* 밤하늘 남색 + 가로등 주황. 홈페이지(site.css)와 같은 색 이야기를 밝은 화면에 옮긴 것입니다. */
  --bg: #ffffff;
  --surface: #f0f1f7;
  --ink: #15162e;
  --muted: #5e6079;
  --line: #e1e3ee;
  --accent: #3a3eb8;
  --accent-ink: #ffffff;
  --accent-soft: #e9eafb;
  --lamp: #f08a2c;        /* 강조 숫자·진행 막대 */
  --warn: #8a5200;
  --warn-soft: #fbf0dc;
  --danger: #b42318;
  --danger-soft: #fbe9e7;
  --page: #eef0f6;        /* 앱 화면 바탕(카드 뒤) */
  --card: #ffffff;        /* 앱 화면의 카드 */
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "AppleMyungjo", "Batang", "Noto Serif KR", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f22; --surface: #17183a; --ink: #eceaf6; --muted: #a3a4c2; --line: #2a2b52;
    --accent: #a3a6ff; --accent-ink: #0e0f22; --accent-soft: #23255c; --lamp: #ffb15e;
    --warn: #f0b860; --warn-soft: #33290f; --danger: #ff8a7d; --danger-soft: #3a1b18;
    --page: #0b0c1c; --card: #15163a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 860px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.tag { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.link { border: 0; background: transparent; color: var(--accent); padding: 4px 0; cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.wrap { margin: 0 auto; padding: 20px 16px 56px; display: flex; flex-direction: column; gap: 20px; }
.wrap.tenant { max-width: 460px; }
.wrap.admin { max-width: 860px; }
.notice { font-size: 13px; color: var(--muted); background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }

h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 600; text-wrap: balance; }
h1:focus { outline: none; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
p { margin: 0; }
.sub { color: var(--muted); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row > * { min-width: 0; }
.row > :last-child { text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 13px 16px; font-weight: 600; cursor: pointer; width: 100%; text-align: center; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.danger { color: var(--danger); }
.btn.small { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.back { border: 0; background: transparent; color: var(--muted); padding: 4px 0; cursor: pointer; align-self: flex-start; }

.panel { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.panel.soft { border-color: transparent; background: var(--surface); }
.total { border-top: 1px solid var(--line); padding-top: 12px; font-weight: 600; font-size: 17px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .legend { font-size: 14px; font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); width: 100%; }
.field textarea { min-height: 72px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); }
.err:empty { display: none; }
.okmsg { font-size: 13px; color: var(--accent); }
.choice { display: flex; gap: 8px; }
.choice label { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 4px; flex: none; }

.steps { font-size: 13px; color: var(--muted); }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface); color: var(--muted); }
.chip.pending_payment, .chip.review, .chip.payout_requested { background: var(--warn-soft); color: var(--warn); }
.chip.approved, .chip.paid_out { background: var(--accent-soft); color: var(--accent); }
.chip.rejected, .chip.canceled { background: var(--danger-soft); color: var(--danger); }

.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); text-align: left; width: 100%; cursor: pointer; }
.flag { font-size: 13px; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 6px 10px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); margin: 5px 0 0 4px; }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 21px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.done::after { background: var(--accent); }
.timeline li.now::before { border-color: var(--accent); }
.timeline li.off { color: var(--muted); }
.timeline strong { font-weight: 600; display: block; }
.timeline span { font-size: 13px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 680px) { .grid2 { grid-template-columns: 1fr; } }

/* 관리자 화면 */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 14px; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--surface); cursor: zoom-in; aspect-ratio: 3 / 4; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer { position: fixed; inset: 0; background: rgba(10, 18, 15, .9); z-index: 30; display: flex; flex-direction: column; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: #fff; }
.viewer-bar .btn { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .4); }
.viewer-body { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 0 16px 16px; }
.viewer-body img { max-width: 100%; height: auto; background: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.overlay { position: fixed; inset: 0; background: rgba(10, 18, 15, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 20; padding: 16px; }
.sheet { background: var(--bg); color: var(--ink); border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 560px) { .overlay { align-items: center; } }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: rise .18s ease-out; } }
@keyframes rise { from { transform: translateY(12px); opacity: .6; } to { transform: none; opacity: 1; } }

.files { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.files div { display: flex; justify-content: space-between; gap: 12px; }
.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.doc h2 { margin-top: 8px; }
.doc p, .doc li { font-size: 14px; }
.foot { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.foot a { color: var(--muted); }

/* ---- 임차인 앱 화면(body.app): 회색 바탕 위 흰 카드, 아래 탭. 관리자 화면에는 적용되지 않습니다 ---- */
body.app { background: var(--page); }
body.app .topbar { background: var(--page); border-bottom: 0; }
body.app .wrap.tenant { gap: 16px; }
body.app.has-tabs { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.mark { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); display: inline-grid; place-items: center; font-size: 15px; font-weight: 700; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

body.app .item, body.app .panel { background: var(--card); border: 0; border-radius: 16px; }
body.app .panel.soft { background: var(--card); }
.card { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; border: 0; width: 100%; color: inherit; }
.card.empty { color: var(--muted); font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.big { font-family: var(--serif); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

.hero { position: relative; overflow: hidden; isolation: isolate; background: #1b1c48; color: #f4efe9; border-radius: 22px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 260px; justify-content: flex-end; }
.hero-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13, 14, 34, 0.1) 0%, rgba(13, 14, 34, 0.35) 45%, rgba(13, 14, 34, 0.85) 100%); }
.hero h1 { color: inherit; font-family: var(--serif); font-weight: 800; font-size: 25px; line-height: 1.25; letter-spacing: -0.03em; }
.hero-sub { font-size: 13.5px; color: rgba(244, 239, 233, 0.85); }
.hero-tag { align-self: flex-start; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); }
.hero-btn { margin-top: 8px; background: #f4efe9; color: #0d0e22; border-color: #f4efe9; border-radius: 999px; }

.card-open { cursor: pointer; }
.card-open .ico { color: var(--muted); }
.dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dots li { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.dots li::before { content: ""; height: 5px; border-radius: 999px; background: var(--line); }
.dots li.done::before { background: var(--lamp); }
.dots li.now::before { background: linear-gradient(90deg, var(--lamp) 50%, var(--line) 50%); }
.dots li.now { color: var(--ink); font-weight: 600; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--card); border-radius: 18px; padding: 14px 6px; }
.quick button { border: 0; background: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; cursor: pointer; min-width: 0; }
.ico-wrap { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

.month { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }

.steps-list { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; }
.steps-list li::before { content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps-list strong { font-weight: 600; }
.steps-list span { font-size: 13px; color: var(--muted); }
.faq { background: var(--card); border-radius: 14px; padding: 14px 16px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin-top: 8px; font-size: 14px; color: var(--muted); }

.profile { flex-direction: row; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; font-weight: 700; flex: none; }
.profile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu { padding: 4px 16px; gap: 0; }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; color: var(--ink); font-size: 15px; text-decoration: none; cursor: pointer; text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-row .ico { color: var(--muted); width: 18px; height: 18px; }
#logout { color: var(--muted); }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px max(8px, calc((100% - 460px) / 2)) calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabbar .tab { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; padding: 6px 0; cursor: pointer; min-width: 0; }
.tabbar .tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar .tab[aria-current="page"] .ico { color: var(--accent); stroke-width: 2.1; }
body.app h1 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.03em; }
body.app .tabbar .tab[aria-current="page"] .ico { color: var(--lamp); }
.foot.biz { display: block; margin: 8px 0 0; line-height: 1.6; }
