/* 左下キャラクターと、上に開くWindows風メニュー */
.ae-site-menu {--menu-blue: #24aadd; position: fixed; left: 24px; bottom: 20px; width: 230px; height: 126px; z-index: 99999; color: var(--menu-blue); font-family: var(--font-family-base, sans-serif); }
body.home:not(.ae-store-open) .ae-site-menu {
    display: none;
}
.ae-site-menu *, .ae-site-menu *::before, .ae-site-menu *::after { box-sizing: border-box; }
.ae-site-menu [hidden] { display: none !important; }
/* メニューを開いたときの背景 */
.ae-site-menu::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(10, 18, 40, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.ae-site-menu.is-open::before {
    opacity: 1;
}
.ae-site-menu__trigger {
    position: relative;
    display: block;
    width: 230px;
    height: 126px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 1;
    transform: translateY(0);
    transition: transform 240ms ease, opacity 180ms ease;
}

.ae-site-menu.is-scrolling:not(.is-open) .ae-site-menu__trigger {
    transform: translateY(180px);
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .ae-site-menu__trigger {
        transition: none;
    }
}
.ae-site-menu__character {
    position: absolute;
    width: 380px;
    height: auto;
    max-width: none;
    left: -76px;
    top: -35px;
    pointer-events: none;
    user-select: none;
    transform-origin: 50% 60%;
    transition: transform 180ms ease-out;
    filter: drop-shadow(0 7px 7px rgba(8,11,32,.22));
}
.ae-site-menu__trigger:hover { filter: drop-shadow(0 4px 5px rgba(6,75,250,.16)); }
.ae-site-menu__trigger:focus-visible { outline: 2px solid var(--menu-blue); outline-offset: 3px; border-radius: 8px; }
.ae-site-menu__panel { position: absolute; left: 0; bottom: 138px; display: flex; flex-direction: column; width: min(390px, calc(100vw - 48px)); max-height: calc(100dvh - 188px); border: 2px solid var(--menu-blue); border-radius: 9px; background: #fff; box-shadow: 0 16px 40px rgba(8,11,32,.28), 0 4px 10px rgba(8,11,32,.14); overflow: hidden; }
.admin-bar .ae-site-menu__panel { max-height: calc(100dvh - 220px); }
.ae-site-menu__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 22px;
    background-color: var(--menu-blue);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0 2px,
        rgba(255, 255, 255, .20) 2px 3px
    );
    color: #fff;
    border-bottom: 2px solid var(--menu-blue);
}
.ae-site-menu__close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 0;
    background: var(--menu-blue);
    color: #fff;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, .18);
    font: 25px/1 Arial, sans-serif;
    cursor: pointer;
}
.ae-site-menu__close:hover {
    background: #fff;
    color: var(--menu-blue);
}
.ae-site-menu__body { padding: 14px 24px 10px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-color: var(--menu-blue) #eaf2ff; scrollbar-width: thin; }
.ae-site-menu__intro {
    margin: 0 0 18px;
    color: #5c6573;
    font-size: 15px;
    line-height: 1.6;
}
.ae-site-menu__group { margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid #bcdcff; }
.ae-site-menu__group h3 { margin: 0 0 5px; color: #151a2d;font-size: 21px; line-height: 1.5; font-weight: 700; }
.ae-site-menu a {
    color: #151a2d;
    text-decoration: none;
    font-weight: 400;
}
.ae-site-menu__group a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 12px; border-radius: 5px; font-size: 18px; line-height: 1.6; }
.ae-site-menu__group a:hover, .ae-site-menu__group a:focus-visible { background: #c4ecfa; }
.ae-site-menu__group a span {
    flex: 0 0 auto;
    color: var(--menu-blue);
    font-size: 28px;
    line-height: 1;
}
.ae-site-menu__bottom { display: flex; justify-content: center; align-items: center; gap: 22px; font-size: 16px; line-height: 1.6; }
.ae-site-menu__bottom > span { color: #8fc2ff; }
.ae-site-menu :focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 600px) {
    .ae-site-menu { left: 12px; bottom: 8px; width: 180px; height: 102px; }
    .ae-site-menu__trigger { width: 180px; height: 102px; }
    .ae-site-menu__character { width: 280px; left: -56px; top: -20px; }
     .ae-site-menu__panel {
        bottom: 120px;
        width: min(350px, calc(100vw - 24px));
        max-height: calc(100dvh - 152px);
    }
    .admin-bar .ae-site-menu__panel {
        max-height: calc(100dvh - 198px);
    }
    .ae-site-menu__body { padding: 12px 18px; }
}

/* 全ページ共通：スマホのメニュー文字サイズ */
@media (max-width: 700px) {
    .ae-site-menu .ae-site-menu__bar h2 {
        margin: 0;
        color: #fff;
        font-size: 18px;
        line-height: 1.4;
    }

    .ae-site-menu .ae-site-menu__intro {
        display: none;
    }

    .ae-site-menu .ae-site-menu__group h3 {
        font-size: 15px;
        line-height: 1.5;
    }

    .ae-site-menu .ae-site-menu__group a {
        font-size: 14px;
        line-height: 1.6;
        min-height: 40px;
    }

    .ae-site-menu .ae-site-menu__group a span {
        font-size: 20px;
    }

    .ae-site-menu .ae-site-menu__bottom {
        font-size: 14px;
    }
}

/* タブレット：メニューを少しコンパクトに */
@media (min-width: 651px) and (max-width: 1100px) {
    .ae-site-menu { left: 18px; bottom: 16px; width: 180px; height: 100px; }
    .ae-site-menu__trigger { width: 180px; height: 100px; }
    .ae-site-menu__character { width: 300px; left: -60px; top: -28px; }
    .ae-site-menu__panel {
        bottom: 114px;
        width: min(320px, calc(100vw - 36px));
        max-height: calc(100dvh - 150px);
    }
    .admin-bar .ae-site-menu__panel { max-height: calc(100dvh - 196px); }
    .ae-site-menu__bar { padding: 6px 10px 6px 16px; }
    .ae-site-menu__close { width: 36px; height: 36px; }
    .ae-site-menu__body { padding: 10px 16px; }
    .ae-site-menu__intro { margin-bottom: 10px; font-size: 13px; }
    .ae-site-menu__group { margin-bottom: 10px; padding-bottom: 10px; }
    .ae-site-menu__group h3 { font-size: 17px; }
    .ae-site-menu__group a { padding: 5px 8px; font-size: 15px; }
    .ae-site-menu__group a span { font-size: 24px; }
    .ae-site-menu__bottom { gap: 16px; font-size: 14px; }
}
/* Tablet: compact shared menu panel */
@media (min-width: 651px) and (max-width: 1100px) {
  .ae-site-menu__panel { width: min(300px, calc(100vw - 36px)); }
  .ae-site-menu__bar { padding: 4px 8px 4px 14px; }
  .ae-site-menu__body { padding: 8px 14px; }
  .ae-site-menu__intro { font-size: 12px; margin-bottom: 8px; }
  .ae-site-menu__group { margin-bottom: 8px; padding-bottom: 8px; }
  .ae-site-menu__group h3 { font-size: 16px; margin-bottom: 4px; }
  .ae-site-menu__group a { font-size: 14px; padding: 4px 8px; line-height: 1.6; }
  .ae-site-menu__group a span { font-size: 22px; }
  .ae-site-menu__bottom { font-size: 13px; gap: 14px; }
}
/* 全ページ共通のハンバーガーボタン */
.ae-site-menu {
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
}

body.home:not(.ae-store-open) .ae-site-menu {
    display: block;
}

.ae-site-menu[hidden] {
    display: none !important;
}

.ae-site-menu__trigger {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #123e68;
    box-shadow: none;
}

.ae-site-menu__trigger:hover {
    background: transparent;
    color: #247ab5;
    filter: none;
}

.ae-site-menu__hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.ae-site-menu__hamburger > span {
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.ae-site-menu__panel {
    left: 0;
    bottom: 72px;
    width: min(390px, calc(100vw - 32px));
    max-height: calc(100dvh - 120px);
}

.admin-bar .ae-site-menu__panel {
    max-height: calc(100dvh - 166px);
}
@media (max-width: 650px) {
    .ae-site-menu,
    .admin-bar .ae-site-menu {
        top: var(--ae-return-admin, 0px);
        right: auto;
        bottom: auto;
        left: 0;
    }

    .ae-site-menu__panel,
    .admin-bar .ae-site-menu__panel {
        position: fixed;
        top: 0;
        bottom: auto;
        left: 0;
        z-index: 1;
        width: min(260px, 70vw);
        height: auto;
        max-height: 100dvh;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__body {
        flex: 0 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__bar {
        gap: 8px;
        padding: max(6px, env(safe-area-inset-top, 0px))
                 8px 6px
                 max(16px, env(safe-area-inset-left, 0px));
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__bar h2 {
        font-size: 17px;
        letter-spacing: 0.02em;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__body {
        padding: 12px 14px
                 max(16px, env(safe-area-inset-bottom, 0px))
                 max(14px, env(safe-area-inset-left, 0px));
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__group {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__group h3 {
        margin: 0 4px 4px;
        font-size: 11px;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__group a {
        min-height: 44px;
        padding: 8px 4px;
        font-size: 14px;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__group a span {
        font-size: 20px;
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__bottom {
        padding: 0 4px;
        font-size: 13px;
    }
}
/* 三本線の下にMENUを添える */
.ae-site-menu__trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ae-site-menu__hamburger {
    width: 26px;
    gap: 4px;
}

.ae-site-menu__label {
    font-family: Arial, "Yu Gothic", Meiryo, sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
}
@media (min-width: 1101px) {
    .ae-site-menu__hamburger {
        width: 36px;
        gap: 5px;
    }

    .ae-site-menu__label {
        font-size: 11px;
    }
}
/* 共通メニュー：一色の面と文字・細い線 */
.ae-site-menu {
    --menu-blue: #24AADD;
    --menu-background: #fff;
    --menu-text: #182338;
    --menu-line: rgb(24 35 56 / 20%);
    color: var(--menu-text);
    font-family: "Yu Gothic", Meiryo, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ae-site-menu__panel {
    border: 0;
    border-radius: 0;
    background: var(--menu-background);
    color: var(--menu-text);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}

.ae-site-menu[data-site-menu] .ae-site-menu__bar {
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top, 0px))
             16px 8px
             max(24px, env(safe-area-inset-left, 0px));
    border: 0;
    background: transparent;
    color: inherit;
}

.ae-site-menu[data-site-menu] .ae-site-menu__bar h2 {
    margin: 0;
    color: inherit;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.16em;
}

.ae-site-menu__close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font: 400 30px/1 Arial, sans-serif;
}

.ae-site-menu__close:hover {
    background: transparent;
    color: inherit;
    opacity: 0.6;
}

.ae-site-menu__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}

.ae-site-menu[data-site-menu] .ae-site-menu__body {
    min-height: 0;
    padding: 0 24px
             max(20px, env(safe-area-inset-bottom, 0px))
             max(24px, env(safe-area-inset-left, 0px));
    overflow-y: auto;
    background: transparent;
    scrollbar-color: var(--menu-line) var(--menu-background);
}

.ae-site-menu .ae-site-menu__body a {
    font-family: inherit;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.ae-site-menu[data-site-menu] .ae-site-menu__section {
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--menu-line);
    border-radius: 0;
    background: transparent;
}

.ae-site-menu__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 16px 0;
    color: inherit;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.02em;
    list-style: none;
    cursor: pointer;
}

.ae-site-menu__summary::-webkit-details-marker {
    display: none;
}

.ae-site-menu__name {
    min-width: 0;
}

.ae-site-menu__symbol {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: inherit;
    font: 400 22px/1 Arial, sans-serif;
}

.ae-site-menu__symbol::before {
    content: "+";
}

.ae-site-menu__section[open] > summary .ae-site-menu__symbol::before {
    content: "−";
}

.ae-site-menu__summary:hover {
    opacity: 0.65;
}

.ae-site-menu__children {
    padding: 0 0 20px;
}

.ae-site-menu[data-site-menu] .ae-site-menu__group a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    position: relative;
    padding: 8px 0 8px 14px;
    border-radius: 0;
    background: transparent;
    color: var(--menu-text);
    font-size: 14px;
}

.ae-site-menu[data-site-menu] .ae-site-menu__group a span {
    flex: 0 0 20px;
    color: inherit;
    font: 400 20px/1 Arial, sans-serif;
    text-align: center;
}

.ae-site-menu .ae-site-menu__children > a {
    font-weight: 500;
}

/* プルダウン内のリンクだけに中黒を付ける */
.ae-site-menu[data-site-menu] .ae-site-menu__children a::before {
    content: "・";
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    transform: translateY(-50%);
    color: var(--menu-blue);
    text-align: center;
    pointer-events: none;
}

/* 現在のページが属する大項目 */
.ae-site-menu[data-site-menu]
.ae-site-menu__section.is-current-page > .ae-site-menu__summary {
    color: var(--menu-blue);
}

/* 現在のページへのリンク */
.ae-site-menu[data-site-menu]
.ae-site-menu__children > a[aria-current="page"],
.ae-site-menu[data-site-menu]
.ae-site-menu__bottom .ae-site-menu__contact[aria-current="page"] {
    color: var(--menu-blue);
}

.ae-site-menu__page-index {
    margin: 4px 0 12px;
    padding-left: 12px;
    border: 0;
}

.ae-site-menu[data-site-menu] .ae-site-menu__page-index a {
    justify-content: flex-start;
    min-height: 40px;
    padding: 7px 0 7px 14px;
    color: var(--menu-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;
}

.ae-site-menu[data-site-menu] .ae-site-menu__group a:hover {
    background: transparent;
    color: var(--menu-text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.ae-site-menu[data-site-menu] .ae-site-menu__group a:focus-visible {
    background: transparent;
    color: var(--menu-text);
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.ae-site-menu[data-site-menu] .ae-site-menu__bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    font-size: 14px;
}

.ae-site-menu .ae-site-menu__bottom a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--menu-text);
    text-decoration: none;
}

.ae-site-menu .ae-site-menu__bottom .ae-site-menu__contact {
    justify-content: space-between;
    min-height: 68px;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--menu-line);
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
}

.ae-site-menu__contact > span:last-child {
    flex: 0 0 20px;
    font: 400 20px/1 Arial, sans-serif;
    text-align: center;
}

.ae-site-menu .ae-site-menu__bottom .ae-site-menu__town {
    justify-content: flex-start;
    min-height: 56px;
    padding: 16px 0 8px;
    font-size: 12px;
    font-weight: 400;
}

.ae-site-menu .ae-site-menu__bottom a:hover {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 650px) {
    .ae-site-menu[data-site-menu] .ae-site-menu__bar {
        padding: max(8px, env(safe-area-inset-top, 0px))
                 8px 4px
                 max(20px, env(safe-area-inset-left, 0px));
    }

    .ae-site-menu[data-site-menu] .ae-site-menu__body {
        padding: 0 20px
                 max(16px, env(safe-area-inset-bottom, 0px))
                 max(20px, env(safe-area-inset-left, 0px));
    }
}

/* スマホではページ右上の目次を表示しない */
@media (max-width: 650px) {
    body :is(
        .ae-about__floating-nav,
        .ae-consult__floating-nav,
        .ae-careers-floating-nav,
        .ae-ai__floating-nav,
        .ae-sn__floating-nav,
        .ae-numbers-nav
    ) {
        display: none;
    }}
/* 下部の共通戻るボタンを包む配置枠 */
body.ae-contact-page .ae-contact__footer,
body.ae-company-page .ae-company__footer,
body.ae-ai-page .ae-ai__bottom-nav,
body.ae-work-detail-page .ae-work-detail__footer,
body.ae-diagnosis-page .ae-diagnosis__footer,
body.ae-management-page .ae-management__back,
body.ae-recruit-page .ae-recruit__footer {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
    text-align: right;
}

/* 会社概要：配置枠の内側余白と枠線を補正 */
body.ae-company-page .ae-company__sheet {
    --ae-return-frame-inset: 41px;
}

body.ae-company-page .ae-company__footer {
    width: calc(100% + var(--ae-return-frame-inset) + var(--ae-return-frame-inset));
    margin-inline: calc(0px - var(--ae-return-frame-inset));
}

@media (max-width: 780px) {
    body.ae-company-page .ae-company__sheet {
        --ae-return-frame-inset: 17px;
    }
}

@media (max-width: 650px) {
    body.ae-company-page .ae-company__sheet {
        --ae-return-frame-inset: 0px;
    }
}

/* AIページ：末尾のお問い合わせ枠と同じ幅 */
body.ae-ai-page .ae-ai__bottom-nav {
    max-width: 1280px;
    margin-inline: auto;
}

@media (min-width: 1000px) {
    body.ae-ai-page .ae-ai__bottom-nav {
        width: calc(100% - 80px);
    }
}

@media (max-width: 780px) {
    body.ae-ai-page .ae-ai__bottom-nav {
        width: calc(100% - 16px);
    }
}

@media (max-width: 650px) {
    body.ae-ai-page .ae-ai__bottom-nav {
        width: 100%;
    }
}
