/* Phong thủy nhà. Dùng lại biến màu của site, mọi lớp đều có tiền tố ptn- hoặc pe-. */
.ptn-page { padding-top: 20px; padding-bottom: 48px; }
.ptn-hero h1 { font-family: "Noto Serif", serif; color: var(--red); font-size: clamp(26px, 4.4vw, 36px); line-height: 1.25; margin: 6px 0 10px; }
.ptn-hero p { color: var(--muted); max-width: 72ch; margin: 0 0 8px; }
.ptn-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.ptn-step h2, .ptn-sec h2 { font-family: "Noto Serif", serif; color: var(--red); font-size: 21px; margin: 0 0 6px; }
.ptn-step > p { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }
.ptn-sec h3 { margin: 22px 0 8px; font-size: 17px; }
.ptn-sec h4 { margin: 14px 0 6px; font-size: 15.5px; }
.ptn-sec h4 small { font-weight: 400; color: var(--muted); }
.ptn-num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--red); color: #fff; font: 700 14px/1 "Be Vietnam Pro", sans-serif; vertical-align: 2px; }

.ptn-member { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 12px; background: #fff; min-width: 0; }
.ptn-mh { padding: 0 6px; font-weight: 700; color: var(--red); }
.ptn-page input[type=number], .ptn-page input[type=text] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d9c9ab; border-radius: 10px; background: #fff; color: var(--ink); min-width: 0; min-height: 46px; font-size: 16px; }
.ptn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ptn-date { grid-template-columns: 1fr 1fr 1.3fr; }
.ptn-row .field { margin-bottom: 10px; }
.ptn-cal { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 10px; font-size: 14.5px; }
.ptn-cal label, .ptn-nohour, .ptn-owner { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ptn-nohour { padding-bottom: 20px; font-size: 14.5px; }
.ptn-mf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; font-size: 14px; }
.ptn-del { background: none; border: 0; color: var(--red-2); text-decoration: underline; cursor: pointer; font: inherit; padding: 4px; }
.ptn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ptn-dirs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ptn-dirbtn { border: 1px solid #dcc7a3; background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink); }
.ptn-dirbtn:hover { background: var(--gold-soft); }
.ptn-note { font-size: 13.5px; color: var(--muted); margin: -2px 0 12px; }
.ptn-note.ptn-warn { color: #92400e; }
.ptn-g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ptn-lg { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ptn-lg legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.ptn-ck { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 14.5px; cursor: pointer; }
.ptn-ck input { margin-top: 4px; flex: none; }
.ptn-ck-s { display: inline-flex; padding: 4px 12px 4px 0; align-items: center; }
.ptn-ck-s input { margin-top: 0; }
.ptn-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-weight: 600; }
.ptn-privacy { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* Trình đánh dấu bản vẽ */
.pe-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pe-tabs button { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); }
.pe-tabs button[aria-selected=true] { background: var(--red); color: #fff; border-color: var(--red); }
.pe-tabs .pe-add { border-style: dashed; color: var(--red-2); }
.pe-tabs .pe-del { color: var(--muted); }
.pe-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pe-top .btn { padding: 8px 12px; font-size: 14px; }
.pe-up { cursor: pointer; }
.pe-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.pe-inline select { width: auto; padding: 6px 8px; }
.pe-hint { font-size: 13.5px; color: var(--muted); margin: 4px 0 8px; }
.pe-msg { font-size: 13.5px; color: #0f766e; margin: 4px 0; }
.pe-msg.pe-bad { color: #991b1b; font-weight: 600; }
.pe-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pe-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.pe-chip i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.pe-chip.on { border-color: var(--red); box-shadow: 0 0 0 2px var(--red) inset; font-weight: 700; }
.pe-stage { position: relative; width: 100%; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pe-stage.pe-blank { background: linear-gradient(#efe7d6 1px, transparent 1px) 0 0 / 100% 24px, linear-gradient(90deg, #efe7d6 1px, #fff 1px) 0 0 / 24px 100%; }
.pe-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.pe-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pe-svg.drawing { cursor: crosshair; touch-action: none; }
.pe-lb { fill: #7f1d1d; font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 4px; font-family: "Be Vietnam Pro", sans-serif; }
.pe-rlb { fill: #2b2118; font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-width: 4px; font-family: "Be Vietnam Pro", sans-serif; }
.pe-room { cursor: move; touch-action: none; }
.pe-h { cursor: nwse-resize; touch-action: none; stroke: #fff; stroke-width: 3px; }
.pe-hf { fill: #b8892d; }
.pe-hr { fill: #7f1d1d; }
.pe-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; background: var(--gold-soft); border-radius: 10px; }
.pe-sel .btn { padding: 6px 12px; font-size: 13.5px; }

/* Kết quả */
.ptn-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.ptn-sec, .ptn-step { min-width: 0; }
.ptn-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.ptn-tile { border: 1px solid var(--line); border-top: 4px solid var(--muted); border-radius: 10px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.ptn-tile b { font: 700 28px/1.1 "Noto Serif", serif; }
.ptn-tile b small { font: 400 13px "Be Vietnam Pro", sans-serif; color: var(--muted); }
.ptn-tile span { font-weight: 600; }
.ptn-tile small { color: var(--muted); font-size: 12.5px; }
.ptn-tile.good { border-top-color: #1baf7a; }
.ptn-tile.warn { border-top-color: #eda100; }
.ptn-tile.bad { border-top-color: #dc2626; }
.ptn-tile.none b { font-size: 18px; color: var(--muted); }
.ptn-sum { padding-left: 20px; margin: 8px 0; }
.ptn-sum li { margin: 5px 0; }
.ptn-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ptn-toc a { background: var(--gold-soft); color: var(--red); padding: 5px 11px; border-radius: 999px; font-size: 13.5px; text-decoration: none; font-weight: 600; }
.ptn-alert { background: #fff7ed; border-left: 4px solid #c2410c; padding: 9px 12px; border-radius: 6px; font-size: 14.5px; }
.ptn-ok { background: #ecfdf5; border-left: 4px solid #1baf7a; padding: 9px 12px; border-radius: 6px; font-size: 14.5px; }
.ptn-mute { color: var(--muted); font-size: 13.5px; }
.ptn-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ptn-pill.good { background: #d1fae5; color: #065f46; }
.ptn-pill.warn { background: #fef3c7; color: #92400e; }
.ptn-pill.bad { background: #fee2e2; color: #991b1b; }
.ptn-tw { overflow-x: auto; margin: 10px 0; }
.ptn-t { border-collapse: collapse; width: 100%; font-size: 14px; background: #fff; }
.ptn-t th, .ptn-t td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.ptn-t thead th { background: var(--gold-soft); }
.ptn-t small { color: var(--muted); font-weight: 400; }
.ptn-du td.cat { background: #ecfdf5; color: #065f46; }
.ptn-du td.hung { background: #fef2f2; color: #991b1b; }
.ptn-t .ptn-lines { margin: 0; min-width: 240px; }
.ptn-lines { list-style: none; padding: 0; margin: 6px 0; }
.ptn-lines li { padding: 5px 0 5px 12px; border-left: 3px solid var(--line); margin: 5px 0; font-size: 14px; }
.ptn-lines li.good { border-left-color: #1baf7a; }
.ptn-lines li.warn { border-left-color: #eda100; }
.ptn-lines li.bad { border-left-color: #dc2626; }
.ptn-lines em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); display: block; }
.ptn-fs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 460px; margin: 14px auto 6px; }
.ptn-fc { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.ptn-fc.hot { background: #fff7e6; border-color: var(--gold); }
.ptn-fc.y5 .ptn-fy { color: #991b1b; font-weight: 700; }
.ptn-fd { font-size: 12.5px; font-weight: 600; color: var(--red); }
.ptn-tag { font-style: normal; font-size: 10.5px; margin-left: 4px; padding: 0 5px; border-radius: 4px; color: #fff; background: var(--red-2); white-space: nowrap; }
.ptn-tag.t { background: #57534e; }
.ptn-fn { display: flex; justify-content: center; gap: 9px; font-size: 21px; line-height: 1.2; }
.ptn-fn .v { color: #a8a29e; font-weight: 500; font-size: 16px; align-self: center; }
.ptn-fn .s3 { color: #b91c1c; }
.ptn-fn .s2 { color: #0f766e; }
.ptn-fn .s0, .ptn-fn .s-1 { color: #78716c; font-weight: 500; }
.ptn-fn .s-3 { color: #1c1917; text-decoration: underline; }
.ptn-fy { font-size: 11.5px; color: var(--muted); }
.ptn-legend { text-align: center; }
.ptn-pn details { border-bottom: 1px solid var(--line); padding: 7px 0; }
.ptn-pn summary { cursor: pointer; }
.ptn-pn p { margin: 6px 0; font-size: 14px; }
.ptn-moves { padding-left: 20px; }
.ptn-moves li { margin: 5px 0; }
.ptn-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.ptn-plans figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; min-width: 0; }
.ptn-plan { display: block; width: 100%; height: auto; }
.ptn-plans figcaption { padding: 6px; text-align: right; }
.ptn-plans .btn { padding: 6px 12px; font-size: 13px; }
.ptn-mrec, .ptn-rrec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.ptn-dec { padding-left: 18px; margin: 6px 0; font-size: 14.5px; }
.ptn-dec li { margin: 4px 0; }
.ptn-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 10px 0; }
.ptn-prod { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.ptn-prod p { margin: 0 0 6px; font-size: 13px; color: var(--muted); flex: 1; }
.ptn-prod b { font-size: 14px; line-height: 1.35; }
.ptn-prod-k { font-size: 11.5px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .03em; }
.ptn-prod .btn-shop { align-self: flex-start; }
.ptn-own { background: #fff9ec; border-color: var(--gold); }
.ptn-ctas { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .ptn-row { grid-template-columns: 1fr; gap: 0; }
  .ptn-date { grid-template-columns: 1fr 1fr 1.3fr; gap: 8px; }
  .ptn-nohour { padding-bottom: 10px; }
  .ptn-tiles { grid-template-columns: 1fr; }
  .ptn-plans { grid-template-columns: 1fr; }
  .ptn-g3 { grid-template-columns: 1fr 1fr; }
  .ptn-fn { font-size: 18px; gap: 6px; }
  .ptn-tag { display: block; margin: 2px auto 0; width: max-content; }
}

@media print {
  .site-header, .site-footer, .msg-fab, .zalo-fab, #ptn-form, .ptn-hero, .ptn-toc, .ptn-dl, .ptn-ctas, .crumbs { display: none !important; }
  .ptn-sec { box-shadow: none; break-inside: auto; }
  .ptn-plans figure, .ptn-fs { break-inside: avoid; }
  .ptn-pn details > * { display: block; }
}
