/* YENTUMI Gradebook Enterprise — Professional Staff Mobile Result Entry UI
   Step 5.44 / Release 2026.08.28.049
   CSS-only presentation layer. No result-entry business logic is changed. */

@media (max-width:800px){
  /* Keep the result workspace calm, compact and clear on phones. */
  body.enterprise-shell-v3 .result-entry-panel{
    padding:14px!important;
    border-radius:20px!important;
    overflow:visible!important;
  }

  body.enterprise-shell-v3 .result-entry-intro{
    display:grid!important;
    gap:12px!important;
    margin:0 0 14px!important;
  }
  body.enterprise-shell-v3 .result-entry-intro h2{
    margin:4px 0 6px!important;
    font-size:26px!important;
    line-height:1.08!important;
    letter-spacing:-.025em!important;
  }
  body.enterprise-shell-v3 .result-entry-intro p{
    max-width:36rem!important;
    font-size:14px!important;
    line-height:1.55!important;
  }
  body.enterprise-shell-v3 .result-context-kicker{
    font-size:10px!important;
    letter-spacing:.14em!important;
  }

  /* Formula is useful, but it should behave like a compact reference strip. */
  body.enterprise-shell-v3 .result-formula{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    margin:0!important;
  }
  body.enterprise-shell-v3 .result-formula span{
    min-width:0!important;
    min-height:64px!important;
    padding:10px 12px!important;
    border-radius:15px!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    background:var(--gb-surface-soft,#f7f9fc)!important;
    color:var(--gb-muted,#66788d)!important;
    box-shadow:none!important;
    font-size:12px!important;
    line-height:1.25!important;
  }
  body.enterprise-shell-v3 .result-formula b{
    font-size:14px!important;
    color:var(--gb-text,#102a43)!important;
  }

  /* Scoring progress / search: one intentional mobile control surface. */
  body.enterprise-shell-v3 .result-mobile-toolbar{
    display:grid!important;
    gap:12px!important;
    margin:2px 0 14px!important;
    padding:13px!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    border-radius:18px!important;
    background:var(--gb-surface-soft,#f7f9fc)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.55)!important;
  }
  body.enterprise-shell-v3 .result-progress{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    gap:3px 10px!important;
    align-items:center!important;
  }
  body.enterprise-shell-v3 .result-progress>span{
    font-size:11px!important;
    font-weight:900!important;
    letter-spacing:.09em!important;
    text-transform:uppercase!important;
    color:var(--gb-muted,#66788d)!important;
  }
  body.enterprise-shell-v3 .result-progress>small{
    font-size:13px!important;
    line-height:1.3!important;
    color:var(--gb-muted,#66788d)!important;
  }
  body.enterprise-shell-v3 .result-progress>strong{
    grid-column:2!important;
    grid-row:1/3!important;
    align-self:center!important;
    min-width:74px!important;
    padding:8px 10px!important;
    border-radius:14px!important;
    background:var(--gb-surface,#fff)!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    color:var(--gb-text,#102a43)!important;
    font-size:21px!important;
    line-height:1!important;
    text-align:center!important;
    letter-spacing:-.03em!important;
  }
  body.enterprise-shell-v3 .result-progress>strong b{
    color:var(--gb-brand-strong,var(--school-accent-dark,#1455b8))!important;
  }

  body.enterprise-shell-v3 .result-mobile-tools{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(122px,auto)!important;
    gap:9px!important;
    align-items:end!important;
  }
  body.enterprise-shell-v3 .score-search{
    display:grid!important;
    gap:6px!important;
    min-width:0!important;
    margin:0!important;
  }
  body.enterprise-shell-v3 .score-search>span{
    font-size:12px!important;
    font-weight:800!important;
    color:var(--gb-muted,#66788d)!important;
  }
  body.enterprise-shell-v3 .score-search input{
    width:100%!important;
    min-width:0!important;
    min-height:50px!important;
    height:50px!important;
    padding:10px 13px!important;
    border-radius:14px!important;
    background:var(--gb-surface,#fff)!important;
    border:1px solid var(--gb-line-strong,#c8d4e1)!important;
    font-size:16px!important;
    text-overflow:ellipsis!important;
  }
  body.enterprise-shell-v3 .result-mobile-tools button{
    width:100%!important;
    min-height:50px!important;
    height:50px!important;
    padding:8px 13px!important;
    border-radius:14px!important;
    font-size:13px!important;
    font-weight:850!important;
    white-space:nowrap!important;
  }

  /* Learner list becomes a compact series of professional data-entry cards. */
  body.enterprise-shell-v3 .result-score-wrap{
    overflow:visible!important;
    border:0!important;
    background:transparent!important;
    padding:0!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    border:0!important;
    background:transparent!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tbody{
    display:grid!important;
    width:100%!important;
    gap:12px!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-learner-row{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-areas:
      "learner learner"
      "class exam"
      "contribution total"
      "remark remark"
      "absent absent"!important;
    gap:11px!important;
    width:100%!important;
    margin:0!important;
    padding:14px!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    border-radius:21px!important;
    background:var(--gb-surface,#fff)!important;
    box-shadow:0 7px 22px rgba(16,42,67,.07)!important;
    overflow:hidden!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-complete{
    border-color:color-mix(in srgb,var(--school-accent,#2563eb) 30%,var(--gb-line,#dce5ef))!important;
    box-shadow:0 7px 22px rgba(16,42,67,.07),inset 3px 0 0 color-mix(in srgb,var(--school-accent,#2563eb) 62%,transparent)!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-absent{
    border-color:#e7b3aa!important;
    background:#fffafa!important;
    box-shadow:inset 3px 0 0 #d85b4b!important;
  }

  body.enterprise-shell-v3 table.result-score-table.mobile-card-table td{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:0!important;
    border:0!important;
    text-align:left!important;
    white-space:normal!important;
    overflow:visible!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table td::before{
    display:block!important;
    margin:0 0 6px!important;
    color:var(--gb-muted,#66788d)!important;
    font-size:10px!important;
    font-weight:900!important;
    line-height:1.2!important;
    letter-spacing:.08em!important;
    text-transform:uppercase!important;
  }

  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-learner-cell{
    grid-area:learner!important;
    padding:0 0 11px!important;
    border-bottom:1px solid var(--gb-line,#e5ebf1)!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-learner-cell::before{display:none!important}
  body.enterprise-shell-v3 .score-learner-identity{
    display:grid!important;
    grid-template-columns:28px 48px minmax(0,1fr)!important;
    gap:10px!important;
    align-items:center!important;
    min-width:0!important;
  }
  body.enterprise-shell-v3 .score-row-number{
    display:grid!important;
    place-items:center!important;
    width:28px!important;
    height:28px!important;
    border-radius:9px!important;
    background:var(--gb-surface-soft,#f4f7fb)!important;
    color:var(--gb-muted,#66788d)!important;
    font-size:11px!important;
    font-weight:900!important;
  }
  body.enterprise-shell-v3 .score-learner-avatar{
    display:grid!important;
    place-items:center!important;
    width:48px!important;
    height:48px!important;
    border-radius:15px!important;
    background:var(--gb-brand-soft,#eaf2ff)!important;
    color:var(--gb-brand-strong,var(--school-accent-dark,#1455b8))!important;
    font-size:15px!important;
    font-weight:900!important;
    letter-spacing:.02em!important;
  }
  body.enterprise-shell-v3 .score-learner-identity>div{min-width:0!important}
  body.enterprise-shell-v3 .score-learner-identity b{
    display:block!important;
    margin:0!important;
    font-size:18px!important;
    line-height:1.18!important;
    letter-spacing:-.015em!important;
    color:var(--gb-text,#102a43)!important;
    overflow-wrap:break-word!important;
  }
  body.enterprise-shell-v3 .score-learner-identity small{
    display:block!important;
    margin:4px 0 0!important;
    color:var(--gb-muted,#66788d)!important;
    font-size:12px!important;
    line-height:1.3!important;
  }

  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-class-cell{grid-area:class!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-exam-cell{grid-area:exam!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-contribution-cell{grid-area:contribution!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-total-cell{grid-area:total!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-remark-cell{grid-area:remark!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-absent-cell{grid-area:absent!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-class-cell::before{content:"Class score /50"!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-exam-cell::before{content:"Exam score /100"!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-contribution-cell::before{content:"Exam contribution /50"!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-total-cell::before{content:"Total /100"!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-remark-cell::before{content:"Teacher remark"!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-absent-cell::before{display:none!important}

  /* Editable and locked values must both remain legible. */
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table input[type="number"],
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .remark-input{
    width:100%!important;
    min-width:0!important;
    min-height:52px!important;
    height:52px!important;
    padding:10px 13px!important;
    border:1px solid var(--gb-line-strong,#c8d4e1)!important;
    border-radius:15px!important;
    background:var(--gb-surface,#fff)!important;
    color:var(--gb-text,#102a43)!important;
    font-size:16px!important;
    font-weight:700!important;
    line-height:1!important;
    box-shadow:inset 0 1px 2px rgba(16,42,67,.025)!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table input::placeholder{
    color:#8799ad!important;
    opacity:1!important;
    font-weight:600!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table input:disabled,
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table input[readonly]{
    opacity:1!important;
    background:#f1f5f9!important;
    color:#61788f!important;
    border-color:#d5dee8!important;
    -webkit-text-fill-color:#61788f!important;
    cursor:not-allowed!important;
  }

  /* Calculated values use a compact dashboard-style summary tile. */
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .calculated-score{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
    min-height:68px!important;
    padding:11px 12px!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    border-radius:15px!important;
    background:color-mix(in srgb,var(--school-accent,#2563eb) 4%,var(--gb-surface,#fff))!important;
    color:var(--gb-brand-strong,var(--school-accent-dark,#1455b8))!important;
    font-size:20px!important;
    font-weight:900!important;
    line-height:1!important;
    letter-spacing:-.025em!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .calculated-score::before{
    margin:0!important;
    max-width:105px!important;
    color:var(--gb-muted,#66788d)!important;
    font-size:10px!important;
    line-height:1.35!important;
    letter-spacing:.07em!important;
  }
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .score-total-cell{
    background:color-mix(in srgb,var(--school-accent,#2563eb) 7%,var(--gb-surface,#fff))!important;
  }

  body.enterprise-shell-v3 .score-row-error:not(:empty){
    margin-top:7px!important;
    padding:7px 9px!important;
    border-radius:10px!important;
    background:#fff1f0!important;
    color:#b42318!important;
    font-size:11px!important;
    font-weight:800!important;
  }

  /* Absent is secondary to scores, so keep it compact and deliberate. */
  body.enterprise-shell-v3 .score-absent-toggle{
    display:grid!important;
    grid-template-columns:48px minmax(0,1fr)!important;
    gap:11px!important;
    align-items:center!important;
    min-height:64px!important;
    margin:0!important;
    padding:10px 12px!important;
    border:1px solid var(--gb-line,#dce5ef)!important;
    border-radius:15px!important;
    background:var(--gb-surface-soft,#f7f9fc)!important;
  }
  body.enterprise-shell-v3 .score-absent-toggle input{
    appearance:none!important;
    -webkit-appearance:none!important;
    position:relative!important;
    width:46px!important;
    min-width:46px!important;
    height:28px!important;
    min-height:28px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #b8c6d4!important;
    border-radius:999px!important;
    background:#dce4ec!important;
    box-shadow:none!important;
    transition:background .16s ease,border-color .16s ease!important;
  }
  body.enterprise-shell-v3 .score-absent-toggle input::after{
    content:""!important;
    position:absolute!important;
    top:3px!important;
    left:3px!important;
    width:20px!important;
    height:20px!important;
    border-radius:50%!important;
    background:#fff!important;
    box-shadow:0 1px 5px rgba(16,42,67,.24)!important;
    transition:transform .16s ease!important;
  }
  body.enterprise-shell-v3 .score-absent-toggle input:checked{
    background:#d44b3d!important;
    border-color:#d44b3d!important;
  }
  body.enterprise-shell-v3 .score-absent-toggle input:checked::after{transform:translateX(18px)!important}
  body.enterprise-shell-v3 .score-absent-toggle>span{display:grid!important;gap:2px!important;min-width:0!important}
  body.enterprise-shell-v3 .score-absent-toggle b{font-size:14px!important;line-height:1.2!important}
  body.enterprise-shell-v3 .score-absent-toggle small{font-size:12px!important;line-height:1.35!important;color:var(--gb-muted,#66788d)!important}

  /* Save/submit stays above the installed-app dock without covering learners. */
  body.enterprise-shell-v3 .result-score-actions{
    position:sticky!important;
    bottom:calc(88px + env(safe-area-inset-bottom))!important;
    z-index:12!important;
    display:grid!important;
    grid-template-columns:minmax(0,.85fr) minmax(0,1.35fr)!important;
    gap:8px!important;
    margin:14px -2px 0!important;
    padding:8px!important;
    border:1px solid color-mix(in srgb,var(--gb-line,#dce5ef) 86%,transparent)!important;
    border-radius:17px!important;
    background:color-mix(in srgb,var(--gb-surface,#fff) 95%,transparent)!important;
    box-shadow:0 12px 32px rgba(16,42,67,.16)!important;
    backdrop-filter:blur(14px)!important;
    -webkit-backdrop-filter:blur(14px)!important;
  }
  body.enterprise-shell-v3 .result-score-actions button{
    width:100%!important;
    min-height:50px!important;
    margin:0!important;
    border-radius:14px!important;
    font-size:14px!important;
    font-weight:850!important;
  }
  html:not(.gradebook-installed-app) body.enterprise-shell-v3 .result-score-actions{bottom:12px!important}

  /* Provide enough breathing room for the fixed app dock at the final row. */
  html.gradebook-installed-app.gradebook-phone-app body.enterprise-shell-v3 .result-entry-panel{
    padding-bottom:22px!important;
  }
}

@media (max-width:390px){
  body.enterprise-shell-v3 .result-entry-panel{padding:12px!important}
  body.enterprise-shell-v3 .result-entry-intro h2{font-size:24px!important}
  body.enterprise-shell-v3 .result-mobile-tools{grid-template-columns:minmax(0,1fr) 116px!important;gap:7px!important}
  body.enterprise-shell-v3 .result-mobile-tools button{padding-inline:9px!important;font-size:12px!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-learner-row{padding:12px!important;gap:10px!important}
  body.enterprise-shell-v3 .score-learner-identity{grid-template-columns:26px 44px minmax(0,1fr)!important;gap:9px!important}
  body.enterprise-shell-v3 .score-learner-avatar{width:44px!important;height:44px!important;border-radius:13px!important}
  body.enterprise-shell-v3 .score-learner-identity b{font-size:17px!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table .calculated-score{font-size:18px!important;padding-inline:10px!important}
}

@media (max-width:350px){
  body.enterprise-shell-v3 .result-formula{grid-template-columns:1fr 1fr!important}
  body.enterprise-shell-v3 .result-mobile-tools{grid-template-columns:1fr!important}
  body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-learner-row{
    grid-template-columns:1fr!important;
    grid-template-areas:"learner" "class" "exam" "contribution" "total" "remark" "absent"!important;
  }
  body.enterprise-shell-v3 .result-score-actions{grid-template-columns:1fr!important}
}

/* Dark-mode parity. The printable report system is intentionally unaffected. */
@media (max-width:800px){
  html[data-theme="dark"] body.enterprise-shell-v3 .result-mobile-toolbar,
  html[data-theme="dark"] body.enterprise-shell-v3 .score-absent-toggle{
    background:var(--gb-dark-surface-raised,#14283e)!important;
    border-color:var(--gb-dark-border,#2b455f)!important;
    box-shadow:none!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 .result-progress>strong{
    background:var(--gb-dark-surface,#0f2033)!important;
    border-color:var(--gb-dark-border,#2b455f)!important;
    color:var(--gb-dark-text,#f3f7fb)!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-learner-row{
    background:var(--gb-dark-surface,#0f2033)!important;
    border-color:var(--gb-dark-border,#2b455f)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.18)!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-complete{
    border-color:color-mix(in srgb,var(--school-accent,#5f8ff7) 45%,var(--gb-dark-border,#2b455f))!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table tr.score-absent{
    background:#1e181b!important;
    border-color:#78473f!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 .score-learner-identity b{color:var(--gb-dark-text,#f3f7fb)!important}
  html[data-theme="dark"] body.enterprise-shell-v3 .score-row-number{
    background:var(--gb-dark-surface-raised,#14283e)!important;
    color:var(--gb-dark-muted,#9fb0c2)!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table input[type="number"],
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table .remark-input,
  html[data-theme="dark"] body.enterprise-shell-v3 .score-search input{
    background:var(--gb-dark-surface-raised,#14283e)!important;
    color:var(--gb-dark-text,#f3f7fb)!important;
    border-color:var(--gb-dark-border-strong,#3b5b78)!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table input:disabled,
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table input[readonly]{
    background:#122338!important;
    color:#a9bacb!important;
    border-color:#294158!important;
    -webkit-text-fill-color:#a9bacb!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 table.result-score-table.mobile-card-table .calculated-score{
    background:var(--gb-dark-surface-raised,#14283e)!important;
    border-color:var(--gb-dark-border,#2b455f)!important;
    color:#9db9ff!important;
  }
  html[data-theme="dark"] body.enterprise-shell-v3 .result-score-actions{
    background:rgba(15,32,51,.96)!important;
    border-color:var(--gb-dark-border,#2b455f)!important;
    box-shadow:0 12px 34px rgba(0,0,0,.3)!important;
  }
}
