/* 지원메이트 테스터 접속
   PC(발표 화면): 스크롤 없이 한 화면 — 왼쪽 개요 · 가운데 접속/대화 · 오른쪽 QR. 주의사항은 버튼 → 대화상자.
   휴대폰: 세로로 이어지는 화면(스크롤 허용), 접속을 먼저 보여 준다.
   글자 크기는 키우지 않고 명시도(굵기·대비·색 구분)와 디자인 요소(아이콘·색·체크 표시)를 강화한다. */
:root {
  --bg: #f4f7fc;
  --card: #ffffff;
  --text: #0a1324;          /* 흰 바탕 대비 약 18:1 */
  --muted: #2a3a55;         /* 보조 글자 9:1 이상 */
  --blue: #003e8b;          /* 서울시립대 로고 색 */
  --blue-dark: #002456;
  --blue-soft: #e6eefb;
  --line: #c3cfe2;
  --ok: #046c3e;   --ok-bg: #e3f6ec;
  --warn: #8a3b00; --warn-bg: #fff1e0;
  --err: #a8180e;  --err-bg: #fdecea;
  --c1: #c2410c; --c1-bg: #fff0e6;    /* 창업 */
  --c2: #0b5cad; --c2-bg: #e5f0fc;    /* 중소기업 */
  --c3: #0f7a55; --c3-bg: #e2f5ec;    /* 소상공인 */
  --c4: #6d28d9; --c4-bg: #f0e9fd;    /* 기술·혁신 */
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 19, 36, 0.06), 0 6px 20px rgba(10, 19, 36, 0.07);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: clamp(14px, min(0.95vw, 1.75vh), 21px); }   /* 1920×1080 ≈ 18px, 1366×768 ≈ 14px */
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere;
  font-weight: 500; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* ---------- 상단 ---------- */
.top {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.6rem clamp(16px, 2.4vw, 48px);
  background: var(--card); border-bottom: 4px solid var(--blue); box-shadow: var(--shadow);
}
.logo { height: clamp(30px, 2.8vw, 52px); width: auto; display: block; }
.top-sep { width: 2px; height: 1.6em; background: var(--line); }
.top-course { font-weight: 800; color: var(--muted); }
.notes-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.4em;
  font: inherit; font-weight: 800; cursor: pointer;
  color: var(--warn); background: var(--warn-bg); border: 2px solid currentColor; border-radius: 999px; padding: 0.3em 0.95em;
}
.notes-btn:hover { background: #ffe3c2; }
.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  background: var(--blue); color: #fff; font-weight: 800; padding: 0.35em 0.95em; border-radius: 999px;
}

/* ---------- 본문 배치 (PC: 3단, 한 화면) ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr) minmax(0, 0.78fr);
  grid-template-areas: "intro main qr";
  gap: clamp(14px, 1.5vw, 32px);
  padding: clamp(14px, 1.6vw, 30px) clamp(16px, 2.4vw, 48px);
  max-width: 2100px; width: 100%; margin: 0 auto;
}
.intro { grid-area: intro; }
.login, .chat { grid-area: main; }
.qr { grid-area: qr; }

@media (min-width: 901px) {
  body { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
  .layout { min-height: 0; }
  .intro, .login, .chat, .qr { min-height: 0; }
  .chat { display: flex; flex-direction: column; }
  .login { overflow: auto; align-self: start; max-height: 100%; }   /* 접속 카드는 내용 높이, 대화 카드는 화면 높이 */
}

/* ---------- 왼쪽: 개요 ---------- */
.intro { display: flex; flex-direction: column; gap: 0.85rem; }
.kicker {
  margin: 0; align-self: flex-start; font-weight: 900; color: var(--blue);
  background: var(--blue-soft); border-radius: 999px; padding: 0.25em 0.85em; letter-spacing: 0.02em;
}
h1 { font-size: clamp(2.4rem, 4.2vw, 4.1rem); font-weight: 900; color: var(--blue-dark); letter-spacing: -0.02em; }
.lead { margin: 0; font-size: 1.15rem; font-weight: 600; }
.lead strong { color: var(--blue); font-weight: 900; box-shadow: inset 0 -0.45em 0 #fde68a; }

.scope { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.scope li {
  display: flex; align-items: center; gap: 0.5em; font-weight: 900; font-size: 1.05rem;
  padding: 0.55em 0.8em; border-radius: 12px; border: 2px solid;
}
.scope .ic { width: 1.4em; height: 1.4em; }
.scope .c1 { color: var(--c1); background: var(--c1-bg); }
.scope .c2 { color: var(--c2); background: var(--c2-bg); }
.scope .c3 { color: var(--c3); background: var(--c3-bg); }
.scope .c4 { color: var(--c4); background: var(--c4-bg); }

.stats { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.stats li {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--blue);
  border-radius: 12px; padding: 0.5rem 0.85rem; box-shadow: var(--shadow);
}
.stats .ic { color: var(--blue); width: 1.5em; height: 1.5em; }
.stats b { font-size: 1.35rem; color: var(--blue-dark); font-weight: 900; white-space: nowrap; }
.stats span { font-weight: 700; color: var(--muted); }

.flow { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.flow span {
  font-weight: 800; font-size: 0.9rem; color: var(--blue-dark); background: var(--card);
  border: 2px solid var(--blue); border-radius: 999px; padding: 0.12em 0.7em;
}
.flow .ic { color: var(--blue); }
.out-scope {
  margin: 0; display: flex; gap: 0.45em; align-items: flex-start; font-weight: 700; font-size: 0.92rem;
  color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 0.5em 0.75em;
}
.out-scope .ic { color: var(--blue); margin-top: 0.1em; }

/* ---------- 가운데: 카드 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--blue);
  border-radius: 20px; padding: clamp(16px, 1.6vw, 30px); box-shadow: var(--shadow);
}
.card h2 { display: flex; align-items: center; gap: 0.45em; font-size: 1.45rem; font-weight: 900; color: var(--blue-dark); }
.card h2 .ic { color: var(--blue); }
.step { display: flex; align-items: center; gap: 0.55rem; font-size: 1.08rem; font-weight: 900; margin: 1rem 0 0.55rem; }
.step span {
  display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 900; flex: none;
}

/* 대화 화면: 고정 모델 표시(선택 기능 없음) */
.model-fixed { color: var(--blue-dark); font-weight: 900; }

/* 접속 방법 탭 */
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.tabs button {
  display: inline-flex; justify-content: center; align-items: center; gap: 0.4em;
  font: inherit; font-weight: 800; cursor: pointer;
  padding: 0.6rem 0.4rem; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--text);
}
.tabs button:hover { border-color: var(--blue); }
.tabs button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.panel { display: grid; gap: 0.45rem; margin-top: 0.9rem; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.row2 > div { display: grid; gap: 0.3rem; }
.panel label { font-weight: 900; }
input, select, textarea {
  font: inherit; font-weight: 600; color: var(--text); background: #fff;
  border: 2px solid var(--line); border-radius: 10px; padding: 0.55rem 0.75rem; width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: #8fa4c4; }
input:focus, select:focus, textarea:focus, button:focus-visible, .model:focus-visible {
  outline: 4px solid #f2b705; outline-offset: 2px;
}
.help { margin: 0; display: flex; gap: 0.4em; align-items: center; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.help .ic { color: var(--ok); }
button.primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 0.45em;
  font: inherit; font-weight: 900; font-size: 1.08rem; cursor: pointer; margin-top: 0.35rem;
  background: var(--blue); color: #fff; border: 0; border-radius: 12px; padding: 0.7rem 1.3rem;
  box-shadow: 0 3px 0 var(--blue-dark);
}
button.primary:hover { background: var(--blue-dark); }
button.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-dark); }
button[disabled] { opacity: 0.55; cursor: not-allowed; }
button.ghost {
  font: inherit; font-weight: 800; cursor: pointer; background: #fff; color: var(--blue-dark);
  border: 2px solid var(--blue); border-radius: 10px; padding: 0.3rem 0.85rem;
}

.notice { display: flex; gap: 0.5em; align-items: center; margin: 0.6rem 0 0; padding: 0.6rem 0.9rem; border-radius: 10px; font-weight: 800; border-left: 6px solid; }
.notice.ok { color: var(--ok); background: var(--ok-bg); }
.notice.err { color: var(--err); background: var(--err-bg); }
.notice.info { color: var(--blue-dark); background: var(--blue-soft); }

/* 대화 */
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 800; margin-top: 0.6rem; }
.chat-meta select { width: auto; padding: 0.3rem 0.6rem; }
.who { color: var(--muted); font-weight: 700; }
.msgs {
  display: flex; flex-direction: column; gap: 0.55rem; margin: 0.8rem 0; overflow-y: auto;
  background: var(--bg); border-radius: 14px; padding: 0.8rem; min-height: 8rem; flex: 1 1 auto;
}
.msg { margin: 0; padding: 0.6rem 0.9rem; border-radius: 14px; white-space: pre-wrap; max-width: 92%; font-weight: 600; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.err { align-self: flex-start; background: var(--err-bg); color: var(--err); border-left: 5px solid currentColor; font-weight: 800; }
/* 검색된 공고 카드 */
.cards { display: grid; gap: 0.45rem; align-self: flex-start; width: 92%; }
.pcard { display: grid; gap: 0.2rem; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
a.pcard:hover { border-color: var(--blue); }
.pcard b { color: var(--blue-dark); font-size: 0.95rem; }
.pmeta { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.ptags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.ptag { font-size: 0.75rem; font-weight: 900; padding: 0.05em 0.55em; border-radius: 999px; background: #eef1f6; color: var(--muted); }
.ptag.dday { background: var(--blue-soft); color: var(--blue-dark); }
.msg small { display: block; color: var(--muted); margin-top: 0.3rem; font-size: 0.8rem; font-weight: 700; }
.ask { display: grid; grid-template-columns: 1fr auto; gap: 0.6rem; align-items: end; }
.ask textarea { resize: none; min-height: 3em; }
.ask button.primary { margin-top: 0; }

/* ---------- 오른쪽: QR ---------- */
.qr {
  align-self: start; text-align: center; background: var(--card);
  border: 4px solid var(--blue); border-radius: 24px; padding: clamp(14px, 1.4vw, 28px); box-shadow: var(--shadow);
}
.qr h2 { display: inline-flex; align-items: center; gap: 0.4em; font-size: 1.3rem; font-weight: 900; color: var(--blue-dark); margin-bottom: 0.5rem; }
.qr h2 .ic { color: var(--blue); }
.qr-img { display: block; width: min(100%, 44vh); height: auto; margin: 0 auto; image-rendering: pixelated; }
.qr-url { margin: 0.5rem 0 0; font-size: clamp(1.25rem, 1.9vw, 2.2rem); font-weight: 900; color: var(--text); }
.qr-hint { margin: 0.15rem 0 0; font-weight: 700; color: var(--muted); }

.foot { padding: 0.5rem clamp(16px, 2.4vw, 48px); color: var(--muted); font-size: 0.82rem; font-weight: 600; border-top: 1px solid var(--line); background: var(--card); }

/* ---------- 주의사항 대화상자 ---------- */
dialog.notes {
  width: min(92vw, 760px); max-height: 90vh; padding: clamp(18px, 2vw, 32px);
  border: 0; border-top: 8px solid var(--warn); border-radius: 20px; color: var(--text);
  box-shadow: 0 20px 60px rgba(10, 19, 36, 0.35);
}
dialog.notes::backdrop { background: rgba(10, 19, 36, 0.55); }
.notes-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.notes-head h2 { display: flex; align-items: center; gap: 0.45em; font-size: 1.5rem; font-weight: 900; color: var(--warn); }
.icon-btn { font: inherit; cursor: pointer; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 0.3rem; color: var(--text); display: grid; place-items: center; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.note-list li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--bg); }
.note-list .ic { width: 1.6em; height: 1.6em; margin-top: 0.05em; }
.note-list .n1 { color: var(--err); } .note-list .n2 { color: var(--c2); } .note-list .n3 { color: var(--c4); }
.note-list .n4 { color: var(--c1); } .note-list .n5 { color: var(--warn); } .note-list .n6 { color: var(--c3); }
.note-list b { display: block; font-weight: 900; }
.note-list span { color: var(--muted); font-weight: 600; }
.source { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
dialog.notes button.primary { margin-top: 1rem; width: 100%; }

/* ---------- 휴대폰: 세로 화면, 스크롤 허용, 접속 먼저 ---------- */
@media (max-width: 900px) {
  html { font-size: 16px; }
  body { background: #fff; }
  .top { gap: 0.5rem; padding: 0.55rem 14px; border-bottom-width: 3px; }
  .top-sep, .top-course { display: none; }
  .logo { height: 28px; }
  .badge { display: none; }
  .notes-btn { padding: 0.3em 0.75em; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "main" "qr"; padding: 14px; gap: 14px; }
  .intro {
    gap: 0.6rem; color: #fff; padding: 18px 16px; border-radius: 18px;
    background: linear-gradient(135deg, var(--blue) 0%, #0b5cad 60%, #1d7fd1 100%);
  }
  .kicker { background: rgba(255, 255, 255, 0.18); color: #fff; }
  h1 { color: #fff; font-size: 2.3rem; }
  .lead strong { color: #fff; box-shadow: inset 0 -0.4em 0 rgba(253, 230, 138, 0.55); }
  .scope { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
  .scope li { flex-direction: column; gap: 0.2em; font-size: 0.82rem; padding: 0.5em 0.2em; text-align: center; border-width: 0; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .stats li { flex-direction: column; align-items: flex-start; gap: 0.1rem; padding: 0.5rem 0.6rem; border-left-width: 4px; box-shadow: none; }
  .stats .ic { display: none; }
  .stats b { font-size: 1.05rem; }
  .stats span { font-size: 0.75rem; }
  .flow, .out-scope { display: none; }
  .card { border-radius: 18px; }
  .tabs, .row2 { grid-template-columns: minmax(0, 1fr); }
  .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs button { flex-direction: column; gap: 0.15em; font-size: 0.85rem; }
  .msgs { max-height: 60vh; }
  .ask { grid-template-columns: 1fr; }
  .qr-img { width: min(70%, 260px); }
  .qr-url { font-size: 1.3rem; }
}
