/* 포릿 화면. 서체: Pretendard(OFL, fonts/ 폴더에 둠). 색은 하나로 확정(시안 4, 10.28). 강조색은 하나만. */
@font-face {
  font-family: "Pretendard";
  src: url("/forit-assets/fonts/PretendardVariable.woff2") format("woff2-variations"),
       url("/forit-assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

/* 확정 색(10.28 대표님): 시안 4, 청록 #33DFDD가 주색.
   청록은 밝아서 단추 글씨는 짙은 남청(#0E2A33), 글자로 쓰는 곳(링크·표시)은 짙은 청록(#0B7472).
   어두운 화면은 남색 바탕(시안 3의 어두운 바탕). 상태 점 세 색은 바탕과 상관없이 같은 뜻. */
:root {
  --paper: #F2FCFC; --ink: #12303A; --muted: #4F6B72; --line: #CDEFEF; --user: #D6F7F6; --ai: #FFFFFF;
  --note: #F8FEFE; --note-line: #CDEFEF;
  --guess: #a3782a; --grounded: #3b7d57; --confirmed: #2f5fa8; --pending: #b3ada4;
  --accent: #33DFDD; --accent-ink: #0E2A33; --note-accent: #33DFDD; --link: #0B7472; --accent-text: #0B7472; --brand: #12303A;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #121B30; --ink: #EEF2FA; --muted: #AEB8CF; --line: #27355A; --user: #22335F; --ai: #1B2745;
          --note: #19243F; --note-line: #2E3E66; --guess: #e0b45b; --grounded: #7cc89a; --confirmed: #8fb3ff; --pending: #6e6a66;
          --accent: #33DFDD; --accent-ink: #0E2A33; --note-accent: #33DFDD; --link: #7EEAE8; --accent-text: #7EEAE8; --brand: #EEF2FA; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
       font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--paper); word-break: keep-all; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }

/* S1 */
.s1 main { max-width: 440px; margin: 0 auto; padding: 36px 20px 48px; }
.s1 h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 28px; }
.s1 label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 15px; }
.s1 input { width: 100%; padding: 13px 14px; font: inherit; border: 1px solid var(--line); border-radius: 10px;
            background: var(--ai); color: var(--ink); }
.s1 input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.s1 .notices { margin: 22px 0 6px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.s1 .notices li { margin-bottom: 6px; }
.s1 .more { text-align: right; font-size: 14px; margin: 0 0 18px; }
.s1 .more a { color: var(--link); }
.s1 button[type=submit] { width: 100%; padding: 15px; border: 0; border-radius: 10px; background: var(--accent);
                          color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.error { color: #b4443a; font-size: 14px; }
.notice { color: var(--muted); }

/* S2 */
.s2 header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px;
             padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper); z-index: 3; }
.s2 .brand, .s3 .brand, .s5 .brand { font-weight: 700; letter-spacing: -0.01em; color: var(--brand); }
.notebtn { border: 1px solid var(--line); background: var(--note); color: var(--ink); border-radius: 18px;
           padding: 6px 12px; font-size: 14px; }
.notebtn .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px;
                  background: var(--accent); color: var(--accent-ink); font-size: 12px; text-align: center; }
.s2 main { max-width: 640px; margin: 0 auto; padding: 16px 16px 230px; }
.msg { margin: 10px 0; padding: 11px 15px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
       max-width: 88%; font-size: 16px; }
.msg.ai { background: var(--ai); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.user { background: var(--user); margin-left: auto; border-top-right-radius: 4px; }
.msg.system { color: var(--muted); font-size: 14px; background: none; border: 0; padding: 4px 0; }
.msg.pending { color: var(--muted); font-size: 14px; padding: 8px 14px; }
.msg.pending .dots::after { content: "…"; display: inline-block; width: 1.2em; text-align: left;
                            animation: dots 1.2s steps(3, end) infinite; }
@keyframes dots { 0% { content: "·"; } 33% { content: "··"; } 66% { content: "···"; } }

/* 노트 한 줄(대화 속) */
.note { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--note-line); border-left: 3px solid var(--note-accent);
        border-radius: 10px; background: var(--note); font-size: 15px; cursor: default; }
.note.provisional { border-left-color: var(--pending); color: var(--muted); }
.note-head { display: flex; align-items: baseline; gap: 8px; }
.note .word, .nb-line .word { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.note .sentence, .nb-line .sentence { font-weight: 600; }
.note.provisional .sentence { font-weight: 500; }
.note .change { margin-top: 6px; font-size: 14px; color: var(--note-accent); }
.note .why, .nb-row .why { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.note.open { background: var(--ai); }
.note .more, .nb-row .more { margin-top: 4px; }
.note-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-acts .act { padding: 5px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--ai);
                  color: var(--ink); font-size: 13px; }
.msg.system .opt { margin-top: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; top: -1px;
       margin-right: 6px; }
.dot.guess { background: var(--guess); } .dot.grounded { background: var(--grounded); }
.dot.confirmed { background: var(--confirmed); } .dot.pending { background: var(--pending); }

/* 노트 서랍 */
.notebook { position: fixed; top: 0; right: 0; bottom: 0; width: min(92vw, 380px); background: var(--note);
            border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.08); z-index: 5; padding: 14px 16px;
            overflow-y: auto; }
.nb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nb-close { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; padding: 4px 10px; font-size: 14px; }
.nb-conf { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.nb-rows { list-style: none; margin: 0; padding: 0; }
.nb-row { padding: 10px 0; border-bottom: 1px dashed var(--note-line); font-size: 15px; }
.nb-row.homework .sentence { color: var(--muted); font-weight: 500; }
.nb-line { display: flex; align-items: baseline; gap: 8px; }
.nb-empty { color: var(--muted); font-size: 14px; }
.nb-sub { margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nb-strength { padding: 6px 0; border-bottom: 1px dashed var(--note-line); font-size: 15px; }
.nb-loop { padding: 8px 0; border-bottom: 1px dashed var(--note-line); font-size: 14px; }
.nb-loop-t { font-weight: 600; margin-bottom: 4px; }
.nb-loop-l { color: var(--muted); margin-top: 2px; }
.dot.memo { background: transparent; border: 1.5px solid var(--pending); }
.nb-areas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-size: 12px; }
.nb-area { padding: 2px 8px; border: 1px solid var(--note-line); border-radius: 10px; color: var(--muted); }
.nb-area.part { color: var(--ink); }
.nb-area.done { color: var(--accent-text); border-color: var(--accent); }
.nb-legend { margin-top: 16px; font-size: 12px; color: var(--muted); }
.nb-legend .dot { margin: 0 4px 0 8px; }
.nb-legend .dot:first-child { margin-left: 0; }

.s2 footer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--paper); border-top: 1px solid var(--line);
             padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 2; }
.s2 footer > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.opt { padding: 8px 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--ai); color: var(--ink); font-size: 15px; }
.opt.cal { min-width: 48px; }
#form { display: flex; gap: 8px; }
#input { flex: 1; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; resize: none;
         background: var(--ai); color: var(--ink); }
#input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
#send { padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.listbox { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.list-row input { min-width: 0; padding: 9px 10px; font: inherit; font-size: 14px; border: 1px solid var(--line);
                  border-radius: 8px; background: var(--ai); color: var(--ink); }
.list-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.list-acts { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-acts .send { padding: 9px 18px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.helpers { display: flex; gap: 8px; margin-top: 8px; }
.helpers button { flex: 1; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--ai);
                  color: var(--ink); font-size: 14px; }

.navlink { margin-left: auto; font-size: 14px; color: var(--link); text-decoration: none; }
.nb-links { margin-top: 14px; font-size: 13px; color: var(--muted); }
.nb-links a { color: var(--link); text-decoration: none; }

/* S3 진행 현황, S5 산출물 미리보기: 점수·막대·배지 없음 */
.s3 main, .s5 main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }
.s3 header, .s5 header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px;
                         border-bottom: 1px solid var(--line); }
.s3 header a, .s5 header a { color: var(--link); text-decoration: none; font-size: 14px; }
.s3 h1, .s5 h1 { font-size: 20px; margin: 8px 0 14px; }
.s3 h2, .s5 h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; letter-spacing: .02em; }
.row { display: flex; gap: 8px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--note-line); font-size: 15px; }
.row .area { flex: none; width: 84px; font-weight: 600; }
.row .word { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.row .arrow { flex: none; color: var(--accent-text); font-weight: 700; }
.row .muted { color: var(--muted); }
.cond { display: flex; gap: 10px; padding: 7px 0; font-size: 15px; }
.cond .mark { flex: none; width: 20px; color: var(--accent-text); }
.cond.todo .mark { color: var(--pending); }
.cell { padding: 10px 0; border-bottom: 1px solid var(--note-line); }
.cell .name { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.cell .item { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 15px; }
.cell .sub { flex: none; width: 112px; font-size: 13px; color: var(--muted); }
.cell .small { font-size: 12.5px; color: var(--muted); }
.cell .empty { color: var(--muted); }
.cell .blank { display: block; min-height: 22px; border-bottom: 1px dotted var(--line); }
.cell .pres { padding: 4px 0; font-size: 15px; }
.cell .pres div { font-size: 14px; color: var(--muted); }
.risk { display: inline-block; margin-right: 10px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.s5 .qs input { width: 100%; margin: 4px 0; padding: 9px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px;
                background: var(--ai); color: var(--ink); }
.s5 .actions { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.s5 .actions button { padding: 11px 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.s5 .actions .ghost { background: var(--ai); color: var(--ink); border: 1px solid var(--line); }
.s5 .saved { margin-top: 10px; font-size: 14px; color: var(--muted); }

.s3 main a, .s5 main a { color: var(--link); }
