.weighted-breadcrumb {
    background: #f6fbfb;
    padding: 18px 0;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    direction: ltr;
}

body {
    direction: ltr;
    text-align: left;
}

.weighted-breadcrumb,
.footer {
    direction: rtl;
    text-align: right;
}

.weighted-hero,
.weighted-tool-section,
.weighted-content {
    direction: ltr;
    text-align: left;
}

.weighted-hero-content,
.weighted-tool-card,
.formula-card,
.content-main,
.content-main section,
.related-card {
    direction: rtl;
    text-align: right;
}

.weighted-breadcrumb .breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

.weighted-breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.weighted-hero {
    background: linear-gradient(135deg, rgba(1, 122, 174, 0.12), rgba(78, 205, 196, 0.18));
    padding: 60px 0 34px;
}

.weighted-hero-content {
    max-width: 850px;
}

.tool-kicker {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(1, 122, 174, 0.12);
    color: var(--primary-color);
    font-weight: 700;
}

.weighted-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.35;
    margin-bottom: 14px;
}

.weighted-hero p {
    max-width: 760px;
    font-size: 1.12rem;
    color: #405468;
}

.weighted-tool-section {
    padding: 36px 0 60px;
    background: #ffffff;
}

.weighted-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 24px;
    align-items: start;
    min-width: 0;
}

.weighted-tool-card,
.formula-card,
.related-card {
    background: #ffffff;
    border: 1px solid rgba(1, 122, 174, 0.15);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.weighted-tool-card {
    padding: 24px;
    min-width: 0;
}

.tool-header h2,
.formula-card h2,
.related-card h2,
.content-main h2 {
    font-size: 1.45rem;
}

.tool-header p {
    color: #5e6f7e;
}

.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.preset-btn {
    border: 1px solid rgba(1, 122, 174, 0.25);
    border-radius: 8px;
    background: #f8fbfc;
    color: var(--text-color);
    padding: 10px 14px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover,
.preset-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

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

.field-box {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: #f7fbfb;
    border: 1px solid rgba(78, 108, 160, 0.18);
    border-radius: 8px;
}

.field-box span {
    font-weight: 700;
    font-size: 0.96rem;
}

.field-box input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(44, 62, 80, 0.22);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    text-align: center;
    background: #ffffff;
}

.field-box input:focus {
    outline: 3px solid rgba(78, 205, 196, 0.28);
    border-color: var(--primary-color);
}

.weight-title {
    margin-top: 20px;
    font-size: 1.15rem;
}

.tool-alert {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #8a4b00;
    background: #fff7e6;
    border: 1px solid #ffd48a;
    font-weight: 700;
}

.tool-alert.show {
    display: block;
}

.result-panel {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(1, 122, 174, 0.95), rgba(78, 108, 160, 0.95));
    color: #ffffff;
}

.result-label {
    display: block;
    margin-bottom: 6px;
    opacity: 0.9;
    font-weight: 700;
}

#weightedResult {
    display: block;
    font-size: 2.4rem;
    line-height: 1;
}

#resultAdvice {
    max-width: 420px;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
}

.breakdown-table-wrap,
.example-table-wrap {
    overflow-x: auto;
    margin-top: 20px;
    max-width: 100%;
}

.breakdown-table,
.example-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e6eef2;
}

.breakdown-table th,
.breakdown-table td,
.example-table th,
.example-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e6eef2;
    text-align: center;
}

.breakdown-table th,
.example-table th {
    background: #eef7f8;
    color: #20394f;
    font-weight: 800;
}

.formula-card {
    padding: 22px;
    position: sticky;
    top: 92px;
}

.formula-text {
    padding: 16px;
    border-radius: 8px;
    background: #eef7f8;
    color: #17384f;
    font-weight: 800;
    direction: ltr;
    text-align: center;
}

.checklist {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.checklist p {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
}

.checklist i {
    color: #0b8f73;
    margin-top: 5px;
}

.inline-cta {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    background: var(--gradient-primary);
    font-weight: 800;
}

.weighted-content {
    padding: 56px 0;
    background: #f7fbfb;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    min-width: 0;
}

.content-main {
    display: grid;
    gap: 28px;
    min-width: 0;
}

.content-main section,
.related-card {
    padding: 24px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2edf0;
    max-width: 100%;
    min-width: 0;
}

.content-main p,
.content-main li {
    color: #405468;
}

.numbered-list,
.plain-list {
    padding-right: 22px;
}

.numbered-list li,
.plain-list li {
    margin-bottom: 10px;
}

.sources-box a,
.content-main a {
    color: var(--primary-color);
    font-weight: 700;
}

.faq-section-lite details {
    border: 1px solid #e2edf0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #fbfefe;
}

.faq-section-lite summary {
    cursor: pointer;
    font-weight: 800;
}

.faq-section-lite p {
    margin-top: 12px;
    margin-bottom: 0;
}

.related-card {
    display: grid;
    gap: 10px;
    position: sticky;
    top: 92px;
}

.related-card a {
    padding: 11px 12px;
    border-radius: 8px;
    background: #f2f8f9;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
}

.related-card a:hover {
    background: var(--primary-color);
    color: #ffffff;
}

@media (max-width: 920px) {
    .weighted-layout,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .formula-card,
    .related-card {
        position: static;
    }
}

@media (max-width: 680px) {
    *,
    *::before,
    *::after {
        max-width: 100vw;
    }

    body > header,
    body > main,
    body > footer,
    .container {
        width: 100vw;
        max-width: 100vw;
    }

    .weighted-hero .container,
    .weighted-tool-section .container,
    .weighted-content .container {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        padding-left: 14px;
        padding-right: 14px;
    }

    .weighted-hero {
        padding: 42px 0 26px;
    }

    .weighted-hero-content {
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        margin-left: 14px;
        margin-right: 14px;
        text-align: center;
    }

    .weighted-hero h1,
    .tool-header h2,
    .content-main h2 {
        overflow-wrap: anywhere;
    }

    .weighted-hero h1 {
        font-size: 1.55rem;
        line-height: 1.55;
    }

    .weighted-tool-card,
    .formula-card,
    .content-main section,
    .related-card {
        padding: 18px;
        width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
        margin-left: 14px;
        margin-right: 14px;
    }

    .tool-header h2 {
        font-size: 1.25rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .result-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    #weightedResult {
        font-size: 2.1rem;
    }

    .preset-btn {
        flex: 1 1 100%;
    }

    .example-table {
        min-width: 560px;
    }

    .nav-content,
    .logo {
        min-width: 0;
    }

    .logo-text {
        font-size: 1.05rem;
        white-space: nowrap;
    }

    .logo-img {
        width: 34px;
        height: 34px;
    }
}
