:root {
    --paper:        #F2E8CE;
    --paper-deep:   #E8DAB4;
    --paper-light:  #FAF4E0;
    --paper-card:   #FBF5E1;
    --ink:          #1B130E;
    --ink-soft:     #4A3528;
    --ink-mute:     #7A6249;
    --vermilion:    #A52521;
    --vermilion-deep:#7A1612;
    --vermilion-soft:#C86560;
    --gold:         #B5933A;
    --gold-light:   #D8B863;
    --gold-deep:    #826921;
    --jade:         #2D5F45;
    --jade-light:   #5B8870;
    --hac:          #3C2A20;
    --shadow:       rgba(27, 19, 14, 0.12);
    --shadow-deep:  rgba(27, 19, 14, 0.20);
    --font-display: 'Alegreya', 'Alegreya Fallback', Georgia, sans-serif;
    --font-body:    'Be Vietnam Pro', 'Be Vietnam Pro Fallback', system-ui, -apple-system, sans-serif;
    --font-serif:   'Alegreya', 'Alegreya Fallback', sans-serif;
    --maxw: 1240px;
  }

  
  /* Italic <em> dùng Be Vietnam Pro (Alegreya không có italic thật) */
  h1 em, h2 em, h3 em, .page-title em, .section-title em, .cb-weekday,
  .ic-title em, .mini-cal-title em, .breadcrumb em,
  .page-subtitle em, .nh-name em {
    font-family: 'Be Vietnam Pro', 'Be Vietnam Pro Fallback', sans-serif;
    font-style: italic;
    font-weight: 500;
  }
  .cb-weekday { font-weight: 600; }

  button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
  .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }

  /* ===== HEADER ===== */
  
  
  
  
  
  
  
  
  
  
  
  
  

  /* ===== BREADCRUMB ===== */
  
  
  
  
  

  /* ===== TAB SUBNAV ===== */
  .subnav {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-bottom: 24px; padding: 6px;
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
  }
  .subnav a {
    padding: 8px 16px; font-size: 13px; font-weight: 500;
    color: var(--ink-soft); border-radius: 2px;
    transition: all .15s;
  }
  .subnav a:hover { background: rgba(181, 147, 58, 0.1); color: var(--vermilion-deep); }
  .subnav a.active { background: var(--vermilion); color: var(--paper-light); }

  /* ===== H1 TITLE ===== */
  .page-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 600; line-height: 1.05;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
  }
  .page-title em { font-style: italic; color: var(--vermilion-deep); }
  .page-subtitle {
    color: var(--ink-mute); font-size: 15px; margin-bottom: 28px;
    max-width: 720px;
  }

  /* ============================================================
     TỜ LỊCH BLOCK (giống tờ lịch xé treo tường)
     ============================================================ */
  .calendar-block {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.4);
    border-radius: 4px;
    box-shadow: 0 24px 60px -28px var(--shadow-deep), 0 2px 0 rgba(255, 248, 220, 0.7) inset;
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
  }
  /* Top staple holes effect */
  .calendar-block::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0;
    height: 24px;
    background: linear-gradient(180deg, var(--vermilion-deep), var(--vermilion));
    z-index: 1;
  }
  .calendar-block::after {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 8px; height: 8px;
    background: var(--paper-light);
    border-radius: 50%;
    box-shadow: -80px 0 0 var(--paper-light), 80px 0 0 var(--paper-light);
    z-index: 2;
  }

  /* Cột trái: tờ lịch lớn */
  .cb-main {
    padding: 48px 24px 24px;
    text-align: center;
    background: var(--paper-card);
    border-right: 1px dashed rgba(181, 147, 58, 0.4);
    position: relative;
    display: flex; flex-direction: column;
  }
  .cb-weekday {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--vermilion-deep);
    font-style: italic;
    margin-bottom: 8px;
  }
  .cb-canchi-day {
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--ink);
    letter-spacing: 0.04em;
  }
  .cb-canchi-extra {
    display: flex; justify-content: center; gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--ink-mute);
  }
  .cb-month-hint {
    margin-top: 14px;
    font-size: 13px;
    color: var(--ink-mute);
  }
  .cb-month-hint strong { color: var(--ink); font-weight: 600; }
  .cb-big-day {
    font-family: var(--font-display);
    font-size: clamp(140px, 18vw, 200px);
    font-weight: 600;
    line-height: 0.85;
    color: var(--vermilion);
    margin: 12px 0;
    text-shadow: 4px 4px 0 rgba(165, 37, 33, 0.08);
  }
  .cb-zodiac {
    width: 100px; height: 100px;
    margin: 8px auto;
    background: var(--paper-light);
    border: 3px solid var(--gold);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 60px;
    line-height: 1;
    box-shadow: 0 8px 16px -8px var(--shadow), inset 0 0 0 6px var(--paper-light), inset 0 0 0 7px rgba(181, 147, 58, 0.3);
  }
  .cb-status-pills {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-top: 16px;
  }
  .pill {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(181, 147, 58, 0.4);
    background: var(--paper-light);
  }
  .pill.hoang { background: linear-gradient(135deg, var(--vermilion), var(--vermilion-deep)); color: var(--paper-light); border-color: var(--vermilion-deep); }
  .pill.hac { background: linear-gradient(135deg, var(--hac), #2a1a14); color: var(--paper-light); border-color: var(--hac); }
  .pill.gold { background: linear-gradient(135deg, #FFF6E0, #FBEAB8); border-color: var(--gold); color: var(--gold-deep); }
  .pill.jade { background: rgba(45, 95, 69, 0.12); border-color: var(--jade); color: var(--jade); }

  .cb-quote {
    margin-top: auto; padding-top: 22px;
    font-style: italic;
    color: var(--ink-mute);
    font-size: 13px;
    line-height: 1.5;
    border-top: 1px dashed rgba(181, 147, 58, 0.3);
  }
  .cb-quote-author {
    font-size: 11px;
    color: var(--vermilion-deep);
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-style: normal;
  }

  /* Cột phải: bảng giờ + thông tin */
  .cb-side {
    padding: 48px 28px 24px;
    background: var(--paper-light);
  }
  .cb-side-block { margin-bottom: 18px; }
  .cb-side-block:last-child { margin-bottom: 0; }
  .cb-side-label {
    font-size: 11px;
    letter-spacing: 0.25em;
    color: var(--ink-mute);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
  }
  .cb-side-label::before {
    content: ""; width: 16px; height: 1px; background: var(--gold);
  }

  .info-row {
    display: flex; gap: 8px; padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px dashed rgba(181, 147, 58, 0.2);
    align-items: baseline;
  }
  .info-row:last-child { border-bottom: none; }
  .info-row .k { color: var(--ink-mute); flex: 0 0 168px; white-space: nowrap; }
  .info-row .v { color: var(--ink); flex: 1; }
  .info-row .v strong { color: var(--vermilion-deep); font-weight: 600; }

  /* Bảng giờ HĐ / Hắc đạo */
  .hours-table {
    margin-top: 8px;
  }
  .hours-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
    color: var(--gold-deep);
    margin-bottom: 6px;
  }
  .hours-label.bad { color: var(--hac); }
  .hours-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 4px;
  }
  .hours-cell {
    padding: 8px 6px;
    text-align: center;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.3;
  }
  .hours-cell.good {
    background: linear-gradient(180deg, #FFF6E0, #FBEAB8);
    border: 1px solid var(--gold);
    color: var(--gold-deep);
  }
  .hours-cell.good .c { font-family: var(--font-serif); font-size: 14px; font-weight: 600; color: var(--vermilion-deep); }
  .hours-cell.bad {
    background: rgba(60, 42, 32, 0.06);
    border: 1px solid rgba(60, 42, 32, 0.2);
    color: var(--ink-mute);
  }
  .hours-cell.bad .c { font-family: var(--font-serif); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
  .hours-cell .t { font-size: 10px; opacity: 0.85; margin-top: 2px; }

  /* Nav prev / today / next */
  .day-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(181, 147, 58, 0.25);
  }
  .day-nav button, .day-nav a.button {
    display: block;
    padding: 10px 8px;
    font-size: 13px; font-weight: 500;
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.4);
    border-radius: 2px;
    color: var(--ink-soft);
    text-decoration: none;
    text-align: center;
    transition: all .15s;
  }
  .day-nav button:hover, .day-nav a.button:hover { background: var(--vermilion); color: var(--paper-light); border-color: var(--vermilion); }
  .day-nav button.primary, .day-nav a.button.primary { background: var(--ink); color: var(--paper-light); border-color: var(--ink); }
  .day-nav button.primary:hover, .day-nav a.button.primary:hover { background: var(--vermilion); border-color: var(--vermilion); }

  /* ============================================================
     SECTIONS
     ============================================================ */
  .section { margin-bottom: 36px; }
  .section-title {
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
  }
  .section-title em { font-style: italic; color: var(--vermilion-deep); }
  .section-title .num {
    display: inline-grid;
    place-items: center;
    width: 36px; height: 36px;
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--paper-light);
    background: var(--vermilion);
    border-radius: 50%;
    margin-right: 14px;
    vertical-align: -7px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 0 4px 10px -4px rgba(165, 37, 33, 0.5);
  }
  .section-sub {
    color: var(--ink-mute);
    font-size: 14px;
    margin-bottom: 18px;
    max-width: 760px;
  }

  /* ===== Grid 2 cột ===== */
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  /* Card chung */
  .info-card {
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
    padding: 20px 22px;
    position: relative;
  }
  .info-card.featured { border-color: var(--gold); box-shadow: 0 8px 24px -16px var(--shadow); }
  .ic-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(181, 147, 58, 0.2);
  }
  .ic-title {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600;
    color: var(--ink);
    display: flex; align-items: center; gap: 10px;
  }
  .ic-title .icon {
    width: 28px; height: 28px;
    background: var(--vermilion);
    color: var(--paper-light);
    display: grid; place-items: center;
    border-radius: 2px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
  }
  .ic-title .icon.emoji {
    background: transparent;
    font-size: 22px;
    width: auto; height: auto;
  }
  .ic-badge {
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .ic-badge.tot { background: rgba(45, 95, 69, 0.12); color: var(--jade); }
  .ic-badge.xau { background: rgba(60, 42, 32, 0.12); color: var(--hac); }

  /* Tag list (việc nên / không nên làm) */
  .tag-list {
    display: flex; flex-wrap: wrap; gap: 6px;
  }
  .tag-item {
    padding: 6px 10px;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 2px;
    font-size: 13px;
    color: var(--ink-soft);
  }
  .tag-item.tot {
    background: rgba(45, 95, 69, 0.08);
    border-color: var(--jade-light);
    color: var(--jade);
  }
  .tag-item.xau {
    background: rgba(60, 42, 32, 0.06);
    border-color: rgba(60, 42, 32, 0.3);
    color: var(--hac);
  }

  /* Tuổi xung hợp */
  .age-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
  .age-cell {
    text-align: center;
    padding: 14px 8px;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 2px;
  }
  .age-cell .lbl {
    font-size: 10px; letter-spacing: 0.18em;
    color: var(--ink-mute);
    text-transform: uppercase;
    margin-bottom: 6px;
  }
  .age-cell .val {
    font-family: var(--font-serif);
    font-size: 16px; font-weight: 600;
    color: var(--ink);
  }
  .age-cell.tamhop { background: rgba(45, 95, 69, 0.1); border-color: var(--jade-light); }
  .age-cell.tamhop .val { color: var(--jade); }
  .age-cell.luchop { background: rgba(181, 147, 58, 0.12); border-color: var(--gold); }
  .age-cell.luchop .val { color: var(--gold-deep); }
  .age-cell.xung { background: rgba(165, 37, 33, 0.08); border-color: var(--vermilion-soft); }
  .age-cell.xung .val { color: var(--vermilion-deep); }
  .age-cell.hinh { background: rgba(60, 42, 32, 0.08); border-color: rgba(60, 42, 32, 0.3); }
  .age-cell.hai { background: rgba(60, 42, 32, 0.05); border-color: rgba(60, 42, 32, 0.2); }

  /* Hướng xuất hành */
  .direction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .direction-item {
    display: flex; gap: 14px; align-items: center;
    padding: 14px;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
  }
  .compass {
    flex: 0 0 56px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--paper-card);
    border: 2px solid var(--gold);
    display: grid; place-items: center;
    position: relative;
  }
  .compass-arrow {
    position: absolute;
    width: 4px; height: 26px;
    background: linear-gradient(180deg, var(--vermilion) 0%, var(--vermilion) 50%, var(--ink-soft) 50%, var(--ink-soft) 100%);
    transform-origin: center bottom;
    bottom: 50%;
    left: 50%;
    margin-left: -2px;
  }
  .compass-center {
    position: absolute;
    width: 8px; height: 8px;
    background: var(--gold);
    border-radius: 50%;
  }
  .direction-info { flex: 1; }
  .direction-info .name {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--ink-mute);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
  }
  .direction-info .dir {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--vermilion-deep);
    line-height: 1.1;
  }
  .direction-info .desc {
    font-size: 12px;
    color: var(--ink-mute);
    margin-top: 2px;
  }

  /* Ngũ hành */
  .ngu-hanh-card { display: flex; gap: 18px; align-items: center; }
  .nh-icon {
    flex: 0 0 80px;
    width: 80px; height: 80px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 40px;
    line-height: 1;
    box-shadow: 0 8px 20px -10px var(--shadow);
    border: 3px solid rgba(255, 244, 224, 0.6);
  }
  .nh-icon.kim { background: linear-gradient(135deg, #B5933A, #826921); }
  .nh-icon.moc { background: linear-gradient(135deg, #5B8870, #2D5F45); }
  .nh-icon.thuy { background: linear-gradient(135deg, #4A6FA5, #2D4A7A); }
  .nh-icon.hoa { background: linear-gradient(135deg, #C86560, #7A1612); }
  .nh-icon.tho { background: linear-gradient(135deg, #A78762, #6B5238); }
  .nh-detail { flex: 1; }
  .nh-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
  }
  .nh-meta {
    font-size: 13px;
    color: var(--ink-mute);
    margin-top: 4px;
    line-height: 1.5;
  }
  .nh-meta strong { color: var(--vermilion-deep); }

  /* Trực block */
  .truc-display {
    text-align: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, rgba(181, 147, 58, 0.08), rgba(165, 37, 33, 0.06));
    border-radius: 3px;
    margin-bottom: 14px;
  }
  .truc-name {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 600;
    color: var(--vermilion-deep);
    line-height: 1;
    margin-bottom: 6px;
  }
  .truc-name-han {
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--gold-deep);
  }

  /* Mini calendar */
  .mini-cal-card {
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
    overflow: hidden;
  }
  .mini-cal-head {
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(181, 147, 58, 0.08), transparent);
    border-bottom: 1px solid rgba(181, 147, 58, 0.2);
    display: flex; align-items: center; justify-content: space-between;
  }
  .mini-cal-title {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600;
    color: var(--ink);
  }
  .mini-cal-title em { color: var(--vermilion-deep); font-style: italic; }
  .mini-cal-nav { display: flex; gap: 4px; }
  .mini-cal-nav button {
    width: 28px; height: 28px;
    border: 1px solid rgba(181, 147, 58, 0.4);
    background: var(--paper-light);
    border-radius: 2px; font-size: 12px;
  }
  .mini-cal-nav button:hover { background: var(--vermilion); color: var(--paper-light); border-color: var(--vermilion); }
  .mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
  }
  .mc-wkd {
    padding: 8px 4px;
    text-align: center;
    font-size: 10px; letter-spacing: 0.15em;
    color: var(--ink-mute);
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid rgba(181, 147, 58, 0.15);
    background: rgba(181, 147, 58, 0.04);
  }
  .mc-wkd.sun { color: var(--vermilion); }
  .mc-cell {
    aspect-ratio: 1 / 1;
    padding: 4px 5px;
    border-right: 1px solid rgba(181, 147, 58, 0.08);
    border-bottom: 1px solid rgba(181, 147, 58, 0.08);
    display: flex; flex-direction: column; justify-content: space-between;
    background: var(--paper-light);
    cursor: pointer;
    transition: all .12s;
    position: relative;
    text-decoration: none;
    color: inherit;
  }
  .mc-cell:hover { background: #FFF8E0; }
  .mc-cell.empty { background: rgba(181, 147, 58, 0.03); cursor: default; }
  .mc-cell .dd {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    color: var(--ink);
    line-height: 1;
  }
  .mc-cell.sun .dd { color: var(--vermilion); }
  .mc-cell .da {
    font-size: 9px;
    color: var(--ink-mute);
    text-align: right;
    line-height: 1;
  }
  .mc-cell .da.first { color: var(--vermilion); font-weight: 600; }
  .mc-cell.today {
    background: linear-gradient(135deg, var(--vermilion), var(--vermilion-deep));
  }
  .mc-cell.today .dd, .mc-cell.today .da { color: var(--paper-light); }
  .mc-cell.selected {
    box-shadow: inset 0 0 0 2px var(--gold);
  }
  .mc-cell.r-vg { background: linear-gradient(135deg, #FFE4DA, #FFD0BD); }
  .mc-cell.r-g { background: linear-gradient(135deg, #FBEAB8, #F4DD9A); }
  .mc-cell.r-n { background: var(--paper-light); }
  .mc-cell.r-b { background: rgba(60, 42, 32, 0.06); }
  .mc-cell.r-vb { background: rgba(60, 42, 32, 0.14); }
  .mc-cell.r-vb .dd { color: var(--hac); }

  .mini-cal-legend {
    display: flex; gap: 12px; flex-wrap: wrap;
    padding: 12px 20px;
    font-size: 11px;
    color: var(--ink-mute);
    border-top: 1px solid rgba(181, 147, 58, 0.15);
    background: rgba(181, 147, 58, 0.03);
  }
  .leg-sw {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: -1px;
  }

  /* FAQ */
  .faq-list { display: flex; flex-direction: column; gap: 8px; }
  .faq-item {
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
    overflow: hidden;
  }
  .faq-q {
    padding: 16px 20px;
    font-weight: 600;
    color: var(--ink);
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer;
    font-size: 15px;
    transition: background .15s;
  }
  .faq-q:hover { background: rgba(181, 147, 58, 0.05); }
  .faq-q .sign {
    width: 28px; height: 28px;
    background: var(--vermilion);
    color: var(--paper-light);
    display: grid; place-items: center;
    border-radius: 2px;
    font-size: 16px; font-weight: 600;
    flex-shrink: 0; margin-left: 12px;
    transition: transform .2s;
  }
  .faq-item.open .faq-q .sign { transform: rotate(45deg); }
  .faq-a {
    max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
    background: var(--paper-light);
  }
  .faq-item.open .faq-a { max-height: 600px; }
  .faq-a-inner {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.6;
    border-top: 1px solid rgba(181, 147, 58, 0.2);
  }
  .faq-a-inner strong { color: var(--vermilion-deep); }

  /* Upcoming days list */
  .upcoming-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
  }
  .up-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--paper-card);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 2px;
    font-size: 13px;
    color: var(--ink-soft);
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
  }
  .up-item:hover { background: var(--vermilion); color: var(--paper-light); border-color: var(--vermilion); }
  .up-item .d {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 2px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    font-size: 16px;
    flex-shrink: 0;
  }
  .up-item:hover .d { background: var(--paper-light); }
  .up-item .meta { flex: 1; line-height: 1.3; }
  .up-item .meta strong { display: block; color: inherit; font-size: 14px; }

  /* ===== Nhị thập bát tú ===== */
  .tu-display {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px dashed rgba(181, 147, 58, 0.3);
  }
  .tu-main { flex: 1; }
  .tu-name {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 600;
    color: var(--vermilion-deep);
    line-height: 1;
    margin-bottom: 6px;
  }
  .tu-han {
    font-size: 28px;
    color: var(--gold-deep);
    opacity: 0.7;
    margin-left: 8px;
  }
  .tu-pos {
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--ink-mute);
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  .tu-note {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
  }
  .tu-badge {
    flex-shrink: 0;
    padding: 8px 18px;
    border-radius: 3px;
    font-size: 14px; font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .tu-badge.cat { background: rgba(45, 95, 69, 0.12); color: var(--jade); border: 1px solid var(--jade-light); }
  .tu-badge.hung { background: rgba(60, 42, 32, 0.1); color: var(--hac); border: 1px solid rgba(60, 42, 32, 0.3); }
  .tu-acts { }
  .tu-act-label {
    font-size: 11px; letter-spacing: 0.18em; color: var(--ink-mute);
    text-transform: uppercase; font-weight: 600;
    margin-bottom: 8px;
  }
  .tu-act-list { display: flex; flex-wrap: wrap; gap: 6px; }

  /* ===== Nhân thần ===== */
  .nt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  .nt-item {
    padding: 16px;
    background: var(--paper-light);
    border: 1px solid rgba(181, 147, 58, 0.3);
    border-radius: 3px;
    text-align: center;
  }
  .nt-label {
    font-size: 11px; letter-spacing: 0.15em;
    color: var(--ink-mute); text-transform: uppercase;
    font-weight: 600; margin-bottom: 10px;
  }
  .nt-label strong { color: var(--vermilion-deep); }
  .nt-part {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 600;
    color: var(--vermilion-deep);
    line-height: 1.1;
  }
  .nt-note {
    font-size: 13px; color: var(--ink-soft);
    line-height: 1.6;
    padding: 12px 14px;
    background: rgba(181, 147, 58, 0.06);
    border-left: 3px solid var(--gold);
    border-radius: 0 2px 2px 0;
  }
  .nt-note strong { color: var(--vermilion-deep); }

  @media (max-width: 480px) {
    .tu-name { font-size: 28px; }
    .tu-han { font-size: 22px; }
    .nt-grid { grid-template-columns: 1fr; }
    .nt-part { font-size: 22px; }
  }

  /* ===== Thai thần ===== */
  .tt-display {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 14px;
  }
  .tt-pos {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 600;
    color: var(--vermilion-deep);
    line-height: 1.1;
  }
  .tt-chi {
    font-size: 12px; letter-spacing: 0.1em;
    color: var(--ink-mute); text-transform: uppercase;
  }
  .tt-note {
    font-size: 13px; color: var(--ink-soft); line-height: 1.6;
    padding: 10px 14px;
    background: rgba(181, 147, 58, 0.07);
    border-left: 3px solid var(--gold);
    border-radius: 0 2px 2px 0;
  }
  .tt-note strong { color: var(--vermilion-deep); }

  /* ===== Sao Ngọc Hạp Thông Thư ===== */
  .nh-stars-section { margin-bottom: 18px; }
  .nh-stars-section:last-child { margin-bottom: 0; }
  .nh-stars-label {
    font-size: 11px; letter-spacing: 0.2em;
    text-transform: uppercase; font-weight: 700;
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
  }
  .nh-stars-label::before { content: ''; display: inline-block; width: 14px; height: 2px; }
  .cat-label { color: var(--jade); }
  .cat-label::before { background: var(--jade); }
  .hung-label { color: var(--hac); }
  .hung-label::before { background: var(--hac); }
  .nh-star-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 6px;
    border: 1px solid transparent;
  }
  .nh-star-item.star-cat {
    background: rgba(45, 95, 69, 0.07);
    border-color: rgba(45, 95, 69, 0.2);
  }
  .nh-star-item.star-hung {
    background: rgba(60, 42, 32, 0.06);
    border-color: rgba(60, 42, 32, 0.15);
  }
  .nh-star-name {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 600;
    flex: 0 0 140px;
    white-space: nowrap;
  }
  .star-cat .nh-star-name { color: var(--jade); }
  .star-hung .nh-star-name { color: var(--hac); }
  .nh-star-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; flex: 1; }

  /* ===== Ngày/Giờ xuất hành ===== */
  .km-block {
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(181,147,58,0.08), rgba(165,37,33,0.05));
    border-radius: 3px;
    margin-bottom: 20px;
    border: 1px solid rgba(181,147,58,0.25);
  }
  .km-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
  }
  .km-label-tag {
    font-size: 11px; letter-spacing: 0.18em; color: var(--ink-mute);
    text-transform: uppercase; font-weight: 600;
  }
  .km-rating {
    padding: 5px 14px;
    border-radius: 2px;
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.06em;
  }
  .km-rating.cat { background: rgba(45,95,69,0.12); color: var(--jade); border: 1px solid var(--jade-light); }
  .km-rating.hung { background: rgba(60,42,32,0.1); color: var(--hac); border: 1px solid rgba(60,42,32,0.3); }
  .km-text { font-size: 15px; color: var(--ink); line-height: 1.5; }

  .km-hours-block { }
  .km-hours-label {
    font-size: 11px; letter-spacing: 0.18em; color: var(--ink-mute);
    text-transform: uppercase; font-weight: 600;
    margin-bottom: 10px;
  }
  .km-hours-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  @media (max-width: 640px) {
    .km-hours-grid { grid-template-columns: repeat(3, 1fr); }
    .nh-star-item { flex-direction: column; gap: 4px; }
    .nh-star-name { flex: none; }
    .tt-pos { font-size: 20px; }
  }
  @media (max-width: 480px) {
    .km-hours-grid { grid-template-columns: repeat(3, 1fr); }
    .nh-stars-label { font-size: 10px; }
  }

  /* FOOTER */
  
  
  
  
  
  
  
  

  /* RESPONSIVE */
  @media (max-width: 960px) {
    .calendar-block { grid-template-columns: 1fr; }
    .cb-main { border-right: none; border-bottom: 1px dashed rgba(181, 147, 58, 0.4); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .age-grid { grid-template-columns: repeat(3, 1fr); }
    
    .direction-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    
    .cb-big-day { font-size: 110px; }
    .cb-zodiac { width: 80px; height: 80px; font-size: 44px; }
    .age-grid { grid-template-columns: repeat(2, 1fr); }
    .info-row .k { flex: 0 0 145px; font-size: 12px; }
    .info-row .v { font-size: 13px; }
    .hours-row { grid-template-columns: 1fr 1fr; }
    
    .mc-cell .dd { font-size: 14px; }
    .mc-cell .da { font-size: 8px; }
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ============================================================
     WEEKDAY BACKGROUND THEMES — cb-main đổi màu theo thứ
     ============================================================ */

  /* Thứ Hai — Xanh ngọc bích (Jade) */
  .cb-main[data-weekday="1"] {
    background: radial-gradient(ellipse 80% 45% at 50% -5%, rgba(34, 197, 94, 0.18) 0%, transparent 65%),
                linear-gradient(175deg, #F0FDF4 0%, #DCFCE7 35%, #C3F0D0 65%, #A7E8BD 100%);
  }
  .cb-main[data-weekday="1"] .cb-weekday { color: #14532D; }
  .cb-main[data-weekday="1"] .cb-big-day { color: #166534; text-shadow: 4px 4px 0 rgba(22, 101, 52, 0.12); }

  /* Thứ Ba — Vàng kim (Gold) */
  .cb-main[data-weekday="2"] {
    background: radial-gradient(ellipse 70% 40% at 50% -5%, rgba(234, 179, 8, 0.25) 0%, transparent 65%),
                linear-gradient(175deg, #FFFBEB 0%, #FEF3C7 35%, #FDE68A 65%, #FBD247 100%);
  }
  .cb-main[data-weekday="2"] .cb-weekday { color: #78350F; }
  .cb-main[data-weekday="2"] .cb-big-day { color: #92400E; text-shadow: 4px 4px 0 rgba(146, 64, 14, 0.12); }

  /* Thứ Tư — Xanh biển (Sky Blue) */
  .cb-main[data-weekday="3"] {
    background: radial-gradient(ellipse 80% 45% at 50% -5%, rgba(59, 130, 246, 0.18) 0%, transparent 65%),
                linear-gradient(175deg, #EFF6FF 0%, #DBEAFE 35%, #BFDBFE 65%, #93C5FD 100%);
  }
  .cb-main[data-weekday="3"] .cb-weekday { color: #1E3A8A; }
  .cb-main[data-weekday="3"] .cb-big-day { color: #1E40AF; text-shadow: 4px 4px 0 rgba(30, 64, 175, 0.12); }

  /* Thứ Năm — Tím hoàng hôn (Twilight Purple) */
  .cb-main[data-weekday="4"] {
    background: radial-gradient(ellipse 80% 45% at 50% -5%, rgba(168, 85, 247, 0.18) 0%, transparent 65%),
                linear-gradient(175deg, #FAF5FF 0%, #F3E8FF 35%, #E9D5FF 65%, #D8B4FE 100%);
  }
  .cb-main[data-weekday="4"] .cb-weekday { color: #581C87; }
  .cb-main[data-weekday="4"] .cb-big-day { color: #6B21A8; text-shadow: 4px 4px 0 rgba(107, 33, 168, 0.12); }

  /* Thứ Sáu — Hoàng hôn cam (Sunset Orange) */
  .cb-main[data-weekday="5"] {
    background: radial-gradient(ellipse 70% 40% at 50% -5%, rgba(249, 115, 22, 0.22) 0%, transparent 65%),
                linear-gradient(175deg, #FFF7ED 0%, #FFEDD5 35%, #FED7AA 65%, #FDBA74 100%);
  }
  .cb-main[data-weekday="5"] .cb-weekday { color: #9A3412; }
  .cb-main[data-weekday="5"] .cb-big-day { color: #C2410C; text-shadow: 4px 4px 0 rgba(194, 65, 12, 0.12); }

  /* Thứ Bảy — Hồng đào (Rose Pink) */
  .cb-main[data-weekday="6"] {
    background: radial-gradient(ellipse 80% 45% at 50% -5%, rgba(244, 114, 182, 0.18) 0%, transparent 65%),
                linear-gradient(175deg, #FFF1F2 0%, #FFE4E6 35%, #FECDD3 65%, #FDA4AF 100%);
  }
  .cb-main[data-weekday="6"] .cb-weekday { color: #881337; }
  .cb-main[data-weekday="6"] .cb-big-day { color: #9F1239; text-shadow: 4px 4px 0 rgba(159, 18, 57, 0.12); }

  /* Chủ Nhật — Đỏ son (Crimson Red — may mắn) */
  .cb-main[data-weekday="0"] {
    background: radial-gradient(ellipse 70% 40% at 50% -5%, rgba(220, 38, 38, 0.22) 0%, transparent 65%),
                linear-gradient(175deg, #FFF5F5 0%, #FFE4E4 35%, #FFCACA 65%, #FFA8A8 100%);
  }
  .cb-main[data-weekday="0"] .cb-weekday { color: #991B1B; }
  .cb-main[data-weekday="0"] .cb-big-day { color: #B91C1C; text-shadow: 4px 4px 0 rgba(185, 28, 28, 0.12); }

  /* ============================================================
     SỰ KIỆN NGÀY — cb-events
     ============================================================ */
  .cb-events {
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .cb-events:empty { display: none; }

  .cb-event {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    border-left: 3px solid var(--vermilion);
    background: rgba(165, 37, 33, 0.09);
    color: var(--vermilion-deep);
    animation: fadeUp .3s ease;
  }
  .cb-event.lunar    { border-color: var(--gold);   background: rgba(181, 147, 58, 0.11); color: var(--gold-deep); }
  .cb-event.tet      { border-color: var(--vermilion); background: linear-gradient(90deg, rgba(165,37,33,0.13), rgba(181,147,58,0.08)); color: var(--vermilion-deep); }
  .cb-event.religious{ border-color: var(--jade);   background: rgba(45, 95, 69, 0.10);  color: var(--jade); }
  .cb-event.monthly  { border-color: #8FA1BA;       background: rgba(91,107,133,0.09);   color: #4A5B75; }
  .cb-event.intl     { border-color: #3A86B0;       background: rgba(27,94,130,0.09);    color: #1B5E82; }

  .cb-ev-emoji { font-size: 15px; line-height: 1.1; flex-shrink: 0; margin-top: 1px; }
  .cb-ev-name  { flex: 1; }
  .cb-ev-src   { font-size: 10px; font-weight: 400; opacity: .65; display: block; margin-top: 1px; }
  .calendar-block, .info-card, .mini-cal-card { animation: fadeUp .5s ease-out both; }

  /* ── Extra responsive breakpoints ── */
  @media (max-width: 768px) {
    .cb-big-day { font-size: clamp(90px, 22vw, 120px); }
    .subnav { overflow-x: auto; flex-wrap: nowrap; }
    .subnav a { white-space: nowrap; }
  }
  @media (max-width: 480px) {
    .page-title { font-size: 26px; }
    .cb-main { padding: 40px 14px 18px; }
    .cb-side { padding: 20px 14px 18px; }
    .cb-big-day { font-size: 80px; }
    .cb-weekday { font-size: 22px; }
    .cb-zodiac { width: 72px; height: 72px; font-size: 40px; }
    .cb-canchi-extra { flex-wrap: wrap; gap: 4px; }
    .info-row { flex-direction: column; gap: 2px; padding: 8px 0; }
    .info-row .k { flex: none; font-size: 11px; }
    .age-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .direction-grid { grid-template-columns: 1fr; }
    .direction-item { gap: 10px; padding: 12px; }
    .compass { flex: 0 0 46px; width: 46px; height: 46px; }
    .compass-arrow { height: 20px; }
    .hours-row { grid-template-columns: repeat(3, 1fr); }
    .day-nav button, .day-nav a.button { padding: 8px 4px; font-size: 12px; }
    .ngu-hanh-card { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
    .nh-icon { flex: 0 0 64px; width: 64px; height: 64px; font-size: 32px; }
    .truc-name { font-size: 34px; }
    .mini-cal-legend { padding: 10px 12px; font-size: 10px; gap: 8px; }
    .faq-q { font-size: 13px; padding: 12px 14px; }
    .faq-a-inner { padding: 12px 14px; font-size: 13px; }
    .upcoming-list { grid-template-columns: 1fr; }
  }
  @media (max-width: 380px) {
    .cb-big-day { font-size: 66px; }
    .mc-cell .dd { font-size: 12px; }
    .mc-cell .da { font-size: 7px; }
  }

  /* ============================================================
     HERO SUMMARY — giờ hoàng đạo mini + việc nên/kỵ
     ============================================================ */
  .cb-hero-summary {
    margin: 16px 0 4px;
    padding: 14px 16px 12px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 14px;
    backdrop-filter: blur(6px);
  }
  .chs-h-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-mute);
    font-weight: 600;
    margin-bottom: 8px;
  }
  .chs-h-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 12px;
  }
  .chs-hcell {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(45,95,69,.22);
    border-radius: 10px;
    padding: 6px 4px 5px;
  }
  .chs-chi  { font-size: 13px; font-weight: 700; color: var(--jade); line-height: 1.1; }
  .chs-time { font-size: 9.5px; color: var(--ink-mute); margin-top: 2px; white-space: nowrap; }

  .chs-acts { display: flex; flex-direction: column; gap: 7px; }
  .chs-acts-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }
  .chs-acts-lbl {
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 38px;
  }
  .chs-acts-lbl.nen { color: #2a8c4a; }
  .chs-acts-lbl.ky  { color: #c0392b; }
  .chs-tag {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 500;
    line-height: 1.3;
  }
  .chs-tag.nen { background: #e6f4ec; color: #1e6b38; }
  .chs-tag.ky  { background: #fceaea; color: #b52626; }

  /* ============================================================
     28 TÚ — thơ
     ============================================================ */
  .tu-poem {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(181,147,58,.07);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-body);
    font-style: italic;
  }

  /* ============================================================
     LỤC DIỆU
     ============================================================ */
  .ld-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .ld-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--vermilion-deep);
    font-family: var(--font-display);
    line-height: 1.1;
  }
  .ld-han {
    font-size: 16px;
    font-weight: 400;
    color: var(--ink-mute);
    margin-left: 4px;
  }
  .ld-badge {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
  }
  .ld-badge.cat  { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
  .ld-badge.hung { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }
  .ld-short {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-body);
    margin-bottom: 6px;
  }
  .ld-desc {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--ink-body);
    margin-bottom: 12px;
  }
  .ld-acts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .ld-act-row {
    font-size: 13px;
    line-height: 1.5;
  }
  .ld-act-lbl {
    font-weight: 700;
    margin-right: 6px;
  }
  .ld-act-lbl.nen { color: #2a8c4a; }
  .ld-act-lbl.ky  { color: #c0392b; }
  .ld-poem {
    padding: 12px 16px;
    background: rgba(181,147,58,.07);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    line-height: 1.9;
    font-style: italic;
    color: var(--ink-body);
  }

  /* ============================================================
     12 THẦN GIỜ
     ============================================================ */
  .tg-section { margin-bottom: 20px; }
  .tg-section:last-child { margin-bottom: 0; }
  .tg-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid;
  }
  .tg-section-label.cat-label  { color: #1b5e20; border-color: #81c784; }
  .tg-section-label.hung-label { color: #b71c1c; border-color: #e57373; }
  .tg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .tg-card {
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid;
  }
  .tg-card.cat  { background: #f1f8e9; border-color: #aed581; }
  .tg-card.hung { background: #fce4ec; border-color: #f48fb1; }
  .tg-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
  }
  .tg-chi  { font-size: 14px; font-weight: 800; color: var(--vermilion-deep); min-width: 28px; }
  .tg-time { font-size: 10px; color: var(--ink-mute); background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
  .tg-name { font-size: 13px; font-weight: 700; flex: 1; }
  .tg-han  { font-size: 11px; color: var(--ink-mute); }
  .tg-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
  }
  .tg-badge.cat  { background: #c8e6c9; color: #1b5e20; }
  .tg-badge.hung { background: #ffcdd2; color: #b71c1c; }
  .tg-short {
    font-size: 11.5px;
    color: var(--ink-mute);
    line-height: 1.4;
  }
  @media (max-width: 480px) {
    .tg-grid { grid-template-columns: 1fr; }
  }

  /* CLS mitigation: giữ chỗ trước khi JS render dữ liệu, tránh dịch layout (CLS) */
  #tu-body, #luc-dieu-body, #than-gio-body, #ngoc-hap-body, #xuat-hanh-body { min-height: 90px; }
  #nhan-than-body, #thai-than-body { min-height: 70px; }
  #chs-hours, #chs-acts { min-height: 28px; }
  .hours-table .hours-row { min-height: 32px; }
  #faq-list { min-height: 480px; }
  #upcoming-list { min-height: 320px; }
  #mc-grid { min-height: 260px; }