/* Math home only. Other Math pages keep the shared stylesheet. */
body { background: #fff; color: #0c2350; }
.math-main { width: min(1240px, calc(100% - 40px)); padding: 28px 0 44px; }
.math-header { background: #fff; backdrop-filter: none; }
.math-header-inner { width: min(1240px, calc(100% - 40px)); gap: 12px; }
.math-header-nav { flex: 1; justify-content: center; gap: 0; }
.math-header-nav a { padding: 0 8px; font-size: 13px; white-space: nowrap; }
.math-header-search, .math-header-all { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 700; white-space: nowrap; }
.math-header-search { min-width: 44px; background: #edf5ff; color: #0755d5; font-size: 26px; }
.math-header-all { padding: 0 16px; background: #145fea; color: #fff; font-size: 13px; gap: 8px; }
.math-header-all:hover, .math-header-all:focus-visible { background: #0648c8; color: #fff; }
.math-header-search:hover { background: #dfeeff; }
.math-intro { min-height: 390px; margin-bottom: 0; padding: 48px clamp(24px, 5vw, 64px); grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 24px; background: linear-gradient(118deg, #f3f9ff, #fbfdff 72%); border: 1px solid #e2efff; border-radius: 24px 24px 0 0; box-shadow: none; color: #0c2350; }
.math-intro::before { width: 340px; height: 340px; right: -75px; top: -170px; background: #e4f5ff; }
.math-intro::after { width: 170px; height: 170px; right: 30%; bottom: -100px; background: #eaf8f7; }
.math-intro .math-eyebrow { width: fit-content; padding: 8px 13px; border: 1px solid #c9ddff; border-radius: 999px; background: #eaf3ff; color: #0756d2; font-size: 13px; letter-spacing: 0; }
.math-intro h1 { margin: 16px 0 14px; color: #072962; font-size: clamp(36px, 4.7vw, 60px); line-height: 1.22; letter-spacing: -.045em; }
.math-catch { margin: 0 0 8px; color: #104bb4; font-size: 19px; }
.math-intro-text { max-width: 640px; margin: 0; color: #354e75; font-size: 16px; line-height: 1.8; }
.math-hero-side { min-height: 295px; display: block; position: relative; }
.math-visual-formula, .math-visual-graph, .math-visual-calc { position: absolute; border: 1px solid #e2ebf8; background: #fff; box-shadow: 0 14px 30px rgba(21, 67, 131, .12); }
.math-visual-formula { right: 4%; top: 3%; padding: 18px 22px; border-radius: 17px; color: #2053a1; font-size: 24px; font-family: Georgia, serif; transform: rotate(-6deg); }
.math-visual-graph { left: 0; top: 20%; width: 65%; padding: 15px; border-radius: 22px; transform: rotate(-5deg); }
.math-visual-graph svg { display: block; width: 100%; }
.math-visual-graph span { display: block; color: #496388; font-size: 13px; font-weight: 700; }
.math-visual-calc { right: 3%; top: 37%; width: 41%; min-height: 195px; padding: 15px; display: grid; gap: 8px; border: 7px solid #e0edff; border-radius: 22px; transform: rotate(6deg); }
.math-visual-calc > span:first-child { color: #547198; font-size: 13px; font-weight: 700; }
.math-visual-calc strong { padding: 12px 5px; border-radius: 8px; background: #123c7b; color: #fff; text-align: center; font-size: 18px; white-space: nowrap; }
.math-visual-keys { color: #195bc5; text-align: center; line-height: 1.8; font-weight: 800; }
.math-home-search { position: relative; z-index: 2; padding: 20px clamp(24px, 5vw, 64px) 24px; background: #f3f9ff; border: 1px solid #e2efff; border-top: 0; border-radius: 0 0 24px 24px; }
.math-home-search .math-search-box { max-width: 860px; }
.math-home-search label { display: block; margin-bottom: 9px; color: #173b77; font-size: 16px; font-weight: 800; }
.math-home-search input { height: 62px; padding: 0 20px; border-color: #b7d3fc; border-radius: 15px; font-size: 16px; }
.math-search-results:empty, .math-search-results[hidden] { display: none; }
.math-search-result { min-height: 55px; }
.math-search-result-title { font-size: 16px; }
.math-search-result-meta { font-size: 14px; }
.math-search-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 14px 0 0; color: #35527d; font-size: 14px; }
.math-search-examples a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid #cbdef9; border-radius: 999px; background: #fff; color: #124a9e; font-weight: 700; }
.math-search-examples a:hover, .math-search-examples a:focus-visible { background: #dcecff; }
.math-benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 28px; }
.math-benefit { min-height: 108px; display: flex; gap: 12px; align-items: center; padding: 17px; background: #f1f8ff; border-radius: 17px; }
.math-benefit:nth-child(2) { background: #eefaf6; }.math-benefit:nth-child(3) { background: #fff9ec; }.math-benefit:nth-child(4) { background: #f4f4ff; }
.math-benefit > span { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: #dceeff; color: #0755c8; font-size: 23px; font-weight: 800; }
.math-benefit:nth-child(2) > span { background: #d5f3e9; color: #007d68; }.math-benefit:nth-child(3) > span { background: #ffedca; color: #a46500; }.math-benefit:nth-child(4) > span { background: #e5e8ff; color: #3c4cbe; }
.math-benefit strong { display: block; font-size: 17px; }.math-benefit p { margin: 4px 0 0; color: #3a527b; font-size: 14px; line-height: 1.5; }
.math-section { margin-top: 18px; padding: 26px 20px 24px; border-radius: 20px; background: #f2f8ff; scroll-margin-top: 90px; }
.math-section:nth-of-type(2n) { background: #f3fbf8; }
.math-section-head { margin-bottom: 17px; }.math-section-head h2 { font-size: 26px; }.math-section-head h2::before { display: none; }
.math-section-note { margin: 6px 0 0; color: #465d81; font-size: 16px; line-height: 1.6; }
.math-section-label { display: none; }
.math-goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.math-goal-grid a { min-height: 104px; display: grid; grid-template-columns: 53px 1fr; align-content: center; column-gap: 12px; padding: 15px; border: 1px solid #e3eaf4; border-radius: 15px; background: #fff; transition: transform .15s, box-shadow .15s; }
.math-goal-grid a > span { grid-row: span 2; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 13px; background: #e9f2ff; color: #075be1; font-size: 24px; font-weight: 800; }
.math-goal-grid a:nth-child(2) > span { background: #e1f7f1; color: #087e72; }.math-goal-grid a:nth-child(3) > span { background: #fff1d9; color: #a86600; }.math-goal-grid a:nth-child(4) > span { background: #ecefff; color: #4352b8; }.math-goal-grid a:nth-child(5) > span { background: #ffe8ed; color: #bf365c; }.math-goal-grid a:nth-child(6) > span { background: #e7f5ff; color: #08739d; }
.math-goal-grid strong { align-self: end; font-size: 17px; }.math-goal-grid small { align-self: start; margin-top: 3px; color: #52698c; font-size: 14px; }
.math-goal-grid a:hover, .math-goal-grid a:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17, 69, 129, .1); }
.math-intent-search { margin-top: 16px; padding: 17px; border: 1px solid #dbe6f5; box-shadow: none; }
.math-intent-search label { font-size: 16px; }.math-intent-search input { font-size: 16px; }
.math-intent-result-title { font-size: 16px; }.math-intent-result-meta { font-size: 14px; }
.category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }.category-box { min-height: 0; padding: 21px; border-color: #e1eaf4; box-shadow: none; }
.category-box::before { display: none; }.category-box h3 { font-size: 19px; }.category-box-head p { font-size: 15px; }.category-mark { width: 48px; height: 48px; }.category-mark svg { width: 26px; height: 26px; }
.category-links a { min-height: 44px; padding: 8px 13px; background: #f8fbff; color: #193d78; font-size: 15px; border-radius: 10px; }.category-links a:hover, .category-links a:focus-visible { background: var(--category-soft); }
#frequent-tools { background: #f3fbf8; }.tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.tool-card { min-height: 106px; padding: 18px 52px 18px 17px; box-shadow: none; }.tool-card-title { font-size: 17px; }.tool-card-description { margin-top: 5px; font-size: 15px; }.tool-card-arrow { right: 14px; bottom: 50%; transform: translateY(50%); }
.tool-card:hover .tool-card-arrow { transform: translate(3px, 50%); }
.math-schools { background: #fff6f6 !important; }.school-grid { gap: 12px; }.school-card { min-height: 100px; padding: 18px; border-radius: 15px; }.school-card::before { display: none; }.school-card-title { font-size: 20px; }.school-description { margin-top: 8px; color: #405879; font-size: 15px; }
.math-about { margin-top: 18px; padding: 28px; border: 1px solid #ddeeff; border-radius: 20px; background: #edf7ff; scroll-margin-top: 90px; }.math-about h2 { font-size: 25px; }.math-about-text p { color: #355077; font-size: 16px; line-height: 1.75; }
a:focus-visible, input:focus-visible { outline: 3px solid #0a5de2; outline-offset: 3px; }
@media (max-width: 1080px) { .math-header-inner { flex-wrap: wrap; padding: 8px 0; }.math-header-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; justify-content: flex-start; }.math-header-nav a { min-height: 44px; flex: 0 0 auto; }.math-header-search { margin-left: auto; } }
@media (max-width: 800px) { .math-intro { grid-template-columns: 1fr; padding: 34px 26px; }.math-hero-side { min-height: 240px; max-width: 440px; width: 100%; justify-self: center; }.math-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }.math-goal-grid, .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.category-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .math-main { width: min(100% - 20px, 1240px); padding-top: 12px; }.math-header-inner { width: min(100% - 20px, 1240px); }.math-brand-main { font-size: 21px; }.math-header-all { padding: 0 10px; font-size: 13px; }.math-header-all-label { display: none; }.math-header-all::before { content: "全ツール"; }.math-header-nav { gap: 4px; }.math-header-nav a { padding: 0 9px; font-size: 13px; }.math-intro { padding: 27px 20px; border-radius: 18px 18px 0 0; }.math-intro h1 { font-size: clamp(32px, 9vw, 42px); }.math-catch { font-size: 17px; }.math-intro-text { font-size: 16px; }.math-hero-side { min-height: 210px; }.math-visual-formula { font-size: 18px; padding: 12px; }.math-visual-calc { top: 30%; min-height: 160px; padding: 8px; border-width: 5px; }.math-visual-calc strong { font-size: 13px; }.math-visual-keys { font-size: 12px; }.math-home-search { padding: 20px; border-radius: 0 0 18px 18px; }.math-search-examples { font-size: 13px; }.math-benefits { gap: 8px; }.math-benefit { min-height: 110px; padding: 10px; gap: 8px; align-items: flex-start; flex-direction: column; }.math-benefit > span { width: 36px; height: 36px; font-size: 18px; }.math-benefit strong { font-size: 16px; }.math-benefit p { font-size: 14px; }.math-section { padding: 22px 12px; }.math-section-head h2 { font-size: 23px; }.math-goal-grid, .tool-grid, .school-grid { grid-template-columns: 1fr; }.math-goal-grid a { min-height: 83px; }.tool-card { min-height: 88px; padding: 16px 54px 16px 15px; }.tool-card-title { font-size: 17px; }.tool-card-description { font-size: 15px; }.category-box { padding: 16px; }.category-links a { font-size: 15px; }.math-about { padding: 22px; }.math-about-inner { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .math-goal-grid a { transition: none; } }
