/* ═══ LEGAL — Terms and Conditions viewer + standalone page ═══ */
#legal-sheet { position: fixed; inset: 0; z-index: 10010; display: none; align-items: center; justify-content: center; }
#legal-sheet.open { display: flex; }
.lg-bg { position: absolute; inset: 0; background: rgba(10,20,10,0.6); }
.lg-box { position: relative; display: flex; flex-direction: column; width: min(720px, 100%); height: min(88vh, 860px); background: var(--surface); color: #1B2C1A;
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,0.35); overflow: hidden; font-family: 'Helvetica Neue', Arial, sans-serif; }
.lg-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.lg-hd h2 { font-size: 20px; font-weight: 800; margin: 0; }
.lg-hd p { margin: 2px 0 0; font-size: 12px; color: #6B7A6E; }
.lg-x { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #F1F4EF; color: #1B2C1A; font-size: 18px; border: 0; cursor: pointer; flex-shrink: 0; }
.lg-x:hover, .lg-x:focus-visible { background: #E2E8DE; outline: none; }
.lg-toc { display: flex; gap: 6px; padding: 4px 20px 12px; overflow-x: auto; flex-shrink: 0; border-bottom: 1px solid #E6EAE2; scrollbar-width: none; }
.lg-toc::-webkit-scrollbar { display: none; }
.lg-toc button { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; border: 1px solid #DCE3D8; background: var(--surface); color: #44544A; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lg-toc button:hover, .lg-toc button.on { background: #2F7D3A; border-color: #2F7D3A; color: #fff; }
.lg-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 24px; font-size: 14px; line-height: 1.65; color: #34453A; -webkit-overflow-scrolling: touch; }
.lg-body:focus { outline: none; }
.lg-updated { font-size: 12px; color: #6B7A6E; margin: 8px 0 4px; }
.lg-sec { padding: 14px 0 6px; border-bottom: 1px solid #EEF1EB; }
.lg-sec:last-child { border-bottom: 0; }
.lg-sec h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; color: #14261A; margin: 0 0 8px; line-height: 1.3; }
.lg-sec h3 span { width: 26px; height: 26px; border-radius: 8px; background: var(--sprout-lt); color: #2F7D3A; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lg-sec h4 { font-size: 14px; font-weight: 700; color: #2F7D3A; margin: 14px 0 4px; }
.lg-sec p { margin: 0 0 10px; }
.lg-sec ul { margin: 0 0 10px; padding-left: 20px; }
.lg-sec li { margin: 0 0 6px; }
.lg-contact { display: grid; gap: 8px; padding: 14px 16px; background: var(--sprout-lt); border: 1px solid #DCE9D8; border-radius: 12px; }
.lg-contact div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-contact span { color: #6B7A6E; font-size: 13px; }
.lg-contact a { color: #2F7D3A; font-weight: 700; text-decoration: none; word-break: break-all; }
.lg-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #E6EAE2; flex-shrink: 0; }
.lg-btn { padding: 11px 20px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border: 1.5px solid transparent; min-height: 44px; }
.lg-btn-ghost { background: var(--surface); border-color: #D5DDD0; color: #1B2C1A; }
.lg-btn-primary { background: #2F7D3A; color: #fff; }
.lg-btn[hidden] { display: none; }
body.lg-lock { overflow: hidden; }
@media (max-width: 640px) {
  #legal-sheet { align-items: flex-end; }
  .lg-box { width: 100%; height: 92vh; height: 92dvh; border-radius: 18px 18px 0 0; }
  .lg-ft .lg-btn { flex: 1; }
}

/* standalone page (terms.html) */
.lg-page { max-width: 760px; margin: 0 auto; padding: 0 0 48px; font-family: 'Helvetica Neue', Arial, sans-serif; color: #1B2C1A; }
.lg-page-hd { padding: 28px 20px 8px; }
.lg-page-hd h1 { font-size: 30px; font-weight: 800; margin: 8px 0 2px; }
.lg-page-hd p { margin: 0; color: #6B7A6E; font-size: 14px; }
.lg-back { display: inline-block; color: #2F7D3A; font-weight: 700; text-decoration: none; font-size: 14px; }
.lg-page .lg-toc { position: sticky; top: 0; background: var(--surface); z-index: 2; padding-top: 12px; }
.lg-page-body { overflow: visible; }
.lg-sec { scroll-margin-top: 64px; }
