/* Lịch Vạn Niên – phong cách lịch bloc đỏ truyền thống.
   Bố cục: một cột cỡ điện thoại, thanh tab dưới, nội dung cuộn ở giữa. */
:root {
  --paper: #F4EFE6;      /* nền giấy */
  --card: #FFFCF6;       /* tờ lịch */
  --ink: #2A1C16;        /* chữ chính */
  --muted: #7E6D63;      /* chữ phụ */
  --line: #E4D8C8;       /* đường kẻ */
  --red: #B5141E;        /* đỏ son – chủ nhật, ngày lễ */
  --red-deep: #85100F;
  --gold: #B8841F;       /* vàng đồng – âm lịch, mùng 1 / rằm */
  --jade: #2E6A55;       /* xanh ngọc – giờ hoàng đạo, thứ bảy */
  --red-wash: #F8E3DE;
  --sun: #C0161F;        /* chủ nhật, ngày lễ – luôn đỏ */
  --body: #E9E1D4;
  --gold-wash: #F6EBD3;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--body);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  position: relative;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(42, 28, 22, .06), 0 10px 40px rgba(42, 28, 22, .12);
  overflow: hidden;
}

/* ---------- Thanh trên ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--red);
  color: #FFF6EC;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: #FFF6EC; color: var(--red); font-family: serif; font-size: 18px; font-weight: 700;
}
.brand-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: .2px; }

.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
}
.chip-today { background: #FFF6EC; border-color: transparent; color: var(--red); }

/* ---------- Vùng nội dung ---------- */
.views { flex: 1; overflow: hidden; position: relative; }
.view {
  height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
}

.view > * { flex-shrink: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px;
}
.card-title {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}

/* ---------- Tờ lịch bloc ---------- */
.bloc {
  position: relative; background: var(--card); border-radius: var(--r);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 3px 0 -1px #EADFCF, 0 6px 0 -2px #E2D5C2, 0 12px 24px rgba(42, 28, 22, .10);
  overflow: hidden; touch-action: pan-y;
}
.bloc-head {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--red); color: #FFF3E6; padding: 18px 16px 10px;
  font-weight: 600; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  position: relative;
}
.bloc-head::before { /* lỗ ghim tờ lịch */
  content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 6px; border-radius: 6px;
  background: radial-gradient(circle, var(--red-deep) 2.5px, transparent 3px) 0 0 / 16px 6px repeat-x;
}
.bloc-main { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 6px 4px 0; }
.bloc-nav {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); font-size: 26px; line-height: 1;
}
.bloc-nav:active { background: var(--gold-wash); }
.bigday {
  border: 0; background: transparent; padding: 0; width: 100%;
  text-align: center; font-family: var(--font-display); font-weight: 800;
  font-size: 128px; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums;
  letter-spacing: -2px;
}
.is-sun .bigday, .is-off .bigday { color: var(--sun); }
.is-sat .bigday { color: var(--jade); }
.weekday { text-align: center; font-size: 20px; font-weight: 700; margin-top: 2px; }
.is-sun .weekday, .is-off .weekday { color: var(--sun); }
.is-sat .weekday { color: var(--jade); }
.ribbon {
  margin: 10px auto 0; width: fit-content; max-width: calc(100% - 32px);
  background: var(--red-wash); color: var(--red-deep); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; font-weight: 600; text-align: center; text-wrap: balance;
}
.ribbon.is-gold { background: var(--gold-wash); color: #7A5410; }
.proverb {
  margin: 12px 24px 14px; text-align: center; font-family: var(--font-display);
  font-style: italic; font-weight: 600; font-size: 16px; color: var(--muted); text-wrap: balance;
}
.bloc-foot {
  display: grid; grid-template-columns: 120px 1fr; border-top: 1px dashed var(--line);
}
.lunar-box {
  padding: 12px 10px 14px; text-align: center; border-right: 1px dashed var(--line);
  background: linear-gradient(var(--gold-wash), var(--card));
}
.lunar-box .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.lunar-box .lday { font-family: var(--font-display); font-size: 52px; font-weight: 800; line-height: 1.05; color: var(--gold); }
.lunar-box .lmon { font-size: 13px; font-weight: 600; }
.canchi { margin: 0; padding: 10px 14px; display: grid; gap: 4px; align-content: center; }
.canchi div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.canchi dt { color: var(--muted); }
.canchi dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Giờ hoàng đạo ---------- */
.hours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hour {
  border-radius: 10px; background: #EAF2EE; color: var(--jade); padding: 6px 8px; text-align: center;
}
.hour b { display: block; font-size: 15px; }
.hour span { font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- Danh sách hẹn / ghi chú ---------- */
.items { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start;
  width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 0;
  border-top: 1px solid var(--line);
}
.items .item:first-child { border-top: 0; padding-top: 0; }
.item-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--red); padding-top: 1px; }
.item-time.is-note { color: var(--gold); }
.item-title { font-weight: 600; }
.item-sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.tag {
  font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px;
  background: var(--paper); color: var(--muted); border: 1px solid var(--line);
}
.tag.is-lunar { background: var(--gold-wash); color: #7A5410; border-color: transparent; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--red); border-color: var(--red); color: #FFF6EC; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--sun); border-color: #E8C3BE; background: transparent; }
.btn:active { transform: translateY(1px); }

/* ---------- Lịch tháng ---------- */
.month-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.month-title {
  border: 0; background: transparent; font-family: var(--font-display);
  font-size: 24px; font-weight: 700; text-align: center; padding: 2px 0;
}
.month-title small { display: block; font-family: var(--font-body); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.month-pick { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; touch-action: pan-y; }
.dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dow.is-sun { color: var(--sun); }
.dow.is-sat { color: var(--jade); }
.cell {
  position: relative; aspect-ratio: 1 / 1.08; border: 1px solid transparent; border-radius: 10px;
  background: var(--card); padding: 4px 5px; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between;
}
.cell.is-other { background: transparent; opacity: .4; }
.cell .s { font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cell .l { margin-left: auto; font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell.is-sun .s, .cell.is-off .s { color: var(--sun); }
.cell.is-sat .s { color: var(--jade); }
.cell.is-lmark .l { color: var(--gold); font-weight: 700; }
.cell.is-today { border-color: var(--red); }
.cell.is-sel { background: var(--red); }
.cell.is-sel .s, .cell.is-sel .l { color: #FFF6EC !important; }
.dots { position: absolute; top: 5px; right: 5px; display: flex; gap: 2px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.dot.is-ev { background: var(--jade); }
.dot.is-note { background: var(--gold); }
.cell.is-sel .dot { background: #FFF6EC; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.day-sum { display: flex; gap: 12px; align-items: center; }
.day-num {
  font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; min-width: 56px; text-align: center;
}
.day-num.is-red { color: var(--sun); }
.day-num.is-jade { color: var(--jade); }
.day-meta { font-size: 14px; }
.day-meta b { font-size: 15px; }
.day-meta .muted { color: var(--muted); }

/* ---------- Lịch hẹn ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #E8DFD2; border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(42, 28, 22, .12); }
.group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 0; }
.group-head b { font-size: 14px; }
.group-head span { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick button {
  text-align: left; border: 1px dashed #D9C9B3; background: transparent; border-radius: 12px; padding: 10px 12px;
}
.quick b { display: block; font-size: 14px; }
.quick span { font-size: 12px; color: var(--muted); }
.fab {
  position: absolute; right: 18px; bottom: 16px;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--red); color: #FFF6EC; font-size: 30px; line-height: 1;
  box-shadow: 0 6px 16px rgba(133, 16, 15, .35); z-index: 5;
}
.note-text { white-space: pre-wrap; }

/* ---------- Đổi ngày ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 0; min-width: 0; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #FFF; border-radius: 10px;
  padding: 9px 10px; font-size: 15px; min-height: 42px;
}
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.result {
  margin-top: 12px; border-radius: 12px; background: var(--gold-wash); padding: 12px 14px;
}
.result .big { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.25; }
.result .muted { color: var(--muted); font-size: 13.5px; }
.result.is-error { background: var(--red-wash); color: var(--red-deep); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- Thanh tab dưới ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0;
  border-radius: 10px;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--red); }
.tab[aria-current="page"] svg { stroke-width: 2.1; }

/* ---------- Bảng nhập (sheet) ---------- */
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(42, 28, 22, .38); z-index: 20;
  display: flex; align-items: flex-end;
}
.sheet {
  width: 100%; max-height: 92%; overflow-y: auto; background: var(--paper);
  border-radius: 20px 20px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: #D6C8B6; margin: 4px auto 10px; }
.sheet-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 22px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.sheet-actions .right { display: flex; gap: 8px; margin-left: auto; }

.toast {
  position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #FFF6EC; padding: 9px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; white-space: nowrap;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .toast { transition: none; }
}
@media (max-width: 370px) {
  .icons { grid-template-columns: repeat(6, 1fr); }
  .bigday { font-size: 104px; }
  .bloc-foot { grid-template-columns: 104px 1fr; }
}

/* ================= Bản 1.1 ================= */
.caret { font-size: .6em; color: var(--muted); vertical-align: middle; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; margin-left: auto; }
.legend { align-items: center; }

/* Ô ngày: số dương trên trái, biểu tượng hẹn trên phải, dấu + ngày âm ở dưới */
.cell-foot { display: flex; align-items: flex-end; gap: 2px; }
.marks { display: flex; gap: 2px; padding-bottom: 1px; }
.ev-ic { position: absolute; top: 3px; right: 3px; font-size: 13px; line-height: 1; }
.ev-ic sup { font-size: 9px; font-weight: 700; color: var(--jade); margin-left: 1px; }
.cell.is-sel .ev-ic sup { color: #FFF6EC; }

/* Mục lịch hẹn có biểu tượng */
.item-main { display: flex; gap: 8px; align-items: flex-start; }
.item-ic { font-size: 18px; line-height: 1.2; width: 22px; text-align: center; flex: none; }

/* Ô chọn tự thiết kế */
.fbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #FFF; border-radius: 12px; padding: 9px 12px; min-height: 48px;
}
.fbtn > span:nth-child(2) { flex: 1; min-width: 0; }
.fbtn b { display: block; font-size: 15px; }
.fbtn small { display: block; font-size: 12.5px; color: var(--muted); }
.fbtn-ic { font-size: 18px; }
.fbtn:active { background: var(--gold-wash); }
.fbtn-time { flex: 1 1 0; }
.row .switch-row { flex: 1 1 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-opt {
  border: 1px solid var(--line); background: #FFF; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 500;
}
.chip-opt[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #FFF6EC; font-weight: 600; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); background: #FFF; border-radius: 12px; padding: 9px 12px; min-height: 48px; font-weight: 500;
}
.switch { width: 42px; height: 24px; border-radius: 12px; background: #D9CDBD; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFF; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.switch-row[aria-checked="true"] .switch { background: var(--jade); }
.switch-row[aria-checked="true"] .switch::after { left: 21px; }

.icons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-opt {
  aspect-ratio: 1; border: 1px solid var(--line); background: #FFF; border-radius: 10px; font-size: 20px; line-height: 1; padding: 0;
}
.icon-opt[aria-pressed="true"] { border: 2px solid var(--red); background: var(--red-wash); }

/* ---------- Lịch năm ---------- */
.year-note { margin: -4px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.year-note b { color: var(--red); }
.ygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; touch-action: pan-y; }
.ymini {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 4px 5px; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
}
.ymini.is-cur { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ym-name { font-weight: 700; font-size: 12.5px; color: var(--red); padding-left: 3px; }
.ym-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 1px; }
.ym-grid i { font-style: normal; font-size: 9.5px; line-height: 15px; height: 15px; text-align: center; font-variant-numeric: tabular-nums; border-radius: 4px; }
.ym-grid .yd { color: var(--muted); font-weight: 700; font-size: 8.5px; }
.ym-grid .yd.is-sun { color: var(--sun); }
.yc.is-red { color: var(--sun); font-weight: 700; }
.yc.is-off { background: var(--red-wash); }
.yc.is-l1 { color: var(--gold); font-weight: 800; box-shadow: inset 0 -1.5px 0 var(--gold); }
.yc.is-ev { text-decoration: underline 2px var(--jade); text-underline-offset: 2px; }
.yc.is-today { background: var(--red); color: #FFF6EC !important; }
.lg-l1 { color: var(--gold); box-shadow: inset 0 -1.5px 0 var(--gold); padding: 0 2px; }
.lg-ev { text-decoration: underline 2px var(--jade); text-underline-offset: 2px; }

/* ---------- Bộ chọn (nằm trên bảng nhập) ---------- */
.picker-backdrop { position: absolute; inset: 0; z-index: 40; background: rgba(42, 28, 22, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.picker {
  width: 100%; max-width: 380px; max-height: 94%; overflow-y: auto; background: var(--card); border-radius: 18px;
  padding: 14px 14px 12px; box-shadow: 0 16px 40px rgba(42, 28, 22, .3); animation: up .18s ease-out;
}
.pk-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.pk-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.pk-mtitle { border: 0; background: transparent; font-weight: 700; font-size: 16px; padding: 6px; border-radius: 8px; }
.pk-mtitle:active { background: var(--gold-wash); }
.pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; touch-action: pan-y; margin-top: 4px; }
.pk-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 3px 0; }
.pk-dow.is-sun { color: var(--sun); }
.pk-day {
  border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 4px 0 3px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.pk-day b { font-size: 16px; }
.pk-day small { font-size: 10px; color: var(--muted); }
.pk-day.is-other { opacity: .35; }
.pk-day.is-sun b { color: var(--sun); }
.pk-day.is-lmark small { color: var(--gold); font-weight: 700; }
.pk-day.is-today { border-color: var(--red); }
.pk-day.is-sel { background: var(--red); }
.pk-day.is-sel b, .pk-day.is-sel small { color: #FFF6EC; }
.pk-info { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--gold-wash); font-size: 13.5px; text-align: center; }
.pk-err { color: var(--red-deep); font-weight: 600; }
.pk-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.pk-right { display: flex; gap: 8px; margin-left: auto; }
.pk-foot .btn[disabled] { opacity: .45; }
.pk-year { display: flex; align-items: center; justify-content: center; gap: 2px; }
.pk-ynum { min-width: 110px; text-align: center; font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.pk-ynum small { display: block; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pk-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pk-mon { border: 1px solid var(--line); background: #FFF; border-radius: 12px; padding: 12px 4px; font-weight: 600; }
.pk-mon.is-today { border-color: var(--red); color: var(--red); }
.pk-mon.is-sel { background: var(--red); border-color: var(--red); color: #FFF6EC; }
.pk-cols { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr; gap: 6px; }
.pk-cols-2 { grid-template-columns: 1fr 1fr; }
.pk-col {
  height: 248px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #FFF;
  display: flex; flex-direction: column; gap: 2px; position: relative; overscroll-behavior: contain;
}
.pk-opt { flex: none; border: 0; background: transparent; border-radius: 8px; padding: 9px 4px; font-size: 14.5px; font-weight: 500; text-align: center; line-height: 1.15; }
.pk-opt small { display: block; font-size: 11px; color: var(--muted); }
.pk-opt.is-sel { background: var(--red); color: #FFF6EC; font-weight: 700; }
.pk-opt.is-sel small { color: #FBDCD6; }
.pk-clock { text-align: center; font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--red); margin-bottom: 8px; font-variant-numeric: tabular-nums; }

/* ---------- Xem trước trang in ---------- */
.print-preview { background: #D9CFC2; border-radius: 12px; padding: 12px; display: flex; justify-content: center; }
.print-preview img { width: 100%; max-width: 340px; box-shadow: 0 4px 16px rgba(0,0,0,.2); background: #FFF; }

/* ---------- Trang A4 để in (794 × 1123 px) ---------- */
#print-stage { position: fixed; left: -10000px; top: 0; }
.pp {
  width: 794px; height: 1123px; background: #FFF; color: #241712; padding: 40px 40px 26px;
  display: flex; flex-direction: column; font-family: var(--font-body);
}
.pp-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--red); padding-bottom: 12px; margin-bottom: 14px; }
.pp-kicker { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.pp-title { font-family: var(--font-display); font-size: 46px; font-weight: 800; line-height: 1.05; }
.pp-sub { text-align: right; font-size: 15px; line-height: 1.5; color: #5E4E45; }
.pp-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.pp-dow { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--red-wash); border-radius: 6px; }
.pp-dow.is-sun { color: var(--sun); }
.pp-dow.is-sat { color: var(--jade); }
.pc { position: relative; border: 1px solid transparent; border-radius: 7px; padding: 6px 7px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.pp-border .pc:not(.is-blank) { border-color: #E3D9CC; }
.pc.is-off { background: #FCEDEA; }
.pc-s { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1; }
.pc.is-red .pc-s { color: var(--sun); }
.pc.is-sat .pc-s { color: var(--jade); }
.pc-l { position: absolute; top: 7px; right: 8px; font-size: 13px; color: #7E6D63; }
.pc-l.is-lmark { color: var(--gold); font-weight: 800; }
.pc-h { font-size: 10.5px; font-weight: 700; color: var(--sun); line-height: 1.2; margin-top: 3px; }
.pc-e { font-size: 10.5px; line-height: 1.3; max-height: 2.6em; overflow: hidden; word-break: break-word; }
.pc-note { color: #8A6418; }
.pc-more { color: #7E6D63; }
.pp-foot { display: flex; gap: 22px; justify-content: space-between; font-size: 12px; color: #7E6D63; padding-top: 10px; }
.pp-red { color: var(--sun); }
.pp-gold { color: var(--gold); }
.pp-u { display: inline-block; width: 16px; border-bottom: 2px solid var(--jade); vertical-align: middle; margin-right: 3px; }
.pp-ygrid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: 12px 20px; }
.ym-t { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5px solid var(--red); padding-bottom: 2px; margin-bottom: 3px; }
.ym-t b { font-size: 15px; color: var(--red); }
.ym-t span { font-size: 10.5px; color: #7E6D63; }
.ym-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.ym-dow { text-align: center; font-size: 9.5px; font-weight: 700; color: #7E6D63; padding: 1px 0; }
.ym-dow.is-sun { color: var(--sun); }
.ym-c { height: 30px; position: relative; text-align: center; border: 1px solid transparent; border-radius: 4px; }
.pp-border .ym-g { gap: 2px; }
.pp-border .ym-c:not(:empty) { border-color: #E6DDD1; height: 28px; }
.ym-c b { display: block; font-size: 13px; line-height: 17px; }
.ym-c i { display: block; font-style: normal; font-size: 8.5px; line-height: 10px; color: #8C7B70; }
.ym-c i.is-lmark { color: var(--gold); font-weight: 800; }
.ym-c.is-red b { color: var(--sun); }
.ym-c.is-off { background: #FCEDEA; border-radius: 4px; }
.ym-c.is-hol b { text-decoration: underline 1px var(--sun); }
.ym-c u { position: absolute; left: 30%; right: 30%; bottom: 0; border-bottom: 2px solid var(--jade); }

/* ================= Bản 1.2 ================= */
.rate { font-size: 12px; letter-spacing: 0; text-transform: none; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.rate.is-good { background: #DDEFE6; color: var(--jade); }
.rate.is-bad { background: var(--red-wash); color: var(--red-deep); }
.rate.is-mid { background: var(--gold-wash); color: #7A5410; }
.tag.is-good { background: #DDEFE6; color: var(--jade); border-color: transparent; }
.tag.is-bad { background: var(--red-wash); color: var(--red-deep); border-color: transparent; }
.facts { margin: 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; font-size: 14px; align-items: baseline; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.hrs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hr { border-radius: 10px; background: #F1ECE4; color: var(--muted); padding: 6px 4px; text-align: center; line-height: 1.2; }
.hr b { display: block; font-size: 14.5px; color: var(--ink); opacity: .75; }
.hr span { display: block; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.hr small { display: block; font-size: 10.5px; margin-top: 1px; }
.hr.is-good { background: #E3F0EA; color: var(--jade); }
.hr.is-good b { color: var(--jade); opacity: 1; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #E4DDD2; margin: 0 3px 0 8px; vertical-align: -1px; }
.key.is-good { background: #BFDCCD; }
.todo-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.todo-cols .card-title { margin-bottom: 6px; }
.todo { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.todo li { display: flex; gap: 6px; align-items: baseline; }
.todo.is-yes li::before { content: '✓'; color: var(--jade); font-weight: 800; }
.todo.is-no li::before { content: '✕'; color: var(--sun); font-weight: 800; }
.fab-sm {
  position: absolute; right: 14px; bottom: 14px; z-index: 5;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(42, 28, 22, .15);
}
.fab-sm svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.fab-sm:active { background: var(--gold-wash); color: var(--red); }
#view-lich-thang, #view-lich-nam { padding-bottom: 68px; }

/* ================= Bản 1.3 ================= */
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 246, 236, .16); color: #FFF6EC;
  display: grid; place-items: center;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { background: #FFF6EC; color: var(--red); }
.tab span { white-space: nowrap; }

/* Can chi + con giáp */
.zchips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.zchip { display: flex; gap: 6px; align-items: center; background: var(--paper); border-radius: 12px; padding: 8px 8px; min-width: 0; }
.zic { font-size: 26px; line-height: 1; flex: none; }
.zchip small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.zchip b { display: block; font-size: 13.5px; line-height: 1.2; }
.zchip em { display: block; font-style: normal; font-size: 12px; color: var(--gold); font-weight: 600; }
.zi { font-size: 17px; line-height: 1; vertical-align: -2px; }

/* Cài đặt */
.set-text { margin: 0 0 6px; font-size: 14px; }
.set-list { display: flex; flex-direction: column; gap: 8px; }
.set-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #FFF; border-radius: 12px; padding: 10px 12px; min-height: 56px;
}
.set-row > span:nth-child(2) { flex: 1; min-width: 0; }
.set-row b, .set-label b { display: block; font-size: 14.5px; }
.set-row small, .set-label small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.set-row.is-danger b { color: var(--sun); }
.set-ic { font-size: 22px; width: 28px; text-align: center; }
.set-label { flex: 1; min-width: 0; text-align: left; }
.switch-row .set-label + .switch { margin-left: 8px; }
.about { font-size: 14px; }
.locked { text-align: center; padding: 28px 18px; }
.lock-ic { font-size: 40px; margin-bottom: 6px; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice .btn { justify-content: center; }
#ex-opts { margin-bottom: 4px; }
.btn[disabled] { opacity: .45; }

/* ================= Bản 1.4 ================= */
.zline { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); }
.zline b { color: var(--ink); font-weight: 600; }
.zline .zi { font-size: 14px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
.swatch { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); padding: 4px 0; border-radius: 12px; }
.swatch i { width: 40px; height: 40px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.swatch[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.swatch[aria-pressed="true"] i { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.about p { margin: 6px 0 0; font-size: 14px; }
.about .dev { color: var(--red); font-weight: 700; }
.precepts { margin: 6px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 2px; }
.about .wish { font-weight: 700; color: var(--red); }
.zline span.zs { white-space: nowrap; }

/* ================= Bản 1.5 ================= */
.topbar { display: none; }
.views { padding-top: env(safe-area-inset-top); }
.float-btn {
  position: absolute; right: 14px; z-index: 6;
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(42, 28, 22, .15);
}
.float-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#btn-privacy { bottom: calc(66px + 64px + env(safe-area-inset-bottom)); }
.app[data-tab="lich-hen"] #btn-privacy { bottom: calc(66px + 84px + env(safe-area-inset-bottom)); }
#btn-privacy[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #FFF6EC; }
#btn-today {
  position: absolute; left: 14px; bottom: calc(66px + 14px + env(safe-area-inset-bottom)); z-index: 6;
  border: 1px solid var(--line); background: var(--card); color: var(--red); font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 9px 14px; box-shadow: 0 3px 10px rgba(42, 28, 22, .15);
}
.tabbar { grid-template-columns: repeat(5, 1fr) !important; }
.zline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.app-icon-row { display: flex; gap: 14px; align-items: center; }
.app-icon-row img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 3px 10px rgba(42, 28, 22, .2); flex: none; }
.pk-left { display: flex; gap: 2px; }
.pk-left .btn { padding: 9px 10px; }
.view { padding-bottom: 130px !important; }

/* ================= Bản 1.6: báo thức ================= */
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.al-list { display: flex; flex-direction: column; gap: 8px; }
.al-row { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px 6px 4px; }
.al-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left; padding: 6px 8px; }
.al-hm { font-family: var(--font-display); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); }
.al-info { min-width: 0; }
.al-info b { display: block; font-size: 15px; }
.al-info small { display: block; font-size: 12.5px; color: var(--muted); }
.al-info .al-next { color: var(--red); font-weight: 600; }
.al-row.is-off .al-hm, .al-row.is-off .al-info { opacity: .45; }
.al-row.is-off .al-info .al-next { color: var(--muted); }
.al-switch { border: 0; background: transparent; padding: 8px; }
.al-switch[aria-checked="true"] .switch { background: var(--jade); }
.al-switch[aria-checked="true"] .switch::after { left: 21px; }
.al-bigtime { display: block; width: 100%; border: 1px solid var(--line); background: #FFF; border-radius: 16px; padding: 10px 0 8px; text-align: center;
  font-family: var(--font-display); font-size: 56px; font-weight: 800; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.al-bigtime small { display: block; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.wd-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd, .ld { border: 1px solid var(--line); background: #FFF; border-radius: 50%; aspect-ratio: 1; font-weight: 700; font-size: 13.5px; padding: 0; }
.wd.is-sun { color: var(--sun); }
.wd[aria-pressed="true"], .ld[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #FFF6EC; }
.ld-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.ld { border-radius: 8px; font-size: 12.5px; }
.ld.is-mark { color: var(--gold); }
.snd-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #FFF; overflow: hidden; }
.snd { display: flex; align-items: center; border-top: 1px solid var(--line); }
.snd:first-child { border-top: 0; }
.snd-pick { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 11px 12px; text-align: left; font-size: 14.5px; }
.snd-pick small { margin-left: auto; color: var(--muted); font-size: 12px; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #CDBFAE; flex: none; }
.snd.is-sel .radio { border: 5px solid var(--red); }
.snd.is-sel .snd-pick { font-weight: 700; }
.snd-play { border: 0; background: var(--red-wash); color: var(--red); width: 34px; height: 34px; border-radius: 50%; margin-right: 10px; font-size: 13px; }
.snd.is-disabled { opacity: .55; }
.al-next-hint { color: var(--red); font-weight: 600; text-align: center; }
.perm { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.about a.dev { text-decoration: none; }

/* Màn hình reo */
.ringer {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(170deg, var(--red) 0%, var(--red-deep) 100%); color: #FFF6EC;
  padding: calc(48px + env(safe-area-inset-top)) 24px calc(36px + env(safe-area-inset-bottom)); text-align: center;
}
.rg-bell { font-size: 54px; animation: shake 1s ease-in-out infinite; display: inline-block; }
@keyframes shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(5deg); } }
.rg-time { font-family: var(--font-display); font-size: 88px; font-weight: 800; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.rg-label { font-size: 22px; font-weight: 700; margin-top: 12px; }
.rg-date { font-size: 15px; opacity: .85; margin-top: 10px; line-height: 1.5; }
.rg-note { margin-top: 14px; font-size: 12.5px; opacity: .7; }
.rg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rg-btn { border: 0; border-radius: 20px; padding: 20px 10px; font-size: 20px; font-weight: 800; }
.rg-btn small { display: block; font-size: 12.5px; font-weight: 500; opacity: .8; margin-top: 2px; }
.rg-snooze { background: rgba(255, 246, 236, .18); color: #FFF6EC; }
.rg-stop { background: #FFF6EC; color: var(--red-deep); }
@media (prefers-reduced-motion: reduce) { .rg-bell { animation: none; } }
.al-switch { flex: none; }
.ld.is-mark[aria-pressed="true"] { color: #FFF6EC; }
.al-switch .switch { display: block; }

/* 1.7: nút đồng hồ báo thức nổi, nằm trên nút con mắt */
#btn-alarms { bottom: calc(66px + 112px + env(safe-area-inset-bottom)); color: var(--red); }
.app[data-tab="lich-hen"] #btn-alarms { bottom: calc(66px + 132px + env(safe-area-inset-bottom)); }
.fb-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }

/* 1.8: thẻ ngày dưới lịch tháng bấm để mở lịch ngày */
.card-link { cursor: pointer; transition: background .15s; }
.card-link:active { background: var(--red-wash); }
.card-link .day-sum { position: relative; }
.card-go { margin-left: auto; align-self: center; font-size: 28px; line-height: 1; color: var(--muted); padding-left: 8px; }

/* 1.9: trạng thái quyền trong app, nhạc chuông điện thoại */
.perm-live { list-style: none; padding-left: 0; }
.perm-row { display: flex; align-items: center; gap: 10px; background: #FFF; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; }
.perm-row > span:nth-child(2) { flex: 1; min-width: 0; }
.perm-row b { display: block; font-size: 14px; }
.perm-row small { display: block; font-size: 12px; color: var(--muted); }
.perm-ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.perm-ok.is-ok { background: #DDEFE6; color: var(--jade); }
.perm-ok.is-bad { background: var(--red-wash); color: var(--sun); }
.snd-group { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--line); background: var(--paper); }

/* 2.0: nhắc cấp quyền trong mục Báo thức */
.perm-warn { display: block; width: 100%; text-align: left; border-color: #E8C3BE; background: var(--red-wash); cursor: pointer; }
.perm-warn b { display: block; color: var(--sun); font-size: 14.5px; }
.perm-warn span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ================= Bố cục 2 cột + máy tính (bản xem lịch 1.0 / app 2.2) ================= */
.col-l, .col-r { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.view-only .tabbar { grid-template-columns: repeat(4, 1fr) !important; }
.install-help p { margin: 0 0 6px; font-size: 13.5px; }

@media (min-width: 900px) {
  .app { max-width: 1240px; box-shadow: none; }
  .tabbar {
    order: -1; display: flex !important; justify-content: center; gap: 6px;
    border-top: 0; border-bottom: 1px solid var(--line); padding: 10px 16px;
  }
  .tab { flex-direction: row; gap: 8px; padding: 8px 18px; font-size: 14.5px; }
  .tab svg { width: 21px; height: 21px; }
  .tab[aria-current="page"] { background: var(--red-wash); }
  .view { padding: 24px 28px 96px !important; }
  .view:has(> .col-l) { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); gap: 24px; align-items: start; }
  .view:not(:has(> .col-l)) > *:not(.fab):not(.fab-sm) { width: 100%; max-width: 980px; margin-left: auto; margin-right: auto; }
  .cell { aspect-ratio: 1.3 / 1; }
  .fab { right: 28px; bottom: 24px; }
  .month-title { font-size: 30px; }
  .cell { border-radius: 12px; padding: 6px 8px; }
  .cell .s { font-size: 23px; }
  .cell .l { font-size: 13px; }
  .ev-ic { font-size: 16px; top: 6px; right: 6px; }
  .dow { font-size: 13px; }
  .bigday { font-size: 150px; }
  .ygrid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .ymini { padding: 10px 8px 8px; }
  .ym-name { font-size: 15px; }
  .ym-grid i { font-size: 12.5px; line-height: 24px; height: 24px; }
  .ym-grid .yd { font-size: 11px; }
  .sheet-backdrop { align-items: center; justify-content: center; }
  .sheet { max-width: 560px; border-radius: 20px; max-height: 88%; }
  .sheet-grip { display: none; }
  #btn-today { bottom: 20px; }
  #btn-privacy { bottom: 74px; }
  #btn-alarms { bottom: 122px; }
  .app[data-tab="lich-hen"] #btn-privacy { bottom: 94px; }
  .app[data-tab="lich-hen"] #btn-alarms { bottom: 142px; }
  .toast { bottom: 28px; }
}

/* ---------- Tờ lịch ngày A4 (bản 2.2) ---------- */
.pp-day { padding: 34px 40px 22px; gap: 12px; }
.pp-day .pp-head { margin-bottom: 0; }
.pp-day { position: relative; }
.pp-frame { padding: 46px 52px 34px; }
.pp-frame-b { position: absolute; inset: 16px; border: 2px solid var(--red); border-radius: 6px; pointer-events: none; }
.pp-frame-b::after { content: ''; position: absolute; inset: 4px; border: 1px solid var(--red); border-radius: 3px; opacity: .55; }
.pp-day .pp-kicker { margin-bottom: 6px; }
.pd-hero { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.pd-hero-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.pd-big { font-family: var(--font-display); font-weight: 800; font-size: 250px; line-height: .9; color: #241712; letter-spacing: -4px; }
.pd-wd { font-size: 26px; font-weight: 700; letter-spacing: .32em; color: #4A3A32; margin-right: -.32em; }
.pd-hero.is-red .pd-big, .pd-hero.is-red .pd-wd { color: var(--sun); }
.pd-hero.is-sat .pd-big, .pd-hero.is-sat .pd-wd { color: var(--jade); }
.pd-ribs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.pd-rib { background: var(--red-wash); color: var(--red); font-weight: 700; font-size: 15px; padding: 4px 14px; border-radius: 999px; }
.pd-rib.is-gold { background: #F7EEDB; color: var(--gold); }
.pd-prov { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 17px; color: #6A584E; max-width: 560px; margin: 6px 0 0; line-height: 1.4; }
.pd-lunar { display: grid; grid-template-columns: 170px 1fr 150px; gap: 14px; align-items: stretch; border-top: 1.5px dashed #D9CBBB; border-bottom: 1.5px dashed #D9CBBB; padding: 12px 0; }
.pd-lbox { text-align: center; border-right: 1px solid #EADFD2; padding-right: 10px; }
.pd-lbl { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pd-lday { font-family: var(--font-display); font-weight: 800; font-size: 62px; line-height: 1; color: var(--gold); }
.pd-lmon { font-size: 14px; font-weight: 600; color: #5E4E45; }
.pd-cc { margin: 0; display: grid; grid-template-columns: auto auto; justify-content: space-between; gap: 8px 16px; align-content: center; }
.pd-cc dd { white-space: nowrap; }
.pd-cc dt { min-width: 50px !important; }
.pd-cc div, .pd-facts div { display: flex; gap: 8px; align-items: baseline; }
.pd-cc dt, .pd-facts dt { font-size: 13px; color: #8A786D; min-width: 58px; }
.pd-cc dd, .pd-facts dd { margin: 0; font-size: 15px; font-weight: 700; color: #241712; }
.pd-rate { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #F3EEE6; color: #5E4E45; text-align: center; }
.pd-rate small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.pd-rate b { font-size: 17px; }
.pd-rate.is-good { background: #E4F0EA; color: var(--jade); }
.pd-rate.is-bad { background: #FBE6E2; color: var(--sun); }
.pd-box { border: 1px solid #EADFD2; border-radius: 12px; padding: 10px 14px 12px; }
.pd-h { margin: 0 0 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--red); display: flex; justify-content: space-between; align-items: center; }
.pd-key { font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 600; color: #7E6D63; }
.pd-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #F1ECE5; margin: 0 3px 0 8px; vertical-align: -1px; }
.pd-key i.is-good { background: #DCEBE3; }
.pd-facts { margin: 0; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 6px 16px; }
.pd-facts dt { white-space: nowrap; min-width: 54px !important; }
.pd-facts div:nth-child(even) dt { min-width: 66px !important; }
.pd-facts dd { font-size: 14.5px; }
.pd-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #F1ECE5; color: #6A584E; margin-left: 2px; vertical-align: 1px; }
.pd-tag.is-good { background: #DCEBE3; color: var(--jade); }
.pd-tag.is-bad { background: #FBE1DC; color: var(--sun); }
.pd-hrs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pd-hr { border-radius: 8px; background: #F5F1EB; color: #7E6D63; text-align: center; padding: 5px 2px; line-height: 1.25; }
.pd-hr b { display: block; font-size: 15px; color: #4A3A32; }
.pd-hr span { display: block; font-size: 11.5px; }
.pd-hr small { display: block; font-size: 10.5px; }
.pd-hr.is-good { background: #DCEBE3; color: var(--jade); }
.pd-hr.is-good b { color: var(--jade); }
.pd-todo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pd-list { list-style: none; margin: 0; padding: 0; column-count: 2; column-gap: 12px; }
.pd-list li { font-size: 14px; line-height: 1.6; padding-left: 18px; position: relative; break-inside: avoid; }
.pd-list li::before { position: absolute; left: 0; font-weight: 800; }
.pd-list.is-yes li::before { content: '✓'; color: var(--jade); }
.pd-list.is-no li::before { content: '✕'; color: var(--sun); }
.pd-empty { margin: 0; font-size: 14px; color: #8A786D; }
.pd-ag { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pd-ag li { display: flex; gap: 12px; font-size: 14px; line-height: 1.4; }
.pd-ag small { color: #7E6D63; font-size: 12.5px; }
.pd-ag-t { min-width: 64px; font-weight: 700; color: var(--jade); }
.pd-ag-t.is-note { color: var(--gold); }
.pd-more { color: #7E6D63; padding-left: 76px; }
.pp-day .pp-foot { padding-top: 2px; }
