html {
    font-size: 62.5%;
}

a {
    text-decoration: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.7;
    font-size: 1.6rem;
}


main .a {
    color: var(--link);
    transition: 0.5s;
    background: var(--bg-history-item);
    padding: 8px 12px;
}

main .a:hover {
    color: var(--link-hover);
    opacity: 0.5;
}

main ul {
    padding-left: 0;
}

main li {
    list-style: none;
    margin: 2px;
    padding: 0;
}

main li .a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 12px;
    background: var(--bg-history-item);
    color: var(--text);
    transition: background .3s, color .3s;
}

.top-header {
    padding: 0px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

body.focus-mode .top-header {


    position: unset;

}

.logo-img {
    height: 40px;
}

.site-title {
    margin: 0
}

/* 通常ロゴ */
.logo-img {
    content: url('/assets/img/logo_wakuwaku_dark.png');
    height: 50px;
    display: block;
}

/* ダークモード用ロゴ */
body[data-theme="dark"] .logo-img {
    content: url('/assets/img/logo_wakuwaku.png');
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.subjects h1 {
    padding: 15px;
    margin: 30px 0 20px;
    font-size: 2.8rem;

}

.pre-school h1 {
    border-left: 8px solid var(--pre-school-c);
}

.japanese h1 {
    border-left: 8px solid var(--japanese-c);
}

.math h1 {
    border-left: 8px solid var(--math-c);
}

.science h1 {
    border-left: 8px solid var(--science-c);
}

.social h1 {
    border-left: 8px solid var(--social-c);
}

.english h1 {
    border-left: 8px solid var(--english-c);
}

.subjects h2 {
    font-size: 24px;
    color: var(--h2);

    padding-left: 10px;

}

.subjects h2:nth-of-type(1) {
    border-left: 8px solid var(--pastel-orange);
    /* 例：3つ目のh2を赤色にする */
}

.subjects h2:nth-of-type(2) {
    border-left: 8px solid var(--pastel-green);
    /* 例：3つ目のh2を赤色にする */
}

.subjects h2:nth-of-type(3) {
    border-left: 8px solid var(--pastel-blue);
    /* 例：3つ目のh2を赤色にする */
}

.subjects h2:nth-of-type(4) {
    border-left: 8px solid var(--pastel-pink);
    /* 例：3つ目のh2を赤色にする */
}

.subjects h2:nth-of-type(5) {
    border-left: 8px solid var(--pastel-purple);
    /* 例：3つ目のh2を赤色にする */
}

.subjects h2:nth-of-type(6) {
    border-left: 8px solid var(--pastel-yellow);
    /* 例：3つ目のh2を赤色にする */
}

/* 共通スタイル：丸み＋パステル＋ふわ影 */
@media (max-width: 1000px) {
    .subjects h1 {
        font-size: 2rem;
        line-height: 1.4;
    }

    .subjects h2 {
        font-size: 1.8rem;
        line-height: 1.5;
    }

    .subjects h3 {
        font-size: 1.5rem;
        line-height: 1.5;
    }
}

.focus-btn,
.theme-btn,
.hamburger-btn {
    background: var(--bg);
    /* ふんわりピンク */
    border: none;
    border-radius: 12px;
    /* ゆるい丸み */
    padding: 10px 14px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(255, 182, 193, 0.4);
    /* やさしい影 */
    transition: all 0.25s ease;
    color: var(--text);
}

/* ホバー時：ふわっと浮く */
.focus-btn:hover,
.theme-btn:hover,
.hamburger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(255, 182, 193, 0.45);
    background: var(--button-hover-bg);
}

/* 押したとき：ぷにっと沈む */
.focus-btn:active,
.theme-btn:active,
.hamburger-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(255, 182, 193, 0.35);
}

/* アイコンを少し大きめにして可愛さアップ */
.focus-btn,
.theme-btn,
.hamburger-btn {
    font-size: 20px;
}

@media (max-width: 1000px) {
    .hamburger-btn {
        display: block;
    }
}

.hamburger-btn.active {
    transform: rotate(90deg);
}

.container {
    display: flex;
    min-height: 100vh;
    transform: translateX(0);
    transition: transform .3s ease;
    position: relative;
}

@media (max-width: 1000px) {
    .container {
        display: flex;
        min-height: 100vh;
        flex-direction: column;
    }
}

/* 左サイドバー */
.sidebar {
    width: 240px;
    background: var(--bg-sub);
    transition: transform .3s ease;
    z-index: 200;
}

body.focus-mode .sidebar {
    transform: translateX(-260px) !important;
    opacity: 0;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
    height: 0;
}

.sidebar.open {
    transform: translateX(0);
    transition: transform .3s ease;
}

/* スマホ：スライドイン */
@media (max-width: 1000px) {
    .sidebar {
        position: fixed;
        top: 0px;
        left: 0;
        height: 100%;
        transform: translateX(-260px);
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

/* メイン */
.content {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}



@media (max-width: 1000px) {
    .content {
        order: 2;
        padding: 15px 10px;
        width: 100%;
    }
}

/* 右スペース */
.right-space {
    width: 240px;
    background: var(--bg-sub);
    padding: 20px;
    min-height: 500px;
    overflow-y: auto;
}

@media (max-width: 1000px) {
    .container {
        display: flex;
        flex-wrap: wrap;
    }


    .right-space {
        width: 100%;
    }
}

/* スマホ：下へ */
@media (max-width: 1000px) {
    .right-space {
        width: 100%;
        order: 3;
        min-height: auto;
    }
}

/* 集中モード：縦並び */
body.focus-mode .container {
    flex-direction: column;
}

body.focus-mode .content {
    order: 1;
    max-width: 1000px;
    width: 100%;

}

body.focus-mode .right-space {

    order: 2;
    width: 99%;
    margin: 0 auto 40px;
    max-width: 1000px;
    min-height: auto;
}

@media (max-width: 1000px) {
    .focus-btn {
        display: none;
    }
}

#menuArea {
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    position: sticky;
    top: 51px;
}

.menu-group {
    position: relative;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--menu-bg);
    color: var(--menu-text);
    font-weight: bold;
    cursor: pointer;
}

body[data-theme="dark"] .menu-header,
body[data-theme="dark"] .menu-header-wrapper,
body[data-theme="dark"] .menu-item {
    background: var(--menu-bg-dark);
}

.menu-home {
    display: block;
    background: aliceblue;
    margin-bottom: 5px;
}

.arrow {
    margin-left: auto;
    font-size: .8rem;
    color: var(--menu-arrow);
}

/* 子メニュー：初期は閉じる */
.menu-children {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: max-height .3s ease;
    display: none;
}

/* 開いたとき */
.menu-group.open .menu-children {
    max-height: 500px;
    /* 子要素より大きければOK */
    padding: 0;
    border-radius: 6px;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}

.menu-overlay {
    display: none;
}

.menu-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--menu-bg);
    margin-bottom: 5px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    color: var(--menu-arrow);
}

.menu-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    display: flex;
    flex-direction: column;
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 4px;
    /* 初期状態では枠も余白も消す */
    padding: 0;
    border: none;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}

.menu-item {
    color: var(--text);
    border: solid 3px #ddd;
    margin: 0 0 5px;
    background: var(--menu-bg);

    border-radius: 18px;
}

/* 子メニューの文字色（ダーク） */
body[data-theme="dark"] .menu-item {
    color: var(--text-sub);
}

.menu-toggle {
    background: var(--bg-sub);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 6px;
    transition: background .2s, transform .2s;
}

/* ホバーでふわっと */
.menu-toggle:hover {
    background: var(--menu-bg);
    transform: scale(1.1);
}

/* ダークモード */
body[data-theme="dark"] .menu-toggle {
    background: var(--bg-sub);
    border-color: var(--border);
}

/* ▼アイコン */
.arrow {
    font-size: 1.4rem;
    color: var(--menu-arrow);
    transition: transform .3s ease;
}

/* 開いたときの回転 */
.menu-group.open .arrow {
    transform: rotate(180deg);
}

@media (max-width: 1000px) {
    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 150;
        display: none;
    }

    .menu-overlay.show {
        display: block;
    }
}

.breadcrumb {
    padding: 6px 16px;
    font-size: 1.2rem;
    color: var(--text-sub);
    background: var(--breadcrumb-bg);
    /* 背景なし */
    border-bottom: 2px solid var(--border-light);
}

.breadcrumb ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li::after {
    content: ">";
    margin: 0 4px;
    color: var(--text-sub);
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

/* 最後の項目だけ太字 */
.breadcrumb li:last-child span {
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* スマホではさらに控えめに */
@media (max-width: 1000px) {
    .breadcrumb {
        font-size: 1rem;
        padding: 4px 12px;
    }

    .breadcrumb ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        /* スマホでスムーズに */
    }

    .breadcrumb li {
        flex-shrink: 0;
        /* つぶれ防止 */
    }
}

.footer {
    color: var(--text);
    padding: 60px 20px 20px;
    font-family: sans-serif;
    background-color: var(--footer-bg);
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--footer-bg) var(--footer-image) no-repeat center / contain;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    margin-top: 2px;
}

.footer-links h3 {
    font-size: 1.7rem;
    margin-bottom: 15px;
    color: var(--text);
    /* ダークモード時はメディアクエリで調整 */
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    text-decoration: none;
    color: inherit;
    font-size: 1.6rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 20px;
    font-size: 1.6rem;
}

@media (max-width: 1000px) {
    .footer {
        background: var(--footer-bg) none;
    }
}

/* --- 全体 --- */
.chat-row {
    display: flex;
    align-items: flex-end;
    margin: 20px 0;
    width: 100%;
}

.chat-row.left {
    justify-content: flex-start;
}

.chat-row.right {
    justify-content: flex-end;
}

.chat-row.center {
    justify-content: center;
}

/* --- アイコン --- */
.icon-box {
    width: 60px;
    display: flex;
    flex-shrink: 0;
}

.chara-img {
    width: 60px;
    height: auto;
}

/* --- 吹き出し --- */
.fukidashi {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 20px;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    /* ▼ ここが重要 */
    background: var(--bubble-bg);
    color: var(--bubble-text);
}

.left .fukidashi {
    margin-left: 11px;
}

.right .fukidashi {
    margin-right: 11px;
}

.chat-row.left .fukidashi::after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: -19px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: var(--bubble-bg);
}

/* 右三角 */
.chat-row.right .fukidashi::after {
    content: "";
    position: absolute;
    bottom: 18px;
    right: -19px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: var(--bubble-bg);
}

/* ▼ ナレーション */
.row-narration .fukidashi {
    text-align: center;
    border-radius: 12px;
    font-style: italic;
    max-width: 80%;
    padding: 12px 16px;
}

/* --- スマホ --- */
@media (max-width: 600px) {
    .fukidashi {
        max-width: 85%;
        font-size: 15px;
    }

    .icon-box {
        width: 45px;
    }

    .chara-img {
        width: 45px;
    }
}

.report-request {
    margin: 20px 0;
    text-align: center;
}

.report-box {
    background: #fff4e1;
    /* 優しい黄色 */
    border: 2px dashed #ff9800;
    border-radius: 15px;
    padding: 15px;
    display: inline-block;
}

.report-msg {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
}

.report-btn {
    display: inline-block;
    background: #ff9800;
    /* マナブくんカラー */
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 0 #e68a00;
    transition: 0.2s;
}

.report-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #e68a00;
}