/* Classmate R2.8.3.9.64 — teacher mobile marks-entry and More sheet.
   Scope: authenticated teacher dashboard, marks screen, mobile More portal.
   Public landing and approved desktop composition are intentionally untouched. */
.cm64-mobile-actions{display:none}
.cm64-progress{display:none;

  margin:12px 0 15px;padding:13px 15px;border:1px solid #d5e6f1;
  border-radius:13px;background:linear-gradient(120deg,#f1f9fe,#f9fcff);
  color:#123654;
}
.cm64-progress-head,.cm64-progress-foot{display:flex;justify-content:space-between;gap:10px;align-items:center}
.cm64-progress-head{font-size:13px;font-weight:800}
.cm64-progress-head>span{color:#006d91;font-variant-numeric:tabular-nums}
.cm64-progress-track{height:7px;overflow:hidden;background:#d9e9f2;border-radius:999px;margin:10px 0}
.cm64-progress-track>span{display:block;height:100%;background:linear-gradient(90deg,#087eac,#19a3bb);border-radius:inherit;transition:width .16s ease}
.cm64-progress-foot{font-size:11px;line-height:1.4;color:#456277}
.cm64-progress-foot>span:last-child{text-align:right}
.cm64-learner-name strong{font-weight:800}
.cm64-learner-name small{display:block;font-size:11px;color:#61758a}
.cm64-comment-disclosure{display:contents}
.cm64-comment-disclosure>summary{display:none}
.cm64-comment-disclosure input{box-sizing:border-box}
.cm64-marks-table input:focus-visible,.cm64-marks-table select:focus-visible,
.cm64-mobile-actions button:focus-visible,.cm-mobile-more-sheet button:focus-visible{
  outline:3px solid #2c98d8;outline-offset:2px;
}
@media (max-width:767px){
  /* Keep More as a compact body-level portal; override legacy edge-to-edge rules. */
  .cm-mobile-more-sheet{
    left:50%!important;right:auto!important;
    width:calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right))!important;
    max-width:420px!important;min-width:0!important;
    transform:translateX(-50%)!important;-webkit-transform:translateX(-50%)!important;
    box-sizing:border-box!important;
    border-radius:17px!important;padding:10px!important;
  }
  .cm-mobile-more-sheet .nav button{
    min-width:0!important;max-width:100%!important;
    min-height:44px!important;height:auto!important;
    padding:8px!important;
  }
  .cm-mobile-more-sheet .nav button .nav-label{
    white-space:normal!important;overflow-wrap:anywhere!important;
  }
  /* Teacher home: first job is entering marks. */
  .cm64-teacher-workspace .saas-hero{
    padding:16px!important;gap:12px!important;
  }
  .cm64-teacher-workspace .saas-hero h2{font-size:clamp(21px,6vw,27px)!important;line-height:1.2!important}
  .cm64-teacher-workspace .saas-hero p{font-size:13px!important;line-height:1.45!important}
  .cm64-teacher-workspace .saas-hero-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;margin-top:12px!important;
  }
  .cm64-teacher-workspace .saas-hero-actions>.btn:first-child{
    grid-column:1/-1!important;min-height:52px!important;
    background:linear-gradient(120deg,#087da8,#005c83)!important;
    color:#fff!important;font-size:15px!important;font-weight:850!important;
    box-shadow:0 8px 20px rgba(3,91,129,.16)!important;
  }
  .cm64-teacher-workspace .saas-hero-actions>.btn:not(:first-child){
    min-width:0!important;min-height:43px!important;
    font-size:12px!important;padding:8px!important;
  }
  .cm64-teacher-workspace .saas-signal-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }
  .cm64-teacher-workspace .saas-content-grid{display:flex!important;flex-direction:column!important;gap:12px!important}
  .cm64-teacher-workspace .saas-content-grid>.saas-panel:nth-child(2){order:-1}
  .cm64-teacher-workspace .saas-panel{padding:12px!important}
  /* Marks: compact class/subject selector followed by learner cards. */
  #screen-marks{
    min-width:0!important;
    padding-bottom:calc(158px + env(safe-area-inset-bottom))!important;
  }
  #screen-marks>.card{min-width:0!important;padding:13px!important;overflow:visible!important}
  #screen-marks .section-title{margin-bottom:10px!important}
  #screen-marks .section-title h3{font-size:18px!important;line-height:1.24!important}
  #screen-marks .section-title p{font-size:12px!important;line-height:1.45!important}
  #screen-marks .report-ready-strip{display:none!important}
  #screen-marks .form-grid.three-col{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }
  #screen-marks .form-grid.three-col>div{min-width:0!important}
  #screen-marks .form-grid.three-col>div:nth-child(3){grid-column:1/-1}
  #screen-marks .form-grid.three-col>div:nth-child(4){grid-column:1/-1}
  #screen-marks .form-grid.three-col select,
  #screen-marks .form-grid.three-col input{
    width:100%!important;min-width:0!important;max-width:100%!important;
    box-sizing:border-box!important;font-size:14px!important;min-height:44px!important;
  }
  #screen-marks .form-grid.three-col label{font-size:11px!important;line-height:1.35!important}
  #screen-marks .cm64-progress{display:block;padding:12px;margin:9px 0 12px}
  #screen-marks .cm64-progress-foot{flex-wrap:wrap;gap:4px 8px}
  #screen-marks .cm64-progress-foot>span:last-child{text-align:left}
  #screen-marks .list-tools{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;margin:12px 0 8px!important;
  }
  #screen-marks .list-tools .field{min-width:0!important}
  #screen-marks .list-tools input,#screen-marks .list-tools select{
    width:100%!important;min-width:0!important;max-width:100%!important;
    box-sizing:border-box!important;min-height:42px!important;font-size:13px!important;
  }
  #screen-marks .pagination-row{
    display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;
    gap:5px!important;align-items:center!important;margin:9px 0!important;
  }
  #screen-marks .pagination-row .page-info{font-size:10px!important;line-height:1.35!important;text-align:center!important}
  #screen-marks .pagination-row .btn{padding:7px 9px!important;font-size:11px!important;min-height:38px!important}
  #screen-marks .cm64-marks-wrap{
    width:100%!important;max-width:100%!important;overflow:visible!important;
    border:0!important;background:transparent!important;box-shadow:none!important;
  }
  #screen-marks .cm64-marks-table{
    display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;
    table-layout:auto!important;border:0!important;background:transparent!important;
  }
  #screen-marks .cm64-marks-table thead{
    position:absolute!important;width:1px!important;height:1px!important;
    padding:0!important;margin:-1px!important;overflow:hidden!important;
    clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;
  }
  #screen-marks .cm64-marks-table tbody{display:grid!important;gap:10px!important;min-width:0!important}
  #screen-marks .cm64-marks-table tbody tr{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px 11px!important;width:100%!important;min-width:0!important;max-width:100%!important;
    box-sizing:border-box!important;padding:12px!important;
    background:#fff!important;border:1px solid #dbe6ef!important;border-radius:13px!important;
    box-shadow:0 3px 12px rgba(12,52,77,.045)!important;
  }
  #screen-marks .cm64-marks-table tbody tr.cm64-complete{border-left:3px solid #0b9a88!important}
  #screen-marks .cm64-marks-table tbody tr.cm64-invalid{border-left:3px solid #c64b4b!important}
  #screen-marks .cm64-marks-table tbody td{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    justify-content:center!important;gap:4px!important;
    min-width:0!important;width:auto!important;max-width:100%!important;
    padding:0!important;margin:0!important;border:0!important;background:none!important;
    text-align:left!important;white-space:normal!important;overflow:visible!important;
  }
  #screen-marks .cm64-marks-table tbody td::before{
    content:attr(data-label);display:block;font-size:10px;line-height:1.3;
    font-weight:800;color:#58738b;letter-spacing:.025em;
  }
  #screen-marks .cm64-marks-table tbody td.cm64-learner-name{
    grid-column:1/-1!important;border-bottom:1px solid #e8eff5!important;
    padding-bottom:9px!important;display:block!important;
  }
  #screen-marks .cm64-learner-name::before{display:none!important}
  #screen-marks .cm64-learner-name strong{
    display:block;font-size:14px;line-height:1.35;color:#153956;overflow-wrap:anywhere;
  }
  #screen-marks .cm64-learner-name small{font-size:10px;overflow-wrap:anywhere}
  #screen-marks .cm64-marks-table tbody td input,
  #screen-marks .cm64-marks-table tbody td select{
    box-sizing:border-box!important;display:block!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    min-height:43px!important;margin:0!important;padding:8px 10px!important;
    font-size:14px!important;border-radius:9px!important;
  }
  #screen-marks .cm64-marks-table tbody td.cm64-mark-cell input{
    font-size:20px!important;font-weight:800!important;font-variant-numeric:tabular-nums!important;
  }
  #screen-marks .cm64-marks-table tbody td.cm64-grade-cell,
  #screen-marks .cm64-marks-table tbody td.cm64-points-cell{
    padding:4px 8px!important;background:#f2f7fa!important;border-radius:8px!important;
    min-height:44px!important;
  }
  #screen-marks .cm64-grade-cell span,#screen-marks .cm64-points-cell span{
    font-size:15px;font-weight:850;color:#17445f;
  }
  #screen-marks .cm64-marks-table tbody td.cm64-comment-cell{grid-column:1/-1!important}
  #screen-marks .cm64-comment-cell::before{display:none!important}
  #screen-marks .cm64-comment-disclosure{
    display:block!important;width:100%!important;min-width:0!important;
    border:1px solid #e1eaf0;border-radius:9px;overflow:hidden;
  }
  #screen-marks .cm64-comment-disclosure>summary{
    display:list-item!important;cursor:pointer;padding:9px 12px;
    color:#1c5876;background:#f6f9fc;font-size:12px;font-weight:800;
  }
  #screen-marks .cm64-comment-disclosure[open]>summary{border-bottom:1px solid #e1eaf0}
  #screen-marks .cm64-comment-disclosure>input{
    margin:8px!important;width:calc(100% - 16px)!important;
    max-width:calc(100% - 16px)!important;
  }
  #screen-marks .cm64-secondary-action{margin-top:7px!important;font-size:12px!important}
  #screen-marks .cm64-desktop-save,#screen-marks .cm64-desktop-submit{display:none!important}
  #screen-marks .cm64-mobile-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;position:fixed!important;
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:calc(87px + env(safe-area-inset-bottom))!important;
    z-index:1100!important;
    background:#fff!important;border:1px solid #d6e6ef!important;
    border-radius:13px!important;padding:8px!important;
    box-shadow:0 8px 26px rgba(9,48,72,.14)!important;
  }
  #screen-marks .cm64-mobile-actions>.btn{
    min-width:0!important;min-height:46px!important;
    padding:8px!important;line-height:1.3!important;font-size:12px!important;
    white-space:normal!important;
  }
  #screen-marks .cm64-mobile-actions>.btn:only-child{grid-column:1/-1}
  body.cm-mobile-nav-open #screen-marks .cm64-mobile-actions{display:none!important}
}
@media (max-width:360px){
  #screen-marks>.card{padding:10px!important}
  #screen-marks .cm64-marks-table tbody tr{padding:10px!important;gap:8px!important}
  #screen-marks .cm64-marks-table tbody td select{font-size:12px!important;padding-inline:6px!important}
  #screen-marks .cm64-mobile-actions{left:7px!important;right:7px!important}
}
@media (prefers-reduced-motion:reduce){
  .cm64-progress-track>span{transition:none!important}
}
@media print{
  .cm64-mobile-actions{display:none!important}
  .cm64-comment-disclosure{display:block}
  .cm64-comment-disclosure>summary{display:none}
}

/* Final Stability Patch 4: only the Marks screen needs viewport-fixed action positioning.
   Disable layout containment in this one active mobile workspace; do not change other
   screens or desktop rendering. The original Save/Submit controls remain in place. */
@media (max-width:767px){
  #platformApp:has(#screen-marks.active){contain:style!important}
}
