/* Shared visual system. Loaded after legacy styles so business layouts stay intact. */
:root {
  --bg: #f6f6f7;
  --surface: #fff;
  --surface-2: #f8f8f9;
  --text: #25262b;
  --muted: #70727c;
  --primary: #ff2442;
  --primary-press: #df1e39;
  --border: #e8e8ec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: none;
  --page-width: 760px;
  --gutter: 24px;
}
html { scroll-padding-block: 130px 110px; }
body {
  max-width: var(--page-width); min-height: 100dvh;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y pinch-zoom;
}
button, input, textarea, select { font-family: inherit; }
button, a, [role="button"], summary { touch-action: manipulation; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--primary); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 3px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #ffccd4; outline-offset: 1px; border-color: var(--primary) !important; }
#app { padding: 0 var(--gutter) calc(112px + var(--safe-b)); overflow-x: clip; }
.topbar {
  min-height: 66px; padding: 12px var(--gutter); margin: 0 calc(-1 * var(--gutter)) 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: none;
}
.topbar .topright { gap: 12px; }
.quota-chip { background: #fff1f3; border: 0; border-radius: 7px; padding: 5px 10px; }
.quota-num { font-variant-numeric: tabular-nums; }
.topbar .upgrade-btn { background: transparent; border: 1px solid var(--border); border-radius: 7px; min-height: 36px; display: inline-flex; align-items: center; padding: 5px 11px; }
.topbar .verlabel { color: var(--muted); font-size: 11px; }
.brand { text-align: left; font-size: 25px; font-weight: 650; letter-spacing: -.6px; margin: 26px 0 20px; color: var(--text); }
.page-intro { color: var(--muted); margin: -10px 0 24px; font-size: 13px; }
.hd { padding: 12px var(--gutter) !important; margin: 0 calc(-1 * var(--gutter)) 20px; gap: 12px !important; background: var(--surface); }
.hd h1 { font-size: 17px !important; line-height: 1.5; overflow-wrap: anywhere; }
.hd .back { width: 40px !important; height: 40px !important; border-radius: 8px; flex-shrink: 0; }
.hd > div { min-width: 0; }
.btn, #app .btn { min-height: 42px; padding: 10px 15px !important; font-size: 14px !important; border-radius: 8px; box-shadow: none; line-height: 1.45; font-weight: 550; }
.btn.sm, #app .btn.sm { min-height: 36px; padding: 7px 11px !important; font-size: 12px !important; }
.btn.block, #app .btn.block { padding: 11px 16px !important; white-space: normal; overflow-wrap: anywhere; }
.btn:active, .workspace-card:active, .pdf-card:active { transform: none; }
.btn:not(.primary):not(.ok):not(.danger) { background: #fff; border: 1px solid var(--border); }
.btn.danger { background: #fff4f5; color: #c93048; border: 1px solid #f5dce1; }
.btn.danger.solid { background: #d92b45; color: #fff; }
.card, #app .card, #app .card.tap { padding: 20px !important; border-radius: 12px; box-shadow: none; margin-bottom: 14px; }
.card.tap:hover { border-color: #d2d3d8; background: #fff; }
#app .job-title { font-size: 16px !important; font-weight: 600; overflow-wrap: anywhere; }
.row, .spread, .section-title, .prompt-head { min-width: 0; }
.spread > :first-child, .copy-row .ct, .title-item .t { min-width: 0; overflow-wrap: anywhere; }
#app .section-title { font-size: 15px !important; margin: 20px 0 12px !important; }
.section-title::before { width: 3px; height: 13px; border-radius: 0; }
#app .field { margin-bottom: 16px !important; }
#app .hint, .hint { font-size: 12px !important; line-height: 1.8 !important; color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select,
#app input[type="text"], #app input[type="number"], #app textarea {
  font-size: 16px !important; line-height: 1.6; border-radius: 8px; border: 1px solid #dedfe4;
  padding: 10px 12px !important; color: var(--text); background: #fff; max-width: 100%; min-width: 0;
}
#app textarea { min-height: 144px !important; }
input[type="search"] { appearance: none; }
.cfg-sec, #app .cfg-sec { padding: 14px !important; background: #fafafa; border-radius: 8px; }
.cfg-sec h4, #app .cfg-sec h4 { font-size: 14px !important; }
.refbox { flex-wrap: wrap; }
.refbox img { flex-shrink: 0; }
#app .pv { padding: 10px !important; font-size: 12px !important; max-height: 180px !important; line-height: 1.7; }
.col, .preset-card { box-shadow: none; border-radius: 10px; }
.col-head, .col.compact > .col-head, .cv4-prompt-wrap .col-head { min-height: 48px; padding: 12px 14px !important; }
.col-title, .col.compact .col-title, .cv4-prompt-wrap .col-title { font-size: 14px !important; }
.col-body .card, #app .col-body .card { padding: 8px 16px 16px !important; border: 0; margin: 0; }
.bottom-nav {
  max-width: var(--page-width); box-shadow: none; border: 1px solid var(--border); border-bottom: 0;
  padding: 6px 16px calc(6px + var(--safe-b)); background: #fff;
}
.bottom-nav .bn-item { background: transparent; border: 0; border-radius: 8px; min-height: 52px; font-size: 12px; gap: 3px; }
.bottom-nav .bn-item.on { background: #fff3f5; }
.bottom-nav .bn-item .icon { width: 21px; height: 21px; }
.workspace-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 0; }
.workspace-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  padding: 24px; border: 1px solid var(--border); border-radius: 12px; box-shadow: none; text-align: left;
  color: var(--text); font: inherit; background: #fff;
}
.workspace-card::after { content: '↗'; position: absolute; right: 20px; top: 22px; font-size: 20px; color: #9b9da5; }
.workspace-card:hover { border-color: #ffc0ca; }
.ws-icon { width: 42px; height: 42px; background: #fff0f3; color: var(--primary); display: grid; place-items: center; border-radius: 10px; margin-bottom: 22px; }
.ws-icon .icon { width: 23px; height: 23px; }
.ws-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.ws-desc { font-size: 12px; line-height: 1.9; color: var(--muted); margin-bottom: 18px; }
.ws-tag { font-size: 11px; padding: 0; background: transparent; border-radius: 0; color: #be2942; margin-top: auto; }
.portfolio-entry { padding: 24px; margin: 24px 0 0; border-radius: 12px; border-color: #eadce0; background: #fffafb; }
.portfolio-entry strong { font-size: 17px; font-weight: 600; }
.portfolio-entry p { margin: 8px 0 18px; color: var(--muted); }
.portfolio-actions { gap: 10px; }
.auth-wrap { padding-top: clamp(40px, 10vh, 110px); max-width: 420px; margin: auto; }
.auth-logo { font-size: 23px; letter-spacing: -.5px; }
.auth-sub { margin-top: 10px; margin-bottom: 28px; }
.auth-wrap .card, #app .auth-wrap .card { padding: 24px !important; }
.seg { padding: 4px; border-radius: 9px; background: #ededf0; }
.seg-item { min-height: 42px; border-radius: 6px; display: grid; place-items: center; }
.seg-item.on { background: #fff; color: var(--primary); box-shadow: none; }
.mine-profile { background: #fff; border: 1px solid var(--border); border-radius: 12px; color: var(--text); padding: 24px; }
.mine-avatar { border-radius: 12px; background: #fff0f3; }
.mine-avatar .icon { color: var(--primary); }
.mine-role { color: var(--muted); }
.mine-actions .btn { justify-content: flex-start; }
.presets-hero { padding: 0 0 20px; margin: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.presets-hero-icon { width: 42px; height: 42px; background: #fff0f3; color: var(--primary); border-radius: 10px; box-shadow: none; }
.presets-hero-title { font-size: 23px; color: var(--text); }
.presets-hero-sub { color: var(--muted); line-height: 1.7; }
.preset-workspaces { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; background: #ededf0; border-radius: 9px; padding: 4px; }
.preset-workspace-tab { padding: 10px 6px; min-height: 44px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; white-space: nowrap; }
.preset-workspace-tab.active { background: #fff; color: #d71938; }
.preset-workspace-summary { margin: 12px 0 24px; }
.cat-head { border: 1px solid var(--border); border-radius: 10px; background: #fff !important; min-height: 58px; padding: 14px 16px; box-shadow: none; }
.cat-head .cat-bar { display: none; }
.cat-section, .cat-section:has(.cat-body[style*="block"]), .preset-card:hover { box-shadow: none; }
.cat-section { border-radius: 10px; margin-bottom: 12px; }
.cat-section .cat-head { border: 0; border-radius: 0; margin-bottom: 0; }
.cat-body { padding-top: 12px; }
#app .card.preset-card { padding: 0 !important; }
.cat-icon { display: none; }
.cat-title { color: var(--text) !important; font-size: 15px; }
.cat-count, .cat-badge { background: #f3f3f5 !important; color: var(--muted) !important; border-radius: 6px; }
#app .preset-card { padding: 0 !important; }
.pc-head { padding: 14px 16px; min-height: 50px; background: #fafafa; }
.pc-body { padding: 16px; }
.pc-title { overflow-wrap: anywhere; }
.var-help { background: #fafafa !important; border-color: var(--border) !important; border-radius: 8px; }
.var-help .vh { background: #fff; box-shadow: none; }
.var-help .vh code { white-space: normal; overflow-wrap: anywhere; }
.cat-add { border-style: dashed; }
.cover-panel-v4 { border: 1px solid var(--border); border-radius: 12px; padding: 16px !important; gap: 12px; box-shadow: none; background: #fff; }
.cv4-title { font-size: 16px; }
.cv4-btn { min-height: 44px; font-size: 13px !important; padding: 10px !important; box-shadow: none; }
.cv4-grid { gap: 10px; max-height: none; overflow: visible; align-items: start; padding: 2px; }
.cv4-thumb { border-radius: 8px; }
.cv4-thumb.sel { box-shadow: none; }
.cv4-img-wrap { height: auto; aspect-ratio: 3/4; border-radius: 6px 6px 0 0; }
.cv4-time { font-size: 11px; padding: 5px 2px; }
.cv4-bar { height: auto; min-height: 46px; padding: 5px; gap: 5px; flex-wrap: wrap; }
.cv4-pick, .cv4-del { min-height: 34px; padding: 5px 8px; font-size: 11px; flex: 1; }
.cv4-save-preset, .cv4-save-new { min-height: 36px; font-size: 12px !important; }
.img-time, .img-dur, .gen-img-time, .gen-img-dur { font-size: 11px !important; line-height: 1.5; color: var(--muted); }
.img-time-text { white-space: normal; }
.img-cell .pick, .img-cell .img-save { min-height: 32px; border-radius: 6px; }
.gen-banner { bottom: calc(82px + var(--safe-b)); border: 1px solid #f1cfd6; box-shadow: none; max-width: 700px; }
.gen-banner .bar > i { background: var(--primary); }
.modal-mask, .panel-mask, .upload-modal-overlay { padding: 24px; background: rgba(26,27,32,.42); }
.modal-mask { z-index: 400; }
.modal, .modal-box, .panel-sheet, .upload-modal { border-radius: 14px; box-shadow: none; max-height: min(90dvh,900px); overflow-y: auto; overscroll-behavior: contain; }
.modal { max-width: 560px; padding: 24px; }
.modal-box { max-width: 400px; }
.panel-sheet { max-width: 620px; }
.panel-foot { padding-bottom: calc(16px + var(--safe-b)); }
.panel-close, .pdf-preview-close, .lightbox-close, .lb-close { min-width: 44px; min-height: 44px; }
.ui-mask { z-index: 10010; }
.ui-foot { padding-top: 12px; }
.ui-grip { background: #d9d9df; }
.save-sheet .ss-box { max-width: 600px; max-height: 92dvh; border-radius: 14px; box-shadow: none; }
.save-sheet .ss-list { min-height: 0; }
.save-sheet .ss-foot, .save-sheet .ss-pdf { flex-shrink: 0; }
.toast, .generic-toast { border-radius: 8px; box-shadow: none; max-width: calc(100% - 32px); white-space: normal; z-index: 10100; }
.generic-main { padding: 0 0 20px; }
.generic-main > div[style="height:80px"] { display: none; }
.task-panel { box-shadow: none; border: 1px solid var(--border); border-radius: 10px; }
.task-item { min-height: 56px; }
.task-item.active, .preset-item.selected { background: #fff2f4; border-color: #ffc0cb; }
.task-item.active::before { background: var(--primary); }
.task-item-del { min-width: 36px; min-height: 36px; }
.tb-btn { min-width: 44px; min-height: 44px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.tb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.size-chip { min-height: 40px; border-radius: 7px; }
.size-chip.on { background: #fff2f4; color: #d71938; border-color: #ffc0cb; }
.preset-item-check { color: var(--primary); }
.gen-group { padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.gen-images { gap: 14px; }
.gen-bar-btn { min-height: 40px; }
.gen-bar-btn.edit { background: #fff1f4; color: #ce2340; }
.ref-panel-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ref-panel-actions { flex-wrap: wrap; }
.ref-panel-add, .ref-panel-copy, .ref-panel-del { min-height: 34px; }
.ref-panel-add { background: var(--primary); }
.sel-ref-var { background: #fff1f4; color: #ce2340; min-height: 34px; }
.dl-body { max-width: 900px; }
.dl-wrap { padding: 24px var(--gutter) calc(40px + var(--safe-b)); }
.dl-top { padding: 22px; border: 1px solid var(--border); box-shadow: none; }
.dl-hd h1 { font-size: 21px; }
.dl-grid { grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; }
.dl-item { padding: 10px; }
.dl-item img { aspect-ratio: 3/4; object-fit: contain; }
.dl-gtitle { margin: 24px 0 12px; font-size: 16px; }
.share-header { padding: 36px var(--gutter) 26px; text-align: left; background: #fff; color: var(--text); border-bottom: 1px solid var(--border); }
.share-header h1 { font-size: 26px; font-weight: 650; letter-spacing: -.5px; }
.share-header .subtitle { color: var(--muted); }
.share-header .count { background: #fff0f3; color: #cd2340; border-radius: 6px; padding: 4px 9px; }
.share-header .password-status { color: var(--muted); background: transparent; padding-left: 0; }
.share-header .set-password-btn { color: #c9203d; background: #fff2f5; border: 1px solid #f5dce3; min-height: 36px; border-radius: 6px; }
.search-bar { box-shadow: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.search-bar input { border: 0 !important; }
.search-bar .clear-btn { min-width: 36px; min-height: 36px; }
.password-modal { box-shadow: none; border-radius: 12px; max-height: 90dvh; overflow-y: auto; }
.password-modal-actions .confirm, .upload-modal-actions .confirm { background: var(--primary); }
.share-body { padding: 24px var(--gutter) calc(40px + var(--safe-b)); }
.sort-tabs { background: #ededf0; border-radius: 8px; }
.sort-tab { min-height: 44px; }
.sort-tab.active { box-shadow: none; border-radius: 6px; }
.pdf-card { box-shadow: none; border: 1px solid var(--border); padding: 16px; border-radius: 10px; }
.pdf-card:active { box-shadow: none; }
.pdf-icon { background: #fff0f3; color: #d71938; border: 1px solid #ffe0e6; }
.pdf-name { font-size: 14px; line-height: 1.65; }
.pdf-meta { color: var(--muted); font-size: 12px; }
.pdf-btn { min-height: 40px; padding: 8px 13px; }
.upload-pdf-btn { background: var(--primary); border-radius: 8px; box-shadow: none; min-height: 46px; }
.upload-pdf-btn:active { transform: none; box-shadow: none; }
.admin-tabs { flex-wrap: wrap; }
.admin-actions { flex-wrap: wrap; }
@media (hover:hover) {
  .btn.primary:hover, .upload-pdf-btn:hover { background: var(--primary-press); }
  .btn:not(.primary):not(.danger):hover { border-color: #c7c8cf; }
}
@media (min-width: 760px) {
  .workspace-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .workspace-card { padding: 22px 18px; }
  .ws-name { font-size: 17px; }
  .portfolio-entry { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .portfolio-entry p { margin-bottom: 0; max-width: 300px; }
  .portfolio-actions { flex-shrink: 0; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  #app { padding: 0 var(--gutter) calc(110px + var(--safe-b)); }
  .topbar { min-height: 60px; margin-bottom: 20px; }
  .brand { font-size: 24px; margin-top: 22px; }
  .workspace-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .workspace-card { padding: 18px 16px; display: grid; grid-template-columns: 40px minmax(0,1fr); column-gap: 14px; }
  .workspace-card .ws-icon { grid-column: 1; grid-row: 1 / 4; width: 40px; height: 40px; margin: 0; }
  .workspace-card .ws-name, .workspace-card .ws-desc, .workspace-card .ws-tag { grid-column: 2; }
  .workspace-card .ws-name { padding-right: 20px; margin-bottom: 4px; }
  .workspace-card .ws-desc { margin-bottom: 8px; }
  .ws-name { font-size: 16px; }
  .ws-desc { font-size: 12px; line-height: 1.8; }
  .ws-icon { margin-bottom: 18px; }
  .portfolio-entry { padding: 20px; }
  .portfolio-actions .btn { flex: 1; }
  .card, #app .card, #app .card.tap { padding: 16px !important; }
  .hd { gap: 8px !important; }
  .hd h1 { font-size: 15px !important; }
  .hd .save-all-btn { padding: 8px 10px !important; }
  .row { flex-wrap: wrap; }
  .row > .btn { flex-shrink: 1; white-space: normal; }
  .stepper .step { padding: 10px 4px !important; font-size: 12px !important; }
  .cv4-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cv4-btnrow { flex-wrap: wrap; }
  .cv4-btn { white-space: normal; }
  .cover-panel-v4 { padding: 14px !important; }
  .modal-mask, .panel-mask { align-items: flex-end; padding: 0; }
  .modal, .panel-sheet, .save-sheet .ss-box { border-radius: 16px 16px 0 0; max-width: 100%; max-height: 92dvh; }
  .modal { padding: 20px 16px calc(20px + var(--safe-b)); }
  .modal-box { margin: 16px; max-height: calc(100dvh - 32px); }
  .save-sheet .ss-box { max-height: 94dvh; }
  .gen-banner { bottom: calc(82px + var(--safe-b)); width: calc(100% - 24px); }
  .ref-panel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .generic-main .section-title { flex-wrap: wrap; }
  .generic-main .section-title .task-name-input { width: 100%; flex: 1 1 100%; }
  .preset-actions { flex-wrap: wrap; }
  .preset-actions .btn { white-space: normal; }
  .dl-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .dl-top { padding: 16px; }
  .dl-hd h1 { font-size: 18px; }
  .pdf-card { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; }
  .pdf-icon { width: 40px; height: 44px; }
  .pdf-actions { grid-column: 2; flex-wrap: wrap; }
  .pdf-btn { flex: 1; }
  .share-header h1 { font-size: 23px; }
  .pdf-preview-header { flex-wrap: wrap; padding: 10px; }
  .pdf-download-btn { min-height: 40px; }
}
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .workspace-grid { gap: 10px; }
  .workspace-card { padding: 16px 12px; }
  .ws-name { font-size: 15px; }
  .workspace-card::after { right: 12px; top: 16px; }
  .preset-workspace-tab { font-size: 12px; padding: 9px 3px; }
  .topbar .topright { gap: 6px; }
  .btn, #app .btn { padding-inline: 10px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 提示词选择面板使用独立图层，折叠区和键盘不再遮挡选项。 */
/* 生成候选图：独立操作栏，不遮挡图片内容。 */
.review-image-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(128px,160px)); gap: 12px; align-items: start; margin-top: 12px; }
.review-image-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.review-image-card.is-selected { border-color: #ffb8c3; }
.review-image-preview { position: relative; display: block; width: 100%; border: 0; padding: 0; background: var(--surface-2); cursor: zoom-in; }
.review-image-preview img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.review-image-preview:focus-visible { outline-offset: -3px; }
.review-image-footer { padding: 8px; border-top: 1px solid var(--border); }
.review-image-actions { display: grid; grid-template-columns: minmax(0,1fr) 36px; gap: 4px; align-items: center; }
.review-image-use, .review-image-delete { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 36px; padding: 0 4px; border: 0; border-radius: 6px; font: inherit; font-size: 12px; line-height: 1.3; cursor: pointer; }
.review-image-use { color: var(--text); background: #f1f2f4; white-space: nowrap; }
.review-image-use:disabled { opacity: 1; color: #cb2440; background: #fff0f3; cursor: default; }
.review-image-delete { color: var(--muted); background: transparent; }
.review-image-delete .icon { width: 16px; height: 16px; }
.review-image-footer .img-time { margin-top: 6px; text-align: left; font-size: 10px; line-height: 1.5; }
.review-image-footer .img-dur { font-size: 10px; }
@media (hover:hover) {
  .review-image-use:not(:disabled):hover { background: #e7e8ed; }
  .review-image-delete:hover { color: #ca2942; background: #fff1f3; }
}
@media (max-width: 600px) {
  .review-image-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .review-image-actions { grid-template-columns: minmax(0,1fr) 44px; }
  .review-image-use, .review-image-delete { min-height: 44px; }
}


.ps-layer { position: fixed; inset: 0 0 auto; z-index: 10030; pointer-events: none; }
.ps-picker { position: absolute; pointer-events: auto; min-width: 0; }
.ps-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; }
.ps-picker-head strong { font-size: 14px; }
.ps-close { min-width: 52px; min-height: 44px; border: 0; border-radius: 8px; background: #fff1f4; color: #c9203d; font: inherit; font-size: 14px; cursor: pointer; }
.ps-picker .ps-panel { position: relative; width: 100%; box-sizing: border-box; border-radius: 0 0 10px 10px; animation: none; touch-action: pan-y; }
.ps-picker .ps-opt { min-height: 56px; padding: 12px; }
.ps-picker .ps-opt-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.ps-picker .ps-opt-sub { line-height: 1.6; }
.ps-trigger { min-height: 44px; touch-action: manipulation; }
.ps-trigger[aria-busy="true"] { opacity: .6; }
.col.is-collapsed > .col-body { visibility: hidden; }
.ps-panel:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ps-mobile { pointer-events: auto; background: rgba(26,27,32,.42); overscroll-behavior: contain; }
.ps-mobile .ps-picker { bottom: 0; left: 0; width: 100%; max-height: 100%; display: flex; flex-direction: column; background: var(--surface); border-radius: 16px 16px 0 0; padding-bottom: var(--safe-b); }
.ps-mobile .ps-picker-head { flex: none; border: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; border-radius: 16px 16px 0 0; }
.ps-mobile .ps-panel { min-height: 0; max-height: min(65dvh,520px); border: 0; border-radius: 0; box-shadow: none; padding: 8px 12px 16px; }
html:has(.ps-mobile, .modal-mask, .panel-mask, .lightbox-mask, #lightbox:not(.hidden), .pdf-preview-mask, .password-modal-overlay, .upload-modal-overlay, .delete-confirm-mask),
body:has(.ps-mobile, .modal-mask, .panel-mask, .lightbox-mask, #lightbox:not(.hidden), .pdf-preview-mask, .password-modal-overlay, .upload-modal-overlay, .delete-confirm-mask) { overflow: hidden; }
@media (max-width: 600px) {
  button, a, [role="button"] { touch-action: manipulation; }
  .col-body { transition: none; }
  .modal-mask, .panel-mask, .password-modal-overlay, .upload-modal-overlay, .delete-confirm-mask {
    top: var(--visual-top,0px); bottom: auto; height: var(--visual-h,100dvh);
  }
  .modal, .panel-sheet, .password-modal, .upload-modal, .delete-confirm-dialog {
    max-height: min(92dvh,calc(var(--visual-h,100dvh) - 12px));
  }
  .btn.sm, #app .btn.sm, .cv4-pick, .cv4-del, .img-cell .pick, .img-cell .img-save,
  .task-item-del, .ref-panel-add, .ref-panel-copy, .ref-panel-del, .gen-bar-btn,
  .pdf-btn, .share-header .set-password-btn, .search-bar .clear-btn { min-height: 44px; }
  .refdel, .ref-panel-remove, .task-item-del, .search-bar .clear-btn, .rename-btn, .delete-btn { min-width: 44px; }
  .rename-btn, .delete-btn, .sel-ref-del, .img-x { min-height: 44px; min-width: 44px; }
  .refcell .refx { top: 0; right: 0; width: 32px; height: 32px; line-height: 32px; }
  .refcell .refx::after { content: ''; position: absolute; inset: -6px; }
  .pdf-name-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: start; gap: 4px; }
  .pdf-name { overflow-wrap: anywhere; }
  .rename-edit-container { min-width: 0; grid-column: 1 / 3; }
  .rename-save-btn, .rename-cancel-btn { min-height: 44px; }
  .col-title { overflow-wrap: anywhere; }
  .ps-picker .ps-opt { min-height: 64px; }
  input, textarea, select { scroll-margin-block: 100px; }
  .modal .ui-foot, .panel-foot { position: sticky; bottom: 0; background: var(--surface); z-index: 2; }
}
.prompt-refs { margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
.prompt-refs-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; font-size:13px; }
.prompt-ref-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(124px,148px)); gap:10px; margin-top:10px; }
.prompt-ref-card { min-width:0; padding:6px; border:1px solid var(--border); border-radius:8px; background:var(--surface); display:flex; flex-direction:column; gap:6px; }
.prompt-ref-preview { display:block; width:100%; aspect-ratio:1; background:var(--surface-2); border:0; padding:0; border-radius:5px; overflow:hidden; cursor:zoom-in; }
.prompt-ref-preview img { display:block; width:100%; height:100%; object-fit:contain; }
.prompt-ref-label { font-size:11px; color:var(--muted); text-align:center; overflow-wrap:anywhere; }
.prompt-ref-actions { display:flex; gap:4px; }
.prompt-ref-actions .btn { flex:1; min-width:0; padding:6px 4px; }
.prompt-ref-empty { aspect-ratio:1; display:grid; place-items:center; font-size:12px; color:var(--muted); }
.prompt-ref-add { min-height:108px; border:1px dashed var(--border); border-radius:8px; background:transparent; color:var(--primary); font:inherit; font-size:12px; cursor:pointer; }
@media (max-width:640px) {
  .prompt-refs { padding:8px; }
  .prompt-ref-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .prompt-refs .btn, .prompt-ref-add { min-height:44px; }
}
