

:root {
    
    --font-cjk-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei";
    --font-cjk-serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC";
    --font-sans: Inter, var(--font-cjk-sans), system-ui, -apple-system, sans-serif;
    --font-serif: "Newsreader", var(--font-cjk-serif), Georgia, serif;
    --font-head: "Newsreader", var(--font-cjk-serif), Georgia, serif;
    --font-mono: "DM Mono", var(--font-cjk-sans), ui-monospace, Menlo, monospace;

    --radius-lg: 32px;
    --radius-md: 20px;
    --radius-sm: 12px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --ease-in-out: cubic-bezier(.4, 0, .2, 1);
    --dur-fast: 180ms;
    --dur-base: 250ms;
    --dur-slow: 420ms;
    --dur-reveal: 800ms;
    --stagger-in: 80ms;
    --stagger-out: 40ms;
    --rise-sm: 8px;
    --rise-md: 24px;
    --rise-lg: 36px;

    --yb-gutter: max(40px, calc((100% - 1280px) / 2));
    --yb-bleed: max(40px, calc((100vw - 1280px) / 2));

    --yb-olive: #313429;
    --yb-olive-deep: #1F2219;
    --yb-lime: #ECFC91;
    --yb-terra: #E0703F;
    --yb-coral: #FB8864;
    --yb-blush: #EFE2D9;
    --yb-lilac: #EAD7F2;
    --yb-sage: #DEE0D3;
    --yb-khaki: #C7C0A6;

    --acc-card-bg: #2A2D22;
    --acc-card-line: #3A3D30;
    --acc-chip-bg: #33362A;
    --acc-chip-line: #43463A;
    --acc-text-2: #C2BFAE;
    --acc-accent: #FB8864;
}

:root:lang(zh-Hans) { --font-cjk-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei"; --font-cjk-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC"; }
:root:lang(ja) { --font-cjk-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo; --font-cjk-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho"; }
:root:lang(ko) { --font-cjk-sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic"; --font-cjk-serif: "Noto Serif KR", AppleMyungjo, Batang; }
:root:lang(ar) { --font-cjk-sans: "Noto Sans Arabic", "Geeza Pro", Tahoma; --font-cjk-serif: "Noto Naskh Arabic", "Geeza Pro", Tahoma; }

body { font-family: var(--font-sans); }


:root:not([data-theme="linen"]) {
    --chrome-bg: #14150F;
    --chrome-bg-rgb: 20, 21, 15;
    --wash-rgb: 236, 234, 223;
    --accent-rgb: 236, 252, 145;
    --accent-fill: #ECFC91;
    --accent-fill-hover: #DDF070;
    --on-accent: #1F2219;
    --shadow-card: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 48px -18px rgba(0, 0, 0, .65);

    --color-primary: #ECFC91;
    --color-primary-light: #F3FDB7;
    --color-primary-dark: #DDF070;
    --color-primary-tint: rgba(236, 252, 145, .1);
    --color-bg: #14150F;
    --color-surface: #1D1F17;
    --color-surface-soft: #26281F;
    --color-border: #34372B;
    --color-text: #ECEADF;
    --color-text-muted: #B3B1A1;
    --color-dark-surface: #1D1F17;
    --color-dark-surface-2: #26281F;
    --color-dark-border: #34372B;
    --color-on-dark: #ECEADF;
    --color-on-dark-muted: #B3B1A1;

    --result-bg: #1D1F17;
    --result-surface: #26281F;
    --result-surface-hover: #2E3026;
    --result-border: #34372B;
    --result-text: #ECEADF;
    --result-text-secondary: #B3B1A1;
    --result-text-muted: #8E8D7E;
    --result-primary: #ECFC91;
    --result-primary-dark: #F3FDB7;
    --result-primary-tint: rgba(236, 252, 145, .1);

    --danger: #F08A7A;
    --ok: #8FC46B;

    
    --score-red: #F08A7A;
    --score-yellow: #D9B969;
    --score-yellow-ink: #D9B969;
    --score-green: #8FC46B;
    --score-blue: #8FB3E0;
    --severity-track: #34372B;
}


:root[data-theme="linen"] {
    --chrome-bg: #FAF9FD;
    --chrome-bg-rgb: 250, 249, 253;
    --wash-rgb: 49, 52, 41;
    --accent-rgb: 49, 52, 41;
    --accent-fill: #313429;
    --accent-fill-hover: #1F2219;
    --on-accent: #ECFC91;
    --shadow-card: 0 2px 6px rgba(49, 52, 41, .05), 0 24px 48px -18px rgba(49, 52, 41, .22);

    --color-primary: #313429;
    --color-primary-light: #5C5E50;
    --color-primary-dark: #1F2219;
    --color-primary-tint: rgba(49, 52, 41, .08);
    --color-bg: #FAF9FD;
    --color-surface: #FFFFFF;
    --color-surface-soft: #F1EEE6;
    --color-border: #E2DED2;
    --color-text: #313429;
    --color-text-muted: #5C5E50;
    --color-dark-surface: #FFFFFF;
    --color-dark-surface-2: #F1EEE6;
    --color-dark-border: #E2DED2;
    --color-on-dark: #313429;
    --color-on-dark-muted: #5C5E50;

    --result-bg: #FFFFFF;
    --result-surface: #FAF9FD;
    --result-surface-hover: #F1EEE6;
    --result-border: #E2DED2;
    --result-text: #313429;
    --result-text-secondary: #45473A;
    --result-text-muted: #5C5E50;
    --result-primary: #313429;
    --result-primary-dark: #1F2219;
    --result-primary-tint: rgba(49, 52, 41, .08);

    --danger: #C85A2B;
    --ok: #4F6B3A;

    
    --score-red: #C85A2B;
    --score-yellow: #A3843A;
    --score-yellow-ink: #756433;
    --score-green: #4F6B3A;
    --score-blue: #4A6E9C;
    --severity-track: #E2DED2;
}


.home-view { container-type: inline-size; --yb-bleed: max(40px, calc((100cqw - 1280px) / 2)); }
@media (max-width: 760px) {
    :root, .home-view { --yb-gutter: 20px; --yb-bleed: 20px; }
}


:root:not([data-theme="linen"]) .home-view, :root:not([data-theme="linen"]) .site-footer {
    --home-ink: #ECEADF;
    --home-muted: #8E8D7E;
    --home-panel: #1D1F17;
    --home-line: rgba(236, 234, 223, .14);
    --home-gold: #E0703F;
}
:root[data-theme="linen"] .home-view, :root[data-theme="linen"] .site-footer {
    --home-ink: #313429;
    --home-muted: #5C5E50; 
    --home-panel: #FFFFFF;
    --home-line: #E2DED2;
    --home-gold: #E0703F;
}


.yb-logo { display: block; width: auto; height: 24px; }
.yb-ink { fill: var(--color-text); }
.yb-accent { fill: #E0703F; }
.yb-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


.app-header {
    height: calc(64px + env(safe-area-inset-top, 0px)); box-sizing: border-box;
    padding: env(safe-area-inset-top, 0px) max(40px, calc((100% - 1280px) / 2)) 0;
    gap: 8px;
    background: rgba(var(--chrome-bg-rgb), .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-border);
}
.app-header .app-brand { gap: 12px; border-radius: 4px; }
.app-header .brand-mark.yb-mark { display: flex; width: auto; height: auto; }
.brand-mark.yb-mark svg.yb-logo { width: auto; height: 24px; }

.yb-main-nav { display: flex; align-items: center; margin: 0 auto 0 30px; }
.header-nav-link.nav-link {
    position: relative; height: 40px; padding: 0 2px; margin-right: 24px; border: 0; border-radius: 0;
    background: none !important; box-shadow: none !important; color: var(--color-text);
    font-family: var(--font-mono); font-size: 11.5px; line-height: 16px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
}
.header-nav-link.nav-link::after {
    content: ""; position: absolute; left: 2px; right: 2px; bottom: 8px; height: 2px; background: var(--color-text);
    transform: scaleX(0); transform-origin: left; transition: transform var(--dur-base) var(--ease-out);
}
.header-nav-link.nav-link:hover::after, .header-nav-link.nav-link.is-current::after,
body.home-view-open:not(.pricing-view-open):not(.account-view-open) #nav_home_button::after { transform: scaleX(1); }

.app-header-actions > :first-child { margin-left: 0; }
.app-header .header-lang .custom-select-trigger,
.app-header .theme-toggle-btn,
.app-header #auth_button {
    height: 40px; min-height: 40px; padding: 0 12px; gap: 6px; border: 0; border-radius: 999px;
    background: transparent; color: var(--color-text);
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
    transition: background var(--dur-base);
}
.app-header .header-lang .custom-select-trigger:hover:not(:disabled),
.app-header .theme-toggle-btn:hover,
.app-header #auth_button:hover { background: var(--color-surface-soft); }
.app-header .header-lang-icon, .app-header .auth-signin-icon { width: 16px; height: 16px; }
.app-header .auth-signin-icon { display: block; }
.app-header #auth_button_avatar:not([hidden]) + .auth-signin-icon { display: none; }
.app-header .custom-select-caret { font-size: 0; width: 12px; height: 12px; opacity: 1; transition: transform var(--dur-base) var(--ease-in-out);
    background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.app-header .custom-select-trigger[aria-expanded="true"] .custom-select-caret { transform: rotate(180deg); }

.app-header .theme-toggle-btn { width: 40px; padding: 0; justify-content: center; }
.app-header .theme-toggle-label { display: none; }
.app-header .theme-toggle-icon { width: auto; display: grid; place-items: center; color: var(--color-text); font-size: 18px; }
.app-header .theme-toggle-icon svg { width: 18px; height: 18px; }

.hdr-start {
    display: none; flex: none; align-items: center; height: 42px; padding: 0 18px; margin-left: 4px; border: 0; border-radius: 999px;
    background: var(--accent-fill); color: var(--on-accent); cursor: pointer; white-space: nowrap;
    font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    transition: background var(--dur-base), transform var(--dur-base);
}
.hdr-start:hover { background: var(--accent-fill-hover); transform: translateY(-1px); }

body:is(.home-view-open, .pricing-view-open):not(.is-signed-in) .hdr-start { display: inline-flex; }
.app-header button:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }


.app-header .account-menu, .app-header .custom-select-list {
    border-radius: 20px; border-color: var(--color-border); background: var(--color-surface); box-shadow: var(--shadow-card);
    animation: ybMenuIn var(--dur-base) var(--ease-out) both;
}

.app-header .header-lang .custom-select-list:not([hidden]) {
    display: grid; grid-template-columns: repeat(2, max-content); gap: 2px 4px;
    max-height: none; overflow: visible;
}
@keyframes ybMenuIn { from { opacity: 0; transform: translateY(calc(-1 * var(--rise-sm))); } to { opacity: 1; transform: none; } }


.yb-burger { display: none; width: 40px; height: 40px; flex: none; padding: 0; margin-left: 4px; border: 0; border-radius: 50%; align-items: center; justify-content: center; background: var(--color-surface-soft); cursor: pointer; }
.yb-burger span, .yb-burger span::before, .yb-burger span::after { display: block; width: 18px; height: 2px; background: var(--color-text); position: relative; transition: transform var(--dur-base), background var(--dur-base); }
.yb-burger span::before, .yb-burger span::after { content: ""; position: absolute; left: 0; }
.yb-burger span::before { top: -6px; }
.yb-burger span::after { top: 6px; }
.app-header.nav-open .yb-burger span { background: transparent; }
.app-header.nav-open .yb-burger span::before { transform: translateY(6px) rotate(45deg); }
.app-header.nav-open .yb-burger span::after { transform: translateY(-6px) rotate(-45deg); }
.yb-drawer { display: none; }

.app-header .app-header-actions > .yb-burger > span { position: relative; width: 18px; height: 2px; margin: 0; overflow: visible; clip: auto; white-space: normal; }

@media (max-width: 820px) {
    .app-header { height: calc(60px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0 20px; gap: 8px; }
    .app-header .brand-mark.yb-mark svg.yb-logo { height: 18px; }
    .app-header-actions { gap: 2px; }
    .app-header-actions > button:not(.header-nav-link), .app-header .header-lang .custom-select-trigger { width: 40px; height: 40px; }
    .yb-main-nav, .hdr-start, body:is(.home-view-open, .pricing-view-open):not(.is-signed-in) .hdr-start { display: none; }
    .yb-burger { display: inline-flex; }
    .yb-drawer {
        display: block; position: fixed; left: 0; right: 0; top: var(--app-header-height, 60px); z-index: 449;
        max-height: 0; overflow: hidden; visibility: hidden;
        background: rgba(var(--chrome-bg-rgb), .97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        transition: max-height .35s var(--ease-in-out), visibility 0s linear .35s;
    }
    .yb-drawer.nav-open {
        max-height: 520px; visibility: visible; transition: max-height .35s var(--ease-out), visibility 0s;
        border-bottom: 1px solid var(--color-border); box-shadow: 0 24px 48px -24px rgba(49, 52, 41, .25);
    }
    .yb-drawer-inner { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 20px 24px; }
    .yb-d-link {
        background: none; border: 0; padding: 6px 0; text-align: left; cursor: pointer; color: var(--color-text);
        font-family: var(--font-head); font-weight: 400; font-size: 36px; line-height: 1.2; letter-spacing: -.02em;
    }
    :root:lang(zh) .yb-d-link, :root:lang(ja) .yb-d-link, :root:lang(ko) .yb-d-link { font-family: var(--font-sans); font-weight: 500; font-size: 26px; line-height: 1.5; letter-spacing: .01em; }
    .yb-d-actions { display: flex; gap: 10px; margin-top: 20px; align-self: stretch; }
    .yb-d-actions > * { flex: 1; justify-content: center; height: 52px; min-height: 52px; padding: 0 16px; white-space: nowrap; }
    body.is-signed-in .yb-d-actions { display: none; }
    
    body:not(.is-signed-in) .app-header .account-menu-wrap { display: none; }
    
    .app-header .auth-btn-label { display: none; }
}
@media (max-width: 640px) {
    .app-header .theme-toggle-btn { display: inline-flex; }
}


.home-cta {
    font-family: var(--font-mono); font-size: 12.5px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    box-shadow: none; transition: transform var(--dur-base), background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}
.home-cta:hover { background: var(--accent-fill-hover); box-shadow: none; transform: translateY(-1px); }
.btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 28px; cursor: pointer;
    border: 1.5px solid var(--color-text); border-radius: 999px; background: transparent; color: var(--color-text);
    font-family: var(--font-mono); font-size: 12.5px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
    transition: transform var(--dur-base), background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}
.btn-outline:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); transform: translateY(-1px); }
:root:lang(zh) :is(.home-cta, .btn-outline, .hdr-start) { letter-spacing: .04em; }


.yb-rv { opacity: 0; transform: translateY(var(--rise-lg)); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out) !important; }
.yb-rv.yb-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .yb-rv { opacity: 1; transform: none; transition: none !important; }
    .home-cta:hover, .btn-outline:hover, .hdr-start:hover { transform: none; }
    .app-header .account-menu, .app-header .custom-select-list { animation: none; }
    .yb-drawer, .yb-drawer.nav-open, .yb-burger span, .yb-burger span::before, .yb-burger span::after { transition: none; }
}


.avatar-initial {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: #EAD7F2; color: #313429; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; line-height: 1;
}
.avatar-initial[hidden] { display: none; }
:root:not([data-theme="linen"]) .avatar-initial { color: #1F2219; }
body.is-signed-in .app-header .auth-signin-icon { display: none !important; }

@media (min-width: 821px) {
    .app-header.is-tight .header-lang .custom-select-trigger-label, .app-header.is-tight .header-lang .custom-select-caret,
    .app-header.is-tight .auth-btn-label { display: none; }
    .app-header.is-tight .header-lang .custom-select-trigger, .app-header.is-tight #auth_button { width: 40px; padding: 0; justify-content: center; gap: 0; }
    html body .app-header.is-tighter .hdr-start { display: none; }
}


.skip-link { position: fixed; top: 8px; left: 8px; z-index: 10000; padding: 10px 16px; border-radius: 999px; background: #313429; color: #FCF8F0; font-size: 14px; font-weight: 600; text-decoration: none; transform: translateY(-200%); }
.skip-link:focus, .skip-link:focus-visible { transform: none; outline: 2px solid #ECFC91; outline-offset: 2px; }
main:focus { outline: none; }

[role="dialog"][aria-modal="true"]:focus { outline: none; }
