.memory-settings { grid-column: 1 / -1; }
.memory-settings[hidden], .memory-settings [hidden] { display: none !important; }
[data-memory-reset-panel][hidden] { display: none !important; }
.memory-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0; }
.memory-settings details { margin: 14px 0; }
.memory-trial { max-width: 640px; margin: 20px auto; padding: 20px; border: 1px solid var(--line, #c9d8d2); border-radius: 14px; }
.memory-stage { min-height: 140px; margin: 20px 0; }
.memory-stimulus { min-height: 140px; display: flex; align-items: center; justify-content: center; font-size: clamp(2.5rem, 10vw, 5rem); font-weight: 700; }
.memory-grid, .memory-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: auto; }
.memory-grid .memory-cell { aspect-ratio: 1; padding: 0; min-height: 54px; background: #dfe8e4; opacity: 1; border: 2px solid #829a90; border-radius: 8px; }
.memory-grid .memory-cell.lit { background: #166c53; border: 5px solid #edb849; }
.memory-grid button.memory-cell { transition: none; transform: none; }
.memory-grid button.memory-cell:hover:not(:disabled) { background: #dfe8e4; border-color: #829a90; transform: none; }
.memory-grid .memory-cell:focus-visible { outline: 3px solid #a76600; }
.memory-options, .memory-actions, .memory-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.memory-options button, .memory-keypad button { min-width: 60px; min-height: 48px; }
.memory-options button[aria-pressed="true"] { background: #166c53; color: white; }
.memory-answer { min-height: 2em; overflow-wrap: anywhere; }
.memory-source { border-left: 3px solid #829a90; padding-left: 10px; }
.memory-trial fieldset { margin: 10px 0; padding: 12px; }
.memory-trial pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-controls [hidden] { display: none; }

/* Daily configuration and comparable-task history. */
.memory-rule-card {border:1px solid var(--border, #dce5df); border-radius:12px; padding:1rem; margin:.75rem 0;}
.memory-rule-card h3 {margin-top:0;}
.memory-type-setting {padding:.7rem 0; border-bottom:1px solid #e5e7eb;}
.memory-assignment {display:flex; align-items:center; flex-wrap:wrap; gap:1rem; padding:.5rem 0;}
.memory-history-row {padding:.6rem 0; border-bottom:1px solid #e5e7eb;}
.memory-history-row summary {cursor:pointer;}
.memory-trial select {max-width:100%;}
.memory-rule-card .memory-actions {flex-wrap:wrap;}

[data-memory-editor] label:has(> input[type="checkbox"]):not(.chip) {
  display: flex; align-items: center; gap: 8px; min-height: 36px;
}
[data-memory-editor] input[type="checkbox"] { width: auto; flex: none; margin: 0; }
