:root{
  color-scheme:light dark;

  /* Thương hiệu */
  --brand-red:#b11b2b;
  --brand-blue:#01417e;
  --accent:#01417e;
  --accent-tint:rgba(1,65,126,.10);
  --accent-tint-strong:rgba(1,65,126,.16);

  /* Nền phân tầng */
  --bg:#f2f2f7;
  --bg-elevated:#ffffff;
  --bg-header:rgba(255,255,255,.72);
  --fill-1:rgba(120,120,128,.12);
  --fill-2:rgba(120,120,128,.08);
  --fill-3:rgba(120,120,128,.05);
  --separator:rgba(60,60,67,.29);
  --separator-soft:rgba(60,60,67,.13);

  /* Chữ */
  --label:rgba(0,0,0,.92);
  --label-2:rgba(60,60,67,.62);
  --label-3:rgba(60,60,67,.38);
  --on-accent:#ffffff;
  --on-dark:#ffffff;

  --shadow-1:0 1px 2px rgba(0,0,0,.05),0 0 1px rgba(0,0,0,.04);
  --shadow-2:0 4px 16px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.04);

  --r-s:8px; --r-m:12px; --r-l:16px; --r-pill:980px;

  --font-ui:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",system-ui,sans-serif;
  --font-body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",system-ui,sans-serif;
  --font-display:"Bricolage Grotesque",-apple-system,BlinkMacSystemFont,system-ui,sans-serif;

  /* Màu nguyên tố */
  --ether:#01417e;
  --hoa:#b11b2b;
  --tho:#d0661d;
  --thuy:#1969b4;
  --phong:#3d94f1;
  --sun:#ff9500;
  --axis:#3c3c43;
  --zone:var(--accent);

  /* Bí danh cho các style nội tuyến còn lại */
  --ink:var(--label);
  --ink-65:var(--label-2);
  --ink-45:var(--label-3);
  --ink-label:var(--label-2);
  --canvas:var(--bg-elevated);
  --surface-muted:var(--fill-2);
  --surface-pill:var(--fill-1);
  --hairline:var(--separator-soft);
  --hairline-soft:var(--separator-soft);
  --divider-light:var(--separator-soft);
  --nav-muted:var(--label-2);
  --accent-orange:#ff9500;
  --accent-orange-soft:rgba(255,149,0,.20);
  --accent-orange-deep:#c93400;
}
@media (prefers-color-scheme:dark){
  :root{
    --accent:#5aa9f0;
    --accent-tint:rgba(90,169,240,.16);
    --accent-tint-strong:rgba(90,169,240,.24);
    --bg:#000000;
    --bg-elevated:#1c1c1e;
    --bg-header:rgba(28,28,30,.72);
    --fill-1:rgba(120,120,128,.24);
    --fill-2:rgba(120,120,128,.18);
    --fill-3:rgba(120,120,128,.12);
    --separator:rgba(84,84,88,.65);
    --separator-soft:rgba(84,84,88,.40);
    --label:rgba(255,255,255,.95);
    --label-2:rgba(235,235,245,.60);
    --label-3:rgba(235,235,245,.35);
    --shadow-1:none;
    --shadow-2:0 4px 16px rgba(0,0,0,.5);
    --phong:#6bb2f7;
    --thuy:#4a9ae0;
    --hoa:#ff6961;
    --tho:#ff9f5a;
    --brand-red:#ff6961;
  }
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--label);
  font-family:var(--font-ui);
  font-size:17px;
  line-height:1.47;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1080px;margin:0 auto;padding:0 20px}

/* ---------- Bố cục ---------- */
.shell{
  display:grid;
  grid-template-columns:252px minmax(0,860px);
  grid-template-rows:auto 1fr;
  justify-content:center;
  column-gap:40px;
  max-width:1200px;
  margin:0 auto;
  padding:0 32px;
  align-items:start;
}
.sidebar{
  grid-column:1;
  grid-row:1 / span 2;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
  padding:24px 0 32px;
}
.masthead{
  grid-column:2;
  grid-row:1;
  padding:32px 0 12px;
}
main{
  grid-column:2;
  grid-row:2;
  padding:12px 0 48px;
  min-width:0;
}

.brand{display:inline-block;line-height:0;flex:none}
.brand img{
  width:80px;height:80px;object-fit:contain;padding:8px;
  background:transparent;
  border:1px solid var(--separator-soft);
  border-radius:var(--r-m);
  /* Ảnh gốc là JPEG nền trắng: multiply cho nền hòa vào nền trang */
  mix-blend-mode:multiply;
}
@media (prefers-color-scheme:dark){
  .brand img{mix-blend-mode:normal;background:#fff;border-color:transparent}
}
.sidebar .brand{margin:0 0 20px;padding:0 12px}
.masthead .brand{display:none}
h1{
  font-family:var(--font-display);
  font-size:28px;font-weight:700;line-height:1.15;letter-spacing:-.02em;margin:0;
}
.sub{color:var(--label-2);margin:6px 0 0;max-width:60ch;font-size:15px;font-weight:400;line-height:1.45}

/* ---------- Sidebar kiểu macOS ---------- */
.sidebar nav{display:flex;flex-direction:column;gap:2px;overflow:visible}
.sidebar nav button{
  display:flex;align-items:center;gap:12px;
  width:100%;text-align:left;cursor:pointer;
  padding:9px 12px;margin:0;
  background:transparent;border:0;border-radius:var(--r-s);
  font:inherit;font-size:15px;font-weight:500;line-height:1.4;color:var(--label);
  transition:background .18s ease-out,color .18s ease-out;
}
.sidebar nav button svg{
  width:20px;height:20px;flex:none;
  stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
  color:var(--label-2);
  transition:color .18s ease-out;
}
.sidebar nav button:hover{background:var(--fill-3)}
.sidebar nav button[aria-selected="true"]{
  background:var(--accent-tint);
  color:var(--accent);
  font-weight:600;
}
.sidebar nav button[aria-selected="true"] svg{color:var(--accent);stroke-width:2.1}

:focus-visible{
  outline:3px solid color-mix(in srgb,var(--accent) 45%,transparent);
  outline-offset:2px;
}
.panel[hidden]{display:none}

/* ---------- Bản đồ nhà ---------- */
.plan-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:24px;align-items:start}
.plan-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;gap:12px}
.hint{color:var(--label-2);font-size:14px;line-height:1.45}
.grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:10px;
  aspect-ratio:1/1;
}
.cell{
  position:relative;display:flex;flex-direction:column;justify-content:flex-end;
  gap:4px;padding:12px;text-align:left;cursor:pointer;
  background:var(--bg-elevated);border:0;border-radius:var(--r-m);
  box-shadow:var(--shadow-1);
  font:inherit;color:var(--label);
  transition:background .18s ease-out,box-shadow .18s ease-out,transform .1s ease-out;
}
.cell:active{transform:scale(.98)}
.cell[aria-pressed="true"]{
  background:var(--accent-tint);
  box-shadow:inset 0 0 0 2px var(--accent);
}
.cell .dir{font-weight:600;font-size:16px;line-height:1.3;display:flex;align-items:center;gap:7px}
.cell .dir::before{
  content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--z);
}
.cell .meta{font-size:12px;color:var(--label-2);line-height:1.4}
.rank{
  width:22px;height:22px;border-radius:50%;margin:0 0 auto;
  background:var(--brand-red);color:#fff;font-size:12px;font-weight:600;
  display:grid;place-items:center;
}
.tally{
  position:absolute;top:10px;right:10px;font-size:12px;font-weight:600;line-height:1.4;
  color:var(--label);background:var(--accent-orange-soft);border-radius:var(--r-pill);padding:2px 9px;
}
.tally[hidden]{display:none}
.compass{display:flex;justify-content:center;font-size:12px;font-weight:600;color:var(--label-2);letter-spacing:.06em;margin-bottom:8px}

.detail{
  background:var(--bg-elevated);
  border:0;border-radius:var(--r-l);
  box-shadow:var(--shadow-1);
  padding:24px;
  scroll-margin-top:72px;
}
.detail h2{
  font-family:var(--font-display);
  font-size:22px;font-weight:700;line-height:1.2;letter-spacing:-.01em;margin:0;
  display:flex;align-items:center;gap:9px;
}
.detail h2::before{
  content:"";flex:none;width:10px;height:10px;border-radius:50%;background:var(--zone);
}
.tagline{color:var(--label-2);font-weight:400;margin:6px 0 16px;font-size:15px;line-height:1.45}
.facts{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px}
.facts span{
  font-size:13px;font-weight:600;line-height:1.4;
  background:var(--fill-1);border-radius:var(--r-pill);padding:5px 12px;
}
.detail h3{
  font-size:13px;font-weight:600;margin:18px 0 6px;color:var(--label-2);
  text-transform:uppercase;letter-spacing:.06em;line-height:1.4;
}
.detail ul{margin:0;padding-left:22px}
.detail li{margin-bottom:4px;font-family:var(--font-body);font-size:16px;line-height:1.5}
.detail p{margin:0;font-family:var(--font-body);font-size:16px;line-height:1.5}
.note{
  margin-top:16px;padding-top:14px;
  border-top:.5px solid var(--separator-soft);
  font-size:15px;color:var(--label-2);
  font-family:var(--font-ui);line-height:1.45;
}

/* ---------- Nội dung dài ---------- */
.prose{
  max-width:none;
  background:var(--bg-elevated);
  border-radius:var(--r-l);
  box-shadow:var(--shadow-1);
  padding:28px 32px;
}
/* Giữ độ dài dòng dễ đọc dù cột nội dung rộng hơn */
.prose h2,.prose h3,.prose p,.prose ul,.prose ol,.prose .pull{max-width:68ch}
.prose h2{
  font-family:var(--font-display);
  font-size:22px;font-weight:700;line-height:1.2;letter-spacing:-.01em;margin:32px 0 8px;
}
.prose h2:first-child{margin-top:0}
.prose h3{font-size:17px;font-weight:600;line-height:1.35;margin:24px 0 6px}
.prose p,.prose li{font-family:var(--font-body);font-size:17px;font-weight:400;line-height:1.5}
.prose p{margin:0 0 14px}
.prose ul,.prose ol{margin:0 0 16px;padding-left:24px}
.prose li{margin-bottom:8px}
.prose li::marker{color:var(--label-2)}
strong{font-weight:600}

table{border-collapse:collapse;width:100%;margin:4px 0 12px}
th,td{
  text-align:left;padding:12px 10px;
  border-bottom:.5px solid var(--separator-soft);
  vertical-align:top;
  font-family:var(--font-body);font-size:16px;line-height:1.5;
}
td:first-child{font-weight:600}
th{
  font-family:var(--font-ui);font-weight:600;font-size:13px;line-height:1.4;
  text-transform:uppercase;letter-spacing:.05em;
  color:var(--label-2);border-bottom:.5px solid var(--separator);
}
tr:last-child td{border-bottom:0}
.table-scroll{
  overflow-x:auto;scrollbar-width:none;
  background:var(--fill-3);border-radius:var(--r-m);
  padding:6px 16px;margin:8px 0 20px;
}
.table-scroll::-webkit-scrollbar{display:none}
.pull{
  background:var(--fill-2);
  border-radius:var(--r-m);
  padding:16px 18px;
  margin:0 0 16px;
}
.pull p{
  font-family:var(--font-ui);
  font-size:17px;font-weight:500;line-height:1.45;
  margin:0;
}

/* ---------- Danh sách kiểm tra ---------- */
.chk-head{display:flex;flex-wrap:wrap;gap:16px;justify-content:space-between;align-items:flex-end;margin-bottom:20px}
.chk-cols{columns:2;column-gap:20px}
.chk-group{
  break-inside:avoid;margin-bottom:20px;
  background:var(--bg-elevated);
  border-radius:var(--r-m);
  box-shadow:var(--shadow-1);
  overflow:hidden;
}
.chk-group h3{
  display:flex;align-items:center;gap:8px;
  font-size:13px;font-weight:600;line-height:1.4;
  text-transform:uppercase;letter-spacing:.05em;color:var(--label-2);
  margin:0;padding:12px 16px 10px;
  border-bottom:.5px solid var(--separator-soft);
}
.chk-group h3::before{
  content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--z);
}
.chk-group h3 small{font-weight:500;color:var(--label-3);font-size:12px;letter-spacing:0;text-transform:none}
.chk{
  display:flex;gap:12px;align-items:flex-start;
  min-height:44px;padding:11px 16px;cursor:pointer;
  font-size:16px;line-height:1.4;
  transition:background .15s ease-out;
}
.chk + .chk{border-top:.5px solid var(--separator-soft)}
.chk:active{background:var(--fill-3)}
.chk input{
  margin:1px 0 0;accent-color:var(--accent);
  width:21px;height:21px;flex:none;border-radius:50%;
}
.chk input:checked+span{color:var(--label-2)}

.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;max-width:76ch}
.chip{
  font:inherit;font-size:15px;font-weight:500;line-height:1.4;cursor:pointer;text-align:left;
  background:var(--bg-elevated);color:var(--label);
  border:.5px solid var(--separator-soft);border-radius:var(--r-pill);
  box-shadow:var(--shadow-1);
  padding:9px 16px;
  transition:background .18s ease-out,color .18s ease-out,transform .1s ease-out;
}
.chip:active{transform:scale(.97)}
.chip[aria-pressed="true"]{
  background:var(--accent);color:var(--on-accent);border-color:transparent;font-weight:600;
}
.care{
  margin-top:14px;padding:14px 16px;
  background:var(--accent-tint);
  border-radius:var(--r-m);
  font-size:15px;line-height:1.45;color:var(--label);
}
.care p{margin:0}
.score{
  background:var(--bg-elevated);
  border-radius:var(--r-l);
  box-shadow:var(--shadow-1);
  padding:20px;
  margin-top:16px;
}
.score h3{margin:0 0 12px;font-size:17px;font-weight:600;line-height:1.35}
.bars{display:grid;gap:4px;margin:0 0 14px}
.bar{
  display:grid;grid-template-columns:96px 1fr 40px;gap:10px;align-items:center;
  margin:0 -8px;padding:7px 8px;
  background:transparent;border:0;border-radius:var(--r-s);
  font:inherit;font-size:14px;line-height:1.4;color:var(--label);
  text-align:left;cursor:pointer;
  transition:background .15s ease-out;
}
.bar:hover{background:var(--fill-3)}
.bar:active{background:var(--fill-2)}
.bar i{display:block;height:6px;background:var(--z);border-radius:3px;min-width:4px}
.bar em{font-style:normal;color:var(--label-2);text-align:right}
.zlink{
  font:inherit;font-weight:600;color:var(--accent);
  background:none;border:0;padding:0;cursor:pointer;
  text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent) 35%,transparent);
  text-underline-offset:2px;
}
.zlink:hover{text-decoration-color:var(--accent)}
.btn{
  min-height:44px;padding:0 18px;cursor:pointer;
  background:var(--accent-tint);color:var(--accent);
  border:0;border-radius:var(--r-m);
  font-family:var(--font-ui);font-size:16px;font-weight:600;line-height:1.3;
  transition:background .18s ease-out,transform .1s ease-out;
}
.btn:hover{background:var(--accent-tint-strong)}
.btn:active{transform:scale(.98)}

/* ---------- Chân trang ---------- */
footer{
  margin-top:8px;padding:20px 32px 40px;
  color:var(--label-2);font-size:16px;line-height:1.47;
}
footer .wrap{max-width:1152px;padding:0}
footer p{margin:0 0 12px;font-family:var(--font-body);font-size:16px;line-height:1.5}
footer b{color:var(--label);font-weight:600;font-family:var(--font-ui)}

/* Hai mục lưu ý gộp thành một thẻ, mỗi mục là một hàng bấm để mở */
.notes{
  margin-top:24px;
  background:var(--bg-elevated);
  border-radius:var(--r-m);
  box-shadow:var(--shadow-1);
  overflow:hidden;
}
.notes .source + .source{border-top:.5px solid var(--separator-soft)}
.source summary{
  cursor:pointer;list-style:none;list-style-type:none;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:48px;padding:13px 18px;
  color:var(--label);font-family:var(--font-ui);
  font-size:16px;font-weight:600;line-height:1.4;
  transition:background .15s ease-out;
}
.source summary:hover{background:var(--fill-3)}
.source summary svg{
  width:20px;height:20px;flex:none;
  stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
  color:var(--accent);
}
.source summary span{flex:1;min-width:0}
.source summary::marker{content:""}
.source summary::-webkit-details-marker{display:none}
.source summary::after{
  content:"";flex:none;width:8px;height:8px;
  border-right:2px solid var(--label-3);border-bottom:2px solid var(--label-3);
  transform:rotate(-45deg);
  transition:transform .2s ease-out;
}
.source[open] summary::after{transform:rotate(45deg)}
.source-body{
  columns:2;column-gap:32px;
  padding:0 18px 18px;
  border-top:.5px solid var(--separator-soft);
  margin-top:0;padding-top:16px;
}
.source-body p{margin:0 0 12px;break-inside:avoid;font-size:15px;line-height:1.5;color:var(--label-2)}
.source-body p:last-child{margin-bottom:0}
.copy{
  margin:16px 0 0;text-align:center;
  font-family:var(--font-ui);font-size:13px;color:var(--label-3);
}

/* Nút quay về trang chủ Lịch Vũ Trụ, đặt sau hai mục lưu ý */
.back{margin-top:20px;text-align:center}
.btn-link{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  text-decoration:none;
}
.btn-link svg{
  width:18px;height:18px;flex:none;
  stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
}

/* ---------- Mobile ---------- */
@media (max-width:1023px){
  .shell{
    display:flex;flex-direction:column;
    align-items:stretch;
    max-width:1080px;padding:0 20px;
  }
  .masthead{order:1;padding:20px 0 14px;text-align:center}
  .sidebar{
    order:2;position:sticky;top:0;z-index:20;height:auto;
    margin:0 -20px;padding:8px 0;
    background:var(--bg-header);
    -webkit-backdrop-filter:saturate(180%) blur(20px);
    backdrop-filter:saturate(180%) blur(20px);
    border-bottom:.5px solid var(--separator-soft);
    grid-column:auto;grid-row:auto;
  }
  .sidebar .brand{display:none}
  .masthead-row{display:block}
  .masthead .brand{display:inline-block;margin:0 0 12px}
  .masthead .brand img{width:64px;height:64px;padding:6px}
  h1{font-size:24px}
  .sub{max-width:38ch;margin:8px auto 0}
  .sidebar nav{
    flex-direction:row;flex-wrap:nowrap;gap:8px;
    overflow-x:auto;scrollbar-width:none;
    padding:0 20px;
  }
  .sidebar nav::-webkit-scrollbar{display:none}
  .sidebar nav button{
    flex:none;width:auto;white-space:nowrap;justify-content:center;
    padding:7px 14px;gap:0;
    background:var(--fill-1);border-radius:var(--r-pill);
    font-size:15px;font-weight:500;color:var(--label);
  }
  .sidebar nav button svg{display:none}
  .sidebar nav button[aria-selected="true"]{
    background:var(--accent);color:var(--on-accent);font-weight:600;
  }
  main{order:3;padding:24px 0 8px}
  .prose{padding:20px 18px}
  .table-scroll{padding:6px 12px;margin:8px -18px 20px;border-radius:0}
  .table-scroll table{min-width:460px}
  footer{padding:24px 20px 40px}
  .source-body{columns:1}
  .source summary{padding:13px 16px;font-size:15px}
  .source-body{padding:16px 16px 16px}
  .plan-layout{grid-template-columns:1fr;gap:20px}
  .chk-cols{columns:1}
  .cell{padding:10px;gap:2px}
  .cell .dir{font-size:15px}
  .cell .dir::before{width:7px;height:7px}
  .cell .meta{font-size:11px}
  .tally{top:8px;right:8px}
  .btn{width:100%}
  .detail{padding:18px}
  .plan-head{flex-wrap:wrap}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}
@media print{
  .sidebar,.hint,.btn,.compass{display:none}
  .shell{display:block;padding:0}
  .panel[hidden]{display:block}
  .prose,.detail,.score,.chk-group{box-shadow:none;padding:0}
  body{background:#fff;font-size:12pt}
}

/* Dấu phiên trên chân trang, dùng để truy nguồn nếu nội dung bị đăng lại */
.copy .mark{color:var(--label-3);opacity:.5;font-size:11px;letter-spacing:.04em}
