.attachment-panel { container-type: inline-size; overflow: visible; padding: 22px; }
.attachment-heading { align-items: center; margin-bottom: 16px; }
.attachment-heading p { margin: 4px 0 0; color: #667085; font-size: 11px; }
.attachment-capacity { display: flex; align-items: baseline; gap: 4px; min-width: 0; padding: 7px 11px; border: 1px solid #e2e8f0; border-radius: 999px; background: #f8fafc; white-space: nowrap; }
.attachment-capacity span { color: #667085; font-size: 10px; }
.attachment-capacity b { color: #1769e0; font-size: 17px; line-height: 1; letter-spacing: -.03em; }
.attachment-capacity em { color: #98a2b3; font-size: 10px; font-style: normal; }
.attachment-workspace { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.85fr); gap: 12px; align-items: stretch; }
.attachment-library-pane,.attachment-uploader,.attachment-locked { min-width: 0; padding: 14px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fbfcfd; }
.attachment-pane-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.attachment-pane-heading b { font-size: 12px; }
.attachment-pane-heading span { color: #98a2b3; font-size: 9px; text-align: right; }
.attachment-library { display: grid; gap: 7px; }
.attachment-reference-library { margin-top: 13px; padding-top: 12px; border-top: 1px solid #e4e7ec; }
.attachment-card.referenced { border-color: #d8e9e2; background: #fbfefc; }
.attachment-card.referenced .attachment-file-icon { background: #eaf8f2; color: #147a58; }
.attachment-card { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 64px; padding: 9px 10px; border: 1px solid #e6eaf0; border-radius: 10px; background: #fff; transition: border-color .18s,background .18s,box-shadow .18s; }
.attachment-card:hover { border-color: #c7d7ee; background: #fcfdff; box-shadow: 0 4px 12px rgba(16,24,40,.04); }
.attachment-file-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #eef4ff; color: #1769e0; }
.attachment-file-icon span { max-width: 34px; overflow: hidden; font: 700 8px/1 ui-monospace,SFMono-Regular,Consolas; letter-spacing: .04em; }
.attachment-file-icon.kind-image { background: #eaf8f2; color: #16794c; }
.attachment-file-icon.kind-video { background: #f3efff; color: #6941c6; }
.attachment-file-icon.kind-pdf { background: #fff0f1; color: #c82a2a; }
.attachment-file-icon.kind-word { background: #eaf2ff; color: #175cd3; }
.attachment-file-icon.kind-spreadsheet { background: #eaf8f2; color: #16794c; }
.attachment-file-icon.kind-markdown,.attachment-file-icon.kind-text { background: #f2f4f7; color: #475467; }
.attachment-meta { min-width: 0; }
.attachment-meta b,.attachment-meta span,.attachment-meta small { display: block; }
.attachment-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.attachment-meta span { margin-top: 1px; color: #667085; font-size: 9px; }
.attachment-meta small { margin-top: 2px; color: #a3acba; font: 8px/1.35 ui-monospace,SFMono-Regular,Consolas; }
.attachment-card-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.attachment-card-actions button,.attachment-card-actions a,.attachment-download-only { min-height: 30px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid #d8dee8; border-radius: 7px; background: transparent; color: #475467; text-decoration: none; font: inherit; font-size: 9px; font-weight: 600; }
.attachment-card-actions button,.attachment-card-actions a { cursor: pointer; }
.attachment-card-actions button:hover,.attachment-card-actions button:focus-visible,.attachment-card-actions a:hover,.attachment-card-actions a:focus-visible { border-color: #1769e0; background: #f1f6ff; color: #1769e0; outline: 2px solid rgba(23,105,224,.10); }
.attachment-download-only { border-color: transparent; background: #f2f4f7; color: #667085; cursor: default; }
.attachment-delete-form { margin: 0; }
.attachment-card-actions .attachment-delete-button { width: 32px; justify-content: center; padding: 0; color: #98a2b3; }
.attachment-delete-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.attachment-card-actions .attachment-delete-button:hover,.attachment-card-actions .attachment-delete-button:focus-visible { border-color: #f0b8bd; background: #fff4f4; color: #c82a2a; outline-color: rgba(200,42,42,.10); }
.attachment-empty { min-height: 130px; display: flex; gap: 12px; align-items: center; justify-content: center; padding: 18px; border: 1px dashed #d0d5dd; border-radius: 10px; background: #fff; }
.attachment-empty i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #eef4ff; color: #1769e0; font-style: normal; font-size: 18px; }
.attachment-empty b { font-size: 11px; }
.attachment-empty p { margin: 2px 0 0; color: #667085; font-size: 9px; }
.attachment-uploader { margin: 0; }
.attachment-uploader>input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attachment-dropzone { position: relative; isolation: isolate; min-height: 154px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 16px; border: 1px dashed rgba(112,145,190,.52); border-radius: 11px; background: linear-gradient(180deg,rgba(255,255,255,.90),rgba(239,246,255,.64)); text-align: center; transition: border-color .2s,background .2s,box-shadow .2s; }
.attachment-dropzone::before { content: ""; position: absolute; z-index: -1; top: -78px; left: 50%; width: 230px; height: 175px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle,rgba(23,105,224,.09) 0,rgba(23,105,224,.025) 46%,transparent 72%); pointer-events: none; transition: opacity .2s,transform .2s; }
.attachment-dropzone.dragging { border-color: #1769e0; background: #f1f7ff; box-shadow: 0 0 0 4px rgba(23,105,224,.065); }
.attachment-dropzone.dragging::before { opacity: 1.3; transform: translateX(-50%) translateY(5px) scale(1.06); }
.attachment-upload-symbol { position: relative; width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 8px; border: 1px solid rgba(23,105,224,.14); border-radius: 14px; background: linear-gradient(145deg,rgba(255,255,255,.86),rgba(23,105,224,.075)); color: rgba(23,105,224,.88); font-style: normal; box-shadow: inset 0 1px 0 rgba(255,255,255,.92),0 7px 20px rgba(23,105,224,.07); transition: transform .2s,border-color .2s,background .2s,color .2s; }
.attachment-upload-symbol::after { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(23,105,224,.07); border-radius: 17px; pointer-events: none; }
.attachment-upload-symbol svg { width: 21px; height: 21px; overflow: visible; }
.attachment-upload-symbol path { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.attachment-dropzone.dragging .attachment-upload-symbol { transform: translateY(-3px); border-color: rgba(23,105,224,.24); color: #1769e0; }
.attachment-dropzone strong { font-size: 12px; }
.attachment-dropzone>span { margin-top: 2px; color: #667085; font-size: 9px; }
.attachment-dropzone button { min-height: 32px; margin-top: 9px; padding: 0 13px; border: 1px solid #bcd0ed; border-radius: 8px; background: rgba(255,255,255,.88); color: #1769e0; font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; }
.attachment-dropzone button:hover,.attachment-dropzone button:focus-visible { border-color: #1769e0; background: #fff; outline: 3px solid rgba(23,105,224,.10); }
.attachment-dropzone small { margin-top: 6px; color: #98a2b3; font-size: 8px; }
.attachment-queue { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 8px; }
.attachment-queue:empty { display: none; }
.queued-file { min-width: 0; display: grid; grid-template-columns: 32px minmax(0,1fr) 26px; gap: 8px; align-items: center; padding: 7px; border: 1px solid #dbe4f0; border-radius: 9px; background: #fff; }
.queued-file-preview { width: 32px; height: 32px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: #eef4ff; color: #1769e0; font: 700 8px ui-monospace,SFMono-Regular,Consolas; }
.queued-file-preview img { width: 100%; height: 100%; object-fit: cover; }
.queued-file b,.queued-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queued-file b { font-size: 10px; }
.queued-file span { color: #667085; font-size: 8px; }
.queued-file button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: #667085; cursor: pointer; }
.queued-file button:hover { background: #fff0f1; color: #c82a2a; }
.attachment-upload-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #e7ebf0; }
.attachment-upload-actions>span { min-width: 0; overflow: hidden; color: #667085; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-upload-actions button { min-height: 32px; margin-left: auto; padding: 0 11px; font-size: 10px; white-space: nowrap; }
.attachment-upload-actions button:disabled { background: #e7ebf0; color: #98a2b3; box-shadow: none; cursor: not-allowed; }
.attachment-locked { display: grid; place-items: center; color: #667085; font-size: 11px; text-align: center; }
.archive-links { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e7ebf0; }
.attachment-preview-dialog { width: min(920px,calc(100vw - 40px)); padding: 0; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(16,24,40,.24); overflow: hidden; }
.attachment-preview-dialog::backdrop { background: rgba(16,24,40,.52); backdrop-filter: blur(4px); }
.attachment-preview-dialog header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #eaecf0; }
.attachment-preview-dialog header span { color: #1769e0; font: 700 9px ui-monospace,SFMono-Regular,Consolas; letter-spacing: .12em; }
.attachment-preview-dialog h2 { margin: 3px 0 0; font-size: 18px; }
.attachment-preview-dialog header p { margin: 3px 0 0; color: #667085; font-size: 10px; }
.attachment-preview-dialog header button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2f4f7; color: #475467; font-size: 22px; cursor: pointer; }
.attachment-preview-stage { height: min(65vh,620px); display: grid; place-items: center; background: #f2f4f7; }
.attachment-preview-stage img,.attachment-preview-stage video,.attachment-preview-stage iframe { width: 100%; height: 100%; border: 0; object-fit: contain; }
.attachment-preview-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid #eaecf0; }
.attachment-uploader.is-uploading { opacity: .7; pointer-events: none; }
@container (max-width: 760px) {
  .attachment-workspace { grid-template-columns: 1fr; }
}
@media(max-width:680px) {
  .attachment-panel { padding: 15px; }
  .attachment-heading { align-items: flex-start; }
  .attachment-capacity { margin-top: 2px; }
  .attachment-card { grid-template-columns: 38px minmax(0,1fr); }
  .attachment-card-actions { grid-column: 1/-1; padding-left: 48px; }
  .attachment-card-actions>* { flex: 1; justify-content: center; min-height: 36px; }
  .attachment-card-actions .attachment-delete-form { flex: 0 0 44px; min-height: 44px; }
  .attachment-card-actions .attachment-delete-button { width: 44px; height: 44px; }
  .attachment-pane-heading { display: block; }
  .attachment-pane-heading span { display: block; margin-top: 2px; text-align: left; }
  .attachment-upload-actions { align-items: stretch; flex-direction: column; }
  .attachment-upload-actions button { width: 100%; margin: 0; min-height: 40px; }
  .attachment-preview-dialog { width: calc(100vw - 20px); }
  .attachment-preview-stage { height: 55vh; }
}
@media(prefers-reduced-motion:reduce) {
  .attachment-dropzone,.attachment-dropzone::before,.attachment-upload-symbol,.attachment-card { transition: none; }
}

/* Business typography: attachment library, upload queue and preview. */
.attachment-heading p { color: #596579; font-size: 12px; line-height: 1.6; }
.attachment-capacity span,.attachment-capacity em { color: #596579; font-size: 11px; }
.attachment-pane-heading b { font-size: 13px; }
.attachment-pane-heading span { color: #596579; font-size: 11px; line-height: 1.5; }
.attachment-file-icon span { font-size: 10px; }
.attachment-meta b { font-size: 13px; }
.attachment-meta span { color: #596579; font-size: 11px; }
.attachment-meta small { color: #667085; font-size: 10px; line-height: 1.45; }
.attachment-card-actions button,.attachment-card-actions a,.attachment-download-only { min-height: 34px; font-size: 11px; }
.attachment-empty b { font-size: 13px; }
.attachment-empty p { color: #596579; font-size: 11px; line-height: 1.5; }
.attachment-dropzone strong { font-size: 13px; }
.attachment-dropzone>span { color: #596579; font-size: 11px; line-height: 1.5; }
.attachment-dropzone button { min-height: 40px; font-size: 12px; }
.attachment-dropzone small { color: #667085; font-size: 10px; line-height: 1.45; }
.queued-file-preview { font-size: 10px; }
.queued-file b { font-size: 12px; }
.queued-file span { color: #667085; font-size: 10px; }
.queued-file button { width: 34px; height: 34px; }
.attachment-upload-actions>span { color: #596579; font-size: 11px; }
.attachment-upload-actions button { min-height: 40px; font-size: 12px; }
.attachment-preview-dialog header span { font-size: 10px; }
.attachment-preview-dialog h2 { font-size: 20px; }
.attachment-preview-dialog header p { color: #596579; font-size: 11px; line-height: 1.5; }

@media(max-width:680px) {
  .attachment-card-actions>*,.attachment-dropzone button,.queued-file button,
  .attachment-upload-actions button,.attachment-preview-dialog header button,
  .attachment-preview-dialog footer .primary,.attachment-preview-dialog footer .secondary { min-height: 44px; }
  .queued-file button,.attachment-preview-dialog header button { width: 44px; height: 44px; }
}

/* Mobile attachment heading: the count is secondary metadata and receives its
   own row so it can never collide with the long Chinese title or description. */
@media(max-width:680px) {
  .attachment-heading {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 11px;
    align-items: start;
  }
  .attachment-heading>div { min-width: 0; }
  .attachment-heading p { max-width: none; margin-top: 5px; }
  .attachment-capacity {
    justify-self: start;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
  }
  .attachment-capacity b { font-size: 18px; }
}
