*{margin:0;padding:0;box-sizing:border-box;font-family:"Inter","Segoe UI",sans-serif}
:root{
  --bg1:#0f2027;--bg2:#203a43;--bg3:#2c5364;--text:#ffffff;--muted:rgba(255,255,255,.72);
  --panel:rgba(255,255,255,.09);--panel-strong:rgba(255,255,255,.14);--line:rgba(255,255,255,.18);
  --success:#92fe9d;--warning:#ffe082;--danger:#ffb4b4;--accent:#00c6ff;
}
html,body{width:100%;height:100%}
body{min-height:100vh;overflow:hidden;color:var(--text);background:linear-gradient(135deg,var(--bg1),var(--bg2),var(--bg3));display:flex;justify-content:center;align-items:center;padding:14px}
.bg-circle{position:fixed;border-radius:50%;filter:blur(120px);opacity:.45;animation:float 14s infinite ease-in-out alternate;pointer-events:none}
.c1{width:600px;height:600px;background:#00c6ff;top:-200px;left:-200px}.c2{width:700px;height:700px;background:#92fe9d;bottom:-250px;right:-250px;animation-duration:18s}
@keyframes float{from{transform:translateY(0)}to{transform:translateY(80px)}}
.app-shell{position:relative;z-index:1;width:min(980px,calc(100vw - 28px));height:min(860px,calc(100vh - 28px));padding:20px;border-radius:30px;background:var(--panel);border:none;backdrop-filter:blur(25px);box-shadow:none;display:flex;flex-direction:column;gap:16px;overflow:hidden}
.app-header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}
.app-title{font-size:clamp(28px,3.4vw,36px);line-height:1.08;font-weight:800;letter-spacing:.4px}
.app-subtitle{margin-top:10px;color:var(--muted);font-size:17px;max-width:640px;line-height:1.4}
.app-status-card{min-width:220px;max-width:min(100%,360px);padding:16px 18px;border-radius:22px;background:var(--panel-strong);border:1px solid var(--line)}
.status-label{font-size:14px;color:var(--muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.8px}
.status-value{font-size:20px;font-weight:800;word-break:break-word}.status-extra{margin-top:10px;font-size:14px;color:var(--muted)}
.success{color:var(--success)!important}.warning{color:var(--warning)!important}.danger{color:var(--danger)!important}
.app-main{flex:1;min-height:0;overflow:auto;padding-right:4px}
.app-footer{display:flex;justify-content:flex-end;align-items:center;gap:14px;flex-wrap:wrap}
.footer-actions{display:flex;gap:14px;flex-wrap:wrap;justify-content:flex-end;width:100%}
.action-btn,.menu-btn,.small-tile,.file-row,.upload-button,.confirm-btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:#fff;border:none;cursor:pointer;transition:.2s;background:var(--panel-strong);border:1px solid rgba(255,255,255,.22)}
.action-btn,.confirm-btn{min-height:58px;padding:0 20px;border-radius:18px;font-size:18px;font-weight:700;max-width:100%;text-align:center}
.action-btn:hover,.menu-btn:hover,.small-tile:hover,.file-row:hover,.upload-button:hover,.confirm-btn:hover{transform:translateY(-2px);background:rgba(255,255,255,.2)}
.action-btn.secondary,.confirm-btn.secondary{background:rgba(255,255,255,.08)}
.action-btn.danger,.confirm-btn.danger{background:rgba(255,90,90,.18);border-color:rgba(255,160,160,.35)}
.action-btn.success{background:rgba(146,254,157,.15);border-color:rgba(146,254,157,.28)}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-content:start}
.menu-btn{min-height:132px;padding:20px;border-radius:26px;font-size:clamp(22px,2.7vw,28px);font-weight:800;text-align:center;line-height:1.18;word-break:break-word}
.tiles-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
.card{background:var(--panel-strong);border:1px solid var(--line);border-radius:28px;padding:18px;min-width:0;overflow:hidden}
.card.center{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.qr-box{width:min(100%,320px);aspect-ratio:1/1;background:#fff;border-radius:24px;padding:14px;display:flex;align-items:center;justify-content:center;box-shadow:0 18px 40px rgba(0,0,0,.25)}
.qr-box img{width:100%;height:100%;object-fit:contain}
.big-note{font-size:20px;font-weight:700;margin-top:16px}.muted{color:var(--muted);font-size:15px;line-height:1.45}
.file-list{margin-top:16px;display:flex;flex-direction:column;gap:12px;max-height:340px;overflow:auto}
.file-row{justify-content:space-between;padding:16px 18px;border-radius:18px;background:rgba(255,255,255,.08);font-size:18px;gap:12px;width:100%;text-align:left;min-width:0}
.file-row span,.file-row strong{min-width:0;overflow-wrap:anywhere}
.file-row.disabled{opacity:.45;cursor:not-allowed}
.meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.meta-box{padding:16px;border-radius:22px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);min-width:0}
.meta-box .label{font-size:13px;color:var(--muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.6px}.meta-box .value{font-size:20px;font-weight:800;word-break:break-word}
.log-box{margin-top:18px;border-radius:22px;padding:18px;min-height:220px;background:rgba(8,15,20,.55);border:1px solid rgba(255,255,255,.1);color:#d8f3ff;font-size:14px;line-height:1.5;white-space:pre-wrap;word-break:break-word;overflow:auto;max-height:360px}
.form-shell{display:flex;flex-direction:column;gap:22px;max-width:620px;margin:0 auto}.file-input{padding:26px;border-radius:24px;background:rgba(255,255,255,.08);border:1px dashed rgba(255,255,255,.28);font-size:18px;color:#fff}.upload-button{min-height:74px;border-radius:24px;font-size:22px;font-weight:800}
.notice{padding:18px 20px;border-radius:20px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);font-size:17px;line-height:1.45;overflow-wrap:anywhere}
.counter{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:18px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);font-size:18px;font-weight:700;max-width:100%;overflow-wrap:anywhere}
.confirm-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;z-index:99999;padding:20px}.confirm-overlay.show{display:flex !important}
.confirm-modal{width:min(560px,100%);max-width:560px;background:rgba(18,31,39,.96);border:1px solid rgba(255,255,255,.18);border-radius:28px;padding:26px;box-shadow:0 30px 80px rgba(0,0,0,.45);text-align:center}
.confirm-title{font-size:30px;font-weight:800;margin-bottom:12px}.confirm-text{font-size:18px;color:var(--muted);line-height:1.45}.confirm-timer{font-size:44px;font-weight:800;margin:18px 0 22px}.confirm-actions{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}
@media (max-width:1100px){.app-shell{width:100%;height:100%;max-height:none;border-radius:0;padding:16px}.grid-3,.tiles-2{grid-template-columns:1fr}.app-status-card{width:100%;max-width:none}.file-list{max-height:none}.log-box{max-height:none}.app-main{padding-right:0}}

.viewer-mode .app-shell{width:min(1180px,calc(100vw - 20px));height:min(920px,calc(100vh - 20px));padding:18px 18px 16px}
.viewer-mode .app-header{align-items:center;gap:10px;margin-bottom:4px}
.viewer-mode .app-subtitle{display:none}
.viewer-mode .app-status-card{padding:14px 16px;border-radius:20px;min-width:210px}
.viewer-mode .app-main{overflow:hidden;padding-right:0}
.viewer-mode .app-footer{flex-shrink:0;padding-top:4px}
.viewer-mode .footer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;width:100%}
.viewer-mode .footer-actions .action-btn{width:100%;min-width:0;min-height:64px;border-radius:20px;font-size:22px;font-weight:800}
.viewer-mode .doc-viewer-card{height:100%;padding:12px;border-radius:30px;background:rgba(255,255,255,.1)}
.viewer-mode .doc-preview-shell{height:100%;display:flex;flex-direction:column;gap:12px;min-height:0}
.viewer-mode .doc-preview-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:12px;border-radius:28px;background:rgba(4,10,14,.4);border:1px solid rgba(255,255,255,.1);overflow:auto}
.viewer-mode .doc-preview-canvas{display:block;max-width:100%;height:auto;border-radius:18px;background:#fff;box-shadow:0 12px 30px rgba(0,0,0,.25)}
.viewer-mode .doc-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;flex-shrink:0}
.viewer-mode .doc-toolbar-panel{min-width:0;min-height:92px;display:flex;align-items:center;justify-content:center;gap:10px;padding:14px 16px;border-radius:24px;background:rgba(255,255,255,.1)}
.viewer-mode .doc-pages-panel,.viewer-mode .doc-copies-panel{display:grid;grid-template-columns:auto minmax(0,1fr) auto}
.viewer-mode .doc-toolbar-info{min-width:0;text-align:center}
.viewer-mode .doc-toolbar-label{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:1px}
.viewer-mode .doc-toolbar-value{font-size:28px;font-weight:800;line-height:1.1;margin-top:4px;overflow-wrap:anywhere}
.viewer-mode .doc-toolbar-hint{font-size:15px;color:var(--muted);margin-top:4px;overflow-wrap:anywhere}
.viewer-mode .doc-price-panel{flex-direction:column;gap:4px}
.viewer-mode .doc-price-value{font-size:32px;font-weight:800;line-height:1.1;text-align:center;overflow-wrap:anywhere}
.viewer-mode .doc-mini-btn{min-height:60px;padding:0 18px;font-size:24px;min-width:64px;flex-shrink:0;border-radius:18px}

@media (max-width:900px){
  .viewer-mode .app-shell{width:100%;height:100%;padding:14px}
  .viewer-mode .app-header{align-items:flex-start}
  .viewer-mode .doc-toolbar{grid-template-columns:1fr}
}

@media (max-width:640px){
  .viewer-mode .app-shell{padding:12px}
  .viewer-mode .app-title{font-size:24px}
  .viewer-mode .app-status-card{width:100%;max-width:none}
  .viewer-mode .doc-viewer-card{padding:8px;border-radius:22px}
  .viewer-mode .doc-preview-stage{padding:8px;border-radius:20px}
  .viewer-mode .doc-toolbar-panel{padding:12px;border-radius:20px}
  .viewer-mode .doc-toolbar-value{font-size:24px}
  .viewer-mode .doc-price-value{font-size:28px}
  .viewer-mode .footer-actions{grid-template-columns:1fr 1fr;gap:10px}
  .viewer-mode .footer-actions .action-btn{min-height:58px;font-size:18px;padding:0 10px}
}


.home-mode .app-shell{width:min(1180px,calc(100vw - 32px));height:min(900px,calc(100vh - 32px));}
.home-mode .app-main{display:flex;align-items:center;justify-content:center;overflow:hidden;padding-right:0}
.home-screen{width:100%;max-width:980px;margin:0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:28px;min-height:100%}
.home-menu-grid{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;align-items:stretch}
.home-menu-grid .menu-btn{min-height:190px;font-size:clamp(24px,2.8vw,32px);padding:28px;border-radius:30px}
.home-service-actions{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;width:100%}
.home-service-actions .action-btn{min-width:260px;min-height:64px}

.templates-card{height:100%}
.templates-toolbar{display:flex;justify-content:flex-end;align-items:center;margin-bottom:16px}
.view-switch{display:inline-flex;gap:8px;padding:6px;border:1px solid rgba(255,255,255,.12);border-radius:999px;background:rgba(255,255,255,.04)}
.view-btn{border:0;background:transparent;color:rgba(255,255,255,.74);padding:10px 18px;border-radius:999px;font-size:15px;cursor:pointer}
.view-btn.active{background:#ffffff;color:#101822;font-weight:700}
.templates-board[data-view="list"]{display:flex;flex-direction:column;gap:12px}
.templates-board[data-view="icons"]{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px}
.template-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-radius:20px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.12);min-width:0}
.templates-board[data-view="icons"] .template-item{flex-direction:column;align-items:stretch;text-align:center;min-height:210px;justify-content:space-between}
.template-main{display:flex;align-items:center;gap:14px;min-width:0}
.templates-board[data-view="icons"] .template-main{flex-direction:column;justify-content:center}
.template-icon{width:56px;height:56px;display:inline-flex;align-items:center;justify-content:center;border-radius:18px;background:rgba(255,255,255,.12);font-size:28px;flex-shrink:0}
.template-meta{min-width:0}
.template-name{font-size:20px;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.template-subline{margin-top:6px;font-size:13px;color:var(--muted);letter-spacing:.6px}
.template-select-btn{border:none;cursor:pointer;min-height:56px;padding:0 22px;border-radius:16px;font-size:18px;font-weight:800;color:#081019;background:linear-gradient(135deg,#7df9a6,#00c6ff);box-shadow:0 10px 24px rgba(0,198,255,.22);flex-shrink:0}
.template-select-btn:disabled{opacity:.7;cursor:default}

.viewer-mode .app-shell{width:min(1240px,calc(100vw - 20px));height:min(940px,calc(100vh - 20px));padding:18px 18px 16px}
.viewer-mode .app-header{align-items:center;gap:10px;margin-bottom:4px;flex-shrink:0}
.viewer-mode .app-main{overflow:hidden;padding-right:0;display:flex}
.viewer-mode .doc-viewer-card{height:100%;width:100%;padding:12px;border-radius:30px;background:rgba(255,255,255,.1);display:flex}
.viewer-mode .doc-preview-shell{height:100%;width:100%;display:flex;flex-direction:column;gap:12px;min-height:0}
.viewer-mode .doc-preview-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:12px;border-radius:28px;background:rgba(4,10,14,.4);border:1px solid rgba(255,255,255,.1);overflow:auto}
.viewer-mode .doc-toolbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;flex-shrink:0;position:relative;z-index:2}
.viewer-mode .footer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;width:100%;max-width:100%}
.viewer-mode .footer-actions .action-btn{width:100%;min-width:0;min-height:70px;border-radius:22px;font-size:24px;font-weight:800;padding:0 14px}

@media (max-width:1100px){
  .home-mode .app-main{overflow:auto}
  .home-screen{justify-content:flex-start;padding:10px 0}
  .home-menu-grid{grid-template-columns:1fr}
}
@media (max-width:900px){
  .viewer-mode .doc-toolbar{grid-template-columns:1fr}
  .viewer-mode .footer-actions{grid-template-columns:1fr 1fr}
}
@media (max-width:640px){
  .home-service-actions .action-btn{min-width:0;width:100%}
  .viewer-mode .footer-actions{grid-template-columns:1fr}
  .viewer-mode .footer-actions .action-btn{font-size:20px;min-height:62px}
}


.app-corner-timer{position:absolute;top:14px;right:16px;z-index:3;display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:rgba(0,0,0,.16);border:1px solid rgba(255,255,255,.10);backdrop-filter:blur(10px);font-size:12px;color:rgba(255,255,255,.62)}
.app-corner-status{display:none}
.app-corner-timer-value{font-variant-numeric:tabular-nums;letter-spacing:.4px}
.home-mode .app-shell{width:min(980px,calc(100vw - 32px));height:min(760px,calc(100vh - 32px));justify-content:center}
.home-mode .app-header{justify-content:center;text-align:center;min-height:auto}
.home-mode .app-main{overflow:hidden;display:flex;align-items:center;justify-content:center;padding:0}
.home-mode .app-footer{justify-content:center}
.home-screen{width:100%;max-width:860px;margin:0 auto;display:flex;flex-direction:column;justify-content:center;gap:22px;min-height:100%}
.home-menu-grid{display:grid;grid-template-columns:1fr;gap:20px}
.home-service-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;max-width:820px;margin:0 auto;width:100%}
.home-mode .menu-btn{min-height:120px}
.home-mode .app-corner-timer{top:12px;right:12px;background:transparent;border-color:transparent;padding:2px 6px;color:rgba(255,255,255,.35)}
.home-mode .app-title{margin:0 auto}
.home-mode .app-subtitle{display:none}
.qr-mode .app-main,.qr-upload-mode .app-main{display:flex;align-items:center;justify-content:center;overflow:hidden}
.qr-mode .card,.qr-upload-mode .card{width:min(720px,100%)}
.templates-card{height:100%;display:flex;flex-direction:column;min-height:0}
.templates-board{flex:1;min-height:0;overflow:auto;padding-right:4px}
.templates-board[data-view="icons"]{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;align-content:start}
.templates-board[data-view="list"]{display:flex;flex-direction:column;gap:12px}
.templates-board .notice{margin-top:0}
.tg-file-sections{display:none;margin-top:18px}
.tg-file-sections.show{display:block}
@media (max-width:1100px){.home-mode .app-shell{height:100%;width:100%;max-height:none;border-radius:0}.home-service-actions{grid-template-columns:1fr 1fr}}
@media (max-width:720px){.home-service-actions{grid-template-columns:1fr}.app-corner-timer{font-size:11px;top:10px;right:10px}}


/* viewer full-screen refinement */
.viewer-mode .app-shell{width:100vw;height:100vh;max-width:none;max-height:none;border-radius:0;padding:12px 12px 10px;border:none;background:rgba(7,22,30,.86)}
.viewer-mode .app-main{height:calc(100vh - 116px);min-height:0;padding:0;display:flex;overflow:hidden}
.viewer-mode .app-footer{flex-shrink:0;padding-top:10px}
.viewer-mode .doc-viewer-card{padding:10px 10px 0;border-radius:24px;background:transparent}
.viewer-mode .doc-preview-shell{gap:10px}
.viewer-mode .doc-preview-stage{border-radius:22px;padding:10px;background:rgba(4,10,14,.48)}
.viewer-mode .doc-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.viewer-mode .doc-toolbar-panel{min-height:82px;padding:12px 14px;border-radius:20px}
.viewer-mode .doc-pages-panel,.viewer-mode .doc-copies-panel{grid-template-columns:56px minmax(0,1fr) 56px;align-items:center}
.viewer-mode .doc-price-panel{grid-column:1 / -1;display:grid;grid-template-columns:auto 1fr;gap:4px 14px;align-items:center;justify-content:space-between;text-align:left;padding:12px 18px}
.viewer-mode .doc-price-panel .doc-toolbar-label{grid-column:1 / 2;margin:0}
.viewer-mode .doc-price-panel .doc-price-value{grid-column:2 / 3;justify-self:end;font-size:28px;text-align:right}
.viewer-mode .doc-price-panel .doc-toolbar-hint{grid-column:1 / -1;margin-top:0}
.viewer-mode .doc-toolbar-label{font-size:11px}
.viewer-mode .doc-toolbar-value{font-size:24px}
.viewer-mode .doc-toolbar-hint{font-size:14px}
.viewer-mode .doc-mini-btn{min-width:56px;min-height:56px;padding:0;font-size:22px;border-radius:16px}
.viewer-mode .footer-actions{gap:10px}
.viewer-mode .footer-actions .action-btn{min-height:64px;font-size:22px;border-radius:18px}
.viewer-mode .app-corner-timer{top:8px;right:10px;background:transparent;border-color:transparent;padding:2px 4px;color:rgba(255,255,255,.28)}

@media (max-width:1100px){
  .viewer-mode .app-main{height:calc(100vh - 120px)}
}

@media (max-width:900px){
  .viewer-mode .app-shell{padding:10px 10px 8px}
  .viewer-mode .app-main{height:calc(100vh - 112px)}
  .viewer-mode .doc-toolbar{grid-template-columns:1fr}
  .viewer-mode .doc-price-panel{grid-column:auto;grid-template-columns:1fr auto}
}

@media (max-width:640px){
  .viewer-mode .app-shell{padding:8px 8px 6px}
  .viewer-mode .app-main{height:calc(100vh - 132px)}
  .viewer-mode .doc-viewer-card{padding:6px 6px 0;border-radius:18px}
  .viewer-mode .doc-preview-stage{padding:6px;border-radius:18px}
  .viewer-mode .doc-toolbar{grid-template-columns:1fr 1fr;gap:8px}
  .viewer-mode .doc-pages-panel,.viewer-mode .doc-copies-panel{grid-template-columns:48px minmax(0,1fr) 48px;padding:10px 12px;min-height:74px}
  .viewer-mode .doc-price-panel{grid-column:1 / -1;padding:10px 12px;gap:2px 10px}
  .viewer-mode .doc-toolbar-value{font-size:20px}
  .viewer-mode .doc-price-panel .doc-price-value{font-size:24px}
  .viewer-mode .doc-toolbar-hint{font-size:12px}
  .viewer-mode .doc-mini-btn{min-width:48px;min-height:48px;font-size:18px}
  .viewer-mode .footer-actions{grid-template-columns:1fr 1fr;gap:8px}
  .viewer-mode .footer-actions .action-btn{min-height:58px;font-size:18px;padding:0 8px}
}

.opt-btn{
 padding:12px 20px;
 border-radius:10px;
 border:1px solid #ccc;
 background:#f5f5f5;
 font-size:16px;
}
.opt-btn.active{
 background:#1976d2;
 color:#fff;
 border-color:#1976d2;
}


.doc-choice-row{
    display:flex;
    gap:10px;
    justify-content:center;
    flex-wrap:wrap;
    margin-top:8px;
}
.doc-choice-btn{
    min-width:132px;
    padding:12px 16px;
    border:1px solid #cfd8dc;
    border-radius:14px;
    background:#fff;
    color:#16213e;
    font-size:18px;
    font-weight:600;
    cursor:pointer;
}
.doc-choice-btn.active{
    background:#16213e;
    color:#fff;
    border-color:#16213e;
}
.doc-mode-panel{
    min-width:280px;
}
.doc-price-panel{
    text-align:center;
    align-items:center;
}


.doc-choice-btn.is-disabled,
.doc-choice-btn:disabled{
    opacity:.55;
    cursor:not-allowed;
    background:rgba(255,255,255,.12);
    color:rgba(255,255,255,.78);
    border-color:rgba(255,255,255,.18);
}


.viewer-mode .doc-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);align-items:stretch}
.viewer-mode .doc-combo-panel{display:flex;flex-direction:column;justify-content:center;gap:12px}
.viewer-mode .doc-inline-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:center}
.viewer-mode .doc-control-group{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center}
.viewer-mode .doc-copy-row{display:grid;grid-template-columns:auto minmax(56px,auto) auto;gap:10px;align-items:center}
.viewer-mode .doc-choice-row{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.viewer-mode .doc-choice-btn{min-width:132px;padding:12px 16px;border:1px solid rgba(255,255,255,.28);border-radius:16px;background:transparent;color:#fff;font-size:17px;font-weight:700;cursor:pointer;transition:.2s}
.viewer-mode .doc-choice-btn.active{background:#fff;color:#16213e;border-color:#fff}
.viewer-mode .doc-binding-wrap{display:flex;flex-direction:column;gap:8px;align-items:center}
.viewer-mode .doc-price-panel{text-align:center;align-items:center;justify-content:center}
.viewer-mode .doc-price-value{font-size:34px}
.viewer-mode .doc-toolbar-hint{text-align:center}
.viewer-mode .doc-choice-btn.is-disabled,.viewer-mode .doc-choice-btn:disabled{opacity:.45;cursor:not-allowed}
.payment-clean .meta-grid{margin-bottom:18px}
.payment-clean .card{display:flex;flex-direction:column}
.payment-clean .log-box{margin-top:0;flex:1}
@media (max-width:900px){
  .viewer-mode .doc-toolbar{grid-template-columns:1fr}
  .viewer-mode .doc-inline-controls{grid-template-columns:1fr}
}


/* tightened preview controls layout */
.viewer-mode .doc-combo-panel{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:14px;
}
.viewer-mode .doc-inline-controls{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);
  gap:18px;
  align-items:end;
}
.viewer-mode .doc-control-group{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  justify-content:center;
  min-width:0;
}
.viewer-mode .doc-copy-row{
  display:grid;
  grid-template-columns:56px minmax(54px,auto) 56px;
  gap:10px;
  align-items:center;
}
.viewer-mode .doc-copy-row .doc-toolbar-value{
  text-align:center;
  min-width:54px;
}
.viewer-mode .doc-control-group .doc-choice-row{
  min-height:56px;
  align-items:center;
}
.viewer-mode .doc-binding-wrap[hidden]{
  display:none !important;
}
@media (max-width:900px){
  .viewer-mode .doc-inline-controls{
    grid-template-columns:1fr 1fr;
    gap:12px;
  }
}
@media (max-width:640px){
  .viewer-mode .doc-inline-controls{
    grid-template-columns:1fr;
  }
}

.app-title-hwid{display:inline-block;margin-left:10px;font-size:.48em;font-weight:700;color:rgba(255,255,255,.78);vertical-align:middle}
.admin-mode .app-shell{width:min(1280px,calc(100vw - 24px));height:min(920px,calc(100vh - 24px));justify-content:flex-start}
.admin-dashboard{display:flex;flex-direction:column;gap:16px}
.admin-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.admin-logs-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.admin-table-wrap{overflow:auto;border:1px solid rgba(255,255,255,.12);border-radius:22px;background:rgba(255,255,255,.06)}
.admin-table{width:100%;border-collapse:collapse;min-width:980px}
.admin-table th,.admin-table td{padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);text-align:left;vertical-align:top}
.admin-table th{position:sticky;top:0;background:rgba(9,19,26,.95);font-size:13px;text-transform:uppercase;letter-spacing:.8px;color:var(--muted)}
.admin-badge{display:inline-flex;align-items:center;justify-content:center;min-width:92px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);font-weight:700}
.admin-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;word-break:break-all}
.admin-log-box{min-height:260px;max-height:320px;margin-top:12px}
.admin-input{width:100%;min-height:58px;padding:0 18px;border-radius:18px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:#fff;font-size:18px}
.admin-input::placeholder{color:rgba(255,255,255,.52)}
.admin-login-card{max-width:560px;margin:0 auto}
.admin-login-form{width:100%;margin-top:18px}
@media (max-width:1024px){.admin-stats-grid,.admin-logs-grid{grid-template-columns:1fr 1fr}}
@media (max-width:720px){.app-title-hwid{display:block;margin:10px 0 0;font-size:.42em}.admin-stats-grid,.admin-logs-grid{grid-template-columns:1fr}}
