:root {
  --brand: #1E5AA8; --brand-dark: #0F2340; --brand-deep: #0B1A30; --brand-soft: #E4EDF8; --brand-mid: #9DBBE3;
  --bg: #EEF2F7; --surf: #fff; --ink: #14202E; --mut: #5B6B7F; --faint: #93A1B2; --line: #DCE3EC; --line-2: #C3CCD8;
  --top: #1F9D55; --top-l: #E2F4EA; --strong: #1490A0; --strong-l: #DFF2F4;
  --dev: #C27D00; --dev-l: #FCF1DA; --concern: #CC3B3B; --concern-l: #FBE4E4;
  --radius: 12px; --num: "Roboto Condensed", "Arial Narrow", "Helvetica Neue Condensed", "TeX Gyre Heros Cn", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.num { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--mut); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surf); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px); }
.topbar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 16px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 650; color: var(--brand-dark); font-size: 15px; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-dark); color: #fff; display: grid;
  place-items: center; font-size: 12px; font-weight: 700; overflow: hidden; }
.logo img { height: 30px; max-width: 140px; object-fit: contain; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--mut); font-size: 14px; font-weight: 500; }
.nav a.on { color: var(--brand); background: var(--brand-soft); }
.nav a:hover { text-decoration: none; color: var(--ink); }
.pill-count { background: var(--concern); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; margin-left: 3px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 36px; background: var(--surf); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(15,35,64,.12); min-width: 190px; padding: 6px; z-index: 40; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  color: var(--ink); font-size: 14px; background: none; border: 0; font-family: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--bg); text-decoration: none; }
.devbanner { background: #FFF3C4; color: #6B4E00; text-align: center; font-size: 12px; padding: 4px; }
@media (max-width: 760px) {
  .nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surf); border-top: 1px solid var(--line);
    justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b)); z-index: 30; }
  .nav a { font-size: 12.5px; padding: 6px 8px; }
  body.has-nav main { padding-bottom: 90px; }
  .topbar-in { justify-content: space-between; }
}

main { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.flash.ok { background: var(--top-l); color: #12603A; } .flash.error { background: var(--concern-l); color: #8C2525; }

/* ---------- generic ---------- */
.card { background: var(--surf); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card + .card { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; } .spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surf); color: var(--ink); font-weight: 600; font-size: 14px; font-family: inherit;
  font-family: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.soft { background: var(--brand-soft); border-color: var(--brand-mid); color: var(--brand); }
.btn.danger { color: var(--concern); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: 12.5px; color: var(--mut); font-weight: 550; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input[type=tel],
select, textarea { width: 100%; font-size: 15px; line-height: 1.3; font-family: inherit; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); margin: 8px 0; font-weight: 400; }
.check input { width: 18px; height: 18px; }
.help { font-size: 12.5px; color: var(--mut); margin: 4px 0 0; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; color: var(--mut); font-weight: 550; padding: 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surf); font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; font-family: inherit; }
.chip.on { background: var(--brand-soft); border-color: var(--brand-mid); color: var(--brand); font-weight: 600; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; }
.empty { text-align: center; color: var(--mut); padding: 30px 10px; }

/* status + tier colors */
.t-top { color: var(--top); } .t-strong { color: var(--strong); } .t-developing { color: var(--dev); } .t-concern { color: var(--concern); }
.bg-top { background: var(--top); } .bg-strong { background: var(--strong); } .bg-developing { background: var(--dev); } .bg-concern { background: var(--concern); }
.s-passed, .s-achieved, .s-complete, .s-on_track { background: var(--top-l); color: #177A43; }
.s-expiring, .s-at_risk, .s-partial, .s-in_progress { background: var(--dev-l); color: #8A5A00; }
.s-failed, .s-expired, .s-behind, .s-overdue, .s-not_achieved { background: var(--concern-l); color: #A52E2E; }
.s-scheduled { background: var(--brand-soft); color: var(--brand); }
.s-eligible { background: #fff; color: var(--brand); border: 1px solid var(--brand-mid); }
.s-locked { background: #EEF1F5; color: var(--faint); }

.bar { height: 9px; border-radius: 999px; background: #E3E8EF; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); width: 0; transition: width .6s ease-out; }
.bar.tall { height: 14px; }
.ovr { display: inline-grid; place-items: center; color: #fff; font-family: var(--num); font-weight: 700;
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%); }
.trend-up { color: var(--top); } .trend-down { color: var(--concern); } .trend-flat { color: var(--faint); }

/* ---------- roster ---------- */
.searchbox { position: relative; }
.searchbox input { padding-left: 36px; height: 46px; }
.searchbox svg { position: absolute; left: 12px; top: 14px; }
.attention { display: grid; gap: 6px; margin: 10px 0; }
.attention a { display: flex; align-items: center; gap: 10px; background: var(--surf); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; color: var(--ink); font-size: 14px; }
.attention a:hover { text-decoration: none; border-color: var(--line-2); }
.attention .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.toolbar { display: flex; gap: 6px; margin: 12px 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.filterpanel { background: var(--surf); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 16px; margin-bottom: 12px; }
.filterpanel .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr 1fr; gap: 9px; } }
.tile { position: relative; background: var(--surf); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 10px 11px; text-align: center; color: var(--ink); display: block; }
.tile:hover { text-decoration: none; border-color: var(--line-2); box-shadow: 0 4px 14px rgba(15,35,64,.07); }
.tile .ph-wrap { position: relative; width: 62px; margin: 0 auto 9px; }
.tile .ovr { position: absolute; right: -24px; bottom: -6px; width: 36px; height: 25px; font-size: 16px; }
.tile .nm { font-weight: 650; font-size: 14px; margin: 0; line-height: 1.25; }
.tile .rl { font-size: 12px; color: var(--mut); margin: 1px 0 0; }
.tile .stats { display: flex; justify-content: space-around; margin: 9px 0 8px; }
.tile .st { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--mut); letter-spacing: .3px; }
.tile .st b { font-size: 19px; line-height: 1.1; }
.tile .flags { position: absolute; top: 8px; right: 9px; display: flex; gap: 4px; }
.tile .bar { height: 6px; }
.photo { border-radius: 12px; display: grid; place-items: center; font-weight: 650; color: #fff; overflow: hidden;
  background: var(--brand); flex: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.none { background: #C7D2E0; }
.hide-ratings .rating-only { display: none !important; }
.listview { width: 100%; }
.listview td .photo { width: 36px; height: 36px; font-size: 13px; border-radius: 9px; }

/* ---------- player card ---------- */
.pc-head { background: var(--brand-dark); color: #fff; border-radius: 16px 16px 0 0; padding: 18px; display: flex; gap: 16px; align-items: center; }
.pc-head .photo { width: 92px; height: 92px; font-size: 28px; border: 2px solid rgba(255,255,255,.35); }
.pc-head h1 { font-size: 22px; margin: 0; color: #fff; line-height: 1.2; }
.pc-head .sub { color: rgba(255,255,255,.72); font-size: 13.5px; }
.pc-head .ovr { width: 68px; height: 56px; font-size: 34px; }
.pc-body { background: var(--surf); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; padding: 4px 18px 18px; }
.pc-cols { display: grid; grid-template-columns: 1fr; gap: 0 32px; }
@media (min-width: 900px) { .pc-cols { grid-template-columns: 1fr 1fr; } }
.sec { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--mut);
  margin: 18px 0 9px; font-weight: 600; }
.attr { display: grid; grid-template-columns: 96px 1fr 34px 18px; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 9px; }
.attr b { font-size: 18px; }
.attr .bar { height: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { width: 52px; text-align: center; font-size: 10px; color: var(--mut); line-height: 1.2; }
.badge svg { display: block; margin: 0 auto 3px; }
.badge.expired { opacity: .45; filter: grayscale(1); }
.ev { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ev .pt { min-width: 36px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; flex: none; }
.pt-pos { background: var(--top-l); color: var(--top); } .pt-neg { background: var(--dev-l); color: var(--dev); }
.pt-bad { background: var(--concern-l); color: var(--concern); } .pt-zero { background: #EEF1F5; color: var(--mut); }
.ev .meta { font-size: 12px; color: var(--faint); margin-top: 3px; }
.ev.removed .body > :first-child { text-decoration: line-through; color: var(--mut); }
.ev .actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; margin: 16px 0 4px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 600; font-size: 14px; font-family: inherit; color: var(--mut);
  border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }
.contact dt { font-size: 12px; color: var(--mut); margin-top: 8px; } .contact dd { margin: 0; }

/* ---------- dialogs + log sheet ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, 100vw); max-height: 92vh; background: var(--surf); color: var(--ink); }
dialog::backdrop { background: rgba(11,26,48,.45); }
dialog .dlg { padding: 16px 18px 20px; overflow-y: auto; max-height: 92vh; }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; }
  dialog .dlg { padding-bottom: calc(20px + var(--safe-b)); }
}
.grab { width: 40px; height: 4px; border-radius: 2px; background: #C9D2DD; margin: 0 auto 12px; }
.seg { display: flex; background: #E3E8EF; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; font-weight: 600; font-size: 14px; font-family: inherit; color: var(--mut); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,35,64,.12); }
.who { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.av { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--mut);
  background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; min-width: 52px; position: relative; }
.av .photo { width: 48px; height: 48px; border-radius: 50%; font-size: 15px; background: #7D93B0; border: 3px solid transparent; }
.av.on .photo { border-color: var(--brand); background: var(--brand); }
.av .rev { position: absolute; top: -2px; right: 0; background: var(--dev); color: #fff; font-size: 9px; border-radius: 999px; padding: 1px 5px; }
.pts { display: flex; gap: 5px; }
.pts button { flex: 1; height: 48px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-family: var(--num);
  font-weight: 700; font-size: 18px; cursor: pointer; }
.pts button.note { font-weight: 500; font-size: 12px; font-family: inherit; color: var(--mut); }
.pts button.neg { color: var(--concern); } .pts button.neg1 { color: var(--dev); } .pts button.pos { color: var(--top); }
.pts button.on { border-width: 2px; }
.pts button.on.pos { background: var(--top-l); border-color: var(--top); }
.pts button.on.neg, .pts button.on.neg1 { background: var(--concern-l); border-color: var(--concern); }
.pts button.on.note { background: #EEF1F5; border-color: var(--mut); }
.guide { font-size: 12.5px; color: var(--mut); min-height: 18px; margin: 6px 0 0; }
.hrs { display: flex; gap: 6px; align-items: center; }
.hrs button { width: 50px; height: 46px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 16px; cursor: pointer; font-family: inherit; }
.hrs button.on { background: var(--brand-soft); border: 2px solid var(--brand); color: var(--brand); font-weight: 700; }
.stepper { flex: 1; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line-2); border-radius: 10px; height: 46px; padding: 0 6px; }
.stepper button { width: 34px; height: 34px; border: 0; background: none; color: var(--brand); font-size: 20px; cursor: pointer; }
.mic { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); border: 0; display: grid; place-items: center; }
.found { display: grid; gap: 4px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.found button { display: flex; gap: 10px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px; cursor: pointer; font-family: inherit; font-size: 14px; }
.found .photo { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; }
.found .grp { font-size: 11.5px; color: var(--mut); padding: 6px 2px 0; }
.fab { position: fixed; right: 18px; bottom: calc(22px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 0; font-size: 30px; font-weight: 300; box-shadow: 0 6px 18px rgba(15,35,64,.28);
  cursor: pointer; z-index: 25; display: grid; place-items: center; }
@media (max-width: 760px) { .fab { bottom: calc(78px + var(--safe-b)); } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); background: var(--brand-deep);
  color: #fff; border-radius: 12px; padding: 11px 14px; font-size: 14px; z-index: 60; display: flex; gap: 14px;
  align-items: center; max-width: calc(100vw - 24px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@media (max-width: 760px) { .toast { bottom: calc(80px + var(--safe-b)); } }
.toast button { background: none; border: 0; color: #9DBBE3; font-weight: 600; cursor: pointer; font-family: inherit; font-size: 14px; }
.outbox { position: fixed; left: 12px; bottom: calc(24px + var(--safe-b)); background: var(--dev-l); color: #6B4E00; font-size: 12.5px;
  padding: 6px 10px; border-radius: 999px; z-index: 50; }

/* ---------- matrix ---------- */
.matrix th { text-align: center !important; white-space: nowrap; }
.matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left !important; }
.cell { display: inline-block; min-width: 92px; padding: 4px 8px; border-radius: 7px; font-size: 12px; font-weight: 550; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 9vh auto 0; text-align: center; }
.login .card { padding: 28px 24px; }
.login .mark { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px; background: var(--brand-dark); color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 700; }
.login img.logo-img { max-height: 70px; max-width: 220px; margin: 0 auto 12px; display: block; }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border: 1px solid #8C8C8C;
  border-radius: 8px; background: #fff; color: #5E5E5E; font-weight: 600; font-size: 15px; }
.ms-btn:hover { text-decoration: none; background: #F7F7F7; }

@media (prefers-reduced-motion: reduce) { .bar > i { transition: none; } }
@media (max-width: 760px) { .hide-sm { display: none; } }

.bar > i.bg-top { background: var(--top); } .bar > i.bg-strong { background: var(--strong); }
.bar > i.bg-developing { background: var(--dev); } .bar > i.bg-concern { background: var(--concern); }
.btn { line-height: 1; }
.seg button { white-space: nowrap; }
