.aqwf-wrap,
.aqwf-wrap * {
    box-sizing: border-box;
}

.aqwf-wrap {
    --aq-bg: #fffaf0;
    --aq-surface: #ffffff;
    --aq-ink: #2b1c09;
    --aq-muted: #6f604c;
    --aq-gold: #b77900;
    --aq-gold-dark: #6f4700;
    --aq-border: #ead8ad;
    --aq-good: #237a3b;
    --aq-mid: #9a6800;
    --aq-watch: #9a4e00;
    --aq-risk: #a62828;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
    color: var(--aq-ink);
    background: var(--aq-bg);
    border: 1px solid var(--aq-border);
    border-radius: 22px;
    font-family: inherit;
    line-height: 1.65;
    overflow: hidden;
}

.aqwf-hero {
    padding: 28px 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3a2508, #8b5b00);
    color: #fff;
    text-align: center;
}

.aqwf-kicker {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffe7a6;
}

.aqwf-hero h1 {
    margin: 8px 0 4px;
    color: #fff;
    font-size: clamp(26px, 5vw, 46px);
    line-height: 1.2;
}

.aqwf-date {
    margin: 0;
    font-weight: 800;
    color: #ffe7a6;
}

.aqwf-intro,
.aqwf-section,
.aqwf-login {
    margin-top: 18px;
    padding: 20px;
    background: var(--aq-surface);
    border: 1px solid var(--aq-border);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(74, 47, 9, .06);
}

.aqwf-wrap h2,
.aqwf-wrap h3,
.aqwf-wrap h4 {
    color: var(--aq-gold-dark);
}

.aqwf-wrap h2 {
    margin-top: 0;
    font-size: clamp(22px, 4vw, 32px);
    line-height: 1.3;
}

.aqwf-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.aqwf-section-head h2 {
    margin: 0;
}

.aqwf-section-head span {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff3ce;
    color: var(--aq-gold-dark);
    font-size: 12px;
    font-weight: 800;
}

.aqwf-sector-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.aqwf-sector-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 17px;
    background: #fffdf7;
    border: 1px solid var(--aq-border);
    border-radius: 15px;
}

.aqwf-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.aqwf-sector-icon {
    font-size: 28px;
}

.aqwf-badge {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid currentColor;
}

.aqwf-badge-good { color: var(--aq-good); background: #eaf7ed; }
.aqwf-badge-mid { color: var(--aq-mid); background: #fff7d9; }
.aqwf-badge-watch { color: var(--aq-watch); background: #fff0df; }
.aqwf-badge-risk { color: var(--aq-risk); background: #ffeded; }

.aqwf-sector-card h3 {
    margin: 12px 0 6px;
    font-size: 20px;
}

.aqwf-sector-card p {
    margin: 0 0 14px;
    color: var(--aq-muted);
}

.aqwf-card-button,
.aqwf-chip,
.aqwf-login-button {
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.aqwf-card-button {
    width: 100%;
    margin-top: auto;
    padding: 11px 13px;
    background: #f1d58d;
    color: #382400;
}

.aqwf-card-button:hover,
.aqwf-card-button:focus,
.aqwf-card-button.is-active {
    background: var(--aq-gold-dark);
    color: #fff;
}

.aqwf-detail {
    scroll-margin-top: 24px;
    padding: 18px;
    border-radius: 14px;
    background: #fffdf7;
    border: 1px solid var(--aq-border);
}

.aqwf-detail[hidden] {
    display: none !important;
}

.aqwf-detail h3 {
    margin-top: 0;
    font-size: 24px;
}

.aqwf-detail table,
.aqwf-final-verdict table {
    width: 100%;
    border-collapse: collapse;
}

.aqwf-detail th,
.aqwf-detail td,
.aqwf-final-verdict th,
.aqwf-final-verdict td {
    padding: 10px;
    border: 1px solid var(--aq-border);
    text-align: left;
    vertical-align: top;
}

.aqwf-chip-wrap {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.aqwf-chip {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: #fff3ce;
    color: var(--aq-gold-dark);
    border: 1px solid var(--aq-border);
}

.aqwf-chip:hover,
.aqwf-chip:focus,
.aqwf-chip.is-active {
    background: var(--aq-gold-dark);
    color: #fff;
}

.aqwf-login {
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #fff8de, #fff);
}

.aqwf-lock {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f2d078;
    font-size: 28px;
}

.aqwf-login h2 {
    margin: 0 0 6px;
}

.aqwf-login-button {
    display: inline-block;
    margin-top: 8px;
    padding: 11px 16px;
    background: var(--aq-gold-dark);
    color: #fff;
}

.aqwf-scroll-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 34%);
    gap: 14px;
    padding-bottom: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
}

.aqwf-panchang-card,
.aqwf-day-card {
    scroll-snap-align: start;
    padding: 17px;
    border: 1px solid var(--aq-border);
    border-radius: 14px;
    background: #fffdf7;
}

.aqwf-panchang-card h3,
.aqwf-day-card h3 {
    margin-top: 0;
}

.aqwf-note {
    margin-top: 0;
    color: var(--aq-muted);
}

.aqwf-table-scroll {
    overflow-x: auto;
}

.aqwf-table {
    min-width: 860px;
    width: 100%;
    border-collapse: collapse;
}

.aqwf-table th,
.aqwf-table td {
    padding: 11px;
    border: 1px solid var(--aq-border);
    text-align: left;
    vertical-align: top;
}

.aqwf-table th {
    background: #fff3ce;
    color: var(--aq-gold-dark);
}

.aqwf-final-verdict .aq-verdict-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.aqwf-final-verdict .aq-verdict-card {
    padding: 15px;
    border: 1px solid var(--aq-border);
    border-radius: 12px;
    background: #fffdf7;
}

.aqwf-disclaimer {
    font-size: 14px;
    color: var(--aq-muted);
}

.aqwf-error {
    padding: 16px;
    border: 1px solid #d63638;
    border-radius: 8px;
    background: #fff0f0;
    color: #7a1315;
}

.aqwf-card-button:focus-visible,
.aqwf-chip:focus-visible,
.aqwf-login-button:focus-visible,
.aqwf-scroll-row:focus-visible,
.aqwf-table-scroll:focus-visible {
    outline: 3px solid #dba32b;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .aqwf-sector-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aqwf-scroll-row {
        grid-auto-columns: minmax(280px, 72%);
    }
}

@media (max-width: 620px) {
    .aqwf-wrap {
        padding: 10px;
        border-radius: 14px;
    }

    .aqwf-hero,
    .aqwf-intro,
    .aqwf-section,
    .aqwf-login {
        padding: 16px;
        border-radius: 13px;
    }

    .aqwf-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .aqwf-sector-grid {
        grid-template-columns: 1fr;
    }

    .aqwf-sector-card {
        min-height: auto;
    }

    .aqwf-scroll-row {
        grid-auto-columns: 88%;
    }

    .aqwf-login {
        align-items: flex-start;
    }

    .aqwf-final-verdict .aq-verdict-grid {
        grid-template-columns: 1fr;
    }
}

/* Fixed AstroQuant links and unobtrusive slide-in app prompt. */
.aqwf-wrap {
    padding-bottom: 92px;
}

.aqwf-fixed-footer {
    position: fixed;
    z-index: 9998;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(760px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid rgba(183, 121, 0, .35);
    border-radius: 16px;
    background: rgba(255, 253, 247, .96);
    box-shadow: 0 10px 34px rgba(43, 28, 9, .22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.aqwf-footer-button {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 11px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: transform .18s ease, filter .18s ease;
}

.aqwf-footer-button:hover,
.aqwf-footer-button:focus {
    color: #fff;
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.aqwf-footer-button:focus-visible,
.aqwf-promo-close:focus-visible,
.aqwf-promo-qr:focus-visible {
    outline: 3px solid #f0bd47;
    outline-offset: 2px;
}

.aqwf-footer-whatsapp {
    background: #157347;
}

.aqwf-footer-app {
    background: linear-gradient(135deg, #6f4700, #b77900);
}

.aqwf-footer-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

.aqwf-slide-promo {
    position: fixed;
    z-index: 9999;
    right: 14px;
    bottom: 86px;
    width: min(360px, calc(100vw - 28px));
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px 36px 13px 13px;
    border: 1px solid var(--aq-border);
    border-radius: 16px;
    background: rgba(255, 253, 247, .98);
    color: var(--aq-ink);
    box-shadow: 0 14px 42px rgba(43, 28, 9, .24);
    transform: translateX(calc(100% + 36px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .48s cubic-bezier(.22, .8, .28, 1), opacity .3s ease, visibility 0s linear .48s;
}

.aqwf-slide-promo.is-visible {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.aqwf-promo-qr {
    display: block;
    width: 84px;
    height: 84px;
    padding: 5px;
    border: 1px solid var(--aq-border);
    border-radius: 11px;
    background: #fff;
}

.aqwf-promo-qr img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.aqwf-promo-copy {
    min-width: 0;
}

.aqwf-promo-copy strong,
.aqwf-promo-copy span {
    display: block;
}

.aqwf-promo-copy strong {
    margin-bottom: 4px;
    color: var(--aq-gold-dark);
    font-size: 15px;
    line-height: 1.3;
}

.aqwf-promo-copy span {
    color: var(--aq-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.aqwf-promo-close {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f4e6bd;
    color: #4d3300;
    font: inherit;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 620px) {
    .aqwf-wrap {
        padding-bottom: 118px;
    }

    .aqwf-fixed-footer {
        width: calc(100vw - 16px);
        gap: 6px;
        padding: 6px;
        border-radius: 13px;
    }

    .aqwf-footer-button {
        min-height: 48px;
        padding: 8px 7px;
        gap: 5px;
        font-size: 11.5px;
    }

    .aqwf-footer-icon {
        font-size: 15px;
    }

    .aqwf-slide-promo {
        right: 8px;
        bottom: 78px;
        width: min(330px, calc(100vw - 16px));
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 32px 10px 10px;
        border-radius: 13px;
    }

    .aqwf-promo-qr {
        width: 70px;
        height: 70px;
    }

    .aqwf-promo-copy strong {
        font-size: 13px;
    }

    .aqwf-promo-copy span {
        font-size: 11px;
        line-height: 1.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aqwf-slide-promo,
    .aqwf-footer-button {
        transition: none;
    }
}

@media print {
    .aqwf-fixed-footer,
    .aqwf-slide-promo {
        display: none !important;
    }

    .aqwf-wrap {
        padding-bottom: 16px;
    }
}
