/* Attach an existing concept or select a defining core from research. */
.recipe-app #research-concept-picker .modal-dialog { width: calc(100% - 32px); max-width: 1120px; max-height: calc(100dvh - 32px); margin: 16px auto; padding: 24px; overflow: hidden; }
.recipe-app #research-concept-picker .modal-dialog:has([data-concept-create]:not([hidden])) { height: calc(100dvh - 32px); }
.recipe-app #research-concept-picker .modal-header { margin-bottom: 12px; padding-bottom: 8px; }
.recipe-app #research-concept-picker .modal-header h2 { margin: 0; font-size: var(--recipe-font-heading); }
.recipe-app #research-concept-picker .modal-body { min-height: 0; padding: 0; }
.recipe-app #research-concept-picker .research-concept-picker-form { display: flex; flex-direction: column; height: 100%; }
.recipe-app #research-concept-picker .research-concept-create { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.recipe-app #research-concept-picker [data-concept-core-list] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.recipe-app #research-concept-picker .research-core-choices { flex: 1; min-height: 0; max-height: none; margin-block: 8px; }
.recipe-app .research-concept-start { border-left: 4px solid var(--recipe-accent); }
.recipe-app .research-concept-core { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 16px; }
.recipe-app .research-concept-core li { padding: 4px 10px; border: 1px solid var(--recipe-line); border-radius: var(--recipe-radius-small); background: var(--recipe-accent-wash); font-size: var(--recipe-font-control); }
.recipe-app .research-concept-start h2 { margin: 0 0 8px; }
.recipe-app .research-concept-start .btn { white-space: normal; }
/* Develop keeps the starting choices and servings together in a compact list. */
.recipe-app .research-develop-panel { padding: 16px 20px; margin-bottom: 16px; }
.recipe-app .research-develop-panel h2 { margin: 0; font-size: var(--recipe-font-heading); }
.recipe-app .research-develop-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.recipe-app .research-develop-panel .research-concept-core { gap: 6px; margin: 0; }
.recipe-app .research-develop-panel .research-concept-core li { padding: 2px 8px; }
.recipe-app .research-develop-panel > .research-help { margin: 8px 0 12px; }
.recipe-app .research-develop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.recipe-app .research-develop-actions form { margin: 0; }
.recipe-app .research-develop-panel .btn { min-height: var(--recipe-control-compact); margin: 0; padding: 6px 12px; }
.recipe-app .research-develop-help { margin-top: 8px; }
.recipe-app .research-develop-help summary { width: fit-content; padding: 4px 0; color: var(--recipe-muted); font-size: var(--recipe-font-control); cursor: pointer; }
.recipe-app .research-develop-help p { margin: 6px 0 0; max-width: 72ch; }
.recipe-app .research-develop-recipes > h2 { margin-bottom: 6px; }
.recipe-app .research-develop-panel .research-list-row { padding: 10px 0; }
.recipe-app .research-develop-panel .research-list-row:last-of-type { border-bottom: 0; }
.recipe-app .research-develop-panel .research-list-row h3 { margin: 0; font-size: var(--recipe-font-body); }
.recipe-app .research-develop-panel .research-list-row .research-help { font-weight: 400; }
@media (max-width: 768px) {
  .recipe-app .research-develop-panel { padding: 14px 16px; }
  .recipe-app .research-develop-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .recipe-app .research-develop-actions > .btn-primary, .recipe-app .research-develop-actions > form:has(.btn-primary) { grid-column: 1 / -1; }
  .recipe-app .research-develop-actions .btn { width: 100%; white-space: normal; text-align: center; }
  .recipe-app .research-develop-panel .btn, .recipe-app .research-develop-help summary { min-height: var(--recipe-control-touch); box-sizing: border-box; }
  .recipe-app .research-develop-help summary { padding-block: 12px; }
  .recipe-app .research-develop-panel .research-list-row { flex-wrap: nowrap; align-items: center; gap: 12px; }
  .recipe-app .research-develop-panel .research-list-row .btn { flex-basis: 110px; white-space: normal; text-align: center; }
}
.recipe-app .research-concept-create { border-top: 1px solid var(--recipe-line); margin-top: 6px; padding-top: 8px; }
.recipe-app .research-concept-create h3 { margin: 0 0 6px; font-size: var(--recipe-font-heading); overflow-wrap: anywhere; }
.recipe-app .research-core-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 6px; max-height: min(300px, 36dvh); overflow-y: auto; border: 0; margin: 12px 0; padding: 0 8px 0 0; }
.recipe-app .research-core-choices legend { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; }
.recipe-app .research-form .research-core-choice { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; height: auto; min-width: 0; min-height: var(--recipe-control-touch); padding: 8px; margin: 0; border: 1px solid var(--recipe-line); border-radius: var(--recipe-radius-small); background: var(--recipe-surface); cursor: pointer; text-transform: none; letter-spacing: normal; font-size: var(--recipe-font-control); font-weight: 400; }
.recipe-app .research-core-choice:has(input:checked) { border-color: var(--recipe-accent); background: var(--recipe-accent-wash); }
.recipe-app .research-core-choice:focus-within { outline: 2px solid var(--recipe-accent); outline-offset: -2px; }
.recipe-app .research-form .research-core-choice input[type=checkbox] { margin: 0; width: 18px; height: 18px; accent-color: var(--recipe-accent); }
.recipe-app .research-concept-picker-form [hidden] { display: none; }
.recipe-app .research-concept-picker-form .research-field { margin-bottom: 4px; }
.recipe-app .research-concept-picker-form .research-field > label { margin-bottom: 4px; font-size: var(--recipe-font-compact); }
.recipe-app .research-concept-picker-form .research-help { margin: 3px 0; font-size: var(--recipe-font-compact); }
.recipe-app .research-concept-picker-form .research-concept-definition { flex-shrink: 0; margin: 0 0 6px; }
.recipe-app .research-concept-picker-form .research-concept-definition textarea { min-height: var(--recipe-control-touch); height: var(--recipe-control-touch); padding: 8px 10px; line-height: 1.4; }
.recipe-app .research-concept-picker-form [data-concept-search-status] { margin: 2px 0; }
.recipe-app .research-concept-picker-form [data-concept-search-status]:empty { display: none; }
.recipe-app .research-core-choice-copy { display: grid; gap: 2px; min-width: 0; }
.recipe-app .research-core-choice-copy > strong { line-height: 1.3; overflow-wrap: anywhere; }
.recipe-app .research-core-choice-copy > span { font-size: var(--recipe-font-compact); line-height: 1.4; color: var(--recipe-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-app .research-core-choice-count { display: grid; gap: 3px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recipe-app .research-core-choice-count small { color: var(--recipe-muted); font-size: var(--recipe-font-compact); }
.recipe-app .research-concept-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1024px) {
  .recipe-app .research-core-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px), (max-height: 600px) {
  .recipe-app #research-concept-picker .research-concept-picker-form { height: auto; display: block; }
  .recipe-app #research-concept-picker .research-concept-create { display: block; }
  .recipe-app #research-concept-picker [data-concept-core-list] { display: block; }
  .recipe-app #research-concept-picker .research-core-choices { max-height: 55dvh; }
}
@media (max-width: 768px) {
  .recipe-app #research-concept-picker .modal-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 16px; border-radius: 0; }
  .recipe-app #research-concept-picker .modal-dialog:has([data-concept-create]:not([hidden])) { height: 100dvh; }
}
@media (max-width: 480px) {
  .recipe-app .research-core-choices { grid-template-columns: minmax(0, 1fr); }
  .recipe-app .research-concept-create .research-actions { align-items: stretch; flex-direction: column; }
}
.recipe-app #research-concept-picker [hidden] { display: none; }




