/* ============================================================
   assets/student-hub.css
   Student Hub. Mobile-first: every rule here is the phone layout,
   and the only media queries widen it. Designed against 375px.

   Uses the existing ParaLearn tokens from site.css (--g, --gl, --gb,
   --gm, --gp, --t, --tm, --tl, --ba, --shadow-sm) -- no new palette,
   no gradients beyond the one dark band the site already uses.
   ============================================================ */

/* The site nav is sticky at the top and, on a phone, the hub's own bar is
   fixed at the bottom. Without scroll-padding, both scrollIntoView() and a
   plain #anchor land content underneath one of them -- which is exactly what
   happened when a tool's Generate button ended up behind the bottom bar. */
html{scroll-padding-top:72px;scroll-padding-bottom:86px}
@media(min-width:900px){html{scroll-padding-bottom:24px}}

/* ─── header ─── */
.sh-head{background:var(--gp);color:#fff;padding:24px 16px 20px}
.sh-head-in{max-width:1100px;margin:0 auto}
.sh-head h1{font-family:var(--font-heading),sans-serif;font-size:26px;font-weight:800;line-height:1.15;margin:8px 0 4px;letter-spacing:-.02em}
#sh-greet{font-family:var(--font-heading),sans-serif;font-size:15px;font-weight:700;color:#fff;margin:0 0 2px}
#sh-subhead{color:rgba(255,255,255,.72);font-size:14px;line-height:1.6;margin:0}
/* Default (light-background) look, used on the Progress tab. The header
   uses the same class on a dark band, so .sh-head overrides the colours
   below rather than this rule assuming one background everywhere. */
.sh-account-note{margin-top:12px;background:var(--gl);border:1.5px solid var(--gm);border-radius:12px;padding:14px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.sh-account-note p{margin:0;flex:1;min-width:200px;font-size:13px;line-height:1.6;color:var(--t)}
.sh-account-note .btn{flex-shrink:0}
.sh-head .sh-account-note{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.16)}
.sh-head .sh-account-note p{color:rgba(255,255,255,.82);font-size:12.5px}
.sh-head .sh-account-note .btn.bg2{background:#fff;color:var(--gd)}
.sh-head .sh-account-note .btn.bg2:hover{background:rgba(255,255,255,.9)}

/* ─── quick actions: one-handed, thumb-sized ─── */
.sh-quick{display:grid;grid-template-columns:1fr;gap:8px;margin-top:16px}
.sh-quick button{width:100%;min-height:48px;justify-content:center}

/* ─── tabs ─── */
/* Phone gets the fixed bottom bar; desktop gets this strip. Showing both
   at once was redundant and the fixed bar overlapped the strip. */
.sh-tabs{display:none;position:sticky;top:0;z-index:20;background:var(--ba);border-bottom:1px solid var(--gb);backdrop-filter:none;box-shadow:none;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.sh-tabs::-webkit-scrollbar{display:none}
.sh-tablist{display:flex;gap:2px;max-width:1100px;margin:0 auto;padding:0 8px;min-width:max-content}
.sh-tablist [role=tab]{flex:0 0 auto;border:none;background:none;font-family:inherit;font-size:13.5px;font-weight:700;color:var(--tm);padding:14px 12px;cursor:pointer;border-bottom:2.5px solid transparent;white-space:nowrap}
.sh-tablist [role=tab]:hover{color:var(--t)}
.sh-tablist [role=tab].active{color:var(--gd);border-bottom-color:var(--g)}
.sh-tablist [role=tab]:focus-visible{outline:3px solid rgba(67,133,90,.42);outline-offset:-3px;border-radius:6px}

/* ─── panels + tool cards ─── */
.sh-main{max-width:1100px;margin:0 auto;padding:20px 16px 96px}
.sh-panel[hidden]{display:none}
.sh-section-title{font-family:var(--font-heading),sans-serif;font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--tl);margin:26px 0 10px}
.sh-section-title:first-child{margin-top:0}
.sh-tool{background:#fff;border:1.5px solid var(--gb);border-radius:16px;padding:16px;margin-bottom:14px}
.sh-tool>h3{font-family:var(--font-heading),sans-serif;font-size:16px;font-weight:800;color:var(--t);margin:0 0 4px}
.sh-tool>p.sh-tool-desc{color:var(--tm);font-size:13.5px;line-height:1.6;margin:0 0 14px}

/* ─── forms: 16px inputs so iOS never zooms on focus ─── */
.sh-fields{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:12px}
.sh-field label{display:block;font-size:12px;font-weight:700;color:var(--t);margin-bottom:5px}
.sh-field select,.sh-field input,.sh-field textarea{width:100%;font-family:inherit;font-size:16px;color:var(--t);background:#fff;border:1.5px solid var(--gb);border-radius:10px;padding:11px 12px;min-height:46px}
.sh-field textarea{min-height:78px;line-height:1.6;resize:vertical}
.sh-field select:focus,.sh-field input:focus,.sh-field textarea:focus{outline:none;border-color:var(--g);box-shadow:0 0 0 3px rgba(67,133,90,.16)}
.sh-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.sh-actions .btn{min-height:44px}

/* ─── generated output ─── */
.sh-out{display:none;margin-top:14px}
.sh-out.show{display:block}
.sh-kicker{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.sh-badge{background:var(--g);color:#fff;border-radius:999px;padding:5px 12px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.sh-meta{color:var(--tl);font-size:11.5px;font-weight:700}
.sh-out-title{font-family:var(--font-heading),sans-serif;font-weight:800;font-size:19px;line-height:1.2;margin:0 0 8px;color:var(--t)}
.sh-lead{color:var(--tm);font-size:13.5px;line-height:1.7;margin:0 0 12px}
.sh-note{color:var(--tl);font-size:12.5px;line-height:1.6;margin:0 0 12px;font-style:italic}
.sh-boxes{display:grid;grid-template-columns:1fr;gap:10px}
.sh-box{background:var(--ba);border:1px solid var(--gb);border-radius:12px;padding:12px 14px}
.sh-box h4{font-family:var(--font-heading),sans-serif;font-size:12.5px;font-weight:800;margin:0 0 7px;color:var(--t)}
.sh-box ul,.sh-box ol{padding-left:17px;margin:0;color:var(--tm);font-size:13px;line-height:1.7}
.sh-box p{color:var(--tm);font-size:13px;line-height:1.7;margin:0}
.sh-q{font-weight:700;color:var(--t)!important}
.sh-blank{color:var(--gm)!important;letter-spacing:.04em;margin-top:6px!important}
.sh-disclaimer{margin-top:14px;padding-top:12px;border-top:1px dashed var(--gb);color:var(--tl);font-size:11.5px;line-height:1.6}

/* ─── loading / empty / error ─── */
.sh-state{border-radius:12px;padding:16px;text-align:center;font-size:13.5px;line-height:1.6}
.sh-loading{background:var(--ba);color:var(--tm);display:flex;align-items:center;justify-content:center;gap:9px}
.sh-spinner{width:15px;height:15px;border:2.5px solid var(--gm);border-top-color:var(--g);border-radius:50%;display:inline-block;animation:sh-spin .7s linear infinite}
@keyframes sh-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.sh-spinner{animation-duration:2s}}
.sh-empty{background:var(--gl);color:var(--tm);border:1px dashed var(--gm)}
.sh-empty p{margin:0 0 12px}
/* Error state is never colour-alone: it carries a ⚠ marker and a border. */
.sh-error{background:#fff1f1;border:1.5px solid #fca5a5;color:#9f1239;text-align:left}
.sh-error p{margin:0 0 10px;font-weight:600}
.sh-error p::before{content:'\26A0\FE0F  ';}

/* ─── revision sprint ─── */
.sh-schedule{list-style:none;padding:0;margin:0 0 12px;display:grid;gap:8px;counter-reset:none}
.sh-schedule li{display:grid;grid-template-columns:82px 1fr;gap:4px 12px;background:var(--ba);border:1px solid var(--gb);border-radius:11px;padding:11px 13px}
.sh-sched-time{grid-row:span 2;font-size:11.5px;font-weight:800;color:var(--gd);align-self:start;padding-top:2px}
.sh-schedule strong{font-family:var(--font-heading),sans-serif;font-size:13.5px;color:var(--t)}
.sh-schedule span:not(.sh-sched-time){font-size:12.5px;color:var(--tm);line-height:1.6}
.sh-timer{display:none;margin-top:12px;background:var(--gp);color:#fff;border-radius:12px;padding:14px;text-align:center;font-family:var(--font-heading),sans-serif;font-size:22px;font-weight:800;font-variant-numeric:tabular-nums}
.sh-timer.show{display:block}

/* ─── flashcards ─── */
.sh-card{background:var(--gl);border:1.5px solid var(--gm);border-radius:14px;padding:20px 16px;text-align:center;min-height:130px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.sh-card-q{font-family:var(--font-heading),sans-serif;font-size:16px;font-weight:800;color:var(--t);margin:0;line-height:1.35}
.sh-card-a{font-size:13.5px;color:var(--tm);line-height:1.7;margin:0}

/* ─── quick reference ─── */
.sh-refs{display:grid;grid-template-columns:1fr;gap:10px}
.sh-ref{background:var(--ba);border:1px solid var(--gb);border-radius:12px;padding:13px 14px}
.sh-ref-name{font-family:var(--font-heading),sans-serif;font-size:15px;font-weight:800;color:var(--gd)}
.sh-ref-full{font-size:11.5px;font-weight:700;color:var(--t);text-transform:uppercase;letter-spacing:.03em;margin:3px 0 5px;line-height:1.5}
.sh-ref-use{font-size:12.5px;color:var(--tm);margin:0;line-height:1.6}

/* ─── progress ─── */
.sh-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin-bottom:16px}
.sh-stat{background:#fff;border:1.5px solid var(--gb);border-radius:13px;padding:14px 12px;text-align:center}
.sh-stat-n{display:block;font-family:var(--font-heading),sans-serif;font-size:26px;font-weight:800;color:var(--g);line-height:1}
.sh-stat-l{display:block;font-size:11.5px;color:var(--tm);margin-top:4px;font-weight:600}
.sh-activity{list-style:none;padding:0;margin:0;display:grid;gap:7px}
.sh-activity li{display:flex;align-items:center;gap:9px;flex-wrap:wrap;background:#fff;border:1px solid var(--gb);border-radius:11px;padding:11px 13px;font-size:13px}
.sh-act-kind{font-weight:800;color:var(--t)}
.sh-act-topic{color:var(--tm)}
.sh-activity time{margin-left:auto;color:var(--tl);font-size:11.5px;font-weight:700}
.sh-reflection{background:#fff;border:1.5px solid var(--gb);border-radius:13px;padding:14px;margin-bottom:10px}
.sh-reflection h4{font-family:var(--font-heading),sans-serif;font-size:13px;font-weight:800;color:var(--gd);margin:0 0 9px}
.sh-reflection dl{margin:0}
.sh-reflection dt{font-size:11.5px;font-weight:800;color:var(--t);margin-top:8px}
.sh-reflection dd{margin:2px 0 0;font-size:13px;color:var(--tm);line-height:1.65}
.sh-status{margin-top:10px;font-size:13px;font-weight:600;color:var(--tm)}
.sh-status-ok{color:var(--gd)}
.sh-status-ok::before{content:'\2713  '}
.sh-status-warn{color:#9a5b00}
.sh-status-warn::before{content:'\26A0\FE0F  '}

/* ─── phase cards on the overview ─── */
.sh-phases{display:grid;grid-template-columns:1fr;gap:12px}
.sh-phase{background:#fff;border:1.5px solid var(--gb);border-radius:16px;padding:16px;text-align:left;font-family:inherit;cursor:pointer;width:100%;transition:border-color .15s,box-shadow .15s}
.sh-phase:hover{border-color:var(--gm);box-shadow:var(--shadow-sm)}
.sh-phase:focus-visible{outline:3px solid rgba(67,133,90,.42);outline-offset:2px}
.sh-phase-when{display:inline-block;background:var(--gl);color:var(--gd);font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;padding:4px 10px;border-radius:999px;margin-bottom:8px}
.sh-phase h3{font-family:var(--font-heading),sans-serif;font-size:16px;font-weight:800;color:var(--t);margin:0 0 5px}
.sh-phase p{color:var(--tm);font-size:13px;line-height:1.6;margin:0 0 9px}
.sh-phase ul{margin:0;padding-left:17px;color:var(--tl);font-size:12.5px;line-height:1.75}

/* ─── mobile bottom bar: primary navigation on a phone ─── */
/* site.css styles the bare `nav` element as the sticky site header:
   nav{position:sticky;top:0;...}. This is also a <nav>, so it inherits that
   rule's `top:0` -- and `position:fixed` + `top:0` + `bottom:0` stretched the
   bar over the whole viewport as an invisible overlay that swallowed every
   click on the page. `top:auto` is load-bearing, not tidying; the rest undoes
   the site-header chrome that leaks in the same way. */
.sh-bottom{position:fixed;top:auto;bottom:0;left:0;right:0;z-index:30;background:#fff;border-top:1px solid var(--gb);border-bottom:none;backdrop-filter:none;display:flex;padding:6px 4px calc(6px + env(safe-area-inset-bottom));box-shadow:0 -3px 14px rgba(20,30,22,.07)}
.sh-bottom button{flex:1;border:none;background:none;font-family:inherit;font-size:10.5px;font-weight:700;color:var(--tm);padding:6px 2px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:3px;border-radius:9px;min-height:48px;justify-content:center}
.sh-bottom button .ico{width:19px;height:19px}
.sh-bottom button.active{color:var(--gd);background:var(--gl)}
.sh-bottom button:focus-visible{outline:3px solid rgba(67,133,90,.42);outline-offset:-3px}

/* ─── wider screens ─── */
@media(min-width:600px){
  .sh-quick{grid-template-columns:repeat(3,1fr)}
  .sh-fields{grid-template-columns:repeat(2,1fr)}
  .sh-boxes{grid-template-columns:repeat(2,1fr)}
  .sh-box.full{grid-column:1/-1}
  .sh-stats{grid-template-columns:repeat(5,1fr)}
  .sh-refs{grid-template-columns:repeat(2,1fr)}
  .sh-phases{grid-template-columns:repeat(3,1fr)}
}
@media(min-width:900px){
  .sh-head{padding:40px 20px 32px}
  .sh-head h1{font-size:34px}
  .sh-main{padding:28px 20px 48px}
  .sh-tool{padding:20px}
  .sh-refs{grid-template-columns:repeat(3,1fr)}
  .sh-tabs{display:block}
  .sh-bottom{display:none}
}

/* The shared consent banner is position:fixed at bottom:16px with z-index:998
   and inline styles, so on a phone it lands squarely on top of the hub's
   bottom navigation and blocks it until dismissed. Lift it clear of the bar.
   !important is required: the banner's own styles are inline. */
@media(max-width:899px){
  #pl-consent-banner{bottom:74px !important}
}

/* An inline control that reads as a link inside a sentence. Must be a
   <button> (it changes a tab, it does not go to a URL), so the browser's
   default button chrome has to be stripped back off. */
.sh-linkbtn{background:none;border:none;padding:0;font:inherit;color:var(--gd);font-weight:700;text-decoration:underline;cursor:pointer}
.sh-linkbtn:hover{color:var(--g)}
.sh-linkbtn:focus-visible{outline:3px solid rgba(67,133,90,.42);outline-offset:2px;border-radius:4px}

/* Reflections describe real jobs and are written to the student's account
   when signed in -- this is the one thing standing between "reflective
   practice" and an accidental patient-data record, so it is not styled as
   a passing hint. Amber, not red: this is a reminder, not an error. */
.sh-warn{background:#fff8e6;border:1.5px solid #f2c94c;border-radius:12px;padding:12px 14px;font-size:13px;line-height:1.6;color:#6b5200;margin-bottom:14px}
.sh-warn strong{color:#4a3800}
/* Shown/hidden via the `hidden` attribute alone (toggled in JS), not a
   class -- one mechanism, so there is nothing for the two to disagree on. */
.sh-warn-inline{background:#fff8e6;border:1.5px solid #f2c94c;border-radius:10px;padding:11px 13px;font-size:12.5px;line-height:1.6;color:#6b5200;margin-top:10px}
