/* Commendations: approved dark Division player view inside the shared ProtoTrack shell. Page-scoped tokens. */
html:has(body.cm-page){color-scheme:dark;background:#0a121c}
body.cm-page{
 color-scheme:dark;
 --cm-bg:#0a121c;--cm-panel:#111e2c;--cm-line:#283a4d;--cm-text:#edf3f9;--cm-muted:#a6b6c8;--cm-accent:#ff9a47;--cm-soft:#172a3c;
 --cm-done:#77cfa7;--cm-progress:#84704c;
 margin:0;min-height:100vh;background:var(--cm-bg);color:var(--cm-text);font:15px/1.6 "Segoe UI",system-ui,-apple-system,Arial,sans-serif
}
.cm-page .cm-wrap{min-width:0;padding:0 0 32px 16px}
.cm-app{container:cm-app/inline-size;background:var(--cm-bg);border:1px solid var(--cm-line);border-radius:8px;overflow:hidden;min-width:0}
.cm-app *{box-sizing:border-box}
.cm-app [hidden]{display:none!important}
.cm-app :is(button,input,select){font:inherit;color:inherit}
.cm-app :where(h1,h2,h3,h4,p,blockquote){margin:0}
.cm-app a{color:#9dceff}
.cm-app :is(a,button,input,select,summary,[tabindex]):focus-visible{outline:2px solid var(--cm-accent);outline-offset:3px}
.cm-app [tabindex="-1"]:focus{outline:none}
.cm-app button{cursor:pointer;color:var(--cm-text);background:var(--cm-panel);border:1px solid var(--cm-line);border-radius:7px;padding:9px 14px;min-height:44px;touch-action:manipulation}
.cm-app button:hover{border-color:var(--cm-accent);background:#203045}
.cm-app :is(input,select){background:#0d1925;color:var(--cm-text);border:1px solid #344b62;border-radius:7px;min-height:44px;padding:9px 12px}
.cm-app input[type=search]{width:100%}
.cm-app input::placeholder{color:#8ea2b5}
.cm-sr{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Masthead: hero, totals, score explanation and personal progress. */
.cm-mast{border-top:4px solid var(--cm-accent);border-bottom:1px solid var(--cm-line);background:radial-gradient(ellipse at 90% 0,#223749 0,transparent 65%),#0c1824;padding:0 36px}
.cm-topline{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:22px 0 16px;font-size:12px;font-weight:700;letter-spacing:2px;color:#c0cbd7;text-transform:uppercase}
.cm-topline a{color:var(--cm-text);text-decoration:none;min-height:24px;display:inline-flex;align-items:center}
.cm-topline a:hover{color:var(--cm-accent)}
.cm-tag{color:var(--cm-accent);font-size:11px;letter-spacing:1.5px;text-transform:uppercase;font-weight:700}
.cm-hero{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:40px;padding:12px 0 28px}
.cm-app h1{font-size:clamp(34px,4.5vw,60px);font-weight:700;letter-spacing:-1.8px;line-height:1.08;margin:12px 0 16px}
.cm-app h1 span{color:var(--cm-accent)}
.cm-lede{max-width:820px;color:#bccbd9;font-size:16px}
.cm-hero-art{display:flex;align-items:center;justify-content:center}
.cm-hero-art img{width:135px;height:135px;object-fit:contain;filter:drop-shadow(0 8px 20px #0008)}
.cm-hero-art img+img{margin-left:-25px;transform:translateY(22px)}
.cm-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--cm-line);padding:18px 0 22px;gap:25px}
.cm-metric strong{font-size:30px;letter-spacing:-1px;font-weight:650;font-variant-numeric:tabular-nums}
.cm-metric span{display:block;font-size:12px;color:var(--cm-muted)}
.cm-metric small{display:block;font-size:11px;color:#87a4bb;margin-top:3px}
.cm-score-help{margin:0 0 18px;color:#a8bfd3;font-size:12px}
.cm-score-help strong{color:#dce9f5}
.cm-progress{border-top:1px solid var(--cm-line);padding:18px 0 22px}
.cm-progress-heading{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-bottom:11px}
.cm-progress-heading h2{font-size:16px;letter-spacing:-.2px}
.cm-progress-heading #cm-tier{display:inline-block;margin-left:8px;color:#ffba80}
.cm-progress-numbers{color:#becfe0;font-size:13px;font-variant-numeric:tabular-nums}
.cm-progress-numbers strong{color:var(--cm-text)}
.cm-track{height:7px;background:#25364a;border-radius:20px;overflow:hidden}
.cm-track>div{height:100%;background:var(--cm-done);width:0;transition:width .2s}
.cm-progress-caption{font-size:11px;color:var(--cm-muted);margin-top:9px;display:flex;justify-content:space-between;gap:15px}
.cm-updated{color:#92aabd}
.cm-storage-warning{margin:8px 0 0;color:#ffcd97;font-size:12px}

/* Account saving (Discord sign-in). */
.cm-account{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;margin-top:12px;padding:10px 14px;border:1px solid var(--cm-line);border-radius:8px;background:#0e1b28;font-size:12px;color:#becfe0}
.cm-account>img{width:20px;height:15px;flex:0 0 auto}
.cm-account p{flex:1 1 240px;min-width:0}
.cm-account[data-state=saved]{border-color:#39715b}
.cm-account:is([data-state=error],[data-state=unavailable],[data-state=remove-failed]){border-color:#7a6440}
.cm-account-actions{display:flex;gap:8px;flex-wrap:wrap}
.cm-account-actions :is(a,button){display:inline-flex;align-items:center;font-size:12px;font-weight:600;min-height:36px;padding:5px 12px;border-radius:7px}
.cm-app .cm-account-actions a{background:#5865f2;border:1px solid #7181f7;color:#fff;text-decoration:none}
.cm-app .cm-account-actions a:hover{background:#4752c4;border-color:#91a0ff}

/* Progress by category with bulk Complete all / Clear. */
.cm-bulk{margin-top:16px;border:1px solid var(--cm-line);border-radius:8px;background:#0e1b28}
.cm-bulk>summary{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;min-height:44px;padding:10px 14px;cursor:pointer;font-size:13px;font-weight:650;color:#a4d1f7;list-style:none}
.cm-bulk>summary::-webkit-details-marker{display:none}
.cm-bulk>summary::before{content:'';width:0;height:0;border-left:5px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform .15s}
.cm-bulk[open]>summary{border-bottom:1px solid var(--cm-line)}
.cm-bulk[open]>summary::before{transform:rotate(90deg)}
.cm-bulk>summary span{font-size:12px;font-weight:400;color:var(--cm-muted)}
.cm-bulk-body{padding:14px}
.cm-bulk-scope{display:inline-flex;align-items:center;gap:9px;min-height:32px;cursor:pointer;font-size:13px}
.cm-bulk-scope input{width:18px;height:18px;min-height:18px;margin:0;padding:0;accent-color:#7bd8ab;cursor:pointer;flex:0 0 auto}
.cm-bulk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;margin-top:10px}
.cm-bulk-row{border:1px solid var(--cm-line);border-radius:8px;background:var(--cm-panel);padding:12px;min-width:0}
.cm-bulk-row.is-completed{border-color:#4c977c}
.cm-bulk-head{display:flex;align-items:center;gap:8px;font-size:14px}
.cm-bulk-head img{width:26px;height:26px;object-fit:contain;flex:0 0 auto}
.cm-bulk-count{margin:6px 0 7px;font-size:11px;color:#becfe0;font-variant-numeric:tabular-nums}
.cm-bulk-track{height:5px;background:#25364a;border-radius:20px;overflow:hidden}
.cm-bulk-track>div{height:100%;width:0;background:var(--cm-done);transition:width .2s}
.cm-bulk-actions{display:flex;gap:6px;margin-top:11px}
.cm-bulk-actions button{flex:1 1 auto;font-size:12px;min-height:36px;padding:5px 10px}
.cm-app .cm-bulk-actions button:disabled{opacity:.45;cursor:default;border-color:var(--cm-line);background:var(--cm-panel)}
.cm-bulk-note{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:10px;font-size:12px;color:#becfe0}
.cm-bulk-note button{font-size:12px;min-height:36px;padding:5px 14px}

/* View switch. */
.cm-bar{background:#0c1824;border-bottom:1px solid var(--cm-line);padding:13px 36px}
.cm-views{display:flex;gap:8px;flex-wrap:wrap}
.cm-views a{display:inline-flex;align-items:center;min-height:44px;padding:9px 14px;border:1px solid var(--cm-line);border-radius:7px;background:var(--cm-panel);color:var(--cm-text);font-weight:600;text-decoration:none}
.cm-views a:hover{border-color:var(--cm-accent);background:#203045}
.cm-views a[aria-current=page]{background:var(--cm-accent);border-color:var(--cm-accent);color:#132031}
.cm-main{padding:24px 36px 0}

/* Filters. */
.cm-controls{display:grid;grid-template-columns:minmax(240px,1.5fr) repeat(4,minmax(140px,.75fr));gap:12px;margin-bottom:14px}
.cm-controls label{display:block;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#b5c7d7;font-weight:600;min-width:0}
.cm-controls :is(input,select){display:block;width:100%;margin-top:5px;text-transform:none;letter-spacing:normal;font-weight:400;font-size:14px}
.cm-categories{display:flex;gap:7px;flex-wrap:wrap}
.cm-categories button{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:13px}
.cm-categories img{width:22px;height:22px;object-fit:contain}
.cm-categories button[aria-pressed=true]{background:var(--cm-accent);border-color:var(--cm-accent);color:#132031}
.cm-categories button[aria-pressed=true] img{filter:brightness(.15)}
.cm-categories b{font-size:11px;padding:0 5px;border:1px solid #59718566;border-radius:4px;font-variant-numeric:tabular-nums}
.cm-retired-help{margin:8px 0 16px;color:#b5c7d7;font-size:12px}
.cm-resultbar{display:flex;gap:16px;justify-content:space-between;align-items:center;margin:20px 0 14px;color:var(--cm-muted);font-size:13px}
.cm-resultbar>div{display:flex;gap:7px;flex-shrink:0;flex-wrap:wrap}
.cm-resultbar button{font-size:12px;min-height:36px;padding:5px 10px}

/* Commendation cards. */
.cm-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:16px}
.cm-card{border:1px solid var(--cm-line);border-radius:10px;background:var(--cm-panel);overflow:hidden;min-width:0}
.cm-card.is-completed{border-color:#4c977c}
.cm-card.is-in-progress{border-color:var(--cm-progress)}
.cm-card.is-target{box-shadow:0 0 0 2px var(--cm-accent)}
.cm-card-head{display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;padding:20px 18px 14px;min-height:143px}
.cm-art{width:100px;height:100px;object-fit:contain}
.cm-noart{width:100px;height:100px;background:var(--cm-soft);border:1px dashed #486078;border-radius:10px;color:#a9bbcb;display:flex;align-items:center;justify-content:center;font-size:11px;text-align:center;line-height:1.4}
.cm-card h3{font-size:18px;font-weight:700;line-height:1.25;letter-spacing:-.3px;margin:7px 0 9px;overflow-wrap:anywhere}
.cm-card h3:focus{outline:none}
.cm-pills{display:flex;gap:6px;flex-wrap:wrap}
.cm-pill{font-size:10px;line-height:1.7;padding:1px 7px;background:#1d3042;border:1px solid #354a5e;border-radius:4px;color:#c1d4e5}
.cm-pill.is-retired{background:#382c25;border-color:#745032;color:#ffc491}
.cm-pill.is-completed{background:#214c3c;color:#b9f1d4;border-color:#39715b}
.cm-pill.is-in-progress{background:#33291c;color:#f2d29d;border-color:#7a6440}
.cm-meta{font-size:11px;color:var(--cm-muted);line-height:1.5;margin-top:5px}
.cm-conditions{padding:0 18px 14px;color:#c5d2df;font-size:13px}
.cm-conditions p{margin:0 0 6px;white-space:pre-line}
.cm-checkline{display:flex;gap:10px;align-items:center;cursor:pointer;border-top:1px solid var(--cm-line);padding:12px 18px;background:#142536;font-size:13px;min-height:49px}
.cm-checkline input,.cm-stage-check input{width:20px;height:20px;min-height:20px;margin:0;padding:0;accent-color:#7bd8ab;cursor:pointer;flex:0 0 auto}
.cm-completion-label{font-weight:650}
.cm-stage-count{margin-left:auto;font-size:11px;color:#a8bbce;font-variant-numeric:tabular-nums}
.cm-card.is-completed .cm-checkline{background:#17382e;color:#acf0d1}
.cm-rewardline{border-top:1px solid #2c3c4b;padding:12px 18px;font-size:12px;color:#bacbdb}
.cm-rewardline span{color:#f7d3ad}
.cm-card details{border-top:1px solid var(--cm-line)}
.cm-card summary{padding:12px 18px;cursor:pointer;font-size:12px;font-weight:650;color:#a4d1f7;min-height:44px;display:flex;align-items:center}
.cm-card summary::before{content:'';width:0;height:0;border-left:5px solid currentColor;border-top:4px solid transparent;border-bottom:4px solid transparent;margin-right:9px;transition:transform .15s}
.cm-card summary::-webkit-details-marker{display:none}
.cm-card details[open]>summary{border-bottom:1px solid var(--cm-line)}
.cm-card details[open]>summary::before{transform:rotate(90deg)}
.cm-detail-body{padding:16px 18px}
.cm-stage{margin-bottom:18px}
.cm-stage:last-child{margin-bottom:0}
.cm-stage-title{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#f4f7fa;margin:0 0 8px}
.cm-stage-title>span{color:var(--cm-accent);white-space:nowrap;font-size:12px}
.cm-stage-check{display:flex;align-items:center;gap:9px;cursor:pointer;font-size:12px;min-height:32px}
.cm-stage-note{font-size:11px;color:var(--cm-muted);margin:6px 0;white-space:pre-line}
.cm-checks{width:100%;border-collapse:collapse;font-size:12px;table-layout:fixed}
.cm-checks th{text-align:left;color:#829bb1;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.7px;border-bottom:1px solid var(--cm-line);padding:5px 0}
.cm-checks th:last-child,.cm-checks td:last-child{text-align:right;width:80px}
.cm-checks td{border-bottom:1px solid #263849;padding:7px 0;overflow-wrap:anywhere;vertical-align:top;font-variant-numeric:tabular-nums}
.cm-checks td:first-child{padding-right:8px}
.cm-item{font-size:12px;padding:11px 0;border-top:1px solid var(--cm-line)}
.cm-item-title{display:flex;align-items:center;gap:8px}
.cm-item-title img{width:40px;height:40px;object-fit:contain;flex:0 0 auto}
.cm-item-title .cm-noart{width:40px;height:40px;font-size:0}
.cm-item p{margin:7px 0;color:#bccbd9;white-space:pre-line}
.cm-item blockquote,.cm-detail-body>blockquote{margin:8px 0 0;padding-left:9px;border-left:2px solid #4b667e;font-size:11px;color:#a3b8ca;white-space:pre-line}
.cm-detail-body>blockquote{margin:0 0 12px}
.cm-empty{padding:60px 20px;text-align:center;border:1px dashed var(--cm-line);border-radius:10px;grid-column:1/-1;color:var(--cm-muted)}

/* Ranks. */
.cm-sectionhead{display:flex;justify-content:space-between;gap:20px;align-items:baseline;margin:4px 0 16px}
.cm-sectionhead h2{font-size:27px;font-weight:700;letter-spacing:-.7px;line-height:1.2}
.cm-sectionhead p{font-size:13px;color:var(--cm-muted)}
.cm-ranks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}
.cm-rank{position:relative;border:1px solid var(--cm-line);border-radius:9px;background:var(--cm-panel);padding:18px;text-align:center;min-width:0}
.cm-rank.is-current{border-color:var(--cm-accent);box-shadow:inset 0 0 0 1px var(--cm-accent)}
.cm-emblem{display:block;width:100px;height:100px;margin:0 auto}
.cm-rank h3{font-size:16px;font-weight:700;margin:4px 0}
.cm-rank .cm-pill{position:absolute;top:10px;right:10px;background:#3a2a1a;border-color:#8a5a2e;color:#ffc491}
.cm-rank-score{font-size:23px;line-height:1.3;color:var(--cm-accent);font-weight:650;font-variant-numeric:tabular-nums}
.cm-rank-score small{font-size:10px;color:#91a9bd;font-weight:400;display:block;letter-spacing:1px;text-transform:uppercase}
.cm-rank-reward{border-top:1px solid var(--cm-line);margin-top:13px;padding-top:12px;min-height:64px;font-size:12px;color:#c8d7e5}
.cm-rank-reward img{width:36px;height:36px;object-fit:contain;display:block;margin:4px auto}

.cm-footer{display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;padding:30px 36px 24px;margin-top:35px;border-top:1px solid var(--cm-line);font-size:11px;color:#869eb3}

/* Layout follows the space next to the site rail, not the window. */
@container cm-app (max-width:1200px){
 .cm-controls{grid-template-columns:repeat(4,minmax(0,1fr))}
 .cm-controls label:first-child{grid-column:1/-1}
}
@container cm-app (max-width:1100px){
 .cm-hero{grid-template-columns:minmax(0,1fr) 220px}
 .cm-ranks{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@container cm-app (max-width:960px){
 .cm-results{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container cm-app (max-width:900px){
 .cm-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container cm-app (max-width:680px){
 .cm-mast,.cm-bar{padding-left:16px;padding-right:16px}
 .cm-main{padding:18px 16px 0}
 .cm-footer{display:block;padding:24px 16px 20px}
 .cm-footer .cm-updated{display:block;margin-top:6px}
 .cm-hero{grid-template-columns:minmax(0,1fr);gap:10px;padding:4px 0 22px}
 .cm-hero-art{display:none}
 .cm-topline{font-size:10px;letter-spacing:1px}
 .cm-app h1{font-size:41px}
 .cm-lede{font-size:14px}
 .cm-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
 .cm-score-help{font-size:11px}
 .cm-progress-heading{display:block}
 .cm-progress-numbers{margin-top:7px;font-size:12px}
 .cm-progress-caption{display:block}
 .cm-progress-caption>span{display:block;margin-top:3px}
 .cm-views{gap:6px}
 .cm-views a{font-size:13px;padding:8px 10px}
 .cm-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cm-controls :is(input,select){font-size:16px}
 .cm-results{grid-template-columns:minmax(0,1fr)}
 .cm-resultbar{display:block}
 .cm-resultbar>div{margin-top:10px}
 .cm-card-head{min-height:135px}
 .cm-stage-check{max-width:70%;line-height:1.4}
 .cm-ranks{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cm-sectionhead{display:block}
 .cm-sectionhead p{margin-top:10px}
}
@container cm-app (max-width:480px){
 .cm-controls label:nth-child(n+4){grid-column:1/-1}
}
@container cm-app (max-width:400px){
 .cm-app h1{font-size:34px}
 .cm-card-head{grid-template-columns:76px minmax(0,1fr);gap:12px;padding:18px 14px 12px}
 .cm-card-head .cm-art,.cm-card-head .cm-noart{width:76px;height:76px}
 .cm-checkline,.cm-rewardline,.cm-card summary,.cm-detail-body{padding-left:14px;padding-right:14px}
 .cm-conditions{padding:0 14px 14px}
 .cm-categories button{padding:8px 9px;font-size:12px}
 .cm-rank{padding:14px 10px}
 .cm-emblem{width:84px;height:84px}
}
@media(max-width:969px){.cm-page .cm-wrap{padding:0 12px 24px}}
@media(max-width:600px){
 .cm-page .cm-wrap{padding:0 0 20px}
 .cm-app{border-left:0;border-right:0;border-radius:0}
}
@media(pointer:coarse){.cm-app :is(.cm-stage-check,.cm-bulk-scope,.cm-resultbar button,.cm-bulk-actions button,.cm-bulk-note button,.cm-account-actions a,.cm-account-actions button){min-height:44px}}
@media(prefers-reduced-motion:reduce){.cm-app *{transition:none!important}}
