/* --- TU VI PRO STYLES (MATCHING REFERENCE IMAGE) --- */
.tuvi-pro-wrapper {
    background: #fdfdfd;
    border: 2px solid #000;
    width: 960px;
    margin: 0 auto;
    font-family: 'Times New Roman', Times, serif;
    position: relative;
    user-select: none;
}

.tuvi-pro-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    width: 100%;
}

.tuvi-pro-cell {
    border: 0.5px solid #ddd;
    padding: 2px 4px;
    min-height: 180px;
    position: relative;
    font-size: 11px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* Corner Labels */
.corner-label {
    position: absolute;
    font-size: 9px;
    color: #666;
    line-height: 1;
}

.label-top-left {
    top: 2px;
    left: 4px;
}

.label-top-right {
    top: 2px;
    right: 4px;
    text-align: right;
}

.label-bottom-left {
    bottom: 18px;
    left: 4px;
}

.label-bottom-right {
    bottom: 18px;
    right: 4px;
    text-align: right;
}

.palace-header {
    text-align: center;
    margin-top: 2px;
    border-bottom: 1px solid #eee;
    padding-bottom: 2px;
}

.palace-name {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
}

.palace-name.is-menh {
    color: #cc0000;
}

.palace-main-star {
    font-size: 13px;
    font-weight: bold;
}

/* Star Columns */
.stars-container {
    display: flex;
    flex: 1;
    margin-top: 4px;
}

.stars-col-left {
    flex: 1;
    text-align: left;
    padding-right: 2px;
}

.stars-col-right {
    flex: 1;
    text-align: right;
    padding-left: 2px;
}

.star-item {
    display: block;
    font-size: 10.5px;
    line-height: 1.2;
    margin-bottom: 1px;
}

/* Star Element Colors */
.color-moc {
    color: #00aa00;
}

.color-hoa {
    color: #ff0000;
}

.color-tho {
    color: #ff9900;
}

.color-kim {
    color: #888888;
}

.color-thuy {
    color: #000000;
}

.star-status {
    font-weight: normal;
    font-size: 9px;
}

/* Bottom Bar */
.cell-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 16px;
    background: #f0f0f0;
    border-top: 0.5px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    font-size: 10px;
}

.branch-name {
    font-weight: bold;
}

.tra-sinh {
    font-style: italic;
    color: #444;
}

.han-num {
    font-weight: bold;
}

/* Center Cell */
.tuvi-pro-center {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #000;
}

.center-title {
    font-size: 16px;
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 4px;
}

.center-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 2px;
}

.center-summary {
    font-size: 13px;
    color: #cc0000;
    font-weight: bold;
    margin-bottom: 4px;
}

.center-destiny {
    font-size: 13px;
    color: #0000cc;
    font-weight: bold;
    margin-bottom: 8px;
}

.center-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 8px;
}

.center-table td {
    border: 1px solid #ccc;
    padding: 2px 4px;
    text-align: center;
}

.center-table .bg-gray {
    background: #f5f5f5;
    font-weight: bold;
}

/* Can Chi Grid */
.can-chi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    border: 1px solid #aaa;
    font-size: 10px;
}

.grid-item {
    border: 0.5px solid #eee;
    padding: 2px;
    text-align: center;
}

.grid-label {
    background: #f9f9f9;
    color: #666;
}

.grid-value {
    font-weight: bold;
    font-size: 12px;
}

/* Markers Tuan/Triet */
.marker-tuan,
.marker-triet {
    position: absolute;
    background: #0044aa;
    color: #fff;
    padding: 1px 4px;
    font-size: 9px;
    font-weight: bold;
    z-index: 10;
}

.marker-horiz {
    width: 60px;
    height: 14px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.marker-vert {
    width: 14px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
}

/* Legend */
.tuvi-pro-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 5px;
    border-top: 1px solid #000;
    font-size: 11px;
    background: #fff;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-box {
    width: 14px;
    height: 10px;
    border: 1px solid #000;
}

/* --- Side-by-side Page Layout (Main + Sidebar) --- */
.jeg_sidebar {
    padding-left: 20px;
}

.jeg_block_heading {
    border-left: 3px solid #c0392b;
    padding-left: 10px;
    margin-bottom: 20px;
}

.jeg_block_title {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Social Counter Widget */
.social-counter-grid .social-item {
    transition: background 0.2s;
    cursor: pointer;
    min-width: 45%;
}

.social-counter-grid .social-item:hover {
    background: #f8f9fa;
}

.smaller {
    font-size: 10px;
}

/* Instructional Table Styles */
.parity-table {
    font-size: 14px;
    border-radius: 4px;
    overflow: hidden;
}

.parity-table thead th {
    background: #f4f4f4;
    color: #333 !important;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.bg-gray-light {
    background: #f9f9f9;
}

/* SEO Content Typography */
.entry-content h2 {
    color: #111;
    font-weight: 700;
}

.seo-content p {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 1.2rem;
}

.faq-section {
    background: #fff;
}

/* Sidebar Tabbed Post */
#sidebarTabs .nav-link {
    border: none;
    background: #f4f4f4;
    color: #666;
    border-radius: 0;
}

#sidebarTabs .nav-link.active {
    background: #fff;
    color: #c0392b;
    font-weight: bold;
    border-top: 2px solid #c0392b;
}

.post-item a {
    text-decoration: none;
    transition: color 0.2s;
}

.post-item a:hover {
    color: #c0392b !important;
}

/* AD Placeholder */
.ad-placeholder {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
}