/* 颜色变量已迁移至 ../shared/kanau-tokens.css，此处不再重复定义，
   避免覆盖共享的品牌色。如需新增变量，请加到 kanau-tokens.css 里。 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 14% 12%, rgba(130, 168, 154, 0.18), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(212, 163, 115, 0.12), transparent 28%),
        linear-gradient(135deg, #fbfaf7, #eee5d8);
    color: var(--text-main);
    font-family: var(--kanau-font-body);
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

img,
svg,
canvas {
    max-width: 100%;
}

.kanau-card {
    background: rgba(255, 255, 255, 0.94);
    border: 2px solid #d7d0c5;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(83, 78, 70, 0.08);
}

.kanau-grid-paper {
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        rgba(255, 255, 255, 0.94);
    background-size: 24px 24px;
}

.kanau-pill-button {
    align-items: center;
    background: #fffdf7;
    background: rgba(255, 253, 247, 0.84);
    border: 2px solid #d7d0c5;
    border-radius: 999px;
    color: #4d7555;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    text-decoration: none;
}

.kanau-pill-button:hover {
    border-color: #7f9a82;
}

.kanau-common-demo {
    margin: 24px auto;
    max-width: 520px;
    padding: 24px;
}

.kanau-common-demo-link {
    min-height: 38px;
    padding: 0 16px;
}

.kanau-visually-hidden {
    clip: rect(0 0 0 0);
    border: 0;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}


/* Home screen */
/* 颜色变量已迁移至 ../shared/kanau-tokens.css，此处不再重复定义，
   避免覆盖共享的品牌色。如需新增变量，请加到 kanau-tokens.css 里。 */

body {
    font-family: var(--kanau-font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    text-align: center;
    width: 100%;
}

#home-app {
    margin: 0 auto;
    max-width: 520px;
    min-height: 100vh;
    padding: 18px 22px 120px;
    width: 100%;
}

body.data-hub-wide {
    max-width: none;
}

body.data-hub-wide #home-app {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.home-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr 42px;
    align-items: center;
    margin-bottom: 22px;
    min-height: 42px;
}

.kanau-home-btn {
    background: transparent;
    border: none;
    grid-column: 2;
    color: #484b47;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0;
    margin: 0;
    padding: 0;
}

.kanau-home-btn:hover {
    color: var(--primary);
}

.page-kanau-btn {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: left;
}

.topbar-language {
    grid-column: 1;
    background: rgba(255, 253, 247, 0.84);
    border: 2px solid #d7d0c5;
    border-radius: 999px;
    color: #555a53;
    font-size: 11px;
    font-weight: 800;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 9px;
}

.language-globe {
    border: 2px solid currentColor;
    border-radius: 50%;
    display: inline-block;
    height: 12px;
    position: relative;
    width: 12px;
}

.language-globe::before,
.language-globe::after {
    content: "";
    position: absolute;
}

.language-globe::before {
    border-left: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    border-radius: 50%;
    inset: -2px 3px;
}

.language-globe::after {
    border-top: 1.5px solid currentColor;
    left: -2px;
    right: -2px;
    top: 5px;
}

.topbar-language select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, currentColor 50%) right 3px center / 5px 5px no-repeat,
        linear-gradient(135deg, currentColor 50%, transparent 50%) right 0 center / 5px 5px no-repeat;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    min-width: 62px;
    outline: none;
    padding: 2px 12px 2px 0;
}

.topbar-calendar {
    grid-column: 4;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    justify-self: end;
    color: #8d958a;
}

.topbar-calendar svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Data hub page */
.memory-page-header {
    margin: 0 auto 12px;
    max-width: min(1180px, calc(100vw - 48px));
    text-align: left;
}

.memory-page-header h1 {
    color: #484b47;
    font-size: 22px;
    margin: 0;
}

.memory-archive {
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        rgba(255, 255, 255, 0.92);
    background-size: 24px 24px;
    border: 2px solid #d7d0c5;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(83, 78, 70, 0.08);
    padding: 20px;
    text-align: left;
}

#page-stats.active {
    min-height: 100vh;
    padding: 0 24px 104px;
}

#stats-content {
    margin: 0 auto;
    max-width: min(1180px, calc(100vw - 48px));
}

.data-hub-split {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
}

.data-hub-split .memory-archive {
    min-height: calc(100vh - 178px);
    position: sticky;
    top: 18px;
}

.memory-title-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.memory-title-row h2 {
    color: #33352f;
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 500;
    margin: 0;
}

.memory-pin {
    width: 24px;
    height: 24px;
    border: 3px solid #33352f;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.memory-pin::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 18px;
    width: 3px;
    height: 16px;
    background: #33352f;
    transform: rotate(18deg);
}

.memory-review-banner {
    background: rgba(235, 249, 238, 0.78);
    border: 2px solid #6f9272;
    border-radius: 999px;
    color: #4d7555;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    margin: 16px 0;
    padding: 9px 14px;
    text-align: left;
    width: 100%;
}

.memory-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 22px;
}

.memory-metrics {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.memory-metric-card {
    background: rgba(247, 251, 244, 0.82);
    border: 1px solid rgba(127, 154, 130, 0.14);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
    min-height: 76px;
    padding: 12px 11px;
}

.memory-metric-card span {
    color: rgba(74, 82, 74, 0.7);
    display: block;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.25;
    min-height: 28px;
}

.memory-metric-card strong {
    color: #3f4a3f;
    display: block;
    font-size: 18px;
    line-height: 1.05;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.memory-chart {
    min-height: 160px;
}

.memory-chart svg {
    width: 100%;
    height: auto;
}

.chart-axis {
    fill: none;
    stroke: #33352f;
    stroke-linecap: round;
    stroke-width: 3;
}

.chart-line {
    fill: none;
    stroke: #aaa889;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
}

.memory-chart text {
    fill: #33352f;
    font-size: 12px;
    font-weight: 800;
}

.activity-chart {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(127, 154, 130, 0.1);
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(83, 78, 70, 0.06);
    color: #33352f;
    cursor: pointer;
    display: block;
    min-height: 248px;
    padding: 18px 24px 14px;
    text-align: left;
    width: 100%;
}

.emotional-chart-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.emotional-chart-top h3 {
    color: #262a25;
    font-size: 22px;
    margin: 0;
}

.emotional-chart-top p {
    color: rgba(63, 74, 63, 0.62);
    font-size: 12px;
    font-weight: 800;
    margin: 5px 0 0;
}

.emotional-filter-icon {
    height: 28px;
    position: relative;
    width: 30px;
}

.emotional-filter-icon::before {
    color: #33352f;
    content: "☷";
    font-size: 25px;
    left: 1px;
    position: absolute;
    top: -4px;
    transform: rotate(90deg);
}

.emotional-chart-main {
    align-items: center;
    display: grid;
    gap: 4px;
    grid-template-columns: minmax(112px, 0.68fr) 1fr;
}

.emotional-breakdown {
    display: grid;
    gap: 16px;
}

.emotional-breakdown span {
    color: rgba(63, 74, 63, 0.62);
    display: grid;
    font-size: 12px;
    font-weight: 800;
    gap: 2px;
    grid-template-columns: 8px 1fr;
}

.emotional-breakdown i {
    border-radius: 999px;
    display: block;
    grid-row: span 2;
    height: 42px;
    margin-top: 1px;
    width: 4px;
}

.emotional-breakdown strong {
    color: #262a25;
    font-size: 16px;
}

.emotional-donut {
    align-items: center;
    border-radius: 50%;
    display: flex;
    height: 252px;
    justify-content: center;
    justify-self: start;
    margin-left: -8px;
    position: relative;
    width: 252px;
}

.emotional-donut svg {
    height: 266px;
    left: -7px;
    overflow: visible;
    position: absolute;
    top: -7px;
    width: 266px;
}

.donut-arc {
    fill: none;
    stroke: var(--segment-color);
    stroke-linecap: round;
    stroke-width: 32;
    transform-box: fill-box;
    transform-origin: center;
    transition: stroke 0.22s ease, stroke-width 0.22s ease, transform 0.22s ease;
}

.donut-track {
    fill: none;
    opacity: 0.28;
    stroke: rgba(143, 164, 133, 0.18);
    stroke-linecap: round;
    stroke-width: 32;
}

.donut-arc:hover {
    stroke: var(--segment-hover);
    stroke-width: 35;
    transform: scale(1.028);
}

.emotional-donut strong {
    align-items: center;
    background: #fff;
    border-radius: 50%;
    display: flex;
    font-size: 36px;
    height: 86px;
    justify-content: center;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 86px;
    z-index: 2;
}

.donut-marker {
    align-items: center;
    background: rgba(85, 88, 88, 0.26);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.86);
    display: flex;
    font-size: 15px;
    height: 34px;
    justify-content: center;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 34px;
    z-index: 3;
}

.donut-dot {
    background: #111;
    border-radius: 50%;
    content: "";
    display: block;
    height: 7px;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 7px;
    z-index: 4;
}

.activity-language,
.activity-legend .activity-language {
    background: #e4f3a2;
}

.activity-revision,
.activity-legend .activity-revision {
    background: #a9d7e5;
}

.activity-community,
.activity-legend .activity-community {
    background: #f5d1f4;
}

.weekly-mood-row {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
}

.weekly-mood-day {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.weekly-mood-day span {
    align-items: center;
    background: rgba(247, 233, 236, 0.86);
    border-radius: 12px;
    display: flex;
    font-size: 18px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.weekly-mood-day small {
    color: rgba(63, 74, 63, 0.62);
    font-size: 11px;
    font-weight: 800;
}

.mood-level-text {
    color: rgba(63, 74, 63, 0.7);
    font-size: 12px;
    font-weight: 900;
    margin: 10px 0 0;
    text-align: center;
}

@media (max-width: 430px) {
    .emotional-chart-main {
        grid-template-columns: minmax(96px, 0.62fr) 1fr;
    }

    .emotional-donut {
        height: 196px;
        margin-left: -6px;
        width: 196px;
    }

    .emotional-donut strong {
        font-size: 29px;
        height: 66px;
        width: 66px;
    }

    .emotional-donut svg {
        height: 210px;
        width: 210px;
    }

    .donut-arc {
        stroke-width: 28;
    }

    .donut-marker {
        font-size: 13px;
        height: 30px;
        width: 30px;
    }

    .weekly-mood-day span {
        height: 30px;
        width: 30px;
    }
}

.activity-calendar-modal[hidden] {
    display: none;
}

.activity-calendar-modal {
    inset: 0;
    position: fixed;
    z-index: 1100;
}

.activity-calendar-backdrop {
    background: rgba(38, 37, 34, 0.34);
    inset: 0;
    position: absolute;
}

.activity-calendar-panel {
    background: #F5F0E8;
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-sizing: border-box;
    left: 50%;
    max-height: 82vh;
    max-width: 430px;
    overflow-y: auto;
    padding: 18px;
    position: absolute;
    transform: translateX(-50%);
    width: 100%;
}

.activity-calendar-panel header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.activity-calendar-panel h3 {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 500;
    margin: 0;
}

.activity-calendar-panel button {
    background: rgba(255, 255, 255, 0.68);
    border: none;
    border-radius: 50%;
    color: #33352f;
    cursor: pointer;
    font-size: 24px;
    height: 38px;
    width: 38px;
}

.activity-calendar-list {
    display: grid;
    gap: 8px;
}

.activity-calendar-row {
    background: rgba(255, 255, 255, 0.58);
    border-radius: 14px;
    display: grid;
    gap: 4px;
    grid-template-columns: 1fr;
    padding: 12px;
}

.activity-calendar-row strong {
    font-family: Georgia, serif;
    font-size: 18px;
}

.activity-calendar-row span {
    color: #555a53;
    font-size: 13px;
    font-weight: 800;
}

.memory-notes h3 {
    color: #33352f;
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    margin: 10px 0 14px;
}

.memory-note-row {
    align-items: center;
    background: rgba(255, 253, 247, 0.72);
    border: 2px solid currentColor;
    border-radius: 999px;
    display: grid;
    grid-template-columns: 54px 1fr 34px;
    gap: 8px;
    margin-bottom: 9px;
    padding: 10px 12px;
}

.memory-note-row span,
.memory-note-row strong {
    color: #33352f;
}

.memory-note-row span {
    font-size: 14px;
    font-weight: 800;
}

.memory-note-row strong {
    font-size: 15px;
}

.memory-note-row em {
    font-style: normal;
    text-align: right;
}

.note-red { color: #d88989; }
.note-green { color: #6f9272; }
.note-yellow { color: #d7c66e; }
.note-orange { color: #dfa15d; }

.memory-notes {
    background:
        linear-gradient(rgba(127, 154, 130, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.055) 1px, transparent 1px),
        #F5F0E8;
    background-size: 24px 24px;
    border: 2px solid #d7d0c5;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(83, 78, 70, 0.08);
    margin-top: 0;
    min-height: calc(100vh - 178px);
    padding: 18px;
}

.memory-notes-header {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.memory-notes-header h3 {
    margin: 0;
    padding: 0;
}

.memory-notes-header span {
    color: rgba(51, 53, 47, 0.56);
    font-size: 13px;
    font-weight: 800;
}

.note-category-menu {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scrollbar-width: none;
}

.note-category-menu::-webkit-scrollbar {
    display: none;
}

.note-category-tab {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(127, 154, 130, 0.22);
    border-radius: 999px;
    color: rgba(51, 53, 47, 0.7);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    min-width: 112px;
    padding: 9px 14px;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.note-category-tab:hover {
    background: rgba(255, 255, 255, 0.86);
    transform: translateY(-1px);
}

.note-category-tab.active {
    background: #edf8ee;
    border-color: #6f9272;
    color: #3f4a3f;
}

.note-category-tab strong,
.note-category-tab span {
    display: block;
    white-space: nowrap;
}

.note-category-tab strong {
    font-size: 13px;
    font-weight: 900;
}

.note-category-tab span {
    color: rgba(51, 53, 47, 0.52);
    font-size: 10px;
    font-weight: 800;
    margin-top: 2px;
}

.diary-card-stack {
    height: calc(100vh - 450px);
    min-height: 360px;
    overflow-y: scroll;
    padding: 0 4px 80px;
    perspective: 900px;
    position: relative;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.diary-empty-state {
    align-items: center;
    background: rgba(255, 255, 255, 0.54);
    border: 1px dashed rgba(51, 53, 47, 0.18);
    border-radius: 18px;
    color: rgba(51, 53, 47, 0.64);
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 42px 20px;
    text-align: center;
}

.diary-empty-state strong {
    color: #33352f;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 500;
}

.diary-empty-state span {
    font-size: 13px;
    font-weight: 800;
}

.diary-card-stack::-webkit-scrollbar {
    display: none;
}

@media (max-width: 980px) {
    #page-stats.active {
        padding-left: 18px;
        padding-right: 18px;
    }

    .memory-page-header,
    #stats-content {
        max-width: 720px;
    }

    .data-hub-split {
        grid-template-columns: 1fr;
    }

    .data-hub-split .memory-archive {
        min-height: 0;
        position: static;
    }

    .memory-notes {
        min-height: 0;
    }

    .diary-card-stack {
        height: 560px;
    }
}

/* Full-bleed layouts for standalone study pages */
body.kanau-has-global-topbar > .hub-panel,
body.kanau-has-global-topbar > #language-hub-panel,
body.kanau-has-global-topbar > #revision-class-panel {
    margin: 0 auto;
    max-width: none;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) * 2 + 28px) clamp(24px, 5vw, 72px) 64px;
    width: 100vw;
}

body.kanau-has-global-topbar .hub-panel-header,
body.kanau-has-global-topbar .word-list-intro,
body.kanau-has-global-topbar .conversation-intro {
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 18px 60px rgba(75, 68, 58, 0.1);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    padding: 22px;
}

body.kanau-has-global-topbar .language-study-panel,
body.kanau-has-global-topbar .revision-class-stage,
body.kanau-has-global-topbar .conversation-card,
body.kanau-has-global-topbar .pronunciation-card {
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.48);
    box-shadow: 0 24px 80px rgba(75, 68, 58, 0.12);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
}

/* Home layout bugfix: stable 12-column desktop workbench */
body.kanau-has-global-topbar #page-materials.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 40px) 32px 144px;
}

body.kanau-has-global-topbar #home-overview {
    align-items: stretch;
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto;
    margin: 0 auto;
    max-width: 1280px;
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    grid-column: span 5;
    grid-row: auto;
    justify-content: space-between;
    min-height: 560px;
    padding: 32px;
    place-items: initial;
}

body.kanau-has-global-topbar .tree-card::before {
    left: 32px;
    top: 28px;
}

body.kanau-has-global-topbar .tree-card::after {
    bottom: 116px;
    right: 32px;
}

body.kanau-has-global-topbar .pinecone-count {
    margin: 34px 0 18px;
    position: relative;
    z-index: 1;
}

body.kanau-has-global-topbar .growth-tree {
    align-self: center;
    flex: 1 1 auto;
    height: clamp(250px, 36vh, 390px);
    margin: 8px auto 24px;
    max-width: 100%;
    transform: scale(1.08);
}

body.kanau-has-global-topbar .home-mascot {
    align-self: flex-end;
    background:
        radial-gradient(circle at 36% 26%, #2f3b35 0 4px, transparent 5px),
        radial-gradient(circle at 64% 26%, #2f3b35 0 4px, transparent 5px),
        linear-gradient(140deg, #fbf8f0, #e9dfcf);
    border-radius: 48% 48% 42% 42%;
    box-shadow: inset -14px -18px 0 rgba(193, 183, 165, 0.22), 0 20px 42px rgba(74, 61, 49, 0.14);
    height: 96px;
    margin: -92px 10px 16px 0;
    pointer-events: none;
    position: relative;
    width: 82px;
    z-index: 2;
}

body.kanau-has-global-topbar .home-mascot::before {
    background: #9bb69d;
    border-radius: 70% 24% 70% 24%;
    content: "";
    height: 22px;
    left: 22px;
    position: absolute;
    top: -10px;
    transform: rotate(-18deg);
    width: 42px;
}

body.kanau-has-global-topbar .daily-goal-panel {
    flex: 0 0 auto;
    grid-column: auto;
    grid-row: auto;
    margin-top: 12px;
    padding: 20px;
    position: relative;
    z-index: 3;
}

body.kanau-has-global-topbar .home-hub-actions {
    align-self: stretch;
    display: grid;
    gap: 24px;
    grid-column: span 7;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 560px;
}

body.kanau-has-global-topbar .hub-action {
    align-items: flex-start;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    min-width: 0;
    padding: 32px;
}

body.kanau-has-global-topbar .hub-action-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    display: flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #292524;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-top: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: #78716c;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

body.kanau-has-global-topbar .bottom-nav {
    bottom: 24px;
}

@media (max-width: 1024px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.kanau-has-global-topbar #home-overview {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        grid-column: 1;
        min-height: auto;
    }

    body.kanau-has-global-topbar .home-hub-actions {
        grid-template-columns: 1fr;
    }
}

/* Final responsive viewport fit overrides. Keep this block at EOF. */
html,
body {
    min-width: 0;
    overflow-x: hidden;
}

body.kanau-has-global-topbar #page-materials.page.active {
    justify-content: flex-start;
}

body.kanau-has-global-topbar #home-overview {
    min-height: auto;
}

@media (max-height: 820px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        padding-top: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 24px);
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        min-height: clamp(320px, 62vh, 520px);
    }

    body.kanau-has-global-topbar .hub-action {
        min-height: clamp(156px, 28vh, 300px);
        padding: clamp(18px, 3vh, 32px);
    }

    body.kanau-has-global-topbar .growth-tree {
        height: clamp(180px, 30vh, 320px);
    }
}

@media (max-width: 640px) {
    #home-app {
        padding-left: clamp(14px, 4vw, 22px);
        padding-right: clamp(14px, 4vw, 22px);
    }

    body.kanau-has-global-topbar #page-materials.page.active {
        padding-left: 16px;
        padding-right: 16px;
    }
}

body.pine-lobby-page,
body.pine-classroom-page,
body.pine-focus-desk-page,
body.pine-teaching-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.pine-lobby,
.pine-classroom-shell,
.pine-focus-desk-shell {
    height: 100dvh;
}

.pine-lobby {
    padding: 0;
}

.pine-canvas {
    height: min(100dvh, 175.56vw);
    max-height: 100dvh;
    max-width: 100vw;
}

.pine-bg-image {
    height: 100%;
    width: auto;
}

.pine-game-board {
    height: min(100dvh, 74.75vw);
    min-height: 0;
    min-width: 0;
    width: min(100vw, 133.78dvh);
}

.pine-focus-desk-bg {
    object-fit: contain;
}

.pine-focus-desk-foreground-wrap {
    max-width: 100vw;
    min-width: 0;
    width: min(100vw, 177.6dvh);
}

.pine-focus-countdown {
    font-size: clamp(32px, 7vmin, 72px);
}

body.pine-teaching-page #teaching-root {
    height: 100dvh;
    overflow: auto;
}

/* Final responsive viewport fit overrides. Keep this block at EOF. */
html,
body {
    min-width: 0;
    overflow-x: hidden;
}

body.kanau-has-global-topbar #page-materials.page.active {
    justify-content: flex-start;
}

body.kanau-has-global-topbar #home-overview {
    min-height: auto;
}

@media (max-height: 820px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        padding-top: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 24px);
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        min-height: clamp(320px, 62vh, 520px);
    }

    body.kanau-has-global-topbar .hub-action {
        min-height: clamp(156px, 28vh, 300px);
        padding: clamp(18px, 3vh, 32px);
    }

    body.kanau-has-global-topbar .growth-tree {
        height: clamp(180px, 30vh, 320px);
    }
}

@media (max-width: 640px) {
    #home-app {
        padding-left: clamp(14px, 4vw, 22px);
        padding-right: clamp(14px, 4vw, 22px);
    }

    body.kanau-has-global-topbar #page-materials.page.active {
        padding-left: 16px;
        padding-right: 16px;
    }
}

body.pine-lobby-page,
body.pine-classroom-page,
body.pine-focus-desk-page,
body.pine-teaching-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.pine-lobby,
.pine-classroom-shell,
.pine-focus-desk-shell {
    height: 100dvh;
}

.pine-lobby {
    padding: 0;
}

.pine-canvas {
    height: min(100dvh, 175.56vw);
    max-height: 100dvh;
    max-width: 100vw;
}

.pine-bg-image {
    height: 100%;
    width: auto;
}

.pine-game-board {
    height: min(100dvh, 74.75vw);
    min-height: 0;
    min-width: 0;
    width: min(100vw, 133.78dvh);
}

.pine-focus-desk-bg {
    object-fit: contain;
}

.pine-focus-desk-foreground-wrap {
    max-width: 100vw;
    min-width: 0;
    width: min(100vw, 177.6dvh);
}

.pine-focus-countdown {
    font-size: clamp(32px, 7vmin, 72px);
}

body.pine-teaching-page #teaching-root {
    height: 100dvh;
}

/* Responsive viewport fit overrides.
   Keep full-screen experiences visible when the browser window is narrow or short. */
html,
body {
    min-width: 0;
    overflow-x: hidden;
}

body.kanau-has-global-topbar #page-materials.page.active {
    justify-content: flex-start;
}

body.kanau-has-global-topbar #home-overview {
    min-height: auto;
}

@media (max-height: 820px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        padding-top: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 24px);
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        min-height: clamp(320px, 62vh, 520px);
    }

    body.kanau-has-global-topbar .hub-action {
        min-height: clamp(156px, 28vh, 300px);
        padding: clamp(18px, 3vh, 32px);
    }

    body.kanau-has-global-topbar .growth-tree {
        height: clamp(180px, 30vh, 320px);
    }
}

@media (max-width: 640px) {
    #home-app {
        padding-left: clamp(14px, 4vw, 22px);
        padding-right: clamp(14px, 4vw, 22px);
    }

    body.kanau-has-global-topbar #page-materials.page.active {
        padding-left: 16px;
        padding-right: 16px;
    }
}

body.pine-lobby-page,
body.pine-classroom-page,
body.pine-focus-desk-page,
body.pine-teaching-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.pine-lobby,
.pine-classroom-shell,
.pine-focus-desk-shell {
    height: 100dvh;
}

.pine-lobby {
    padding: 0;
}

.pine-canvas {
    height: min(100dvh, 175.56vw);
    max-height: 100dvh;
    max-width: 100vw;
}

.pine-bg-image {
    height: 100%;
    width: auto;
}

.pine-game-board {
    height: min(100dvh, 74.75vw);
    min-height: 0;
    min-width: 0;
    width: min(100vw, 133.78dvh);
}

.pine-focus-desk-bg {
    object-fit: contain;
}

.pine-focus-desk-foreground-wrap {
    max-width: 100vw;
    min-width: 0;
    width: min(100vw, 177.6dvh);
}

.pine-focus-countdown {
    font-size: clamp(32px, 7vmin, 72px);
}

body.pine-teaching-page #teaching-root {
    height: 100dvh;
}

/* Restore compact Home layout requested by user */
body.kanau-has-global-topbar #home-app {
    margin: 0 auto;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    width: 100%;
}

body.kanau-has-global-topbar #page-materials.page.active {
    display: block;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) * 2 + 28px) 22px 132px;
}

body.kanau-has-global-topbar .home-local-topbar {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr auto 1fr 42px;
    margin: 0 auto 22px;
    max-width: 520px;
    min-height: 42px;
    width: 100%;
}

body.kanau-has-global-topbar #home-overview {
    display: block;
    margin: 0 auto;
    max-width: 520px;
    min-height: 0;
    padding-bottom: 40px;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-items: initial;
    background: rgba(255, 255, 255, 0.9);
    border: 0;
    border-radius: 24px;
    box-shadow: 0 12px 26px rgba(83, 78, 70, 0.08);
    display: block;
    margin: 0 auto 16px;
    min-height: 300px;
    overflow: visible;
    padding: 24px 18px 18px;
    position: relative;
    width: min(248px, 76vw);
}

body.kanau-has-global-topbar .tree-card::before,
body.kanau-has-global-topbar .tree-card::after,
body.kanau-has-global-topbar .home-mascot {
    display: none;
}

body.kanau-has-global-topbar .pinecone-count {
    margin: 0 0 18px;
    position: static;
}

body.kanau-has-global-topbar .pinecone-count strong {
    color: #777b72;
    font-size: 18px;
    letter-spacing: 0;
}

body.kanau-has-global-topbar .growth-tree {
    flex: initial;
    height: 232px;
    margin: 0;
    max-width: none;
    transform: none;
}

body.kanau-has-global-topbar .daily-goal-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 6px 0 0;
    padding: 0;
    position: static;
    text-align: left;
}

body.kanau-has-global-topbar .daily-goal-bar {
    background: #eeeae3;
    height: 8px;
}

body.kanau-has-global-topbar .daily-goal-fill {
    background: #8fa88f;
}

body.kanau-has-global-topbar .home-hub-actions {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
    min-height: 148px;
}

body.kanau-has-global-topbar .hub-action {
    align-items: center;
    border: 0;
    border-radius: 18px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 142px;
    overflow: visible;
    padding: 18px 10px;
    text-align: center;
}

body.kanau-has-global-topbar .hub-action::before {
    display: none;
}

body.kanau-has-global-topbar .hub-action-icon {
    border-radius: 13px;
    display: grid;
    flex: initial;
    height: 44px;
    margin-bottom: 8px;
    place-items: center;
    width: 44px;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #494b48;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    margin-top: 0;
    overflow-wrap: normal;
    word-break: normal;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: #8b8d88;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 0;
    overflow-wrap: normal;
}

body.kanau-has-global-topbar .bottom-nav {
    bottom: 0;
    max-width: 520px;
    padding-bottom: 10px;
    width: 100%;
}

/* Final Home desktop grid fix: keep this block last */
body.kanau-has-global-topbar #page-materials.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 40px) 32px 144px;
}

body.kanau-has-global-topbar #home-overview {
    align-items: stretch;
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto;
    margin: 0 auto;
    max-width: 1280px;
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    grid-column: span 5;
    grid-row: auto;
    justify-content: space-between;
    min-height: 560px;
    padding: 32px;
    place-items: initial;
}

body.kanau-has-global-topbar .tree-card::after {
    display: none;
}

body.kanau-has-global-topbar .growth-tree {
    align-self: center;
    flex: 1 1 auto;
    height: clamp(250px, 36vh, 390px);
    margin: 8px auto 24px;
    max-width: 100%;
    transform: scale(1.08);
}

body.kanau-has-global-topbar .daily-goal-panel {
    flex: 0 0 auto;
    grid-column: auto;
    grid-row: auto;
    margin-top: 12px;
    padding: 20px;
    position: relative;
    z-index: 3;
}

body.kanau-has-global-topbar .home-hub-actions {
    align-self: stretch;
    display: grid;
    gap: 24px;
    grid-column: span 7;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 560px;
}

body.kanau-has-global-topbar .hub-action {
    align-items: flex-start;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    min-width: 0;
    padding: 32px;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #292524;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-top: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: #78716c;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.kanau-has-global-topbar #home-overview {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        grid-column: 1;
        min-height: auto;
    }

    body.kanau-has-global-topbar .home-hub-actions {
        grid-template-columns: 1fr;
    }
}

.diary-card-canvas {
    position: relative;
}

.diary-card {
    background: var(--card-color);
    border: none;
    border-radius: 22px;
    box-shadow: none;
    box-sizing: border-box;
    color: #33352f;
    cursor: pointer;
    left: 4px;
    height: 60px;
    overflow: hidden;
    padding: 0 18px;
    position: absolute;
    right: 4px;
    top: var(--stack-top);
    touch-action: pan-y;
    opacity: var(--deck-opacity);
    transform: translate3d(var(--deck-x), var(--deck-y), 0) rotate(var(--deck-rotate)) scale(var(--deck-scale));
    transform-origin: top center;
    transition: top 0.52s cubic-bezier(.22, 1, .36, 1), transform 0.52s cubic-bezier(.22, 1, .36, 1), height 0.52s cubic-bezier(.22, 1, .36, 1), opacity 0.28s ease;
    will-change: top, transform;
}

.diary-card.is-expanded {
    height: 390px;
    padding: 18px;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
}

.diary-card.is-idle-stack {
    height: 170px;
    padding: 18px;
}

.diary-card.is-lifted {
    animation: liftUp 0.54s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.diary-card.is-new {
    animation: diaryCardIn 0.42s ease both;
}

@keyframes liftUp {
    0% {
        transform: translate3d(var(--deck-x), calc(var(--deck-y) - 28px), 0) rotate(calc(var(--deck-rotate) - 1deg)) scale(var(--deck-lift-start-scale));
        opacity: 0.76;
    }
    42% {
        transform: translate3d(0, -18px, 0) rotate(0.4deg) scale(1.02);
        opacity: 1;
    }
    72% {
        transform: translate3d(0, 3px, 0) rotate(-0.2deg) scale(0.998);
    }
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes diaryCardIn {
    from {
        opacity: 0;
        transform: translateY(-26px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate3d(var(--deck-x), var(--deck-y), 0) rotate(var(--deck-rotate)) scale(var(--deck-scale));
    }
}

.diary-card-peek {
    align-items: center;
    display: flex;
    height: 60px;
    justify-content: space-between;
}

.diary-card-peek .diary-card-tags {
    margin: 0;
}

.diary-card-peek span {
    align-items: center;
    background: rgba(255, 255, 255, 0.54);
    border-radius: 50%;
    display: flex;
    font-size: 18px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.diary-card.is-expanded .diary-card-peek {
    display: none;
}

.diary-card.is-idle-stack .diary-card-peek {
    display: none;
}

.diary-card-full {
    display: none;
}

.diary-card.is-expanded .diary-card-full {
    display: block;
}

.diary-card.is-idle-stack .diary-card-full {
    display: block;
}

.diary-card-date {
    color: rgba(51, 53, 47, 0.46);
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.diary-card-title {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 42px;
}

.diary-card-title h4 {
    color: #33352f;
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.1;
    margin: 0;
    overflow-wrap: anywhere;
}

.diary-card-title span {
    align-items: center;
    background: rgba(255, 255, 255, 0.54);
    border-radius: 50%;
    display: flex;
    font-size: 22px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.diary-card-tags {
    color: rgba(51, 53, 47, 0.68);
    font-size: 13px;
    font-weight: 800;
    margin: 10px 0 0;
}

.diary-card-body {
    color: #33352f;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.55;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.28s ease;
}

.diary-card.is-expanded .diary-card-body {
    margin-top: 18px;
    max-height: 560px;
    opacity: 1;
}

.diary-card-body p {
    margin: 0 0 12px;
}

.diary-card-body ul {
    display: grid;
    gap: 6px;
    margin: 0 0 14px;
    padding-left: 18px;
}

.diary-card-body img {
    border-radius: 16px;
    display: block;
    max-height: 180px;
    object-fit: cover;
    width: 100%;
}

.diary-card-rating {
    color: rgba(51, 53, 47, 0.72);
    font-size: 18px;
    letter-spacing: 0;
    margin-top: 12px;
}

.diary-modal-shell[hidden] {
    display: none;
}

.diary-modal-shell {
    inset: 0;
    position: fixed;
    z-index: 1000;
}

.diary-modal-backdrop {
    background: rgba(38, 37, 34, 0.34);
    inset: 0;
    position: absolute;
}

.diary-modal {
    background: #F5F0E8;
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-sizing: border-box;
    color: #33352f;
    left: 50%;
    max-height: 92vh;
    max-width: 430px;
    overflow-y: auto;
    padding: 18px;
    position: absolute;
    text-align: left;
    transform: translateX(-50%);
    width: 100%;
}

.diary-modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.diary-modal-header h3 {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 500;
    margin: 0;
}

.diary-modal-header button {
    background: rgba(255, 255, 255, 0.68);
    border: none;
    border-radius: 50%;
    color: #33352f;
    cursor: pointer;
    font-size: 24px;
    height: 38px;
    line-height: 1;
    width: 38px;
}

.diary-session-summary {
    background: rgba(255, 255, 255, 0.58);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
    padding: 10px 14px;
}

.diary-upload-preview {
    align-items: center;
    background: rgba(255, 255, 255, 0.48);
    border: 2px dashed rgba(51, 53, 47, 0.2);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    min-height: 128px;
    overflow: hidden;
}

.diary-upload-empty {
    background: transparent;
    border: none;
    color: rgba(51, 53, 47, 0.64);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.diary-upload-image {
    display: block;
    max-height: 220px;
    object-fit: cover;
    width: 100%;
}

.diary-upload-file {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 18px;
}

.diary-upload-file span {
    font-size: 28px;
}

.diary-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.diary-field > span {
    color: rgba(51, 53, 47, 0.68);
    font-size: 12px;
    font-weight: 800;
}

.diary-field input,
.diary-field textarea {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    border-radius: 14px;
    box-sizing: border-box;
    color: #33352f;
    font: inherit;
    outline: none;
    padding: 12px 14px;
    width: 100%;
}

.diary-field input:focus,
.diary-field textarea:focus {
    border-color: rgba(51, 53, 47, 0.28);
}

.diary-mood-row {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, 1fr);
}

.diary-mood-btn {
    align-items: center;
    background: rgba(255, 255, 255, 0.56);
    border: 2px solid transparent;
    border-radius: 16px;
    color: #33352f;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 4px;
    min-height: 68px;
    padding: 8px 4px;
}

.diary-mood-btn.active {
    background: #fff;
    border-color: rgba(51, 53, 47, 0.36);
}

.diary-mood-btn span {
    font-size: 22px;
}

.diary-mood-btn em {
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.diary-save-btn {
    background: #33352f;
    border: none;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 15px 18px;
    width: 100%;
}

.diary-save-btn:disabled {
    cursor: default;
    opacity: 0.42;
}

@media (max-width: 380px) {
    .diary-mood-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* シェアボタン */
.share-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #4A90E2, #7B5EA7);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    transition: opacity 0.2s, transform 0.1s;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-btn:active {
    transform: scale(0.98);
}

/* Profile card */
.profile-page-header {
    margin-bottom: 16px;
    text-align: left;
}

.profile-page-header h1 {
    color: #484b47;
    font-size: 22px;
    margin: 0;
}

.profile-summary-card {
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        rgba(255, 255, 255, 0.94);
    background-size: 24px 24px;
    border: 2px solid #d7d0c5;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(83, 78, 70, 0.08);
    padding: 18px;
    margin-bottom: 18px;
}

.profile-main-row {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin-bottom: 18px;
}

.profile-achievement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-achievement {
    border: 2px solid #d7d0c5;
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.72);
    padding: 12px 10px;
    text-align: left;
}

.achievement-label {
    display: block;
    color: #777d74;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
}

.profile-achievement strong {
    color: #33352f;
    font-size: 24px;
    line-height: 1;
}

.profile-menu {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.profile-menu-row {
    align-items: center;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5dfd6;
    color: #33352f;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    justify-content: space-between;
    padding: 14px 2px;
    text-align: left;
    text-decoration: none;
}

.profile-menu-row:hover {
    color: var(--primary);
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar-circle {
    width: 68px;
    height: 68px;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 253, 247, 0.96) 0 48%, transparent 49%),
        #edf6ee;
    border: 2px solid #b8cab2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4d7555;
    font-size: 34px;
    line-height: 1;
    box-shadow: inset 0 -6px 0 rgba(127, 154, 130, 0.12);
}

.profile-avatar-edit {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 24px;
    height: 24px;
    background: #dfa15d;
    border-radius: 50%;
    border: 2px solid #fffdf7;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(83, 78, 70, 0.14);
}

.profile-info {
    flex: 1;
    text-align: left;
}

.profile-display-name {
    font-size: 17px;
    font-weight: bold;
    color: #33352f;
    margin-bottom: 5px;
}

.plan-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.plan-free {
    background: #edf6ee;
    color: #4d7555;
}

.plan-premium {
    background: #dfa15d;
    color: white;
}

.profile-action-link {
    font-size: 12px;
    color: #7f9a82;
    font-weight: 800;
}

.squirrel-illo-profile {
    transform: scale(0.68);
}

.squirrel-illo-profile,
.squirrel-illo-profile span {
    box-sizing: border-box;
}

.squirrel-illo {
    display: inline-block;
    height: 70px;
    position: relative;
    width: 70px;
}

.squirrel-tail {
    background: #b97832;
    border: 3px solid #6b4422;
    border-radius: 60% 48% 56% 44%;
    height: 44px;
    left: 4px;
    position: absolute;
    top: 11px;
    transform: rotate(-22deg);
    width: 30px;
}

.squirrel-body {
    background: #c9853d;
    border: 3px solid #6b4422;
    border-radius: 48% 48% 42% 42%;
    height: 38px;
    left: 27px;
    position: absolute;
    top: 28px;
    width: 31px;
}

.squirrel-head {
    background: #cf8f4a;
    border: 3px solid #6b4422;
    border-radius: 50%;
    height: 34px;
    left: 27px;
    position: absolute;
    top: 8px;
    width: 34px;
}

.squirrel-ear {
    background: #b97832;
    border: 3px solid #6b4422;
    border-radius: 50%;
    height: 12px;
    position: absolute;
    top: -7px;
    width: 12px;
}

.squirrel-ear.left { left: 1px; }
.squirrel-ear.right { right: 1px; }

.squirrel-eye {
    background: #33352f;
    border-radius: 50%;
    height: 4px;
    position: absolute;
    top: 13px;
    width: 4px;
}

.squirrel-eye.left { left: 9px; }
.squirrel-eye.right { right: 9px; }

.squirrel-muzzle {
    background: #fff3df;
    border-radius: 50%;
    height: 11px;
    left: 50%;
    position: absolute;
    top: 18px;
    transform: translateX(-50%);
    width: 14px;
}

.squirrel-arm {
    background: #6b4422;
    border-radius: 999px;
    height: 12px;
    left: 36px;
    position: absolute;
    top: 40px;
    transform: rotate(28deg);
    width: 4px;
}

.squirrel-accent {
    background: #fff3df;
    border-radius: 48% 48% 54% 54%;
    height: 14px;
    left: 39px;
    position: absolute;
    top: 45px;
    width: 10px;
}

.tone-leaf .squirrel-body,
.tone-leaf .squirrel-head { background: #8fbf7d; }

.tone-blue .squirrel-body,
.tone-blue .squirrel-head { background: #8aa5d6; }

.tone-tea .squirrel-body,
.tone-tea .squirrel-head { background: #a8c7c1; }

.tone-star .squirrel-body,
.tone-star .squirrel-head { background: #d7c66e; }

.tone-spark .squirrel-body,
.tone-spark .squirrel-head { background: #dfa15d; }

.tone-moon .squirrel-body,
.tone-moon .squirrel-head { background: #aaa889; }

.tone-book .squirrel-body,
.tone-book .squirrel-head { background: #c9a47d; }

.tone-travel .squirrel-body,
.tone-travel .squirrel-head { background: #d89b8d; }


/* プロフィールモーダル内スタイル */
.modal-section-label {
    font-size: 11px;
    font-weight: bold;
    color: #aaa;
    margin: 14px 0 6px;
    letter-spacing: 0.5px;
}

.avatar-carousel {
    align-items: center;
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        #fbfaf7;
    background-size: 22px 22px;
    border: 2px solid #d7d0c5;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: 36px 1fr 36px;
    padding: 16px 10px;
}

.avatar-stage {
    align-items: end;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    min-height: 120px;
    position: relative;
}

.avatar-main-avatar,
.avatar-side-avatar {
    display: grid;
    place-items: center;
    line-height: 1;
}

.avatar-main-avatar {
    animation: avatar-showcase-spin 3.2s ease-in-out infinite;
    font-size: 58px;
    filter: drop-shadow(0 8px 8px rgba(69, 55, 38, 0.12));
}

.avatar-side-avatar {
    font-size: 34px;
    opacity: 0.55;
}

.avatar-growth-mark {
    left: 50%;
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
}

.avatar-rotate-btn {
    background: transparent;
    border: none;
    color: #33352f;
    cursor: pointer;
    font-size: 30px;
    font-weight: 800;
}

.avatar-character-name {
    color: #33352f;
    font-family: Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
}

@keyframes avatar-showcase-spin {
    0%, 100% { transform: rotateY(0deg) translateY(0); }
    50% { transform: rotateY(20deg) translateY(-4px); }
}

.profile-name-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.profile-name-input:focus {
    border-color: #4A90E2;
}

.plan-options {
    display: flex;
    gap: 10px;
}

.plan-option {
    flex: 1;
    padding: 12px 8px;
    border-radius: 12px;
    border: 2px solid #e0e6ed;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.plan-option.selected {
    border-color: #4A90E2;
    background: #e8f0fe;
}

.plan-option-locked {
    opacity: 0.55;
    cursor: default;
    position: relative;
}

.plan-option-name {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.plan-option-desc {
    font-size: 11px;
    color: #aaa;
    margin-top: 3px;
}

.settings-arrow {
    color: #ccc;
    font-size: 22px;
    line-height: 1;
}

/* シェアモーダル */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal-overlay[hidden] {
    display: none;
}

.share-modal-box {
    background: white;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.share-modal-header button {
    background: #f0f0f0;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#share-preview {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.share-modal-hint {
    text-align: center;
    color: #bbb;
    font-size: 11px;
    margin: 10px 0 6px;
}

.share-download-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4A90E2, #7B5EA7);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.share-download-btn:hover {
    opacity: 0.9;
}

.modal-save-btn {
    margin-top: 20px;
}

/* Home main */
.tree-card {
    width: min(248px, 76vw);
    min-height: 300px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 12px 26px rgba(83, 78, 70, 0.08);
    margin: 0 auto 16px;
    padding: 24px 18px 18px;
}

.pinecone-count {
    color: #8b8e84;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 18px;
}

.pinecone-count strong {
    color: #777b72;
    font-size: 18px;
    margin-right: 5px;
}

.growth-tree {
    height: 232px;
    margin: 0;
    position: relative;
    overflow: visible;
}

.tree-canopy {
    width: 212px;
    height: 154px;
    margin: 0 auto;
    position: relative;
    border-radius: 46% 54% 48% 52%;
    background:
        radial-gradient(circle at 33% 28%, #83b986 0 31%, transparent 32%),
        radial-gradient(circle at 64% 28%, #7fb582 0 33%, transparent 34%),
        radial-gradient(circle at 22% 58%, #82b986 0 34%, transparent 35%),
        radial-gradient(circle at 76% 62%, #78ae7b 0 31%, transparent 32%),
        radial-gradient(circle at 50% 54%, #82b986 0 52%, transparent 53%);
    filter: drop-shadow(2px 3px 0 rgba(72, 84, 67, 0.28));
    opacity: 1;
}

.tree-face {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 40px;
    height: 28px;
    transform: translate(-50%, -50%);
}

.tree-face::before,
.tree-face::after {
    content: "";
    position: absolute;
    top: 2px;
    width: 2px;
    height: 14px;
    background: #526653;
    border-radius: 999px;
}

.tree-face::before {
    left: 8px;
}

.tree-face::after {
    right: 8px;
}

.tree-face {
    border-bottom: 3px solid #526653;
    border-radius: 0 0 50% 50%;
}

.tree-trunk {
    width: 68px;
    height: 128px;
    background: #77735f;
    border: 3px solid #5d5a4b;
    border-radius: 24px 20px 16px 18px;
    box-shadow: 2px 3px 0 rgba(72, 64, 52, 0.25);
    margin: -54px auto 0;
    position: relative;
    overflow: visible;
}

.tree-trunk::before {
    content: "";
    position: absolute;
    right: -31px;
    top: 46px;
    width: 48px;
    height: 16px;
    background: #77735f;
    border: 3px solid #5d5a4b;
    border-left: none;
    border-radius: 0 10px 10px 0;
    transform: rotate(-45deg);
    transform-origin: left center;
    z-index: -1;
}

.tree-trunk::after {
    content: "";
    position: absolute;
    left: -3px;
    top: -10px;
    width: 74px;
    height: 24px;
    background: #77735f;
    border-radius: 26px 24px 0 0;
}

.tree-ground {
    display: none;
}

.acorn {
    position: absolute;
    display: block;
    background: #b97832;
    border-radius: 48% 48% 54% 54%;
    box-shadow: inset -3px -4px 0 rgba(78, 45, 19, 0.18), 0 3px 5px rgba(49, 82, 46, 0.18);
    z-index: 2;
}

.acorn::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -20%;
    transform: translateX(-50%);
    width: 112%;
    height: 42%;
    background: #6b4422;
    border-radius: 50% 50% 36% 36%;
}

.acorn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -33%;
    width: 22%;
    height: 25%;
    background: #6b4422;
    border-radius: 999px;
    transform: translateX(-50%) rotate(12deg);
}

.acorn-large {
    width: 18px;
    height: 23px;
}

.acorn-small {
    width: 13px;
    height: 17px;
}

.acorn-1 { left: 42%; top: 74%; transform: rotate(-10deg); }
.acorn-2 { left: 24%; top: 80%; transform: rotate(8deg); }
.acorn-3 { left: 58%; top: 82%; transform: rotate(-4deg); }
.acorn-4 { left: 48%; top: 56%; transform: rotate(12deg); }
.acorn-5 { left: 26%; top: 61%; transform: rotate(-12deg); }
.acorn-6 { left: 38%; top: 42%; transform: rotate(6deg); }
.acorn-7 { left: 62%; top: 64%; transform: rotate(14deg); }
.acorn-8 { left: 19%; top: 70%; transform: rotate(-14deg); }

.daily-goal-panel {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-top: 6px;
    padding: 0;
    text-align: left;
}

.daily-goal-header,
.daily-goal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.daily-goal-header span {
    color: #555a53;
    font-size: 14px;
    font-weight: 800;
}

.daily-goal-header strong {
    color: #555a53;
    font-size: 14px;
    line-height: 1;
}

.daily-goal-bar {
    width: 100%;
    height: 8px;
    background: #eeeae3;
    border-radius: 999px;
    margin: 12px 0 8px;
    overflow: hidden;
}

.daily-goal-fill {
    width: 0;
    height: 100%;
    background: #8fa88f;
    border-radius: inherit;
    transition: width 0.25s ease;
}

.daily-goal-meta {
    color: #6b7788;
    font-size: 11px;
    font-weight: 600;
}

.hub-panel[hidden],
#home-overview[hidden] {
    display: none;
}

.hub-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.hub-panel-header h2 {
    color: var(--primary);
    font-size: 22px;
    margin: 0;
}

.hub-back-btn {
    background: white;
    border: 1px solid #d0d9e4;
    border-radius: 8px;
    color: #4f5f73;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    min-height: 0;
    padding: 9px 12px;
}

.hub-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.home-hub-actions {
    min-height: 148px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-content: center;
    margin-top: 18px;
}

.hub-action {
    min-height: 142px;
    border: none;
    border-radius: 18px;
    color: #494b48;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    text-align: center;
    box-shadow: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.hub-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(64, 73, 62, 0.08);
}

.hub-action:active {
    transform: translateY(0);
}

.hub-action-language {
    background: #dceade;
}

.hub-action-revision {
    background: #f2eee8;
}

.hub-action-classroom {
    background: #dce7ef;
}

.hub-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    place-items: center;
    margin-bottom: 8px;
}

.hub-action-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #7f9a82;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hub-action-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
}

.hub-action-meta {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    color: #8b8d88;
}

/* ページ切り替え */
.page {
    display: none;
    padding-bottom: 120px;
}

.page.active {
    display: block;
}

/* ボトムナビゲーション */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    display: flex;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid #eeeae3;
    box-shadow: 0 -6px 18px rgba(74, 70, 63, 0.06);
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 9px 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #b4b5b0;
    transition: color 0.2s;
    gap: 4px;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn:hover {
    color: var(--primary);
    background-color: #f7f5ef;
}

.nav-icon {
    width: 24px;
    height: 24px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.nav-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 430px) {
    .home-hub-actions {
        grid-template-columns: 1fr;
        min-height: 0;
        margin-top: 24px;
    }

    .hub-action {
        min-height: 108px;
    }
}

/* プレースホルダーページ */


/* Tree Hole lobby */
html {
    background: #fdf0e3;
}

.pine-page[hidden] {
    display: none !important;
}

.pine-lobby-page {
    background: #fdf0e3;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    height: 100vh;
    margin: 0;
    max-width: none;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;
}

.pine-lobby {
    align-items: center;
    background: transparent;
    box-sizing: border-box;
    display: flex;
    height: 100vh;
    justify-content: center;
    margin: 0;
    max-width: none;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-align: left;
    width: 100%;
}

.pine-lobby-header {
    align-items: center;
    background: transparent;
    color: #5c3d2e;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    left: 0;
    margin: 0;
    padding: 24px 40px;
    position: absolute;
    top: 0;
    width: 100%;
    font-size: 18px;
    font-weight: 800;
    z-index: 50;
}

.pine-back-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.pine-canvas {
    flex-shrink: 0;
    height: 100%;
    margin: 0;
    position: relative;
    width: auto;
}

.pine-lobby-title {
    color: #5c3d2e;
    font-size: clamp(18px, 4.2vh, 30px);
    font-weight: 800;
    left: 50%;
    line-height: 1.05;
    margin: 0;
    position: absolute;
    text-align: center;
    text-shadow: 0 2px 10px rgba(255, 246, 229, 0.8);
    top: 7%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 20;
}

.pine-bg-image {
    display: block;
    height: 100%;
    position: relative;
    user-select: none;
    width: auto;
    z-index: 0;
}

.pine-room-card {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(68, 50, 32, 0.12);
    color: #3f3a32;
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 4px;
    max-width: 44%;
    min-height: 62px;
    padding: 12px;
    position: absolute;
    text-align: left;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    z-index: 20;
}

.pine-room-card:hover {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 18px rgba(68, 50, 32, 0.14);
    transform: translateY(-1px);
}

.pine-room-card:active {
    transform: scale(0.97);
}

.pine-room-card strong {
    font-size: clamp(11px, 2.9vw, 14px);
    line-height: 1.2;
}

.pine-room-card span {
    color: #6b7280;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    line-height: 1.2;
}

.pine-room-card-left {
    left: -5%;
}

.pine-room-card-right {
    right: -5%;
}

.pine-room-card-1,
.pine-hole-1 {
    top: 15%;
}

.pine-room-card-2,
.pine-hole-2 {
    top: 38%;
}

.pine-room-card-3,
.pine-hole-3 {
    top: 61%;
}

.pine-room-card-4,
.pine-hole-4 {
    top: 84%;
}

.pine-hole-hitbox {
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    height: 12%;
    left: 37.5%;
    opacity: 0;
    padding: 0;
    position: absolute;
    transition: background-color 0.18s ease;
    width: 25%;
    z-index: 30;
}

.pine-hole-hitbox:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.pine-hole-hitbox:focus-visible {
    opacity: 1;
    outline: 2px solid rgba(127, 154, 130, 0.55);
    outline-offset: 3px;
}

@media (max-width: 380px) {
    .pine-lobby-header {
        padding: 20px 24px;
    }

    .pine-room-card {
        max-width: 46%;
        min-height: 56px;
        padding: 10px;
    }
}

.pine-study-room {
    box-sizing: border-box;
    padding-bottom: 120px;
    text-align: left;
}

.pine-study-panel {
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(246, 238, 225, 0.92));
    border: 1px solid #eadfce;
    border-radius: 20px;
    box-shadow: 0 12px 26px rgba(105, 91, 72, 0.08);
    display: grid;
    gap: 18px;
    justify-items: center;
    min-height: 460px;
    padding: 24px;
    text-align: center;
}

.pine-study-panel p {
    color: #6b7280;
    font-size: 14px;
    font-weight: 800;
    margin: 0;
}

.pine-study-timer {
    color: #3f3a32;
    font-size: 58px;
    font-weight: 300;
    line-height: 1;
}

.pine-study-start {
    background: #7f9a82;
    border: none;
    border-radius: 8px;
    color: #fffaf2;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 900;
    min-height: 48px;
    padding: 0 22px;
}

.pine-classroom-page {
    background: #ddb988;
    box-sizing: border-box;
    font-family: var(--kanau-font-display);
    height: 100vh;
    margin: 0;
    max-width: none;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.pine-classroom-page *,
.pine-classroom-page *::before,
.pine-classroom-page *::after {
    box-sizing: border-box;
}

.pine-classroom-shell {
    background: #ddb988;
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.pine-game-board {
    aspect-ratio: 1608 / 1202;
    height: calc(100vw * 1202 / 1608);
    left: 50%;
    min-height: 100vh;
    min-width: 100vw;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    z-index: 0;
}

.pine-blackboard-entry {
    position: absolute;
    top: 9.5%;
    left: 27.5%;
    width: 44%;
    height: 20%;
    border: none;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    z-index: 10;
    display: grid;
    place-items: center;
    transition: background 0.2s ease;
}

.pine-blackboard-entry:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pine-blackboard-entry-label {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pine-blackboard-entry:hover .pine-blackboard-entry-label {
    opacity: 1;
    transform: translateY(0);
}

.pine-classroom-bg {
    display: block;
    height: 100%;
    inset: 0;
    object-fit: fill;
    pointer-events: none;
    position: absolute;
    user-select: none;
    width: 100%;
    z-index: 0;
}

.pine-classroom-topbar {
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(92, 61, 46, 0.12);
    color: #5c3d2e;
    display: flex;
    font-size: 14px;
    justify-content: space-between;
    left: 50%;
    max-width: 768px;
    min-height: 42px;
    padding: 8px 24px;
    position: absolute;
    top: 16px;
    transform: translateX(-50%);
    width: min(86vw, 768px);
    z-index: 50;
}

.pine-classroom-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.pine-classroom-title strong {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.pine-classroom-title span,
.pine-focus-status {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.pine-classroom-actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

.pine-focus-status {
    padding: 0;
}

.pine-room-close {
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(92, 61, 46, 0.12);
    color: #5c3d2e;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 30px;
    font-weight: 300;
    height: 46px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 4px;
    position: absolute;
    right: 22px;
    top: 16px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 46px;
    z-index: 50;
}

.pine-room-close:hover,
.pine-room-close:focus-visible {
    background: rgba(255, 255, 255, 0.48);
    outline: none;
    transform: translateY(-1px);
}

.pine-seat-grid {
    bottom: 15%;
    display: grid;
    gap: 10% 10%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    left: 15%;
    pointer-events: none;
    position: absolute;
    right: 15%;
    top: 35%;
    z-index: 10;
}

.pine-desk-cell {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: space-between;
    padding: 0 5.5%;
    width: 100%;
}

.pine-seat-hotspot {
    align-items: center;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: clamp(12px, 1vw, 15px);
    font-weight: 700;
    height: 76%;
    justify-content: center;
    min-height: 28px;
    padding: 0;
    pointer-events: auto;
    transition: transform 0.3s ease;
    width: 45%;
}

.pine-seat-hotspot:hover,
.pine-seat-hotspot:focus-visible {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    outline: none;
    transform: translateY(-2px);
}

.pine-seat-hotspot span {
    opacity: 0;
    text-shadow: 0 2px 8px rgba(92, 61, 46, 0.35);
    transition: opacity 0.3s ease;
}

.pine-seat-hotspot:hover span,
.pine-seat-hotspot:focus-visible span {
    opacity: 1;
}

.pine-focus-modal-overlay {
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 0 16px;
    position: fixed;
    z-index: 50;
}

.pine-focus-modal-overlay[hidden] {
    display: none;
}

.pine-focus-modal-card {
    background: #fdfbf7;
    border-radius: 32px;
    box-shadow: 0 20px 44px rgba(92, 61, 46, 0.18);
    max-width: 384px;
    padding: 32px;
    width: 100%;
}

.pine-focus-modal-header {
    margin-bottom: 30px;
    text-align: center;
}

.pine-focus-modal-header h2 {
    color: #5c3d2e;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.pine-focus-modal-header p {
    color: #8c7a6b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 8px 0 0;
}

.pine-focus-field h3 {
    color: #8c7a6b;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 10px;
    text-align: left;
}

.pine-duration-options {
    display: flex;
    gap: 10px;
}

.pine-duration-option {
    background: transparent;
    border: 1px solid #e8dcc8;
    border-radius: 999px;
    color: #8c7a6b;
    cursor: pointer;
    flex: 1 1 0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    min-height: 40px;
    padding: 8px 10px;
    text-align: center;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pine-duration-option:hover,
.pine-duration-option:focus-visible {
    background: rgba(245, 235, 225, 0.5);
    outline: none;
}

.pine-duration-option.is-selected {
    background: #b58b66;
    border-color: #b58b66;
    box-shadow: 0 1px 3px rgba(92, 61, 46, 0.12);
    color: #fff;
}

.pine-topic-field {
    margin-top: 28px;
}

.pine-select-wrap {
    position: relative;
}

.pine-topic-select {
    -webkit-appearance: none;
    appearance: none;
    background: #fdfbf7;
    border: 2px solid #e8dcc8;
    border-radius: 16px;
    color: #5c3d2e;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    min-height: 48px;
    outline: none;
    padding: 12px 44px 12px 16px;
    transition: border-color 0.18s ease;
    width: 100%;
}

.pine-topic-select:focus {
    border-color: #b58b66;
}

.pine-topic-select:invalid {
    color: #8c7a6b;
}

.pine-select-arrow {
    fill: none;
    height: 22px;
    pointer-events: none;
    position: absolute;
    right: 16px;
    stroke: #8c7a6b;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
}

.pine-start-focus-btn {
    background: #b58b66;
    border: none;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(92, 61, 46, 0.14);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 32px;
    min-height: 56px;
    padding: 16px;
    transition: background-color 0.18s ease, transform 0.18s ease;
    width: 100%;
}

.pine-start-focus-btn:hover,
.pine-start-focus-btn:focus-visible {
    background: #a37a55;
    outline: none;
    transform: translateY(-1px);
}

@media (max-width: 860px) {
    .pine-classroom-topbar {
        width: min(92vw, 720px);
    }
}

@media (max-aspect-ratio: 1608 / 1202) {
    .pine-game-board {
        height: 100vh;
        width: calc(100vh * 1608 / 1202);
    }
}

@media (max-width: 560px) {
    .pine-classroom-topbar {
        gap: 8px;
        justify-content: center;
        padding: 8px 14px;
        top: 10px;
        width: 94vw;
    }

    .pine-classroom-actions {
        gap: 8px;
    }

    .pine-focus-status {
        display: none;
    }

    .pine-room-close {
        height: 40px;
        right: 12px;
        top: 10px;
        width: 40px;
    }
}

.pine-focus-desk-page {
    background: #ddb988;
    box-sizing: border-box;
    font-family: var(--kanau-font-display);
    height: 100vh;
    margin: 0;
    max-width: none;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.pine-focus-desk-page *,
.pine-focus-desk-page *::before,
.pine-focus-desk-page *::after {
    box-sizing: border-box;
}

.pine-focus-desk-shell {
    background: #ddb988;
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100%;
}

@keyframes focusEnter {
    0% {
        filter: blur(0);
        opacity: 1;
        transform: scale(1);
    }

    100% {
        filter: blur(4px);
        opacity: 0.85;
        transform: scale(1.05);
    }
}

.animate-focus-enter {
    animation: focusEnter 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.pine-focus-desk-bg {
    display: block;
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    position: absolute;
    user-select: none;
    width: 100%;
    z-index: 0;
}

.pine-focus-desk-foreground-wrap {
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 50%;
    max-width: 1600px;
    min-width: 120vw;
    position: absolute;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
}

.pine-focus-desk-foreground {
    display: block;
    filter: drop-shadow(0 25px 25px rgba(0, 0, 0, 0.35));
    height: auto;
    object-fit: contain;
    object-position: bottom;
    pointer-events: none;
    user-select: none;
    width: 100%;
}

.pine-focus-leave {
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    left: 32px;
    padding: 10px 20px;
    position: absolute;
    top: 32px;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 20;
}

.pine-focus-leave:hover,
.pine-focus-leave:focus-visible {
    color: #fff;
    outline: none;
}

.pine-focus-pause {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    left: 154px;
    padding: 10px 20px;
    position: absolute;
    top: 32px;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 20;
}

.pine-focus-pause:hover,
.pine-focus-pause:focus-visible {
    color: #fff;
    outline: none;
}

.pine-focus-countdown {
    color: #fff;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
    font-size: clamp(48px, 7vw, 72px);
    font-weight: 700;
    left: 50%;
    letter-spacing: 0.12em;
    line-height: 1;
    position: absolute;
    text-shadow: 0 0 24px rgba(255, 255, 255, 0.34);
    top: 15%;
    transform: translateX(-50%);
    z-index: 20;
}

.pine-sticky-input {
    background: transparent;
    border: none;
    color: #5c3d2e;
    display: block;
    font: inherit;
    font-size: 12px;
    height: 22%;
    left: 24%;
    line-height: 1.45;
    outline: none;
    padding: 4px;
    position: absolute;
    resize: none;
    top: 30%;
    transform: rotate(-2deg);
    width: 12%;
    z-index: 30;
}

.pine-sticky-input::placeholder {
    color: rgba(140, 122, 107, 0.7);
}

@media (min-width: 640px) {
    .pine-sticky-input {
        font-size: 14px;
    }
}

.pine-notes-fab {
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    bottom: 32px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    height: 64px;
    justify-content: center;
    position: absolute;
    right: 32px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 64px;
    z-index: 20;
}

.pine-notes-fab:hover,
.pine-notes-fab:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    transform: scale(1.05);
}

.pine-notes-fab svg {
    fill: none;
    height: 26px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 26px;
}

.pine-notes-fab span {
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
}

.pine-inspiration-fab {
    background: rgba(255, 253, 247, 0.9);
    border: 1px solid rgba(215, 208, 197, 0.86);
    border-radius: 999px;
    bottom: 112px;
    color: #4d7555;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    padding: 10px 16px;
    position: absolute;
    right: 32px;
    z-index: 21;
}

.pine-inspiration-panel,
.pine-reflection-card {
    background:
        linear-gradient(rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 154, 130, 0.08) 1px, transparent 1px),
        rgba(255, 253, 247, 0.97);
    background-size: 24px 24px;
    border: 2px solid #d7d0c5;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(40, 38, 34, 0.18);
    color: #33352f;
}

.pine-inspiration-panel {
    bottom: 160px;
    display: grid;
    gap: 12px;
    padding: 16px;
    position: absolute;
    right: 32px;
    width: min(340px, calc(100vw - 48px));
    z-index: 24;
}

.pine-inspiration-panel[hidden],
.pine-reflection-overlay[hidden] {
    display: none;
}

.pine-inspiration-panel h2,
.pine-reflection-card h2 {
    color: #33352f;
    font-size: 20px;
    margin: 0;
}

.pine-inspiration-panel textarea,
.pine-inspiration-panel input,
.pine-reflection-card input,
.pine-reflection-card textarea,
.pine-reflection-card select {
    background: #fffdf7;
    border: 2px solid #b8cab2;
    border-radius: 8px;
    color: #33352f;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    min-height: 96px;
    padding: 10px;
    resize: vertical;
}

.pine-inspiration-panel input,
.pine-reflection-card input {
    min-height: 42px;
    resize: none;
}

.pine-reflection-card select {
    min-height: 42px;
}

.pine-reflection-overlay {
    align-items: center;
    background: rgba(30, 28, 24, 0.54);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: absolute;
    z-index: 60;
}

.pine-reflection-card {
    display: grid;
    gap: 14px;
    max-width: 480px;
    padding: 22px;
    width: 100%;
}

.pine-reflection-card p,
.pine-reflection-card strong {
    color: #6f7f70;
    font-size: 13px;
    font-weight: 900;
    margin: 0;
}

.pine-focus-reward {
    align-items: center;
    background: rgba(247, 236, 211, 0.72);
    border: 1px solid rgba(192, 139, 82, 0.32);
    border-radius: 8px;
    color: #7a5a32;
    display: flex;
    font-size: 14px;
    font-weight: 900;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
}

.pine-focus-reward.is-earned .acorn {
    animation: focusRewardPop 680ms ease both;
}

@keyframes focusRewardPop {
    0% { opacity: 0; transform: translateY(8px) scale(0.86) rotate(-8deg); }
    60% { opacity: 1; transform: translateY(-3px) scale(1.08) rotate(5deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

.pine-reflection-card label {
    color: #6f7f70;
    display: grid;
    font-size: 12px;
    font-weight: 900;
    gap: 7px;
    text-transform: uppercase;
}

.pine-journal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.pine-journal-actions button {
    border: 1px solid #b8cab2;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    min-height: 34px;
    padding: 0 14px;
}

.pine-journal-actions button:first-child {
    background: rgba(255, 253, 247, 0.88);
    color: #4d7555;
}

.pine-journal-actions button:last-child {
    background: #7f9a82;
    color: #fff;
}

@media (max-width: 560px) {
    .pine-focus-leave {
        left: 16px;
        top: 16px;
    }

    .pine-focus-pause {
        left: 128px;
        top: 16px;
    }

    .pine-focus-countdown {
        font-size: 44px;
        top: 18%;
    }

    .pine-notes-fab {
        bottom: 24px;
        height: 64px;
        right: 24px;
        width: 64px;
    }

    .pine-inspiration-fab {
        bottom: 98px;
        right: 18px;
    }

    .pine-inspiration-panel {
        bottom: 146px;
        right: 18px;
    }
}



/* Pine teaching mode */
#teaching-root {
    display: none;
}

body.pine-teaching-page {
    background: #ddb988;
    margin: 0;
    max-width: none;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
}

body.pine-teaching-page #teaching-root {
    display: block;
    height: 100vh;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
}
body.pine-teaching-page * {
    box-sizing: border-box;
    font-family: var(--kanau-font-display);
}

.pen-cursor {
            cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%238c5a35' d='M4 20l4.7-1 9.9-9.9-3.7-3.7L5 15.3 4 20z'/%3E%3Cpath fill='%235c3d2e' d='M16.1 4.2l1.1-1.1c.6-.6 1.6-.6 2.2 0l1.5 1.5c.6.6.6 1.6 0 2.2l-1.1 1.1-3.7-3.7z'/%3E%3C/svg%3E") 2 22, crosshair;
        }

        .laser-cursor {
            cursor: none;
        }

/* Home emergency layout override: must stay last */
body.kanau-has-global-topbar #page-materials.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 40px) 32px 144px;
}

body.kanau-has-global-topbar #home-overview {
    align-items: stretch;
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto;
    margin: 0 auto;
    max-width: 1280px;
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    grid-column: span 5;
    grid-row: auto;
    justify-content: space-between;
    min-height: 560px;
    padding: 32px;
    place-items: initial;
}

body.kanau-has-global-topbar .tree-card::after {
    display: none;
}

body.kanau-has-global-topbar .growth-tree {
    align-self: center;
    flex: 1 1 auto;
    height: clamp(250px, 36vh, 390px);
    margin: 8px auto 24px;
    max-width: 100%;
    transform: scale(1.08);
}

body.kanau-has-global-topbar .daily-goal-panel {
    flex: 0 0 auto;
    grid-column: auto;
    grid-row: auto;
    margin-top: 12px;
    padding: 20px;
    position: relative;
    z-index: 3;
}

body.kanau-has-global-topbar .home-hub-actions {
    align-self: stretch;
    display: grid;
    gap: 24px;
    grid-column: span 7;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 560px;
}

body.kanau-has-global-topbar .hub-action {
    align-items: flex-start;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    min-width: 0;
    padding: 32px;
}

body.kanau-has-global-topbar .hub-action-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    display: flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #292524;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-top: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: #78716c;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.kanau-has-global-topbar #home-overview {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        grid-column: 1;
        min-height: auto;
    }

    body.kanau-has-global-topbar .home-hub-actions {
        grid-template-columns: 1fr;
    }
}


/* KanAU full-bleed workspace reset */
body.kanau-has-global-topbar {
    padding-top: 0;
    overflow-x: hidden;
}

body.kanau-has-global-topbar #home-app {
    max-width: none;
    min-height: 100vh;
    padding: 0;
    width: 100vw;
}

body.kanau-has-global-topbar #page-materials.page.active {
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) * 2 + 28px) clamp(24px, 5vw, 72px) 48px;
}

body.kanau-has-global-topbar #home-overview {
    align-items: stretch;
    display: grid;
    gap: clamp(24px, 4vw, 56px);
    grid-template-columns: minmax(320px, 0.9fr) minmax(480px, 1.1fr);
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - var(--kanau-topbar-height, 64px) - var(--kanau-topbar-offset, 16px) * 2 - 76px);
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-self: stretch;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.88), transparent 28%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(234, 227, 210, 0.36));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(75, 68, 58, 0.12);
    display: grid;
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    overflow: hidden;
    padding: clamp(28px, 4vw, 54px);
    place-items: center;
    position: relative;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card::before {
    color: rgba(45, 56, 50, 0.68);
    content: "Today's Focus";
    font-size: 12px;
    font-weight: 900;
    left: clamp(28px, 4vw, 54px);
    letter-spacing: 0.18em;
    position: absolute;
    text-transform: uppercase;
    top: clamp(26px, 3vw, 42px);
}

body.kanau-has-global-topbar .tree-card::after {
    background:
        radial-gradient(circle at 36% 26%, #2f3b35 0 4px, transparent 5px),
        radial-gradient(circle at 64% 26%, #2f3b35 0 4px, transparent 5px),
        radial-gradient(circle at 50% 44%, rgba(214, 170, 124, 0.78) 0 18px, transparent 19px),
        linear-gradient(#f7f3eb, #ede3d2);
    border-radius: 48% 48% 42% 42%;
    bottom: clamp(24px, 4vw, 54px);
    box-shadow: inset -18px -20px 0 rgba(193, 183, 165, 0.2), 0 24px 46px rgba(74, 61, 49, 0.16);
    content: "";
    height: 138px;
    position: absolute;
    right: clamp(24px, 5vw, 72px);
    width: 118px;
}

body.kanau-has-global-topbar .pinecone-count {
    align-self: start;
    justify-self: start;
    margin: 38px 0 0;
}

body.kanau-has-global-topbar .pinecone-count strong {
    color: #31463d;
    font-size: clamp(36px, 6vw, 76px);
    letter-spacing: -0.03em;
}

body.kanau-has-global-topbar .growth-tree {
    height: min(46vh, 430px);
    transform: scale(1.35);
    transform-origin: center;
}

body.kanau-has-global-topbar .daily-goal-panel {
    align-self: end;
    background: rgba(255, 255, 255, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: 0 18px 60px rgba(75, 68, 58, 0.1);
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    padding: 22px;
}

body.kanau-has-global-topbar .daily-goal-bar {
    background: rgba(48, 65, 57, 0.1);
    height: 10px;
}

body.kanau-has-global-topbar .daily-goal-fill {
    background: linear-gradient(90deg, #315f4e, #a8b9a8);
}

body.kanau-has-global-topbar .home-hub-actions {
    align-self: stretch;
    display: grid;
    gap: clamp(20px, 3vw, 34px);
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    min-height: 0;
}

body.kanau-has-global-topbar .hub-action {
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(75, 68, 58, 0.12);
    gap: 18px;
    justify-content: flex-end;
    min-height: 420px;
    overflow: hidden;
    padding: clamp(28px, 4vw, 48px);
    position: relative;
    text-align: left;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

body.kanau-has-global-topbar .hub-action:hover {
    border-color: rgba(49, 95, 78, 0.3);
    box-shadow: 0 34px 110px rgba(75, 68, 58, 0.17);
    transform: translateY(-4px);
}

body.kanau-has-global-topbar .hub-action::before {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.72), transparent 34%);
    border-radius: 24px;
    content: "";
    inset: 22px;
    pointer-events: none;
    position: absolute;
}

body.kanau-has-global-topbar .hub-action-language {
    background: linear-gradient(145deg, rgba(211, 230, 214, 0.86), rgba(246, 242, 232, 0.56));
}

body.kanau-has-global-topbar .hub-action-revision {
    background: linear-gradient(145deg, rgba(232, 222, 209, 0.9), rgba(255, 255, 255, 0.5));
}

body.kanau-has-global-topbar .hub-action-icon {
    border-radius: 22px;
    height: 64px;
    margin: 0;
    position: relative;
    width: 64px;
    z-index: 1;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #26312d;
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 0.94;
    position: relative;
    z-index: 1;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: rgba(38, 49, 45, 0.58);
    font-size: 15px;
    font-weight: 850;
    position: relative;
    z-index: 1;
}

body.kanau-has-global-topbar .bottom-nav {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    bottom: 24px;
    box-shadow: 0 18px 60px rgba(75, 68, 58, 0.14);
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 4px;
    left: 50%;
    max-width: min(560px, calc(100vw - 32px));
    padding: 8px;
    width: auto;
    -webkit-backdrop-filter: blur(24px) saturate(130%);
    backdrop-filter: blur(24px) saturate(130%);
}

body.kanau-has-global-topbar .bottom-nav .nav-btn {
    border-radius: 999px;
    padding: 8px 12px;
}

body.kanau-has-global-topbar .bottom-nav .nav-btn.active,
body.kanau-has-global-topbar .bottom-nav .nav-btn:hover {
    background: rgba(49, 95, 78, 0.1);
    color: #315f4e;
}

@media (max-width: 980px) {
    body.kanau-has-global-topbar #home-overview {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .daily-goal-panel,
    body.kanau-has-global-topbar .home-hub-actions {
        grid-column: 1;
        grid-row: auto;
    }

    body.kanau-has-global-topbar .home-hub-actions {
        grid-template-columns: 1fr;
    }
}

/* Final Home desktop grid fix: keep this block after the full-bleed reset */
body.kanau-has-global-topbar #page-materials.page.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 40px) 32px 144px;
}

body.kanau-has-global-topbar #home-overview {
    align-items: stretch;
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto;
    margin: 0 auto;
    max-width: 1280px;
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
    width: 100%;
}

body.kanau-has-global-topbar .tree-card {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    grid-column: span 5;
    grid-row: auto;
    justify-content: space-between;
    min-height: 560px;
    padding: 32px;
    place-items: initial;
}

body.kanau-has-global-topbar .tree-card::after {
    display: none;
}

body.kanau-has-global-topbar .growth-tree {
    align-self: center;
    flex: 1 1 auto;
    height: clamp(250px, 36vh, 390px);
    margin: 8px auto 24px;
    max-width: 100%;
    transform: scale(1.08);
}

body.kanau-has-global-topbar .daily-goal-panel {
    flex: 0 0 auto;
    grid-column: auto;
    grid-row: auto;
    margin-top: 12px;
    padding: 20px;
    position: relative;
    z-index: 3;
}

body.kanau-has-global-topbar .home-hub-actions {
    align-self: stretch;
    display: grid;
    gap: 24px;
    grid-column: span 7;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 560px;
}

body.kanau-has-global-topbar .hub-action {
    align-items: flex-start;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    min-width: 0;
    padding: 32px;
}

body.kanau-has-global-topbar .hub-action-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    display: flex;
    flex: 0 0 48px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

body.kanau-has-global-topbar .hub-action-title {
    color: #292524;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-top: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.kanau-has-global-topbar .hub-action-meta {
    color: #78716c;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        justify-content: flex-start;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.kanau-has-global-topbar #home-overview {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        grid-column: 1;
        min-height: auto;
    }

    body.kanau-has-global-topbar .home-hub-actions {
        grid-template-columns: 1fr;
    }
}

/* Final responsive viewport fit overrides. Keep this block at EOF. */
html,
body {
    min-width: 0;
    overflow-x: hidden;
}

body.kanau-has-global-topbar #page-materials.page.active {
    justify-content: flex-start;
}

body.kanau-has-global-topbar #home-overview {
    min-height: auto;
}

@media (max-height: 820px) {
    body.kanau-has-global-topbar #page-materials.page.active {
        padding-top: calc(var(--kanau-topbar-height, 64px) + var(--kanau-topbar-offset, 16px) + 24px);
    }

    body.kanau-has-global-topbar .tree-card,
    body.kanau-has-global-topbar .home-hub-actions {
        min-height: clamp(320px, 62vh, 520px);
    }

    body.kanau-has-global-topbar .hub-action {
        min-height: clamp(156px, 28vh, 300px);
        padding: clamp(18px, 3vh, 32px);
    }

    body.kanau-has-global-topbar .growth-tree {
        height: clamp(180px, 30vh, 320px);
    }
}

@media (max-width: 640px) {
    #home-app {
        padding-left: clamp(14px, 4vw, 22px);
        padding-right: clamp(14px, 4vw, 22px);
    }

    body.kanau-has-global-topbar #page-materials.page.active {
        padding-left: 16px;
        padding-right: 16px;
    }
}

body.pine-lobby-page,
body.pine-classroom-page,
body.pine-focus-desk-page,
body.pine-teaching-page {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.pine-lobby,
.pine-classroom-shell,
.pine-focus-desk-shell {
    height: 100dvh;
}

.pine-lobby {
    padding: 0;
}

.pine-canvas {
    height: min(100dvh, 175.56vw);
    max-height: 100dvh;
    max-width: 100vw;
}

.pine-bg-image {
    height: 100%;
    width: auto;
}

.pine-game-board {
    height: min(100dvh, 74.75vw);
    min-height: 0;
    min-width: 0;
    width: min(100vw, 133.78dvh);
}

.pine-focus-desk-bg {
    object-fit: contain;
}

.pine-focus-desk-foreground-wrap {
    max-width: 100vw;
    min-width: 0;
    width: min(100vw, 177.6dvh);
}

.pine-focus-countdown {
    font-size: clamp(32px, 7vmin, 72px);
}

body.pine-teaching-page #teaching-root {
    height: 100dvh;
    overflow: auto;
}

/* Data Hub responsive containment. */
#page-stats.active {
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
}

.memory-page-header,
#stats-content {
    box-sizing: border-box;
    max-width: min(1180px, 100%);
    min-width: 0;
    width: 100%;
}

.data-hub-split,
.memory-archive,
.memory-dashboard,
.memory-metrics,
.memory-notes,
.activity-chart,
.emotional-chart-main,
.weekly-mood-row,
.diary-card-stack {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.data-hub-split {
    align-items: start;
    grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
}

.data-hub-split .memory-archive {
    min-height: calc(100vh - 178px);
    position: sticky;
    top: 18px;
}

.memory-metrics {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.memory-review-banner,
.memory-metric-card,
.activity-chart {
    overflow-wrap: anywhere;
}

.emotional-chart-main {
    grid-template-columns: minmax(0, 0.7fr) minmax(180px, 1fr);
}

.emotional-donut {
    height: clamp(176px, 30vw, 252px);
    margin-left: 0;
    width: clamp(176px, 30vw, 252px);
}

.emotional-donut svg {
    height: calc(100% + 14px);
    width: calc(100% + 14px);
}

.weekly-mood-row {
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.weekly-mood-day {
    flex: 0 0 38px;
}

@media (max-width: 900px) {
    .data-hub-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .data-hub-split .memory-archive {
        min-height: 0;
        position: static;
        top: auto;
    }
}

@media (max-width: 760px) {
    #page-stats.active {
        padding-left: 14px;
        padding-right: 14px;
    }

    .memory-archive {
        padding: clamp(16px, 4vw, 20px);
    }

    .memory-title-row h2 {
        font-size: clamp(30px, 9vw, 54px);
        line-height: 1.02;
    }

    .memory-review-banner {
        border-radius: 22px;
        font-size: clamp(14px, 4vw, 18px);
        line-height: 1.25;
        padding: 14px 16px;
    }

    .memory-metrics {
        grid-template-columns: 1fr;
    }

    .emotional-chart-main {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .emotional-breakdown {
        justify-self: stretch;
    }

    .emotional-donut {
        height: min(68vw, 252px);
        width: min(68vw, 252px);
    }

    .diary-card-stack {
        height: min(560px, 72vh);
    }
}

/* Stage B：小さな画面でも振り返りの入力と保存操作へ到達できる。 */
.pine-reflection-overlay {
    position: fixed;
    overflow-y: auto;
    z-index: 1000;
}
.pine-reflection-card {
    box-sizing: border-box;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
}
.diary-card.is-expanded .diary-card-body {
    max-height: 215px;
    overflow-y: auto;
    overscroll-behavior: contain;
    white-space: pre-wrap;
}

/* 後段の Home レイアウト指定よりもパネルの非表示状態を優先する。 */
#home-overview[hidden],
#revision-class-panel[hidden],
#revision-select-panel[hidden],
#revision-timer-panel[hidden] {
    display: none !important;
}

/* Stage B.2：前面選択と展開を分離。通常はdeckがスクロールを受け取る。 */
.diary-card:not(.is-expanded) { touch-action: none; }
.diary-card:not(.is-expanded) .diary-card-body { overflow: hidden; max-height: 0; }
.diary-card.is-expanded .diary-card-body { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.diary-card:focus-visible { outline: 2px solid #454544; outline-offset: -3px; }
@media (hover: hover) {
    .diary-card:not(.is-expanded):hover {
        transform: translate3d(var(--deck-x), calc(var(--deck-y) - 3px), 0) rotate(var(--deck-rotate)) scale(calc(var(--deck-scale) * 1.008));
        box-shadow: 0 6px 16px #0001;
    }
}
