/* Smart Practice and the My Study coach: mode picker, insights, section cards and the mastery tree.
   Mobile first; nothing here may widen the page beyond a 375 px screen. */
.smart-page .split>*{min-width:0}
.mode-picker{border:0;margin:0 0 4px;padding:0;min-width:0}
.mode-list{display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.portal .mode-card{display:flex;gap:10px;align-items:flex-start;margin:0;padding:10px 12px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:#fff;cursor:pointer;font-weight:400}
.mode-card:has(input:checked){border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-wash)}
.mode-card input{margin-top:4px;flex:none;accent-color:var(--primary)}
.mode-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.mode-body strong{color:var(--ink);font-size:14px;line-height:1.35}
.mode-options{display:grid;gap:0 12px;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.mode-options>[hidden]{display:none}
.small-button{padding:4px 10px!important;min-height:0!important;font-size:13px!important;font-weight:650}
.insight-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.insight{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:var(--radius-sm);border:1px solid var(--line);background:#fff}
.insight>span{flex:1 1 260px;min-width:0}
.insight-warn{border-left:4px solid var(--warning)}
.insight-info{border-left:4px solid var(--info)}
.section-cards{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.section-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;min-width:0}
.section-card h3{margin:0 0 4px}
.section-card .level{font-weight:650;color:var(--ink);margin-bottom:6px}
.section-card .meter{min-width:0;margin-bottom:6px}
.section-card .small{margin:0 0 4px}
.mastery-tree{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.mt-head,.mt-cells{display:grid;grid-template-columns:minmax(0,2.2fr) 104px minmax(110px,1.2fr) 76px 64px 82px 150px;gap:10px;align-items:center;padding:8px 12px}
.mt-head{background:var(--soft);font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--line)}
.mt-row{border-bottom:1px solid var(--line)}
.mt-row:last-child{border-bottom:0}
.mt-children .mt-row{border-bottom:0;border-top:1px dashed var(--line)}
.mt-sub>.mt-cells{padding-left:30px;background:#fcfcfe}
.mt-type>.mt-cells{padding-left:52px;background:var(--soft);font-size:14px}
.mt-name{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}
.mt-name strong{color:var(--ink);overflow-wrap:anywhere}
.mt-subject{flex-basis:100%;padding-left:30px;margin-top:-4px}
.mt-toggle{flex:none;width:24px;height:24px;padding:0!important;min-height:0!important;border-radius:6px!important;background:var(--primary-wash)!important;border:1px solid var(--primary-line,#c3d3e5)!important;color:var(--primary-ink)!important;font-size:12px;line-height:1;cursor:pointer}
.mt-toggle-space{flex:none;width:24px}
.mt-meter .meter{min-width:0}
.mt-num,.mt-due{font-variant-numeric:tabular-nums;font-size:14px}
.mt-key{display:none}
.mt-act{justify-self:end}
@media(max-width:860px){
  .mt-head{display:none}
  .mt-cells{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px}
  .mt-name{grid-column:1/3}
  .mt-status{grid-column:3/4;justify-self:end}
  .mt-meter{grid-column:1/-1}
  .mt-num,.mt-due{font-size:13px;color:var(--muted)}
  .mt-key{display:inline}
  .mt-act{grid-column:1/-1;justify-self:start}
  .mt-act:empty{display:none}
  .mt-sub>.mt-cells{padding-left:22px}
  .mt-type>.mt-cells{padding-left:36px}
  .mt-subject{padding-left:30px}
}
/* My Study coach additions */
.coach-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.coach-insights{list-style:none;padding:0;margin:10px 0 0;display:grid;gap:6px}
.coach-insights li{padding:8px 12px;border-radius:var(--radius-sm);background:#fff;border:1px solid var(--line);min-width:0;overflow-wrap:anywhere}

/* Build my test: a step-by-step guide (owner feedback, 16 Oct 2026). Centred dialog on wide screens, full screen on phones. */
.guide-dialog{border:0;padding:0;border-radius:18px;width:calc(100% - 32px);max-width:640px;max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);color:var(--ink);box-shadow:0 20px 50px rgba(11,35,64,.3)}
.guide-dialog[open]{display:flex;flex-direction:column}
.guide-dialog::backdrop{background:rgba(11,35,64,.55)}
.guide-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px 6px}
.guide-head h2{margin:0;font-size:19px;color:var(--primary)}
.portal .guide-icon{width:44px;height:44px;min-height:44px;padding:0;display:flex;align-items:center;justify-content:center;border:0;border-radius:10px;background:transparent;color:var(--primary)}
.portal .guide-icon:hover{background:var(--soft);color:var(--primary)}
.guide-progress{flex:none;display:grid;gap:6px;padding:0 20px}
.guide-progress span{display:block;height:4px;border-radius:2px;background:var(--line)}
.guide-progress span.done{background:var(--accent)}
.guide-dialog .guide-step{flex:none;margin:8px 20px 0;font-size:12.5px;font-weight:700;color:var(--muted)}
.guide-body{flex:1 1 auto;min-height:0;overflow-y:auto;padding:12px 20px 8px}
.guide-question,.guide-body legend.guide-question{display:block;margin:0 0 12px;padding:0;font-size:19px;font-weight:800;color:var(--ink)}
.guide-body fieldset{border:0;margin:0;padding:0;min-width:0}
.guide-body .mode-list{grid-template-columns:1fr}
.guide-body .mode-card{padding:12px 14px;border-radius:12px}
.guide-body .mode-card:has(input:checked){border:2px solid var(--primary);background:var(--primary-wash);box-shadow:none}
.mode-title{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px}
.mode-title strong{font-size:15.5px}
.mode-rec{font-size:11.5px;font-weight:800;color:#7c2d04;background:var(--accent-wash);border:1px solid var(--accent-line);padding:1px 8px;border-radius:999px}
.mode-size{font-size:13px;font-weight:700;color:var(--primary)}
.guide-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.guide-list{display:flex;flex-direction:column;gap:8px}
.portal .guide-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;min-height:60px;padding:12px 14px;border:1px solid var(--line-strong);border-radius:12px;background:#fff;color:var(--ink);text-align:left;font-weight:400}
.portal .guide-card:hover{border-color:var(--primary);background:var(--soft);color:var(--ink)}
.portal .guide-card.is-selected{border:2px solid var(--primary);background:var(--primary-wash)}
.guide-card strong{font-size:15px}
.guide-list .guide-card{flex-direction:row;align-items:center;justify-content:space-between}
.guide-field{margin-top:14px}
.guide-field label{display:block;margin-bottom:6px;font-weight:600}
.guide-summary{margin:0;border:1px solid var(--line);border-radius:12px;padding:2px 14px}
.guide-summary div{display:flex;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.guide-summary div:last-child{border-bottom:0}
.guide-summary dt{color:var(--muted)}
.guide-summary dd{margin:0;font-weight:700;text-align:right}
.guide-status:empty{display:none}
.guide-dialog .guide-status{flex:none;margin:0 20px;color:var(--body)}
.guide-foot{flex:none;padding:12px 20px 18px;border-top:1px solid var(--line)}
.portal .guide-foot button{width:100%;min-height:52px;border-radius:12px;font-size:16px;font-weight:800}
.portal .guide-next:disabled{background:#94a3b8;border-color:#94a3b8;color:#fff;cursor:not-allowed}
.portal .guide-start{background:var(--accent-ink);border-color:var(--accent-ink);color:#fff}
@media(max-width:640px){
  .guide-dialog{width:100%;max-width:none;height:100%;max-height:none;margin:0;border-radius:0}
  .guide-foot{padding-bottom:calc(16px + env(safe-area-inset-bottom))}
}
@media(min-width:760px){
  .guide-dialog{max-width:760px}
  .guide-body .mode-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Check-and-start fits without scrolling (student feedback, 17 Oct 2026): summary as two-column tiles,
   timing and language as compact two-option switches side by side. */
.guide-dialog .guide-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0;border:0}
.guide-dialog .guide-summary div{flex-direction:column;align-items:flex-start;gap:2px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.guide-dialog .guide-summary div:last-child{border-bottom:1px solid var(--line)}
.guide-dialog .guide-summary dt{font-size:12px}
.guide-dialog .guide-summary dd{text-align:left;font-size:14.5px;line-height:1.35}
.guide-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.seg{margin:0;padding:0;border:0;min-width:0}
.seg legend{padding:0;margin-bottom:6px;font-size:13px;font-weight:700;color:var(--ink)}
.seg{display:flex;flex-wrap:wrap}
.seg legend{flex-basis:100%}
.seg label{flex:1 1 0;margin:0;min-width:0}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg span{display:flex;align-items:center;justify-content:center;min-height:42px;padding:0 10px;border:1px solid var(--line-strong);background:#fff;font-size:14px;font-weight:600;color:var(--body);text-align:center;cursor:pointer}
.seg label:first-of-type span{border-radius:10px 0 0 10px}
.seg label:last-of-type span{border-radius:0 10px 10px 0;border-left:0}
.seg input:checked+span{background:var(--primary);border-color:var(--primary);color:#fff}
.seg input:focus-visible+span{outline:3px solid var(--accent);outline-offset:2px}
.guide-note{margin:10px 0 0!important}
.guide-dialog .guide-question,.guide-body legend.guide-question{margin-bottom:10px}
.portal .guide-card[disabled]{opacity:.55;cursor:not-allowed}
@media(max-width:420px){.guide-options{grid-template-columns:1fr}}
.guide-dialog .guide-summary div:last-child:nth-child(odd){grid-column:1/-1}
