/* Body Quests: problems Audi is fixing (Character tab). Guild Hall parchment surfaces, status = colour + word. */
.body-quests { padding: clamp(1rem, 2.4vw, 1.45rem); }
.body-quests-heading { flex-wrap: wrap; }
.body-quests-heading > div { flex: 1 1 14rem; min-width: 0; }
.body-quest-add { flex: 0 0 auto; min-height: 44px; }
.body-quest-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .85rem; }

.bq-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; border: 1px solid; font-size: .74rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.bq-pill.is-active { color: #7a2a21; background: #f6d9cf; border-color: #c98b7c; }
.bq-pill.is-improving { color: #6b4209; background: #f8e3b4; border-color: #c9a05a; }
.bq-pill.is-resolved { color: #2f5a40; background: #d8ead9; border-color: #8fb69a; }

.body-quest-compose:empty { display: none; }
.body-quest-compose { margin-bottom: .9rem; }
.body-quest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .7rem; }

.bq-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .75rem; align-items: start; width: 100%; padding: .75rem .8rem .75rem .75rem; text-align: left; font: inherit; color: #432e1e; background: #fff4d6; border: 1px solid #c9a46a; border-left: 6px solid #b98e50; border-radius: 10px; box-shadow: 0 3px 8px rgba(21, 10, 4, .16); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.bq-card:hover { transform: translateY(-2px); box-shadow: 0 7px 16px rgba(21, 10, 4, .22); }
.bq-card:focus-visible { outline: 3px solid #a96919; outline-offset: 2px; }
.bq-card.is-active { border-left-color: #b4483a; }
.bq-card.is-improving { border-left-color: #c58a1f; }
.bq-card.is-resolved { border-left-color: #477157; background: #f3efdf; }
.bq-thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #ead3a5; border: 1px solid #c9a46a; }
.bq-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bq-thumb-icon { font-size: 1.9rem; line-height: 1; }
.bq-card-body { display: grid; gap: .3rem; min-width: 0; }
.bq-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.bq-card-name { font-size: .98rem; line-height: 1.3; color: #3a2616; }
.bq-card-metric { font-size: .8rem; color: #4f3722; }
.bq-card-foot { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; font-size: .76rem; }
.bq-trend { color: #5d432b; }
.bq-trend.is-better { color: #2f5a40; font-weight: 700; }
.bq-trend.is-worse { color: #7a2a21; font-weight: 700; }
.bq-today { padding: .1rem .5rem; border-radius: 999px; background: #432e1e; color: #fff0cb; font-weight: 700; }
.bq-today.is-done { background: #d8ead9; color: #2f5a40; border: 1px solid #8fb69a; }
.bq-spark { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 3px; height: 26px; padding-top: .2rem; }
.bq-spark i { flex: 1 1 0; max-width: 14px; min-height: 3px; border-radius: 2px 2px 0 0; background: #b98e50; }
.bq-card.is-active .bq-spark i { background: #c66d5f; }
.bq-card.is-resolved .bq-spark i { background: #6f9a7d; }
.bq-empty { margin: 0; padding: .9rem; border: 1px dashed #b98e50; border-radius: 10px; color: #5d432b; background: rgba(255, 244, 214, .7); font-size: .86rem; }

.body-quest-starters { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .85rem; }
.body-quest-starters:empty { display: none; }
.bq-starters-label { font-size: .74rem; font-weight: 800; letter-spacing: .06em; color: #5d432b; }
.bq-starter { min-height: 40px; padding: .4rem .8rem; border-radius: 999px; border: 1px dashed #a07a44; background: #f8ecd0; color: #432e1e; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.bq-starter:hover { background: #fff4d6; border-style: solid; }
.bq-starter:focus-visible { outline: 3px solid #a96919; outline-offset: 2px; }

.body-quest-form .bq-name-row label:first-child { flex: 0 0 5.5rem; }
.bq-form-warning { display: block; margin: -.2rem 0 .3rem; padding: .45rem .6rem; border-radius: 8px; background: #f8e3b4; color: #6b4209; font-size: .78rem; }

/* Detail view (shared movement modal) */
#training-exercise-modal .bq-detail-photo img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 10px; }
#training-exercise-modal .bq-detail-photo figcaption { margin-top: .3rem; font-size: .76rem; color: #5d432b; }
#training-exercise-modal .bq-log { margin: 1rem 0; padding: .9rem; border-radius: 12px; background: #fff4d6; border: 1px solid #c9a46a; }
#training-exercise-modal .bq-log h3 { margin: 0 0 .6rem; }
.bq-score-scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.bq-score { display: grid; gap: .1rem; justify-items: center; min-height: 54px; padding: .35rem .2rem; border-radius: 10px; border: 2px solid #c9a46a; background: #fffaf0; color: #432e1e; font: inherit; cursor: pointer; }
.bq-score strong { font-size: 1.15rem; line-height: 1; }
.bq-score small { font-size: .72rem; }
.bq-score:hover { border-color: #8a6a3e; }
.bq-score:focus-visible { outline: 3px solid #a96919; outline-offset: 2px; }
.bq-score.is-selected.is-score-0 { background: #d8ead9; border-color: #477157; color: #2f5a40; }
.bq-score.is-selected.is-score-1 { background: #f8e3b4; border-color: #c58a1f; color: #6b4209; }
.bq-score.is-selected.is-score-2 { background: #f6d9cf; border-color: #c66d5f; color: #7a2a21; }
.bq-score.is-selected.is-score-3 { background: #81352b; border-color: #81352b; color: #fff4ec; }
.bq-note, .bq-number-log label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: #4f3722; }
.bq-note input, .bq-number-log input { min-height: 42px; padding: .45rem .6rem; border-radius: 8px; border: 1px solid #a07a44; background: #fffaf0; color: #2f2014; font: inherit; }
.bq-number-log { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) auto; gap: .6rem; align-items: end; }
.bq-number-log button { min-height: 44px; }
.bq-hint { display: block; margin-top: .5rem; font-size: .74rem; color: #5d432b; }
.bq-history, .bq-section { margin: .7rem 0; border-radius: 10px; border: 1px solid #c9a46a; background: #fbf0d6; }
.bq-history > summary, .bq-section > summary { padding: .65rem .8rem; font-weight: 700; color: #3a2616; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.bq-history .bq-spark { height: 40px; padding: 0 .8rem .4rem; }
.bq-history .bq-spark i { background: #b98e50; }
.bq-history-list { list-style: none; margin: 0; padding: 0 .8rem .6rem; display: grid; gap: .3rem; }
.bq-history-list li { display: grid; grid-template-columns: 4.2rem auto minmax(0, 1fr) 36px; gap: .5rem; align-items: center; padding: .3rem 0; border-top: 1px solid rgba(160, 122, 68, .3); font-size: .82rem; color: #432e1e; }
.bq-history-date { color: #5d432b; }
.bq-history-note { color: #5d432b; overflow-wrap: anywhere; }
.bq-history-remove { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #c98b7c; background: #fff4ec; color: #7a2a21; cursor: pointer; font: inherit; }
.bq-history-remove:hover { background: #81352b; color: #fff; }
.bq-section-text { margin: 0; padding: 0 .8rem .8rem; white-space: pre-line; }
.bq-status-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .8rem 0; }
.bq-status-label { font-size: .78rem; font-weight: 800; color: #4f3722; margin-right: .2rem; }
.bq-status-switch .bq-pill { min-height: 40px; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; opacity: .8; }
.bq-status-switch .bq-pill.is-selected { opacity: 1; box-shadow: 0 0 0 3px #efb944; }
.bq-status-switch .bq-pill.is-selected::after { content: "✓"; margin-left: .15rem; }
.bq-status-switch .bq-pill:focus-visible { outline: 3px solid #a96919; outline-offset: 2px; }
.bq-disclaimer { margin: .8rem 0 0; font-size: .74rem; color: #5d432b; }

@media (max-width: 560px) {
  .bq-number-log { grid-template-columns: 1fr; }
  .bq-history-list li { grid-template-columns: 3.8rem auto minmax(0, 1fr) 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .bq-card { transition: none; }
  .bq-card:hover { transform: none; }
}

/* The shared modal sets light ink for its dark board; cream Body Quest panels need dark ink, the bare board needs light ink. */
.guild-theme #training-exercise-modal .bq-log h3, .guild-theme #training-exercise-modal .bq-history > summary, .guild-theme #training-exercise-modal .bq-section > summary { color: #3a2616; }
.guild-theme #training-exercise-modal .bq-note, .guild-theme #training-exercise-modal .bq-number-log label { color: #4f3722; }
.guild-theme #training-exercise-modal .bq-section .bq-section-text, .guild-theme #training-exercise-modal .bq-history-list li { color: #3a2616; }
.guild-theme #training-exercise-modal .bq-hint, .guild-theme #training-exercise-modal .bq-history-date, .guild-theme #training-exercise-modal .bq-history-note { color: #5a4029; }
.guild-theme #training-exercise-modal .bq-status-label, .guild-theme #training-exercise-modal .bq-disclaimer { color: #f3dfb4; }
.guild-theme #training-exercise-modal .bq-note input::placeholder, .guild-theme #training-exercise-modal .bq-number-log input::placeholder { color: #7a6046; }

/* Form: one clear column, paired fields side by side, icon kept small so the problem name has room. */
.guild-theme .body-quest-form { display: grid; grid-template-columns: 1fr; gap: .7rem; }
.guild-theme .body-quest-form .field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.guild-theme .body-quest-form .field-row[hidden] { display: none; }
.guild-theme .body-quest-form .bq-name-row { grid-template-columns: 4.5rem minmax(0, 1fr); }
.guild-theme .body-quest-form .bq-name-row input#bq-icon { text-align: center; font-size: 1.2rem; }
.guild-theme .body-quest-form .form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.guild-theme .body-quest-form .form-actions button { flex: 1 1 10rem; min-height: 44px; }
.guild-theme .body-quest-form textarea { min-height: 4.5rem; }
@media (max-width: 420px) { .guild-theme .body-quest-form .field-row:not(.bq-name-row) { grid-template-columns: 1fr; } }
.guild-theme #training-exercise-modal .bq-section .bq-section-text a { color: #1f4f7a; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
