/* Worksheet missions extend the existing pixel-style field guide. */
.mission-goal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 24px;
  margin: 0 0 27px;
  padding: 22px 25px;
  border: 1px solid #554465;
  background: #251e30;
  box-shadow: 4px 4px 0 #100c17;
}
.mission-goal > svg { color: var(--purple); width: 30px; height: 30px; }
.mission-goal > div:not(.goal-meter) { flex: 1; min-width: 0; }
.mission-goal h2, .mission-goal h3 { font: 18px/1.6 var(--pixel); margin: 0 0 8px; }
.mission-goal p { margin: 0; color: #bcaccb; font-size: 12px; line-height: 1.8; }
.goal-numbers { display: flex; align-items: baseline; gap: 8px; color: var(--mint); font: 27px/1.4 var(--pixel); white-space: nowrap; }
.goal-numbers small, .goal-numbers span { font: 11px/1.7 var(--sans); color: #b4a2c1; }
.goal-numbers b { font: inherit; }
.goal-meter { height: 8px; background: #44364f; border: 1px solid #574361; overflow: hidden; flex-basis: 100%; }
.goal-meter > span { display: block; height: 100%; background: var(--mint); transition: width .2s; }
.goal-message { color: #c9b9d8; font-size: 12px; line-height: 1.8; }
.goal-achieved { border-color: #728660; background: #263022; }
.goal-achieved > svg { color: var(--mint); }
.goal-achieved .goal-message, .goal-achieved p { color: #c7d9ba; }
.mission-row { align-items: flex-start; }
.mission-row > div { min-width: 0; }
.mission-row .button { flex-shrink: 0; min-height: 45px; align-self: center; }
.mission-row h2 { line-height: 1.8; }
.mission-row .mission-kind, .mission-row .mission-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 2px 7px; margin: 0 7px 8px 0; background: #382a44; border: 1px solid #51405e; color: #d0b8e8; }
.mission-row .mission-status { color: var(--yellow); background: #363023; border-color: #554a31; }
.mission-row .mission-status.complete, .mission-row .mission-status.done { color: var(--mint); background: #293524; border-color: #536947; }
.mission-mini-fields { margin-top: 10px; font-size: 10px; color: #a391b3; }
.mission-type-badge { display: inline-block; color: #dfc5f4; background: #3a2b49; border: 1px solid #685079; padding: 3px 9px; margin-bottom: 11px; font-size: 11px; }
.mission-form { border-top: 1px solid #4b3759; padding-top: 25px; margin-top: 25px; }
.mission-form h3 { font: 19px/1.7 var(--pixel); margin: 4px 0 13px; }
.mission-form > p { font-size: 13px; line-height: 1.9; color: #c0aecb; }
.mission-field { margin: 22px 0; min-width: 0; }
.mission-field > label, .mission-field > legend, .reflection-fields label { display: block; margin: 0 0 10px; font-size: 13px; color: #e2d3ec; line-height: 1.8; }
.mission-field input:not([type="checkbox"]), .mission-field textarea { display: block; width: 100%; min-width: 0; border: 1px solid #655071; border-radius: 2px; background: #15111c; color: var(--text); padding: 12px 14px; font-size: 15px; line-height: 1.8; }
.mission-field input:not([type="checkbox"]) { min-height: 48px; }
.mission-field textarea { min-height: 116px; }
.mission-field input::placeholder, .mission-field textarea::placeholder { color: #94809f; }
.mission-field input[aria-invalid="true"], .mission-field textarea[aria-invalid="true"] { border-color: #eda0b1; box-shadow: inset 3px 0 0 #eda0b1; }
.mission-field input[readonly], .mission-field textarea[readonly] { border-color: #526547; background: #1b2319; color: #d5e8c8; }
.field-hint { margin: 8px 0 0; color: #aa95b8; font-size: 11px; line-height: 1.8; }
.field-feedback { margin: 7px 0 0; font-size: 12px; line-height: 1.8; color: #f1acbd; }
.field-feedback:empty { display: none; }
.field-feedback.correct, .field-feedback.success { color: var(--mint); }
.mission-feedback, #mission-form-feedback { margin: 16px 0; padding: 12px 15px; background: #302337; border-left: 3px solid var(--purple); color: #d8c4e9; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.mission-feedback:empty, #mission-form-feedback:empty { display: none; }
.mission-feedback.error, #mission-form-feedback.error { background: #38232b; border-left-color: #e89bac; color: #ffd1dc; }
.mission-feedback.success, #mission-form-feedback.success { background: #293722; border-left-color: var(--mint); color: #d2efc1; }
.mission-confirm { display: flex; align-items: flex-start; gap: 11px; padding: 15px; margin: 20px 0; border: 1px solid #4c3d58; background: #261d30; font-size: 12px; line-height: 1.9; color: #d2bfdc; cursor: pointer; }
.mission-confirm input[type="checkbox"] { accent-color: var(--mint); width: 18px; height: 18px; margin: 4px 0 0; flex-shrink: 0; }
.mission-confirm > label { cursor: pointer; }
.mission-confirm:has(input:checked) { border-color: #6a8058; color: #d5e9c9; background: #273222; }
.mission-form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 19px 0 0; }
.mission-form-actions .button { flex: 1; min-width: 160px; }
.mission-submit { min-height: 48px; width: 100%; }
.mission-submit.is-complete { background: #283822 !important; color: var(--mint) !important; box-shadow: 0 3px 0 #10180e !important; border-color: #627b51 !important; }
.mission-form-actions .text-button { min-height: 44px; font-size: 11px; }
.mission-optional { margin-top: 27px; padding: 17px 18px; border: 1px solid #4e3c57; background: #261e2e; }
.mission-optional summary { min-height: 28px; cursor: pointer; color: var(--yellow); font-size: 12px; line-height: 1.9; }
.mission-optional p { margin: 15px 0 10px; color: #c9b2d7; font-size: 12px; line-height: 1.9; }
.mission-optional label { font-size: 12px; color: #cfbadc; display: block; margin-bottom: 10px; }
.mission-optional textarea { margin-top: 8px; min-height: 100px; font-size: 14px; }
.mission-completion-note { margin: 15px 0 0; padding: 14px 16px; background: #273523; color: #cfe7c1; border: 1px solid #60784e; font-size: 12px; line-height: 1.9; }
.mission-completion-note > svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; color: var(--mint); }
.stamp-cell .stamp-progress { display: block; margin: 9px 0 0; color: #bda4ce; font-size: 10px; }
.stamp-cell.stamped .stamp-progress { color: var(--mint); }
.record-item dl { margin: 19px 0; padding: 15px 18px; background: #19141f; border-left: 2px solid #8a6caf; }
.record-item dt { margin-top: 15px; font-size: 11px; color: #b49bc4; }
.record-item dt:first-child { margin-top: 0; }
.record-item dd { margin: 6px 0 0; color: #e4d5ed; font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-item .record-optional { margin-top: 18px; padding-top: 15px; border-top: 1px solid #41314d; }
.reflection-panel { margin-top: 35px; padding: 27px; border: 1px solid #594569; background: #251d2f; box-shadow: 4px 4px 0 #100c17; }
.reflection-panel h2 { font: 24px/1.7 var(--pixel); margin: 8px 0 13px; }
.reflection-panel > p:not(.reflection-status) { color: #bda7cc; font-size: 12px; line-height: 1.9; margin-bottom: 25px; }
.reflection-fields { display: grid; grid-template-columns: 1fr; gap: 24px; }
.reflection-fields textarea { display: block; min-height: 110px; font-size: 14px; }
.reflection-fields .mission-field { margin: 0; }
.reflection-fields .field-hint { margin-top: 8px; }
.reflection-status { margin: 17px 0 0; font-size: 11px; color: #b6a4c3; line-height: 1.8; }
.legacy-section { margin-top: 30px; border: 1px solid #46364f; padding: 22px; background: #1c1723; }
.legacy-section > h2, .legacy-section summary { color: #bea5cf; font-size: 15px; }
.legacy-section summary { cursor: pointer; line-height: 1.8; }
.legacy-section > p { font-size: 11px; color: #aa93ba; line-height: 1.9; }
.legacy-section .record-item { background: #1a1520; }
.legacy-section .record-item:last-child { margin-bottom: 0; }
.legacy-section blockquote { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: #c2afcf; margin: 12px 0; }
.small-note a { color: #c5aedc; text-decoration: underline; text-underline-offset: 3px; }
.goal-numbers { justify-content: space-between; }
.goal-numbers > span { display: inline-flex; align-items: center; gap: 9px; }
.goal-numbers > span svg { width: 18px; height: 18px; color: var(--mint); }
.mission-mini-fields { display: block; }
.mission-field > label > span { margin-left: 6px; font-size: 10px; color: var(--purple); white-space: nowrap; }
.field-hint summary { cursor: pointer; padding: 6px 0; }
.record-item > .record-answer { display: block; margin: 16px 0; }
.record-answer > span { font-size: 11px; color: #bda8cc; }
.record-answer blockquote { margin: 7px 0 0; }

/* Photo cards and the inline worksheet preserve the existing game-window theme. */
#mission-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px; }
.photo-mission { min-width: 0; display: flex; flex-direction: column; border: 1px solid #554064; background: #231c2d; box-shadow: 4px 4px 0 #100c17; }
.photo-mission-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 43px; padding: 10px 16px; border-bottom: 1px solid #594368; background: #35273f; }
.photo-mission-bar h2 { margin: 0; font: 14px/1.5 var(--pixel); color: #eadcf4; }
.photo-mission-bar .mission-status { color: var(--yellow); font-size: 10px; }
.photo-mission-bar .mission-status.complete, .photo-mission-bar .mission-status.done { color: var(--mint); }
svg.mission-photo { display: block; width: 100%; height: 220px; min-width: 0; background: #15111c; border-bottom: 1px solid #4a3656; }
.photo-mission-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 22px 21px; }
.photo-mission-body > label { display: block; margin-bottom: 9px; color: #e4d3ee; font-size: 13px; line-height: 1.8; }
.mission-name-input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid #79618a; border-radius: 2px; background: #14101b; color: #f2e8fa; font: 16px/1.8 var(--sans); }
.mission-name-input::placeholder { color: #a18bac; }
.mission-name-input[aria-invalid="true"] { border-color: #eda0b1; box-shadow: inset 3px 0 #eda0b1; }
.photo-mission-body > p { margin: 15px 0 20px; color: #bca6ca; font-size: 12px; line-height: 1.9; }
.photo-mission-body > .button { margin-top: auto; min-height: 46px; width: 100%; }
.photo-mission-body .field-feedback { margin-bottom: 12px; }
.worksheet-form { min-width: 0; margin-top: 0; padding-top: 0; border-top: 0; }
.worksheet-form > h3 { margin: 25px 0 14px; font: 18px/1.8 var(--pixel); }
svg.worksheet-photo, .worksheet-photo > svg { display: block; width: 100%; height: 250px; background: #15111c; border: 1px solid #584064; }
.worksheet-photo { min-width: 0; }
.worksheet-place-name { padding: 18px; margin: 0 0 23px; border: 1px solid #6a507a; border-top: 0; background: #302339; }
.worksheet-place-name > label { color: #efe2f8; font-size: 14px; }
.worksheet-place-name input:not([type="checkbox"]) { border-color: #9275a5; font-size: 16px; }
.worksheet-introduction, .worksheet-passage { color: #ded0e9; font-size: 15px; line-height: 2.2; overflow-wrap: anywhere; word-break: keep-all; }
.worksheet-form > .worksheet-introduction { font-size: 15px; line-height: 2.2; margin: 20px 0; color: #d1bedf; }
.worksheet-passage { padding: 19px 20px; border: 1px solid #513c5f; background: #1a1422; }
.worksheet-passage p { margin: 0 0 15px; }
.worksheet-passage p:last-child { margin-bottom: 0; }
.inline-blank { display: inline-block; width: 155px; max-width: calc(100% - 10px); margin: 3px 5px; vertical-align: middle; line-height: 1.8; }
.inline-blank input { display: inline-block; width: 100%; max-width: 100%; min-width: 0; min-height: 43px; padding: 6px 10px; border: 1px solid #9477a5; border-bottom: 2px solid #b595d0; border-radius: 2px; background: #302239; color: #f5ebfc; font: 16px/1.8 var(--sans); text-align: center; vertical-align: middle; }
.inline-blank input::placeholder { color: #b8a0c7; font-size: 12px; }
.inline-blank input[aria-invalid="true"] { border-color: #f0a4b5; background: #39222e; box-shadow: inset 3px 0 #eda0b1; }
.inline-blank input[readonly] { border-color: #779366; color: var(--mint); background: #25321f; }
.worksheet-feedbacks { margin: 13px 0 0; }
.worksheet-feedbacks:empty { display: none; }
.worksheet-feedbacks .field-feedback { padding: 7px 12px; border-left: 2px solid #eaa0b3; background: #30202e; }
.worksheet-feedbacks .field-feedback.correct, .worksheet-feedbacks .field-feedback.success { border-color: var(--mint); background: #273322; }
.worksheet-feedbacks .field-hint { padding: 0 2px; }
.certification-sheet { margin: 25px 0 0; padding: 20px; background: #292032; border: 1px solid #5d466b; }
.certification-sheet > h3 { margin: 0 0 13px; font: 17px/1.8 var(--pixel); color: var(--yellow); }
.certification-sheet > p { color: #d2bddf; font-size: 14px; line-height: 2; margin: 0 0 18px; }
.certification-sheet .mission-field:last-child { margin-bottom: 0; }
.answer-echo { display: inline-block; min-width: 95px; max-width: 100%; padding: 0 7px; border-bottom: 1px solid #b595cb; color: var(--mint); text-align: center; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  #mission-list { grid-template-columns: minmax(0, 1fr); }
  .photo-mission-body { padding: 21px; }
  .worksheet-passage { padding: 17px; }
  .worksheet-place-name { padding: 16px; }
}
@media (max-width: 530px) {
  .photo-mission-bar { padding: 10px 15px; }
  .photo-mission-body { padding: 20px 17px; }
  .photo-mission-body > p { font-size: 13px; }
  svg.mission-photo { height: 220px; }
  svg.worksheet-photo, .worksheet-photo > svg { height: 215px; }
  .worksheet-form > .worksheet-introduction, .worksheet-introduction, .worksheet-passage { font-size: 15px; line-height: 2.2; }
  .worksheet-passage { padding: 15px 13px; }
  .inline-blank { width: 135px; }
  .inline-blank input { padding: 6px 8px; }
  .worksheet-place-name { padding: 16px 13px; }
  .worksheet-place-name > label { font-size: 13px; }
  .certification-sheet { padding: 18px 14px; }
  .certification-sheet > h3 { font-size: 16px; }
  .certification-sheet > p { font-size: 14px; }
}
@media (max-width: 360px) {
  .inline-blank { width: 120px; margin-left: 3px; margin-right: 3px; }
  .photo-mission-bar h2 { font-size: 13px; }
  svg.mission-photo { height: 200px; }
}
@media (max-width: 980px) {
  .mission-row .button { margin-left: 0; }
  .mission-row > div { flex-basis: calc(100% - 60px); }
  .mission-row .button { margin-left: 53px; }
}
@media (max-width: 760px) {
  .mission-goal { padding: 21px; gap: 13px 18px; }
  .mission-goal h2, .mission-goal h3 { font-size: 16px; }
  .goal-numbers { font-size: 25px; }
  .mission-goal p, .goal-message { font-size: 12px; }
  .mission-row .button { min-height: 45px; }
  .mission-field input:not([type="checkbox"]), .mission-field textarea, .mission-optional textarea, .reflection-fields textarea { font-size: 16px; }
  .reflection-panel { padding: 23px; }
  .reflection-panel h2 { font-size: 22px; }
  .mission-form-actions .button { width: 100%; flex-basis: 100%; }
  .mission-form-actions .text-button { width: 100%; text-align: center; }
}
@media (max-width: 530px) {
  .mission-goal { padding: 19px 17px; }
  .mission-goal > svg { width: 23px; height: 23px; }
  .mission-goal h2, .mission-goal h3 { font-size: 15px; }
  .mission-row { gap: 13px; }
  .mission-row > div { flex-basis: calc(100% - 47px); }
  .mission-row .button { margin-left: 43px; }
  .mission-kind, .mission-status { font-size: 10px; }
  .mission-form { padding-top: 22px; }
  .mission-form h3 { font-size: 17px; }
  .mission-field { margin: 20px 0; }
  .mission-field > label, .reflection-fields label { font-size: 13px; }
  .mission-confirm { padding: 13px; font-size: 12px; }
  .mission-optional { padding: 15px; }
  .mission-form-actions { gap: 7px; }
  .reflection-panel { padding: 22px 18px; }
  .reflection-panel h2 { font-size: 22px; }
  .reflection-panel > p:not(.reflection-status) { font-size: 12px; }
  .reflection-fields { gap: 22px; }
  .reflection-fields textarea { min-height: 125px; }
  .legacy-section { padding: 19px 16px; }
  .goal-numbers { font-size: 23px; }
  .goal-numbers small, .goal-numbers span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-meter > span { transition: none; }
}
