/* stlview.app site layer: header, hero, page text and footer around the app (app/css stays untouched). */
html.sv-site, html.sv-site body { height: auto; overflow: visible; overflow-x: clip; }
html.sv-site body { line-height: 1.6; }
/* WCAG AA contrast on the site layer (Lighthouse 18.10): white on #6c63ff is 4.3:1, muted #71717a on the dark bg 3.5:1 */
html.sv-site { --accent: #5b54e6; --accent-hover: #4b44d4; --link: #9a94ff; --text-muted: #8f8f99; }
html.sv-site.light { --link: #4f46e5; --text-muted: #666670; }
.sv-site #app.sv-tool { height: clamp(440px, calc(100vh - 150px), 820px); height: clamp(440px, calc(100dvh - 150px), 820px); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sv-site #app.sv-tool--short { height: clamp(380px, 62vh, 620px); }
.sv-site #app .header .logo { display: none; }
.sv-site #app .sv-strip { position: absolute; }   /* the app pins the tool strip to the viewport; on a scrolling page it belongs to the tool */
.sv-site #app .header { justify-content: flex-end; padding: 8px 16px; }
.sv-site .sv-sidepanel:not(.open) { box-shadow: none; }   /* closed drawer: its shadow showed as a dark band on the right edge */
@media (max-width: 640px) {   /* 390px: the drop text cleared the left tool strip only on wide screens */
  .sv-site #app .drop-zone { padding: 0 10px 0 64px; }
  .sv-site #app .drop-content { padding: 22px 12px; }
  .sv-site #app .drop-content h2 { font-size: 19px; }
}
.site-wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.site-top { background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.site-top .site-wrap { max-width: none; display: flex; align-items: center; gap: 18px; height: 52px; }
.site-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.site-logo .logo-mark { color: var(--accent); }
.site-nav { display: flex; gap: 16px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav a { color: var(--text-secondary); text-decoration: none; font-size: 14px; white-space: nowrap; }
.site-nav a:hover { color: var(--text-primary); }
.site-cta { background: var(--accent); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.site-cta:hover { background: var(--accent-hover); }
@media (max-width: 760px) { .site-cta { display: none; } .site-nav { gap: 12px; } }
.site-top { position: relative; }
/* header language switcher: <details> dropdown, current language + caret, list anchored to the inline end (RTL-safe) */
.lang-menu { position: relative; flex: none; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; white-space: nowrap; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: var(--accent); }
.lang-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-menu .lang-caret { font-size: 11px; color: var(--text-secondary); transition: transform .15s; }
.lang-menu[open] .lang-caret { transform: rotate(180deg); }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 5000; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.lang-menu li a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; font-size: 14px; white-space: nowrap; text-align: start; }
.lang-menu li a:hover, .lang-menu li a:focus-visible { background: var(--bg-tertiary); color: var(--text-primary); outline: none; }
.lang-menu li a[aria-current] { color: var(--text-primary); font-weight: 600; }
.lang-menu li a[aria-current]::after { content: " ✓"; color: var(--accent); }
.lang-menu .lang-short { display: none; }
@media (max-width: 480px) { .lang-menu .lang-full { display: none; } .lang-menu .lang-short { display: inline; } .lang-menu summary { padding: 5px 8px; } .site-top .site-wrap { gap: 12px; } }
.hero { padding: 14px 0 12px; }
.hero h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.3px; margin: 2px 0 6px; color: var(--text-primary); }
.hero .lede { color: var(--text-secondary); font-size: 16px; max-width: 820px; margin: 0; }
.hero-note { margin-top: 8px !important; }
@media (max-width: 640px) { .hero h1 { font-size: 23px; } .hero .lede { font-size: 15px; } }
.crumbs { font-size: 13px; color: var(--text-muted); }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.page-text { padding-top: 26px; padding-bottom: 10px; }
.page-text h2 { font-size: 22px; line-height: 1.3; margin: 30px 0 10px; color: var(--text-primary); }
.page-text h3 { font-size: 17px; margin: 18px 0 6px; color: var(--text-primary); }
.page-text p { margin: 0 0 12px; max-width: 780px; }
.page-text ul, .page-text ol { margin: 0 0 14px 22px; max-width: 760px; }
.page-text li { margin: 4px 0; }
.page-text a, .hero a, .related a { color: var(--link); }
.page-text p a, .page-text li a, .page-text td a, .hero .lede a, .crumbs a { text-decoration: underline; text-underline-offset: 2px; }
.page-text table { border-collapse: collapse; width: 100%; margin: 10px 0 18px; font-size: 14.5px; display: block; overflow-x: auto; }
.page-text th, .page-text td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.page-text th { background: var(--bg-tertiary); }
.page-text code { background: var(--bg-tertiary); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.note { background: var(--bg-tertiary); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--text-secondary); font-size: 14.5px; max-width: 820px; }
.faq details { border-top: 1px solid var(--border); padding: 10px 0; }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--accent); }
.faq details[open] summary::before { content: "– "; }
.faq details p { margin: 8px 0 0; color: var(--text-secondary); }
.hub-cards, .related ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0 8px; list-style: none; padding: 0; }
.hub-cards a, .related a { display: block; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; text-decoration: none; color: var(--text-primary); }
.hub-cards a b { display: block; margin-bottom: 3px; }
.hub-cards a span { font-size: 14px; color: var(--text-secondary); }
.hub-cards a:hover, .related a:hover { border-color: var(--accent); }
.related { margin: 26px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.related h2 { font-size: 18px; margin: 0; }
.calc { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 10px; }
.calc h2 { margin-top: 0 !important; font-size: 18px !important; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px 16px; }
.calc label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.calc input, .calc select { background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font-size: 14px; max-width: 190px; }
.calc input { width: 90px; }
.calc-out { display: block; margin-top: 12px; font-weight: 600; }
.site-foot { border-top: 1px solid var(--border); background: var(--bg-secondary); margin-top: 30px; padding: 22px 0 26px; font-size: 13.5px; color: var(--text-muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.foot-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); margin-bottom: 6px; }
.foot-cols ul { list-style: none; padding: 0; }
.foot-cols li { margin: 3px 0; }
.foot-cols a { color: var(--text-secondary); text-decoration: none; }
.foot-cols a:hover { color: var(--text-primary); }
.foot-line { margin-top: 16px; }
.foot-langs { margin-top: 14px; }
.foot-langs a { color: var(--text-secondary); }
/* Japanese pages: CJK system fonts after the Latin stack (Latin words keep the UI font), no negative tracking, kinsoku line breaking */
html.sv-site:lang(ja) body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif; line-break: strict; word-break: normal; overflow-wrap: anywhere; }
html.sv-site:lang(ja) .hero h1 { letter-spacing: 0; line-height: 1.35; }
html.sv-site:lang(ja) .page-text p, html.sv-site:lang(ja) .page-text li, html.sv-site:lang(ja) .faq details p { line-height: 1.85; }
html.sv-site:lang(ja) .page-text h2 { line-height: 1.45; }
