/* On-device advice and contextual lessons. This overlay does not resize the table. */
.study-actions {
  position:absolute;right:7px;bottom:5px;z-index:5;
  display:flex;gap:6px;align-items:center;
}
.dialogue-panel .study-actions .mentor-help,
.dialogue-panel .study-actions .study-learn {
  position:static;left:auto;right:auto;bottom:auto;top:auto;
  min-height:28px;min-width:0;width:auto;
  padding:5px 9px;font-size:11px;line-height:1.3;
  border-radius:14px;box-shadow:0 2px 6px #0005;
  white-space:nowrap;touch-action:manipulation;
}
.dialogue-panel .study-actions .study-learn {
  color:#f3e4c5;background:#2c5145;border:1px solid #7eae9c;
  font-weight:650;cursor:pointer;
}
.dialogue-panel .study-actions .study-learn:active {background:#3a695a;}
.dialogue-panel .coach-dialogue:has(.study-actions) {padding-bottom:36px;}
@media(max-width:720px) and (orientation:portrait) {
  /* Put both choices in the existing artwork gutter, not over hand guidance. */
  .dialogue-panel .study-actions {
    left:-73px;right:auto;bottom:4px;width:69px;
    display:flex;flex-direction:column;align-items:stretch;gap:4px;
  }
  .dialogue-panel .study-actions .mentor-help,
  .dialogue-panel .study-actions .study-learn {
    width:100%;min-height:27px;font-size:10px;line-height:1.1;
    padding:5px 2px;box-sizing:border-box;
  }
  .dialogue-panel .coach-dialogue:has(.study-actions){padding-bottom:7px;}
}
@media(max-width:360px) and (orientation:portrait) {
  .dialogue-panel .study-actions {left:-63px;width:59px;gap:3px;}
  .dialogue-panel .study-actions .mentor-help,
  .dialogue-panel .study-actions .study-learn {font-size:9px;min-height:25px;}
}
.study-overlay {
  position:fixed;inset:0;z-index:90;display:grid;place-items:center;
  padding:env(safe-area-inset-top) 7px env(safe-area-inset-bottom);
}
.study-scrim {
  position:absolute;inset:0;background:#07140fdf;border:0;width:100%;height:100%;
}
.study-panel {
  width:min(580px,calc(100vw - 16px));
  max-height:calc(100dvh - 18px);height:auto;
  min-height:0;z-index:2;position:relative;display:flex;flex-direction:column;
  overflow:hidden;border:1.5px solid #c8a96f;border-radius:13px;
  box-shadow:0 18px 58px #020c08c9;background:#19342a;color:#f5f0e2;
}
.study-header {
  flex:0 0 auto;display:grid;grid-template-columns:1fr auto;gap:2px 8px;
  align-items:center;padding:11px 13px 9px;
  border-bottom:1px solid #64765e;background:#234238;
}
.study-header span {
  font-size:10px;color:#a9d7c1;letter-spacing:.05em;
  grid-column:1;grid-row:1;
}
.study-header strong {font-size:17px;line-height:1.4;color:#ffe5ae;grid-column:1;grid-row:2;}
.study-header button {
  grid-column:2;grid-row:1/3;display:grid;place-items:center;
  width:37px;height:37px;border:1px solid #adbd9d;border-radius:8px;
  color:#fff8df;background:#36584b;font-size:25px;touch-action:manipulation;
}
.study-scroll {
  flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;touch-action:pan-y;padding:13px 15px 19px;
}
.study-scroll h2 {font-size:19px;color:#ffe2a8;margin:0 0 10px;line-height:1.4;}
.study-scroll h3 {font-size:14px;color:#f1d29c;margin:17px 0 7px;font-weight:800;}
.study-scroll p {font-size:13px;line-height:1.75;margin:6px 0 10px;color:#e5ede0;}
.study-scroll p.study-lead {font-size:14px;font-weight:650;color:#fff3db;}
.study-scroll .study-note {font-size:11px;color:#b8c7b9;line-height:1.65;margin-top:8px;}
.study-scroll .study-highlight {color:#ffe0a2;font-weight:750;}
.study-scroll .study-warning {
  padding:8px 9px;background:#513e2b;border-left:3px solid #eac27a;color:#fff2d3;
  border-radius:3px;
}
.study-situation {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:9px;}
.study-situation div {display:flex;flex-direction:column;gap:4px;padding:8px 10px;
  border:1px solid #637d67;border-radius:7px;background:#294338;}
.study-situation small {font-size:10px;color:#bfcbb8;}
.study-situation strong {font-size:13px;color:#fff0c6;}
.study-choice {display:flex;align-items:center;gap:9px;position:relative;
  padding:8px 6px 8px 9px;border-top:1px solid #5d765c;min-height:64px;}
.study-choice-order {
  position:absolute;top:-1px;right:0;font-size:9px;color:#f2d9a1;font-weight:700;
}
.study-choice .discard-tile,.study-example-tiles .discard-tile {
  width:35px;height:47px;font-size:20px;flex:0 0 35px;box-shadow:0 2px 0 #bac7ae;
}
.study-choice .discard-tile .sub,.study-example-tiles .discard-tile .sub{font-size:9px;}
.study-choice-copy {display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;}
.study-choice-copy strong {font-size:15px;color:#ffe3ac;}
.study-choice-copy span {font-size:11px;color:#bbdabf;line-height:1.4;}
.study-choice-copy p {font-size:11px;margin:0;line-height:1.5;}
.study-example-tiles {display:flex;flex-wrap:wrap;gap:5px;margin:12px 0;}
.study-topics {display:flex;flex-wrap:wrap;gap:7px;margin-top:8px;}
.study-topic {border:1px solid #829e86;border-radius:8px;background:#2b4b3b;
  color:#f8edcd;font-size:12px;padding:9px 10px;text-align:left;
  touch-action:manipulation;}
.study-topic:active {background:#49765b;}
.study-footer {
  flex:0 0 auto;display:grid;grid-template-columns:1fr 1fr;gap:8px;
  border-top:1px solid #6a8066;padding:9px 12px;
  background:#203b31;
}
.study-footer button {border-radius:8px;border:1px solid #a9b99a;
  color:#eaf1da;background:#2a4b3b;min-height:41px;
  padding:7px 8px;font-size:12px;font-weight:750;touch-action:manipulation;}
.study-footer button:last-child {border-color:#e6c281;background:#655132;color:#fff1cf;}
.study-footer button:active {filter:brightness(1.18);}
@media(max-width:390px) {
  .study-scroll {padding:10px 11px 14px;}
  .study-scroll p {font-size:12px;}
  .study-scroll h3 {margin-top:13px;}
  .study-choice {gap:7px;}
  .study-footer {padding:7px 9px;}
  .study-footer button {font-size:11px;min-height:39px;}
}
@media(prefers-reduced-motion:reduce){.study-panel{transition:none;}}
