:root{
  --navy:#2b2452;--ink:#39325f;--muted:#8d86a8;--blue:#9b8cff;--blueDeep:#6f5cf0;
  --pale:#f5f3ff;--line:#eae7f6;--orange:#ffb65b;--surface:#fff;--radius:20px;
  --shadow:0 20px 60px rgba(56,102,161,.085);
  --lu-cyan:#6cd8f2;--lu-green:#74e3ba;--lu-yellow:#ffe15a;--lu-pink:#ff9cc0;--lu-purple:#a68cff;--lu-orange:#ffad4d;
  --font:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Noto Sans SC",Arial,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
[hidden]{display:none!important}
html{scroll-behavior:smooth}
body{font-family:var(--font);color:var(--ink);background:
  radial-gradient(1200px 500px at 85% -50px,#ffead9 0%,transparent 60%),
  radial-gradient(900px 420px at -60px 8%,#e4dfff 0%,transparent 55%),
  radial-gradient(800px 500px at 55% 110%,#e2f6f0 0%,transparent 60%),
  #f7f6fd;min-height:100vh}
button{font-family:inherit}
a{color:var(--blueDeep)}

/* ---------- topbar ---------- */
.topbar{position:sticky;top:0;z-index:50;display:flex;align-items:center;justify-content:space-between;
  padding:14px 34px;background:rgba(255,255,255,.82);backdrop-filter:blur(12px);border-bottom:1px solid #ffffffd9}
.brand{display:flex;align-items:center;gap:14px}
.brand .logo{width:44px;height:44px;border-radius:14px;background:#fff;box-shadow:0 6px 18px rgba(56,102,161,.15);display:flex;align-items:center;justify-content:center}
.brand h1{font-size:20px;letter-spacing:.5px;color:var(--navy)}
.brand small{display:block;font-size:11px;color:var(--muted);font-weight:500;letter-spacing:1.5px}
.brand .lu{background:linear-gradient(90deg,var(--blueDeep),var(--lu-purple),var(--lu-pink));-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:800}
.top-meta{display:flex;align-items:center;gap:10px;font-size:12px;color:#5f7290}
.top-meta .dot{color:#ff8ab2}
.badge-guide{display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:7px 14px;font-size:12px;color:var(--ink)}
.badge-guide .sw{width:34px;height:18px;border-radius:999px;background:#3ecf8e;position:relative}
.badge-guide .sw::after{content:"";position:absolute;right:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff}

/* ---------- hero ---------- */
.hero{max-width:1180px;margin:0 auto;padding:44px 34px 10px;display:grid;grid-template-columns:1.2fr .9fr;gap:20px;align-items:center}
.kicker{display:inline-flex;align-items:center;gap:8px;font-size:11px;letter-spacing:2.5px;color:var(--blueDeep);
  background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 16px;font-weight:700}
.kicker::before{content:"✳";color:var(--lu-pink)}
.hero h2{font-size:44px;line-height:1.28;color:var(--navy);margin:18px 0 14px;font-weight:800}
.hero h2 .warm{color:#ff8e79}
.hero p{color:#5f7290;font-size:14.5px;line-height:2}
.hero-badges{display:flex;gap:18px;margin-top:16px;font-size:12.5px;color:#5f7290;flex-wrap:wrap}
.hero-badges b{color:#3ecf8e;font-weight:600}
.hero-art{position:relative;height:260px}
.art-card{position:absolute;width:190px;height:250px;border-radius:18px;box-shadow:0 24px 50px rgba(56,102,161,.18);padding:22px;color:#fff}
.art-card.a{background:linear-gradient(150deg,#9b8cff,#6cd8f2);right:150px;top:6px;transform:rotate(-6deg)}
.art-card.b{background:linear-gradient(150deg,#ffb86b,#ff9cc0);right:40px;top:26px;transform:rotate(7deg)}
.art-card span{font-size:22px;font-weight:800;letter-spacing:2px;line-height:1.4;display:block}
.art-card .tw{width:52px;height:52px;border-radius:50%;background:rgba(255,255,255,.35);margin-top:70px;display:flex;align-items:center;justify-content:center;font-size:26px}
.art-handdraw{position:absolute;right:10px;top:-4px;color:#c7b299;font-family:cursive;font-size:15px;transform:rotate(8deg)}
.art-spark{position:absolute;color:var(--lu-yellow);font-size:26px}

/* ---------- app shell ---------- */
.app-shell{max-width:1500px;margin:26px auto 40px;padding:0 34px;display:grid;grid-template-columns:236px minmax(0,1fr) 300px;gap:22px;align-items:start}
.sidebar{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 14px;position:sticky;top:86px}
.sidebar-heading{font-size:13px;font-weight:800;color:var(--navy);padding:6px 10px 14px;letter-spacing:1px}
.sidebar-heading span{color:var(--muted);font-weight:600;font-size:10px;letter-spacing:2px;margin-left:6px}
.category-item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:none;border:0;border-radius:14px;
  padding:12px 10px;cursor:pointer;color:var(--ink);transition:background .15s}
.category-item:hover{background:var(--pale)}
.category-item.active{background:linear-gradient(90deg,#eaf4ff,#f5f0ff);box-shadow:inset 0 0 0 1px #d5e6ff}
.side-icon{width:38px;height:38px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:17px;flex:none}
.side-icon.blue{background:#e3f3ff;color:#3c77ea}.side-icon.purple{background:#efe9ff;color:#8a6bf0}
.side-icon.orange{background:#fff1de;color:#e8933a}.side-icon.pink{background:#ffe7ef;color:#e8659a}.side-icon.green{background:#e2f7ec;color:#2fae7d}
.side-label{font-size:13.5px;font-weight:700;display:flex;flex-direction:column;gap:2px}
.side-label small{font-size:10.5px;color:var(--muted);font-weight:500}
.category-indicator{margin-left:auto;color:#b9c6da;font-size:16px}
.sidebar-bottom{margin-top:14px;padding:10px 12px;font-size:11px;color:#69a08c;background:#eef8f3;border-radius:10px;display:flex;gap:8px;align-items:center}
.privacy-dot{width:8px;height:8px;border-radius:50%;background:#3ecf8e;flex:none}

/* ---------- work area ---------- */
.work-area{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:26px 30px 34px;min-height:640px}
.subtool-navigation{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:0}
.subtool-chip{border:1px solid var(--line);background:#fbfdff;color:#51617e;border-radius:999px;padding:8px 16px;font-size:12.5px;cursor:pointer}
.subtool-chip.active{background:var(--ink);color:#fff;border-color:var(--ink)}
/* 分类标题卡：对齐原站 subtool-group 版式，LULU 紫蓝配色 */
.subtool-group{margin:0 0 22px;padding:15px 17px 16px;background:linear-gradient(135deg,#f3f0ff 0%,#fffefd 60%,#fff5fb 100%);border:1px solid #e9e2fb;border-radius:16px}
.subtool-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:13px}
.subtool-kicker{font-size:9px;font-weight:850;letter-spacing:2px;color:#9b8cff}
.subtool-heading h3{font-size:15px;color:#2b2452;margin:4px 0 2px;font-weight:800}
.subtool-heading p{color:#9aa6c4;font-size:10.5px;margin:0;line-height:1.6}
.subtool-count{background:#fff;border:1px solid #e6dffb;border-radius:30px;padding:5px 9px;white-space:nowrap;font-size:10px;color:#8a7bd6;font-weight:700}
.subtool-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.tool-shortcut{display:flex;align-items:center;justify-content:center;gap:5px;text-align:center;border-radius:10px;background:#fff;border:1px solid #e8e3f7;min-height:39px;padding:9px 6px;color:#64729a;font-size:11px;font-weight:730;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.tool-shortcut:hover{border-color:#b8a9f5;color:#6f5cf0;transform:translateY(-1px)}
.tool-shortcut.active{background:linear-gradient(110deg,#efeaff 0%,#f6f2ff 50%,#fff0f7 100%);border-color:#a99af2;color:#6f5cf0;box-shadow:inset 0 0 0 1px #ddd4fb}
.tool-shortcut:focus-visible{outline:2px solid #9b8cff;outline-offset:3px}
.eyebrow{font-size:10.5px;letter-spacing:3px;color:#9aa9c2;font-weight:700}
.panel h3.title{font-size:24px;color:var(--navy);margin:8px 0 4px;font-weight:800}
.panel h3.title .ast{color:var(--lu-pink);margin-left:4px}
.panel .desc{color:#7d8ca6;font-size:13px;margin-bottom:18px}
.tool-panel{display:none}
.tool-panel.active{display:block;animation:fade .25s}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1}}

.card{border:1px solid var(--line);border-radius:16px;padding:18px;margin-bottom:18px;background:#fdfefe}
.card h4{font-size:12px;letter-spacing:2px;color:#8d9cb8;margin-bottom:14px;font-weight:800}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:1fr 1fr}.g3{grid-template-columns:repeat(3,1fr)}.g4{grid-template-columns:repeat(4,1fr)}
label.f{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#647695;font-weight:600}
label.f input,label.f select{border:1px solid #dfe7f2;border-radius:10px;padding:9px 12px;font-size:13px;color:var(--ink);background:#fff;font-family:inherit}
label.f input:focus,label.f select:focus{outline:2px solid #bfe0ff;border-color:#9ccdf5}
label.f .hint{font-size:10.5px;color:#9aa9c2;font-weight:500}
details.advanced{border:1px solid #e5e0f4;border-radius:12px;background:#faf9ff;margin:14px 0;padding:0 14px}
details.advanced summary{padding:12px 0;cursor:pointer;font-size:13px;font-weight:700;color:var(--navy);list-style:none}
details.advanced summary::-webkit-details-marker{display:none}
details.advanced summary::before{content:"▸ ";color:#6f5cf0}
details.advanced[open] summary::before{content:"▾ "}
details.advanced summary small{font-size:10.5px;color:#9a92b4;font-weight:400;margin-left:8px}
details.advanced .adv-body{padding:0 0 14px}
.check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink);cursor:pointer}
.check input{width:16px;height:16px;accent-color:#3c77ea}

/* mode choice cards */
.mode-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px}
.mode-card{border:1.5px solid var(--line);border-radius:14px;background:#fff;padding:14px 10px;text-align:center;cursor:pointer;transition:all .15s;color:#51617e}
.mode-card .ic{font-size:22px;display:block;margin-bottom:8px;color:#7f93c9}
.mode-card b{display:block;font-size:13px;color:var(--ink);margin-bottom:4px}
.mode-card small{font-size:10.5px;color:var(--muted)}
.mode-card.active{border-color:#6ea8f5;background:#f0f7ff;box-shadow:0 6px 16px rgba(60,119,234,.12)}
.mode-card.active b{color:var(--blueDeep)}

/* upload */
.dropzone{border:1.5px dashed #b9cfe8;border-radius:14px;background:#f8fbff;padding:26px;text-align:center;color:#7186a7;font-size:13px;cursor:pointer;transition:all .15s}
.dropzone:hover,.dropzone.drag{border-color:var(--blue);background:#eff7ff}
.dropzone b{display:block;font-size:14px;color:var(--ink);margin-bottom:4px}
.dropzone small{color:#9aa9c2}
.file-list{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.file-item{display:flex;align-items:center;gap:10px;background:#f4f8ff;border:1px solid #e1ecfa;border-radius:10px;padding:8px 12px;font-size:12.5px;color:var(--ink)}
.file-item .tag{background:#3c77ea;color:#fff;font-size:10px;border-radius:6px;padding:2px 8px;font-weight:700}
.file-item .rm{margin-left:auto;color:#e8659a;cursor:pointer;font-size:12px;border:0;background:none}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:12px;padding:12px 22px;font-size:14px;font-weight:700;cursor:pointer;border:0;transition:all .15s}
.btn.primary{background:linear-gradient(120deg,#7a6cf0,#9b6cf5);color:#fff;box-shadow:0 10px 24px rgba(79,111,240,.28)}
.btn.primary:hover{transform:translateY(-1px)}
.btn.preview{background:#f3f0ff;color:#6f5cf0;border:1px solid #ded7ff}
.btn.preview:hover{background:#ebe5ff}
.btn.direct{background:#fff;color:#39325f;border:1px solid #ddd7f0}
.btn.direct:hover{background:#f7f4ff}
.btn.ghost{background:#fff;border:1px solid var(--line);color:var(--ink)}
.btn.ghost:hover{background:var(--pale)}
.btn.small{padding:8px 14px;font-size:12.5px;border-radius:10px}
.btn-row{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:6px}

.status{margin-top:14px;font-size:13px;color:#51617e;display:none;align-items:center;gap:10px}
.status.show{display:flex}
.spinner{width:16px;height:16px;border:2.5px solid #cfe0f7;border-top-color:#3c77ea;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.note{font-size:12px;color:#8d9cb8;line-height:1.9;background:#f7faff;border-radius:10px;padding:10px 14px;margin-top:12px}
.note b{color:#e8933a}

/* preview canvas area */
.canvas-wrap{position:relative;border:1px solid var(--line);border-radius:12px;background:#eef2f8;min-height:220px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.canvas-wrap canvas{max-width:100%;max-height:460px;box-shadow:0 8px 22px rgba(30,40,70,.14)}
.canvas-empty{color:#9aa9c2;font-size:12.5px;padding:40px 20px;text-align:center}
.pager{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:10px;font-size:12.5px;color:#647695}
.pager button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 12px;cursor:pointer;font-size:13px}
.pager button:disabled{opacity:.4;cursor:default}

/* selection overlay (crop / watermark erase) */
.sel-box{position:absolute;border:2px solid #3c77ea;background:rgba(70,140,240,.15);pointer-events:none}
.sel-box.erase{border-color:#e8659a;background:rgba(232,101,154,.18)}

/* ---------- structured booklet preview ---------- */
.preview-panel .stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:12px}
.preview-panel .stat-grid>div{border:1px solid #eee9f8;border-radius:10px;background:#faf9ff;text-align:center;padding:9px 4px}
.preview-panel .stat-grid strong{display:block;font-size:19px;color:#6f5cf0;line-height:1.2}
.preview-panel .stat-grid span{font-size:9.5px;color:#9a92b4}
.preview-panel .preview-controls{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--navy);margin-bottom:10px}
.preview-panel .icon-btn{border:1px solid #ddd7f0;background:#fff;border-radius:8px;width:30px;height:28px;cursor:pointer;color:#6f5cf0}
.preview-panel .icon-btn:disabled{opacity:.4;cursor:default}
.preview-panel .sheet-view{border:1px solid #e9e3fb;border-radius:12px;padding:10px;margin-bottom:10px;background:#fdfcff}
.preview-panel .sheet-label{font-size:11.5px;font-weight:700;color:var(--navy);margin-bottom:8px;display:flex;align-items:center;gap:6px}
.preview-panel .sheet-label small{font-size:9.5px;color:#a094b8;font-weight:400;margin-left:auto}
.preview-panel .side-status{display:inline-flex;width:18px;height:18px;border-radius:6px;background:#6f5cf0;color:#fff;font-size:10px;align-items:center;justify-content:center}
.preview-panel .side-status.soft{background:#b7a6ff}
.preview-panel .sheet-diagram{display:flex;align-items:stretch;gap:4px;border:1px solid #dcd4f7;border-radius:9px;background:#fff;padding:8px;min-height:76px}
.preview-panel .page-half{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:6px}
.preview-panel .page-half .page-count{font-size:9px;color:#b4accb}
.preview-panel .page-half strong{font-size:18px;color:#6f5cf0}
.preview-panel .fold-axis{width:0;border-left:1.5px dashed #cfc6ee;align-self:stretch}
.preview-panel .preview-note{font-size:10.5px;color:#9a92b4;line-height:1.8;margin:4px 0 8px}
.preview-panel .preview-bottom{font-size:10.5px;color:#b29ac2;text-align:center;margin-top:10px}
.preview-panel .canvas-empty span{font-size:10.5px;color:#b4accb}
.preview-panel[hidden],#planReady[hidden],#resultPreview[hidden]{display:none!important}

/* ---------- right preview panel ---------- */
.preview-panel{background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;position:sticky;top:86px;max-height:calc(100vh - 106px);overflow:auto}
.preview-panel .pp-head{font-size:11px;letter-spacing:2.5px;color:#9aa9c2;font-weight:800;margin-bottom:4px}
.preview-panel h5{font-size:16px;color:var(--navy);margin-bottom:2px}
.preview-panel .pp-sub{font-size:11.5px;color:var(--muted);margin-bottom:12px}
.pp-results{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.pp-item{display:flex;align-items:center;gap:8px;background:#f4f8ff;border:1px solid #e1ecfa;border-radius:10px;padding:8px 12px;font-size:12px;color:var(--ink)}
.pp-item a{margin-left:auto;font-size:12px;color:#3c77ea;font-weight:700;text-decoration:none;white-space:nowrap}

/* ---------- footer ---------- */
/* lower cards */
.sidebar-separator{height:1px;background:var(--line);margin:12px 4px}
.community{margin:4px 2px;border:1px solid #f0e2ee;border-radius:14px;background:linear-gradient(160deg,#fffafc,#fbf8ff);padding:14px}
.community-topline{display:flex;justify-content:space-between;align-items:center;font-size:10.5px;color:#b98bad}
.community-kicker-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#ff8ab2;margin-right:4px}
.community-spark{color:#ffc46b}
.community-header{display:flex;gap:10px;align-items:center;margin:12px 0}
.community-avatar{width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,#8b6cff,#5cc9f5);color:#fff;font-weight:800;font-size:22px;display:flex;align-items:center;justify-content:center;flex:none;box-shadow:0 6px 14px rgba(124,92,246,.25)}
.community-header h3{font-size:13px;color:var(--navy);line-height:1.5}
.community-subline{font-size:10px;color:#a094b8}
.community-description{font-size:11px;line-height:1.9;color:#6f6588}
.community-description strong{color:#6f5cf0}
.community-tags{display:flex;flex-wrap:wrap;gap:5px;margin:10px 0}
.community-tags span{font-size:9.5px;background:#fff;border:1px solid #efe7f8;border-radius:999px;padding:3px 8px;color:#8d7ba8}
.community-footnote{font-size:10px;color:#b29ac2;margin-top:8px}
.bottom-info{max-width:1500px;margin:0 auto 10px;padding:0 34px;display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.bottom-info>div{display:flex;flex-direction:column;gap:4px;border:1px solid #eee9f7;border-radius:14px;background:#fffdfd;padding:14px 18px;font-size:11.5px;color:#8d86a8}
.bottom-info strong{font-size:13px;color:var(--navy)}
.bottom-info .info-star{color:#a68cff;font-size:15px}
.site-footer{border-top:1px solid #ffffffb3;padding:20px 34px 6px;text-align:center;color:#9a92b4;font-size:11.5px;display:flex;flex-direction:column;gap:4px}
.site-footer b{color:var(--ink)}
.build-version{text-align:center;font-size:10.5px;color:#b4accb;padding-bottom:4px}
.visitor-stats{text-align:center;font-size:10.5px;color:#b4accb;padding-bottom:24px}

/* booklet result card */
.result-card{display:none;align-items:center;gap:12px;flex-wrap:wrap;border:1px solid #cdebdc;border-radius:14px;background:#f3fbf7;padding:14px 18px;margin-top:14px;font-size:13px;color:#3f6d59}
.result-card.show{display:flex}
.result-card .success-icon{width:26px;height:26px;border-radius:50%;background:#4fc898;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.result-card .result-text{display:flex;flex-direction:column;gap:2px}
.result-card .result-text span{font-size:11.5px;color:#6d9681}
.result-card .result-actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.result-card .result-actions button{font-size:12px;padding:8px 12px;border-radius:9px;border:1px solid #bfe5d3;background:#fff;color:#3b8466;cursor:pointer}
.result-card .result-actions button.primary-dl{background:#3fa77c;color:#fff;border-color:#3fa77c}
.result-card .result-actions button[hidden]{display:none}

/* per-file plan buttons */
.file-item .view-plan{font-size:11.5px;color:#6f5cf0;background:#fff;border:1px solid #ded7ff;border-radius:7px;padding:3px 9px;cursor:pointer}

/* modal */
.modal{position:fixed;inset:0;z-index:120;background:rgba(30,24,60,.42);display:flex;align-items:center;justify-content:center;padding:20px}
.modal[hidden]{display:none}
.modal-box{background:#fff;border-radius:18px;box-shadow:0 30px 80px rgba(40,30,80,.25);width:min(760px,100%);max-height:86vh;display:flex;flex-direction:column}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--line)}
.modal-head strong{font-size:15px;color:var(--navy)}
.modal-head button{border:0;background:none;font-size:24px;color:#9a92b4;cursor:pointer;line-height:1}
.modal-body{padding:18px 20px;overflow:auto;font-size:13px;color:var(--ink)}
.modal-body .sheet-row{display:flex;gap:10px;border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:10px;background:#fbfaff}
.modal-body .sheet-row .side{flex:1;min-width:0}
.modal-body .sheet-row .side>span{font-size:10.5px;color:#9a92b4;letter-spacing:1px;display:block;margin-bottom:6px}
.modal-body .sheet-row .side .sheet-pair{display:flex;gap:4px}
.modal-body .sheet-row .side .sheet-pair b{flex:1;text-align:center;font-size:14px;background:#f0edff;color:#5b48cf;border-radius:8px;padding:8px 4px;font-weight:600}
.modal-body .sheet-row .side .sheet-pair b.blank{background:#f5f5f7;color:#bbb4cc;font-weight:400}
.modal-body .plan-summary{font-size:12px;color:#8d86a8;margin-bottom:14px}

/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:34px;transform:translateX(-50%) translateY(20px);background:var(--navy);color:#fff;
  border-radius:12px;padding:12px 22px;font-size:13px;opacity:0;pointer-events:none;transition:all .3s;z-index:99;box-shadow:0 12px 30px rgba(20,30,60,.3)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media(max-width:1200px){.app-shell{grid-template-columns:220px minmax(0,1fr)}.preview-panel{display:none}}
@media(max-width:900px){.hero-art{display:none}.hero{grid-template-columns:1fr}.hero h2{font-size:34px}.top-meta .badge-guide{display:none}}
@media(max-width:480px){.hero h2{font-size:30px}.topbar{padding:12px 16px}.brand h1{font-size:17px}.brand small{font-size:9px}}
@media(max-width:900px){.bottom-info{grid-template-columns:1fr;padding:0 18px}.hero{padding:28px 18px 8px}.hero h2{font-size:32px}.app-shell{padding:0 14px}}
@media(max-width:760px){
 .app-shell{grid-template-columns:1fr}
 .sidebar{position:static;order:3}
 .work-area{order:1;padding:18px}
 .preview-panel{display:block;position:static;order:2;max-height:none}
 .bottom-info{order:4}
 .top-meta span:first-child{display:none}
}


/* mobile ordering fix: preview-panel lives inside app-shell grid */
@media(max-width:760px){.app-shell .preview-panel{grid-row:2}}

@media(max-width:560px){
 .g2,.g3,.g4{grid-template-columns:1fr!important}
 .subtool-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px}
 .subtool-group{padding:13px 12px;margin-bottom:18px}
 .tool-shortcut{font-size:11px;min-height:38px;padding:7px 3px}
 .subtool-heading h3{font-size:14px}
 .subtool-heading p{font-size:10px}
 .mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .btn-row .btn{flex:1 1 30%;font-size:12px;padding:10px 8px}
 .stat-grid{gap:4px}
 .sheet-diagram{min-height:64px}
 .result-card .result-actions{margin-left:0}
}
