/* Tabs and usability fixes. Loaded last; keeps the existing colours, fonts and shapes. */

/* ---------- Tabs ---------- */
.has-tabs main>[data-panel][hidden]{display:none!important}
.has-tabs main>[data-panel].panel-first:not(.hero){padding-top:36px}
.mobile-shortcuts{display:none!important}
body>header{flex-wrap:nowrap;justify-content:space-between;gap:20px;min-height:0;padding-top:14px;padding-bottom:14px}
body>header nav.site-tabs{order:0;width:auto;margin:0 0 0 auto;padding:0;border:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:4px;font-size:15px}
body>header .language-picker{margin:0}
.site-tabs a{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:8px 14px;border-radius:999px;color:var(--ink);font-weight:700;white-space:nowrap;line-height:1.3}
.site-tabs a::after{display:none!important}
.site-tabs a:hover{background:var(--pale)}
.site-tabs a[aria-current=page]{background:var(--yellow);color:var(--ink)}
.site-tabs svg{width:20px;height:20px;flex-shrink:0}
.site-tabs a:focus-visible{outline:3px solid #3577b9;outline-offset:2px}
main h1[tabindex="-1"]:focus:not(:focus-visible),main h2[tabindex="-1"]:focus:not(:focus-visible){outline:none}
html:not([lang=ja]) body>header nav.site-tabs{gap:2px;flex-wrap:nowrap}

@media(max-width:1200px){
 body>header{flex-wrap:wrap;gap:10px 16px}
 body>header nav.site-tabs{order:3;width:100%;justify-content:center;margin:0}
 body>header .language-picker{margin-left:auto}
}

/* Phones: the tabs become a bar fixed to the bottom of the screen. */
@media(max-width:760px){
 body>header{flex-wrap:nowrap;align-items:center;padding:8px 16px 6px 20px;gap:12px}
 body>header .brand img{width:104px;height:auto}
 body>header .language-picker{margin-left:auto}
 body>header nav.site-tabs{position:fixed;left:0;right:0;bottom:0;z-index:40;width:auto;margin:0;gap:0;justify-content:stretch;padding:6px 2px calc(6px + env(safe-area-inset-bottom));background:#fffdf5f5;border-top:1px solid #cbd8c7;box-shadow:0 -4px 18px #203c2f0f;backdrop-filter:blur(12px)}
 .site-tabs a{flex:1 1 0;min-width:0;flex-direction:column;justify-content:center;gap:2px;min-height:56px;padding:4px 0;border-radius:14px;font-size:12px;letter-spacing:-.03em;color:var(--green)}
 .site-tabs a span{max-width:100%;overflow:hidden;text-overflow:ellipsis}
 .site-tabs a[aria-current=page]{background:#fff3aa;color:var(--ink)}
 .site-tabs.input-focused{display:none}
 body{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
 .has-tabs main>[data-panel].panel-first:not(.hero){padding-top:20px}
}

@media(max-width:359px){.site-tabs a{font-size:11px;letter-spacing:-.09em}.site-tabs a span{text-overflow:clip}}

/* ---------- Home ---------- */
.demo{font-size:13px;letter-spacing:.08em}
.demo span{font-size:13px}
.intro>.small{font-size:13px!important}
.hero-actions{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin:22px 0 4px}
.hero-actions .button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:52px;padding:12px 26px;margin:0;text-decoration:none}
.hero-actions .button b{font-weight:700;white-space:nowrap}
html:not([lang=ja]) .hero-actions .button b{white-space:normal}
.hero-actions .button svg{width:22px;height:22px;flex-shrink:0}
.hero-actions .hero-main{min-height:56px;padding:14px 32px;font-size:17px}
.hero-sub{display:flex;flex-wrap:wrap;gap:10px}
.button.outline{background:#fff;color:var(--green);border:1.5px solid var(--green);font-size:15px}
.button.outline:hover{background:var(--pale)}
.slide-controls{gap:2px;padding:2px}
.slide-controls button,.slide-controls #slide-prev,.slide-controls #slide-next{min-width:44px;min-height:44px}
.slide-controls #slide-label{font-size:13px}
.slide-controls #slide-pause{font-size:13px}
.handwritten{color:#17603a}
.handwritten span{font-size:13px}
.min-sticker small{font-size:12px}
.welcome-icon svg{width:22px;height:22px}
.welcome-icon{color:var(--ink)}
.welcome-card p{font-size:14px}
.welcome-arrow{font-size:26px;line-height:1}
.eyebrow{font-size:13px;letter-spacing:.1em}
.together .eyebrow{font-size:13px}
.together>.small{font-size:13px}
.together{min-height:0}
.section-top h2 span{display:inline-block}
html:not([lang=ja]) .section-top h2 span{display:inline}
html:not([lang=ja]) .section-top h2 span+span::before{content:" "}
@media(max-width:760px){
 .hero{padding-top:18px}
 .hero-actions{align-items:stretch;margin-top:18px}
 .hero-actions .button{width:100%}
 .hero-sub{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .hero-sub .button{padding:10px 8px;font-size:14px;gap:6px}
 .hero-sub .button svg{width:20px;height:20px}
 .intro>p:not(.eyebrow){font-size:15px}
 .together p{font-size:14px}
 .together>.small{font-size:13px}
}
@media(max-width:420px){
 .intro>.small{font-size:13px!important}
 .handwritten span{font-size:12px}
 .min-sticker small{font-size:12px}
 .slide-controls #slide-label{font-size:13px;min-width:92px}
}
html:not([lang=ja]) .hero-sub .button{white-space:normal;line-height:1.3}

/* ---------- Letters ---------- */
.inbox-gateway{padding:16px 18px;gap:14px;margin-bottom:28px}
.inbox-gateway-icon{flex-basis:44px;height:44px;border-radius:50%;font-size:20px}
.inbox-gateway h3{margin:0;font-size:1.05rem}
.inbox-gateway p{font-size:14px;color:#3f5245}
.inbox-gateway>.reply-box-link{min-height:48px;padding:10px 22px}
@media(max-width:1000px){.inbox-gateway{flex-wrap:nowrap}.inbox-gateway>.reply-box-link{margin-left:0}}
@media(max-width:520px){
 .inbox-gateway{flex-wrap:wrap;padding:14px}
 .inbox-gateway-copy{flex-basis:calc(100% - 58px)}
 .inbox-gateway>.reply-box-link{width:100%;margin:2px 0 0}
}
#letter-form label{font-size:15px}
#letter-form input:not([type=checkbox]):not([type=radio]),#letter-form textarea{font-size:16px;min-height:48px}
#letter-form .counter{font-size:14px}
.public-message-note,.private-reply-intro p{font-size:14px!important}
.letter-visibility{border:0;padding:0;margin:20px 0}
.letter-visibility legend{padding:0;margin-bottom:8px;font-size:15px}
.letter-visibility label{display:flex;align-items:center;gap:12px;min-height:56px;margin:0 0 10px;padding:10px 14px;border:1.5px solid #cfd8ca;border-radius:14px;background:#fff;font-size:15px;line-height:1.5;cursor:pointer}
.letter-visibility label:has(input:checked){border:2px solid var(--green);background:var(--pale);font-weight:700}
.letter-visibility input{width:22px;height:22px;margin:0;flex-shrink:0}
#letter-form input[type=checkbox],#art-form input[type=checkbox]{width:22px;height:22px;flex-shrink:0;accent-color:var(--green)}
.letters-controls{gap:8px}
.letters-controls .more-button{min-width:0;min-height:44px}
.letters-controls .more-button[aria-label]{width:44px;height:44px;padding:0;font-size:18px;border-radius:50%}
.letters-controls .letters-home{font-size:14px;padding:8px 18px}
.letters-position{min-width:52px;text-align:center;font-size:14px}
.letter-wall .small,.pending-count{font-size:14px}

/* ---------- Fan art ---------- */
#fan-art>.art-post{margin:0 0 28px;padding:0;border:0;background:transparent}
#fan-art>.art-post>summary{display:flex;align-items:center;justify-content:center;gap:10px;width:max-content;max-width:100%;min-height:56px;padding:12px 32px;border-radius:99px;background:var(--green);color:#fff;font-size:17px;box-shadow:0 5px 12px #1b5d4024}
#fan-art>.art-post>summary:hover{background:#185f39}
#fan-art>.art-post>summary span{font-size:22px;line-height:1}
#fan-art>.art-post[open]{padding:0 0 8px}
#fan-art>.art-post[open]>summary{margin-bottom:18px;background:#fff;color:var(--green);border:1.5px solid var(--green);box-shadow:none}
#fan-art>.art-post[open]>summary span{transform:rotate(45deg)}
#fan-art>.art-post #art-form{padding:22px;border:1px solid var(--line);border-radius:20px;background:#fff}
.art-reply-note{margin:6px 0 16px}
.art-reply-note a,.art-reply-tab-link{color:var(--green);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.art-gallery-links .small,.art-social p{font-size:14px}
#art-form .small{font-size:14px}
@media(max-width:760px){
 #fan-art>.art-post>summary{width:100%}
 #fan-art>.art-post #art-form{padding:16px}
}

/* ---------- Small text elsewhere ---------- */
.section-top p:not(.eyebrow){font-size:15px}
.site-footer>span{font-size:13px}
@media(max-width:760px){.section-top p:not(.eyebrow){font-size:14px}.demo,.demo span{font-size:13px}}
