/* Phân tích SIM (/phan-tich-sim) – nền giấy ngà, xanh ngọc đậm, điểm nhấn vàng đồng. Chỉ nạp trên hai trang của ứng dụng. */
.sim {
    --sim-teal: #0d5b61;
    --sim-teal-deep: #0a3f44;
    --sim-teal-soft: #e3efec;
    --sim-ink: #1d3436;
    --sim-muted: #5a6d6e;
    --sim-paper: #fffdf6;
    --sim-ivory: #f8f2e3;
    --sim-line: #e4d7b8;
    --sim-gold: #b98b2f;
    --sim-gold-soft: #f4e8c8;
    --sim-gold-ink: #6b4f12;
    --sim-radius: 14px;
    --sim-ban: #2f6f8f;
    --sim-loc: #7a5a10;
    --sim-vuong: #1f7a4d;
    --sim-khac-nhap: #a3361f;
    --sim-khac-xuat: #8a4b7a;
    box-sizing: border-box;
    max-width: 1180px;
    margin: 24px auto 56px;
    padding: 24px 16px 8px;
    color: var(--sim-ink);
    font-family: "Nunito Sans", "Roboto", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--sim-ivory);
    /* Hoa văn hào âm/dương rất nhạt */
    background-image:
        repeating-linear-gradient(0deg, transparent 0 22px, rgba(185, 139, 47, .05) 22px 24px),
        radial-gradient(circle at 100% 0, rgba(13, 91, 97, .07), transparent 340px);
    border-radius: var(--sim-radius);
}
/* Ảnh nền riêng của Phân tích SIM: chỉ phủ #web khi nó trực tiếp chứa .sim (file CSS này chỉ nạp trên 2 trang SIM),
   không đụng body, header, footer. Nền nằm trên #web nên không cần 100vw → không tạo thanh cuộn ngang. */
#web.wrap_background:has(> .sim) {
    background-color: #f8f2e3;
    background-image: url("../images/sim-analysis-background.webp");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}
#web.wrap_background:has(> .sim) > .sim { box-shadow: 0 12px 40px rgba(10, 63, 68, .08), 0 0 0 1px rgba(185, 139, 47, .12); }
/* Máy tính bảng: không dùng fixed (iOS phóng to cả khối); ảnh theo bề ngang, mép dưới hòa dần vào màu giấy */
@media (max-width: 1023px) {
    #web.wrap_background:has(> .sim) {
        background-attachment: scroll;
        background-image:
            linear-gradient(to bottom, rgba(248, 242, 227, 0) 55%, #f8f2e3 100%),
            url("../images/sim-analysis-background.webp");
        background-position: center top, center top;
        background-size: 100% 62.5vw, 100% auto;
    }
}
/* Điện thoại: khối .sim tràn ngang nên chỉ giữ màu giấy, không tải ảnh */
@media (max-width: 767px) {
    #web.wrap_background:has(> .sim) { background-image: none; }
    #web.wrap_background:has(> .sim) > .sim { box-shadow: none; }
}
@media (prefers-reduced-data: reduce) {
    #web.wrap_background:has(> .sim) { background-image: none; }
}
.sim *, .sim *::before, .sim *::after { box-sizing: border-box; }
.sim h1, .sim h2, .sim h3, .sim h4 { font-family: "Lexend", "Nunito Sans", sans-serif; color: var(--sim-teal-deep); margin: 0; line-height: 1.3; }
.sim p, .sim dl, .sim dd, .sim ul, .sim ol { margin: 0; padding: 0; }
.sim ul, .sim ol { list-style: none; }
.sim a { color: var(--sim-teal); }
.sim :focus-visible { outline: 3px solid var(--sim-gold); outline-offset: 2px; }
.sim [hidden] { display: none !important; }

.sim-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sim-gold-ink); }
.sim-title { font-size: clamp(28px, 4vw, 40px); margin-top: 4px !important; }
.sim-lead { margin-top: 10px !important; color: var(--sim-muted); max-width: 640px; }
.sim-h2 { font-size: clamp(18px, 2vw, 22px); margin-bottom: 12px !important; }
.sim-h2::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--sim-gold), transparent); }
.sim-h3 { font-size: 15px; margin-bottom: 8px !important; }
.sim-h3 small { font-family: "Nunito Sans", sans-serif; font-weight: 400; color: var(--sim-muted); font-size: 13px; }
.sim-small { font-size: 14px; color: var(--sim-muted); }
.sim-small strong { color: var(--sim-ink); }

.sim-card {
    background: var(--sim-paper);
    border: 1px solid var(--sim-line);
    border-radius: var(--sim-radius);
    padding: 22px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 24px -18px rgba(10, 63, 68, .35);
    min-width: 0;
}

/* ---------- Nút ---------- */
.sim-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
    font-family: "Lexend", sans-serif; font-size: 15px; font-weight: 500; line-height: 1.2;
    text-decoration: none; cursor: pointer; text-align: center;
}
.sim .sim-btn.is-primary { background: var(--sim-teal); color: #fff; border-color: var(--sim-teal); }
.sim .sim-btn.is-primary:hover { background: var(--sim-teal-deep); }
.sim .sim-btn.is-ghost { background: var(--sim-paper); color: var(--sim-teal); border-color: var(--sim-line); }
.sim .sim-btn.is-ghost:hover { border-color: var(--sim-gold); }
.sim-btn[disabled] { opacity: .65; cursor: progress; }

/* ---------- Trang nhập ---------- */
.sim--form { max-width: 620px; }
.sim-intro { margin-bottom: 18px; }
.sim-form { display: grid; gap: 18px; }
.sim-field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.sim-field label, .sim-field legend { font-weight: 700; color: var(--sim-teal-deep); padding: 0; font-size: 15px; }
.sim-field input[type="tel"], .sim-field input[type="text"] {
    width: 100%; min-height: 48px; padding: 10px 14px;
    border: 1.5px solid var(--sim-line); border-radius: 10px; background: #fff;
    font: inherit; font-size: 17px; color: var(--sim-ink); letter-spacing: .02em;
}
.sim-field input:focus { border-color: var(--sim-teal); outline: none; box-shadow: 0 0 0 3px rgba(13, 91, 97, .15); }
.sim-field.is-invalid input[type="tel"], .sim-field.is-invalid input[type="text"] { border-color: var(--sim-khac-nhap); }
.sim-hint { color: var(--sim-muted); font-size: 13px; }
.sim-error { color: var(--sim-khac-nhap); font-size: 14px; font-weight: 600; }
.sim-error:empty { display: none; }
.sim-form__error { padding: 10px 14px; border-radius: 10px; background: #fbeae5; color: var(--sim-khac-nhap); font-weight: 600; }
.sim-gender__options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sim-choice { position: relative; flex: 1 1 120px; margin: 0; cursor: pointer; }
.sim-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sim-choice span {
    display: flex; align-items: center; justify-content: center; min-height: 48px;
    border: 1.5px solid var(--sim-line); border-radius: 10px; background: #fff; font-weight: 600; color: var(--sim-ink);
}
.sim-choice input:checked + span { border-color: var(--sim-teal); background: var(--sim-teal-soft); color: var(--sim-teal-deep); box-shadow: inset 0 0 0 1px var(--sim-teal); }
.sim-choice input:focus-visible + span { outline: 3px solid var(--sim-gold); outline-offset: 2px; }
.sim-gender.is-invalid .sim-choice span { border-color: var(--sim-khac-nhap); }
.sim-form__submit { width: 100%; min-height: 50px; font-size: 16px; }
.sim-note { font-size: 13px; color: var(--sim-muted); text-align: center; }

/* ---------- Báo cáo: một trang liên tục, mỗi dữ liệu một lần ---------- */
.sim--result { display: grid; gap: 28px; }
.sim-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.sim-toolbar--end { justify-content: center; }
.sim-lead-line { margin-bottom: 4px !important; }
.sim-foot { margin-top: 14px !important; }

/* 1. Thông tin SIM và bổn mệnh */
.sim-profile { padding: 0; }
.sim-profile__head {
    position: relative; text-align: center; padding: 26px 22px 22px; color: #fff;
    background: linear-gradient(160deg, var(--sim-teal) 0%, var(--sim-teal-deep) 100%);
    border-radius: calc(var(--sim-radius) - 1px) calc(var(--sim-radius) - 1px) 0 0;
}
.sim-profile__head::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--sim-gold), transparent); }
.sim-profile__head .sim-eyebrow { color: #e9d49b; }
.sim .sim-profile__phone { color: #fff; font-size: clamp(30px, 6vw, 46px); letter-spacing: .06em; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.sim-profile__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0; }
.sim-profile__meta > div { padding: 0 18px; min-width: 0; border-left: 1px solid rgba(233, 212, 155, .4); }
.sim-profile__meta > div:first-child { border-left: 0; }
.sim-profile__meta dt { font-size: 12px; color: #cfe2df; font-weight: 600; }
.sim-profile__meta dd { font-family: "Lexend", sans-serif; font-weight: 500; font-size: 16px; color: #fff; overflow-wrap: break-word; }
.sim-profile__body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 32px; padding: 20px 22px 8px; }
.sim-profile__group { min-width: 0; }
.sim-profile__group + .sim-profile__group { border-left: 1px solid var(--sim-line); padding-left: 32px; }
.sim .sim-profile__note { padding: 6px 22px 20px; }

.sim-dl { display: grid; gap: 0; }
.sim-dl > div { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--sim-line); }
.sim-dl > div:last-child { border-bottom: 0; }
.sim-dl dt { color: var(--sim-muted); font-size: 14px; }
.sim-dl dd { font-weight: 700; overflow-wrap: break-word; }

/* Màu quan hệ */
.rel-ban { --rel: var(--sim-ban); }
.rel-loc { --rel: var(--sim-loc); }
.rel-vuong { --rel: var(--sim-vuong); }
.rel-khac-nhap { --rel: var(--sim-khac-nhap); }
.rel-khac-xuat { --rel: var(--sim-khac-xuat); }
.sim-rel { display: inline-block; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--rel); font-weight: 700; font-size: 12.5px; line-height: 1.25; }

/* 2. Bảng sáu số cuối */
.sim-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; margin: 14px 0 22px; text-align: center; font-size: 14.5px; }
.sim-table th, .sim-table td { padding: 9px 4px; border-bottom: 1px solid var(--sim-line); vertical-align: middle; overflow-wrap: break-word; }
.sim-table__corner { width: 17%; }
.sim-table thead th { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14px; color: var(--sim-teal-deep); background: var(--sim-ivory); border-bottom: 2px solid var(--sim-gold); }
.sim-table thead th:first-child { border-radius: 10px 0 0 0; }
.sim-table thead th:last-child { border-radius: 0 10px 0 0; }
.sim-table .sim-table__corner { color: var(--sim-muted); font-size: 12.5px; text-align: left; padding-left: 10px; }
.sim-table__period { border-left: 1px solid var(--sim-line); }
.sim-table thead .sim-table__period.is-current { background: var(--sim-gold-soft); color: var(--sim-gold-ink); }
.sim-table__now { display: block; width: max-content; margin: 3px auto 0; padding: 0 8px; border-radius: 999px; background: var(--sim-gold); color: #fff; font-family: "Nunito Sans", sans-serif; font-size: 11px; font-weight: 700; line-height: 1.6; }
.sim-table tbody th { text-align: left; padding-left: 10px; color: var(--sim-muted); font-weight: 600; font-size: 13.5px; }
.sim-table td.is-pair-start { border-left: 1px solid var(--sim-line); }
.sim-table td.is-current { background: rgba(244, 232, 200, .5); }
.sim-table tbody tr:last-child th, .sim-table tbody tr:last-child td { border-bottom: 0; }
.sim-table__pos td { color: var(--sim-muted); font-size: 13px; }
.sim-table td.sim-table__digit { font-family: "Lexend", sans-serif; font-size: 28px; font-weight: 600; line-height: 1.1; color: var(--sim-teal-deep); }

.sim-tally__title { margin-bottom: 10px !important; }
.sim-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sim-counts li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; min-width: 0; padding: 10px 12px; background: #fff; border-radius: 10px; box-shadow: inset 0 3px 0 var(--rel); }
.sim-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rel); }
.sim-counts b { color: var(--rel); font-size: 14.5px; }
.sim-counts em { grid-column: 1 / -1; grid-row: 2; font-style: normal; color: var(--sim-muted); font-size: 12.5px; line-height: 1.35; }
.sim-counts strong { grid-column: 3; grid-row: 1; font-family: "Lexend", sans-serif; font-size: 20px; color: var(--sim-teal-deep); }
.sim-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.sim-totals p { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--sim-gold-soft); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--sim-gold-ink); }
.sim-totals small { display: block; font-weight: 400; font-size: 12px; }
.sim-totals strong { font-family: "Lexend", sans-serif; font-size: 20px; color: var(--sim-teal-deep); }

/* 3. Cát–Hung */
.sim-cat { --cat: var(--sim-gold-ink); }
.sim-cat.cat-dai-cat, .sim-cat.cat-cat { --cat: var(--sim-vuong); }
.sim-cat.cat-hung, .sim-cat.cat-dai-hung { --cat: var(--sim-khac-nhap); }
.sim-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sim-stats > div { min-width: 0; padding: 4px 16px 12px; border-left: 1px solid var(--sim-line); }
.sim-stats > div:first-child { border-left: 0; padding-left: 0; }
.sim-stats dt { font-size: 13px; color: var(--sim-muted); }
.sim-stats dd { font-family: "Lexend", sans-serif; font-weight: 500; font-size: 17px; overflow-wrap: break-word; }
.sim-stats > .sim-stats__wide { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--sim-line); padding: 12px 0 0; }
.sim-cat__index { font-size: 26px; line-height: 1.1; color: var(--cat); }
.sim-cat__type { display: inline-block; padding: 1px 12px; border-radius: 999px; background: var(--cat); color: #fff; font-size: 15px; }
.sim-cat__title { font-size: 19px; color: var(--sim-teal-deep); }
.sim .sim-cat__text { margin-top: 14px !important; padding: 14px 16px; background: var(--sim-gold-soft); border-left: 4px solid var(--cat); border-radius: 0 10px 10px 0; font-size: 15.5px; }
.sim .sim-notice { margin-top: 12px !important; padding: 12px 14px; border-left: 4px solid var(--sim-gold); background: #fff8e6; border-radius: 0 10px 10px 0; font-size: 14px; color: var(--sim-gold-ink); }

/* 4 & 5. Ba cột (vận, quẻ): thẻ hàng trên, lời luận hàng dưới cùng cột – liền thành một thẻ */
.sim-section__title { margin-bottom: 6px !important; }
.sim-section__lead { margin-bottom: 14px !important; }
.sim-section__title + .sim-trio { margin-top: 14px; }
.sim-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; row-gap: 0; }
.sim-trio__card { grid-column: var(--col); grid-row: 1; }
.sim-trio__meaning { grid-column: var(--col); grid-row: 2; }

.sim-tile {
    display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0;
    background: var(--sim-paper); border: 1px solid var(--sim-line); border-bottom: 0;
    border-radius: var(--sim-radius) var(--sim-radius) 0 0; padding: 18px 16px 14px; text-align: center;
}
.sim-tile__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; }
.sim-tile__head h3 { font-size: 16px; }
.sim-tile__no { font-size: 12px; color: var(--sim-muted); font-weight: 600; }
.sim-badge { display: inline-block; background: var(--sim-gold); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; line-height: 1.5; }
.sim-tile__pair { font-family: "Lexend", sans-serif; font-size: 30px; font-weight: 600; letter-spacing: .12em; color: var(--sim-gold-ink); line-height: 1; }
.sim-tile__name { font-family: "Lexend", sans-serif; font-weight: 600; color: var(--sim-teal-deep); font-size: 16px; line-height: 1.3; }
.sim-mini { display: grid; gap: 3px; width: 100%; font-size: 13.5px; }
.sim-mini > div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--sim-line); padding: 3px 0; }
.sim-mini dt { color: var(--sim-muted); }
.sim-mini dd { font-weight: 700; text-align: right; overflow-wrap: break-word; min-width: 0; }
.sim-digits2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.sim-digits2 li { background: #fff; border-radius: 8px; padding: 6px 4px; display: grid; gap: 1px; min-width: 0; box-shadow: inset 0 0 0 1px var(--sim-line); }
.sim-digits2 b { font-family: "Lexend", sans-serif; font-size: 20px; line-height: 1.1; }
.sim-digits2 span { font-size: 12.5px; color: var(--sim-muted); }
.sim-digits2 em { font-style: normal; font-weight: 700; font-size: 12.5px; color: var(--rel); }

.sim-meaning {
    background: var(--sim-paper); border: 1px solid var(--sim-line); border-top: 1px dashed var(--sim-line);
    border-radius: 0 0 var(--sim-radius) var(--sim-radius); padding: 14px 16px 18px; min-width: 0;
}
.sim-meaning h4 { font-size: 14px; color: var(--sim-gold-ink); margin-bottom: 6px !important; }
.sim-meaning p { font-size: 15px; }

.sim-trio__card.is-current { background: linear-gradient(180deg, var(--sim-gold-soft), var(--sim-paper) 70%); border-color: var(--sim-gold); box-shadow: inset 0 3px 0 var(--sim-gold); }
.sim-trio__meaning.is-current { border-color: var(--sim-gold); }
/* Màn rộng: lời luận nằm ngay dưới thẻ nên dòng tham chiếu là trùng, ẩn đi; màn hẹp (lời luận tách khỏi thẻ) mới hiện. */
@media (min-width: 768px) { .sim-meaning__ref { display: none; } }

/* Hình quẻ: cột hào co giãn + cột nhãn riêng (không đè lên hào) */
.sim-hex { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: clamp(4px, .7vw, 7px); width: min(100%, 150px); margin: 2px auto; }
.sim-hex__line { display: flex; gap: 18%; aspect-ratio: 11 / 1; min-height: 5px; } /* hào co giãn theo bề rộng, giữ tỷ lệ */
.sim-hex__line i { flex: 1 1 0; background: var(--sim-teal-deep); border-radius: 2px; }
.sim-hex__line.is-yang i + i { display: none; }
.sim-hex__tag { display: none; }
.sim-hex.has-tag { grid-template-columns: minmax(0, 1fr) 2.6em; column-gap: 6px; width: min(100%, 180px); }
.sim-hex.has-tag .sim-hex__tag { display: flex; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--sim-khac-nhap); line-height: 1; }
.sim-hex__line.is-moving i { background: var(--sim-khac-nhap); box-shadow: 0 0 0 2px rgba(163, 54, 31, .18); }

/* 6. Tổng kết và lưu ý */
.sim-summary__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; margin-bottom: 18px !important; }
.sim-summary__list li { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--sim-line); font-size: 14.5px; }
.sim-summary__list span { color: var(--sim-muted); }
.sim-summary__list b { overflow-wrap: break-word; }
.sim-bullets { display: grid; gap: 6px; font-size: 14.5px; }
.sim-bullets li { position: relative; padding-left: 16px; }
.sim-bullets li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--sim-gold); }
/* ---------- Máy tính bảng ---------- */
@media (max-width: 1023px) {
    .sim-profile__body { gap: 0 22px; }
    .sim-profile__group + .sim-profile__group { padding-left: 22px; }
    .sim-summary__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Điện thoại: vẫn giữ 6 số/hàng và 3 thẻ/hàng, lời luận xếp dọc bên dưới ---------- */
@media (max-width: 767px) {
    .sim { margin: 12px auto 32px; padding: 16px 12px 4px; border-radius: 0; font-size: 15px; }
    .sim--result { gap: 20px; }
    .sim-card { padding: 16px 14px; }
    .sim-profile { padding: 0; }
    .sim-profile__head { padding: 20px 14px 18px; }
    .sim-profile__meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .sim-profile__meta > div { border-left: 0; padding: 6px 4px; background: rgba(255, 255, 255, .08); border-radius: 8px; }
    .sim-profile__meta dd { font-size: 15px; }
    .sim-profile__body { grid-template-columns: minmax(0, 1fr); padding: 16px 14px 4px; gap: 14px; }
    .sim-profile__group + .sim-profile__group { border-left: 0; padding-left: 0; border-top: 1px solid var(--sim-line); padding-top: 12px; }
    .sim .sim-profile__note { padding: 6px 14px 16px; }

    .sim-table { font-size: 12.5px; margin-bottom: 18px; }
    .sim-table th, .sim-table td { padding: 7px 1px; }
    .sim-table__corner { width: 62px; }
    .sim-table .sim-table__corner, .sim-table tbody th { padding-left: 4px; font-size: 11.5px; }
    .sim-table thead th { font-size: 11.5px; }
    .sim-table__now { font-size: 9.5px; padding: 0 6px; }
    .sim-table td.sim-table__digit { font-size: 21px; }
    .sim-table__pos td { font-size: 11.5px; }
    .sim-rel { font-size: 10.5px; padding: 1px 4px; }

    .sim-counts { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .sim-counts li { grid-template-columns: 10px minmax(64px, auto) minmax(0, 1fr) auto; gap: 6px; padding: 6px 0; background: none; border-radius: 0; box-shadow: none; border-bottom: 1px dashed var(--sim-line); }
    .sim-counts em { grid-column: auto; grid-row: auto; }
    .sim-counts strong { grid-column: auto; grid-row: auto; font-size: 17px; }
    .sim-totals { grid-template-columns: minmax(0, 1fr); }

    .sim-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sim-stats > div { padding: 8px 6px; }
    .sim-stats > div:first-child { padding-left: 0; }
    .sim-stats dd { font-size: 15.5px; }

    .sim-trio { column-gap: 6px; row-gap: 10px; }
    .sim-trio__meaning { grid-column: 1 / -1; grid-row: var(--row); border-radius: 10px; border-top: 1px solid var(--sim-line); }
    .sim-tile { border-bottom: 1px solid var(--sim-line); border-radius: 10px; padding: 10px 5px; gap: 6px; }
    .sim-trio__card.is-current { border-color: var(--sim-gold); }
    .sim-tile__head h3 { font-size: 13px; }
    .sim-tile__no { font-size: 10.5px; }
    .sim-badge { font-size: 10px; padding: 1px 6px; }
    .sim-tile__pair { font-size: 22px; letter-spacing: .08em; }
    .sim-tile__name { font-size: 12.5px; }
    .sim-mini { font-size: 11px; }
    .sim-mini > div { flex-direction: column; gap: 0; align-items: center; }
    .sim-mini dd { text-align: center; }
    .sim-digits2 { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .sim-digits2 li { padding: 4px 2px; }
    .sim-digits2 b { font-size: 16px; }
    .sim-digits2 span, .sim-digits2 em { font-size: 10.5px; }
    .sim-hex.has-tag { grid-template-columns: minmax(0, 1fr) 2.3em; column-gap: 3px; }
    .sim-hex.has-tag .sim-hex__tag { font-size: 9.5px; }
    .sim-meaning p { font-size: 14.5px; }

    .sim-summary__list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .sim-toolbar .sim-btn { flex: 1 1 140px; }
}

/* ---------- In ---------- */
@media print {
    body > *:not(#web) { display: none !important; }
    #web { padding: 0 !important; margin: 0 !important; background: #fff !important; }
    .sim { max-width: none; margin: 0; padding: 0; background: #fff; font-size: 11.5pt; box-shadow: none !important; }
    #web.wrap_background:has(> .sim) { background: #fff !important; }
    .sim--result { gap: 14px; }
    .sim-toolbar { display: none !important; }
    .sim-card, .sim-tile, .sim-meaning { box-shadow: none; }
    .sim-table, .sim-tile, .sim-meaning, .sim-counts, .sim-stats { break-inside: avoid; }
    .sim-profile__head { background: #fff; color: var(--sim-ink); border-bottom: 2px solid var(--sim-teal); }
    .sim .sim-profile__phone, .sim-profile__meta dd { color: var(--sim-teal-deep); }
    .sim-profile__head .sim-eyebrow, .sim-profile__meta dt { color: var(--sim-gold-ink); }
    .sim-profile__meta > div { background: #fff; border-color: var(--sim-line); }
    .sim-section, .sim-card { break-inside: auto; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
