/* Entry pages only. Keep legacy component classes and their event handlers intact. */
body.kg-portal {
    --kg-primary: #b478b1;
    --kg-ink: #82517f;
    --kg-tint: #f5edf6;
    --kg-line: #ecdfed;
    --kg-text: #303b43;
    --kg-muted: #78838b;
    margin: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    min-height: 100vh;
    background: #f7f8fa;
    color: var(--kg-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}
body.kg-director { --kg-primary: #8fc250; --kg-ink: #527d2a; --kg-tint: #f0f6e8; --kg-line: #e1ebd4; }
body.kg-parent { --kg-primary: #214c92; --kg-ink: #214c92; --kg-tint: #edf3fb; --kg-line: #dfe8f5; }
.kg-portal *, .kg-portal *::before, .kg-portal *::after { box-sizing: border-box; }
.kg-portal a { text-decoration: none; }
.kg-portal a:focus-visible, .kg-portal input:focus-visible, .kg-portal [tabindex]:focus-visible { outline: 3px solid var(--kg-primary); outline-offset: 4px; }
.kg-eyebrow { display: block; margin: 0 0 10px; color: var(--kg-ink); font-size: 11px; font-weight: 700; letter-spacing: 2px; line-height: 1.5; }
.kg-role-badge { display: inline-block; padding: 5px 12px; border: 1px solid var(--kg-line); border-radius: 30px; background: var(--kg-tint); color: var(--kg-ink); font-size: 12px; }
.kg-section-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 16px; color: var(--kg-text); font-size: 18px; font-weight: 600; }
.kg-section-title small { color: var(--kg-muted); font-size: 11px; font-weight: 400; letter-spacing: 1px; }

/* Login: one readable, touch-friendly form on every screen. */
body.kg-login { padding: 76px 20px 40px; background: radial-gradient(ellipse at 15% 12%, var(--kg-tint), transparent 50%), #f7f8fa; }
.kg-login > .header { position: absolute; top: 0; left: 0; width: 100%; height: 56px; padding: 0 24px; background: transparent; border-bottom: 1px solid var(--kg-line); box-shadow: none; }
.kg-login > .header h5 { margin: 0; color: var(--kg-ink); font-size: 14px; font-weight: 600; line-height: 56px; }
.kg-login .kg-login-card, .kg-login .registPublic { width: 100%; max-width: 440px; margin: 22px auto 0; padding: 36px; border: 1px solid #edf0f1; border-radius: 24px; background: #fff; box-shadow: 0 16px 60px rgba(33, 49, 60, .06); }
.kg-login .kg-login-intro { margin-bottom: 30px; text-align: left; }
.kg-login-intro h1 { margin: 18px 0 10px; color: var(--kg-text); font-size: 28px; font-weight: 650; line-height: 1.4; letter-spacing: -.5px; }
.kg-login-intro p { margin: 0; color: var(--kg-muted); font-size: 14px; line-height: 1.8; }
.kg-login .kg-sprout { position: relative; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 16px; background: var(--kg-tint); }
.kg-sprout::before, .kg-sprout::after { content: ""; position: absolute; background: var(--kg-primary); }
.kg-sprout::before { top: 13px; left: 11px; width: 15px; height: 10px; border-radius: 2px 12px 2px 12px; transform: rotate(12deg); }
.kg-sprout::after { top: 17px; left: 25px; width: 3px; height: 20px; border-radius: 3px; transform: rotate(18deg); }
.kg-login .login_logo { width: auto; margin: 0 0 24px; padding: 0; text-align: left; }
.kg-login .login_logo img { width: auto !important; max-width: 150px; max-height: 80px; object-fit: contain; }
.kg-login .hg44 { display: none; }
.kg-login .registPublic form, .kg-login .form { width: 100%; margin: 0; padding: 0; }
.kg-login .form_list { margin: 0; padding: 0; border: 0; background: transparent; }
.kg-login .registPublic article { margin: 0; padding: 0; }
.kg-login .kg-field-label { display: block; margin: 0 0 8px; color: var(--kg-text); font-size: 13px; font-weight: 600; }
.kg-login .login, .kg-login .form_list dl { display: block; height: auto; margin: 0 0 20px; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.kg-login .form_list dt { position: static; float: none; width: auto; height: auto; margin: 0 0 8px; padding: 0; color: var(--kg-text); font-size: 13px; font-weight: 600; line-height: 1.6; }
.kg-login dd, .kg-login .form_list dd { position: static; float: none; width: 100%; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; line-height: normal; }
.kg-login .login dd input, .kg-login .form_list dd input { display: block; float: none; width: 100%; height: 52px; margin: 0; padding: 0 15px; border: 1px solid #dfe4e8; border-radius: 10px; background: #fafbfc; color: var(--kg-text); font: inherit; font-size: 16px; line-height: normal; transition: border-color .15s, box-shadow .15s; }
.kg-login .login dd input:focus, .kg-login .form_list dd input:focus { border-color: var(--kg-primary); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--kg-tint); }
.kg-login input::placeholder { color: #9aa3aa; font-size: 13px; }
.kg-login input[type="submit"], .kg-login .form input[type="submit"] { display: block; width: 100%; height: 52px; margin: 8px 0 0; padding: 0 12px; border: 0; border-radius: 10px; background: var(--kg-primary); color: #fff; font-size: 16px; font-weight: 600; line-height: 52px; letter-spacing: 3px; cursor: pointer; transition: filter .15s; -webkit-appearance: none; }
.kg-login input[type="submit"]:hover { background: var(--kg-primary); filter: brightness(.95); }
.kg-login input[type="submit"]:disabled { opacity: .6; cursor: wait; }
.kg-login .pl10.pb10.pr10 { padding: 0; }
.kg-login .describe_next { margin-top: 18px; font-size: 13px; }
.kg-login .describe_next a { color: var(--kg-ink); line-height: 28px; }
.kg-login-footer { max-width: 440px; margin: 24px auto 0; color: var(--kg-muted); font-size: 12px; text-align: center; letter-spacing: 1px; }

/* Home: retain legacy links, role menus, feature gates and live summary nodes. */
body.kg-home { padding: 84px 24px 112px; }
.kg-home > .header, .kg-home > .mui-bar-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 20; width: 100%; max-width: none; height: 60px; padding: 0 max(24px, calc((100% - 1040px) / 2)); border: 0; background: var(--kg-primary); box-shadow: 0 3px 18px rgba(31, 47, 59, .06); }
.kg-home > .header h5, .kg-home .mui-bar-nav .mui-title { margin: 0; color: #fff; font-size: 16px; font-weight: 600; line-height: 60px; }
.kg-home .mui-bar-nav .mui-title { right: 100px; left: 100px; pointer-events: none; }
.kg-home .mui-bar-nav > .mui-icon { margin: 6px 0 0; }
.kg-home .header_fr { top: 16px; right: max(24px, calc((100% - 1040px) / 2)); }
.kg-home > .hg44 { display: none; }
.kg-home > .mui-content, .kg-home > .home-tz, .kg-home > .new_content, .kg-home > .kg-hero, .kg-home > .index_top { width: 100%; max-width: 1040px; margin-right: auto; margin-left: auto; }
.kg-home > .mui-content { padding: 0 !important; background: transparent; }
.kg-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 196px; margin: 0 0 24px; padding: 30px 36px; overflow: hidden; border: 1px solid var(--kg-line); border-radius: 22px; background: var(--kg-tint); }
.kg-hero-copy { min-width: 0; flex: 1; }
.kg-hero h2 { margin: 8px 0 12px; color: var(--kg-text); font-size: 30px; font-weight: 650; line-height: 1.4; letter-spacing: -.5px; }
.kg-hero p { margin: 0; color: var(--kg-muted); font-size: 14px; line-height: 1.9; }
.kg-home .kg-hero #slider { flex: 0 0 36%; width: 36%; max-width: 340px; height: 160px; overflow: hidden; border-radius: 14px; background: #fff; }
.kg-home .kg-hero #slider > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kg-home .home-icon { display: flex; gap: 16px; width: 100%; margin: 0; padding: 0; }
.kg-home .home-icon .mui-col-xs-4 { flex: 1; float: none; width: auto; min-width: 0; margin: 0; padding: 0; }
.kg-home .home-icon div a { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 100px; padding: 18px 16px; border: 1px solid #e9edf0; border-radius: 16px; background: #fff; transition: border-color .15s, transform .15s; }
.kg-home .home-icon div a:hover { transform: translateY(-2px); border-color: var(--kg-primary); }
.kg-home .home-icon div a img { display: block; width: 52px; height: 52px; margin: 0; padding: 0; object-fit: contain; }
.kg-home .home-icon div a span { position: static; width: auto; color: var(--kg-ink); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.kg-home .home-gx { display: flex; align-items: center; gap: 14px; width: 100%; height: auto; margin: 30px 0 18px; }
.kg-home .home-gx .mui-col-xs-5 { flex: 1; float: none; width: auto !important; height: 1px; margin: 0; padding: 0; background: var(--kg-line); }
.kg-home .home-gx .mui-col-xs-2 { float: none; width: auto !important; }
.kg-home .home-gx .mui-col-xs-2 a { color: var(--kg-muted); font-size: 13px; letter-spacing: 2px; cursor: default; }
.kg-home > .home-tz { margin-top: 0; padding: 0; border: 0 !important; }
.kg-home .home-tz > .mui-content { padding: 0 !important; background: transparent; }
.kg-home .tz-m { position: relative; display: flex; align-items: flex-start; gap: 14px; min-width: 0; margin: 0 0 16px; padding: 22px; border: 1px solid #e9edf0; border-radius: 16px; background: #fff; }
.kg-home .tz-m > .mui-pull-left { flex: 0 0 38px; float: none; width: 38px; }
.kg-home .tz-m > .mui-pull-left img { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; }
.kg-home .tz-m > .mui-pull-right { flex: 1; float: none; width: auto; min-width: 0; padding: 0; border: 0; }
.kg-home .tz-m-wz { width: 100%; }
.kg-home .tz-m-wz > span { display: block; margin: 0 0 10px; color: var(--kg-ink); font-size: 15px; font-weight: 600; line-height: 1.6; }
.kg-home .tz-m-wz h1 { margin: 8px 0; color: var(--kg-ink); font-size: 15px; line-height: 1.7; }
.kg-home .tz-m-wz p { margin: 0 0 8px; color: #68747d; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.kg-home .tz-m-wz p img { width: 29%; max-height: 150px; margin-top: 8px; border-radius: 8px; object-fit: cover; }
.kg-home .tz-m-time { margin-top: 16px; color: var(--kg-muted); font-size: 12px; line-height: 20px; }
.kg-home .tz-cq { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; }
.kg-home .tz-cq label { color: var(--kg-ink); font-size: 24px; font-weight: 600; }
.kg-home #msg_box .wc-summary-card { width: 100%; min-width: 0; border: 0; box-shadow: none; background: transparent; }
.kg-home #msg_box .wc-summary-label { color: var(--kg-ink); font-size: 15px; font-weight: 600; }
.kg-home #msg_box .wc-summary-text { color: #68747d; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.kg-home .home-tx1 { display: flex; align-items: center; flex-wrap: wrap; column-gap: 18px; margin-bottom: 24px; padding: 28px 30px; border: 1px solid var(--kg-line); border-radius: 22px; background: var(--kg-tint); }
.kg-home .home-tx1 > div { position: static; flex: 0 0 80px; width: 80px; height: 80px; margin: 0; border: 4px solid #fff; border-radius: 50%; overflow: hidden; box-shadow: 0 4px 14px rgba(33, 76, 146, .08); }
.kg-home .home-tx1 > div img { position: static; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.kg-home .home-tx1 > p { margin: 0; color: var(--kg-ink); font-size: 24px; font-weight: 600; text-align: left; }
.kg-home .home-tx1 .kg-profile-caption { flex-basis: 100%; margin-top: 18px; color: var(--kg-muted); font-size: 14px; font-weight: 400; }

/* Fixed navigation stays above the device safe area; its actions are unchanged. */
.kg-home .mui-bar-tab, .kg-home .footer { position: fixed; z-index: 30; right: 16px; bottom: 12px; left: 16px; width: auto; max-width: 680px; height: calc(68px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; padding: 4px 8px env(safe-area-inset-bottom, 0px); border: 1px solid #e9edf0; border-radius: 20px; background: #fff; box-shadow: 0 6px 32px rgba(31, 47, 59, .10); }
.kg-home .mui-bar-tab a { height: 58px; padding: 0; color: var(--kg-muted); }
.kg-home .mui-bar-tab a .mui-icon { top: 5px; }
.kg-home .mui-bar-tab a .mui-icon ~ .mui-tab-label { margin-top: 4px; color: inherit; font-size: 11px; line-height: 18px; white-space: normal; }
.kg-home .mui-bar-tab a.mui-active { color: var(--kg-ink); }
.kg-home .nav-plus { position: fixed; z-index: 31; bottom: calc(37px + env(safe-area-inset-bottom, 0px)); left: 50%; width: 52px; height: 52px; margin-left: -26px; transform: none; }
.kg-home .morebox, .kg-home .moreboxt { z-index: 40; top: 57px; width: 210px; max-width: calc(100vw - 32px); border: 1px solid var(--kg-line); border-radius: 12px; background: #fff; opacity: 1; box-shadow: 0 10px 35px rgba(31, 47, 59, .15); }
.kg-home .more_jiao, .kg-home .more_jiaot { display: none; }
.kg-home #bottomPopover.mui-popover { position: fixed !important; top: auto !important; right: 0; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 0 !important; width: calc(100% - 32px); max-width: 600px; max-height: calc(100vh - 180px); margin: 0 auto; padding: 28px 12px !important; overflow-y: auto; border-radius: 20px; background: #fff; }
.kg-home #bottomPopover .mui-popover-arrow { display: none; }
.kg-home #bottomPopover .plus-m { width: 100%; }
.kg-home .foot-nav { height: 0; }

/* Director overview and feed. */
.kg-director .index_top p { margin: 0 0 18px; border: 1px solid var(--kg-line); border-radius: 12px; }
.kg-director .new_content { padding: 0; border: 0; background: transparent; }
.kg-director .school_info { width: 100%; margin: 0 0 26px; padding: 0; border: 1px solid #e9edf0; border-radius: 18px; background: #fff; }
.kg-director .s_table { width: 100%; margin: 0; }
.kg-director .s_table td { width: 33.333%; padding: 24px 12px; }
.kg-director .s_table td + td { border-left: 1px solid #edf0f1; }
.kg-director .s_table td a { display: block; }
.kg-director .s_table td div { width: auto; height: auto; margin: 0 0 8px; border-radius: 0; background: transparent; color: var(--kg-ink); font-size: 34px; font-weight: 650; line-height: 1.3; }
.kg-director .s_table p { margin: 3px 0 0; color: var(--kg-muted); font-size: 12px; }
.kg-director .s_table p.clbcda93 { color: var(--kg-text); font-size: 14px; font-weight: 500; }
.kg-director .new_content > .clearfix { margin: 0 0 16px; padding: 24px; border: 1px solid #e9edf0; border-radius: 16px; background: #fff; }
.kg-director .init_title { display: flex; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 16px; padding: 0; border: 0; }
.kg-director .init_title > img { position: static; float: none; width: 32px; height: 32px; margin: 0; border-radius: 8px; object-fit: contain; }
.kg-director .init_title > p { margin: 0; padding: 0; line-height: 1.7; }
.kg-director .init_title .clbcda93 { color: var(--kg-ink); font-size: 15px; font-weight: 600; }
.kg-director .new_content > .clearfix > .mt10, .kg-director .new_content > .clearfix > a > .mt10 { margin-left: 0 !important; }
.kg-director .new_content p { line-height: 1.8; }
.kg-director .atten_table { width: 100%; }
.kg-director .atten_table td { height: 52px; padding: 10px 8px; border-bottom: 1px solid #eef1ed; font-size: 14px; overflow-wrap: anywhere; }
.kg-director .atten_table td:first-child a { color: var(--kg-ink); font-weight: 600; }
.kg-director .atten_table td:last-child a { color: var(--kg-ink); font-weight: 600; }
.kg-director .tab_bot { margin-top: 14px; color: var(--kg-muted); font-size: 12px; }
.kg-director .footer ul { display: flex; width: 100%; height: 58px; margin: 0; padding: 0; }
.kg-director .footer ul li { flex: 1; width: 20%; height: 58px; }
.kg-director .footer ul li a { display: block; height: 58px; color: var(--kg-muted); }
.kg-director .footer ul li.active a { color: var(--kg-ink); }
.kg-director .footer ul li p { padding-top: 31px; font-size: 11px; line-height: 22px; }
.kg-director .footer .center_li, .kg-director .footer .active2 { top: -10px; }
.kg-director .pray_div { position: fixed; z-index: 25; top: 0; right: 0; bottom: 0; left: 0; width: 100%; background: rgba(39, 49, 35, .38); }
.kg-director .pray_div > div { top: auto; right: 0; bottom: calc(94px + env(safe-area-inset-bottom, 0px)); left: 0; width: calc(100% - 32px); max-width: 640px; max-height: calc(100vh - 160px); margin: 0 auto; padding: 16px 0; overflow-y: auto; border-radius: 20px; background: #fff; }

@media (min-width: 768px) {
    .kg-home .home-tz > .mui-content { display: contents; }
    .kg-home > .home-tz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
    .kg-home .home-tz .tz-m { height: 100%; margin: 0; }
}
@media (max-width: 600px) {
    body.kg-login { padding: 68px 18px 28px; }
    .kg-login .kg-login-card, .kg-login .registPublic { margin-top: 16px; padding: 28px 24px; border-radius: 20px; }
    .kg-login-intro h1 { font-size: 26px; }
    body.kg-home { padding: 76px 16px 110px; }
    .kg-home > .header, .kg-home > .mui-bar-nav { height: 56px; padding-right: 16px; padding-left: 16px; }
    .kg-home > .header h5, .kg-home .mui-bar-nav .mui-title { font-size: 15px; line-height: 56px; }
    .kg-home .mui-bar-nav .mui-title { right: 76px; left: 76px; }
    .kg-home .header_fr { right: 16px; }
    .kg-hero { gap: 14px; min-height: 168px; margin-bottom: 18px; padding: 24px 20px; border-radius: 18px; }
    .kg-hero h2 { font-size: 23px; }
    .kg-hero p { font-size: 12px; }
    .kg-hero .kg-eyebrow { font-size: 9px; letter-spacing: 1px; }
    .kg-home .kg-hero #slider { flex-basis: 30%; width: 30%; height: 108px; border-radius: 12px; }
    .kg-home .home-icon { gap: 10px; }
    .kg-home .home-icon div a { flex-direction: column; gap: 9px; min-height: 116px; padding: 16px 5px; border-radius: 14px; }
    .kg-home .home-icon div a img { width: 44px; height: 44px; }
    .kg-home .home-icon div a span { font-size: 13px; line-height: 1.5; }
    .kg-home .home-gx { margin-top: 24px; }
    .kg-home .tz-m { gap: 12px; padding: 18px 16px; }
    .kg-home .tz-m > .mui-pull-left { flex-basis: 32px; width: 32px; }
    .kg-home .tz-m > .mui-pull-left img { width: 32px; height: 32px; }
    .kg-home .home-tx1 { padding: 22px; }
    .kg-home .home-tx1 > div { flex-basis: 68px; width: 68px; height: 68px; }
    .kg-home .home-tx1 > p { font-size: 22px; }
    .kg-home .home-tx1 .kg-profile-caption { font-size: 12px; }
    .kg-director .s_table td { padding: 20px 8px; }
    .kg-director .s_table td div { font-size: 28px; }
    .kg-director .new_content > .clearfix { padding: 20px 16px; }
    .kg-director .init_title > p > span { display: block; }
    .kg-director .init_title .ml10 { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .kg-portal *, .kg-portal *::before, .kg-portal *::after { transition: none !important; }
}
