:root{--web-banner-height:0px;--web-answer-height:90px;--web-surface:#fff;--web-text:#152b3f;--web-muted:#546879;--web-line:#dbe4eb;--web-link:#195c8d}
[hidden]{display:none!important}
body.has-web-banner{--web-banner-height:92px}
.web-badge{display:inline-block;background:#fff;color:#174d73;padding:6px 12px;border-radius:999px;font-weight:800;font-size:12px;margin-top:14px}
.web-note{font-size:13px;line-height:1.8;color:var(--web-muted);margin:0 0 14px}
.web-intro{background:#eaf3fa;border:1px solid #cddfea;border-radius:14px;padding:16px;line-height:1.8;color:#234e6b}
.web-links{display:flex;flex-wrap:wrap;gap:12px;font-size:13px;line-height:1.8;margin-top:16px}
.web-links a{color:var(--web-link);text-decoration:underline;text-underline-offset:3px}
.locked-feature,.locked-year{appearance:none;display:block;width:100%;position:relative;opacity:1!important;background:#e9edf0!important;color:#626f79!important;box-shadow:none!important;border:1px solid #d6dfe5!important;text-align:left;cursor:pointer}
.locked-feature:hover,.locked-year:hover{background:#dfe6eb!important;border-color:#b4c3cf!important}
.locked-feature:focus-visible,.locked-year:focus-visible{outline:3px solid #417eaf;outline-offset:3px}
.locked-feature small,.locked-year small{color:#687782!important;font-size:12px;display:block;margin-top:7px}
.web-feature-grid{display:grid;gap:12px}
.web-lock-heading{font-size:16px;margin:24px 0 12px;color:var(--web-text)}
.web-upgrade{margin:20px 0;background:#fff8eb;border:1px solid #efd8ae;border-radius:16px;padding:19px;color:#4b3b28;line-height:1.8}
.web-upgrade h2,.web-upgrade h3{font-size:20px;line-height:1.5;margin:0 0 10px;color:inherit}
.web-upgrade .price{font-size:26px;font-weight:900;margin:12px 0 2px}
.web-upgrade .fine{font-size:12px;line-height:1.8}
.web-upgrade a{color:#1c5b85}
.store-status{font-size:13px;margin-top:12px;color:#65543d}
.store-link{display:block;text-align:center;text-decoration:none}
.web-upgrade-flow{padding-left:1.4em;font-size:14px}
.web-end-early{font-size:13px;background:none;border:0;color:var(--web-muted);text-decoration:underline;padding:12px;cursor:pointer}
.web-explanation-link{font-size:13px;display:block;margin-top:20px;color:var(--web-link)}
.web-completion-notice{background:#fff6dd;border:1px solid #e7cd88;border-radius:14px;padding:18px;line-height:1.7;margin-top:16px}
.web-answer{font-weight:900;font-size:20px}
.web-banner{position:fixed;z-index:350;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,700px);height:calc(92px + env(safe-area-inset-bottom));background:#f0f3f5;border-top:1px solid #d3dce3;padding:6px 12px calc(8px + env(safe-area-inset-bottom));text-align:center;box-sizing:border-box}
.ad-label{font-size:10px;line-height:16px;color:#6b7883;letter-spacing:.08em;margin:0 0 4px}
.ad-content{height:60px;max-width:100%;overflow:hidden}
body[data-subject-theme] #upgradeModal{bottom:0;z-index:400}
body[data-subject-theme] #upgradeModal .sheet{max-height:calc(100dvh - 40px)}
body.has-web-banner .web-fixed-nav{display:none}
body.web-dialog-open .web-fixed-nav,body.web-upgrade-open .web-banner{visibility:hidden}
body[data-subject-theme] .hero .web-badge{position:relative;z-index:1}
body[data-subject-theme] .qText img,body[data-subject-theme] #figureHost img,body[data-subject-theme] #modalBody img{max-width:100%;height:auto}
.web-seo-body{height:auto!important;min-height:100vh;overflow:auto!important;background:#eef3f7;color:var(--web-text);font-family:-apple-system,BlinkMacSystemFont,'Yu Gothic','Meiryo',sans-serif;line-height:1.8;margin:0}
.web-seo-body .app{height:auto!important;min-height:100vh;overflow:visible!important;max-width:900px;background:transparent;box-sizing:border-box}
.web-document{max-width:900px;margin:auto;padding:24px 22px 70px;box-sizing:border-box}
.web-document .document-header{background:#183e5b;color:#fff;border-radius:18px;padding:26px;margin:10px 0 24px}
.web-document h1{font-size:clamp(23px,4vw,32px);line-height:1.5;margin:0 0 8px}
.web-document h2{font-size:22px;line-height:1.5;margin-top:30px}
.web-document .question-paper,.web-document .answer-paper{padding:24px;background:#fff;border:1px solid #dbe5ed;border-radius:16px;margin:20px 0}
.web-document img{max-width:100%;height:auto}
.web-document .question-list{padding-left:24px}
.web-document .question-list li{margin:10px 0}
.web-document a{color:var(--web-link);text-underline-offset:3px}
.web-document .primary-link{display:inline-block;padding:14px 22px;background:#1a638e;color:#fff;border-radius:12px;text-decoration:none;font-weight:800;margin:10px 10px 10px 0}
.web-document table{max-width:100%;border-collapse:collapse}
.web-document th,.web-document td{border:1px solid #d8e1e8;padding:8px}
.web-document .inlineChoices{margin:20px 0}
.web-document .inlineChoice{margin:12px 0;overflow-x:auto}
.web-document .source-note{font-size:12px;color:var(--web-muted);margin-top:24px}
.web-document footer{font-size:13px;border-top:1px solid #d6e2eb;margin-top:28px;padding-top:18px}
.web-document .score-big{font-size:36px;font-weight:900;color:#1a567e}
body.has-web-banner .web-document{padding-bottom:150px}
.app-version-free{text-align:center;font-size:11px;color:var(--web-muted);margin:18px}
html[data-color-mode=dark]{--web-surface:#111;--web-text:#e5ebef;--web-muted:#a5b4be;--web-line:#3c4852;--web-link:#9dd4ff}
html[data-color-mode=dark] .locked-feature,html[data-color-mode=dark] .locked-year{background:#252b30!important;color:#b2bec7!important;border-color:#3d4851!important}
html[data-color-mode=dark] .web-intro{background:#132b3c;color:#d0e8f9;border-color:#33516a}
html[data-color-mode=dark] .web-upgrade{background:#2b2419;color:#f2e1c3;border-color:#665334}
html[data-color-mode=dark] .web-banner{background:#141a1e;border-color:#3d4851}
html[data-color-mode=dark] .web-document .question-paper,html[data-color-mode=dark] .web-document .answer-paper{background:#111;border-color:#3b4851}
html[data-color-mode=dark] .web-seo-body{background:#05080a}
@media(max-width:480px){.web-document{padding:14px 14px 65px}.web-document .question-paper,.web-document .answer-paper{padding:17px}.web-document .document-header{padding:21px 18px}.web-banner{width:100%}.web-upgrade h2{font-size:18px}}

/* Free-edition additions preserve the supplied subject layouts and controls. */
.premium-crown{display:block;width:24px;height:24px;color:#be8b20;flex:none}
body[data-subject-theme] .screen:not(#quizScreen) .locked-feature{background:#e4e9ed!important;color:#65737e!important;border-color:#cdd7df!important;box-shadow:none!important;opacity:1!important}
body[data-subject-theme] .screen:not(#quizScreen) .locked-feature small{color:#687985!important}
body[data-subject-theme] .locked-feature .menu-icon{color:#7a8c99!important}
body[data-subject-theme] .locked-feature>.premium-crown{position:absolute;top:19px;right:16px;width:22px;height:22px}
body[data-subject-theme] .screen:not(#quizScreen) .locked-feature:hover{background:#dae2e8!important;border-color:#9fb2c1!important}
body[data-subject-theme] #pastMenuScreen .locked-feature,body[data-subject-theme] #yearMenuScreen .locked-feature{padding-right:46px!important}
body[data-subject-theme] #homeScreen .locked-feature .menu-label{padding-right:6px}
body[data-subject-theme] #homeScreen .web-badge{margin-top:12px;padding:4px 9px;font-size:11px;font-weight:600;line-height:1.6;background:#ffffff20;color:#fff;border:1px solid #ffffff45;border-radius:4px;text-shadow:none;letter-spacing:0}
.web-home-info,.web-full-row{grid-column:1/-1;min-width:0}
.web-home-info .web-upgrade{margin:12px 0 20px}
.web-upgrade{background:#fffdf7;border:1px solid #dfcfaa;border-radius:8px;padding:20px 22px;margin:24px 0;font-family:-apple-system,BlinkMacSystemFont,"Yu Gothic",Meiryo,sans-serif;font-size:14px;line-height:1.8;color:#364759}
.upgrade-heading{display:flex;align-items:center;gap:10px}
.web-upgrade h2{font-size:18px;line-height:1.5;margin:0;font-weight:700}
.web-upgrade p{margin:8px 0}
.web-upgrade .price{font-size:27px;line-height:1.4;color:#293c50;margin-top:14px}
.web-upgrade .price span{font-size:14px;font-weight:600}
.web-upgrade .upgrade-payment{margin-top:2px;font-size:12px;color:#67727b}
.web-upgrade .app-product-name{font-size:13px;font-weight:700;margin-bottom:4px}
.web-upgrade .fine{font-size:11px;line-height:1.8;color:#697680;margin-top:12px}
.web-upgrade .store-status{margin:4px 0;font-size:12px;color:#747d84}
.web-upgrade-flow{padding-left:1.4em;line-height:1.8;margin:16px 0}
.app-product-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
.app-product-links>div{border-top:1px solid #e8dfc9;padding-top:10px}
.web-links{gap:8px 16px;font-size:12px;line-height:1.8}
.web-links a{display:inline-flex;align-items:center;min-height:32px}
.web-fixed-nav{bottom:auto;left:auto;transform:none;width:auto;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
body.web-dialog-open .web-fixed-nav,body.web-dialog-open #counterWrap,body.web-dialog-open #appMenuButton{visibility:hidden}
body[data-subject-theme] #upgradeModal .sheet{width:min(560px,100%);font-family:inherit;padding:20px;border-radius:14px;overscroll-behavior:contain}
body[data-subject-theme] #upgradeModal .sheetTop{display:flex;align-items:flex-start;gap:14px;top:-20px;background:var(--web-surface);padding:14px 0 12px}
body[data-subject-theme] #upgradeTitle{font-size:18px;line-height:1.6;flex:1}
body[data-subject-theme] #upgradeCloseBtn{flex:none;min-height:44px;padding:8px 14px}
body[data-subject-theme] #upgradeFeatureText{font-size:14px;line-height:1.8;margin:10px 0}
body[data-subject-theme] #upgradeModal .web-upgrade{margin:14px 0 0;padding:16px}
.locked-menu-link{color:#697a87!important;gap:12px;background:#eff2f5}
.locked-menu-link .premium-crown{margin-left:auto;width:20px;height:20px}
body[data-page=subject] .web-banner{width:min(430px,100%)}
@media(min-width:700px){body[data-page=subject] .web-banner{width:min(760px,calc(100vw - 48px))}}
@media(min-width:1100px){body[data-page=subject] .web-banner{width:min(960px,calc(100vw - 72px))}}
html[data-color-mode=dark] body[data-subject-theme] .screen:not(#quizScreen) .locked-feature{background:#293139!important;color:#c4cdd4!important;border-color:#45535e!important}
html[data-color-mode=dark] body[data-subject-theme] .screen:not(#quizScreen) .locked-feature small{color:#acbbc5!important}
html[data-color-mode=dark] .web-upgrade{background:#25251f;color:#e2e9ed;border-color:#655d43}
html[data-color-mode=dark] .web-upgrade .price{color:#f1e5c9}
html[data-color-mode=dark] .web-upgrade :is(.fine,.upgrade-payment,.store-status){color:#b7c3ca}
html[data-color-mode=dark] .locked-menu-link{background:#242d35;color:#c6d1d9!important}
@media(max-width:480px){.web-upgrade{padding:16px}.web-upgrade h2{font-size:16px}.app-product-links{grid-template-columns:1fr;gap:10px}body[data-subject-theme] #upgradeModal .sheet{padding:16px}body[data-subject-theme] #upgradeModal .sheetTop{top:-16px}body[data-subject-theme] #upgradeTitle{font-size:16px}.web-upgrade .fine{font-size:11px}}

/* Public site: compact navigation, readable lists, restrained promotion. */
.practice-heading,.learning-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 12px}
.practice-heading h2,.learning-heading h2{font-size:17px;font-weight:700;margin:0;color:#263b4b;line-height:1.5}
.practice-heading>span,.learning-heading>span{font-size:12px;color:#657480;white-space:nowrap}
.learning-heading{margin-top:30px}
.learning-heading>span{display:inline-flex;align-items:center;gap:5px}
.learning-heading .premium-crown{width:14px;height:14px}
.home-year-list{border:1px solid #d3dfe7;border-radius:4px;overflow:hidden}
.public-year{width:100%;display:flex;align-items:center;gap:12px;min-height:57px;padding:14px 18px;border:0;border-bottom:1px solid #e3e9ed;background:#fff;color:#205b83;font:600 16px/1.5 inherit;text-align:left;cursor:pointer}
.public-year:last-child{border-bottom:0}
.public-year>span:first-child{font-size:16px;font-weight:600;flex:1}
.public-year small{font-size:12px;font-weight:400;color:#6c7881}
.public-year .year-arrow{font-size:23px;line-height:1;color:#7b909e;margin-left:10px}
.public-year:hover{background:#f2f7fa}
.public-year:focus-visible{outline:2px solid #2579ac;outline-offset:-3px}
.practice-links{display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-top:12px}
.practice-links a,.all-years-link,.display-settings-link{appearance:none;font:400 12px/1.7 -apple-system,BlinkMacSystemFont,"Yu Gothic",Meiryo,sans-serif;border:0;background:none;box-shadow:none;color:#426a86;text-decoration:none;cursor:pointer;padding:4px 0;min-height:32px}
.practice-links a:hover,.all-years-link:hover,.display-settings-link:hover{text-decoration:underline}
.public-feature-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.display-settings-link{display:block;margin:12px 0 0 auto}
.app-notice{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:24px 0 18px;padding:20px 0;border-top:1px solid #dce3e8;border-bottom:1px solid #dce3e8;color:#354b5b;font:400 13px/1.8 -apple-system,BlinkMacSystemFont,"Yu Gothic",Meiryo,sans-serif}
.app-notice strong{font-size:14px;font-weight:600}
.app-notice p{margin:5px 0 0;color:#657480;font-size:12px}
.app-notice>a{white-space:nowrap;color:#285d80;font-size:12px}
.web-links{font-size:11px;gap:6px 16px;margin-top:8px}
.web-upgrade{background:transparent!important;border:0!important;border-top:1px solid #dce3e8!important;border-radius:0!important;padding:18px 0 0!important;margin:18px 0 0!important;color:var(--web-text)}
.web-upgrade h2{font-size:15px!important}
.web-upgrade .price{font-size:25px;margin-top:16px}
.web-upgrade .store-status{margin-top:15px;padding:10px 12px;background:#f1f4f6;color:#62727e;border-radius:3px;font-size:12px}
.web-upgrade .fine{margin-top:16px;font-size:11px}
body[data-subject-theme] #upgradeModal .sheet{box-shadow:0 12px 40px #0002!important;background:#fff!important;border-radius:6px!important;padding:24px!important;max-width:480px}
body[data-subject-theme] #upgradeModal .sheetTop{background:#fff;top:-24px;padding:0 0 12px}
body[data-subject-theme] #upgradeModal .closeBtn{background:#f0f3f5!important;color:#40596b!important;border:1px solid #d8e0e6!important;box-shadow:none!important;border-radius:4px!important;font-size:12px}
body[data-subject-theme] #upgradeTitle{font-size:18px!important}
.web-document .document-header{background:transparent;color:#23425a;border-radius:0;border-bottom:2px solid #245f86;padding:14px 0 22px;margin:0 0 24px}
.web-document .document-header>p{font-size:12px;color:#60788a}
.web-document h1{font-size:26px}
.web-document .question-paper,.web-document .answer-paper{border-radius:4px;box-shadow:none}
.web-document .primary-link{border-radius:4px;font-size:14px}
html[data-color-mode=dark] .public-year{background:#1c242b;color:#c5dfef;border-color:#3d4953}
html[data-color-mode=dark] .home-year-list{border-color:#46545f}
html[data-color-mode=dark] :is(.practice-heading,.learning-heading) h2{color:#d5e0e8}
html[data-color-mode=dark] .app-notice{color:#d5e0e8;border-color:#46545f}
html[data-color-mode=dark] .app-notice :is(p,a),html[data-color-mode=dark] :is(.practice-links a,.all-years-link,.display-settings-link){color:#acbfcd}
html[data-color-mode=dark] body[data-subject-theme] #upgradeModal .sheet,html[data-color-mode=dark] body[data-subject-theme] #upgradeModal .sheetTop{background:#20282f!important}
html[data-color-mode=dark] .web-upgrade .store-status{background:#303a42;color:#bfced8}


.web-upgrade .purchase-once{font-weight:600;margin:4px 0 12px;font-size:14px;}
a.locked-feature{text-decoration:none}

/* Feature content comes before the purchase guide. */
body[data-subject-theme] #upgradeModal .sheet{max-width:680px;overflow-y:auto}
.feature-app-label{font-size:11px;color:#687b87;margin:0 0 6px}
.feature-details h3{font-size:14px;margin:20px 0 8px;color:var(--web-text)}
.feature-topic-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;margin:0}
.feature-topic{padding:11px 0;border-top:1px solid #e1e6e9}
.feature-topic dt{font-size:14px;font-weight:700;line-height:1.6}
.feature-topic dd{margin:4px 0 0;font-size:12px;line-height:1.8;color:#647582}
.feature-use-flow{font-size:12px;line-height:1.8;padding:12px;background:#f2f6f7;margin:14px 0}
.feature-record-note{font-size:13px;line-height:1.8;border-left:3px solid #63888a;padding-left:12px}
.feature-purchase{border-top:1px solid #dce3e8;padding-top:16px;margin-top:20px}
.feature-purchase strong{font-size:20px}
.feature-purchase p{font-size:12px;line-height:1.8;margin:6px 0}
.feature-purchase .store-status{font-size:12px;padding:8px 10px;background:#f1f4f6;margin:12px 0}
.feature-purchase .fine{color:#73818a;font-size:11px}
.feature-more summary{cursor:pointer;font-size:13px;padding:12px 0;color:var(--web-text)}
html[data-color-mode=dark] .feature-topic dd{color:#bbc9d2}
html[data-color-mode=dark] :is(.feature-use-flow,.feature-purchase .store-status){background:#303a42}
@media(max-width:520px){.feature-topic-list{grid-template-columns:1fr}body[data-subject-theme] #upgradeModal .sheet{padding:18px!important}.feature-topic{padding:9px 0}.feature-details h3{margin-top:14px}}

body[data-subject-theme] #homeScreen a.home-card{text-decoration:none;box-sizing:border-box}

/* Only the ad's occupied space alters the original exercise layout. */
body.has-web-banner[data-subject-theme] #quizScreen .answerDock{bottom:calc(var(--web-banner-height) + env(safe-area-inset-bottom))!important}
body.has-web-banner[data-subject-theme] #modal{bottom:var(--web-banner-height)}
body.has-web-banner[data-subject-theme] #modal .sheet{max-height:calc(82vh - var(--web-banner-height))}
button.locked-year:disabled{cursor:default}
body[data-subject-theme] .screen:not(#quizScreen) button.locked-year:disabled:hover{background:#e4e9ed!important;border-color:#cdd7df!important}
html[data-color-mode=dark] body[data-subject-theme] .screen:not(#quizScreen) button.locked-year:disabled:hover{background:#293139!important;border-color:#45535e!important}
body[data-page=result] .app{height:auto;min-height:100vh;overflow:visible}
body[data-page=result] .app>.screen.active{display:block}
body[data-page=result] .app>.web-links{padding:20px}
#bookmarkBtn:disabled{color:#687985!important;background:#e4e9ed!important;box-shadow:none!important;cursor:default}
html[data-color-mode=dark] #bookmarkBtn:disabled{color:#acbbc5!important;background:#293139!important}
body[data-subject-theme=kiso] #modalBody .explain-support.has-support-heading::before{content:none;display:none}
