/* BFL SURVEY — 공용 디자인 토큰/컴포넌트 (실험실 문서 아이덴티티) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable.css');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --paper: #FAFAF8;
  --paper-raised: #FFFFFF;
  --ink: #1A2332;
  --ink-soft: #5A6472;
  --accent: #0E7C7B;
  --accent-soft: #E4F1F1;
  --amber: #E8A33D;
  --amber-soft: #FCF1DE;
  --line: #D8DCE0;
  --line-strong: #B8C0C8;
  --success: #3F8F5F;
  --success-soft: #E7F4EC;
  --danger: #C0504D;
  --danger-soft: #F9E9E8;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Pretendard Variable', 'Pretendard', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img.emoji { height: 1.1em; width: 1.1em; margin: 0 .08em; vertical-align: -0.15em; }

/* 상단 바 */
.app-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
  position: sticky; top: 0; z-index: 50;
}
.app-bar .brand { display: flex; align-items: baseline; gap: 10px; }
.app-bar .brand .mark {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  border: 1px solid var(--accent); padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.05em; white-space: nowrap;
}
.app-bar .brand .name { font-weight: 600; font-size: 15px; }
.app-bar .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 버튼 */
.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: white; color: var(--ink);
  cursor: pointer; transition: all .15s;
  text-decoration: none; display: inline-block;
}
.btn:hover { border-color: var(--ink-soft); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(0.93); border-color: var(--accent); }
.btn-ghost { border-color: transparent; color: var(--ink-soft); background: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* 폼 */
.field label, .mono-label {
  display: block; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-soft); letter-spacing: .07em; margin-bottom: 7px;
  text-transform: uppercase;
}
.field input, .field textarea, .field select, .text-input {
  width: 100%; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; font-size: 14.5px; font-family: var(--sans);
  background: white; color: var(--ink);
}
.field input:focus, .field textarea:focus, .text-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft);
}
.field { margin-bottom: 18px; }

/* 상태 칩 */
.chip {
  font-family: var(--mono); font-size: 11px; padding: 3px 9px;
  border-radius: 10px; letter-spacing: .04em; white-space: nowrap;
}
.chip.draft { background: var(--line); color: var(--ink-soft); }
.chip.open { background: var(--success-soft); color: var(--success); }
.chip.closed { background: var(--amber-soft); color: var(--amber); }

/* 모달 */
.modal-back {
  position: fixed; inset: 0; background: rgba(26,35,50,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 6vh 16px;
}
.modal-back.show { display: flex; }
.modal {
  background: var(--paper-raised); border-radius: 12px;
  width: 100%; max-width: 520px; max-height: 84vh;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(26,35,50,.25);
}
.modal .m-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal .m-head .m-title { font-weight: 700; font-size: 15px; }
.modal .m-body { padding: 18px 20px; overflow-y: auto; }
.modal .m-close {
  border: none; background: none; font-size: 18px; cursor: pointer;
  color: var(--ink-soft); padding: 4px 8px; border-radius: 6px;
}
.modal .m-close:hover { background: var(--paper); }

/* 토스트 */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: white; font-size: 13.5px;
  padding: 11px 20px; border-radius: 8px; opacity: 0;
  transition: all .25s; z-index: 300; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
