/* Compact save dialog: one action at a time, centered, without page scrolling. */
.save-dialog{box-sizing:border-box;width:min(560px,calc(100vw - 80px));height:min(480px,calc(100vh - 32px));height:min(480px,calc(100dvh - 32px));max-width:none;max-height:none;padding:22px;overflow:hidden;overscroll-behavior:none;background:#15282d;border:1px solid #71817670;border-radius:10px;color:#e4e7db;box-shadow:0 18px 60px #0008}.save-dialog[open]{display:block}.save-dialog [hidden]{display:none!important}.save-dialog::backdrop{background:#041015b8;backdrop-filter:blur(3px)}body.save-manager-open{overflow:hidden;overscroll-behavior:none}.save-shell{height:100%;min-height:0;display:grid;grid-template-rows:auto auto auto auto minmax(0,1fr) auto;gap:8px}.save-dialog .save-heading{position:static;inset:auto;z-index:auto;width:auto;margin:0;padding:0;transform:none;pointer-events:auto;display:flex;align-items:center;justify-content:space-between;gap:10px}.save-heading small{display:none}.save-heading h2{margin:0;font-size:25px;line-height:1.2;font-family:inherit;font-weight:700;letter-spacing:0}.save-dialog .save-close{position:static;pointer-events:auto;flex:0 0 auto;width:28px;height:28px;padding:0;border:0;background:none;color:#bcc8be;font-size:25px;line-height:1}
.save-tabs{display:flex;border-bottom:1px solid #b2bea42b;gap:18px}.save-dialog .save-tabs button{flex:1;padding:9px 2px;background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:#9facaa;font-size:15px;line-height:1.3;font-weight:500;letter-spacing:0}.save-dialog .save-tabs button[aria-selected=true]{color:#edcf94;border-bottom-color:#d2b276;font-weight:700}.save-tabs span{display:none}.save-network-note{padding:0;border:0;background:none;color:#bbc5b7;font-size:12px;line-height:1.5}.save-network-note #saveGoLocal{display:none!important}
.save-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0;min-height:0}.save-summary>div{min-width:0;padding:0;border:0;background:none}.save-summary span{display:block;font-size:11px;line-height:1.3;color:#9fafa4;margin-bottom:3px}.save-summary strong{display:block;font-size:15px;line-height:1.3;color:#ead4a8;overflow-wrap:anywhere}.save-summary>div:last-child strong{font-size:11px;line-height:1.4}#saveCurrentSummary{display:flex;gap:30px;padding:0 0 8px;border-bottom:1px solid #a9b7a51c}#saveCurrentSummary>div{display:flex;align-items:baseline;gap:8px}#saveCurrentSummary span{font-size:12px;margin:0}#saveCurrentSummary strong,#saveCurrentSummary>div:last-child strong{font-size:16px;line-height:1.3}.has-save-feedback #saveCurrentSummary{height:0;min-height:0;padding:0;border:0;overflow:hidden}
.save-body,.save-page{height:100%;min-height:0;overflow:hidden}.save-card{box-sizing:border-box;min-width:0;min-height:0;height:100%;display:flex;flex-direction:column;gap:7px;padding:0;border:0;background:none;overflow:hidden}.save-card h3,#saveImportPreview h3{font-size:17px;line-height:1.25;font-weight:700;color:#e5e8dd;margin:0;flex-shrink:0}.save-card p,#saveImportPreview p{font-size:13px;line-height:1.5;color:#b6c4b9;margin:0}.save-card small{display:block;font-size:11px;line-height:1.4;color:#9aada1;margin:0;flex-shrink:0}.save-card .save-service-status{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:12px;line-height:1.4;flex-shrink:0}.save-dialog label{display:block;font-size:12px;line-height:1.35;color:#bac9bd;margin:0;flex-shrink:0}.save-dialog textarea{box-sizing:border-box;display:block;width:100%;min-height:42px;height:50px;flex:1;padding:9px;border:1px solid #81918366;border-radius:5px;background:#0b1c22;color:#e7ebdd;font:11px/1.5 ui-monospace,Consolas,monospace;resize:none;margin:0;word-break:break-all;overflow-wrap:anywhere;scrollbar-width:thin;-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default!important;touch-action:auto}.save-dialog textarea:focus{outline:1px solid #c4ad7d}.save-dialog button{box-sizing:border-box;font-size:13px;line-height:1.3;letter-spacing:0;padding:8px 12px;-webkit-tap-highlight-color:transparent;border-color:#82918555;background:#20353a;color:#d8e0d5}.save-dialog button.save-primary{background:#ceb27c;color:#12242a;border-color:#ceb27c;font-size:16px;font-weight:700}.save-dialog button.save-primary:hover{background:#dfc38d}.save-dialog button:disabled{opacity:.45;cursor:default}.save-dialog button:focus-visible{outline:1px solid #dfc38d;outline-offset:2px}.save-card-actions{display:flex;align-items:center;gap:9px;flex:0 0 auto}.save-card-actions button{white-space:nowrap;min-width:0}.save-card-actions button:first-child{flex:1}.save-local-mark{display:flex;align-items:center;flex:1;min-height:0}.save-local-mark small{font-size:12px;color:#aabbb0}.save-dialog .save-feedback{font-size:12px;line-height:1.4;margin:0;color:#c2d1bf;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.save-dialog .save-feedback:empty{display:none}.save-dialog .bad{color:#eab5a2}.save-shell>footer{position:static;inset:auto;width:auto;margin:0;padding:0;transform:none;display:grid;gap:5px;min-height:0}.save-dialog .save-text-button{justify-self:center;border:0;background:none;padding:2px;color:#d6c092;font-size:13px}.save-shell>footer>small{font-size:10px;line-height:1.3;color:#849b91;text-align:center}.save-preview-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}#saveImportPreview{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:10px;box-sizing:border-box;height:100%;min-height:0;overflow:hidden;padding:0;border:0;background:none}#saveImportPreview p{align-self:center;font-size:12px;line-height:1.5}#saveRestore{justify-self:stretch}
#saveCodePopup{width:min(520px,calc(100vw - 80px));height:min(440px,calc(100vh - 32px));height:min(440px,calc(100dvh - 32px))}.save-export-shell{height:100%;min-height:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto;gap:10px}.save-dialog .save-export-status{font-size:13px;line-height:1.45;margin:0;color:#bac9bc;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.save-export-field{display:grid;grid-template-rows:auto minmax(36px,1fr) auto;gap:8px;min-height:0}.save-export-field textarea{height:100%;min-height:36px;max-height:none}.save-export-field>button{justify-self:stretch}.save-code-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.save-code-actions>span{font-size:11px;color:#9eb0a4}.save-export-footer{display:grid;gap:7px;min-height:0}.save-export-footer>button{justify-self:start;border:0;background:none;color:#d6c092;padding:0;font-size:12px}
@media(max-height:500px){.save-dialog{padding:14px;height:calc(100vh - 32px);height:calc(100dvh - 32px)}.save-shell{gap:5px}.save-heading h2{font-size:22px}.save-dialog .save-close{height:25px;width:25px}.save-dialog .save-tabs button{font-size:14px;padding:7px 2px}.save-network-note{font-size:11px;line-height:1.4}#saveCurrentSummary{padding-bottom:5px;gap:24px}#saveCurrentSummary span{font-size:11px}#saveCurrentSummary strong,#saveCurrentSummary>div:last-child strong{font-size:14px}.save-card{gap:5px}.save-card h3,#saveImportPreview h3{font-size:15px}.save-card p{font-size:12px;line-height:1.4}.save-card .save-service-status{font-size:11px}.save-card small{font-size:10px}.save-dialog label{font-size:11px}.save-dialog textarea{min-height:32px;padding:6px;font-size:10px;line-height:1.4}.save-dialog button{font-size:12px;padding:6px 10px}.save-dialog button.save-primary{font-size:14px}.save-dialog .save-feedback{font-size:11px;line-height:1.35}.save-shell>footer{gap:3px}.save-dialog .save-text-button{font-size:12px}.save-shell>footer>small{font-size:9px}.save-summary{grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}.save-summary span{font-size:8px}.save-summary strong{font-size:12px}.save-summary>div:last-child strong{font-size:8px}.save-export-shell{gap:6px}.save-dialog .save-export-status{font-size:11px}.save-export-field{gap:6px}.save-export-footer{gap:5px}#saveImportPreview{gap:6px}#saveImportPreview p{font-size:11px}.save-local-mark small{font-size:11px}}
@media(max-height:350px){.save-dialog{padding:10px}.save-shell{gap:4px}.save-heading h2{font-size:20px}.save-dialog .save-close{height:22px;width:22px}.save-dialog .save-tabs button{font-size:13px;padding:5px 2px}.save-network-note{font-size:10px}#saveCurrentSummary{padding-bottom:4px}#saveCurrentSummary strong,#saveCurrentSummary>div:last-child strong{font-size:13px}.save-card{gap:4px}.save-card h3{font-size:14px}.save-card[data-task=save] h3{display:none}.save-card .save-service-status{font-size:10px}.save-card p{font-size:11px}.save-card small{font-size:9px}.save-dialog label{font-size:10px}.save-dialog textarea{min-height:27px;font-size:10px}.save-dialog button{font-size:11px;padding:5px 8px}.save-dialog button.save-primary{font-size:13px}.save-dialog .save-text-button{font-size:11px}.save-shell>footer>small{display:none}.save-dialog .save-feedback{font-size:10px}.save-export-shell{gap:5px}.save-heading h2{font-size:20px}.save-local-mark small{font-size:10px}#saveImportPreview p{font-size:10px}}
@media(max-width:520px) and (orientation:portrait){.save-dialog,#saveCodePopup{width:calc(100vw - 40px)}.save-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Keep the server-save schedule outside the flexible form, so it cannot be covered. */
#saveServerPage{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:7px}#serverSaveHint{position:static;flex-shrink:0;margin:0;padding:2px 0 0;font-size:12px;line-height:1.5;color:#bdcbbd;white-space:normal;overflow:visible}.save-dialog #saveLocalTab,.save-dialog #saveGoLocal{display:none!important}.save-dialog .save-tabs{gap:0}.save-dialog .save-tabs #saveServerTab{cursor:default}.save-dialog #saveExportSwitch[hidden]{display:none!important}@media(max-height:500px){#saveServerPage{gap:5px}#serverSaveHint{font-size:11px;line-height:1.4}}@media(max-height:350px){#saveServerPage{gap:4px}#serverSaveHint{font-size:10px;line-height:1.4}}
/* Make recovery easy to find while keeping Save as the primary action. */
.save-dialog #saveTaskToggle{justify-self:center;min-height:34px;min-width:220px;padding:7px 18px;border:1px solid #bba16c;border-radius:5px;background:#284047;color:#f0d69f;font-size:14px;font-weight:600;line-height:1.3}.save-dialog #saveTaskToggle:hover{background:#34515a}.save-dialog #saveTaskToggle:focus-visible{outline:2px solid #ead09a;outline-offset:2px}@media(max-height:500px){.save-dialog #saveTaskToggle{min-height:30px;min-width:210px;padding:6px 16px;font-size:13px}#saveServerPage [data-task=save]>h3{display:none}}@media(max-height:350px){.save-dialog #saveTaskToggle{min-height:28px;padding:5px 14px;font-size:12px}}
@media(max-height:300px){.save-shell #saveCurrentSummary{height:0;min-height:0;padding:0;border:0;overflow:hidden}.save-dialog .save-tabs button{font-size:12px;padding:4px 2px}.save-card h3,.save-card>small{display:none}.has-save-feedback #archiveServiceStatus{display:none}.save-dialog .save-feedback{-webkit-line-clamp:1}}
/* The mode is a small title label; reserve independent rows for the save buttons and schedule. */
.save-shell{grid-template-rows:auto auto auto minmax(0,1fr) auto}.save-dialog .save-tabs{display:none!important}.save-title-row{display:flex;align-items:baseline;gap:12px;min-width:0}.save-heading .save-mode-label{display:inline;font-size:12px;line-height:1.3;font-weight:400;letter-spacing:0;color:#9eafa5;white-space:nowrap}#saveServerPage{grid-template-rows:minmax(0,1fr) auto auto}#serverSaveActions{position:relative;z-index:1;flex-shrink:0;min-height:42px;background:#15282d}#serverSaveActions button{min-height:42px;white-space:normal}#serverSaveActions #saveGenerate{font-size:16px;font-weight:700;line-height:1.3;padding:9px 14px}#serverSaveActions #archiveCopyLink{min-width:90px}.save-dialog #archiveLink{min-height:32px}
@media(max-height:500px){.save-title-row{gap:10px}.save-heading .save-mode-label{font-size:11px}#serverSaveActions,#serverSaveActions button{min-height:38px}#serverSaveActions #saveGenerate{font-size:15px;padding:7px 12px}}@media(max-height:350px){.save-heading .save-mode-label{font-size:10px}#serverSaveActions,#serverSaveActions button{min-height:36px}#serverSaveActions #saveGenerate{font-size:14px;padding:6px 10px}}
/* Pin the controls in the footer, outside the form's clipped, flexible area. */
#saveServerPage{grid-template-rows:minmax(0,1fr)}.save-shell>footer #serverSaveActions,.save-shell>footer #serverSaveHint{align-self:start}.save-shell>footer #serverSaveHint{text-align:left}.save-shell>footer{overflow:visible}
/* Give recovery a quieter place at the right, alongside the save schedule. */
.save-shell>footer{grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:6px;align-items:center}.save-shell>footer #serverSaveActions{grid-column:1/-1}.save-shell>footer #serverSaveHint{grid-column:1;align-self:center;padding:0;font-size:11px;line-height:1.45;color:#a7b8aa}.save-dialog #saveTaskToggle{grid-column:2;justify-self:end;align-self:center;min-width:0;min-height:28px;padding:5px 3px;border:1px solid transparent;background:transparent;border-radius:4px;color:#9eafa8;font-size:12px;font-weight:400;line-height:1.3;white-space:nowrap}.save-dialog #saveTaskToggle:hover{background:transparent;color:#d2c39f}.save-shell>footer>.save-feedback,.save-shell>footer>small{grid-column:1/-1}.save-shell>footer>small{text-align:left;color:#7e958b;font-size:9px}#serverSaveActions{gap:10px;min-height:44px}#serverSaveActions button{min-height:44px;border-radius:7px}#serverSaveActions #saveGenerate{background:#dbc28f;border:1px solid #e8d2a8;color:#14272d;font-size:16px;font-weight:700;letter-spacing:1px;padding:10px 16px;box-shadow:none;transition:background .15s,border-color .15s}#serverSaveActions #saveGenerate:not(:disabled):hover{background:#e5cfa5;border-color:#efdfc1}#serverSaveActions #saveGenerate:not(:disabled):active{background:#c9ac75;border-color:#d6ba87}#serverSaveActions #archiveCopyLink{min-width:84px;background:transparent;border-color:#87998a55;color:#c0cec2;font-size:12px;padding:8px 10px}.save-card label{color:#aebfb4}.save-network-note{color:#a9baad}
@media(max-height:500px){.save-shell>footer{row-gap:4px;column-gap:10px}#serverSaveActions,#serverSaveActions button{min-height:40px}#serverSaveActions #saveGenerate{font-size:15px;padding:8px 14px}.save-shell>footer #serverSaveHint{font-size:10px}.save-dialog #saveTaskToggle{font-size:11px;min-height:27px;padding:4px 2px}}@media(max-height:350px){#serverSaveActions,#serverSaveActions button{min-height:38px}#serverSaveActions #saveGenerate{font-size:14px;padding:7px 12px}.save-shell>footer #serverSaveHint{font-size:10px}.save-dialog #saveTaskToggle{font-size:11px;min-height:25px}}
/* Recovery remains right-aligned when returning from the restore page. */
.save-shell>footer #saveTaskToggle:first-child{grid-column:2}
#foreignSavePrompt{width:min(440px,calc(100vw - 48px));height:auto;max-height:calc(100vh - 24px);padding:24px;overflow:hidden}#foreignSavePrompt h2{font-family:inherit;letter-spacing:0;font-size:22px;font-weight:700;line-height:1.3;margin:0 0 16px}#foreignSavePrompt p{font-size:14px;line-height:1.8;color:#e6c3b1;margin:0 0 20px}#foreignSavePrompt>div{display:flex;justify-content:flex-end;gap:12px}#foreignSavePrompt button{min-height:36px;padding:8px 18px}@media(max-height:350px){#foreignSavePrompt{padding:18px}#foreignSavePrompt h2{font-size:20px;margin-bottom:10px}#foreignSavePrompt p{font-size:12px;margin-bottom:14px}}
