.khpf-section {
    --khpf-green: #087b3e;
    --khpf-green-dark: #056832;
    --khpf-green-soft: #e9f5ed;
    --khpf-blue: #0b4278;
    --khpf-blue-dark: #082f5a;
    --khpf-blue-deep: #062847;
    --khpf-heading: #102942;
    --khpf-body: #536578;
    --khpf-muted: #71808f;
    --khpf-border: #dce5e9;
    --khpf-soft: #f5f8fa;
    --khpf-container: min(1240px, calc(100% - 48px));
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin: 0 0 0 calc(50% - 50vw) !important;
    padding: clamp(70px, 7vw, 100px) 0 !important;
    color: var(--khpf-heading);
    background: #fff;
    font-family: inherit;
    line-height: 1.6;
    overflow: hidden;
}
.khpf-section,
.khpf-section *,
.khpf-section *::before,
.khpf-section *::after { box-sizing: border-box; }
.khpf-section a { text-decoration: none; }
.khpf-section button,
.khpf-section input,
.khpf-section select { font: inherit; }
.khpf-section button { cursor: pointer; }
.khpf-section :focus-visible { outline: 3px solid #efbd28; outline-offset: 3px; }
.khpf-container { width: var(--khpf-container); margin: 0 auto; }

/* Heading */
.khpf-header {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(330px, .7fr);
    align-items: end;
    gap: clamp(50px, 7vw, 105px);
    margin-bottom: clamp(39px, 5vw, 60px);
}
.khpf-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--khpf-green);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .17em;
    line-height: 1.25;
    text-transform: uppercase;
}
.khpf-eyebrow span { width: 25px; height: 2px; background: currentColor; }
.khpf-header h2 {
    margin: 0 !important;
    color: var(--khpf-blue-dark) !important;
    font-size: clamp(35px, 3.5vw, 49px) !important;
    font-weight: 730 !important;
    letter-spacing: -.037em !important;
    line-height: 1.09 !important;
}
.khpf-intro { max-width: 470px; padding-bottom: 4px; }
.khpf-intro p {
    margin: 0 0 18px !important;
    color: var(--khpf-body) !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
}
.khpf-intro a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--khpf-blue) !important;
    font-size: 12px;
    font-weight: 750;
}
.khpf-intro a span { color: var(--khpf-green); font-size: 15px; }

/* Main panel */
.khpf-panel {
    display: grid;
    grid-template-columns: minmax(310px, .68fr) minmax(0, 1.42fr);
    min-height: 420px;
    background: #fff;
    border: 1px solid var(--khpf-border);
    box-shadow: 0 19px 50px rgba(21, 51, 70, .07);
}
.khpf-aside {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(31px, 4vw, 47px);
    color: #fff;
    background:
        radial-gradient(circle at 100% 5%, rgba(20, 166, 83, .33), transparent 42%),
        linear-gradient(138deg, var(--khpf-blue-deep), var(--khpf-blue));
    overflow: hidden;
}
.khpf-aside::after {
    position: absolute;
    right: -70px;
    bottom: -70px;
    width: 190px;
    height: 190px;
    content: "";
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
}
.khpf-aside__label {
    display: block;
    margin-bottom: 13px;
    color: #8be0ae;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.khpf-aside h3 {
    margin: 0 0 17px !important;
    color: #fff !important;
    font-size: clamp(26px, 2.65vw, 36px) !important;
    font-weight: 710 !important;
    letter-spacing: -.032em !important;
    line-height: 1.12 !important;
}
.khpf-aside p {
    margin: 0 !important;
    color: rgba(255, 255, 255, .69) !important;
    font-size: 12px !important;
    line-height: 1.7 !important;
}
.khpf-applicant {
    position: relative;
    z-index: 2;
    margin-top: 42px;
    padding-top: 23px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}
.khpf-applicant > span {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, .64);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.khpf-applicant__switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    padding: 3px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
}
.khpf-applicant__switch button {
    min-height: 38px;
    padding: 8px 10px;
    color: rgba(255, 255, 255, .72);
    background: transparent;
    border: 0;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.3;
}
.khpf-applicant__switch button.is-active {
    color: var(--khpf-blue-dark);
    background: #fff;
}
.khpf-portal-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 15px;
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
}
.khpf-portal-link span { color: #8be0ae; font-size: 13px; }

/* Search side */
.khpf-search-area {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(31px, 4.5vw, 55px);
    background: linear-gradient(135deg, #fff, #fbfcfd);
}
.khpf-search-block > label,
.khpf-filters label {
    display: block;
    margin-bottom: 8px;
    color: var(--khpf-blue-dark);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.khpf-searchbox { position: relative; }
.khpf-searchbox svg {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: var(--khpf-green);
    stroke-width: 1.8;
    stroke-linecap: round;
    transform: translateY(-50%);
}
.khpf-searchbox input {
    width: 100%;
    height: 58px;
    padding: 0 54px 0 53px;
    color: var(--khpf-heading);
    background: #fff;
    border: 1px solid #cfdbe1;
    border-radius: 4px;
    outline: 0;
    font-size: 13px;
}
.khpf-searchbox input:focus {
    border-color: var(--khpf-green);
    box-shadow: 0 0 0 3px rgba(8, 123, 62, .1);
}
.khpf-searchbox > button {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    padding: 0;
    color: var(--khpf-muted);
    background: var(--khpf-soft);
    border: 0;
    border-radius: 50%;
    font-size: 20px;
    transform: translateY(-50%);
}

/* Compact results directly below search */
.khpf-search-results {
    position: relative;
    z-index: 4;
    max-height: 390px;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #cfdbe1;
    box-shadow: 0 15px 34px rgba(18, 48, 68, .11);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.khpf-search-results[hidden] { display: none !important; }
.khpf-suggestion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--khpf-border);
}
.khpf-suggestion:last-child { border-bottom: 0; }
.khpf-suggestion:hover { background: #fbfdfc; }
.khpf-suggestion__school {
    display: block;
    margin-bottom: 4px;
    color: var(--khpf-green);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .07em;
    line-height: 1.35;
    text-transform: uppercase;
}
.khpf-suggestion h4 {
    margin: 0 !important;
    color: var(--khpf-blue-dark) !important;
    font-size: 13px !important;
    font-weight: 720 !important;
    letter-spacing: -.01em !important;
    line-height: 1.4 !important;
}
.khpf-suggestion h4 a { color: inherit !important; }
.khpf-suggestion__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}
.khpf-suggestion__meta span {
    color: var(--khpf-muted);
    font-size: 8px;
    font-weight: 650;
}
.khpf-suggestion__meta span + span::before {
    margin-right: 6px;
    content: "•";
    color: #aeb8b2;
}
.khpf-suggestion__actions {
    display: flex;
    align-items: center;
    gap: 7px;
}
.khpf-suggestion__actions a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 750;
    white-space: nowrap;
}
.khpf-suggestion__details {
    color: var(--khpf-blue) !important;
    background: #fff;
    border: 1px solid var(--khpf-border);
}
.khpf-suggestion__apply {
    color: #fff !important;
    background: var(--khpf-green);
    border: 1px solid var(--khpf-green);
}
.khpf-search-message {
    padding: 20px 18px;
    color: var(--khpf-body);
    font-size: 10px;
    line-height: 1.55;
}
.khpf-search-message strong {
    display: block;
    margin-bottom: 4px;
    color: var(--khpf-blue-dark);
    font-size: 12px;
}
.khpf-search-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 18px;
    background: var(--khpf-soft);
    border-top: 1px solid var(--khpf-border);
}
.khpf-search-footer a {
    color: var(--khpf-blue) !important;
    font-size: 9px;
    font-weight: 750;
}

/* Filters and shortcuts */
.khpf-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .72fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 18px;
}
.khpf-filters select {
    width: 100%;
    height: 46px;
    padding: 0 37px 0 13px;
    color: var(--khpf-heading);
    background: #fff;
    border: 1px solid #cfdbe1;
    border-radius: 4px;
    outline: 0;
    font-size: 11px;
}
.khpf-reset {
    min-height: 46px;
    padding: 10px 15px;
    color: var(--khpf-blue);
    background: transparent;
    border: 1px solid var(--khpf-border);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.khpf-popular {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 20px;
}
.khpf-popular > span {
    flex: 0 0 auto;
    padding-top: 7px;
    color: var(--khpf-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.khpf-popular > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.khpf-popular button {
    padding: 6px 10px;
    color: var(--khpf-blue);
    background: #edf3f8;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 650;
}
.khpf-popular button:hover {
    color: var(--khpf-green-dark);
    background: var(--khpf-green-soft);
    border-color: #c9dfd1;
}

/* Guided finder callout */
.khpf-guide-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 26px;
    padding-top: 23px;
    border-top: 1px solid var(--khpf-border);
}
.khpf-guide-callout > div { max-width: 420px; }
.khpf-guide-callout > div > span {
    display: block;
    margin-bottom: 4px;
    color: var(--khpf-blue-dark);
    font-size: 12px;
    font-weight: 750;
}
.khpf-guide-callout p {
    margin: 0 !important;
    color: var(--khpf-body) !important;
    font-size: 10px !important;
    line-height: 1.55 !important;
}
.khpf-guide-callout > button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #fff;
    background: var(--khpf-blue);
    border: 1px solid var(--khpf-blue);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}
.khpf-guide-callout > button span { color: #8be0ae; font-size: 13px; }

/* Inline fallback */
.khpf-inline-fallback {
    padding: 28px;
    color: var(--khpf-body);
    background: #fff7f5;
    border: 1px solid #ecd6d1;
}
.khpf-inline-fallback strong {
    display: block;
    margin-bottom: 5px;
    color: #6f302a;
    font-size: 13px;
}
.khpf-inline-fallback p {
    margin: 0 0 16px !important;
    color: #7a5b57 !important;
    font-size: 10px !important;
}
.khpf-inline-fallback > div { display: flex; gap: 8px; }
.khpf-inline-fallback a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 12px;
    color: var(--khpf-blue) !important;
    background: #fff;
    border: 1px solid #dfc8c3;
    font-size: 9px;
    font-weight: 750;
}

/* Guided modal */
.khpf-guide {
    position: fixed;
    z-index: 100005;
    inset: 0;
    display: grid;
    place-items: center;
}
.khpf-guide[hidden] { display: none !important; }
.khpf-guide__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 22, 36, .76);
    backdrop-filter: blur(7px);
}
.khpf-guide__dialog {
    position: relative;
    width: min(760px, calc(100% - 30px));
    max-height: calc(100dvh - 30px);
    padding: clamp(28px, 5vw, 50px);
    background: #fff;
    border-top: 5px solid var(--khpf-green);
    box-shadow: 0 30px 90px rgba(0, 20, 34, .28);
    overflow-y: auto;
}
.khpf-guide__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    padding: 0;
    color: var(--khpf-blue-dark);
    background: var(--khpf-soft);
    border: 0;
    border-radius: 50%;
    font-size: 22px;
}
.khpf-guide__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-right: 48px;
}
.khpf-guide__top > span {
    color: var(--khpf-green);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.khpf-guide__top > div { display: flex; gap: 5px; }
.khpf-guide__top i {
    display: block;
    width: 25px;
    height: 3px;
    background: #dce5e9;
}
.khpf-guide__top i.is-active { background: var(--khpf-green); }
.khpf-guide__dialog > h3 {
    margin: 14px 0 28px !important;
    color: var(--khpf-blue-dark) !important;
    font-size: clamp(28px, 4vw, 40px) !important;
    font-weight: 730 !important;
    letter-spacing: -.035em !important;
    line-height: 1.1 !important;
}
.khpf-guide__step { display: none; }
.khpf-guide__step.is-active { display: block; }
.khpf-guide__step > p {
    margin: 0 0 15px !important;
    color: var(--khpf-heading) !important;
    font-size: 13px !important;
    font-weight: 750;
}
.khpf-guide__choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.khpf-guide__choices--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.khpf-guide__choices--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.khpf-guide__choices button {
    min-height: 68px;
    padding: 15px 17px;
    color: var(--khpf-blue-dark);
    text-align: left;
    background: #fff;
    border: 1px solid var(--khpf-border);
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}
.khpf-guide__choices button:hover {
    color: var(--khpf-green-dark);
    background: var(--khpf-green-soft);
    border-color: var(--khpf-green);
}
.khpf-guide__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid var(--khpf-border);
}
.khpf-guide__footer button {
    padding: 0;
    color: var(--khpf-blue);
    background: transparent;
    border: 0;
    font-size: 10px;
    font-weight: 750;
}
.khpf-guide__footer button:disabled { opacity: .35; cursor: not-allowed; }
.khpf-guide__footer a {
    color: var(--khpf-blue) !important;
    font-size: 10px;
    font-weight: 750;
}
.khpf-guide__noscript {
    margin-top: 16px;
    color: var(--khpf-body);
    font-size: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .khpf-section { --khpf-container: min(100% - 34px, 1240px); padding: 68px 0 !important; }
    .khpf-header { grid-template-columns: 1fr; gap: 22px; }
    .khpf-intro { max-width: 650px; }
    .khpf-panel { grid-template-columns: 1fr; }
    .khpf-aside { min-height: 300px; }
}
@media (max-width: 620px) {
    .khpf-section { --khpf-container: calc(100% - 26px); padding: 56px 0 !important; }
    .khpf-header h2 { font-size: clamp(33px, 9.5vw, 43px) !important; }
    .khpf-header h2 br { display: none; }
    .khpf-aside,
    .khpf-search-area { padding: 27px 22px; }
    .khpf-aside { min-height: 330px; }
    .khpf-applicant__switch,
    .khpf-filters { grid-template-columns: 1fr; }
    .khpf-searchbox input { height: 54px; padding-left: 47px; font-size: 11px; }
    .khpf-popular { flex-direction: column; gap: 8px; }
    .khpf-popular > span { padding-top: 0; }
    .khpf-guide-callout { align-items: flex-start; flex-direction: column; gap: 14px; }
    .khpf-guide-callout > button { width: 100%; justify-content: center; }
    .khpf-suggestion { grid-template-columns: 1fr; gap: 12px; }
    .khpf-suggestion__actions { justify-content: flex-start; }
    .khpf-guide__choices,
    .khpf-guide__choices--three,
    .khpf-guide__choices--two { grid-template-columns: 1fr; }
    .khpf-guide__dialog { padding: 26px 21px; }
}
@media (prefers-reduced-motion: reduce) {
    .khpf-section *,
    .khpf-section *::before,
    .khpf-section *::after {
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Version 1.2: exact guided matching and academic hierarchy */
.khpf-search-context {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px;
    padding: 11px 18px;
    color: var(--khpf-muted);
    background: var(--khpf-soft);
    border-bottom: 1px solid var(--khpf-border);
    font-size: 8px;
    line-height: 1.4;
}
.khpf-search-context span {
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.khpf-search-context strong {
    color: var(--khpf-blue-dark);
    font-size: 9px;
    font-weight: 750;
}
.khpf-result-group + .khpf-result-group {
    border-top: 4px solid var(--khpf-soft);
}
.khpf-result-group > h5 {
    margin: 0 !important;
    padding: 10px 18px !important;
    color: var(--khpf-blue-dark) !important;
    background: #f7faf8;
    border-bottom: 1px solid var(--khpf-border);
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: .09em !important;
    line-height: 1.35 !important;
    text-transform: uppercase;
}
.khpf-result-group:nth-of-type(1) > h5 { border-left: 3px solid var(--khpf-green); }
.khpf-result-group:nth-of-type(2) > h5 { border-left: 3px solid var(--khpf-blue); }
.khpf-result-group:nth-of-type(3) > h5 { border-left: 3px solid #8a5b9d; }
.khpf-result-group:nth-of-type(4) > h5 { border-left: 3px solid #a47532; }
.khpf-guide__choices--areas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.khpf-guide__choices--levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) {
    .khpf-guide__choices--areas,
    .khpf-guide__choices--levels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    .khpf-guide__choices--areas,
    .khpf-guide__choices--levels {
        grid-template-columns: 1fr;
    }
    .khpf-search-context {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}
