/* Mobile app layout. Desktop nodes return to their original parents in mobile.js. */
.mobile-ui { display:none; }
@media (max-width:900px), (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
  body.kanyu-mobile { --mobile-top:calc(54px + var(--safe-top)); --mobile-nav:calc(66px + var(--safe-bottom)); --mobile-line:rgba(164,183,204,.14); --mobile-muted:#91a3b8; background:#0c1119; touch-action:manipulation; }
  .kanyu-mobile .mobile-ui { display:block; }
  .kanyu-mobile button, .kanyu-mobile a, .kanyu-mobile input, .kanyu-mobile select, .kanyu-mobile textarea, .kanyu-mobile summary { touch-action:manipulation; }
  .kanyu-mobile #cv, .kanyu-mobile #lpCanvas { touch-action:none; }
  .kanyu-mobile .mobile-ui[hidden], .kanyu-mobile [id^="mobilePane"][hidden], .kanyu-mobile [id^="mobileSection"][hidden] { display:none !important; }
  .kanyu-mobile #side { display:none !important; }
  .kanyu-mobile #topbar { height:var(--mobile-top); padding:var(--safe-top) max(14px,var(--safe-right)) 0 max(12px,var(--safe-left)); gap:8px; background:#111821; border-bottom:1px solid var(--mobile-line); backdrop-filter:none; }
  .kanyu-mobile #topbar .back { display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:0; border:0; font-size:12px; }
  .kanyu-mobile #topbar .title { font-size:16px; letter-spacing:.1em; }
  .kanyu-mobile #topbar .product-mark { width:24px; height:24px; margin-right:5px; }
  .kanyu-mobile #topbar .sub { display:none; }
  .kanyu-mobile #topbar .spatial-language-host { margin-left:0; flex-shrink:0; }
  .kanyu-mobile #memberAccountHost { display:flex; flex:1 1 0; min-width:0; margin-left:auto; justify-content:flex-end; text-align:right; }
  .kanyu-mobile #memberAccountHost .xunq-account-button { min-height:44px; min-width:0; max-width:100%; font-size:12px; border-radius:24px; justify-content:flex-end; text-align:right; overflow:hidden; }
  .kanyu-mobile #memberAccountHost .xunq-account-label, .kanyu-mobile #memberAccountHost .xunq-account-credit { text-align:right; }
  .kanyu-mobile #main { top:var(--mobile-top); right:0; bottom:var(--mobile-nav); transition:none; overflow:hidden; background:radial-gradient(ellipse at 50% 43%,rgba(33,58,53,.14),transparent 62%); }
  .kanyu-mobile #cvEmptyGuide, .kanyu-mobile #edgeCompass { display:none !important; }
  .kanyu-mobile #mobileNav { position:fixed; z-index:150; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); height:var(--mobile-nav); padding:6px max(8px,var(--safe-right)) max(6px,var(--safe-bottom)) max(8px,var(--safe-left)); border-top:1px solid var(--mobile-line); background:rgba(17,24,33,.98); }
  #mobileNav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; min-height:52px; padding:5px 0; border:0; border-radius:13px; color:#8798ae; background:none; font-family:inherit; font-weight:500; font-size:11px; line-height:1.4; }
  #mobileNav svg { width:23px; height:23px; }
  #mobileNav button.is-active { color:#9ae6bd; background:rgba(138,214,172,.09); }
  .kanyu-mobile #mobileCanvasToolbar { position:absolute; z-index:21; left:14px; right:14px; top:14px; display:flex; gap:10px; align-items:flex-start; justify-content:space-between; pointer-events:none; }
  #mobileCanvasToolbar > * { pointer-events:auto; }
  #mobileCanvasToolbar #mobileFacingReadout { pointer-events:none; cursor:default; }
  .kanyu-mobile #uploadBtn { display:flex; align-items:center; min-height:44px; padding:0 15px; border-radius:13px; border:1px solid rgba(162,217,186,.25); background:#1a2b27; color:#b9edce; font-size:13px; font-weight:600; box-shadow:0 4px 16px rgba(0,0,0,.12); }
  #mobileFacingReadout { display:flex; flex:0 0 auto; align-items:center; gap:7px; min-height:44px; padding:0 11px; border-radius:13px; border:1px solid var(--mobile-line); background:#141d29; color:#cbd5df; white-space:nowrap; }
  .mobile-eyebrow { font-size:10px; letter-spacing:.05em; color:var(--mobile-muted); }
  #mobileFacingReadout output { font-size:12px; font-weight:600; }
  #mobileFacingReadout.is-verified output { color:#a5e0bd; }
  .kanyu-mobile #mobileQuickActions { position:absolute; z-index:20; top:72px; right:14px; display:flex; flex-direction:column; gap:8px; }
  #mobileQuickActions button { display:flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:0 11px; border:1px solid var(--mobile-line); border-radius:12px; background:rgba(19,28,39,.94); color:#bdcbdc; font-size:12px; }
  #mobileQuickActions svg { width:17px; height:17px; }
  #mobileQuickActions b { display:inline-flex; align-items:center; justify-content:center; min-width:17px; height:17px; border-radius:50%; background:#233c32; color:#a6e7c0; font-size:10px; }
  #mobileQuickActions .is-on { border-color:#827449; color:#e8d49a; }
  .kanyu-mobile #mobileCanvasActions { position:absolute; z-index:21; left:max(10px,var(--safe-left)); right:max(10px,var(--safe-right)); bottom:33px; display:grid; grid-template-columns:60px minmax(0,1fr) 72px; align-items:center; gap:8px; pointer-events:none; }
  #mobileCanvasActions > * { pointer-events:auto; }
  #mobileCanvasActions button { position:static; min-width:44px; height:44px; min-height:44px; margin:0; padding:0 6px; border:1px solid var(--mobile-line); border-radius:12px; background:rgba(18,27,38,.96); color:#c9d4e0; font-size:12px; white-space:nowrap; box-shadow:0 6px 25px rgba(0,0,0,.18); }
  #mobileCanvasActions #mobileFenjinShortcut { display:flex; align-items:center; justify-content:center; gap:4px; width:60px; padding:0 4px; }
  #mobileFenjinShortcut svg { width:17px; height:17px; }
  #mobileCanvasActions #mobileFenjinShortcut.is-on { border-color:#827449; color:#e8d49a; background:#2b291d; }
  #mobileFacingActions { justify-self:center; width:100%; max-width:260px; min-width:0; box-sizing:border-box; padding:7px 9px 0; border:1px solid var(--mobile-line); border-radius:14px; background:rgba(18,27,38,.96); box-shadow:0 6px 25px rgba(0,0,0,.18); }
  #mobileFacingActions .mobile-facing-caption { display:flex; align-items:center; justify-content:space-between; gap:5px; line-height:1.2; }
  #mobileFacingActions label { color:var(--mobile-muted); font-size:10px; }
  #mobileFacingControlValue { color:#b9e7ca; font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; }
  #mobileFacingSlider { display:block; width:100%; min-width:0; height:44px; min-height:44px; margin:0; padding:0; border:0; border-radius:0; background:transparent; accent-color:#a5d9b9; cursor:ew-resize; touch-action:pan-y; }
  #mobileFacingSlider:focus-visible { outline:2px solid #a5d9b9; outline-offset:1px; border-radius:5px; }
  #mobileFullscreenSlot { width:72px; }
  #mobileCanvasActions #fsBtn { width:72px; padding:0 3px; font-size:11px; }
  .kanyu-mobile #main:fullscreen #mobileCanvasActions { bottom:calc(33px + var(--safe-bottom)); }
  .kanyu-mobile #main:-webkit-full-screen #mobileCanvasActions { bottom:calc(33px + var(--safe-bottom)); }
  .kanyu-mobile.fsPseudo #mobileCanvasActions { bottom:calc(33px + var(--safe-bottom)); }
  .kanyu-mobile #mobileGestureHint { position:absolute; left:0; right:0; bottom:10px; pointer-events:none; text-align:center; font-size:10px; letter-spacing:.06em; color:#718398; }
  .kanyu-mobile #mobileWelcome { position:absolute; z-index:19; left:50%; top:47%; width:min(300px,calc(100% - 40px)); transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center; text-align:center; padding:23px 20px; border:1px solid rgba(135,177,158,.16); border-radius:24px; background:rgba(14,22,30,.95); box-shadow:0 12px 44px rgba(0,0,0,.2); }
  .mobile-welcome-mark { display:grid; place-items:center; width:52px; height:52px; margin-bottom:15px; border:1px solid rgba(157,214,180,.24); border-radius:17px; background:#1c2d28; color:#a3dfbb; }
  .mobile-welcome-mark svg { width:28px; height:28px; }
  #mobileWelcome h2 { margin-top:8px; font-size:21px; letter-spacing:.015em; color:#edf2ee; font-weight:600; }
  #mobileWelcome p { margin-top:12px; font-size:12px; line-height:1.9; color:#97a8b8; }
  #mobileWelcomeUpload { width:100%; min-height:46px; margin-top:22px; display:flex; align-items:center; justify-content:center; gap:16px; border:1px solid #a4d7b8; border-radius:12px; background:#a5d9b9; color:#142c21; font-size:14px; font-weight:700; }
  .mobile-welcome-foot { margin-top:12px; font-size:10px; color:#73889a; }
  .kanyu-mobile #mobileUploadStatus { position:absolute; z-index:23; left:14px; top:65px; width:calc(100% - 112px); pointer-events:none; }
  .kanyu-mobile #mobileUploadStatus #uploadMsg { margin:0; font-size:11px; padding:7px 10px; border-radius:8px; background:rgba(17,25,35,.96); pointer-events:none; overflow-wrap:anywhere; }
  .kanyu-mobile #mobileUploadStatus #uploadMsg:empty { display:none; }
  .kanyu-mobile #mobileScrim { position:fixed; z-index:120; top:var(--mobile-top); left:0; right:0; bottom:var(--mobile-nav); border:0; background:rgba(3,8,14,.44); }
  .kanyu-mobile #mobileSheet { position:fixed; z-index:130; bottom:var(--mobile-nav); left:max(0px,var(--safe-left)); right:max(0px,var(--safe-right)); max-height:calc(100dvh - var(--mobile-top) - var(--mobile-nav) - 34px); height:min(590px,73dvh); display:flex; flex-direction:column; overflow:hidden; border:1px solid #2a3946; border-bottom:0; border-radius:23px 23px 0 0; background:#111923; box-shadow:0 -18px 60px rgba(0,0,0,.2); }
  #mobileSheetHeader { display:flex; align-items:center; justify-content:space-between; flex-shrink:0; min-height:80px; padding:17px 18px 12px; gap:12px; border-bottom:1px solid var(--mobile-line); }
  #mobileSheetTitle { font-size:18px; font-weight:600; color:#e4ece8; outline-offset:5px; }
  #mobileSheetSubtitle { margin-top:6px; font-size:11px; color:#91a3b6; }
  #mobileSheetClose { min-width:66px; min-height:44px; border:1px solid #364739; border-radius:12px; background:#1d3028; color:#b1dec1; font-size:12px; }
  #mobileSheetClose span { margin-left:5px; }
  #mobileSheetBody { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding:0 16px 22px; scroll-padding:16px; }
  #mobileSheet button, #mobileSheet input:not([type="checkbox"]), #mobileSheet select, #mobileSheet label.auto { min-height:44px; }
  .kanyu-mobile input:not([type="checkbox"]), .kanyu-mobile textarea, .kanyu-mobile select { font-size:16px !important; }
  #mobileSheet button { touch-action:manipulation; }
  #mobileSheet input[type="range"] { min-width:0; touch-action:pan-y; }
  #mobileSheet .mobile-section-caption { margin:17px 0 10px; color:#94a8bc; font-size:11px; line-height:1.65; }
  .mobile-control-card { padding:13px; border:1px solid var(--mobile-line); border-radius:15px; background:#151f2b; }
  #mobileCompassSegments { position:sticky; z-index:3; top:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; padding:12px 0 10px; background:#111923; }
  #mobileCompassSegments button { min-height:44px; border:1px solid transparent; border-radius:11px; color:#95a7bd; background:#19232f; font-size:13px; }
  #mobileCompassSegments button[aria-selected="true"] { border-color:#3d5b4c; background:#233d30; color:#bae8ca; }
  #mobileSheet .dirRow { display:flex; align-items:center; gap:9px; color:#b7c7d7; font-size:12px; flex-wrap:wrap; }
  #mobileSheet .dirRow + .dirRow { margin-top:12px; }
  #mobileSheet .dirTrack { flex:1; min-width:80px; }
  #mobileSheet .dirVal { min-width:66px; display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 9px; border:1px solid #635739; border-radius:9px; color:#e5ce91; background:#282719; font-size:12px; font-weight:600; }
  #mobileSheet .dirVal input { max-width:74px; }
  #mobileSheet .dirTicks span { font-size:9px; color:#8195aa; }
  #mobileSheet #nsFlipBtn, #mobileSheet #baguaModeBtn { min-height:44px; padding:0 10px !important; border:1px solid #3b4c5d; border-radius:9px; color:#becddb; background:#1a2835; font-size:12px; }
  #mobileDirectionGrid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:12px; }
  #mobileDirectionGrid button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:9px 2px; border:1px solid var(--mobile-line); border-radius:11px; background:#17222d; color:#acbecf; }
  #mobileDirectionGrid strong { font-size:12px; font-weight:500; }
  #mobileDirectionGrid span { font-size:10px; color:#7f93a8; }
  #mobileDirectionGrid button.is-on { border-color:#728b5b; color:#d7e8bf; background:#253222; }
  #mobileLayerControls #ctrlBox { border:0; border-radius:0; padding:0; background:transparent; margin:0; }
  #mobileLayerControls .ctrlRow { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 8px !important; }
  #mobileLayerControls .ctrlRow:empty { display:none; }
  #mobileLayerControls #ctrlBox .ctrlRow button { min-width:0; min-height:61px; margin:0; padding:9px 3px; font-size:12px; line-height:1.5; border:1px solid #304151; border-radius:12px; background:#182432; color:#a9bbcd; }
  #mobileLayerControls #ctrlBox .ctrlRow button.on { border-color:#53775d; background:#223c2c; color:#b6e5c4; }
  #mobileLayerControls #ctrlBox .dirRow { padding:10px 12px; border-radius:12px; background:#151f2b; }
  #mobileReadoutLink { display:flex; align-items:center; justify-content:space-between; width:100%; margin:10px 0; padding:0 13px; border:1px solid #3c4e3b; border-radius:11px; background:#1b2b24; color:#b4d4c1; font-size:12px; }
  #mobileSheet #fenjinPanel { margin-top:16px; padding:15px; border-radius:15px; }
  #mobileSheet .fjHead h2 { font-size:14px; }
  #mobileSheet .fjHead span { font-size:10px; }
  #mobileSheet .fjReadout { padding:12px; }
  #mobileSheet .fjReadout span { font-size:12px; }
  #mobileSheet .fjNumbers { gap:10px; }
  #mobileSheet .fjNumbers input { border-radius:9px; padding:8px 10px; }
  #mobileSheet .fjNote { font-size:11px; line-height:1.8; }
  #mobileSheet #bazhaiPanel, #mobileSheet #starTable, #mobileSheet #shan24Panel, #mobileSheet #daxuanPanel, #mobileSheet #luopanBox, #mobileSheet #skyBox, #mobileSheet #scorePanel { margin:12px 0; padding:14px; border:1px solid var(--mobile-line); border-radius:15px; background:#151f2b; }
  #mobileSheet .stGrid { gap:7px; }
  #mobileSheet .stCell, #mobileSheet .dxCell { min-height:74px; padding:8px 5px; border-radius:10px; }
  #mobileSheet .stCell .p, #mobileSheet .stCell .n, #mobileSheet .dxCell .pn { font-size:10px; }
  #mobileSheet .stCell .s { font-size:14px; margin:5px 0; }
  #mobileSheet .stCell .e { font-size:11px; }
  #mobileSheet .stHead { font-size:14px; }
  #mobileSheet .stLogic { font-size:11px; line-height:1.8; color:#9cb0c3; }
  #mobileSheet .dxYearRow { display:flex; align-items:center; gap:10px; margin:10px 0; font-size:12px; }
  #mobileSheet #dxYear { width:95px; border-radius:9px; }
  #mobileSheet #fwBtn { padding:8px; border:1px solid #3c4e60; border-radius:9px; background:#1d2a38; color:#b9c9db; }
  #mobileSheet .dxVerdict { font-size:12px; line-height:1.8; padding:10px; }
  #mobileSheet #shan24Panel .s24Group { align-items:center; gap:10px; }
  #mobileSheet #shan24Panel .s24Tag { font-size:12px; padding:5px 8px; }
  #mobileSheet #shan24Panel .s24Shan { min-width:44px; min-height:44px; font-size:15px; }
  #mobileSheet #shan24Panel .s24List { line-height:1.5; }
  #mobileSheet #compass { max-width:248px; }
  #mobileSheet #lpSwitch { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; }
  #mobileSheet #lpSwitch button { padding:4px 1px; font-size:12px; }
  .mobile-tip { display:flex; align-items:flex-start; gap:10px; margin:18px 0 14px; }
  .mobile-tip-number { display:grid; place-items:center; flex-shrink:0; width:24px; height:24px; border-radius:50%; background:#294735; color:#b6dfc5; font-size:12px; }
  .mobile-tip p { color:#d0ddda; font-size:13px; line-height:1.6; }
  .mobile-tip p span { color:#8da2b7; font-size:11px; }
  #mobileSheet #gejuPanel { padding:0; margin:0; border:0; background:transparent; }
  #mobileSheet #gjAddBtn { min-height:44px; padding:0 12px; border-radius:10px; font-size:12px; }
  #mobileSheet #gjTypes { gap:8px; margin:12px 0; }
  #mobileSheet #gjTypes button { flex:1 0 calc(25% - 8px); min-height:54px; padding:8px 4px; border-radius:12px; font-size:12px; background:#1a2633; }
  #mobileSheet .gjItem { min-height:58px; padding:9px 12px; margin:8px 0; border-radius:12px; background:#16232f; }
  #mobileSheet .gjNm { font-size:13px; }
  #mobileSheet .gjInfo, #mobileSheet .gjEmpty { font-size:12px; line-height:1.8; }
  .kanyu-mobile #mobileAnnotationBar { position:absolute; z-index:24; left:12px; right:12px; bottom:88px; display:flex; align-items:center; gap:8px; padding:8px; border:1px solid #53725b; border-radius:14px; background:#182c23; box-shadow:0 6px 20px rgba(0,0,0,.2); }
  #mobileAnnotationBar button { min-height:44px; padding:0 10px; border:1px solid #476753; border-radius:9px; background:#253e2e; color:#b8e2c7; font-size:11px; }
  #mobilePlacementText { flex:1; font-size:12px; line-height:1.5; color:#d7e6dc; }
  #mobileAnnotationBar #mobilePlacementCancel { padding:0 8px; background:none; color:#a8bdaf; border-color:transparent; }
  #mobileSensorTools p { margin:0 0 11px; font-size:13px; color:#b7cbd3; }
  #mobileSensorTools #compassModeBtn, #mobileChatTools #aiChatBtn { width:100%; min-height:48px; padding:10px 12px; border-radius:11px; font-size:13px; }
  #mobileSheet #skyBox .line { min-height:29px; }
  #mobileSheet #skyBox .line span, #mobileSheet #calendarBasis, #mobileSheet #skyBox label.auto { font-size:12px; }
  #mobileSheet #skyBox .line b { font-size:13px; }
  #mobileSheet #skyBox label.auto { min-width:70px; gap:8px; }
  #mobileSheet #skyBox input[type="checkbox"] { width:20px; height:20px; accent-color:#91d5ac; }
  #mobileSheet #scorePanel .scRow { min-height:44px; }
  #mobileSheet #scorePanel .scName { font-size:13px; flex-basis:42px; }
  #mobileSheet #scorePanel .scSub { font-size:11px; line-height:1.7; }
  #mobileSheet #huangliBtn, #mobileSheet #scGenBtn { min-height:46px; border-radius:11px; }
  .kanyu-mobile #aiOverlay { top:var(--mobile-vv-top,0px); bottom:auto; height:var(--mobile-vvh,100dvh); z-index:6500; }
  .kanyu-mobile #aiPanel { position:absolute; inset:0; width:100%; max-width:none; height:100%; border:0; border-radius:0; transform:translateY(105%); background:#101923; box-shadow:none; padding-top:var(--safe-top); padding-bottom:var(--safe-bottom); }
  .kanyu-mobile #aiOverlay.open #aiPanel { transform:none; }
  .kanyu-mobile #aiHead { min-height:61px; flex-shrink:0; padding:8px 14px; background:#131e29; }
  .kanyu-mobile #aiHead .t { font-size:17px; color:#d6e9dd; }
  .kanyu-mobile #aiHead .chip, .kanyu-mobile #aiHead .x { min-height:44px; padding:8px 11px; font-size:12px; }
  .kanyu-mobile #aiHead .x { min-width:44px; font-size:18px; }
  .kanyu-mobile #aiBasis { padding:10px 15px; flex-shrink:0; font-size:11px; line-height:1.7; color:#9ab0c3; }
  .kanyu-mobile #mobileAiTerms { margin:0; padding:0 15px; border-bottom:1px solid var(--mobile-line); flex-shrink:0; background:#141e28; }
  #mobileAiTerms summary { display:flex; align-items:center; justify-content:space-between; min-height:44px; gap:10px; cursor:pointer; font-size:11px; color:#b4c6b6; list-style:none; }
  #mobileAiTerms summary::-webkit-details-marker { display:none; }
  #mobileAiTerms summary span { color:#8a9baf; font-size:10px; }
  #mobileAiTerms summary span::after { content:" ＋"; }
  #mobileAiTerms[open] summary span::after { content:" −"; }
  .kanyu-mobile #aiDisc { padding:0 0 12px; text-align:left; line-height:1.8; font-size:11px; color:#95a8bb; max-height:130px; overflow:auto; }
  .kanyu-mobile #aiMsgs { min-height:0; padding:18px 14px; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .kanyu-mobile .aiMsg .bub { max-width:92%; padding:12px 14px; font-size:14px; line-height:1.9; border-radius:15px; }
  .kanyu-mobile #aiSuggestions { flex-wrap:nowrap; overflow-x:auto; flex-shrink:0; padding:8px 14px; gap:7px; scrollbar-width:none; }
  .kanyu-mobile #aiSuggestions button { flex-shrink:0; min-height:44px; padding:8px 11px; font-size:11px; border-radius:12px; }
  .kanyu-mobile #aiFoot { flex-shrink:0; align-items:flex-end; padding:10px 12px 12px; background:#131e29; }
  .kanyu-mobile #aiInput { min-height:52px; height:58px; max-height:110px; padding:12px; border-radius:13px; line-height:1.5; background:#1b2736; }
  .kanyu-mobile #aiSend { min-width:62px; min-height:52px; padding:0 14px; border-radius:13px; background:#a6d9b9; color:#183425; }
  .kanyu-mobile.mobile-keyboard-open #aiPanel { padding-bottom:0; }
  .kanyu-mobile.mobile-keyboard-open #aiSuggestions { display:none; }
  .kanyu-mobile.mobile-keyboard-open #aiBasis { padding-top:5px; padding-bottom:5px; font-size:10px; }
  .kanyu-mobile.mobile-compact-viewport #aiBasis, .kanyu-mobile.mobile-compact-viewport #aiSuggestions { display:none; }
  .kanyu-mobile.mobile-compact-viewport #aiHead { min-height:52px; padding-top:4px; padding-bottom:4px; }
  .kanyu-mobile.mobile-compact-viewport #aiFoot { padding-top:6px; padding-bottom:6px; }
  .kanyu-mobile.mobile-compact-viewport #aiInput { height:52px; }
  .kanyu-mobile.mobile-compact-viewport #aiMsgs { padding-top:5px; padding-bottom:5px; }
  .kanyu-mobile.mobile-compact-viewport #mobileAiTerms[open] { max-height:80px; overflow:auto; }
  .kanyu-mobile #detailOverlay, .kanyu-mobile #huangliOverlay { padding:calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom)); }
  .kanyu-mobile #detailOverlay .dtPanel, .kanyu-mobile .hlPanel { width:100%; max-width:600px; max-height:calc(100dvh - 30px - var(--safe-top) - var(--safe-bottom)); border-radius:18px; }
  .kanyu-mobile #detailOverlay .dtClose, .kanyu-mobile #hlClose { min-width:44px; min-height:44px; }
  .kanyu-mobile .dtBody button, .kanyu-mobile .hlPanel button { min-height:44px; }
  .kanyu-mobile #lpOverlay { top:var(--mobile-vv-top,0px); bottom:auto; height:var(--mobile-vvh,100dvh); padding-top:var(--safe-top); }
  .kanyu-mobile #lpTop { display:grid; grid-template-columns:auto 1fr auto; gap:6px; padding:6px max(8px,var(--safe-right)) 8px max(8px,var(--safe-left)); flex-shrink:0; }
  .kanyu-mobile #lpTop button { min-height:44px; padding:6px 9px; font-size:12px; }
  .kanyu-mobile #lpModeTabs { grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .kanyu-mobile #lpClose { grid-column:1; grid-row:1; }
  .kanyu-mobile #lpQiBtn { grid-column:2; grid-row:1; justify-self:end; }
  .kanyu-mobile #lpReset { grid-column:3; grid-row:1; }
  .kanyu-mobile #lpStage { min-height:140px; overflow:hidden; }
  .kanyu-mobile #mobileLpControls { display:flex; flex-direction:column; flex-shrink:1; min-height:0; overflow:auto; overscroll-behavior:contain; }
  .kanyu-mobile #lpMapBtn, .kanyu-mobile #lpHeadChip { min-height:44px; }
  .kanyu-mobile #lpMapBar { padding:8px 10px; gap:7px; flex-shrink:0; }
  .kanyu-mobile #lpMapBar button { min-height:44px; padding:6px 10px; }
  .kanyu-mobile #lpMapBar .mbRow { gap:6px; flex-wrap:wrap; }
  .kanyu-mobile #lpMapBar #lpHideBtn { min-width:105px; padding:6px 8px; font-size:12px; }
  .kanyu-mobile #lpAddr { min-height:44px; width:calc(100% - 106px); }
  .kanyu-mobile #lpMapBar input[type="range"] { height:44px; min-width:70px; }
  .kanyu-mobile #lpMeters { min-height:40px; padding:4px 8px; flex-shrink:0; flex-wrap:wrap; }
  .kanyu-mobile #lpMeters .lpM { font-size:9px; gap:3px; }
  .kanyu-mobile #lpMeters .bar { width:18px; }
  .kanyu-mobile #lpTnBtn { min-height:44px; padding:4px 8px; }
  .kanyu-mobile #lpInfo { max-height:30dvh; overflow:auto; overscroll-behavior:contain; flex-shrink:0; padding:8px 12px calc(8px + var(--safe-bottom)); }
  .kanyu-mobile #lpInfo .lpRow { padding:3px 0; font-size:11px; }
  .kanyu-mobile #lpInfo .lpRow[style*="visibility: hidden"], .kanyu-mobile #lpInfo .lpRow[style*="visibility:hidden"] { display:none; }
  .kanyu-mobile #lpApply { position:sticky; bottom:0; min-height:46px; margin-top:8px; border-radius:11px; background:#40361e; font-size:13px; }
  .kanyu-mobile.mobile-keyboard-open #lpInfo { display:none; }
  .kanyu-mobile.mobile-keyboard-open #lpMeters { display:none; }
  .kanyu-mobile.mobile-keyboard-open #lpModeTabs { display:none; }
  .kanyu-mobile.mobile-keyboard-open #lpStage { min-height:0; }
}
@media (max-width:380px) {
  .kanyu-mobile #topbar { gap:4px; padding-left:8px; padding-right:8px; }
  .kanyu-mobile #topbar .title { font-size:14px; }
  .kanyu-mobile #topbar .product-mark { width:20px; height:20px; }
  .kanyu-mobile #memberAccountHost .xunq-account-button { max-width:100%; padding:5px 8px; }
  .kanyu-mobile #mobileCanvasToolbar { left:10px; right:10px; gap:7px; }
  #mobileFacingReadout { gap:4px; padding:0 8px; }
  #mobileFacingReadout .mobile-eyebrow { display:none; }
  .kanyu-mobile #mobileWelcome { width:calc(100% - 46px); padding:18px 16px; }
  #mobileWelcome h2 { font-size:19px; }
  #mobileSheetBody { padding-left:12px; padding-right:12px; }
  #mobileSheet #gjTypes button { flex-basis:calc(33.33% - 8px); }
  #mobileSheet #nsFlipBtn { padding:0 6px !important; font-size:11px; }
  #mobileSheet .dirRow { gap:6px; }
  #mobileSheet .dirVal { min-width:58px; padding:0 6px; }
}
@media (max-width:900px) and (max-height:600px), (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
  .kanyu-mobile #mobileWelcome { top:48%; width:310px; padding:15px; }
  .mobile-welcome-mark, #mobileWelcome .mobile-eyebrow, .mobile-welcome-foot { display:none; }
  #mobileWelcome h2 { margin:0; font-size:17px; }
  #mobileWelcome p { margin-top:6px; font-size:11px; }
  #mobileWelcomeUpload { margin-top:10px; }
  .kanyu-mobile #mobileSheet { height:calc(100dvh - var(--mobile-top) - var(--mobile-nav) - 8px); max-height:none; }
  #mobileSheetHeader { min-height:66px; padding:10px 15px; }
  #mobileSheetSubtitle { display:none; }
  .kanyu-mobile #lpInfo { max-height:21dvh; }
}
@media (max-width:1100px) and (max-height:480px) and (orientation:landscape) {
  body.kanyu-mobile { --mobile-top:calc(48px + var(--safe-top)); --mobile-nav:calc(58px + var(--safe-bottom)); }
  .kanyu-mobile #mobileNav { padding-top:3px; padding-bottom:max(3px,var(--safe-bottom)); }
  #mobileNav button { min-height:50px; padding:2px 0; }
  .kanyu-mobile #mobileCanvasActions { left:max(14px,var(--safe-left)); right:max(14px,var(--safe-right)); bottom:14px; }
  .kanyu-mobile #mobileUploadStatus { max-width:220px; top:64px; }
  .kanyu-mobile #mobileGestureHint { width:auto; left:90px; right:100px; bottom:65px; }
  .kanyu-mobile #mobileAnnotationBar { left:14px; right:auto; top:66px; bottom:auto; width:230px; flex-wrap:wrap; gap:4px; padding:6px; }
  #mobileAnnotationBar #mobilePlacementText { order:-1; flex-basis:100%; padding:3px 5px; }
  #mobileAnnotationBar #mobileAnnotationTypes { flex:1; }
  .kanyu-mobile #lpOverlay[aria-hidden="false"] { display:grid !important; grid-template-columns:minmax(0,1fr) 320px; grid-template-rows:auto minmax(0,1fr); }
  .kanyu-mobile #lpTop { display:flex; grid-column:1/-1; grid-row:1; }
  .kanyu-mobile #lpModeTabs { display:flex; }
  .kanyu-mobile #lpStage { grid-column:1; grid-row:2; min-height:0; }
  .kanyu-mobile #mobileLpControls { grid-column:2; grid-row:2; overflow:auto; overscroll-behavior:contain; border-left:1px solid var(--mobile-line); }
  .kanyu-mobile #lpInfo { max-height:none; overflow:visible; }
  .kanyu-mobile #lpMapBar { padding:8px; }
}

/* The controls frame the drawing; colour indicates a selection rather than every boundary. */
@media (max-width:900px), (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
  body.kanyu-mobile { --mobile-line:var(--ky-line,rgba(178,193,209,.13)); --mobile-muted:#a1afbf; }
  .kanyu-mobile #mobileNav { padding-top:5px; background:#111821f7; }
  .kanyu-mobile #mobileNav button { border-radius:11px; color:#a0aebd; font-size:12px; transition:background-color var(--xq-motion-fast,120ms),color var(--xq-motion-fast,120ms); }
  .kanyu-mobile #mobileNav button.is-active { color:#e1cfa4; background:var(--ky-selected,rgba(216,194,142,.11)); }
  .kanyu-mobile #mobileNav svg { width:22px; height:22px; }
  .kanyu-mobile #mobileCanvasToolbar { gap:8px; align-items:flex-start; }
  .kanyu-mobile #mobileUploadSlot { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:5px; flex:0 1 182px; min-width:0; }
  .kanyu-mobile #mobileUploadSlot #uploadBtn { grid-column:1/-1; justify-content:center; min-width:0; width:100%; min-height:44px; padding:8px 10px; border:1px solid var(--mobile-line); border-radius:12px; background:#1b2734f5; color:#e0e7ec; font-size:13px; font-weight:500; box-shadow:0 4px 16px #0002; }
  .kanyu-mobile #mobileUploadSlot :is(#kanyuSaveLocal,#kanyuOpenLocal) { min-width:0; width:100%; min-height:44px; margin:0; padding:7px 4px; gap:0; border:1px solid var(--mobile-line); border-radius:10px; background:#141e2aeF; color:#b9c7d5; font-size:11px; }
  .kanyu-mobile #mobileUploadSlot :is(#kanyuSaveLocal,#kanyuOpenLocal)::before { flex-basis:14px; width:14px; height:14px; margin-right:5px; }
  .kanyu-mobile #mobileFacingReadout { min-height:44px; border-radius:12px; border-color:var(--mobile-line); background:#141e2aef; gap:6px; }
  .kanyu-mobile #mobileFacingReadout output { font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; }
  .kanyu-mobile #mobileFacingReadout.is-verified output { color:#decba0; }
  .kanyu-mobile #mobileQuickActions button { color:#bdcad7; background:#141e2aef; border-radius:11px; }
  .kanyu-mobile #mobileQuickActions b { color:#dfd0ad; background:#d8c28e16; font-size:11px; }
  .kanyu-mobile #mobileCanvasActions button { border-radius:11px; border-color:var(--mobile-line); background:#16212df2; color:#cbd5df; box-shadow:0 4px 18px #0002; }
  .kanyu-mobile #mobileCanvasActions #mobileFenjinShortcut.is-on { border-color:#d8c28e44; color:#e5d4ac; background:#292a27; }
  .kanyu-mobile #mobileFacingActions { border-radius:13px; border-color:var(--mobile-line); background:#16212df2; box-shadow:0 4px 18px #0002; }
  .kanyu-mobile #mobileFacingActions label { font-size:11px; }
  .kanyu-mobile #mobileFacingControlValue { color:#e3d0a3; font-weight:500; }
  .kanyu-mobile #mobileFacingSlider { accent-color:#d8c28e; }
  .kanyu-mobile #mobileGestureHint { font-size:11px; letter-spacing:0; color:#9aabba; }
  .kanyu-mobile #mobileWelcome { border-color:var(--mobile-line); border-radius:22px; background:#131c27f5; box-shadow:0 16px 44px #0002; }
  .kanyu-mobile .mobile-welcome-mark { border:0; border-radius:16px; color:#dbc89e; background:#d8c28e0d; }
  .kanyu-mobile #mobileWelcome h2 { font-size:21px; letter-spacing:0; font-weight:600; }
  .kanyu-mobile #mobileWelcome p { color:#a5b3c2; font-size:13px; line-height:1.8; }
  .kanyu-mobile #mobileWelcomeUpload { min-height:48px; border:0; border-radius:12px; background:#d8c28e; color:#29281f; font-weight:600; }
  .kanyu-mobile .mobile-welcome-foot { font-size:11px; color:#9baaba; }
  .kanyu-mobile #mobileSheet { border-color:var(--mobile-line); border-radius:24px 24px 0 0; background:#131c27; box-shadow:0 -14px 50px #0003; }
  .kanyu-mobile #mobileSheet:not([hidden]) { animation:ky-sheet-in var(--xq-motion-panel,220ms) var(--xq-ease-out,cubic-bezier(.2,.8,.2,1)) both; }
  .kanyu-mobile #mobileScrim:not([hidden]) { animation:ky-scrim-in var(--xq-motion-menu,180ms) ease-out both; }
  .kanyu-mobile #mobileSheetHeader { min-height:78px; padding:16px 18px 12px; border-color:var(--mobile-line); }
  .kanyu-mobile #mobileSheetTitle { color:#e7ebed; font-size:19px; letter-spacing:0; }
  .kanyu-mobile #mobileSheetSubtitle { margin-top:5px; color:#a3b1c0; font-size:12px; line-height:1.6; }
  .kanyu-mobile #mobileSheetClose { min-width:60px; min-height:44px; padding:0 10px; border:0; border-radius:11px; background:#ffffff07; color:#d8c69d; font-size:13px; }
  .kanyu-mobile #mobileSheetBody { padding-top:14px; }
  .kanyu-mobile #mobileSheet .mobile-section-caption { color:#a1b0bf; font-size:12px; line-height:1.8; }
  .kanyu-mobile .mobile-control-card { padding:14px; border:1px solid var(--mobile-line); border-radius:15px; background:#192431; }
  .kanyu-mobile #mobileCompassSegments { gap:3px; margin:12px 0; padding:4px; border:1px solid #ffffff05; border-radius:12px; background:#0e1722; }
  .kanyu-mobile #mobileCompassSegments button { min-height:44px; border:0; border-radius:9px; background:transparent; color:#a4b2c1; font-size:13px; }
  .kanyu-mobile #mobileCompassSegments button[aria-selected="true"] { color:#e4d5b5; background:#29313a; box-shadow:0 2px 6px #0002; }
  .kanyu-mobile #mobileSheet .dirRow { color:#b8c4d0; font-size:13px; }
  .kanyu-mobile #mobileSheet .dirTicks span { font-size:10px; transform:none; }
  .kanyu-mobile #mobileSheet .dirVal { min-height:44px; color:#e0cda3; border:1px solid var(--mobile-line); border-radius:10px; background:#101b27; font-weight:500; font-variant-numeric:tabular-nums; }
  .kanyu-mobile #mobileSheet input[type="range"] { accent-color:#d8c28e; }
  .kanyu-mobile #mobileSheet :is(#nsFlipBtn,#baguaModeBtn) { color:#c8d3dd; border-color:var(--mobile-line); border-radius:10px; background:#222e3a; }
  .kanyu-mobile #mobileDirectionGrid { gap:5px; margin-top:10px; padding:5px; border-radius:14px; border:1px solid var(--mobile-line); background:#151f2b; }
  .kanyu-mobile #mobileDirectionGrid button { min-height:52px; border:1px solid transparent; border-radius:10px; background:transparent; color:#b7c5d2; }
  .kanyu-mobile #mobileDirectionGrid strong { font-size:13px; }
  .kanyu-mobile #mobileDirectionGrid span { color:#9caebf; font-size:11px; }
  .kanyu-mobile #mobileDirectionGrid button.is-on { color:#e5d4ac; border-color:#d8c28e22; background:#d8c28e10; }
  .kanyu-mobile #mobileLayerControls #ctrlBox { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow { display:contents; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow button { display:flex; align-items:center; justify-content:space-between; min-height:50px; padding:11px 13px; border:1px solid transparent; border-radius:12px; background:#1b2734; color:#bbc9d5; font-size:13px; font-weight:500; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow button::after { content:""; flex:0 0 7px; width:7px; height:7px; margin-left:5px; border-radius:50%; background:#738397; opacity:.45; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow button.on { border-color:#d8c28e2b; background:#d8c28e11; color:#e4d2a8; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow button.on::after { background:#ddc58d; opacity:1; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .dirRow { grid-column:1/-1; margin-top:6px; padding:12px 14px; border:1px solid var(--mobile-line); border-radius:13px; background:#18232f; }
  .kanyu-mobile #mobileReadoutLink { margin:14px 0; padding-inline:13px; border:0; border-radius:11px; background:#ffffff05; color:#cbbd9c; font-size:13px; }
  .kanyu-mobile #mobileSheet :is(#fenjinPanel,#bazhaiPanel,#starTable,#shan24Panel,#daxuanPanel,#luopanBox,#skyBox,#scorePanel) { padding:15px; border-color:var(--mobile-line); border-radius:16px; background:#192431; }
  .kanyu-mobile #mobileSheet :is(.stHead,.lpTitle,.scHead) { min-height:44px; font-size:15px; font-weight:600; color:#e0e7eb; letter-spacing:0; }
  .kanyu-mobile #mobileSheet :is(.stLogic,.fjNote,.dxVerdict,.scSub,.gjEmpty) { font-size:12px; line-height:1.8; color:#a4b4c4; }
  .kanyu-mobile #mobileSheet :is(.stYear,.stFold,.fjHead span) { font-size:11px; color:#a7b6c5; }
  .kanyu-mobile #mobileSheet .fjHead h2 { color:#e2d0a6; font-size:15px; }
  .kanyu-mobile #mobileSheet .fjReadout { background:#d8c28e0a; border-left-color:#b49d68; border-radius:10px; }
  .kanyu-mobile #mobileSheet :is(.fjNumbers input,#dxYear,#fwBtn) { border-color:var(--mobile-line); background:#101b27; border-radius:10px; }
  .kanyu-mobile #mobileSheet .fjNumbers label { font-size:12px; }
  .kanyu-mobile #mobileSheet #lpSwitch { gap:3px; padding:4px; border-radius:12px; background:#101923; }
  .kanyu-mobile #mobileSheet #lpSwitch button { min-height:44px; border:0; border-radius:8px; background:transparent; color:#a4b4c4; }
  .kanyu-mobile #mobileSheet #lpSwitch button.on { color:#e4d1a7; background:#2a3139; }
  .kanyu-mobile #mobileSheet :is(#compassModeBtn,#huangliBtn,#scGenBtn,#gjAddBtn) { min-height:44px; border:1px solid var(--mobile-line)!important; border-radius:11px; background:#222e3b!important; color:#d3dce5!important; font-size:13px; font-weight:500!important; }
  .kanyu-mobile #mobileSheet #compassModeBtn { min-height:48px; }
  .kanyu-mobile #mobileSheet #gjTypes button { border-color:transparent; background:#1b2734; font-size:13px; }
  .kanyu-mobile #mobileSheet #gjTypes button.sel { border-color:#d8c28e33; color:#e3d1a5; background:#d8c28e10; }
  .kanyu-mobile #mobileSheet .gjItem { border-color:var(--mobile-line); border-radius:12px; background:#192431; }
  .kanyu-mobile #mobileSheet :is(.gjNm,.gjInfo) { font-size:13px; }
  .kanyu-mobile #mobileSheet #ownerBinding { border-color:var(--mobile-line); border-radius:15px; background:#192431; }
  .kanyu-mobile #mobileSheet #ownerBinding label { color:#e0d0ad; }
  .kanyu-mobile #mobileSheet #ownerBinding :is(button,select) { border-color:var(--mobile-line); border-radius:10px; background:#111c28; }
  .kanyu-mobile #mobileSheet :is(#ownerHint,#ownerStatus,.owner-note) { color:#a4b4c4; font-size:12px; line-height:1.8; }
  .kanyu-mobile #mobileSheet #ownerBinding input[type="checkbox"],.kanyu-mobile #mobileSheet #skyBox input[type="checkbox"] { width:20px; height:20px; accent-color:#d8c28e; }
  .kanyu-mobile #mobileAnnotationBar { border-color:#d8c28e33; background:#242b2c; }
  .kanyu-mobile #mobileAnnotationBar button { border-color:var(--mobile-line); background:#ffffff05; color:#e1d2ae; font-size:12px; }
  .kanyu-mobile #mobilePlacementText { color:#d7e0e5; }
  .kanyu-mobile #aiPanel { transition:transform var(--xq-motion-panel,220ms) var(--xq-ease-out,cubic-bezier(.2,.8,.2,1)); }
  .kanyu-mobile #aiHead .t { color:#e3e9e9; font-weight:600; }
  .kanyu-mobile #aiHead .chip { border-color:var(--mobile-line); background:transparent; color:#b6c5d1; }
  .kanyu-mobile #aiHead .chip.on { border-color:#d8c28e38; color:#decba2; background:#d8c28e09; }
  .kanyu-mobile #aiHead .x { border:0; border-radius:50%; background:#ffffff08; }
  .kanyu-mobile .aiMsg .bub { font-size:15px; line-height:1.8; }
  .kanyu-mobile .aiMsg.ai .bub { padding:4px 2px; max-width:100%; border:0; background:transparent; }
  .kanyu-mobile .aiMsg.user .bub { border:0; background:#25302f; }
  .kanyu-mobile #aiSuggestions button { border-color:var(--mobile-line); background:#192531; color:#c5d1dc; font-size:12px; }
  .kanyu-mobile #aiSend { border:0; background:#d8c28e; color:#2a281f; font-weight:600; }
  .kanyu-mobile #mobileAiTerms summary,.kanyu-mobile #aiDisc { font-size:12px; }
  .kanyu-mobile #lpTop .lpMode button { border-color:transparent; background:#192430; color:#aebdca; }
  .kanyu-mobile #lpTop .lpMode button.on { border-color:#d8c28e30; color:#e0cea3; background:#d8c28e14; }
  .kanyu-mobile #lpMapBar button { border-color:var(--mobile-line); background:#202d38; color:#c6d4dd; }
  .kanyu-mobile #lpApply { border-color:#d8c28e40; background:#302f28; color:#e2d1ac; font-size:13px; }
}
@keyframes ky-sheet-in { from { opacity:.7; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes ky-scrim-in { from { opacity:0; } to { opacity:1; } }
@media(max-width:380px){
  .kanyu-mobile #mobileUploadSlot { flex-basis:160px; }
  .kanyu-mobile #mobileUploadSlot :is(#kanyuSaveLocal,#kanyuOpenLocal)::before { display:none; }
  .kanyu-mobile #mobileSheet .dirRow { gap:6px; }
  .kanyu-mobile #mobileLayerControls #ctrlBox .ctrlRow button { font-size:12px; padding-inline:10px; }
}
@media(max-width:900px) and (max-height:600px),(max-width:1100px) and (max-height:600px) and (pointer:coarse){
  .kanyu-mobile #mobileWelcome { padding:14px 16px; }
  .kanyu-mobile #mobileWelcome h2 { font-size:18px; }
  .kanyu-mobile #mobileWelcome p { font-size:12px; line-height:1.6; }
  .kanyu-mobile #mobileWelcomeUpload { min-height:44px; }
  .kanyu-mobile #mobileSheetHeader { min-height:66px; padding:10px 15px; }
}
@media(prefers-reduced-motion:reduce){
  .kanyu-mobile #mobileSheet:not([hidden]),.kanyu-mobile #mobileScrim:not([hidden]){animation:none}
  .kanyu-mobile #aiPanel,.kanyu-mobile #mobileNav button{transition:none}
}
