/* Project proposals (mdp-projects.php + the block on mdp.php). Builds on
   .mk from mdp-marks.css and .attl-go / .attl-ghost from
   mdp-attendance-live.css; everything here is scoped under .pj (page) or
   .pjb (course-page block). Colours live here, not in page HTML, because
   the site theme recolours hex found in pages. */

.pj-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.pj-pill.is-draft { background: #ececf2; color: #555366; }
.pj-pill.is-submitted { background: #dfe8fb; color: #234a9b; }
.pj-pill.is-revise { background: #fdedc7; color: #8a6100; }
.pj-pill.is-approved { background: #d7f2dd; color: #1a7f37; }
.pj-pill.is-rejected { background: #fbdde1; color: #9b1c2b; }

.pj-member { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; margin: 2px 4px 2px 0; border-radius: 999px; background: #f3f2f8; font-size: .82rem; }
.pj-member b { font-weight: 600; color: #241b4d; }
.pj-member i { font-style: normal; color: #77748a; font-size: .74rem; }
.pj-member.is-me { background: #eee7f6; }

.pj-meta { margin: -4px 0 10px; }
.pj-meta + .pj-decision { margin-top: 6px; }

/* the instructor's decision */
.pj-decision { border-radius: 10px; padding: 10px 14px; font-size: .86rem; line-height: 1.5; border: 1px solid #e3e5ee; background: #f7f8fb; color: #333; }
.pj-decision.is-approved { background: #e9f7ec; border-color: #b7e2c1; }
.pj-decision.is-approved b { color: #1a6b31; }
.pj-decision.is-revise { background: #fff8e8; border-color: #f0d79a; }
.pj-decision.is-revise b { color: #7a5a12; }
.pj-decision.is-rejected { background: #fdecee; border-color: #f3c2c8; }
.pj-decision.is-rejected b { color: #9b1c2b; }
.pj-feedback { margin-top: 6px; color: #2b2840; }

/* read-only proposal */
.pj-view { margin: 0; display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px 18px; font-size: .9rem; }
.pj-view dt { font-weight: 600; color: #5a5670; font-size: .8rem; padding-top: 2px; }
.pj-view dd { margin: 0; color: #1d1b2f; line-height: 1.55; overflow-wrap: anywhere; }
.pj-view dd a { color: #7a1233; text-decoration: underline; }
@media (max-width: 600px) {
	.pj-view { grid-template-columns: 1fr; gap: 2px; }
	.pj-view dd { margin-bottom: 10px; }
}

/* form */
.pj-form h3, .pj-review h3 { margin-bottom: 8px; }
.pj-form > p.mk-muted { margin: 0 0 14px; }
.pj .pj-f { margin-bottom: 14px; }
.pj .pj-f textarea, .pj .pj-f input[type=text] {
	font: inherit; font-size: .92rem; font-weight: 400; color: #1d1b2f; line-height: 1.5;
	padding: 8px 11px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; width: 100%; resize: vertical;
}
.pj .pj-f textarea:focus, .pj .pj-f input[type=text]:focus { outline: none; border-color: #241b4d; box-shadow: 0 0 0 3px rgba(36, 27, 77, .12); }
.pj .pj-f .is-bad { border-color: #d33a4a; background: #fff6f7; }
.pj-hint { font-weight: 400; color: #888; font-size: .76rem; }
.pj-count { align-self: flex-end; font-weight: 400; font-size: .7rem; color: #999; font-variant-numeric: tabular-nums; }
.pj-count.is-near { color: #b26a00; }

.pj fieldset { border: 1px solid #e6e8ef; border-radius: 10px; padding: 10px 14px 12px; margin: 0 0 14px; min-width: 0; }
.pj fieldset.is-bad { border-color: #d33a4a; background: #fffafb; }
.pj legend { width: auto; padding: 0 6px; margin: 0; font-size: .78rem; font-weight: 600; color: #555; }
.pj legend i { font-style: normal; font-weight: 400; color: #999; }
.pj-bad { color: #b21f2d; font-size: .78rem; margin: 4px 0 6px; }

.pj-team-me { margin: 2px 0 8px; font-size: .8rem; }
.pj .pj-find { width: 100%; max-width: 380px; margin-bottom: 6px; }
.pj-team-say { margin: 0 0 6px; min-height: 1em; }
.pj-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 10px; max-height: 260px; overflow-y: auto; padding: 2px; }
.pj-person { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 9px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: .84rem; }
.pj-person:hover { background: #f6f5fb; }
.pj-person.is-on { background: #eee7f6; border-color: #d6c8ea; }
.pj-person span { flex: 1; min-width: 0; }
.pj-person b { font-weight: 600; color: #241b4d; }
.pj-person i { font-style: normal; color: #888; font-size: .74rem; white-space: nowrap; }
.pj-person small { color: #999; font-size: .7rem; white-space: nowrap; }
.pj-person.is-busy, .pj-person.is-full { cursor: not-allowed; opacity: .55; }
.pj-person.is-busy:hover, .pj-person.is-full:hover { background: transparent; }
.pj-person input { margin: 0; flex: none; }

.pj-mod-list { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pj-mod { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 12px; border: 1px solid #dcdfe8; border-radius: 999px; font-size: .84rem; cursor: pointer; background: #fff; }
.pj-mod:has(input:checked) { background: #eee7f6; border-color: #b9a5d8; }
.pj-mod input { margin: 0; }
.pj .pj-mod-other { flex: 1 1 200px; max-width: 280px; font: inherit; font-size: .84rem; padding: 5px 11px; border: 1px solid #d5d9e2; border-radius: 999px; }

.pj-danger { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pj-danger form { margin: 0; }

/* decision radio cards */
.pj-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pj-choice { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 8px 14px; border: 1px solid #dcdfe8; border-radius: 10px; font-size: .86rem; font-weight: 600; cursor: pointer; color: #444; background: #fff; }
.pj-choice input { margin: 0; }
.pj-choice.is-approved:has(input:checked) { background: #e9f7ec; border-color: #7cc890; color: #1a6b31; }
.pj-choice.is-revise:has(input:checked) { background: #fff8e8; border-color: #e6c264; color: #7a5a12; }
.pj-choice.is-rejected:has(input:checked) { background: #fdecee; border-color: #e899a2; color: #9b1c2b; }
.pj-choice.is-submitted:has(input:checked) { background: #eef2fc; border-color: #9fb5e8; color: #234a9b; }

/* admin list */
.pj-tabs { margin-bottom: 12px; }
.pj-item-team { font-size: .82rem; color: #444; }
.pj-unteamed { display: flex; flex-wrap: wrap; }

/* titles list + history */
.pj-titles ul { margin: 0; padding-left: 20px; }
.pj-titles li { margin: 0 0 7px; font-size: .9rem; color: #1d1b2f; }
.pj-you { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; background: #eee7f6; color: #5a3d86; vertical-align: middle; }
.pj-history-item { margin-top: 12px; }
.pj-history-item h4 { font-size: .95rem; margin: 0 0 6px; color: #241b4d; }

/* ---- block on the course page (mdp.php) --------------------------------- */
.pjb-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid #ece3ee; background: #fbfafd; }
.pjb-mine-txt { flex: 1 1 240px; font-size: .86rem; color: #4a4560; line-height: 1.45; }
.pjb-mine-txt b { color: #241b4d; }
.pjb-titles summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: #7a1233; margin-bottom: 6px; }
.pjb-titles ul { margin: 4px 0 8px; padding-left: 20px; font-size: .86rem; }
.pjb-titles li { margin-bottom: 3px; }

/* ---- generic questions ---------------------------------------------------- */
.pj-intro { background: #f7f5fb; border-left: 3px solid #7a1233; border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 0 0 14px; font-size: .88rem; line-height: 1.55; color: #2b2840; }
.pj-intro a { color: #7a1233; text-decoration: underline; }
.pj .pj-q legend span { display: inline; }
.pj .pj-q legend .pj-hint { display: block; padding-top: 2px; }
.pj .pj-select { font: inherit; font-size: .88rem; padding: 6px 10px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; max-width: 100%; }
.pj .pj-f input[type=url] { font: inherit; font-size: .92rem; font-weight: 400; color: #1d1b2f; padding: 8px 11px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; width: 100%; }
.pj .pj-f input:disabled, .pj .pj-f textarea:disabled, .pj .pj-q input:disabled, .pj .pj-select:disabled { background: #f7f7fa; cursor: not-allowed; }
.pj-orphan { opacity: .7; }
.pj-orphan i { font-style: normal; font-weight: 400; font-size: .72rem; }
.pj-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- form editor (?form=1) ------------------------------------------------- */
.pjf-lead { font-size: .84rem; color: #4a4560; background: #f2f0fa; border: 1px solid #e3def2; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; line-height: 1.5; }
.pjf-lead a { color: #7a1233; font-weight: 600; }
.pjf .mk-f input[type=number] { font: inherit; font-size: .92rem; padding: 8px 11px; border: 1px solid #d5d9e2; border-radius: 8px; width: 100%; min-width: 80px; }
.pjf .mk-f select { font: inherit; font-size: .9rem; padding: 7px 10px; border: 1px solid #d5d9e2; border-radius: 8px; background: #fff; width: 100%; }
.pjf .mk-f textarea { font: inherit; font-size: .9rem; padding: 8px 11px; border: 1px solid #d5d9e2; border-radius: 8px; width: 100%; resize: vertical; }
.pjf-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 12px; }
.pjf-row > .mk-f { flex: 0 1 120px; margin: 0; }
.pjf-row > .pjf-grow { flex: 1 1 240px; }
.pjf-row-note { flex: 1 1 200px; padding-bottom: 9px; }

.pjf-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pjf-card { border: 1px solid #e3e5ee; border-radius: 12px; padding: 10px 14px 12px; background: #fcfcfe; }
.pjf-card.is-new { border-style: dashed; border-color: #b9a5d8; background: #fbf9fe; }
.pjf-card.is-bad { border-color: #d33a4a; background: #fffafb; }
.pjf-card.is-removed { opacity: .5; }
.pjf-card.is-removed .pjf-grid, .pjf-card.is-removed .pjf-note { display: none; }
.pjf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pjf-num { flex: none; min-width: 24px; height: 24px; border-radius: 50%; background: #241b4d; color: #fff; font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pjf-num:empty { background: #c9c7d4; }
.pjf-title { flex: 1; min-width: 0; color: #241b4d; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjf-card.is-removed .pjf-title { text-decoration: line-through; }
.pjf-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.pjf-move, .pjf-drop { border: 1px solid #dcdfe8; background: #fff; border-radius: 8px; padding: 3px 8px; font-size: .78rem; color: #555; cursor: pointer; }
.pjf-move:hover, .pjf-drop:hover { border-color: #241b4d; color: #241b4d; }
.pjf-del { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 0 6px; font-size: .78rem; color: #9b1c2b; cursor: pointer; }
.pjf-del input { margin: 0; }
.pjf-errs { margin: 0 0 8px; padding: 6px 10px 6px 26px; background: #fdecee; border-radius: 8px; color: #9b1c2b; font-size: .8rem; }
.pjf-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 8px 14px; }
.pjf-grid .mk-f { margin: 0; }
.pjf-hint, .pjf-opts { grid-column: 1 / -1; }
.pjf-check { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: .84rem; font-weight: 600; color: #444; cursor: pointer; align-self: center; }
.pjf-check input { margin: 0; }
.pjf-note { margin: 8px 0 0; font-size: .76rem; color: #6b6780; }
/* settings that only apply to some answer types */
.pjf-card:not([data-type=select]):not([data-type=checkboxes]) .pjf-opts,
.pjf-card:not([data-type=select]):not([data-type=checkboxes]) .pjf-other,
.pjf-card:not([data-type=checkboxes]) .pjf-min,
.pjf-card[data-type=select] .pjf-max,
.pjf-card[data-type=checkboxes] .pjf-max { display: none; }
.pjf-add { margin-top: 2px; }
.pjf-bar { position: sticky; bottom: 0; z-index: 5; background: rgba(255, 255, 255, .96); border: 1px solid #e6e8ef; border-radius: 12px; padding: 10px 14px; box-shadow: 0 -6px 18px rgba(36, 27, 77, .06); }
@media (max-width: 600px) {
	.pjf-grid { grid-template-columns: 1fr; }
	.pjf-title { white-space: normal; }
}
.pj .pjf-bar { margin: 0 0 14px; }
.pjf .mk-f textarea, .pjf .mk-f select, .pjf .mk-f input { font-weight: 400; color: #1d1b2f; }
