/* Question panel (pilot). Docked on the right on wide screens; floating button + bottom sheet on narrow ones. */
:root { --ask-dock-w: 370px; --audio-bar-space: 0px; --ask-blue: #1f4e79; --ask-blue-soft: #eaf2fa; }
@media (min-width: 1400px) { :root { --ask-dock-w: 410px; } }

.pilot-notice { max-width:1060px; margin:1rem auto 0; padding:.8rem 1rem; border:2px solid #7a5b00; border-left:8px solid #7a5b00; background:#fff8e1; border-radius:.45rem; }
@media (max-width:1092px) { .pilot-notice { margin:1rem; } }

/* Reserve room on the right so the panel never covers the lab text or the read-aloud controls. */
body.ask-docked { padding-right: var(--ask-dock-w); }
body.ask-docked .sticky-audio-controls { left: calc((100% - var(--ask-dock-w)) / 2); width: min(960px, calc(100% - var(--ask-dock-w) - 2rem)); }
body.ask-mobile main { padding-bottom: 6rem; }

.ask-dock { position:fixed; top:0; right:0; bottom:0; width:var(--ask-dock-w); z-index:1500; background:#fff;
  border-left:1px solid #c9d3de; box-shadow:-6px 0 24px rgba(16,40,70,.10); display:flex; flex-direction:column; color:#111; }
.ask-dock[hidden], .ask-launcher[hidden] { display:none !important; }
.ask-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.85rem 1rem; background:var(--ask-blue); color:#fff; }
.ask-head h2 { margin:0; padding:0; border:0; font-size:1.15rem; line-height:1.3; }
.ask-head h2:focus { outline:3px solid #fff; outline-offset:3px; }
.ask-close { background:transparent; color:#fff; border:2px solid #fff; border-radius:999px; padding:.3rem .8rem; font-size:.9rem; }
.ask-close:focus { outline:3px solid #fff; outline-offset:2px; }
.ask-body { overflow-y:auto; padding:1rem; flex:1 1 auto; overscroll-behavior:contain; }

.ask-where { background:var(--ask-blue-soft); border:1px solid #c3d6ea; border-radius:.6rem; padding:.75rem .85rem; margin-bottom:.9rem; }
.ask-where-label { font-size:.75rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:#2c4a66; }
.ask-where-title { font-weight:800; font-size:1.05rem; line-height:1.35; margin:.1rem 0 .15rem; }
.ask-where-step { font-size:.92rem; color:#28323c; margin-bottom:.2rem; }
.ask-field { display:flex; flex-direction:column; gap:.2rem; margin-top:.55rem; }
.ask-field[hidden] { display:none; }
.ask-field label { font-size:.85rem; font-weight:700; }
.ask-field select { font:inherit; font-size:.95rem; width:100%; padding:.35rem .4rem; border:1px solid #6b7785; border-radius:.35rem; background:#fff; }
.ask-follow { display:flex; align-items:center; gap:.45rem; margin-top:.6rem; font-size:.92rem; }
.ask-follow input { width:1.1rem; height:1.1rem; margin:0; }

.ask-graded { border-left:5px solid #7a5b00; background:#fff8e1; padding:.55rem .7rem; margin:0 0 .9rem; border-radius:.3rem; font-size:.93rem; }
.ask-graded[hidden] { display:none; }

.ask-presets { display:flex; flex-wrap:wrap; gap:.5rem; margin:0 0 .9rem; }
.ask-preset { flex:1 1 9rem; font:inherit; font-size:.95rem; padding:.5rem .7rem; border:2px solid var(--ask-blue); color:var(--ask-blue); background:#fff; border-radius:999px; cursor:pointer; font-weight:700; }
.ask-preset:hover:not(:disabled) { background:var(--ask-blue-soft); }

.ask-form { display:flex; flex-direction:column; gap:.35rem; }
.ask-form label { font-weight:700; }
.ask-form textarea { font:inherit; width:100%; padding:.55rem; border:1px solid #6b7785; border-radius:.45rem; resize:vertical; min-height:4.6rem; }
.ask-form-foot { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.ask-count { font-size:.82rem; color:#4d5660; }
.ask-submit { font:inherit; font-weight:700; padding:.5rem 1.4rem; background:var(--ask-blue); color:#fff; border:2px solid var(--ask-blue); border-radius:999px; cursor:pointer; }
.ask-hint { font-size:.82rem; color:#4d5660; }
.ask-status { min-height:1.4em; font-weight:600; margin:.7rem 0 .4rem; font-size:.95rem; }
.ask-dock button:disabled { opacity:.55; cursor:wait; }

.ask-history { display:flex; flex-direction:column; gap:.75rem; }
.ask-card { border:1px solid #c9d3de; border-left:5px solid #7d8a97; border-radius:.55rem; padding:.7rem .8rem; background:#fbfcfd; }
.ask-card-approved { border-left-color:#1d6b2f; }
.ask-card-prepared { border-left-color:var(--ask-blue); }
.ask-card-generated { border-left-color:#a07800; }
.ask-card-error { border-left-color:#8a1c1c; }
.ask-card-about { font-size:.85rem; margin-bottom:.25rem; }
.ask-card-about-label { font-weight:800; }
.ask-card-q { font-style:italic; color:#333; margin-bottom:.35rem; overflow-wrap:anywhere; }
.ask-badge { display:inline-block; font-size:.78rem; font-weight:800; border:2px solid #555; border-radius:.3rem; padding:.1rem .45rem; margin-bottom:.4rem; background:#fff; }
.ask-badge-approved { border-color:#1d6b2f; color:#1d6b2f; }
.ask-badge-prepared { border-color:var(--ask-blue); color:var(--ask-blue); }
.ask-badge-generated { border-color:#7a5b00; color:#5c4400; }
.ask-badge-error { border-color:#8a1c1c; color:#8a1c1c; }
.ask-para { margin:.3rem 0; overflow-wrap:anywhere; }
.ask-sources { margin-top:.4rem; font-size:.9rem; }
.ask-sources-label { font-weight:700; }
.ask-actions { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:.5rem; }
.ask-actions button { font:inherit; font-size:.88rem; padding:.3rem .7rem; border:2px solid #333; background:#fff; border-radius:999px; cursor:pointer; }

.ask-dock button:focus, .ask-dock select:focus, .ask-dock textarea:focus, .ask-dock input:focus, .ask-dock a:focus { outline:3px solid #0b3a66; outline-offset:2px; }

/* Floating launcher: shown when the panel is hidden; always above the read-aloud bar. */
.ask-launcher { position:fixed; right:1rem; bottom:calc(var(--audio-bar-space) + 1rem); z-index:1900; display:flex; align-items:center; gap:.5rem;
  font:inherit; font-weight:800; padding:.65rem 1.1rem .65rem .7rem; background:var(--ask-blue); color:#fff; border:2px solid #fff; border-radius:999px;
  box-shadow:0 4px 18px rgba(0,0,0,.25); cursor:pointer; }
.ask-launcher:focus { outline:3px solid #111; outline-offset:3px; }
.ask-launcher-icon { display:inline-flex; align-items:center; justify-content:center; width:1.6rem; height:1.6rem; border-radius:50%; background:#fff; color:var(--ask-blue); font-weight:900; }
.ask-launcher-new { font-weight:600; }

/* Narrow screens: the panel becomes a bottom sheet that stops above the read-aloud bar. */
body.ask-mobile .ask-dock { top:auto; left:0; right:0; width:auto; bottom:var(--audio-bar-space);
  max-height:calc(100vh - var(--audio-bar-space) - 2.5rem); max-height:calc(100dvh - var(--audio-bar-space) - 2.5rem);
  border-radius:1rem 1rem 0 0; border-left:0; border-top:1px solid #c9d3de; box-shadow:0 -8px 28px rgba(16,40,70,.22); z-index:1950; }
body.ask-mobile .ask-head { border-radius:1rem 1rem 0 0; }

@media print { .ask-dock, .ask-launcher, .pilot-notice { display:none !important; } body.ask-docked { padding-right:0; } }
@media (forced-colors: active) { .ask-dock, .ask-card, .ask-where, .ask-launcher, .pilot-notice { border:1px solid CanvasText; } }
@media (prefers-reduced-motion: no-preference) { .ask-launcher { transition: bottom .15s ease; } }

/* Common questions (multi-module release) */
.ask-common { margin: 0.6rem 0; border: 1px solid #c9d2dd; border-radius: 8px; padding: 0.4rem 0.6rem; }
.ask-common summary { cursor: pointer; font-weight: 600; }
.ask-common-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.ask-common-q { width: 100%; text-align: left; font: inherit; font-size: 0.92rem; background: transparent;
  border: 1px solid #c9d2dd; border-radius: 6px; padding: 0.35rem 0.5rem; cursor: pointer; color: inherit; }
.ask-common-q:hover:not(:disabled) { border-color: currentColor; }
.ask-common-q:focus-visible { outline: 3px solid #b9530a; outline-offset: 2px; }
.ask-common-q:disabled { opacity: 0.6; cursor: default; }

/* Link back to the course home page (/ban6003/) */
.home-link { margin:0 0 .6rem; font-size:.92rem; }
.home-link a { color:var(--ask-blue); font-weight:700; text-decoration:none; }
.home-link a:hover, .home-link a:focus-visible { text-decoration:underline; }

/* Keep single line breaks inside an answer paragraph (lists written as lines). */
.ask-para { white-space: pre-line; }
