/* Learning Journey dashboard: hero, readiness, Focus next, chapter map and the progress panel.
   Relies on the tokens and tile/stat-card rules already defined in candidate-home.css / site-trial.css. */

.jr-hero{margin-bottom:22px; padding:32px 36px;}
.jr-hero .hero-panel{flex:0 0 260px;}

.jr-card{
  background:var(--paper-raised); border:1px solid var(--line);
  border-radius:16px; box-shadow:var(--shadow); padding:18px 20px; margin-bottom:22px;
}
.jr-card-head{display:flex; align-items:baseline; gap:6px 12px; flex-wrap:wrap; margin-bottom:14px;}
.jr-card-head h2{margin:0; font-family:'Space Grotesk',sans-serif; font-size:1.12rem; font-weight:700; color:var(--ink);}
.jr-card-head p{margin:0; font-size:0.84rem; color:var(--ink-soft); line-height:1.5;}
.jr-empty{margin:0; font-size:0.86rem; color:var(--ink-soft);}
.jr-muted{color:var(--ink-soft); font-size:0.8rem;}

.jr-ready .stat-row{margin:0;}

/* two panes */
.jr-panes{display:flex; flex-wrap:wrap; gap:24px; align-items:flex-start;}
.jr-main{flex:999 1 620px; min-width:0;}
.jr-side{flex:1 1 330px; min-width:0; position:sticky; top:16px;}
.jr-main .jr-card:last-child,.jr-side .jr-card{margin-bottom:0;}
@media(max-width:960px){
  /* One column. Order: syllabus map first (it is what the student should act on), then Focus next, then My progress. */
  .jr-panes{flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:16px;}
  .jr-main{display:contents;}
  #syllabus-map{order:1; margin-bottom:0;}
  #focus{order:2; margin-bottom:0;}
  .jr-side{position:static; order:3; flex:0 0 auto; width:100%;}
  .jr-hero{padding:24px 20px;}
}
/* Phones: shrink the hero, the stats strip and the readiness card so the map is reached quickly. */
@media(max-width:640px){
  .jr-hero{padding:14px 16px; margin-bottom:12px; border-radius:16px;}
  .jr-hero .hero-inner{gap:8px; align-items:center;}
  .jr-hero .hero-text h1{font-size:1.2rem; margin:0 0 4px;}
  .jr-hero p.lede{font-size:.82rem; line-height:1.4; margin:0;}
  .jr-hero .hero-panel{flex:1 1 100%; display:flex; align-items:baseline; gap:8px; padding:6px 12px;}
  .jr-hero .hero-panel-label{font-size:.64rem;}
  .jr-hero .hero-panel-days{margin:0; font-size:.82rem;}
  .jr-hero .hero-panel-days .mono{font-size:1.3rem;}
  .jr-ready{padding:12px; margin-bottom:12px;}
  .jr-ready .jr-card-head{margin-bottom:8px;}
  .jr-ready .jr-card-head h2{font-size:1rem;}
  .jr-ready .jr-card-head p{display:none;}
  .jr-ready .stat-row{grid-template-columns:repeat(3,1fr); gap:6px;}
  .jr-ready .stat-card{padding:8px 8px 10px; border-radius:10px;}
  .jr-ready .stat-card .stat-label{font-size:.58rem; letter-spacing:0; margin-bottom:4px; gap:3px;}
  .jr-ready .stat-card .stat-value{font-size:1.05rem !important; margin:0;}
  .jr-ready .stat-card .ring-inline{gap:6px;}
  .jr-ready .stat-card .ring-inline svg{width:28px; height:28px;}
  .jr-ready .stat-card .stat-link{font-size:.68rem; margin-top:4px;}
  .jr-ready .not-assessed{font-size:.72rem;}
}

/* Focus next */
.jr-focus-list{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px;}
.jr-focus-item{
  display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:12px;
  background:var(--brand-orange-bg); border:1px solid #F3C79F;
}
.jr-focus-dot{width:10px; height:10px; border-radius:50%; flex:none; background:var(--shaky);}
.jr-focus-item.is-weak .jr-focus-dot{background:var(--weak);}
.jr-focus-text{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px;}
.jr-focus-name{font-size:0.95rem; font-weight:700; line-height:1.3; color:var(--ink);}
.jr-focus-sub{font-size:0.74rem; color:var(--ink-soft);}
.jr-focus-item .tag{flex:none; font-size:0.68rem; font-weight:700; padding:2px 8px; border-radius:999px;}

/* map */
.jr-legend-ring{display:inline-block; width:14px; height:10px; border-radius:3px; border:2px solid var(--brand-orange); box-sizing:border-box;}
.tile .tile-no{font-family:'IBM Plex Mono',monospace; font-size:0.7rem; font-weight:600; color:var(--ink-soft); margin-right:6px;}
.tile.is-focus{outline:2px solid var(--brand-orange); outline-offset:1px;}
.tile .focus-badge{
  position:absolute; top:-9px; right:10px; font-size:0.66rem; font-weight:700; letter-spacing:0.02em;
  background:var(--brand-orange-bg); color:#8F4607; border:1px solid var(--brand-orange);
  border-radius:999px; padding:1px 8px;
}
.subject-tabs .count{white-space:nowrap;}

/* progress panel */
.jr-stats{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:14px;}
.jr-stat{background:var(--page-bg); border-radius:12px; padding:12px 14px;}
.jr-stat-big{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:1.5rem; color:var(--ink);}
.jr-stat-lbl{font-size:0.76rem; color:var(--ink-soft); margin-top:2px;}

.jr-fold{border-top:1px solid var(--line); padding:12px 0 4px;}
.jr-fold > summary{
  list-style:none; cursor:pointer; font-size:0.86rem; font-weight:600; color:var(--ink);
  display:flex; align-items:center; justify-content:space-between; min-height:28px; margin-bottom:8px;
}
.jr-fold > summary::-webkit-details-marker{display:none;}
.jr-fold > summary::after{content:"+"; font-weight:600; color:var(--ink-soft); font-size:1rem;}
.jr-fold[open] > summary::after{content:"\2212";}
.jr-fold-note{margin:0 0 8px;}

.jr-cov{display:flex; flex-direction:column; gap:10px; padding-bottom:10px;}
.jr-cov-top{display:flex; justify-content:space-between; font-size:0.78rem; margin-bottom:4px;}
.jr-cov-top .mono{font-family:'IBM Plex Mono',monospace; font-weight:600;}
.jr-cov-track{height:6px; border-radius:3px; background:#E1E7F5; overflow:hidden;}
.jr-cov-track div{height:100%; background:var(--brand-blue); border-radius:3px;}

.jr-due{display:flex; flex-direction:column; gap:8px; padding-bottom:10px;}
.jr-due-row{display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:0.82rem; padding:8px 10px; border-radius:10px; background:var(--brand-orange-bg);}
.jr-due-row small{display:block; font-size:0.7rem; color:var(--ink-soft);}
.jr-due-tag{font-size:0.7rem; font-weight:700; color:#8F4607; flex:none;}

.jr-week-sum{font-size:0.84rem; margin-bottom:10px;}
.jr-week-sum .mono{font-family:'IBM Plex Mono',monospace; font-weight:700; font-size:1.05rem;}
.jr-bars{display:flex; align-items:flex-end; gap:8px; height:72px;}
.jr-bar-col{flex:1; height:100%; display:flex; flex-direction:column; justify-content:flex-end;}
.jr-bar{min-height:3px; background:var(--brand-blue); opacity:.35; border-radius:4px 4px 0 0;}
.jr-bar.is-on{opacity:1;}
.jr-bar-labels{display:flex; gap:8px; margin:6px 0 10px; font-size:0.68rem; color:var(--ink-soft);}
.jr-bar-labels span{flex:1; text-align:center;}

.jr-papers{display:flex; flex-direction:column; gap:8px; padding-bottom:10px;}
.jr-paper{border-radius:10px; background:var(--page-bg); overflow:hidden;}
.jr-paper > summary{
  list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px;
  padding:9px 10px; min-height:44px; box-sizing:border-box; color:var(--ink-soft);
}
.jr-paper > summary::-webkit-details-marker{display:none;}
.jr-paper > summary svg{flex:none; transition:transform .12s ease;}
.jr-paper[open] > summary svg{transform:rotate(90deg);}
.jr-paper-row{display:flex; align-items:center; gap:10px; padding:9px 10px 9px 32px; min-height:44px; box-sizing:border-box;}
.jr-paper-name{flex:1; min-width:0; font-size:0.84rem; font-weight:600; color:var(--ink);}
.jr-paper-name small{display:block; font-size:0.72rem; font-weight:400; color:var(--ink-soft); margin-top:1px;}
.jr-paper-score{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:0.84rem; color:var(--ink);}
.jr-attempts{list-style:none; margin:0; padding:2px 10px 10px 32px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:6px;}
.jr-attempts li{display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-size:0.78rem; padding-top:6px; color:var(--ink-soft);}
.jr-attempts .mono{font-family:'IBM Plex Mono',monospace; font-weight:600; color:var(--ink);}

.jr-links{border-top:1px solid var(--line); padding-top:12px; display:flex; flex-direction:column; gap:8px;}
.jr-links a{font-size:0.82rem; font-weight:600; color:var(--brand-blue); text-decoration:none;}
.jr-links a:hover{text-decoration:underline;}

/* subject tabs: three equal columns, count under the name, never wider than the card */
.jr-card .subject-tabs{display:flex; gap:6px; flex-wrap:nowrap;}
.jr-card .subject-tabs button{
  flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:10px 6px; text-align:center; line-height:1.25;
}
.jr-card .subject-tabs .count{display:block; white-space:normal; font-size:0.68rem; line-height:1.3;}
.jr-card, .jr-main, .jr-side{min-width:0; max-width:100%;}
@media(max-width:520px){
  .jr-card{padding:14px;}
  .jr-card .subject-tabs button{font-size:0.82rem; padding:8px 4px;}
  .jr-card .subject-tabs .count{font-size:0.62rem;}
  .map-grid{grid-template-columns:repeat(auto-fill, minmax(140px,1fr));}
}

/* sample data state of the progress panel */
.jr-sample-tag{position:absolute; top:14px; right:16px; margin:0; padding:3px 10px; border-radius:999px; font-size:.7rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; background:var(--brand-orange); color:#fff;}
.jr-sample-note{display:flex; flex-direction:column; gap:2px; margin:0 0 14px; padding:12px 14px; border-radius:12px; background:var(--brand-orange-bg); border:2px dashed var(--brand-orange); color:#8F4607; font-size:.84rem; line-height:1.45;}
.jr-sample-note strong:first-child{font-size:.95rem; color:#8F4607;}
.jr-side.is-sample .jr-side-card{border:2px dashed var(--brand-orange);}
.jr-side.is-sample .jr-stats,.jr-side.is-sample .jr-trend,.jr-side.is-sample .jr-fold,.jr-side.is-sample .jr-papers{opacity:.78;}

.jr-ready.is-sample{border:2px dashed var(--brand-orange);}
.jr-ready.is-sample .stat-row{opacity:.8;}
.jr-ready .jr-sample-note{margin:0 0 14px;}
.jr-card.is-sample .jr-card-head{padding-right:112px;}
#focus.is-sample{border:2px dashed var(--brand-orange);}
#focus.is-sample .jr-focus-list{opacity:.85;}
@media(max-width:520px){.jr-sample-tag{top:12px; right:12px; font-size:.64rem;}.jr-card.is-sample .jr-card-head{padding-right:96px;}}
.jr-card{position:relative;}

.jr-all-papers{display:block; width:100%; margin:0 0 10px; padding:.55rem .8rem; border:1px dashed var(--line); border-radius:10px; background:transparent; color:var(--brand-blue,#1B4FA0); font-weight:700; font-size:.82rem; cursor:pointer; text-align:left;}
.jr-all-papers:hover{background:var(--brand-blue-bg,#EAF0FC);}
.jr-pop{position:fixed; inset:0; background:rgba(15,25,60,.55); display:none; align-items:center; justify-content:center; z-index:2000; padding:16px;}
.jr-pop.is-open{display:flex;}
.jr-pop-box{background:#fff; border-radius:16px; width:100%; max-width:520px; max-height:80vh; overflow:auto; padding:22px 22px 14px; position:relative; box-shadow:0 20px 60px rgba(15,25,60,.35); text-align:left;}
.jr-pop-box h3{margin:0 0 6px; font-size:1.05rem; font-weight:800; color:var(--ink,#152238); padding-right:28px;}
.jr-pop-x{position:absolute; top:10px; right:14px; background:none; border:0; font-size:1.4rem; line-height:1; color:var(--ink-soft,#5B6B85); cursor:pointer;}

.jr-help{display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; margin:16px 0 0; padding:12px 18px; background:var(--paper-raised,#fff); border:1px solid var(--line,#DDE3F0); border-radius:14px; font-size:.88rem;}
.jr-help span{font-weight:700; color:var(--ink,#152238);}
.jr-help a{font-weight:700; color:var(--brand-blue,#1B4FA0); text-decoration:none;}
.jr-help a:hover{text-decoration:underline;}
/* Phones: heading and each link on its own row */
@media(max-width:640px){
  .jr-help{flex-direction:column; align-items:stretch; gap:0; padding:10px 16px;}
  .jr-help span{padding:2px 0 8px; font-size:.84rem;}
  .jr-help a{display:block; padding:10px 0; border-top:1px solid var(--line,#DDE3F0); font-size:.88rem;}
}
