/* SKYHORSE Studio home. One control system: every input/select/button/segment is 34px, radius 8, same
   border, same focus ring. Cards are borderless covers with a soft lift on hover. Quiet, warm grey. */
:root {
  --bg: #f6f6f4; --surface: #ffffff; --surface-2: #f0f0ed; --surface-3: #e9e9e5;
  --line: #e4e4df; --line-strong: #cbcbc4;
  --text: #17171a; --text-2: #55555c; --muted: #8a8a91;
  --accent: #17171a; --accent-hover: #2e2e33; --on-accent: #fff; --focus: #2563eb;
  --danger: #b42318; --danger-soft: #fdecea;
  --radius: 10px; --radius-lg: 14px; --control: 34px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 28px -14px rgba(0,0,0,.14);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.06), 0 14px 32px -16px rgba(0,0,0,.18);
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:where(input, button, select, a, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: #dfe6ff; }

/* ---- controls -------------------------------------------------------------------------------- */
.control, .view-tools input[type=search], .view-tools select, .ghost, .primary, .seg, .dialog-form input[type=text], .dialog-form select, .connect-card input {
  height: var(--control); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.view-tools input[type=search], .dialog-form input[type=text], .connect-card input { padding: 0 12px; min-width: 0; }
.view-tools input[type=search] { width: 260px; padding-left: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238a8a91' stroke-width='1.6'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cpath d='M13.2 13.2 17 17' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 10px center; background-size: 16px; }
.view-tools input[type=search]::placeholder { color: var(--muted); }
.view-tools input[type=search]:hover, .view-tools select:hover, .dialog-form input[type=text]:hover, .dialog-form select:hover { border-color: var(--line-strong); }
.view-tools input[type=search]:focus, .dialog-form input[type=text]:focus, .dialog-form select:focus, .view-tools select:focus { border-color: var(--line-strong); outline: none; box-shadow: 0 0 0 3px rgba(23,23,26,.06); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.view-tools select, .dialog-form select {
  appearance: none; -webkit-appearance: none; padding: 0 30px 0 12px; color: var(--text-2); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2355555c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 16px;
}
.view-tools select:hover { color: var(--text); }
.primary { padding: 0 14px; border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary:active { transform: translateY(.5px); }
.ghost { padding: 0 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.ghost:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.ghost:active { background: var(--surface-2); }
.ghost.small { height: 26px; padding: 0 8px; font-size: 12px; }
.ghost.is-danger { color: var(--danger); } .ghost.is-danger:hover { border-color: #e7b4ae; background: var(--danger-soft); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-color: transparent; }
.seg button { height: 26px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; line-height: 1; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button b { font-weight: 500; color: var(--muted); margin-left: 5px; font-size: 12px; font-variant-numeric: tabular-nums; }
.seg button.is-on b { color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.upload-label { cursor: pointer; }

/* ---- shell / rail ---------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: .04em; font-size: 13px; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; } .mark svg { width: 18px; height: 18px; fill: currentColor; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.rail-nav svg { width: 18px; height: 18px; color: var(--muted); transition: color .15s var(--ease); }
.rail-nav a:hover { background: var(--surface-2); color: var(--text); }
.rail-nav a.is-on { background: var(--surface-2); color: var(--text); } .rail-nav a.is-on svg { color: var(--text); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.rail-foot a { height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 13px; } .rail-foot a:hover { color: var(--text); background: var(--surface-2); }
.rail-account { display: flex; gap: 6px; align-items: stretch; margin-top: 8px; }
.rail-user { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-align: left; min-width: 0; }
.rail-user span { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; } .rail-user small { color: var(--muted); font-size: 11px; }
.rail-user.is-connected span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.rail-signout { width: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); display: grid; place-items: center; } .rail-signout:hover { color: var(--danger); border-color: #e7b4ae; }
.rail-signout svg { width: 16px; height: 16px; }

/* ---- page frame ------------------------------------------------------------------------------ */
.main { padding: 28px 36px 56px; min-width: 0; }
.view { display: none; } .view.is-on { display: block; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.view-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.view-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.view-title small { font-size: 13px; }
.view-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 18px; flex-wrap: wrap; }
.crumb { background: none; border: 0; padding: 2px 4px; margin: 0 -4px; border-radius: 6px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.crumb:hover { color: var(--text); background: var(--surface-2); }
.crumb.is-here { color: var(--text-2); cursor: default; }
.crumb-sep { color: var(--line-strong); }
.crumb.is-over { background: var(--accent); color: var(--on-accent); }
body.is-dragging-project .crumb:not(.is-here) { outline: 1px dashed var(--line-strong); outline-offset: 2px; }
.row-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: baseline; gap: 8px; }
.row-title .count { font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.empty { color: var(--muted); margin: 56px 0; text-align: center; font-size: 13px; }
.empty.small { margin: 24px 0; }
.more { display: block; margin: 12px auto 0; }

/* ---- cards ----------------------------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.project-grid, .canvas-grid { grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 22px 22px; }
.asset-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; padding: 0; border: 0; background: none; text-align: left; min-width: 0; color: inherit; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease); }
.card:hover .thumb { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.project-card:hover .thumb, .canvas-card:hover .thumb { transform: translateY(-1px); }
.asset .thumb { aspect-ratio: 1 / 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .22s ease; }
.thumb.is-ready img { opacity: 1; }
.thumb.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.thumb.is-empty::after, .thumb.is-failed::after { content: attr(data-note); position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.thumb.is-empty::after { content: "还没有图片"; } .thumb.is-failed::after { content: "缩略图暂不可用"; }
.thumb > i { position: absolute; z-index: 1; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-style: normal; font-size: 13px; display: grid; place-items: center; padding-left: 2px; backdrop-filter: blur(2px); }
.thumb.is-cover-default { display: grid; place-items: center; background: linear-gradient(135deg, #ebebe8, #f7f7f5); }
.thumb.is-cover-default b { font-size: 30px; font-weight: 600; color: var(--line-strong); letter-spacing: -.02em; }
.thumb.is-audio { display: grid; place-items: center; background: linear-gradient(135deg, #ebebe8, #f7f7f5); } .thumb.is-audio > i { position: static; transform: none; width: auto; height: auto; background: none; color: var(--muted); font-size: 30px; padding: 0; backdrop-filter: none; }
.card-body { padding: 9px 2px 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card-body strong { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.card-body small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-more { position: absolute; z-index: 3; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 7px; background: rgba(255,255,255,.94); color: var(--text-2); font-size: 16px; line-height: 28px; text-align: center; opacity: 0; transition: opacity .15s var(--ease), background .15s var(--ease); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.14); backdrop-filter: blur(4px); }
.card:hover .card-more, .card-more:focus-visible { opacity: 1; }
.card-more:hover { background: #fff; color: var(--text); }
.card-more svg { width: 16px; height: 16px; fill: currentColor; display: block; margin: 6px auto; }
.seg button svg { width: 16px; height: 16px; display: block; }
.ghost.icon { width: var(--control); padding: 0; justify-content: center; } .ghost.icon svg { width: 16px; height: 16px; fill: currentColor; }
.project-card.is-dragging, .canvas-card.is-dragging { opacity: .45; }
.folder-card { cursor: pointer; }
.folder-card .folder-icon { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: #d4b872; transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease); }
.folder-card .folder-icon svg { width: 42%; height: 42%; filter: drop-shadow(0 1px 0 rgba(0,0,0,.06)); }
.folder-card:hover .folder-icon { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.thumb.is-folder-cover .folder-badge { position: absolute; left: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.92); color: #d4b872; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.14); } .folder-badge svg { width: 15px; height: 15px; }
.folder-card.is-over .thumb, .folder-card.is-over .folder-icon { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface-3); }
.start-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 30px; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface); }
.start-card strong { font-size: 16px; } .start-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* list view */
body.view-list .project-grid { display: flex; flex-direction: column; gap: 2px; }
body.view-list .project-card, body.view-list .folder-card { flex-direction: row; align-items: center; gap: 14px; padding: 6px 10px 6px 6px; border-radius: 10px; transition: background .15s var(--ease); }
body.view-list .project-card:hover, body.view-list .folder-card:hover { background: var(--surface-2); }
body.view-list .project-card:hover .thumb, body.view-list .folder-card:hover .folder-icon { box-shadow: none; transform: none; }
body.view-list .project-card .thumb, body.view-list .folder-card .folder-icon { width: 92px; flex: none; aspect-ratio: 16 / 9; border-radius: 7px; }
body.view-list .card-body { flex-direction: row; align-items: baseline; gap: 14px; padding: 0; flex: 1; }
body.view-list .card-body small { margin-left: auto; }
body.view-list .card-more { position: static; opacity: 1; box-shadow: none; background: none; }

/* ---- menus ------------------------------------------------------------------------------------ */
.menu { position: fixed; z-index: 50; min-width: 172px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lift); display: flex; flex-direction: column; animation: pop .12s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.menu button { height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.menu button.is-danger { color: var(--danger); } .menu button.is-danger:hover { background: var(--danger-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }


/* ---- assets ---------------------------------------------------------------------------------- */
#view-assets .view-title .seg { align-self: flex-start; margin-top: 2px; }
.type-seg { margin: 0 0 18px; }
.group { margin-bottom: 30px; } .group h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); } .group h2 small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.asset { cursor: pointer; }
.asset-check { position: absolute; z-index: 3; top: 8px; left: 8px; width: 22px; height: 22px; border: 1.5px solid rgba(255,255,255,.95); border-radius: 6px; background: rgba(0,0,0,.28); color: #fff; font-size: 13px; line-height: 20px; text-align: center; opacity: 0; transition: opacity .15s var(--ease), background .15s var(--ease); cursor: pointer; backdrop-filter: blur(2px); }
.asset:hover .asset-check, .asset.is-selected .asset-check { opacity: 1; }
.asset.is-selected .asset-check { background: var(--accent); border-color: var(--accent); }
.asset.is-selected .thumb { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.asset .dur { position: absolute; z-index: 2; right: 8px; top: 8px; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
.asset .badge { position: absolute; z-index: 2; left: 8px; bottom: 50px; padding: 1px 7px; border-radius: 5px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; } .badge.is-failed { background: var(--danger); }
.select-bar { position: fixed; z-index: 40; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lift); animation: rise .18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.select-bar span { font-size: 13px; font-weight: 600; margin-right: 6px; }
#library-wrap .crumbs { margin: 0 0 12px; }
#library-wrap .seg { margin-bottom: 16px; }
.folder-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 22px; }
.folder-grid .folder-card .folder-icon { aspect-ratio: 16 / 10; }
#library-title { margin-top: 2px; }

/* ---- connect --------------------------------------------------------------------------------- */
.view.connect.is-on { display: grid; place-items: center; min-height: 70vh; }
.connect-card { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.connect-card h1 { margin: 0 0 6px; font-size: 18px; } .connect-card p { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.connect-card form { display: flex; gap: 8px; } .connect-card input { flex: 1; height: 36px; }
.error { color: var(--danger); font-size: 12px; min-height: 18px; margin: 10px 0 0; }

/* ---- dialogs --------------------------------------------------------------------------------- */
.dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); width: min(560px, calc(100vw - 32px)); animation: pop .14s var(--ease); }
.dialog::backdrop { background: rgba(20,20,22,.42); backdrop-filter: blur(2px); }
.dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog header strong { font-size: 14px; }
.dialog .close { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); } .dialog .close:hover { background: var(--surface-2); color: var(--text); }
.dialog-note { margin: 0; padding: 12px 18px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-form { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 16px; }
.dialog-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.dialog-form footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.deleted-list { list-style: none; margin: 0; padding: 8px 10px 12px; max-height: 60vh; overflow: auto; }
.deleted-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border-radius: 8px; transition: background .12s var(--ease); } .deleted-list li:hover { background: var(--surface-2); }
.deleted-list li span { display: flex; flex-direction: column; min-width: 0; } .deleted-list strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .deleted-list small { color: var(--muted); font-size: 12px; }
.deleted-list .muted { color: var(--muted); justify-content: center; }
li.cover-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
li.cover-row:hover { background: none; }
.cover-pick { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 8px; }
.cover-option { padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: none; cursor: pointer; transition: border-color .12s var(--ease); } .cover-option:hover { border-color: var(--accent); }
.cover-option .thumb { width: 96px; aspect-ratio: 1; border: 0; border-radius: 7px; }
.dialog.preview { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; }
.dialog.preview .close { position: absolute; right: 10px; top: 10px; z-index: 1; background: rgba(255,255,255,.9); }
#preview-body { display: grid; grid-template-columns: 1fr 320px; max-height: calc(100vh - 34px); }
#preview-body > img, #preview-body > video { width: 100%; max-height: calc(100vh - 34px); object-fit: contain; background: #111; display: block; }
#preview-body > audio { align-self: center; width: 90%; margin: 48px auto; }
.preview-meta { padding: 22px 22px 18px; border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.preview-meta > strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
.preview-meta small { color: var(--muted); font-size: 12px; }
.preview-meta p { margin: 8px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 12.5px; }
.details dt { color: var(--muted); white-space: nowrap; } .details dd { margin: 0; color: var(--text-2); word-break: break-all; }
.prompt-fold { margin-top: 12px; font-size: 12.5px; } .prompt-fold summary { cursor: pointer; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; } .prompt-fold summary::before { content: "›"; display: inline-block; transition: transform .15s var(--ease); color: var(--line-strong); } .prompt-fold[open] summary::before { transform: rotate(90deg); } .prompt-fold summary::-webkit-details-marker { display: none; }
.preview-actions { margin-top: auto; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.preview-actions .primary, .preview-actions .ghost { height: 32px; font-size: 13px; }

/* ask (our prompt / confirm) */
.dialog.ask { width: min(420px, calc(100vw - 32px)); }
.dialog.ask form { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 18px; }
.dialog.ask strong { font-size: 15px; font-weight: 600; }
.ask-message { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.dialog.ask input[type=text] { height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; margin-top: 4px; }
.dialog.ask input[type=text]:hover { border-color: var(--line-strong); } .dialog.ask input[type=text]:focus { border-color: var(--line-strong); outline: none; box-shadow: 0 0 0 3px rgba(23,23,26,.06); }
.ask-choices { align-self: flex-start; margin-top: 4px; }
.dialog.ask footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.primary.is-danger { background: var(--danger); border-color: var(--danger); } .primary.is-danger:hover { background: #9a1c12; border-color: #9a1c12; }

/* ---- toast / boot ---------------------------------------------------------------------------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 12px); padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); max-width: min(520px, calc(100vw - 32px)); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.booting { display: none; }
body.is-booting .view { display: none !important; }
body.is-booting .booting { display: block; height: 240px; margin-top: 60px; border-radius: var(--radius-lg); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; } .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .brand { padding: 0; } .rail-nav { flex-direction: row; } .rail-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; } .rail-user { margin: 0; }
  .main { padding: 18px 14px 40px; } .view-head { flex-direction: column; align-items: stretch; } .view-tools { justify-content: flex-start; } .view-tools input[type=search] { width: 100%; }
  #preview-body { grid-template-columns: 1fr; } .preview-meta { border-left: 0; border-top: 1px solid var(--line); }
}
