:root {
    --tp-ink: #17213a;
    --tp-muted: #5d697d;
    --tp-border: #dce3ed;
    --tp-surface: #ffffff;
    --tp-page: #f3f6fa;
    --tp-soft: #f7f9fc;
    --tp-accent: #3558df;
    --tp-accent-hover: #2948c2;
    --tp-accent-soft: #edf1ff;
    --tp-dark: #263d8d;
    --tp-right: #cbd6f7;
    --tp-warning-soft: #fff4cc;
    --tp-radius: 18px;
    --tp-shadow: 0 12px 32px rgba(24, 41, 82, 0.09);
    --tp-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Force override host site & framework root settings */
html {
    font-size: 18px !important;
}

body {
    margin: 0;
    background: var(--tp-page);
    font-size: 18px !important;
}

body .tp-shell,
body .tp-shell * {
    box-sizing: border-box;
}

body .tp-shell {
    width: min(1160px, calc(100% - 40px));
    margin: 30px auto 72px;
    color: var(--tp-ink);
    font-family: var(--tp-font);
    font-size: 18px !important;
    font-weight: 400;
    line-height: 1.55;
    text-align: left;
}

body .tp-shell--narrow {
    width: min(760px, calc(100% - 40px));
}

body .tp-shell h1,
body .tp-shell h2,
body .tp-shell h3,
body .tp-shell p,
body .tp-shell label,
body .tp-shell span,
body .tp-shell strong,
body .tp-shell small,
body .tp-shell button,
body .tp-shell input {
    font-family: var(--tp-font);
}

body .tp-shell h1,
body .tp-shell h2,
body .tp-shell h3,
body .tp-shell p {
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
}

body .tp-shell h1 {
    margin: 0;
    color: var(--tp-ink);
    font-size: clamp(2.4rem, 4.8vw, 3.8rem) !important;
    font-weight: 760;
    line-height: 1.12;
}

body .tp-shell h2 {
    margin: 0;
    color: var(--tp-ink);
    font-size: clamp(1.6rem, 2.8vw, 2.3rem) !important;
    font-weight: 750;
    line-height: 1.25;
}

body .tp-shell h3 {
    color: var(--tp-ink);
    font-size: 1.35rem !important;
    font-weight: 700;
    line-height: 1.45;
}

body .tp-shell p {
    margin: 0;
    color: var(--tp-muted);
    font-size: 1.15rem !important;
    line-height: 1.6;
}

.tp-hero,
.tp-result-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 5vw, 60px);
    border: 1px solid rgba(220, 227, 237, 0.85);
    border-radius: 28px;
    background:
        radial-gradient(circle at 94% 7%, rgba(102, 205, 215, 0.32), transparent 35%),
        linear-gradient(135deg, #ffffff 0%, #f3f6ff 72%, #edf6f8 100%);
    box-shadow: var(--tp-shadow);
    margin-bottom: 24px;
}

body .tp-hero p,
body .tp-result-hero p,
body .tp-assessment-header p,
body .tp-dashboard-header p {
    max-width: 780px;
    margin-top: 14px;
    font-size: 1.2rem !important;
}

body .tp-shell .tp-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--tp-dark);
    font-size: 15px !important;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.tp-card,
.tp-question-card,
.tp-score-card,
.tp-profile-card,
.tp-reflection-card,
.tp-kpi,
.tp-progress-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
}

.tp-card {
    padding: clamp(22px, 4vw, 32px);
    margin-bottom: 24px;
}

/* Join form */
.tp-form .input {
    margin-bottom: 20px;
}

body .tp-shell .tp-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--tp-ink);
    font-size: 1.15rem !important;
    font-weight: 720;
    line-height: 1.4;
}

body .tp-shell .tp-form input[type="text"] {
    display: block;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid #c6d0de;
    border-radius: 12px;
    background: #fff;
    color: var(--tp-ink);
    font-size: 1.15rem !important;
    line-height: 1.4;
    box-shadow: none;
}

body .tp-shell .tp-form input[type="text"]:focus {
    border-color: var(--tp-accent);
    outline: 3px solid rgba(53, 88, 223, 0.15);
}

body .tp-shell .tp-button {
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 14px 24px;
    border: 1px solid var(--tp-accent);
    border-radius: 12px;
    background: #fff;
    color: var(--tp-accent);
    font-size: 1.15rem !important;
    font-weight: 760;
    line-height: 1.2;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    box-shadow: none;
}

body .tp-shell .tp-button:hover,
body .tp-shell .tp-button:focus {
    border-color: var(--tp-accent-hover);
    color: var(--tp-accent-hover);
}

body .tp-shell .tp-button--primary {
    background: var(--tp-accent);
    border-color: var(--tp-accent);
    color: #fff;
}

body .tp-shell .tp-button--primary:hover,
body .tp-shell .tp-button--primary:focus {
    background: var(--tp-accent-hover);
    border-color: var(--tp-accent-hover);
    color: #fff;
}

body .tp-shell .tp-button--primary:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

body .tp-shell .tp-note {
    max-width: 800px;
    margin: 22px auto;
    color: var(--tp-muted);
    font-size: 1.05rem !important;
    line-height: 1.55;
    text-align: center;
}

/* Question page */
.tp-assessment-header,
.tp-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 28px;
}

.tp-assessment-header > div:first-child,
.tp-dashboard-header > div:first-child {
    min-width: 0;
}

.tp-progress-card {
    flex: 0 0 220px;
    padding: 19px 20px;
}

body .tp-shell .tp-progress-card strong {
    display: block;
    color: var(--tp-dark);
    font-size: 2rem !important;
    font-weight: 800;
    line-height: 1.2;
}

body .tp-shell .tp-progress-card > span {
    display: block;
    margin-top: 4px;
    color: var(--tp-muted);
    font-size: 1.1rem !important;
}

.tp-progress-track {
    height: 9px;
    margin-top: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7ebf2;
}

.tp-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--tp-accent);
    transition: width 180ms ease;
}

.tp-dimension-section {
    margin-bottom: 40px;
}

.tp-section-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 0 0 17px;
}

body .tp-shell .tp-section-heading > span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--tp-accent-soft);
    color: var(--tp-dark);
    font-size: 1.05rem !important;
    font-weight: 820;
    line-height: 1.25;
    white-space: nowrap;
}

body .tp-shell .tp-section-heading h2 {
    min-width: 0;
    flex: 1 1 280px;
    font-size: 1.65rem !important;
    line-height: 1.28;
}

.tp-section-heading--result {
    margin-top: 40px;
    margin-bottom: 18px;
}

.tp-question-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 17px;
    padding: 22px;
    margin-bottom: 14px;
}

.tp-question-number {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    background: var(--tp-soft);
    color: var(--tp-dark);
    font-size: 1.2rem !important;
    font-weight: 850;
}

body .tp-shell .tp-question-content h3 {
    margin: 2px 0 16px;
    font-size: 1.35rem !important;
}

.tp-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body .tp-shell .tp-option {
    display: grid;
    grid-template-columns: 20px 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 72px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: #fff;
    color: var(--tp-ink);
    font-size: 1.15rem !important;
    font-weight: 450;
    line-height: 1.42;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

body .tp-shell .tp-option:hover {
    border-color: #a9b7db;
    background: #fafbff;
    transform: translateY(-1px);
}

body .tp-shell .tp-option:has(input:checked) {
    border-color: var(--tp-accent);
    background: var(--tp-accent-soft);
}

body .tp-shell .tp-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--tp-accent);
}

.tp-option-letter {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    background: #fff;
    color: var(--tp-dark);
    font-size: 1.1rem !important;
    font-weight: 850;
    line-height: 1;
}

.tp-submit-panel {
    position: sticky;
    z-index: 10;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 15px 18px;
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 38px rgba(20, 35, 70, 0.17);
    backdrop-filter: blur(10px);
}

body .tp-shell .tp-submit-panel p {
    font-size: 1.12rem !important;
}

/* Result page */
.tp-result-hero {
    text-align: center;
}

.tp-result-hero .tp-eyebrow {
    margin-bottom: 14px;
    text-align: center;
}

.tp-type-badge {
    display: flex;
    width: max-content;
    min-width: 174px;
    min-height: 86px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    padding: 13px 25px;
    border-radius: 20px;
    background: var(--tp-dark);
    color: #fff;
    font-size: clamp(2.6rem, 6.2vw, 4.4rem) !important;
    font-weight: 880;
    letter-spacing: 0.12em;
    line-height: 1;
    text-indent: 0.12em;
    box-shadow: 0 10px 24px rgba(38, 61, 141, 0.18);
}

body .tp-shell .tp-result-hero h1 {
    max-width: 900px;
    margin: 0 auto;
    font-size: clamp(2.3rem, 4.2vw, 3.5rem) !important;
}

body .tp-result-hero p {
    margin: 14px auto 0;
}

.tp-score-grid,
.tp-profile-grid,
.tp-kpi-grid {
    display: grid;
    gap: 16px;
}

.tp-score-grid,
.tp-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tp-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.tp-score-card,
.tp-profile-card,
.tp-kpi {
    min-width: 0;
    padding: 22px;
}

.tp-score-labels,
.tp-score-values {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.tp-score-labels > div,
.tp-score-values > span {
    min-width: 0;
}

.tp-score-labels > div:last-child,
.tp-score-values > span:last-child {
    text-align: right;
}

body .tp-shell .tp-score-labels strong {
    display: block;
    color: var(--tp-dark);
    font-size: 1.45rem !important;
    font-weight: 850;
    line-height: 1.2;
}

body .tp-shell .tp-score-labels span {
    display: block;
    margin-top: 4px;
    color: var(--tp-muted);
    font-size: 1.15rem !important;
    line-height: 1.35;
}

.tp-dual-bar {
    height: 16px;
    margin: 17px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--tp-right);
}

.tp-dual-bar__left {
    height: 100%;
    border-radius: inherit;
    background: var(--tp-accent);
}

body .tp-shell .tp-score-values {
    color: var(--tp-muted);
    font-size: 1.1rem !important;
    line-height: 1.4;
}

body .tp-shell .tp-selected {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--tp-border);
    color: var(--tp-muted);
    font-size: 1.15rem !important;
    line-height: 1.45;
}

body .tp-shell .tp-selected strong {
    color: var(--tp-dark);
}

body .tp-shell .tp-selected p {
    margin: 7px 0 0;
    font-size: 1.1rem !important;
}

.tp-balanced {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--tp-warning-soft);
    color: #6d5500;
    font-size: 1rem !important;
    font-weight: 800;
    line-height: 1.2;
}

.tp-profile-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
}

.tp-profile-letter {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 14px;
    background: var(--tp-accent-soft);
    color: var(--tp-dark);
    font-size: 1.7rem !important;
    font-weight: 880;
    line-height: 1;
}

body .tp-shell .tp-profile-card h3 {
    margin: 1px 0 11px;
    font-size: 1.4rem !important;
}

body .tp-shell .tp-profile-card p {
    margin: 8px 0;
    font-size: 1.12rem !important;
    line-height: 1.55;
}

body .tp-shell .tp-profile-card p strong {
    color: var(--tp-ink);
}

.tp-reflection-card {
    padding: clamp(22px, 4vw, 30px);
    margin-top: 24px;
    background:
        radial-gradient(circle at 96% 5%, rgba(255, 211, 113, 0.32), transparent 38%),
        #fff;
}

body .tp-shell .tp-reflection-card h2 {
    margin-bottom: 10px;
    font-size: 1.65rem !important;
}

/* Dashboard */
body .tp-shell .tp-kpi span {
    display: block;
    color: var(--tp-muted);
    font-size: 1.1rem !important;
    font-weight: 700;
}

body .tp-shell .tp-kpi strong {
    display: block;
    margin-top: 7px;
    color: var(--tp-dark);
    font-size: 2.4rem !important;
    font-weight: 820;
    line-height: 1.15;
}

.tp-dashboard-dimension {
    padding: 19px 0;
    border-bottom: 1px solid var(--tp-border);
}

.tp-dashboard-dimension:last-child {
    border-bottom: 0;
}

body .tp-shell .tp-dashboard-dimension small {
    display: block;
    margin-top: 8px;
    color: var(--tp-muted);
    font-size: 1.05rem !important;
    line-height: 1.4;
}

.tp-type-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(76px, 1fr));
    gap: 10px;
}

.tp-type-count {
    padding: 14px;
    border-radius: 12px;
    background: var(--tp-soft);
    text-align: center;
}

body .tp-shell .tp-type-count strong {
    display: block;
    color: var(--tp-dark);
    font-size: 1.35rem !important;
    font-weight: 830;
}

body .tp-shell .tp-type-count span {
    display: block;
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 1.15rem !important;
}

@media (max-width: 900px) {
    body .tp-shell,
    body .tp-shell--narrow {
        width: min(100% - 28px, 1160px);
        margin-top: 20px;
    }

    .tp-assessment-header,
    .tp-dashboard-header {
        display: block;
    }

    .tp-progress-card {
        width: 100%;
        margin-top: 18px;
    }

    .tp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tp-type-grid {
        grid-template-columns: repeat(4, minmax(70px, 1fr));
    }
}

@media (max-width: 720px) {
    .tp-options,
    .tp-score-grid,
    .tp-profile-grid {
        grid-template-columns: 1fr;
    }

    .tp-question-card {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 18px;
    }

    .tp-question-number {
        width: 40px;
        height: 40px;
    }

    .tp-submit-panel {
        align-items: stretch;
        flex-direction: column;
    }

    body .tp-shell .tp-submit-panel .tp-button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    body .tp-shell,
    body .tp-shell--narrow {
        width: min(100% - 18px, 1160px);
        margin-top: 10px;
        margin-bottom: 48px;
    }

    .tp-hero,
    .tp-result-hero,
    .tp-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    body .tp-shell h1 {
        font-size: 2.2rem !important;
    }

    body .tp-result-hero h1 {
        font-size: 2rem !important;
    }

    .tp-type-badge {
        min-width: 148px;
        min-height: 74px;
        font-size: 2.6rem !important;
        border-radius: 17px;
    }

    .tp-question-card {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .tp-question-number {
        width: 38px;
        height: 38px;
    }

    body .tp-shell .tp-option {
        grid-template-columns: 19px 30px minmax(0, 1fr);
        min-height: 66px;
        padding: 12px;
        font-size: 1.1rem !important;
    }

    .tp-score-card,
    .tp-profile-card,
    .tp-kpi {
        padding: 18px;
    }

    .tp-profile-card {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
    }

    .tp-profile-letter {
        width: 44px;
        height: 44px;
        font-size: 1.45rem !important;
    }

    .tp-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .tp-type-grid {
        grid-template-columns: repeat(2, minmax(70px, 1fr));
    }

    body .tp-shell .tp-section-heading h2 {
        flex-basis: 100%;
        font-size: 1.45rem !important;
    }
}

/* ================================================================
   V3: Five-point preference scale (High-Specificity Styles)
   ================================================================ */
.tp-likert-endpoints {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin: 1rem 0 1.15rem;
}

.tp-endpoint {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    min-height: 78px;
    padding: .9rem 1rem;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    background: #f8faff;
    font-size: 1.15rem !important;
    line-height: 1.48;
}

.tp-endpoint strong {
    display: inline-grid;
    place-items: center;
    flex: 0 0 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #e7edff;
    color: #233b91;
    font-size: 1.1rem !important;
}

.tp-endpoint--b strong {
    background: #e8f7f7;
    color: #17666c;
}

.tp-likert {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    padding: 0;
    margin: 0;
    border: 0;
}

body .tp-shell .tp-likert-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .48rem;
    min-width: 0;
    min-height: 100px;
    padding: .8rem .35rem .6rem;
    border: 1px solid #d9e1ef;
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

body .tp-shell .tp-likert-choice:hover {
    border-color: #7892e7;
    transform: translateY(-1px);
}

body .tp-shell .tp-likert-choice:has(input:checked) {
    border-color: #3558dc;
    background: #eef2ff;
    box-shadow: 0 0 0 2px rgba(53, 88, 220, .11);
}

body .tp-shell .tp-likert-choice input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tp-likert-dot {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid #aebbd4;
    border-radius: 50%;
    background: #fff;
    color: #41506d;
    font-size: 1.1rem !important;
    font-weight: 800;
}

body .tp-shell .tp-likert-choice:has(input:checked) .tp-likert-dot {
    border-color: #3558dc;
    background: #3558dc;
    color: #fff;
}

.tp-likert-label {
    font-size: 0.98rem !important;
    line-height: 1.25;
    color: #526078;
    overflow-wrap: anywhere;
}

.tp-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 720px) {
    .tp-likert-endpoints {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .tp-likert {
        gap: .3rem;
    }

    body .tp-shell .tp-likert-choice {
        min-height: 90px;
        padding: .6rem .15rem .5rem;
        border-radius: 10px;
    }

    .tp-likert-dot {
        width: 2.1rem;
        height: 2.1rem;
        font-size: 1rem !important;
    }

    .tp-likert-label {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 430px) {
    .tp-likert-label {
        font-size: 0.8rem !important;
        letter-spacing: -.01em;
    }
}