:root{
  --navy:#16264c; --navy2:#1f3565; --yellow:#ffc93c; --bg:#f2f5fc;
  --card:#ffffff; --ink:#1d2739; --muted:#5b6b8c; --line:#dde4f2;
  --green:#1e9e6a; --green-bg:#e6f7ef; --red:#d64545; --red-bg:#fdeeee;
  --amber:#b97d0f; --amber-bg:#fdf3dd; --radius:16px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:"Be Vietnam Pro",system-ui,sans-serif;background:var(--bg);color:var(--ink);font-size:16px;line-height:1.55}
h1,h2,h3,.brand-title{font-family:"Baloo 2","Be Vietnam Pro",sans-serif}

/* ===== Top bar ===== */
.topbar{position:sticky;top:0;z-index:50;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;box-shadow:0 2px 10px rgba(10,20,50,.25)}
.brand{display:flex;align-items:center;gap:12px;background:none;border:0;color:#fff;cursor:pointer;text-align:left;padding:0}
.brand-badge{width:44px;height:44px;border-radius:50%;background:var(--yellow);color:var(--navy);font-family:"Baloo 2",sans-serif;font-size:26px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:none}
.brand-title{display:block;font-size:20px;font-weight:800;line-height:1.15}
.brand-sub{display:block;font-size:12.5px;color:#bcd0ff;font-family:"Be Vietnam Pro",sans-serif}
.top-progress{font-size:14px;font-weight:600;background:var(--navy2);border:1px solid #33508f;padding:7px 14px;border-radius:999px;white-space:nowrap}
.top-progress b{color:var(--yellow)}

main{max-width:960px;margin:0 auto;padding:22px 16px 40px}

/* ===== Hero ===== */
.hero{background:linear-gradient(135deg,var(--navy) 0%,var(--navy2) 100%);color:#fff;border-radius:22px;padding:28px 28px 24px;margin-bottom:26px}
.hero h1{margin:0 0 10px;font-size:30px;line-height:1.2}
.hero p{margin:0 0 18px;color:#dbe6ff;max-width:720px}
.hero p b{color:#fff}
.hero-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:18px}
.hstep{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-radius:12px;padding:10px 12px;font-size:14.5px;display:flex;gap:10px;align-items:flex-start}
.hstep span{background:var(--yellow);color:var(--navy);font-weight:800;width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none;font-size:14px}
.hero-samples{display:flex;flex-wrap:wrap;gap:10px;align-items:center;font-size:14.5px;color:#dbe6ff}

/* ===== Buttons ===== */
.btn{display:inline-block;border:0;cursor:pointer;font-family:inherit;font-weight:700;font-size:15px;padding:11px 18px;border-radius:12px;text-decoration:none;transition:transform .05s ease, box-shadow .15s ease}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--yellow);color:var(--navy)}
.btn-primary:hover{box-shadow:0 4px 14px rgba(255,201,60,.45)}
.btn-light{background:#fff;color:var(--navy)}
.btn-ghost{background:#eef2fb;color:var(--navy);border:1px solid var(--line)}
.btn-big{font-size:17px;padding:14px 22px}

/* ===== Group sections & problem cards ===== */
.group-head{display:flex;align-items:center;gap:12px;margin:30px 0 6px}
.group-dot{width:16px;height:16px;border-radius:5px;flex:none}
.group-head h2{margin:0;font-size:23px;color:var(--navy)}
.group-desc{color:var(--muted);margin:0 0 14px;max-width:760px}
.group-progress{display:flex;align-items:center;gap:10px;margin:0 0 14px;font-size:14px;color:var(--muted);font-weight:600}
.progress-track{flex:1;max-width:320px;height:10px;background:#e3e9f5;border-radius:99px;overflow:hidden}
.progress-fill{height:100%;background:var(--green);border-radius:99px;transition:width .3s ease}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}
.pcard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;cursor:pointer;text-align:left;font-family:inherit;display:flex;flex-direction:column;gap:8px;transition:box-shadow .15s ease, transform .1s ease}
.pcard:hover{box-shadow:0 8px 22px rgba(22,38,76,.13);transform:translateY(-2px)}
.pcard-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.pcard-code{font-weight:800;color:var(--muted);font-size:13px;letter-spacing:.4px}
.stars{color:var(--yellow);font-size:15px;letter-spacing:2px;text-shadow:0 0 1px #a87400}
.pcard h3{margin:0;font-size:18px;color:var(--navy);line-height:1.3}
.pcard p{margin:0;color:var(--muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pcard-status{margin-top:auto;font-size:13.5px;font-weight:700;padding:5px 10px;border-radius:999px;align-self:flex-start}
.st-none{background:#eef2fb;color:var(--muted)}
.st-submitted{background:var(--amber-bg);color:var(--amber)}
.st-done{background:var(--green-bg);color:var(--green)}

.note-card{background:#fff;border:1px dashed #b9c6e4;border-radius:var(--radius);padding:18px 20px;margin-top:30px}
.note-card h3{margin:0 0 6px;color:var(--navy)}
.note-card p{margin:0;color:var(--muted)}

/* ===== Problem page ===== */
.back-btn{margin-bottom:14px}
.p-head{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;margin-bottom:16px}
.p-head h1{margin:4px 0 8px;font-size:27px;color:var(--navy);line-height:1.25}
.p-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chip{font-size:13px;font-weight:700;padding:4px 11px;border-radius:999px;background:#eef2fb;color:var(--navy)}
.chip-group{color:#fff}
.p-status-line{margin-top:10px;font-weight:700}
.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;margin-bottom:16px}
.card h2{margin:0 0 12px;font-size:20px;color:var(--navy)}
.card p{margin:0 0 10px}
.card p:last-child{margin-bottom:0}
.io-note{background:#f6f9ff;border-left:4px solid var(--navy);padding:10px 14px;border-radius:0 10px 10px 0;color:#33436b}
table.io{width:100%;border-collapse:collapse;font-size:15px}
table.io th,table.io td{border:1px solid var(--line);padding:9px 12px;text-align:left;vertical-align:top}
table.io th{background:#f0f4fd;color:var(--navy)}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:14.5px}

/* Hints */
.hint-row{display:flex;gap:10px;align-items:stretch;margin-bottom:10px;flex-wrap:wrap}
.hint-btn{flex:1;min-width:170px}
.hint-body{background:var(--amber-bg);border:1px solid #f0d492;border-radius:12px;padding:12px 16px;margin-bottom:12px}
.hint-body p{margin:0}

/* Upload */
.upload-zone{border:2px dashed #aebfdd;border-radius:14px;padding:26px 18px;text-align:center;background:#f8faff;cursor:pointer}
.upload-zone.dragover{border-color:var(--navy);background:#eef3ff}
.upload-zone p{margin:0 0 6px;font-size:16.5px}
.upload-zone .small{color:var(--muted);font-size:14px}
.upload-error{background:var(--red-bg);color:var(--red);border-radius:10px;padding:10px 14px;margin-top:12px;font-weight:600}
.analysis-summary{background:#f6f9ff;border-radius:12px;padding:12px 16px;margin-bottom:14px}
.analysis-summary p{margin:0 0 4px}
.check-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.check-list li{border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;gap:12px}
.check-list li.pass{background:var(--green-bg);border-color:#b9e5cf}
.check-list li.fail{background:var(--red-bg);border-color:#f2c1c1}
.check-ico{font-size:19px;flex:none;line-height:1.35}
.check-label{font-weight:700}
.check-found{color:var(--muted);font-size:13.5px;font-weight:600}
.check-miss{margin-top:5px;font-size:14.5px}
.verdict{border-radius:12px;padding:14px 16px;font-weight:700;margin-top:14px}
.verdict.ok{background:var(--green-bg);color:#0f6b43}
.verdict.notyet{background:var(--amber-bg);color:#7a5205}

/* Tests self-check */
.test-done{display:flex;gap:12px;align-items:flex-start;background:#f6f9ff;border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-top:14px;cursor:pointer}
.test-done input{width:21px;height:21px;margin-top:2px;flex:none;accent-color:var(--green)}
.test-done span{font-weight:600}

/* Solution & errors */
.locked-box{text-align:center;padding:8px 0 2px}
.locked-box p{color:var(--muted)}
ol.steps{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:8px}
.err-item{border-left:4px solid var(--red);background:#fff8f8;border-radius:0 10px 10px 0;padding:10px 14px;margin-bottom:10px}
.err-item b{color:#a52a2a}
.err-item p{margin:4px 0 0}

.footer{text-align:center;color:var(--muted);font-size:13.5px;padding:10px 16px 30px}

@media (max-width:640px){
  .hero{padding:22px 18px}
  .hero h1{font-size:24px}
  .brand-title{font-size:17px}
  .top-progress{display:none}
  .p-head h1{font-size:23px}
  .card,.p-head{padding:16px}
}
