/* 設定 → 關於：文件閱讀視窗（legal.js）。<dialog> showModal 開在最上層（疊在設定上面）；跟設定同一套亮藍面板 */
/* 整個畫面都是 dialog（點面板外面＝點到 dialog 本身就關），底色用 ::backdrop */
.lgd-ov{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;
  display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:manipulation}
.lgd-ov:not([open]){display:none}
.lgd-ov::backdrop{background:rgba(6,24,70,.62)}
/* 高度上限：100vh 是舊瀏覽器的回退；支援的用 100dvh（手機工具列展開時也不會把底部「關閉」推出畫面） */
.lgd-pn{position:relative;box-sizing:border-box;width:min(680px,94vw);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);display:flex;flex-direction:column;
  color:#123a73;background:linear-gradient(180deg,#e9f8ff,#c9ebff);border:4px solid #fff;border-radius:18px;
  box-shadow:0 0 0 4px #1d7fe0,0 0 0 7px #bfeaff,0 14px 30px rgba(0,20,70,.5);padding:0 0 12px;overflow:hidden}
.lgd-hd{flex:none;display:flex;align-items:center;gap:10px;padding:10px 12px 10px 18px;background:linear-gradient(180deg,#5cc8ff,#1d7fe0);border-bottom:3px solid #fff}
.lgd-hd b{flex:1;min-width:0;font-size:20px;font-weight:900;color:#fff;letter-spacing:2px;text-shadow:0 2px 0 #0b4aa8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lgd-x{flex:none;width:34px;height:34px;padding:0;border-radius:50%;border:3px solid #fff;background:#ff5a6a;color:#fff;font-size:16px;font-weight:900;cursor:pointer;box-shadow:0 2px 0 #b02a3a;font-family:inherit}
.lgd-x:active{transform:translateY(2px);box-shadow:none}
.lgd-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:12px 12px 0;padding:14px 18px 18px;
  background:#fff;border:2px solid #9cd0ff;border-radius:12px;font-size:15px;line-height:1.75;user-select:text;outline:none;overflow-wrap:anywhere}
.lgd-body:focus-visible{box-shadow:0 0 0 3px #ffc94a}
.lgd-body h2{margin:0 0 10px;font-size:20px;line-height:1.4;color:#1462c8}
.lgd-body h3{margin:16px 0 4px;font-size:16px;line-height:1.5;color:#0b4aa8}
.lgd-body h2 + h3{margin-top:0;color:#4a6b9a;font-size:14px}
.lgd-body p{margin:0 0 10px}
.lgd-body strong{font-weight:900}
.lgd-ul{margin:0 0 10px;padding-left:1.4em}
.lgd-ul li{margin:2px 0}
.lgd-ul li::marker{content:"・";color:#1d7fe0}
.lgd-hr{border:0;border-top:2px dashed #9cd0ff;margin:16px 0}
.lgd-a{color:#1462c8;text-decoration:underline;word-break:break-all}
.lgd-ft{flex:none;display:flex;flex-direction:column;align-items:center;gap:6px;padding-top:10px}
.lgd-url{margin:0;font-size:12px;font-weight:700;color:#4a6b9a;text-align:center;word-break:break-all}
.lgd-url .lgd-a{color:#1462c8}
/* 設定裡的「關於」區：小標＋四顆按鈕（兩欄） */
.ux-shd{margin:12px 4px 6px;font-size:14px;font-weight:900;color:#4a6b9a;letter-spacing:2px}
.ux-about{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:6px}
.ux-about .ux-b{min-width:0;width:100%;padding:7px 8px;font-size:15px;white-space:normal;line-height:1.25;overflow-wrap:anywhere}   /* 英文「Rights & Complaints」窄螢幕可換行，不超出按鈕 */
@media (max-width:360px){.ux-about{grid-template-columns:1fr}}   /* 320 寬：改單欄 */
@media (max-width:480px){
  .lgd-pn{width:calc(100vw - 20px);max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px)}
  .lgd-hd b{font-size:17px;letter-spacing:1px}
  .lgd-body{margin:8px 8px 0;padding:10px 12px 14px;font-size:14px;line-height:1.7}
  .lgd-body h2{font-size:17px}
  .lgd-body h3{font-size:15px}
}
@media (max-height:500px) and (orientation:landscape){
  .lgd-pn{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
  .lgd-hd{padding:5px 10px 5px 14px}
  .lgd-hd b{font-size:16px}
  .lgd-x{width:28px;height:28px;font-size:13px}
  .lgd-ft{padding-top:6px}
  .lgd-ok{padding:4px 18px}
}
