/* Native contest content, with one stable presentation owner. */
html body .main:has(.ph8550-contest-workspace) { padding-top:24px !important; }
html body .ph8550-contest-workspace {
  --pc-ink:#19344e; --pc-muted:#657a8f; --pc-line:#dce6ef; --pc-surface:#fff; --pc-soft:#f4f8fc; --pc-accent:#2868b6;
  --pc-status:"Trạng thái"; --pc-submit:"Nộp gần nhất"; --pc-score:"Điểm tối đa"; --pc-correction:"Sau kỳ thi"; --pc-actions:"Thao tác cuộc thi";
  display:grid; gap:22px; box-sizing:border-box; width:min(calc(100% - 32px),1180px) !important; max-width:1180px; margin:0 auto 32px !important; color:var(--pc-ink);
}
html:not([lang^="vi"]) body .ph8550-contest-workspace { --pc-status:"Status"; --pc-submit:"Last submission"; --pc-score:"Maximum score"; --pc-correction:"After contest"; --pc-actions:"Contest actions"; }
.ph8550-contest-workspace * { box-sizing:border-box; }
.ph8550-contest-workspace .ph8540-icon { flex:0 0 auto; display:inline-block; width:20px; height:20px; vertical-align:middle; }
.ph8550-contest-breadcrumb { display:flex; align-items:center; gap:9px; min-width:0; font-size:11px; color:var(--pc-muted); }
.ph8550-contest-breadcrumb>a { display:inline-flex; align-items:center; gap:7px; color:var(--pc-accent); }
.ph8550-contest-breadcrumb>.ph8540-icon { width:13px; height:13px; }
.ph8550-contest-hero { position:relative; overflow:hidden; padding:28px 30px 20px; border:1px solid #2c547b; border-radius:20px; color:#e3edf9; background:radial-gradient(ellipse at 100% 0%,#315b85,transparent 65%),linear-gradient(120deg,#10273e,#183b5c); box-shadow:0 12px 30px rgb(22 52 84 / 12%); }
.ph8550-contest-hero::after { position:absolute; right:-110px; top:-120px; width:380px; height:380px; border:1px solid rgb(255 255 255 / 9%); border-radius:50%; box-shadow:0 0 0 42px rgb(255 255 255 / 2.5%); content:""; pointer-events:none; }
.ph8550-contest-hero-top { position:relative; z-index:1; display:flex; align-items:center; gap:28px; }
.ph8550-contest-hero-top>div:first-child { flex:1; min-width:0; }
.ph8550-contest-eyebrow { display:block; color:#b6cee7; font-size:9px; font-weight:700; letter-spacing:.1em; }
.ph8550-contest-badges { display:flex; flex-wrap:wrap; gap:8px; margin:15px 0 12px; }
.ph8550-contest-badges>span { display:inline-flex; align-items:center; gap:5px; padding:4px 9px; border:1px solid rgb(198 220 245 / 20%); border-radius:7px; color:#d4e3f4; background:rgb(255 255 255 / 6%); font-size:10px; }
.ph8550-contest-badges .ph8540-icon { width:13px; height:13px; }
.ph8550-contest-state i { width:5px; height:5px; border-radius:50%; background:currentColor; }
.ph8550-contest-badges>.is-active { color:#abefd1; background:#184c43; border-color:#337362; }
.ph8550-contest-badges>.is-upcoming { color:#f3d59b; background:#4a3d28; border-color:#6c5938; }
html body .ph8550-contest-workspace .ph8550-contest-hero h1 { margin:0 !important; max-width:900px; color:#fff7e6 !important; font-size:clamp(25px,2.5vw,33px) !important; line-height:1.5 !important; overflow-wrap:anywhere; letter-spacing:-.02em; }
.ph8550-contest-crest { display:grid; place-items:center; flex:0 0 86px; width:86px; height:94px; border:1px solid rgb(229 205 155 / 30%); border-radius:24px; background:linear-gradient(140deg,rgb(244 213 157 / 15%),rgb(244 213 157 / 3%)); color:#efd39a; transform:rotate(5deg); }
.ph8550-contest-crest>.ph8540-icon { width:44px; height:44px; transform:rotate(-5deg); }
.ph8550-contest-facts { position:relative; z-index:1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; max-width:750px; margin-top:25px; }
.ph8550-contest-facts>div { display:flex; align-items:center; gap:12px; padding:12px 16px; border:1px solid rgb(180 210 244 / 16%); border-radius:11px; background:rgb(5 22 38 / 21%); }
.ph8550-contest-facts .ph8540-icon { width:23px; height:23px; color:#a4c9ed; }
.ph8550-contest-facts span { color:#b8cde3; font-size:10px; }
.ph8550-contest-facts strong { display:block; color:#f6e2b5; font-size:19px; line-height:1.45; }
.ph8550-contest-schedule { position:relative; z-index:1; display:flex; flex-wrap:wrap; gap:8px 24px; margin-top:20px; padding-top:16px; border-top:1px solid rgb(182 209 239 / 18%); color:#b6cce3; font-size:10px; }
.ph8550-contest-schedule b { margin-left:6px; color:#eef5fc; font-size:11px; font-weight:400; }
html body .ph8550-contest-schedule :is(a,.user-profile-name) { color:#eef5fc !important; }
.ph8550-contest-tabs { display:flex; flex-wrap:wrap; gap:8px; padding:7px; border:1px solid var(--pc-line); border-radius:13px; background:var(--pc-surface); }
html body .ph8550-contest-workspace .ph8550-contest-tabs>a { display:flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:9px 16px; border:1px solid transparent; border-radius:9px; color:var(--pc-muted) !important; font-size:12px; font-weight:700; text-decoration:none; }
.ph8550-contest-tabs>a>b { font-size:10px; font-weight:400; }
html body .ph8550-contest-workspace .ph8550-contest-tabs>a[aria-current="page"] { color:var(--pc-accent) !important; border-color:#d8e6f5; background:var(--pc-soft); }
html body .ph8550-contest-workspace>.row { display:grid !important; grid-template-columns:minmax(0,1fr) 270px; align-items:start; gap:22px; width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; }
html body .ph8550-contest-workspace>.row>.columns { float:none !important; width:auto !important; min-width:0; margin:0 !important; padding:0 !important; }
/* Legacy phone gutters use a negative margin on native sections. The workspace
   already owns its page gutters, so those sections must stay on the same grid. */
html body .ph8550-contest-workspace>.row>.columns>.section { width:100% !important; max-width:100% !important; margin-left:0 !important; margin-right:0 !important; }
html body .ph8550-contest-workspace>.row>.medium-9 { container-type:inline-size; container-name:ph8550-main; }
html body .ph8550-contest-workspace.ph8550-scoreboard>.row { grid-template-columns:minmax(0,1fr); }
html body .ph8550-contest-workspace .section { max-width:100%; margin-bottom:20px; border:1px solid var(--pc-line) !important; border-radius:15px !important; background:var(--pc-surface) !important; box-shadow:0 5px 18px rgb(24 55 88 / 4%); opacity:1 !important; transform:none !important; }
html body .ph8550-contest-workspace .section__header { padding:17px 20px; border-bottom:1px solid var(--pc-line); background:var(--pc-soft) !important; }
html body .ph8550-contest-workspace .section__title { color:var(--pc-ink) !important; font-size:17px !important; line-height:1.5; }
html body .ph8550-contest-workspace .section__body { color:var(--pc-ink) !important; background:var(--pc-surface) !important; }
html body .ph8550-contest-workspace .section__body.typo { padding:22px; font-size:14px; line-height:1.9; }
html body .ph8550-contest-workspace .richmedia :is(h1,h2,h3,h4) { color:var(--pc-ink) !important; line-height:1.5; }
html body .ph8550-contest-workspace .richmedia h2 { margin-top:26px; padding-bottom:10px; border-bottom:1px solid var(--pc-line); font-size:19px !important; }
html body .ph8550-contest-workspace .richmedia h2:first-child { margin-top:0; }
.ph8550-contest-workspace .richmedia p,.ph8550-contest-workspace .richmedia li { line-height:1.9; }
/* Hero owns overview metadata; retain the native section as the attempts host. */
.ph8550-overview .medium-9>.section:first-child>.section__header { display:none !important; }
.ph8550-overview .medium-9>.section:first-child>.section__body { display:flex; flex-wrap:wrap; gap:8px; padding:16px 18px !important; }
.ph8550-overview .medium-9>.section:first-child .problem__tag-item { display:none !important; }
.ph8550-overview .medium-9>.section:first-child:not(:has(.ph8488-contest-attempt-card)) { display:none; }
.ph8550-contest-workspace .ph8488-contest-attempt-card { flex:1 1 100%; width:100% !important; margin:0 !important; padding:14px !important; border-color:var(--pc-line) !important; border-radius:10px !important; color:var(--pc-ink) !important; background:var(--pc-soft) !important; }
.ph8550-contest-workspace .ph8496-attempt-summary { display:flex; flex-wrap:wrap; align-items:center; gap:7px 12px; }
.ph8550-contest-workspace .ph8496-attempt-summary>strong { font-size:13px !important; }
.ph8550-contest-workspace .ph8496-attempt-summary>span { font-size:11px !important; }
.ph8550-contest-workspace .ph8496-attempt-summary>small { width:100%; color:var(--pc-muted); font-size:10px !important; }
html body .ph8550-contest-workspace .section.side { overflow:hidden; }
.ph8550-contest-workspace .section.side:has(>.contest-sidebar__bg)::before,.ph8550-overview .medium-3>.section.side:first-child::before { display:block; padding:16px 18px; border-bottom:1px solid var(--pc-line); color:var(--pc-ink); background:var(--pc-soft); content:var(--pc-actions); font-family:var(--ph8550-font-ui); font-size:14px; font-weight:700; }
.ph8550-contest-workspace .contest-sidebar__bg { display:none !important; }
.ph8550-contest-workspace .section.side>.section__body.typo:has(dl) { display:none !important; }
html body .ph8550-contest-workspace .section.side .menu__link { display:flex !important; align-items:center; gap:9px; min-height:46px; padding:12px 18px !important; color:var(--pc-ink) !important; font-size:12px !important; line-height:1.5; white-space:normal; }
.ph8550-contest-workspace .section.side .menu__link>.icon { flex:0 0 18px; margin:0; color:var(--pc-accent); }
.ph8550-contest-workspace .section.side .menu__seperator { margin:5px 18px; border-color:var(--pc-line); }
.ph8550-contest-workspace .section__body.no-padding:has(table) { overflow-x:auto !important; overscroll-behavior-x:contain; }
html body .ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) { width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
html body .ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) :is(th,td) { padding:13px 12px !important; border-bottom:1px solid var(--pc-line); color:var(--pc-ink); font-size:12px !important; line-height:1.65; }
html body .ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) th { color:var(--pc-muted) !important; background:var(--pc-soft) !important; font-size:11px !important; white-space:nowrap; }
.ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) tbody tr:hover { background:var(--pc-soft); }
.ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) tbody tr:last-child td { border-bottom:0; }
.ph8550-problems .medium-9>.section:first-child .col--problem { min-width:230px; }
html body .ph8550-contest-workspace .ph8550-native-table { table-layout:fixed; border:0; }
.ph8550-native-table col.col--status { width:120px; }
.ph8550-native-table col.col--submit-at,.ph8550-native-table col.col--correction { width:145px; }
.ph8550-native-table col.col--score { width:72px; }
.ph8550-native-table col.col--problem { width:auto; }
html body .ph8550-problems .col--problem-name .typo-a>.icon { font-family:var(--ph8550-font-ui) !important; }
html body .ph8550-problems .col--problem-name>a:first-of-type { color:var(--pc-accent) !important; font-size:14px !important; line-height:1.7; }
.ph8550-problems .col--problem-name .problem__tag-item { margin:7px 4px 0 0; border-radius:5px; color:var(--pc-muted); background:var(--pc-soft); font-size:10px !important; }
.ph8550-contest-workspace .record_main__table { min-width:760px; }
.ph8550-scoreboard .overflow-hidden-horizontal { overflow-x:auto !important; }
.ph8550-scoreboard table:is(.data-table,.ph8550-native-table) { min-width:680px; }
.ph8550-scoreboard .section__title .button { min-height:34px; margin:4px; padding:6px 10px; font-size:10px !important; }
html.theme--dark body .ph8550-contest-workspace { --pc-ink:#e4d0a3; --pc-muted:#a7b7ca; --pc-line:#2c4058; --pc-surface:#121f30; --pc-soft:#192b42; --pc-accent:#a8caff; }
html.theme--dark body .ph8550-contest-workspace .section__body.typo { color:#dbe5f1 !important; }
html.theme--dark body .ph8550-contest-workspace table:is(.data-table,.ph8550-native-table) td { color:#dbe5f1; }
@media(max-width:900px) {
  html body .ph8550-contest-workspace>.row { grid-template-columns:minmax(0,1fr) 230px; gap:16px; }
  .ph8550-contest-hero { padding:25px; }
  .ph8550-contest-crest { flex-basis:64px; width:64px; height:76px; border-radius:19px; }
}
@media(max-width:700px) {
  html body .ph8550-contest-workspace>.row { grid-template-columns:1fr; }
  .ph8550-contest-hero { padding:22px 18px 18px; }
  .ph8550-contest-crest { display:none; }
  .ph8550-contest-facts { gap:8px; margin-top:20px; }
  .ph8550-contest-facts>div { gap:8px; padding:10px; }
  .ph8550-contest-facts .ph8540-icon { width:18px; height:18px; }
  .ph8550-contest-facts strong { font-size:16px; }
  .ph8550-contest-facts span { font-size:9px; }
  .ph8550-contest-schedule { flex-direction:column; gap:6px; }
  .ph8550-contest-tabs { gap:4px; padding:5px; }
  html body .ph8550-contest-workspace .ph8550-contest-tabs>a { flex:1 1 auto; min-height:44px; gap:6px; padding:8px; font-size:10px; }
  .ph8550-contest-tabs .ph8540-icon { width:16px; height:16px; }
  .ph8550-contest-workspace .section__body.typo { padding:18px !important; }
}
@container ph8550-main (max-width:600px) {
  .ph8550-problems .medium-9>.section:first-child table { display:block; }
  .ph8550-problems .medium-9>.section:first-child table colgroup { display:none; }
  .ph8550-problems .medium-9>.section:first-child table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .ph8550-problems .medium-9>.section:first-child table tbody { display:grid; gap:12px; padding:14px; }
  .ph8550-problems .medium-9>.section:first-child table tr { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; padding:14px; border:1px solid var(--pc-line); border-radius:12px; }
  html body .ph8550-problems .medium-9>.section:first-child table td { display:block; min-width:0; height:auto; padding:0 !important; border:0; font-size:11px !important; }
  .ph8550-problems .medium-9>.section:first-child table td.col--problem-name { order:-1; flex:1 1 100%; margin-bottom:8px; }
  .ph8550-problems .medium-9>.section:first-child table td:not(.col--problem-name)::before { display:block; margin-bottom:3px; color:var(--pc-muted); font-family:var(--ph8550-font-ui); font-size:9px; }
  .ph8550-problems td.col--status::before { content:var(--pc-status); }
  .ph8550-problems td.col--submit-at::before { content:var(--pc-submit); }
  .ph8550-problems td.col--score::before { content:var(--pc-score); }
  .ph8550-problems td.col--correction::before { content:var(--pc-correction); }
  .ph8550-problems .col--problem-name .typo-a { display:inline-flex; align-items:center; min-height:36px; padding:4px 8px; }
}
@media(max-width:450px) {
  html body .main:has(.ph8550-contest-workspace) { padding-top:16px !important; }
  html body .ph8550-contest-workspace { width:calc(100% - 24px) !important; gap:16px; }
  .ph8550-contest-hero { border-radius:15px; }
  html body .ph8550-contest-workspace .ph8550-contest-hero h1 { font-size:24px !important; }
  .ph8550-contest-facts>div { flex-direction:column; align-items:start; gap:6px; padding:10px; }
  .ph8550-contest-facts strong { font-size:15px; }
  .ph8550-contest-tabs>a>b { display:none; }
}
