.device-layout-toggle{flex-shrink:0;white-space:nowrap;border:1px solid #bacbc0;border-radius:5px;background:#f1f6f3;color:#245139;padding:7px 10px;font:600 12px/1.3 var(--sans);min-height:36px}
.device-layout-toggle[aria-pressed=true]{background:#dfece4;border-color:#85a791}
.device-editor-tabs{display:none}
.device-draft-dock{display:none}
@media screen and (max-width:1100px){
  html:not(.device-top-screen){min-height:100%;background:#fff}
  html:not(.device-top-screen) body{width:100%;min-height:100dvh}
  .wrap{width:100%;padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  /* The Duo's open display and split windows need touch-sized fields too. */
  body.eval-mode .eval-form :is(input,select,textarea),body.eval-mode .eval-season select{font-size:16px;min-height:36px}
  body.eval-mode .eval-factors .factor-grade-control select{font-size:16px;width:100%;min-height:36px}
  body.eval-mode .eval-factors .factor-grade-control{grid-template-columns:minmax(0,1fr)116px;min-height:42px}
  .nav-inner{flex-wrap:wrap;gap:8px 14px;padding-top:10px;padding-bottom:10px}
  .device-layout-toggle{margin-left:auto}
  /* On either Duo display, use the whole width for the task being worked on. */
  body.eval-mode .eval-form{display:flex;flex-direction:column;gap:10px}
  body.eval-mode .device-editor-tabs{display:flex;position:sticky;top:0;z-index:5;gap:6px;padding:6px 0;background:#f3f6f4}
  .device-editor-tabs button{flex:1;min-height:44px;border:1px solid #c5d3ca;border-radius:5px;background:#fff;color:#365d45;font:600 14px/1.3 var(--sans)}
  .device-editor-tabs button[aria-pressed=true]{background:#e0ede5;border-color:#8aac97}
  body.eval-mode .eval-form[data-device-panel="0"]>.eval-reference,body.eval-mode .eval-form[data-device-panel="0"]>.eval-factors,
  body.eval-mode .eval-form[data-device-panel="1"]>.eval-writing,body.eval-mode .eval-form[data-device-panel="1"]>.eval-factors,
  body.eval-mode .eval-form[data-device-panel="2"]>.eval-reference,body.eval-mode .eval-form[data-device-panel="2"]>.eval-writing{display:none}
  body.eval-mode .eval-pane{width:100%;grid-column:auto;grid-row:auto;max-height:none;overflow:visible}
  body.eval-mode .eval-reference-content{max-height:none;overflow:visible}
  body.eval-mode .eval-pane-title,body.eval-mode .eval-pane-title h2{font-size:16px}
  body.eval-mode .eval-text-heading label{font-size:12px}
  body.eval-mode .eval-text-control textarea{font-size:16px;line-height:1.6;padding:10px;min-height:100px}
  body.eval-mode .eval-text-control textarea[name=summary]{height:clamp(180px,30dvh,320px)}
  body.eval-mode .eval-writing .editor-facts input{height:40px}
  body.eval-mode .eval-reference-tabs button{min-height:42px;font-size:14px}
  body.eval-mode .eval-actions{gap:8px}
  body.eval-mode .eval-actions .button{min-height:42px;font-size:13px}
}
@media screen and (min-width:701px) and (max-width:1100px){
  body.eval-mode main#content>.wrap{padding:12px 16px}
  body.eval-mode .eval-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);align-items:start;gap:12px}
  body.eval-mode .device-editor-tabs{display:none}
  body.eval-mode .eval-form[data-device-panel]>.eval-pane{display:flex;flex-direction:column;gap:10px}
  body.eval-mode .eval-reference{grid-column:1;grid-row:1}
  body.eval-mode .eval-writing{grid-column:2;grid-row:1}
  body.eval-mode .eval-factors{grid-column:1/-1;grid-row:2}
  body.eval-mode .eval-factors .factor-editor{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  body.eval-mode .eval-factors .factor-grade-control span{font-size:13px;line-height:1.3}
  body.eval-mode .eval-reference .editor-details-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.eval-mode .eval-reference-content .stat-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
  body.eval-mode .eval-reference-content .stat-cell small{font-size:12px}
  body.eval-mode .eval-reference-content .stat-cell strong{font-size:20px}
}
@media screen and (max-width:700px){
  .cards{grid-template-columns:minmax(0,1fr)}
  .report-paper .report-player img{display:block;flex:0 0 56px;width:56px;height:132px;object-fit:cover}
  .report-paper .report-player{min-width:0;gap:9px}
  .report-paper .report-player>div{min-width:0}
  .report-paper .report-header{grid-template-columns:minmax(0,1fr) 98px;min-height:140px;gap:7px;padding-right:8px}
  .report-paper .report-score{flex-basis:98px;width:98px;min-width:98px;max-width:98px}
  .report-paper .report-header h1{font-size:clamp(21px,4.4vw,30px);overflow-wrap:normal;word-break:normal}
  .nav-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px}
  .nav-inner .brand{grid-column:1;grid-row:1;min-width:0;font-size:12px;gap:9px}
  .nav-inner .device-layout-toggle{grid-column:2;grid-row:1;margin:0;font-size:11px;padding:6px 8px}
  .nav-inner .nav-links{grid-column:1/-1;grid-row:2;display:flex;flex-wrap:nowrap;min-width:0;overflow-x:auto;gap:18px;white-space:nowrap}
  .nav-inner .nav-links a{padding-top:7px;padding-bottom:7px}
}
@media screen and (max-width:1100px) and (max-height:500px) and (orientation:landscape){
  /* A short landscape viewport needs a single compact navigation row. */
  .nav-inner{display:flex;flex-wrap:nowrap;min-height:44px;padding:5px 12px;gap:10px}
  .nav-inner .brand{flex:0 0 auto}
  .nav-inner .brand>span:not(.brand-icon){display:none}
  .nav-inner .brand-icon{width:28px;height:29px;font-size:20px}
  .nav-inner .nav-links{flex:1;width:auto;gap:16px;font-size:11px;min-width:0;overflow-x:auto;white-space:nowrap}
  .nav-inner .nav-links a{padding:5px 0}
  .device-layout-toggle{min-height:32px;font-size:11px}
  .hero,.profiles-head{padding-top:20px;padding-bottom:20px}
  .profile-shell{padding-top:12px}
  .report-paper .report-masthead{display:none}
  .report-paper .report-kicker{margin-top:0}
  body.eval-mode .eval-text-control textarea[name=summary]{height:150px;min-height:120px}
}
@media screen{
  html.device-top-screen{height:100%;overflow:hidden;scroll-behavior:auto;background:#edf1ee}
  html.device-top-screen body{position:fixed;inset:0 0 auto;display:block;width:100%;height:min(50dvh,var(--device-visible-height,100dvh));min-height:0;max-height:none;overflow:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding:12px;background:#fff}
  html.device-top-screen.device-segmented body{height:min(var(--device-segment-height,env(viewport-segment-height 0 0,50dvh)),var(--device-visible-height,100dvh))}
  html.device-top-screen .nav-inner,html.device-top-screen body.eval-mode .nav-inner{display:flex;min-height:40px;max-width:none;padding:5px 12px;gap:8px;flex-wrap:nowrap}
  html.device-top-screen .brand{flex:0 0 auto;gap:0}
  html.device-top-screen .brand>span:not(.brand-icon){display:none}
  html.device-top-screen .brand-icon{width:26px;height:28px;font-size:19px}
  html.device-top-screen .nav-links{flex:1;min-width:0;overflow-x:auto;flex-wrap:nowrap;gap:17px;font-size:11px;white-space:nowrap}
  html.device-top-screen .nav-links a{padding:6px 0}
  html.device-top-screen .device-layout-toggle{font-size:11px;min-height:30px;padding:5px 8px}
  html.device-top-screen main .wrap{padding-left:12px;padding-right:12px}
  html.device-top-screen .profile-shell{padding-top:12px}
  html.device-top-screen .hero,html.device-top-screen .profiles-head{padding-top:18px;padding-bottom:18px}
  html.device-top-screen .report-paper{padding:16px}
  html.device-top-screen .report-masthead{display:none}
  html.device-top-screen .report-kicker{margin-top:0}
  html.device-top-screen .breadcrumb{margin-bottom:12px}
  html.device-top-screen .site-footer{padding:12px 0}
  html.device-top-screen body.eval-mode main#content,html.device-top-screen body.eval-mode main#content>.wrap,html.device-top-screen body.eval-mode #lookupPlayer,html.device-top-screen body.eval-mode #lookupPlayer>.eval-shell,html.device-top-screen body.eval-mode .eval-shell [data-player-tools],html.device-top-screen body.eval-mode .eval-shell .report-editor{display:block;flex:none;height:auto;overflow:visible;min-height:0}
  html.device-top-screen body.eval-mode main#content>.wrap{padding:8px 12px}
  html.device-top-screen body.eval-mode #playerLookupForm{margin:0 0 6px;display:flex;gap:6px;align-items:flex-end}
  html.device-top-screen body.eval-mode #playerLookupForm input{font-size:16px;height:36px;margin-top:2px}
  html.device-top-screen body.eval-mode #playerLookupForm button{height:36px;min-height:36px;padding:5px 9px}
  html.device-top-screen body.eval-mode #lookupStatus:empty{display:none}
  html.device-top-screen body.eval-mode .eval-identity{margin:5px 0}
  html.device-top-screen body.eval-mode .eval-identity .lookup-bio>div{display:block}
  html.device-top-screen body.eval-mode .eval-identity h2{font-size:19px}
  html.device-top-screen body.eval-mode .eval-identity .lookup-bio img{width:34px;height:40px}
  html.device-top-screen body.eval-mode .eval-form{display:flex;flex-direction:column;gap:8px}
  html.device-top-screen body.eval-mode .device-editor-tabs{display:flex;position:sticky;top:0;z-index:5;gap:5px;padding:5px 0;background:#f3f6f4;flex-shrink:0}
  html.device-top-screen .device-editor-tabs button{flex:1;border:1px solid #c5d3ca;border-radius:4px;background:#fff;color:#365d45;font-size:13px;min-height:34px}
  html.device-top-screen .device-editor-tabs button[aria-pressed=true]{background:#e0ede5;border-color:#8aac97;font-weight:700}
  html.device-top-screen body.eval-mode .eval-form[data-device-panel="0"]>.eval-reference,html.device-top-screen body.eval-mode .eval-form[data-device-panel="0"]>.eval-factors,
  html.device-top-screen body.eval-mode .eval-form[data-device-panel="1"]>.eval-writing,html.device-top-screen body.eval-mode .eval-form[data-device-panel="1"]>.eval-factors,
  html.device-top-screen body.eval-mode .eval-form[data-device-panel="2"]>.eval-reference,html.device-top-screen body.eval-mode .eval-form[data-device-panel="2"]>.eval-writing{display:none}
  html.device-top-screen body.eval-mode .eval-pane{width:100%;display:flex;flex-direction:column;overflow:visible;max-height:none;padding:10px;gap:8px}
  html.device-top-screen body.eval-mode .eval-reference-content{max-height:none;overflow:visible}
  html.device-top-screen body.eval-mode .eval-text-control{flex:none;min-height:0}
  html.device-top-screen body.eval-mode .eval-text-control textarea{flex:none;font-size:16px;line-height:1.5;min-height:70px;height:90px}
  html.device-top-screen body.eval-mode .eval-text-control textarea[name=summary]{height:150px}
  html.device-top-screen body.eval-mode .eval-game-notes[open]{max-height:none;overflow:visible}
  html.device-top-screen body.eval-mode .eval-actions{flex-direction:row;gap:6px;padding:8px}
  html.device-top-screen body.eval-mode .eval-actions .button{flex:1 1 auto;width:auto;min-height:36px;font-size:12px;padding:7px 9px}
  html.device-top-screen body.eval-mode .eval-actions .stats-message{flex-basis:100%;max-height:none}
  /* Expanded writing and dialogs must fit above a native keyboard, including without fold APIs. */
  html.device-top-screen body.eval-mode .eval-text-control.is-expanded{position:fixed;inset:8px 8px auto;height:calc(min(50dvh,var(--device-visible-height,100dvh)) - 16px);padding:10px;overflow:hidden;z-index:100}
  html.device-top-screen.device-segmented body.eval-mode .eval-text-control.is-expanded{height:calc(min(var(--device-segment-height,env(viewport-segment-height 0 0,50dvh)),var(--device-visible-height,100dvh)) - 16px)}
  html.device-top-screen body.eval-mode .eval-text-control.is-expanded textarea{flex:1;min-height:0!important;height:auto!important}
  html.device-top-screen dialog[open]{position:fixed;top:8px;bottom:auto;margin:0 auto;max-height:calc(min(50dvh,var(--device-visible-height,100dvh)) - 16px);overflow:auto}
  html.device-top-screen.device-segmented dialog[open]{max-height:calc(min(var(--device-segment-height,env(viewport-segment-height 0 0,50dvh)),var(--device-visible-height,100dvh)) - 16px)}
  html.device-keyboard-open:not(.device-top-screen) body.eval-mode .eval-text-control.is-expanded{top:calc(var(--device-visible-top,0px) + 8px);bottom:auto;height:calc(var(--device-visible-height,100dvh) - 16px)}
}
@media print{.device-layout-toggle,.device-editor-tabs{display:none!important}}

/* Follow the visible viewport rather than the part hidden behind a phone keyboard. */
@media screen{
  html.device-mobile-editor{scroll-padding-bottom:calc(var(--device-dock-height,64px) + 14px)}
  html.device-mobile-editor body.eval-mode{padding-bottom:calc(var(--device-dock-height,64px) + 14px);scroll-padding-bottom:calc(var(--device-dock-height,64px) + 14px)}
  html.device-mobile-editor body.eval-mode .device-draft-dock{position:fixed;z-index:150;top:calc(var(--device-editor-bottom,100dvh) - var(--device-dock-height,64px));left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;margin:0;padding:8px 10px max(8px,env(safe-area-inset-bottom));border:1px solid #b8cbbf;border-radius:8px;background:#fff;box-shadow:0 -3px 16px #203e2b1f;color:#244532}
  html.device-mobile-editor.device-keyboard-open body.eval-mode .device-draft-dock{padding-bottom:8px}
  .device-draft-dock [data-device-save-status]{font:500 11px/1.35 var(--sans);letter-spacing:0;overflow-wrap:anywhere;max-height:3.9em;overflow:auto}
  .device-draft-dock button{min-height:42px;border:1px solid #00693e;border-radius:5px;background:#00693e;color:#fff;padding:8px 13px;font:650 14px/1.3 var(--sans);letter-spacing:0;white-space:nowrap}
  .device-draft-dock button.device-keyboard-done{background:#f0f4f1;color:#355b43;border-color:#c1d0c6;padding:8px 12px}
  html.device-mobile-editor body.eval-mode .eval-actions [data-save-draft]{display:none}
  html.device-mobile-editor body.eval-mode .eval-text-heading .eval-word-count{flex:1 1 auto;min-width:0;white-space:normal;overflow-wrap:anywhere}
  html.device-mobile-editor.device-keyboard-open body.eval-mode .device-editor-tabs{position:static}
  html.device-mobile-editor.device-keyboard-open body.eval-mode textarea:focus{min-height:0!important;height:min(180px,max(32px,calc(var(--device-editor-height,100dvh) - var(--device-dock-height,64px) - 64px)));max-height:max(32px,calc(var(--device-editor-height,100dvh) - var(--device-dock-height,64px) - 64px))!important}
  html.device-mobile-editor body.eval-mode .eval-text-control.is-expanded,
  html.device-mobile-editor.device-keyboard-open body.eval-mode .eval-text-control.is-expanded,
  html.device-mobile-editor.device-top-screen body.eval-mode .eval-text-control.is-expanded{top:calc(var(--device-editor-top,0px) + 8px);bottom:auto;height:calc(var(--device-editor-height,100dvh) - var(--device-dock-height,64px) - 20px);min-height:0;max-height:none;overflow:visible;padding:10px}
  html.device-mobile-editor body.eval-mode .eval-text-control.is-expanded textarea{flex:1;min-height:0!important;max-height:none!important;height:auto!important;resize:none}
  html.device-mobile-editor body.eval-mode .eval-text-control.is-expanded .eval-text-heading{min-height:30px;flex-shrink:0;gap:6px}
  html.device-mobile-editor body.eval-mode .eval-text-control.is-expanded .eval-expand{min-height:30px}
  html.device-mobile-editor body.eval-mode .eval-text-control.is-expanded .eval-word-count{font-size:10px}
  html.device-mobile-editor body.eval-mode dialog[open]{top:calc(var(--device-editor-top,0px) + 8px);bottom:auto;max-height:calc(var(--device-editor-height,100dvh) - 16px);margin-top:0;margin-bottom:0;overflow:auto}
}
@media print{.device-draft-dock{display:none!important}}
