/* Design a specimen, inspect it, then save. Optional controls stay close to the live draft. */
#modal .compact-editor{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:18px;align-items:start;min-width:0}
#modal .compact-editor>*{min-width:0}
#modal .compact-editor .editor-preview{position:sticky;top:0;margin:0;padding:12px;border:1px solid #c9bea2;border-radius:16px;background:#fffaf0;text-align:center}
#modal .compact-editor #draft-preview{display:block;width:100%;height:250px;max-height:none;object-fit:contain;border-radius:10px}
#modal .compact-editor #draft-preview.is-live{height:clamp(260px,48dvh,430px)}
#modal .compact-editor .editor-test-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;margin-top:7px}
#modal .compact-editor .editor-test-actions .small{min-height:44px;min-width:44px;margin:0;font-size:11px;padding:9px 10px;white-space:normal}
#modal .compact-editor #draft-rule{font-size:12px;line-height:1.4;margin:10px 0 0;color:#5b634e;overflow-wrap:break-word}
#modal .compact-editor .editor-fields{display:flex;flex-direction:column;gap:10px;min-width:0}
#modal .compact-editor .editor-basic{display:grid;grid-template-columns:minmax(0,1fr) 65px;gap:9px}
#modal .compact-editor .editor-shape{grid-column:1/-1}
#modal .compact-editor label{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;line-height:1.3;font-weight:750}
#modal .compact-editor input,#modal .compact-editor select{width:100%;min-width:0;min-height:44px;padding:10px;border:1px solid #b8b59e;border-radius:9px;background:#fffaf0;font-size:14px}
#modal .compact-editor input[type=color]{padding:4px;height:44px}
#modal .compact-editor .editor-options{border:1px solid #c6c7ad;border-radius:11px;background:#f1f2e5;min-width:0}
#modal .compact-editor .editor-options summary{min-height:44px;cursor:pointer;padding:12px;font-size:13px;font-weight:750;line-height:1.4;color:#254735}
#modal .compact-editor summary:focus-visible,#modal .collection-slot-options summary:focus-visible,#modal .specimen-management summary:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:6px}
#modal .compact-editor .editor-option-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0 12px 12px}
#modal .compact-editor .editor-option-fields>.preset-row,#modal .compact-editor .editor-option-fields>.text-button,#modal .compact-editor .editor-option-fields>p,#modal .compact-editor .editor-identity label{grid-column:1/-1}
#modal .compact-editor .preset-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0 0 2px}
#modal .compact-editor .preset-row .small{min-width:0;min-height:44px;padding:7px;font-size:11px;line-height:1.3;white-space:normal}
#modal .compact-editor .editor-option-fields>.text-button{min-height:44px;text-align:left;font-size:12px;line-height:1.4}
#modal .compact-editor .editor-option-fields>p{font-size:12px;line-height:1.45;margin:0;color:#59634d}
#modal .compact-editor .editor-save{display:flex;gap:7px;position:sticky;bottom:0;padding:8px 0;background:#fffaf0f7;z-index:2}
#modal .compact-editor #draft-publish{flex:1;min-width:0;min-height:49px;font-size:14px;line-height:1.3;background:linear-gradient(#d5ff4e,#b6e926);color:#173b27;border-color:#8baa2b;box-shadow:0 3px 0 #819a3a}
#modal .compact-editor .editor-save>.small{min-height:49px;min-width:0;font-size:11px;padding:8px}
#modal .compact-editor #publish-note{margin:0;font-size:12px!important;line-height:1.4!important}
/* Owned specimens are the content; expansion offers remain available below one short row. */
#modal #modal-content:has(.compact-storage){grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#modal .compact-storage{display:grid;gap:10px;padding:0;background:none;border:0}
#modal .collection-capacities{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#modal .collection-capacities>span{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;padding:10px 12px;border:1px solid #c5c7ac;border-radius:10px;background:#e9eddd;font-size:12px;line-height:1.3;color:#34503d}
#modal .collection-capacities strong{font-size:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
#modal .collection-toolbar{display:flex;gap:8px;align-items:stretch}
#modal .collection-toolbar .primary{flex:1;min-height:47px;min-width:0;font-size:14px;line-height:1.3;background:linear-gradient(#d5ff4e,#b6e926);color:#173b27;border-color:#8baa2b;box-shadow:0 3px 0 #819a3a}
#modal .collection-toolbar .small{min-height:47px;min-width:44px;font-size:12px;white-space:normal}
#modal .collection-slot-options{border:1px solid #cfc7b2;border-radius:10px;background:#f8f2e4}
#modal .collection-slot-options>summary{cursor:pointer;min-height:44px;padding:12px;font-size:12px;font-weight:750;line-height:1.4;color:#3d5340}
#modal .collection-slot-options .slot-options{margin:0;padding:0 10px 10px}
#modal .collection-empty{padding:18px}
#modal .collection-empty h3{font-size:18px;line-height:1.3;margin:0 0 7px}
#modal .collection-empty p{font-size:13px;line-height:1.4;margin:0}
#modal .specimen-card{min-width:0;padding:12px;border:1px solid #c8bea7;border-radius:13px;background:#fffaf0}
#modal .specimen-card.specimen-equipped{border-color:#63886a;box-shadow:inset 0 0 0 1px #63886a;background:#f5f8e9}
#modal .specimen-card>canvas{display:block;width:100%;height:82px;max-height:none;object-fit:contain}
#modal .specimen-card>.status-pill{max-width:100%;font-size:9px;line-height:1.3;margin-top:5px}
#modal .specimen-card h3{font-size:16px;line-height:1.25;margin:7px 0 5px;overflow-wrap:anywhere}
#modal .specimen-card p{font-size:11px;line-height:1.4;margin:0 0 9px;overflow-wrap:anywhere}
#modal .specimen-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:stretch}
#modal .specimen-actions .small{flex:1 1 90px;min-width:0;min-height:44px;margin:0;padding:8px;font-size:11px;line-height:1.3;white-space:normal}
#modal .specimen-replacement{display:block;flex-basis:100%;min-width:0;font-size:11px;line-height:1.4}
#modal .specimen-replacement select{display:block;width:100%;max-width:100%;min-width:0;min-height:44px;margin-top:4px;border:1px solid #b8b59e;border-radius:7px;padding:8px;background:#fffaf0;font-size:12px}
#modal .specimen-management{margin-top:6px}
#modal .specimen-management summary{min-height:44px;cursor:pointer;padding:12px 0;font-size:11px;font-weight:700;color:#5c6b55}
#modal .specimen-management .small{min-height:44px;margin:0;font-size:11px}
@media(max-width:700px){
 #modal .compact-editor{grid-template-columns:minmax(0,1fr);gap:12px}
 #modal .compact-editor .editor-preview{position:static;grid-row:auto;padding:9px}
 #modal .compact-editor #draft-preview{height:144px}
 #modal .compact-editor #draft-preview.is-live{height:clamp(220px,43dvh,340px)}
 #modal .compact-editor #draft-rule{font-size:11px;line-height:1.35;margin-top:7px}
 #modal .compact-editor .editor-test-actions{margin-top:3px;flex-wrap:nowrap}
 #modal .compact-editor .editor-test-actions .small{font-size:10px;padding:7px;flex:1;min-width:0}
 #modal .compact-editor #draft-reset{flex:0 0 44px}
 #modal #modal-content:has(.compact-storage){grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 #modal .collection-capacities{gap:5px}
 #modal .collection-capacities>span{flex-direction:column;align-items:flex-start;gap:3px;padding:8px;font-size:11px}
 #modal .collection-capacities strong{font-size:16px}
 #modal .collection-slot-options .slot-options{grid-template-columns:minmax(0,1fr)}
 #modal .specimen-card{padding:9px}
 #modal .specimen-card h3{font-size:14px}
 #modal .specimen-card>canvas{height:68px}
}
@media(max-width:360px){
 #modal .compact-editor .editor-option-fields{grid-template-columns:minmax(0,1fr)}
 #modal .compact-editor .editor-options summary{font-size:12px}
 #modal .compact-editor .editor-save{flex-wrap:wrap}
 #modal .compact-editor #draft-publish{flex-basis:180px}
}
body.large-text #modal .compact-editor label,body.large-text #modal .compact-editor summary,body.large-text #modal .collection-slot-options summary{font-size:15px}
body.large-text #modal .compact-editor #draft-rule,body.large-text #modal .specimen-card p,body.large-text #modal .specimen-actions .small{font-size:14px}
