.apkx-modal{
  position:fixed;inset:0;z-index:240;background:rgba(20,16,12,.68);
  display:none;align-items:center;justify-content:center;padding:18px;
  backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);
}
.apkx-modal.show{display:flex;}
.apkx-sheet{
  width:min(1040px,100%);max-height:min(920px,94dvh);overflow:auto;position:relative;
  color:var(--ink);background:color-mix(in srgb,var(--panel) 94%,white 6%);
  border:3px solid var(--line);border-radius:18px;padding:20px;
  box-shadow:0 24px 80px rgba(0,0,0,.42);
}
.apkx-close{
  position:sticky;float:right;top:0;z-index:4;width:42px;height:42px;border-radius:50%;
  border:2px solid var(--line);background:var(--panel);color:var(--ink);font:700 25px/1 inherit;cursor:pointer;
}
.apkx-head{padding-right:52px;margin-bottom:12px;}
.apkx-head h2{font-size:23px;margin:0 0 4px;letter-spacing:1px;}
.apkx-head p{margin:0;color:var(--ink2);font-size:13px;line-height:1.55;}
.apkx-nav{display:flex;gap:7px;overflow:auto;padding:4px 0 12px;scrollbar-width:thin;}
.apkx-nav button,.apkx-action,.apkx-select{
  min-height:40px;border:2px solid var(--line);border-radius:10px;background:rgba(255,255,255,.42);
  color:var(--ink);font:600 14px/1.2 inherit;padding:8px 13px;cursor:pointer;white-space:nowrap;
}
.apkx-nav button.on,.apkx-action.primary{background:var(--green);box-shadow:inset 0 0 0 1px var(--green-d);}
.apkx-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:4px 0 14px;}
.apkx-note{
  padding:10px 12px;margin:8px 0 14px;border-left:4px solid var(--gold-d);border-radius:7px;
  background:rgba(255,255,255,.34);font-size:13px;line-height:1.65;
}
.apkx-note.bad{border-left-color:var(--bad);}
.apkx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.apkx-grid.two{grid-template-columns:repeat(2,minmax(0,1fr));}
.apkx-card{
  border:2px solid color-mix(in srgb,var(--line) 72%,transparent);border-radius:12px;
  padding:12px;background:rgba(255,255,255,.32);min-width:0;
}
.apkx-card h3{margin:0 0 8px;font-size:16px;display:flex;justify-content:space-between;gap:8px;align-items:center;}
.apkx-card p{margin:6px 0 0;font-size:13px;line-height:1.65;overflow-wrap:anywhere;}
.apkx-muted{color:var(--ink2);font-size:12px;}
.apkx-badge{display:inline-flex;align-items:center;min-height:24px;border-radius:999px;padding:3px 8px;background:rgba(231,173,60,.25);font-size:11px;white-space:nowrap;}
.apkx-figrow{display:flex;align-items:flex-start;gap:8px;overflow-x:auto;padding:3px 0;}
.apkx-fig{min-width:58px;text-align:center;font-size:11px;color:var(--ink2);}
.apkx-fig b{display:block;color:var(--ink);font-size:12px;margin-top:3px;}
.apkx-dots{display:flex;flex-direction:column;gap:3px;align-items:center;min-height:43px;justify-content:center;}
.apkx-dotrow{height:8px;display:flex;gap:5px;align-items:center;justify-content:center;}
.apkx-dot{width:7px;height:7px;border-radius:50%;background:#1a1713;display:block;}
.apkx-month h3 b{color:var(--good);}
.apkx-month .apkx-source{font-size:11px;color:var(--ink2);min-height:34px;line-height:1.45;}
.apkx-mode-block{margin:0 0 13px;}
.apkx-mode-block h3{margin:0 0 7px;font-size:16px;}
.apkx-sixteen{display:grid;grid-template-columns:repeat(8,minmax(52px,1fr));gap:6px;}
.apkx-sixteen .apkx-fig{min-width:0;border:1px solid rgba(56,42,26,.28);padding:5px 2px;border-radius:7px;}
.apkx-triangle{position:relative;}
.apkx-triangle::before{content:"△";position:absolute;right:9px;top:5px;font-size:36px;opacity:.11;}
.apkx-time{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px;}
.apkx-time > div{text-align:center;border-radius:7px;padding:6px;background:rgba(255,255,255,.3);}
.apkx-time span{display:block;font-size:11px;color:var(--ink2);margin-bottom:3px;}
.apkx-house-list{display:grid;gap:8px;}
.apkx-house-row{display:grid;grid-template-columns:92px 1fr;gap:10px;align-items:start;border-bottom:1px dashed rgba(56,42,26,.34);padding:8px 0;}
.apkx-house-row:last-child{border-bottom:0;}
.apkx-house-key{font-weight:700;font-size:13px;}
.apkx-house-text{font-size:13px;line-height:1.65;}
.apkx-trail-summary{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;align-items:center;}
.apkx-color{font-weight:800;border-radius:999px;padding:4px 9px;color:#fff;font-size:12px;}
.apkx-color.red{background:#b83b34}.apkx-color.blue{background:#356eb4}
.apkx-path{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin:8px 0;}
.apkx-node{border:1px solid rgba(56,42,26,.45);border-radius:8px;padding:5px 8px;background:rgba(255,255,255,.34);font-size:12px;}
.apkx-arrow{color:var(--ink2);}
.apkx-verdict{font-weight:800;color:var(--good);}
.apkx-lot{text-align:center;max-width:720px;margin:0 auto;}
.apkx-lot-id{font-size:12px;color:var(--ink2);letter-spacing:1px;}
.apkx-lot-letters{font-size:38px;direction:rtl;margin:8px 0;letter-spacing:8px;}
.apkx-lot-fortune{display:inline-block;padding:5px 16px;border-radius:999px;font-weight:800;margin-bottom:10px;background:rgba(231,173,60,.25);}
.apkx-lot-text{text-align:left;white-space:pre-line;line-height:1.9;font-size:15px;border-top:1px dashed rgba(56,42,26,.35);padding-top:12px;}
.apkx-daily-figs{justify-content:center;gap:28px;margin:14px 0;}
.apkx-daily-text{font-size:15px!important;line-height:1.9!important;}
.apkx-personality-intro{text-align:center;max-width:650px;margin:0 auto;}
.apkx-progress{height:9px;border-radius:999px;background:rgba(56,42,26,.16);overflow:hidden;margin:6px 0 12px;}
.apkx-progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--green-d),var(--gold));}
.apkx-question{max-width:720px;margin:0 auto;}
.apkx-question h3{font-size:20px;line-height:1.55;}
.apkx-options{display:grid;gap:9px;margin:15px 0;}
.apkx-option{display:grid;grid-template-columns:34px 1fr;gap:8px;align-items:center;text-align:left;min-height:52px;border:2px solid rgba(56,42,26,.48);border-radius:11px;background:rgba(255,255,255,.33);color:var(--ink);font:600 14px/1.55 inherit;padding:9px 12px;cursor:pointer;}
.apkx-option span{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:rgba(231,173,60,.22);font-weight:900;}
.apkx-option.on{background:var(--green);border-color:var(--green-d);}
.apkx-action:disabled{opacity:.42;cursor:not-allowed;}
.apkx-personality-report{max-width:820px;}
.apkx-report-section{border-top:1px dashed rgba(56,42,26,.32);padding-top:12px;margin-top:14px;}
.apkx-report-section h4{font-size:17px;margin:0 0 9px;color:var(--good);}
.apkx-report-section b{display:block;margin:8px 0 3px;font-size:14px;}
.apkx-report-section p{margin:0 0 8px;line-height:1.82;}
.apkx-empty{text-align:center;padding:34px 10px;color:var(--ink2);}

body.theme-dark .apkx-sheet{background:#252932;color:#edf0f6;}
body.theme-dark .apkx-sheet,.theme-dark .apkx-head p,.theme-dark .apkx-muted,.theme-dark .apkx-fig,.theme-dark .apkx-lot-id{color:#cfd5df;}
body.theme-dark .apkx-card,body.theme-dark .apkx-note,body.theme-dark .apkx-nav button,body.theme-dark .apkx-action,body.theme-dark .apkx-select{background:rgba(255,255,255,.08);color:#edf0f6;border-color:#89919d;}
body.theme-dark .apkx-card h3,body.theme-dark .apkx-fig b,body.theme-dark .apkx-house-key{color:#fff;}
body.theme-dark .apkx-dot{background:#f2f2f2;}
body.theme-dark .apkx-option{background:rgba(255,255,255,.07);color:#edf0f6;border-color:#89919d;}
body.theme-dark .apkx-option.on{background:rgba(92,150,117,.45);}

@media (max-width:760px){
  .apkx-modal{padding:0;align-items:flex-end;}
  .apkx-sheet{width:100%;max-height:96dvh;border-radius:18px 18px 0 0;border-width:3px 0 0;padding:16px 13px calc(18px + env(safe-area-inset-bottom));}
  .apkx-grid,.apkx-grid.two{grid-template-columns:1fr;}
  .apkx-sixteen{grid-template-columns:repeat(4,minmax(52px,1fr));}
  .apkx-house-row{grid-template-columns:74px 1fr;gap:8px;}
  .apkx-head h2{font-size:20px;}
  .modebar button{padding-left:10px;padding-right:10px;font-size:13px;}
}

@media (max-width:390px){
  .apkx-sheet{padding-left:10px;padding-right:10px;}
  .apkx-nav{margin-right:-10px;}
  .apkx-sixteen{grid-template-columns:repeat(4,minmax(46px,1fr));gap:4px;}
  .apkx-card{padding:10px;}
  .apkx-house-text{font-size:12px;}
}
