/* 아침 경영 브리핑 데모 (우정소프트웨어) — box-mes와 같은 카톡 스타일 계열 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e3e7ec;
  --text: #1f2933;
  --muted: #6b7684;
  --primary: #d97706;
  --primary-soft: #fef3e2;
  --danger: #d94f3d;
  --kakao-bg: #b2c7d9;
  --kakao-yellow: #fee500;
  --radius: 12px;
}

html, body { height: 100%; }
body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; }
.topbar .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.layout {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  min-height: 0;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
.settings {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}
.chat {
  width: 380px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--kakao-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.hint {
  position: relative;
  background: var(--primary-soft);
  border: 1px solid #f5d9ab;
  color: #92500a;
  padding: 10px 36px 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 12px;
}
.hint button {
  position: absolute; right: 0; top: 0;
  border: 0; background: none;
  font-size: 18px; color: #92500a; cursor: pointer;
  padding: 10px 14px; /* 터치 영역 확보 */
}

.set-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.set-card h2 { font-size: 15px; margin-bottom: 10px; }

.time-row { display: flex; gap: 8px; }
.time-row button {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.time-row button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.set-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.set-item:last-child { border-bottom: 0; }
.set-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.set-item span { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; padding: 12px 0; font-size: 15px; }
.btn:hover { filter: brightness(0.97); }

.build-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.6;
}

/* 카톡 미리보기 */
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: #a6bdd0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 14px;
  background: var(--kakao-yellow);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-name { font-weight: 700; font-size: 15px; }
.chat-status { font-size: 12px; color: #3d4c5c; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.day-divider {
  align-self: center;
  font-size: 12px;
  color: #3d4c5c;
  background: rgba(255,255,255,0.5);
  border-radius: 999px;
  padding: 3px 12px;
}
.msg { display: flex; flex-direction: column; max-width: 88%; align-self: flex-start; }
.bubble {
  background: #fff;
  padding: 10px 12px;
  border-radius: 14px; border-top-left-radius: 4px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  animation: pop 0.25s ease-out;
}
.bubble b { font-weight: 700; }
.bubble .warn { color: var(--danger); font-weight: 700; }
.msg-time { font-size: 11px; color: #3d4c5c; margin-top: 3px; margin-left: 4px; }
@keyframes pop { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }

.honest {
  font-size: 12px; color: #3d4c5c;
  background: #a6bdd0;
  padding: 8px 12px 10px;
  text-align: center;
}

/* 모바일: 위 설정 + 아래 미리보기 분할 */
@media (max-width: 900px) {
  .layout { flex-direction: column; padding: 10px; gap: 10px; }
  .settings { flex: 1; min-height: 0; overflow-y: auto; }
  .chat { width: 100%; height: 44vh; height: 44dvh; min-height: 240px; flex-shrink: 0; }
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .set-item, .time-row button { font-size: 16px; }
  .set-item { flex-wrap: wrap; padding: 12px 4px; }
  .set-item span { flex-basis: 100%; margin-left: 28px; text-align: left; }
  #btn-replay { position: sticky; bottom: 0; box-shadow: 0 -6px 12px rgba(244,246,248,0.9); }
}
