/* 별별AI 클로드 수업 매뉴얼 공통 스타일 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --ink: #2b2820;
  --paper: #faf7f0;
  --card: #ffffff;
  --accent: #e8630a;
  --accent-soft: #fdeadd;
  --green: #2e7d4f;
  --green-soft: #e3f2e9;
  --blue: #2b5fa3;
  --blue-soft: #e6eef8;
  --line: #e5dfd2;
  --muted: #7a7466;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', -apple-system, 'Malgun Gothic', sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
  padding-bottom: 90px; /* 채팅바 공간 */
}

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }

/* 상단 내비 */
nav.top {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 20px; background: var(--card); border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
nav.top a {
  text-decoration: none; color: var(--ink); font-weight: 600;
  padding: 6px 14px; border-radius: 999px; font-size: 15px;
}
nav.top a:hover { background: var(--accent-soft); }
nav.top a.here { background: var(--accent); color: #fff; }
nav.top .brand { font-weight: 800; margin-right: auto; font-size: 17px; }

header.hero { text-align: center; padding: 40px 0 24px; }
header.hero .badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 15px; padding: 4px 16px; border-radius: 999px;
}
header.hero h1 { font-size: 34px; margin: 14px 0 8px; letter-spacing: -0.5px; }
header.hero p.sub { color: var(--muted); font-size: 19px; }

h2 {
  font-size: 24px; margin: 44px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--accent); display: inline-block;
}
h3 { font-size: 20px; margin: 26px 0 10px; }

p { margin: 10px 0; }
ul, ol { margin: 10px 0 10px 24px; }
li { margin: 6px 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px 24px; margin: 16px 0;
}

/* 오늘의 결과물 */
.goal {
  background: var(--green-soft); border: 2px solid var(--green);
  border-radius: 16px; padding: 20px 24px; margin: 20px 0;
}
.goal .title { font-weight: 800; color: var(--green); font-size: 17px; margin-bottom: 6px; }

/* 단계 스텝 */
.step { display: flex; gap: 16px; margin: 22px 0; }
.step .num {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.step .body { flex: 1; min-width: 0; }
.step .body h3 { margin-top: 4px; }

/* 복붙 프롬프트 박스 */
.prompt {
  position: relative; background: #2f2b24; color: #f5efe2;
  border-radius: 12px; padding: 18px 20px; margin: 12px 0;
  font-size: 17px; line-height: 1.65; white-space: pre-wrap; word-break: keep-all;
}
.prompt::before {
  content: "💬 클로드에게 이렇게 말하세요"; display: block;
  font-size: 13px; color: #c9b998; font-weight: 700; margin-bottom: 8px;
}
.prompt button.copy {
  position: absolute; top: 12px; right: 12px;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.prompt button.copy:hover { filter: brightness(1.1); }
.prompt button.copy.done { background: var(--green); }

/* 명령어(터미널) 박스 */
.cmd {
  position: relative; background: #10243a; color: #d7e7fb;
  border-radius: 12px; padding: 18px 20px; margin: 12px 0;
  font-family: Consolas, 'Courier New', monospace; font-size: 16.5px;
  white-space: pre-wrap; word-break: break-all;
}
.cmd::before {
  content: "⌨️ 그대로 입력 (복사해서 붙여넣기)"; display: block;
  font-family: 'Pretendard', sans-serif;
  font-size: 13px; color: #8fb4dd; font-weight: 700; margin-bottom: 8px;
}
.cmd button.copy {
  position: absolute; top: 12px; right: 12px;
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: 'Pretendard', sans-serif;
}
.cmd button.copy.done { background: var(--green); }

/* 팁/주의 */
.tip {
  background: var(--blue-soft); border-left: 5px solid var(--blue);
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 14px 0; font-size: 17px;
}
.warn {
  background: #fdeaea; border-left: 5px solid #c0392b;
  border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 14px 0; font-size: 17px;
}

/* 막혔을 때 아코디언 */
details {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin: 10px 0;
}
details summary { font-weight: 700; cursor: pointer; font-size: 17px; }
details[open] summary { margin-bottom: 8px; color: var(--accent); }

/* 진도표 */
table.timeline { width: 100%; border-collapse: collapse; margin: 14px 0; background: var(--card); border-radius: 12px; overflow: hidden; }
table.timeline th, table.timeline td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 16px; }
table.timeline th { background: var(--accent-soft); font-size: 15px; }
table.timeline td:first-child { white-space: nowrap; color: var(--muted); font-size: 15px; }

/* 코스 홈 카드 */
.sessions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 24px 0; }
a.session-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; transition: transform .12s, box-shadow .12s;
}
a.session-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
a.session-card .no { font-size: 14px; font-weight: 800; color: var(--accent); }
a.session-card h3 { margin: 6px 0 8px; font-size: 20px; }
a.session-card p { color: var(--muted); font-size: 15.5px; margin: 0; }
a.session-card .takeaway { margin-top: 12px; font-size: 15px; color: var(--green); font-weight: 700; }

.dl-btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 18px; padding: 14px 28px; border-radius: 999px; margin: 8px 0;
}
.dl-btn:hover { filter: brightness(1.08); }

footer.page-nav { display: flex; justify-content: space-between; margin-top: 50px; gap: 12px; }
footer.page-nav a {
  text-decoration: none; color: var(--ink); font-weight: 700;
  background: var(--card); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 12px;
}
footer.page-nav a:hover { background: var(--accent-soft); }

/* ===== 채팅 위젯 ===== */
#chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 14px 22px; font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(232,99,10,.35); font-family: inherit;
}
#chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 101;
  width: min(380px, calc(100vw - 40px)); height: min(520px, calc(100vh - 80px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,.18);
}
#chat-panel.open { display: flex; }
#chat-head {
  background: var(--accent); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: 16px;
}
#chat-head button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
#chat-me {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper);
  font-size: 14px; font-weight: 700; color: var(--muted);
}
#chat-name {
  flex: 1; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 15px; font-family: inherit; background: var(--card);
}
#chat-name.needed { border-color: var(--accent); background: var(--accent-soft); }
#chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 85%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 15px; }
.chat-msg .who { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.chat-msg.mine { align-self: flex-end; background: var(--accent-soft); }
#chat-image-preview { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; background: var(--card); }
#chat-image-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
#chat-image-preview button { border: none; background: var(--paper); color: var(--muted); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.chat-image-error { color: #a23a2d; font-size: 13px; padding: 4px 0; }
.chat-image { display: block; max-width: 100%; max-height: 220px; margin-top: 6px; border-radius: 8px; object-fit: contain; }
#chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
#chat-input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
#chat-attach { flex: none; width: 40px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); border-radius: 10px; font-size: 18px; cursor: pointer; }
#chat-form button { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 0 18px; font-weight: 700; cursor: pointer; font-family: inherit; }
#chat-form #chat-attach { background: var(--paper); color: var(--muted); border: 1px solid var(--line); padding: 0; }
#chat-off { padding: 20px; text-align: center; color: var(--muted); font-size: 15px; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  header.hero h1 { font-size: 27px; }
  .step { gap: 12px; }
}
