/* Bộ component dùng chung (P.ui.*). */

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 4px 8px; background: color-mix(in srgb, var(--bg-top) 88%, transparent); backdrop-filter: blur(12px); }
.hdr--clear { background: transparent; backdrop-filter: none; }
.hdr__btn, .hdr__sp { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.hdr__btn:active { background: rgba(0, 0, 0, 0.05); }
.hdr__t { flex: 1; min-width: 0; }
.hdr__t h1 { font-family: var(--f-body); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr__t small { display: block; font-size: 12px; color: var(--ink-2); }
.hdr__r { display: flex; align-items: center; gap: 2px; flex: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 4px 16px; min-height: 52px; }
.wordmark { font-family: var(--f-name); font-weight: 700; font-size: 24px; color: var(--primary); cursor: pointer; letter-spacing: -0.01em; }
.wordmark i { font-style: normal; font-size: 13px; margin-left: 2px; vertical-align: super; }
.topbar__r { display: flex; align-items: center; gap: 2px; }

.ibtn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); flex: none; }
.ibtn:active { background: rgba(0, 0, 0, 0.05); }
.ibtn__badge { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; font-weight: 700; border: 2px solid #fff; }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: var(--r-pill); font-weight: 600; font-size: 15px; transition: transform 0.12s, box-shadow 0.12s, background 0.12s; text-decoration: none; white-space: normal; text-align: center; line-height: 1.2; min-width: 0; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-pink); }
.btn--secondary { background: var(--secondary); color: #fff; box-shadow: var(--shadow-indigo); }
.btn--dark { background: var(--brown); color: #fff; box-shadow: 0 6px 14px rgba(122, 59, 46, 0.3); }
.btn--soft { background: var(--primary-soft); color: var(--primary-600); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--outline { background: #fff; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn--white { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn--lg { min-height: 54px; font-size: 16.5px; }
.btn--block { display: flex; width: 100%; }
.link { color: var(--secondary); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }

/* ---------- Thẻ ---------- */
.card { background: var(--surface); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow); position: relative; }
.card--p0 { padding: 0; overflow: hidden; }
.card--psm { padding: 12px; }
.card--plg { padding: 20px; }
.card--pink { background: linear-gradient(135deg, #ffeef6, #fff7fb); box-shadow: none; }
.card--lavender { background: linear-gradient(135deg, #efebfd, #f8f6ff); box-shadow: none; }
.card--cream { background: linear-gradient(135deg, #fff6e2, #fffbf2); box-shadow: none; }
.card--peach { background: linear-gradient(135deg, #ffece4, #fff7f3); box-shadow: none; }
.card--mint { background: linear-gradient(135deg, #e3f7ee, #f4fcf8); box-shadow: none; }
.card--sky { background: linear-gradient(135deg, #e5f0ff, #f5f9ff); box-shadow: none; }
.card--ghost { background: rgba(255, 255, 255, 0.6); box-shadow: none; border: 1px solid var(--line); }
.card__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.card__h h3 { font-size: 16.5px; font-weight: 700; }
.is-tap { cursor: pointer; transition: transform 0.12s; }
.is-tap:active { transform: scale(0.985); }

.sec { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; gap: 8px; }
.sec h2 { font-size: 18px; font-weight: 700; color: var(--ink); }

/* ---------- Danh sách ---------- */
.list--card { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; position: relative; }
.list--card .li + .li::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; border-top: 1px solid var(--line); }
.li:active.is-tap { background: var(--surface-2); transform: none; }
.li__ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-600); }
.li__emo { font-size: 24px; width: 36px; text-align: center; flex: none; }
.li__b { flex: 1; min-width: 0; }
.li__t { font-weight: 600; font-size: 15px; }
.li__s { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.li__m { font-size: 13px; color: var(--ink-3); flex: none; }
.li__r { flex: none; display: flex; align-items: center; gap: 6px; }
.li__chev { color: var(--ink-3); flex: none; }

/* ---------- Chip / tab / phân đoạn ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gap)); padding: 2px var(--gap); }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; flex: none; }
.chip__e { font-size: 15px; }
.chip b { background: var(--primary-soft); color: var(--primary-600); font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.chip.is-on { background: var(--primary); color: #fff; box-shadow: var(--shadow-pink); }
.chip.is-on b { background: rgba(255, 255, 255, 0.25); color: #fff; }
.chip--soft { background: var(--primary-50); box-shadow: none; }
.chip--lavender.is-on { background: var(--secondary); box-shadow: var(--shadow-indigo); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding: 0 8px; position: sticky; top: 52px; z-index: 4; background: color-mix(in srgb, var(--bg-top) 88%, transparent); backdrop-filter: blur(12px); }
.tabs::-webkit-scrollbar { display: none; }
.tabs__i { padding: 12px 10px 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; position: relative; min-height: 44px; flex: none; }
.tabs__i.is-on { color: var(--primary); font-weight: 600; }
.tabs__i.is-on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--primary); }
.tabs__i b { margin-left: 4px; font-size: 11px; background: var(--primary-soft); color: var(--primary-600); padding: 0 6px; border-radius: 9px; }

.seg { display: flex; background: #f3eef6; border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg__i { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; min-height: 38px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; white-space: nowrap; }
.seg__i.is-on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Form ---------- */
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld__l { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.fld__l i { color: var(--primary); font-style: normal; }
.fld__box { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: var(--r-sm); padding: 0 14px; min-height: 50px; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow 0.15s; color: var(--ink-3); }
.fld__box:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.fld__box input, .fld__box textarea, .fld__box select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); padding: 12px 0; }
.fld__box textarea { resize: vertical; min-height: 96px; }
.fld__box--sel select { appearance: none; padding-right: 4px; }
.fld__sfx { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.fld__hint { font-size: 12.5px; color: var(--ink-3); }
.fld__err { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.fld.has-err .fld__box { box-shadow: inset 0 0 0 2px var(--danger); }
.form { display: flex; flex-direction: column; gap: 14px; }

.choice { display: grid; grid-template-columns: 1fr; gap: 10px; }
.choice--c2 { grid-template-columns: 1fr 1fr; }
.choice--c3 { grid-template-columns: repeat(3, 1fr); }
.choice__i { background: #fff; border-radius: var(--r-md); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; box-shadow: inset 0 0 0 1.5px var(--line-2); min-height: 56px; transition: box-shadow 0.15s, background 0.15s; }
.choice--c2 .choice__i, .choice--c3 .choice__i { align-items: center; text-align: center; }
.choice__i.is-on { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-50); }
.choice__e { font-size: 30px; line-height: 1.1; }
.choice__t { font-weight: 700; }
.choice__s { font-size: 12.5px; color: var(--ink-2); }

.tgl { width: 50px; height: 30px; border-radius: 15px; background: #ddd5e3; position: relative; transition: background 0.2s; flex: none; }
.tgl span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18); transition: transform 0.2s; }
.tgl.is-on { background: var(--primary); }
.tgl.is-on span { transform: translateX(20px); }

.stp { display: inline-flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--r-pill); padding: 4px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.stp__b { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-600); display: grid; place-items: center; }
.stp__v { min-width: 56px; text-align: center; font-family: var(--f-head); font-size: 22px; font-weight: 700; }
.stp__v small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }

/* ---------- Tiến độ ---------- */
.prog__bar { position: relative; height: 10px; border-radius: 6px; background: #f3e7ef; }
.prog__bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.prog--secondary .prog__bar i { background: var(--secondary); }
.prog--mint .prog__bar i { background: var(--success); }
.prog__bar b { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); transform: translate(-50%, -50%); box-shadow: var(--shadow-sm); }
.prog__marks { position: relative; height: 18px; margin-top: 4px; }
.prog__marks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring__c { position: relative; font-weight: 700; font-size: 14px; text-align: center; line-height: 1.1; }

/* ---------- Avatar / minh hoạ ---------- */
.ava { width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; background: var(--ab, linear-gradient(135deg, #ffd3e6, #e3ddfb)); color: var(--secondary); font-weight: 700; font-size: calc(var(--s) * 0.42); flex: none; position: relative; }
.ava span { font-size: calc(var(--s) * 0.55); }
.ava--ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary); }
.ava__on { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; border-radius: 50%; background: var(--success); border: 2px solid #fff; }
.illus { width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: radial-gradient(circle at 30% 28%, #fff 0, var(--ia) 45%, var(--ib) 120%); box-shadow: inset -4px -6px 12px rgba(0, 0, 0, 0.08), 0 6px 14px rgba(90, 84, 170, 0.15); }
.illus span { font-size: calc(var(--s) * 0.52); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.15)); }
.photo { position: relative; border-radius: 28px; background: radial-gradient(circle at 35% 30%, #fff 0, var(--pa) 50%, var(--pb) 140%); display: grid; place-items: center; overflow: hidden; aspect-ratio: 1; }
.photo span { font-size: 96px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.15)); }

/* bong bóng thao tác nhanh */
.bub { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 78px; position: relative; }
.bub__c { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #8b84d6 0, var(--secondary) 60%, #3f3990 100%); color: #fff; box-shadow: var(--shadow-indigo), inset 0 0 0 3px rgba(255, 255, 255, 0.35); transition: transform 0.15s; }
.bub:active .bub__c { transform: scale(0.94); }
.bub__e { font-size: 32px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25)); }
.bub__l { font-size: 13px; font-weight: 600; color: var(--secondary); }
.bub--pink .bub__c { background: radial-gradient(circle at 35% 30%, #ff9cc8 0, var(--primary) 60%, #c42d74 100%); box-shadow: var(--shadow-pink), inset 0 0 0 3px rgba(255, 255, 255, 0.35); }
.bub--pink .bub__l { color: var(--primary-600); }
.bub--light .bub__c { background: #fff; color: var(--secondary); box-shadow: var(--shadow); }
.bub__b { position: absolute; top: -2px; right: 2px; background: var(--accent); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; }

/* bong bóng thoại mây */
.cloud { position: relative; background: #fff; border-radius: 26px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.4; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 34px; height: 34px; top: -12px; left: 22%; }
.cloud::after { width: 26px; height: 26px; top: -8px; left: 48%; }
.cloud--left > :first-child::before { content: ''; position: absolute; left: -10px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.cloud > * { position: relative; z-index: 1; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge--primary { background: var(--primary); color: #fff; }
.badge--soft { background: var(--primary-soft); color: var(--primary-600); }
.badge--secondary { background: var(--secondary-soft); color: var(--secondary); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warn { background: var(--warning-soft); color: #b46d00; }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--gray { background: #f1edf3; color: var(--ink-2); }
.badge--accent { background: var(--accent); color: #fff; }

/* ---------- Số liệu / lưới ---------- */
.grid { display: grid; gap: 10px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.hs { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gap)); padding: 4px var(--gap) 10px; scroll-snap-type: x mandatory; }
.hs::-webkit-scrollbar { display: none; }
.hs > * { flex: none; scroll-snap-align: start; }
.stat { background: #fff; border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat__ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-600); margin-bottom: 4px; }
.stat__e { font-size: 24px; }
.stat__l { font-size: 12.5px; color: var(--ink-2); }
.stat__v { font-family: var(--f-head); font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.stat__v small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 3px; font-family: var(--f-body); }
.stat__s { font-size: 12px; color: var(--ink-3); }
.stat--pink { background: var(--primary-50); box-shadow: none; }
.stat--lavender { background: var(--secondary-soft); box-shadow: none; }
.stat--mint { background: var(--success-soft); box-shadow: none; }
.stat--danger { background: var(--danger-soft); box-shadow: none; }
.stat--cream { background: #fff6e2; box-shadow: none; }

/* ---------- Rỗng / băng / ghi chú ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--ink-2); font-size: 14px; max-width: 280px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; background: #f3eff6; color: var(--ink-2); }
.banner > svg { flex: none; margin-top: 1px; }
.banner > div { flex: 1; }
.banner--info { background: #f1eef6; }
.banner--warn { background: var(--warning-soft); color: #8a5300; }
.banner--danger { background: var(--danger-soft); color: #a3262a; }
.banner--success { background: var(--success-soft); color: #1d7a54; }
.banner--tip { background: var(--secondary-soft); color: var(--secondary-600); }
.banner__x { color: inherit; opacity: 0.7; }
.sample { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin: 10px 0; }
.disc { font-size: 12px; color: var(--ink-3); font-style: italic; margin-top: 8px; }

/* ---------- Dòng thời gian ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl__i { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl__i::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; border-left: 2px dashed var(--line-2); }
.tl__i:last-child::before { display: none; }
.tl__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-600); font-size: 15px; box-shadow: 0 0 0 4px #fff; }
.tl__i.is-done .tl__dot { background: var(--primary); color: #fff; }
.tl__b { flex: 1; min-width: 0; padding-top: 4px; }
.tl__time { font-size: 12px; color: var(--ink-3); }
.tl__t { font-weight: 600; }
.tl__s { font-size: 13px; color: var(--ink-2); }
.tl__r { flex: none; padding-top: 4px; }

/* ---------- Thẻ gợi ý ---------- */
.promo { display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: var(--r-md); background: linear-gradient(120deg, #ffeef6 0%, #fff8fb 100%); overflow: hidden; position: relative; }
.promo--lavender { background: linear-gradient(120deg, #ece7fd, #f8f6ff); }
.promo--cream { background: linear-gradient(120deg, #fff1d6, #fffaf0); }
.promo--peach { background: linear-gradient(120deg, #ffe6dc, #fff6f2); }
.promo--mint { background: linear-gradient(120deg, #dff6ec, #f5fcf8); }
.promo__b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.promo__b h3 { font-size: 16px; color: var(--primary-600); font-weight: 700; }
.promo--lavender .promo__b h3 { color: var(--secondary); }
.promo__b p { font-size: 13px; color: var(--ink-2); font-style: italic; }
.promo__art { flex: none; }

/* ---------- Lịch ---------- */
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wk__d { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; font-size: 12px; color: var(--ink-2); position: relative; min-height: 56px; }
.wk__d b { font-size: 16px; color: var(--ink); font-family: var(--f-head); }
.wk__d.is-today b { color: var(--primary); }
.wk__d.is-on { background: var(--primary); color: #fff; box-shadow: var(--shadow-pink); }
.wk__d.is-on b { color: #fff; }
.wk__d i { width: 6px; height: 6px; border-radius: 50%; }
.mo__h, .mo__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mo__h span { font-size: 12px; color: var(--ink-3); padding: 4px 0; }
.mo__d { aspect-ratio: 1; border-radius: 50%; font-size: 14px; font-weight: 500; display: grid; place-items: center; min-height: 36px; position: relative; }
.mo__d.is-today { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-weight: 700; }
.mo__d.is-on { background: var(--primary); color: #fff; }
.mo__d.mk-pink { background: var(--primary-soft); color: var(--primary-700); }
.mo__d.mk-period { background: #ffd0d8; color: #b02443; }
.mo__d.mk-fertile { background: #fff0c9; color: #a46300; }
.mo__d.mk-ovulation { background: var(--accent); color: #fff; }
.mo__d.mk-lavender { background: var(--secondary-soft); color: var(--secondary); }
.mo__d.mk-mint { background: var(--success-soft); color: var(--success); }
.mo__d.mk-dot::after { content: ''; position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* ---------- FAB / chân form ---------- */
.fab { position: absolute; right: 18px; bottom: calc(var(--tabbar-h) + 18px); z-index: 6; min-width: 56px; height: 56px; padding: 0 16px; border-radius: 28px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; box-shadow: var(--shadow-pink); }
#app:not(.has-tabbar) .fab { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.foot { position: sticky; bottom: 0; z-index: 4; margin-top: 20px; padding: 12px var(--gap) calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--bg-bot) 30%); display: flex; gap: 10px; }
.foot > * { flex: 1; }

.stars { display: inline-flex; gap: 2px; color: #e8dfe9; font-size: 16px; }
.stars .on { color: var(--accent); }
.stars [data-action] { font-size: 34px; cursor: pointer; padding: 0 2px; }

/* ---------- Biểu đồ ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: #f0eaf3; stroke-width: 1; }
.ch-yl { font-size: 10px; fill: var(--ink-3); text-anchor: end; }
.ch-xl { font-size: 10px; fill: var(--ink-3); text-anchor: middle; }
.ch-v { font-size: 10px; fill: var(--ink-2); text-anchor: middle; font-weight: 600; }
.ch-leg { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.ch-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ch-leg i.band { background: var(--primary-soft); }
.gauge { position: relative; margin: 0 auto; }
.gauge svg { position: absolute; inset: 0; }
.gauge__c { position: absolute; inset: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* ---------- Lớp phủ ---------- */
.ov { position: absolute; inset: 0; }
.ov__bg { position: absolute; inset: 0; background: rgba(31, 22, 48, 0.42); opacity: 0; transition: opacity 0.25s; }
.ov.is-open .ov__bg { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; display: flex; flex-direction: column; background: #fff; border-radius: 28px 28px 0 0; transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ov--full .sheet { height: 92%; max-height: 92%; }
.ov.is-open .sheet { transform: none; }
.sheet__grip { width: 40px; height: 5px; border-radius: 3px; background: #e2dbe7; margin: 8px auto 2px; flex: none; }
.sheet__h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 4px 20px; flex: none; }
.sheet__h h3 { font-size: 18px; }
.sheet__b { overflow-y: auto; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.ov--dlg { display: grid; place-items: center; padding: 24px; }
.dlg { position: relative; width: 100%; max-width: 340px; background: #fff; border-radius: 28px; padding: 22px 20px 16px; text-align: center; transform: scale(0.92); opacity: 0; transition: transform 0.22s, opacity 0.22s; }
.ov.is-open .dlg { transform: none; opacity: 1; }
.dlg__art { display: grid; place-items: center; margin-bottom: 10px; }
.dlg h3 { font-size: 19px; margin-bottom: 6px; }
.dlg__b { color: var(--ink-2); font-size: 14.5px; }
.dlg__f { display: flex; gap: 10px; margin-top: 18px; }
.dlg__f .btn { flex: 1; padding: 0 12px; }
.toast { position: absolute; left: 50%; top: calc(var(--status-h) + 10px); transform: translate(-50%, -140%); z-index: 40; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--r-pill); background: #2b2340; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2); transition: transform 0.25s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); }
.toast--success svg { color: #7ee2b5; }
.toast--warn svg { color: #ffc65c; }
.share__i { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; padding: 10px 0; color: var(--ink-2); }
.share__i svg { color: var(--secondary); }
.dp__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tp__c { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 0 18px; }
.tp__c b { font-size: 24px; }
.st { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.st a { color: var(--primary); font-weight: 600; cursor: pointer; }

/* ---------- Bài viết ---------- */
.prose { font-size: 15.5px; line-height: 1.65; color: #3b3350; }
.prose h2 { font-size: 19px; margin: 18px 0 8px; color: var(--ink); }
.prose h3 { font-size: 16.5px; margin: 14px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose blockquote { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--primary); background: var(--primary-50); border-radius: 0 12px 12px 0; }
.thumb { border-radius: var(--r-sm); background: linear-gradient(135deg, var(--ta, #ffd3e6), var(--tb, #e3ddfb)); display: grid; place-items: center; font-size: 34px; flex: none; overflow: hidden; }

/* ---------- Màn rất hẹp (≤ 340px) ---------- */
@container (max-width: 340px) {
  .seg__i { padding: 0 6px; font-size: 12.5px; gap: 4px; }
  .stp { gap: 4px; }
  .stp__b { width: 36px; height: 36px; }
  .stp__v { min-width: 40px; font-size: 19px; }
  .btn { padding: 0 16px; }
  .chip { padding: 0 11px; }
}
/* ---------- Minh hoạ Fluent 3D (thay emoji, js/core/emoji.js) ---------- */
img.fe { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.25em; margin: 0 0.04em; pointer-events: none; user-select: none; }
.illus span img.fe, .bub__e img.fe, .photo span img.fe { width: 1.3em; height: 1.3em; vertical-align: middle; margin: 0; }
.illus span, .bub__e, .photo span { line-height: 1; display: inline-grid; place-items: center; }