:root {
  color: #17213b;
  background: #f3f5fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --blue: #364f91;
  --blue-dark: #25386d;
  --red: #d20011;
  --ink: #17213b;
  --muted: #68728a;
  --line: #dfe3ed;
  --surface: #fff;
  --success: #16825b;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f3f5fa; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 9px; color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.site-header { position: sticky; z-index: 20; top: 0; min-height: 76px; padding: 0 clamp(20px, 5vw, 72px); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 15px; text-decoration: none; }
.brand img { width: 152px; height: auto; }
.brand span { display: grid; padding-left: 15px; border-left: 1px solid var(--line); }
.brand b { font-size: 13px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.site-header nav { justify-self: center; display: flex; gap: 7px; }
.site-header nav a { padding: 10px 13px; border-radius: 9px; color: #566078; font-size: 13px; font-weight: 800; text-decoration: none; }
.site-header nav a:hover, .site-header nav a.active { color: var(--blue); background: #eef1fa; }
.account-menu { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.account-menu button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: #fff; cursor: pointer; }
.page-shell { width: min(1220px, calc(100% - 40px)); margin: 36px auto 76px; }
.hero-card { position: relative; overflow: hidden; min-height: 250px; padding: clamp(30px, 5vw, 55px); display: flex; align-items: center; justify-content: space-between; gap: 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #273a72, var(--blue)); box-shadow: 0 22px 54px rgba(38,56,109,.18); }
.hero-card::after { content: ""; position: absolute; width: 280px; height: 280px; right: -75px; top: -110px; border: 56px solid rgba(210,0,17,.13); border-radius: 50%; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #ffc0c5; }
.hero-card h1 { margin: 0; font-size: clamp(35px, 5vw, 58px); letter-spacing: -.04em; }
.hero-card p:last-child { color: rgba(255,255,255,.72); }
.hero-badge { min-width: 150px; padding: 21px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(255,255,255,.08); }
.hero-badge span, .hero-badge b { display: block; }
.hero-badge span { color: rgba(255,255,255,.65); font-size: 11px; }
.hero-badge b { margin-top: 8px; font-size: 25px; }
.notice { padding: 13px 16px; border-left: 3px solid var(--red); border-radius: 7px; color: #77232a; background: #fff0f1; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 22px 0; }
.stat-card { min-height: 138px; padding: 23px; display: grid; align-content: space-between; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 9px 28px rgba(31,48,88,.05); }
.stat-card > span { color: var(--muted); font-size: 13px; }
.stat-card b { margin: 8px 0; color: var(--blue); font-size: 34px; }
.stat-card b.small-stat { font-size: 21px; }
.stat-card small { color: #9ca3b3; font-size: 9px; letter-spacing: .16em; }
.content-grid, .workspace-grid, .admin-grid { min-width: 0; display: grid; gap: 18px; }
.content-grid { grid-template-columns: 1.15fr .85fr; }
.workspace-grid { grid-template-columns: minmax(320px,.78fr) minmax(480px,1.22fr); }
.admin-grid { grid-template-columns: minmax(0,1.4fr) minmax(290px,.6fr); }
.panel { min-width: 0; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(34,49,85,.05); }
.panel-heading, .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading { margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 20px; }
.page-heading { margin-bottom: 25px; }
.page-heading h1 { margin: 0; font-size: clamp(34px,4vw,50px); letter-spacing: -.04em; }
.page-heading p:last-child { color: var(--muted); }
.progress-list, .inventory-list, .management-list { display: grid; gap: 10px; }
.progress-row, .inventory-row, .management-row { padding: 14px; border: 1px solid #e8ebf2; border-radius: 11px; background: #fafbfe; }
.progress-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; align-items: center; }
.progress-track { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; background: #e3e7f1; }
.progress-track::-webkit-progress-bar { border-radius: 99px; background: #e3e7f1; }
.progress-track::-webkit-progress-value { border-radius: 99px; background: var(--blue); }
.progress-track::-moz-progress-bar { border-radius: 99px; background: var(--blue); }
.inventory-row, .management-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.inventory-row b, .management-row b { color: var(--blue); }
.management-row button { border: 0; color: var(--blue); background: none; cursor: pointer; font-weight: 800; }
.level-section { margin-top: 18px; }
.level-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.level-card { min-height: 140px; padding: 18px; border: 1px solid #e4e8f1; border-radius: 14px; background: #fafbfe; }
.level-card { cursor: pointer; }
.level-card:hover, .level-card:focus-within { border-color: var(--blue); box-shadow: 0 10px 24px rgba(54,79,145,.1); }
.level-card span { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.level-card h3 { margin: 12px 0 8px; font-size: 16px; }
.level-card p { margin: 0; color: var(--muted); font-size: 12px; }
.empty-copy { color: var(--muted); font-size: 13px; }
.button { display: inline-grid; min-height: 40px; padding: 0 15px; place-items: center; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 850; text-decoration: none; }
.button-primary { border: 1px solid var(--blue); color: #fff; background: var(--blue); }
.button-secondary { border: 1px solid var(--line); color: var(--blue); background: #fff; }
.button-danger { border: 1px solid #f0c6c9; color: var(--red); background: #fff5f5; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.count-pill { padding: 6px 9px; border-radius: 99px; color: var(--blue); background: #eef1fa; font-size: 11px; font-weight: 800; }
.search-field { display: block; margin-bottom: 14px; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid #cbd2df; border-radius: 9px; outline: 0; background: #fff; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(54,79,145,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, .block-field { display: grid; gap: 7px; color: #3e475d; font-size: 12px; font-weight: 800; }
.block-field { margin-top: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.inline-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.inline-filter select { width: 150px; }
.table-wrap { min-width: 0; max-width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 10px; border-bottom: 1px solid #e9ecf2; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; }
td button { border: 0; color: var(--blue); background: none; cursor: pointer; font-weight: 800; }
.detail-panel hr { margin: 25px 0; border: 0; border-top: 1px solid var(--line); }
.editor-panel > hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.mission-panel { margin-top: 18px; }
.mission-summary { color: var(--blue); font-size: 17px; font-weight: 800; }
.mission-instructions { color: var(--muted); line-height: 1.75; white-space: pre-wrap; }
.mission-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 24px 0; }
.mission-columns h3, .practice-card h3 { margin: 0 0 12px; }
.mission-list { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.resource-list { display: grid; gap: 10px; }
.resource-item { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfe; }
.resource-item h4 { margin: 0 0 7px; }
.resource-item p { margin: 0; color: var(--muted); white-space: pre-wrap; }
.resource-item img { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; object-fit: contain; }
.resource-icon { width: 34px; height: 34px; color: var(--blue); }
.practice-card { padding: 20px; border: 1px solid #dce2f0; border-radius: 14px; background: #f8f9fd; }
.practice-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.practice-heading span { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.practice-heading p { max-width: 460px; margin: 0; color: var(--muted); font-size: 12px; }
.practice-status { min-height: 20px; color: var(--blue); font-size: 13px; font-weight: 800; }
.detail-list { display: grid; gap: 12px; margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 20px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 800; text-align: right; }
.page-message { min-height: 20px; color: var(--red); font-size: 13px; }
.page-message.success { color: var(--success); }
.landing-page { color: #fff; background: radial-gradient(circle at 80% 20%, rgba(210,0,17,.2), transparent 23%), linear-gradient(135deg,#1f3063,var(--blue)); }
.landing-shell { width: min(900px, calc(100% - 42px)); min-height: 100vh; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.landing-brand { padding: 14px 20px; border-radius: 14px; background: #fff; box-shadow: 0 20px 45px rgba(8,17,48,.25); }
.landing-brand img { display: block; width: min(260px,65vw); }
.landing-shell .eyebrow { margin-top: 45px; color: #ffc0c5; }
.landing-shell h1 { margin: 0; font-size: clamp(42px,8vw,80px); letter-spacing: -.05em; }
.landing-shell > p:not(.eyebrow) { max-width: 650px; color: rgba(255,255,255,.74); font-size: 18px; line-height: 1.8; }
.landing-action { margin-top: 24px; color: var(--blue); border-color: #fff; background: #fff; }
.landing-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 42px; color: rgba(255,255,255,.65); font-size: 12px; }

@media (max-width: 940px) {
  .site-header { grid-template-columns: 1fr auto; padding: 12px 20px; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .workspace-grid, .admin-grid, .mission-columns { grid-template-columns: minmax(0,1fr); }
  .level-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 660px) {
  .page-shell { width: calc(100% - 24px); margin-top: 18px; }
  .brand img { width: 128px; }
  .brand span { display: none; }
  .account-menu > span { display: none; }
  .hero-card { align-items: flex-start; flex-direction: column; border-radius: 18px; }
  .stat-grid, .content-grid, .level-grid, .form-grid { grid-template-columns: 1fr; }
  .page-heading, .panel-heading { align-items: flex-start; }
  .page-heading { flex-direction: column; }
  .panel { padding: 19px; }
  .progress-row { grid-template-columns: 72px 1fr; }
  .progress-row > b { grid-column: 2; }
}
