/* 포릿 화면. 서체: 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: #FF8FB8; --grounded: #FFE45C; --confirmed: #A6E36F;   /* 판정 기준 v1.4(11.09): 포스트잇 분홍·노랑·연두 */ --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: #FF8FB8; --grounded: #FFE45C; --confirmed: #A6E36F; --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; }
.msg.ai a.opt { display: block; width: fit-content; margin-top: 8px; text-decoration: none; }   /* 정해진 문장 아래의 산출물 바로가기 */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; position: relative; top: -1px;
       margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(14, 42, 51, .35); }   /* 밝은 바탕에서 노랑이 보이게 얇은 테 */
.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-resume { margin: 0 0 8px; font-size: 14px; }
.nb-resume strong { letter-spacing: .08em; }
.nb-resume .small { display: block; font-size: 12px; 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); }

/* 운영자 알림 띠(지시함 #10) */
.admin-alerts { list-style: none; margin: 0 0 18px; padding: 0; }
.admin-alerts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px;
                   padding: 10px 12px; border-left: 3px solid #c2410c; border-radius: 8px; background: var(--ai);
                   border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
                   font-size: 14px; }
.admin-alerts form { margin: 0; flex: none; }
.s1 .admin-alerts button.ack { width: auto; padding: 6px 12px; font-size: 13px; }

/* S1b 이어서 하기 */
.s1 button.linkbtn[type=submit] { width: auto; padding: 0; border: 0; background: none; color: var(--link); text-decoration: underline; font-size: 14px; }
.admin-resume { margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ai); }
.admin-resume h2 { font-size: 15px; margin: 0 0 6px; }
.admin-resume table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-resume td { padding: 4px 6px 4px 0; border-top: 1px dashed var(--line); }
.admin-resume .otp { font-size: 20px; font-weight: 800; letter-spacing: .12em; }

.segchip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--user); color: var(--ink); }

/* 운영자 반 코드 화면 */
.s1 main:has(table.codes) { max-width: 980px; }
table.codes { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 20px; }
table.codes th, table.codes td { text-align: left; vertical-align: top; padding: 8px 6px; border-top: 1px solid var(--line); }
table.codes form { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
table.codes label { display: inline-flex; gap: 4px; align-items: center; margin: 0; font-weight: 500; font-size: 13px; white-space: nowrap; }
table.codes input[type=datetime-local], table.codes select { width: auto; padding: 4px 6px; font-size: 13px; }
.s1 button.small, .s1 table.codes button { width: auto; padding: 6px 12px; font-size: 13px; }
.newcode label { margin-top: 10px; }
.newcode input[type=checkbox] { width: auto; }
code { font-size: 12px; }
.s1 main:has(.admin-resume), .s1 main:has(.admin-alerts) { max-width: 760px; }
.admin-resume td { white-space: nowrap; }
.admin-resume td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
table.codes a { color: var(--link); }
.admin-alerts .alert-acts { display: flex; gap: 6px; flex: none; }

/* 3라운드 평가(지시함 #26): 동료 평가·반응 평가 */
.rv input[type=radio], .rv input[type=checkbox] { width: auto; padding: 0; margin: 0 8px 0 0; }
.rv fieldset { border: 0; padding: 0; margin: 20px 0 0; }
.rv legend { font-size: 15px; margin-bottom: 8px; padding: 0; }
.rv-speech { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 14px 0 6px; font-size: 15px; }
.rv-speech p { margin: 6px 0; }
.rv-legend { font-size: 12px; color: var(--muted); }
.rv-legend .dot { margin: 0 3px 0 8px; }
.rv-scale { display: flex; gap: 6px; }
.rv-scale label, .rv-chips label { flex: 1; margin: 0; }
.rv-scale input, .rv-chips input { position: absolute; opacity: 0; }
.rv-scale span, .rv-chips span { display: block; text-align: center; padding: 10px 0; border: 1px solid var(--line); border-radius: 10px;
  font-weight: 600; cursor: pointer; }
.rv-chips { display: flex; gap: 8px; margin: 0; }
.rv-scale input:checked + span, .rv-chips input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rv-scale input:focus-visible + span, .rv-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rv-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.rv-weak label { display: flex; align-items: flex-start; font-weight: 400; margin: 8px 0; font-size: 15px; }
.rv-weak label .dot { margin-top: 6px; }
.rv select { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--ai); color: inherit; }
.rv-consent { display: flex; align-items: flex-start; font-weight: 400 !important; font-size: 14px !important; }
.rv-list { list-style: none; padding: 0; margin: 12px 0 0; }
.rv-list li { display: flex; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 16px; }
.rv-list a { color: var(--link); font-weight: 600; }
.rv-state { color: var(--muted); font-size: 14px; }
.rv-count { font-size: 15px; }
.nb-eval { margin-top: 14px; border-top: 1px dashed var(--note-line); padding-top: 8px; font-size: 14px; }
.nb-eval h3 { font-size: 15px; margin: 4px 0 6px; }
.nb-eval p { margin: 4px 0; }
.nb-eval .small { font-size: 13px; color: var(--muted); }
.nb-eval ul { margin: 2px 0 6px; padding-left: 18px; }
.nb-eval a { color: var(--link); }
.nb-link { width: 100%; margin-top: 4px; padding: 6px 8px; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: inherit; }
