/* 유병장수(LWI) 공통 디자인 토큰 — 기획안/랜딩페이지와 동일한 브랜드 팔레트 */
:root {
  --bg: #FDF6F2;
  --surface: #FFFFFF;
  --surface-2: #F8E1D8;
  --ink: #33211C;
  --ink-soft: #8C6D63;
  --ink-faint: #BFA398;
  --accent: #D9718A;
  --accent-deep: #9C4A5F;
  --accent-ink: #FFF6F5;
  --accent-2: #BC8642;
  --accent-2-soft: #F1E2C9;
  --line: rgba(51, 33, 28, 0.10);
  --line-strong: rgba(51, 33, 28, 0.20);
  --serif: "Iowan Old Style", "Noto Serif KR", Georgia, "Apple SD Gothic Neo", serif;
  --sans: "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --kup-banner-h: 34px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1210; --surface: #241713; --surface-2: #2E1E1A;
    --ink: #F5E7E1; --ink-soft: #C9A99D; --ink-faint: #8C6E63;
    --accent: #EFA3B1; --accent-deep: #C56E80; --accent-ink: #3A1C22;
    --accent-2: #E0B26C; --accent-2-soft: #43331F;
    --line: rgba(245, 231, 225, 0.10); --line-strong: rgba(245, 231, 225, 0.22);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, textarea, select, button { font-family: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ---------- K-Up Learning cross-promo banner ---------- */
.kup-banner {
  position: sticky;
  top: 0;
  z-index: 11;
  height: var(--kup-banner-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: linear-gradient(90deg, #EAF6FF, #D3ECFB);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .kup-banner { background: linear-gradient(90deg, #17303D, #102530); }
}
.kup-banner .kup-text {
  flex: 1;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.kup-banner .kup-arrow { flex: none; color: var(--accent-2); font-weight: 700; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: var(--kup-banner-h);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0) + 14px) 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .back { color: var(--ink-soft); display: flex; }
.topbar .back svg { width: 22px; height: 22px; }
.topbar h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  margin: 0;
  flex: 1;
}
.topbar .action { font-family: var(--mono); font-size: 12px; color: var(--accent-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 15px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  width: 100%;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-text { background: none; color: var(--accent-deep); font-weight: 600; padding: 10px; width: auto; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input, .field textarea {
  width: 100%;
  font-size: 15px;
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }
.field .error { font-size: 12.5px; color: var(--accent-deep); margin-top: 6px; display: none; }
.field.has-error input { border-color: var(--accent-deep); }
.field.has-error .error { display: block; }

/* ---------- Cards / chips shared with mockups ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 17px;
}
.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.kind {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 20px;
}
.kind.exp { background: var(--accent-ink); color: var(--accent-deep); }
.kind.evi { background: var(--accent-2-soft); color: var(--accent-2); }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-faint);
}
.empty-state p { font-size: 14px; margin: 10px 0 0; }

.config-banner {
  margin: 16px 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--accent-ink);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
  font-size: 13px;
  line-height: 1.6;
}
.config-banner code {
  font-family: var(--mono);
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 10px calc(env(safe-area-inset-bottom, 0) + 12px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-faint); }
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: 10.5px; }
.tab.on { color: var(--accent); }
.tab.on svg { fill: var(--accent); }

/* ---------- Kebab menu / bottom sheet (신고·차단) ---------- */
.kebab-btn {
  background: none; border: none; padding: 4px; color: var(--ink-faint); cursor: pointer;
  display: flex; align-items: center; margin-left: auto;
}
.kebab-btn svg { width: 18px; height: 18px; }
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(30, 18, 15, 0.4);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom, 0) + 16px);
}
.sheet h3 {
  font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase;
  letter-spacing: 0.04em; margin: 10px 4px 6px; padding-top: 6px;
}
.sheet-option {
  display: block; width: 100%; text-align: left; padding: 13px 12px; border-radius: 12px;
  border: none; background: none; font-size: 14.5px; color: var(--ink); cursor: pointer;
}
.sheet-option:hover { background: var(--surface-2); }
.sheet-option.danger { color: var(--accent-deep); }
.sheet-cancel {
  margin-top: 10px; width: 100%; text-align: center; padding: 13px; border-radius: 12px;
  background: var(--surface-2); border: none; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); font-size: 13px; padding: 10px 18px;
  border-radius: 20px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.toast.show { opacity: 0.92; }
