/* The save panel (ui/saves.js), opened from the 儲存 menu. */

/* the dialog is the 分享 card's: the same frame, backdrop and head */
.save-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);overflow:hidden}
.save-dialog[open]{display:flex;flex-direction:column;gap:10px}
.save-dialog::backdrop{background:rgba(30,35,29,.46)}
.save-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.save-head h2{flex:1;margin:0;font-family:var(--display);font-size:20px;letter-spacing:.04em;color:var(--ink);font-weight:700}
.seg.save-modes{grid-template-columns:repeat(2,1fr)}
.save-modes button{min-height:40px}
/* what a press did, or why not: dark, not the grey of a note, so it is not missed */
.save-status{min-height:1.55em;margin:0;color:var(--ink);font-weight:500}
/* only the list scrolls: the mode switch and the backup links stay in reach. 1 1 auto, not flex:1: the iPhone's WebKit (Erin,
   2026-11-13) gives a 0% basis no height in this auto-height column dialog, and the list, 新存檔 with it, was squeezed to a line */
.save-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:2px}
.save-empty{margin:0;padding:28px 8px;text-align:center;color:var(--muted);font-size:13px}

.save-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
@media(max-width:520px){.save-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.save-slot{display:flex;flex-direction:column;min-width:0;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.save-slot:has(.save-pick:hover){border-color:var(--accent)}
.save-slot.is-broken{opacity:.8}
.save-pick{display:flex;flex-direction:column;align-items:stretch;gap:5px;min-width:0;padding:0 0 8px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.save-pick:focus-visible{outline-offset:-3px}
/* every picture box is the same size, 4 wide to 5 high, whatever shape the picture is, so the tiles, their names and their buttons line up;
   the picture is shown whole inside it (contain), the box's colour showing at its sides or above and below. The picture lies over the box
   (absolute) rather than being sized by it, and the box does not shrink in its tile's column (flex:none), so neither depends on how the engine
   works a height out from aspect-ratio. */
.save-thumb{position:relative;display:grid;place-items:center;flex:none;width:100%;aspect-ratio:4/5;background:var(--bg);overflow:hidden}
.save-thumb img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
.save-nothumb{color:var(--muted);font-size:12px}
.save-tag{align-self:flex-start;margin:2px 10px 0;padding:1px 8px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:11px;letter-spacing:.06em}
.save-name{padding:0 10px;font-weight:500;line-height:1.35;overflow-wrap:anywhere}
.save-meta{display:flex;flex-wrap:wrap;gap:0 8px;padding:0 10px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.save-actions{margin-top:auto;display:flex;border-top:1px solid var(--line)}
.save-del{flex:1;min-height:40px;border:0;background:none;color:var(--muted);font:500 12px var(--body);cursor:pointer}
.save-del:hover{color:var(--sel)}
/* "覆蓋這一格？" and "刪除這一格？": the question and its two answers, in the tile's own foot */
.save-actions.is-confirm{flex-wrap:wrap;align-items:center;gap:6px;padding:8px 10px}
.save-ask{flex:1 0 100%;font-size:13px}
.save-actions.is-confirm .btn{flex:1;min-height:40px;padding:6px 8px}
/* a phone's tile is about 105px wide: tighter sides so the two answers stay side by side, each word on one line (in an even narrower
   tile, nowrap makes them stack rather than break a word in two) */
@media(max-width:520px){
 .save-actions.is-confirm{padding:8px 6px;gap:6px 4px}
 .save-actions.is-confirm .btn{padding:6px 4px;white-space:nowrap}
}
.save-new{border-style:dashed}
.save-new .save-pick{flex:1 1 auto;align-items:center;justify-content:center;gap:4px;padding:16px 8px;color:var(--accent)}
.save-plus{font-size:34px;line-height:1}

.save-foot{display:flex;flex-direction:column;gap:2px;padding-top:6px;border-top:1px solid var(--line)}
.save-foot .note{margin:0}
.save-backup{display:flex;flex-wrap:wrap;align-items:center;gap:0 14px;margin:0;font-size:12px;color:var(--muted)}
.save-link{padding:8px 0;border:0;background:none;color:var(--accent);font:500 12px var(--body);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
@media(max-width:650px){.save-dialog{padding:12px}}
