html, body { height: 100%; overflow: hidden; }
html[data-restoring-account] body > :not(#area-feedback) { display: none !important; }
.forest-new-page #area-viewport { position: fixed; inset: 55px 0 0; overflow: hidden; isolation: isolate; }
.area-pane { position: absolute; inset: 0; min-width: 0; min-height: 0; background: #f7f4e8; }
.area-pane > harvest-list-component, .area-pane > canopy-component { display: block; width: 100%; height: 100%; }
.area-notice { max-width: 800px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.area-notice h1 { color: #4c7744; font-size: 28px; }
.area-notice p { color: #6b6b6b; line-height: 1.6; }
#area-feedback { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 48px); padding: 10px 16px; border-radius: 8px; background: #fffefa; color: #304f2b; box-shadow: 0 2px 10px #24351c24; }
#area-feedback[hidden] { display: none; }
#area-feedback[data-state="loading"] { pointer-events: none; animation: area-loading .2s .15s backwards; }
#area-retry { font: inherit; margin-left: 8px; border: 0; background: transparent; color: #4c7744; cursor: pointer; text-decoration: underline; }
bottom-navigation-component .bottom-navbar { touch-action: pan-y; }
@keyframes area-loading { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #area-feedback[data-state="loading"] { animation: none; } }

.area-loading { padding: 40px 24px; text-align: center; color: #677460; }
.area-refresh-error { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 10; max-width: calc(100% - 32px); padding: 10px 16px; background: #fffefa; border-radius: 8px; box-shadow: 0 2px 10px #24351c24; }

language-switcher-component .language-switcher:has(treesy-select) > span { visibility: hidden; }
language-switcher-component .language-switcher > treesy-select { position: absolute; inset: 0; width: 100%; height: 100%; font: inherit; }
.harvest-toolbar > treesy-select[toolbar] { width: auto; min-width: 200px; flex: 0 1 240px; }
@media(max-width:900px), (max-height:600px) and (pointer:coarse) { .harvest-toolbar > treesy-select[toolbar] { width: 100%; min-width: 0; flex-basis: 100%; } }

/* Center the navigation within the safe display bounds. Where space permits,
   reserve a 12px gap to each adjacent 44px landscape button. */
.forest-new-page bottom-navigation-component .bottom-navbar {
    --navbar-gutter: 24px;
    width: min(300px, calc(100% - var(--navbar-gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    left: calc((100% + env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 2);
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px) + var(--forest-information-row-height, 0px));
    transform: translateX(-50%) translateY(120px);
}
.forest-new-page bottom-navigation-component .bottom-navbar.visible { transform: translateX(-50%); }
/* The same 56px bar in both orientations leaves 8px above and below it in
   the 72px dock. The safe-area inset is added once, outside that spacing. */
.forest-new-page bottom-navigation-component .nav-container { box-sizing: border-box; border: 0; border-radius: 10px; padding: 4px; gap: 2px; }
.forest-new-page bottom-navigation-component .nav-button { box-sizing: border-box; min-width: 60px; min-height: 48px; flex: 1; padding: 4px; }
.forest-new-page bottom-navigation-component .nav-button-icon { width: 24px; height: 24px; margin-bottom: 2px; }
.forest-new-page bottom-navigation-component .nav-button-label { font-size: 11px; line-height: 14px; }

/* Reserve side targets only while Forest has enough safe content width. Narrow
   Forest layouts and the other areas keep the full three-button bar width. */
.forest-new-page:has(forest-columns-component[data-stacked-navigation="false"]) bottom-navigation-component .bottom-navbar {
    --navbar-gutter: 136px;
}

#bottom-nav .bottom-navbar:not(.visible) { visibility: hidden; }

#forest-information {
    position: fixed;
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    z-index: 100000;
    container-type: inline-size;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}
#forest-information[hidden] { display: none; }
.forest-information-intro {
    /* Leave room for the previous landscape arrow on wide displays. */
    max-width: calc((100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) / 2 - 226px);
    margin-bottom: 10px;
    pointer-events: auto;
}
.forest-information-footer {
    flex: none;
    text-align: end;
    color: #24451e;
    font-size: 11px;
    line-height: 12px;
}
.forest-information-footer small {
    display: block;
    font-size: inherit;
}
.forest-information-links {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.forest-information-links a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: inherit;
    pointer-events: auto;
}
/* Bring the last label row up within its 24px link targets. */
.forest-information-links:last-of-type a { align-items: flex-start; }
.forest-information-links a:focus-visible,
.forest-information-dialog button:focus-visible { outline: 2px solid #24451e; outline-offset: 2px; }

/* Keep the full three-line footer below the dock when side space is limited. */
@media (max-width: 900px) {
    .forest-new-page:has(#forest-information:not([hidden])) { --forest-information-row-height: 68px; }
    .forest-information-intro {
        max-width: none;
        min-width: 44px;
        margin-bottom: 0;
    }
    .forest-information-intro .first-time-button-icon { display: none; }
}

@media (max-width: 360px) {
    .forest-new-page:has(#forest-information:not([hidden])) { --forest-information-row-height: 104px; }
    .forest-information-intro { position: absolute; bottom: 68px; left: 0; }
    .forest-information-footer { margin-left: auto; }
}

@container (max-width: 260px) {
    .forest-information-footer { font-size: 10px; }
}

html:has(> body.forest-new-page dialog.forest-information-dialog[open]) { overflow: hidden; }
.forest-information-dialog {
    box-sizing: border-box;
    position: fixed;
    inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
        env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    margin: auto;
    width: min(480px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 0;
    border: 1px solid #d5dece;
    border-radius: 16px;
    background: #fbfaf4;
    color: #273624;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 12px 40px #0004;
}
.forest-information-dialog[open] { display: flex; flex-direction: column; }
.forest-information-dialog::backdrop { background: #0006; }
.forest-information-copy { padding: 20px 24px 0; overflow-y: auto; overscroll-behavior-y: contain; }
.forest-information-copy h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; }
.forest-information-copy p, .forest-information-copy ol, .forest-information-copy ul { margin: 0 0 16px; }
.forest-information-copy ol, .forest-information-copy ul { padding-inline-start: 22px; }
#forest-public-page {
    width: min(768px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    overflow: hidden;
}
#forest-public-page-title { margin: 0 0 16px; font-size: clamp(22px, 4vw, 30px); line-height: 1.25; }
.forest-public-page-content h2 { margin: 24px 0 12px; font-size: 18px; line-height: 1.3; }
.forest-public-page-content a { color: #24451e; overflow-wrap: anywhere; }
#forest-public-page .forest-information-actions { flex-shrink: 0; }
#forest-intro li + li { margin-block-start: 8px; }
.forest-information-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 16px;
    padding: 8px 24px 16px;
}
.forest-information-actions button {
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: #4c7744;
    color: white;
    font: inherit;
    cursor: pointer;
}
