/* 2TECH Lá số Tử vi - phong cách phong thủy */
:root{
  --tuvi-primary:#720101;
  --tuvi-bg:#fff8f0;
  --tuvi-border:#d8c6a1;
}

.tuvi2t-wrapper{font-family:'Noto Serif',serif; margin: 24px 0;}
.tuvi2t-card{background:var(--tuvi-bg); border:1px solid var(--tuvi-border); border-radius:16px; padding:24px; box-shadow:0 8px 24px rgba(0,0,0,0.06);}
.tuvi2t-title{margin:0 0 16px; color:var(--tuvi-primary); font-size:26px; letter-spacing:.3px}
.tuvi2t-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px}
@media (max-width: 768px){.tuvi2t-grid{grid-template-columns:1fr}}
.tuvi2t-field label{display:block; font-weight:600; margin-bottom:6px}
.tuvi2t-field input,.tuvi2t-field select{width:100%; padding:10px 12px; border:1px solid var(--tuvi-border); border-radius:10px; background:#fff}
.tuvi2t-actions{margin-top:12px}
.tuvi2t-btn{background:var(--tuvi-primary); color:#fff; border:none; padding:12px 18px; border-radius:12px; cursor:pointer; font-weight:700}
.tuvi2t-btn:hover{opacity:.92}

.tuvi2t-result{margin-top:20px}
.tuvi2t-result-card{background:#fff; border:1px solid var(--tuvi-border); border-radius:18px; overflow:hidden}
.tuvi2t-header{display:flex; align-items:center; justify-content:space-between; padding:18px 18px 0 18px}
.tuvi2t-result-title{margin:0; color:var(--tuvi-primary); font-size:22px}
.tuvi2t-meta{margin:4px 0; color:#333}
.tuvi2t-badge{background:var(--tuvi-primary); color:#fff; padding:8px 12px; border-radius:999px; font-weight:700}

.tuvi2t-overview{padding:8px 18px 18px 18px; border-bottom:1px dashed var(--tuvi-border)}
.tuvi2t-overview h4{margin:0 0 8px; color:var(--tuvi-primary)}

.tuvi2t-grid-12{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:18px}
@media (max-width: 900px){.tuvi2t-grid-12{grid-template-columns:repeat(2,1fr)}}

.tuvi2t-cung{border:1px solid var(--tuvi-border); border-radius:14px; background:linear-gradient(180deg,#fff, #fffaf3)}
.tuvi2t-cung-head{padding:10px; border-bottom:1px dashed var(--tuvi-border); display:flex; justify-content:space-between; align-items:center}
.tuvi2t-cung-name{font-weight:700; color:var(--tuvi-primary)}
.tuvi2t-stars{padding:10px}
.tuvi2t-star-major{display:inline-block; padding:4px 8px; border:1px solid var(--tuvi-primary); color:var(--tuvi-primary); border-radius:999px; margin:3px; font-size:13px; font-weight:700}
.tuvi2t-star-minor{display:inline-block; padding:3px 7px; border:1px dashed var(--tuvi-primary); color:var(--tuvi-primary); border-radius:999px; margin:3px; font-size:12px}

.tuvi2t-notes{padding:0 18px 18px 18px}
.tuvi2t-notes details{border:1px dashed var(--tuvi-border); padding:10px 12px; border-radius:10px; background:#fff}
.tuvi2t-notes summary{cursor:pointer; color:var(--tuvi-primary); font-weight:700}

/* Accessibility tweaks */
.tuvi2t-field select{min-height:44px}

/* ===== A4 Layout for Lá số ===== */
.tuvi2t-laso-a4{background:#fff; color:#000; border:1px solid var(--tuvi-primary); box-shadow:0 8px 24px rgba(0,0,0,.06);}
.tuvi2t-toolbar{display:flex; gap:8px; justify-content:flex-end; padding:10px; border-bottom:1px solid #eee}
.tuvi2t-laso-grid{display:grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, minmax(120px, auto)); gap:6px; padding:8px}
.laso-cung{border:1px solid #c9bba0; border-radius:6px; padding:6px; background: #fff; min-height:120px}
.laso-cung-head{display:flex; justify-content:space-between; align-items:center; margin-bottom:4px}
.laso-cung-name{font-weight:700; color:var(--tuvi-primary); display:flex; gap:6px; align-items:center}
.laso-badge{background:var(--tuvi-primary); color:#fff; border-radius:999px; padding:2px 6px; font-size:11px}
.laso-stars .star{display:inline-block; margin:2px 3px; font-size:12px}
.laso-stars .star.major{color:#b00000; font-weight:700; border-bottom:1px dotted #b00000}
.laso-stars .star.minor{color:#006400}

/* Place 12 boxes around with center panel */
.tuvi2t-laso-grid > .laso-cung:nth-child(1){grid-column:1 / span 1; grid-row:1}
.tuvi2t-laso-grid > .laso-cung:nth-child(2){grid-column:2; grid-row:1}
.tuvi2t-laso-grid > .laso-cung:nth-child(3){grid-column:3; grid-row:1}
.tuvi2t-laso-grid > .laso-cung:nth-child(4){grid-column:4; grid-row:1}
.tuvi2t-laso-grid > .laso-cung:nth-child(5){grid-column:4; grid-row:2}
.tuvi2t-laso-grid > .laso-cung:nth-child(6){grid-column:4; grid-row:3}
.tuvi2t-laso-grid > .laso-cung:nth-child(7){grid-column:4; grid-row:4}
.tuvi2t-laso-grid > .laso-cung:nth-child(8){grid-column:3; grid-row:4}
.tuvi2t-laso-grid > .laso-cung:nth-child(9){grid-column:2; grid-row:4}
.tuvi2t-laso-grid > .laso-cung:nth-child(10){grid-column:1; grid-row:4}
.tuvi2t-laso-grid > .laso-cung:nth-child(11){grid-column:1; grid-row:3}
.tuvi2t-laso-grid > .laso-cung:nth-child(12){grid-column:1; grid-row:2}

.laso-center{grid-column:2 / span 2; grid-row:2 / span 2; border:2px solid var(--tuvi-primary); border-radius:8px; padding:10px; background: #fffdf7}
.center-title{text-align:center; margin:6px 0 8px; color:var(--tuvi-primary)}
.center-info{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr; gap:4px}
.center-info li{font-size:13px}
.center-desc{margin-top:6px; font-size:12px; color:#333}

/* Print styles */
@media print{
  @page{ size: A4; margin: 10mm; }
  .no-print{ display:none !important; }
  body{ background:#fff; }
  .tuvi2t-laso-a4{ box-shadow:none; border:none; }
}

/* Two-page A4 support */
.page-break{ page-break-after: always; height: 0; }
@media print{
  .page-break{ page-break-after: always; }
}

/* Summary tables (Page 3) */
.tuvi2t-summary{ padding: 12px; }
.summary-block{ margin-bottom: 16px; }
.summary-block h4{ margin: 6px 0 8px; color: var(--tuvi-primary); }
.summary-table{ width: 100%; border-collapse: collapse; }
.summary-table th, .summary-table td{ border: 1px solid #d8cfc0; padding: 6px 8px; font-size: 12px; vertical-align: top; }
.summary-table thead th{ background: #fff8ef; }
.col-major{ color: #b00000; font-weight: 600; } /* chính tinh đỏ */
.col-phu{ color: #0a6b0a; } /* cát tinh xanh */
.col-sat{ color: #4a2a7a; } /* sát tinh tím/đen */
@media print{
  .summary-table th, .summary-table td{ font-size: 11px; }
}

/* v1.4.1 tweaks: badges + notes */
.laso-foot{display:flex; justify-content:space-between; align-items:center; margin-top:4px}
.laso-badges{display:flex; gap:4px}
.badge-invert{background:#000; color:#fff; padding:2px 6px; border-radius:3px; font-size:11px; font-weight:700}
.laso-ts{font-size:11px; color:#333; font-style:italic}
.star.sat{color:#4a2a7a; font-weight:600}
/* Slightly closer to sample */
.laso-cung-head{border-bottom:1px solid #d8cfc0; padding-bottom:2px; margin-bottom:4px}
.laso-cung{background-image:url('');}

/* v1.4.2: visibility & underline */
.tuvi2t-laso-a4{ overflow: visible; }
.star.major, .star.minor, .star.sat{ text-decoration: underline dotted; text-underline-offset: 2px; }
.tuvi2t-warn{ background:#fff3cd; color:#7a5d00; border:1px solid #ffe08a; padding:8px; margin:8px 0; border-radius:6px; }

/* v1.4.5 polish */
.laso-center{ border:2px solid var(--tuvi-primary); background:#fdf8f2; }
.laso-center .center-title{ font-size:22px; letter-spacing:1px; margin-bottom:6px }
.laso-cung .star.major{ color:#8b0000; font-weight:700 }
.laso-cung .star.minor{ color:#0d6b0d }
.laso-cung .star.sat{ color:#4a2a7a; font-weight:700 }
.laso-cung{ border:1.5px solid #c9b79a; border-radius:6px; }
.laso-cung-head .laso-cung-name{ font-weight:800; color:#6c0000 }
.laso-badge{ background:var(--tuvi-primary); color:#fff; padding:1px 6px; border-radius:10px; font-size:11px; margin-left:6px }

/* v1.5.0: triangle overlay + interpretation */
.laso-overlay{position:absolute; inset:0; pointer-events:none}
.tuvi2t-laso-grid{position:relative}
.laso-overlay line{stroke:#720101; stroke-width:2; opacity:.6}
.tuvi2t-interpret{margin-top:8px; padding:8px 10px; border:1px dashed #c8b79b; background:#fffdf8}
.tuvi2t-interpret h4{margin:0 0 6px 0; color:#6c0000}
.interpret-block p{margin:6px 0; font-size:13px; line-height:1.5}
@media print{ .tuvi2t-interpret{page-break-inside:avoid} }
