.study-tool-hero{align-items:stretch}
.study-tool-links{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}
.study-tool-shell{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;max-width:1180px;min-width:0;margin-inline:auto}.study-tool-shell>*{min-width:0}

.notes-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.34fr);gap:16px;align-items:start}
.notes-editor{display:grid;gap:12px}
.notes-editor label{display:grid;gap:6px;font-weight:900;color:var(--navy)}
.notes-title-input,.notes-body-input{width:100%;border:1px solid #b8ccd8;border-radius:13px;background:#fff;color:var(--ink);padding:12px;font:inherit}
.notes-title-input:focus,.notes-body-input:focus{outline:3px solid rgba(34,132,166,.2);border-color:#2284a6}
.notes-body-input{min-height:440px;resize:vertical;line-height:1.55}
.notes-actions{display:flex;gap:9px;flex-wrap:wrap}
.notes-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:.82rem}
.notes-rail{display:grid;gap:13px}
.notes-prompt-list{display:grid;gap:8px;padding:0;margin:0;list-style:none}
.notes-prompt-list li{padding:9px 10px;border:1px solid #d3e1e7;border-radius:12px;background:#f8fbfc;color:#3c5968;font-size:.86rem}
.notes-privacy{border-left:6px solid #bd8b27;background:#fff7df}

.memory-controls{display:grid;gap:13px}
.memory-control-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.memory-control-row .btn.active{background:var(--navy);border-color:var(--navy);color:#fff}
.memory-select{min-height:44px;border:1px solid #b8ccd8;border-radius:11px;background:#fff;padding:9px 11px;color:var(--ink);font:inherit}
.memory-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.memory-stat{padding:11px;border:1px solid #cadce5;border-radius:14px;background:#fff;text-align:center}
.memory-stat strong{display:block;color:var(--navy);font-size:1.35rem}
.memory-stat span{font-size:.76rem;color:var(--muted)}
.memory-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
.memory-tile{position:relative;min-height:126px;border:0;background:transparent;padding:0;perspective:900px;color:inherit}
.memory-tile-inner{position:absolute;inset:0;transform-style:preserve-3d;transition:transform .42s ease}
.memory-tile.revealed .memory-tile-inner,.memory-tile.matched .memory-tile-inner{transform:rotateY(180deg)}
.memory-tile-face{position:absolute;inset:0;display:grid;place-items:center;padding:12px;border:1px solid #d7bd54;border-radius:7px 17px 17px 7px;box-shadow:0 8px 17px rgba(31,48,59,.14);backface-visibility:hidden;text-align:center;font-weight:900;line-height:1.3}
.memory-tile-front{background:linear-gradient(150deg,#fff4a1,#f5df66);color:#574916;font-size:1.35rem}
.memory-tile-back{transform:rotateY(180deg);background:linear-gradient(150deg,#d7eef7,#a9d9ec);border-color:#69a9c5;color:#163f53;font-size:.85rem;overflow:hidden}
.memory-tile.matched .memory-tile-back{background:linear-gradient(150deg,#d9f1d7,#aee0ac);border-color:#72ad73;color:#215326}
.memory-tile:focus-visible{outline:4px solid rgba(34,132,166,.25);outline-offset:3px;border-radius:17px}
.memory-complete{padding:14px;border:1px solid #8fc3a1;border-radius:15px;background:#eaf7ef;color:#1e6040;text-align:center;font-weight:900}
.memory-game-panel[hidden]{display:none}

.recall-card{display:grid;gap:13px}
.recall-prompt{padding:18px;border:1px solid #c7dbe5;border-radius:16px;background:#fff;text-align:center}
.recall-prompt .status{margin-bottom:8px}
.recall-prompt strong{display:block;color:var(--navy);font-size:clamp(1.25rem,3vw,1.85rem);line-height:1.3}
.recall-choices{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.recall-choice{padding:12px;border:2px solid #c8d8e1;border-radius:14px;background:#fff;color:var(--ink);text-align:left;font-weight:800}
.recall-choice.correct{background:#e8f7ee;border-color:#69ae84;color:#175f3a}
.recall-choice.incorrect{background:#fff0f1;border-color:#d47a86;color:#922e3d}
.recall-feedback{padding:11px 12px;border-radius:13px;font-weight:850}
.recall-feedback.correct{background:#e8f7ee;border:1px solid #7cbb93;color:#17613a}
.recall-feedback.incorrect{background:#fff0f1;border:1px solid #d98791;color:#932f40}

.memory-mode-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.memory-mode-card{border-top:6px solid var(--blue)}
.memory-mode-card:nth-child(2){border-top-color:#7658a5}
.memory-mode-card:nth-child(3){border-top-color:#2b8a65}

@media(max-width:960px){.notes-layout{grid-template-columns:1fr}.memory-board{grid-template-columns:repeat(3,minmax(0,1fr))}.memory-mode-cards{grid-template-columns:minmax(0,1fr);min-width:0}.memory-mode-card{min-width:0;overflow-wrap:anywhere}}
@media(max-width:650px){.notes-body-input{min-height:360px}.notes-actions{display:grid;grid-template-columns:1fr}.notes-actions>*{width:100%}.memory-stats{grid-template-columns:1fr 1fr}.memory-board{grid-template-columns:1fr 1fr}.memory-tile{min-height:112px}.recall-choices{grid-template-columns:1fr}.memory-control-row{display:grid;grid-template-columns:1fr}.memory-control-row>*{width:100%}}
@media(max-width:370px){.memory-board{gap:8px}.memory-tile{min-height:102px}.memory-tile-back{font-size:.76rem}}
@media(prefers-reduced-motion:reduce){.memory-tile-inner{transition:none}}
@media print{.topbar,.sidebar,.mobile-nav,.notes-actions,.study-tool-links,.footer{display:none!important}.layout{display:block!important}.main{padding:0!important}.notes-layout{display:block}.notes-rail{display:none}.notes-body-input,.notes-title-input{border:0;padding:0;overflow:visible;min-height:0}.notes-body-input{height:auto;white-space:pre-wrap}}


/* Prevent mobile form controls from imposing their intrinsic width on Memory Games. */
@media(max-width:650px){
  .memory-controls,
  .memory-controls .section-head,
  .memory-controls .section-head>*,
  .memory-control-row,
  .memory-control-row>*{
    min-width:0;
    max-width:100%;
  }
  .memory-control-row{
    width:100%;
    grid-template-columns:minmax(0,1fr);
  }
  .memory-control-row label,
  .memory-select{
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .memory-controls .status{
    white-space:normal;
    overflow-wrap:anywhere;
  }
}
