/* Studio — 사장님 대면 웹 앱. 테마(fnb-photo)와 같은 크림/테라코타 계열, 모바일 퍼스트. */
:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --text: #2a2018;
  --muted: #85786a;
  --line: #ece4d8;
  --accent: #c2551f;
  --accent-contrast: #fff8f2;
  --danger: #b3261e;
  --ok: #2e7d32;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Kantumruy Pro", "Noto Sans Khmer", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.view { max-width: 44rem; margin: 0 auto; padding: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0.8rem 0; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }

/* 로그인 */
.login-card { max-width: 22rem; margin: 14vh auto 0; text-align: center; }
.login-card h1 { margin: 0 0 0.4rem; }

/* 버튼 */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); padding: 0.6rem 1.2rem; border-radius: 999px; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; text-decoration: none; margin: 0.25rem 0.2rem;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small-btn { font-size: 0.8rem; padding: 0.35rem 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: wait; }

/* 상단바 + 탭 */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0 0.6rem; gap: 0.5rem; flex-wrap: wrap; }
.topbar-right { display: inline-flex; align-items: center; gap: 0.4rem; }
.brand { font-weight: 700; }

/* 언어 스위처 */
.lang-row { display: flex; justify-content: flex-end; padding: 0.3rem 0; }
.langs { display: inline-flex; gap: 0.15rem; padding: 0.2rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.langs button { border: none; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 600; padding: 0.25rem 0.65rem; border-radius: 999px; cursor: pointer; font-family: inherit; }
.langs button.active { background: var(--accent); color: var(--accent-contrast); }
.tabs { display: flex; gap: 0.4rem; border-bottom: 2px solid var(--line); margin-bottom: 0.6rem; }
.tab { border: none; background: transparent; padding: 0.5rem 0.9rem; font-size: 0.9rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* 작성 */
textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem; font: inherit; resize: vertical; background: #fffdfa; }
.file-label { display: inline-block; margin: 0.5rem 0; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.thumbs img { width: 4.2rem; height: 4.2rem; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* 미리보기(3개 언어) */
.preview-card h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.locale-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.05rem 0.45rem; margin-bottom: 0.3rem; color: var(--muted); }
.preview-card p { margin: 0; font-size: 0.92rem; white-space: pre-wrap; }
.kind-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; background: var(--accent); color: var(--accent-contrast); border-radius: 999px; padding: 0.1rem 0.6rem; margin-right: 0.4rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.6rem; }

/* 목록 */
.list-item { display: flex; align-items: center; gap: 0.7rem; width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0.5rem 0; cursor: pointer; font: inherit; }
.list-item .title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* 배너/로딩 */
.banner { position: sticky; top: 0; z-index: 30; background: var(--danger); color: #fff; padding: 0.6rem 1rem; font-size: 0.9rem; text-align: center; }
.banner.ok { background: var(--ok); }
.loading { position: fixed; inset: 0; background: rgb(255 253 250 / 0.6); display: grid; place-items: center; z-index: 50; }
.spinner { width: 2.2rem; height: 2.2rem; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
