/* 무원 오퍼 — 시안(https://claude.ai/artifact/4R7CQqnMZeZvzbKwMeX2Gf) 과 같은 색·구성. 390px 폰 ~ 폴더블/태블릿(최대 폭 560px 컨테이너) */
:root {
  --blue: #1d4ed8; --blue-dark: #1e40af; --bg: #f3f4f6; --card: #ffffff; --ink: #111827; --ink-2: #374151; --muted: #6b7280;
  --line: #e5e7eb; --line-2: #d1d5db; --amber-bg: #fef3c7; --amber: #b45309; --amber-ink: #78350f; --amber-dark: #92400e;
  --red: #b91c1c; --green: #047857; --kakao: #fee500; --kakao-ink: #3c1e1e;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --maxw: 560px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body { min-height: 100dvh; }
button, input { font-family: inherit; font-size: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.splash { padding: 40vh 16px 0; text-align: center; color: var(--muted); }

/* 머리 */
.hdr { background: var(--blue); color: #fff; padding: calc(var(--safe-top) + 14px) 0 14px; }
.hdr-in { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 4px; }
.hdr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.hdr-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hdr-title .id { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-sub { font-size: 13px; opacity: 0.85; }
.pill { font-size: 12px; background: rgba(255,255,255,0.18); padding: 4px 10px; border-radius: 12px; white-space: nowrap; color: #fff; border: 0; }
.back { color: #fff; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -10px; border-radius: 20px; background: transparent; border: 0; }
.back:active { background: rgba(255,255,255,0.15); }

/* 본문 */
.main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 10px 16px calc(var(--safe-bottom) + 96px); }
.tabs { display: flex; gap: 8px; padding: 2px 0 10px; overflow-x: auto; }
.tab { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 16px; background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 700; }
.list { display: flex; flex-direction: column; gap: 12px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); color: inherit; }
.card.sent { opacity: 0.72; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.band { font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-bg); padding: 3px 8px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.card-title { font-size: 17px; font-weight: 800; word-break: break-word; }
.card-sub { font-size: 14px; color: var(--ink-2); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.st-unsent { font-size: 12px; font-weight: 700; color: var(--red); }
.st-sent { font-size: 12px; font-weight: 700; color: var(--green); }
.st-warn { font-size: 12px; font-weight: 700; color: var(--amber-dark); }
.open { font-size: 13px; font-weight: 700; color: var(--blue); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }

/* 알림 켜기 안내 띠 */
.notice { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.notice b { color: var(--ink); }
.notice .grow { flex: 1; }
.btn-sm { font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; white-space: nowrap; }
.btn-sm.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); }

/* 카드(상세) */
.internal { background: var(--amber-bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.internal .h { font-size: 11px; font-weight: 800; color: var(--amber-dark); }
.internal .l { font-size: 14px; color: var(--amber-ink); word-break: break-word; }
.internal .raw { font-size: 12px; color: var(--amber-dark); word-break: break-word; }
.box { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.box .h { font-size: 12px; font-weight: 700; color: var(--muted); }
.text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; background: #f9fafb; border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); -webkit-user-select: text; user-select: text; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photos a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e5e7eb; position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .n { position: absolute; left: 6px; bottom: 6px; color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.meta { font-size: 12px; color: var(--muted); padding: 10px 4px 0; line-height: 1.6; }
.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }

/* 아래 고정 바 */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px calc(var(--safe-bottom) + 12px); z-index: 5; }
.bar-in { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.btn-share { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 14px; background: var(--kakao); color: var(--kakao-ink); font-size: 16px; font-weight: 800; border: 0; width: 100%; }
.btn-share:disabled { opacity: 0.6; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn { height: 46px; border-radius: 12px; font-size: 15px; font-weight: 700; border: 1px solid var(--line-2); background: #fff; color: var(--ink); }
.btn.green { border: 0; background: var(--green); color: #fff; }
.btn.gray { border: 0; background: var(--line); color: var(--ink-2); }
.btn:disabled { opacity: 0.55; }
.link-row { display: flex; justify-content: center; gap: 18px; font-size: 13px; }
.link-row button { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 2px 4px; }

/* 아래 탭 */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 8px 0 calc(var(--safe-bottom) + 8px); z-index: 5; }
.nav-in { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-around; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); background: none; border: 0; padding: 4px 16px; min-width: 72px; }
.nav button.on { color: var(--blue); font-weight: 700; }
.nav svg { width: 22px; height: 22px; }

/* 로그인 */
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 420px; width: 100%; margin: 0 auto; padding: 24px 20px calc(var(--safe-bottom) + 24px); gap: 14px; }
.logo { width: 64px; height: 64px; border-radius: 16px; background: var(--blue); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; align-self: center; }
.login h1 { font-size: 22px; text-align: center; margin: 0; }
.login p { color: var(--muted); font-size: 14px; text-align: center; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input { height: 48px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 14px; font-size: 16px; background: #fff; }
.field input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.btn-primary { height: 50px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; font-size: 16px; font-weight: 800; }
.err { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; }

/* 설정 */
.sec { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.sec h2 { font-size: 15px; margin: 0; }
.sec p { margin: 0; font-size: 14px; color: var(--ink-2); }
.sec ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ok { color: var(--green); font-weight: 700; }
.bad { color: var(--red); font-weight: 700; }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 14px; font-size: 16px; background: #fff; }

/* 토스트·시트 */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 110px); transform: translateX(-50%); background: rgba(17,24,39,0.92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; z-index: 20; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 15; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--maxw); background: #fff; border-radius: 24px 24px 0 0; padding: 14px 16px calc(var(--safe-bottom) + 20px); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -8px 30px rgba(0,0,0,0.25); }
.sheet .grip { height: 5px; width: 40px; border-radius: 3px; background: var(--line-2); align-self: center; }
.sheet h3 { margin: 0; font-size: 16px; }
.sheet p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.sheet .btn-share { height: 50px; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; } }
