/* Uploaded images remain images, both inside a document and in chat albums. */
/* A single, answer-shaped question card; settings stay secondary. */
.survey-badges{align-items:center;gap:8px}.survey-badges>.badge,.survey-badges>.survey-status{display:inline-flex;align-items:center;justify-content:center;min-height:32px;box-sizing:border-box;margin:0;padding:6px 11px;line-height:1.25}.survey-intro>p{margin:16px 0;line-height:1.65}.survey-intro>h2{margin:0 0 18px}.survey-intro>.hint{padding:14px 16px}.survey-intro>.badge{display:table;margin-top:18px;margin-bottom:0;padding:7px 11px}.survey-card .actions{padding-top:8px;gap:10px}.survey-type-help{color:var(--muted);font-size:13px;line-height:1.6;margin:0 0 14px!important}.survey-description-toggle{margin:14px 0}.survey-description-toggle>summary{font-size:13px;cursor:pointer;color:var(--muted);padding:6px 0}.survey-choice-marker{font-size:24px;color:var(--muted);text-align:center}.survey-choice-row{gap:12px;margin:12px 0}.survey-choice-row input{border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;padding:10px 4px}.survey-choice-row input:focus{border-bottom-color:var(--brand)}.survey-answer-shape{margin:16px 0 8px!important;border:0!important;border-bottom:1px dashed var(--line)!important;border-radius:0!important;background:var(--light)!important;opacity:1!important;color:var(--muted)!important;max-width:100%}.survey-question textarea.survey-answer-shape{height:86px;min-height:86px}.survey-condition>summary{padding:10px 0;cursor:pointer;font-weight:600}.survey-condition[open]>.survey-settings{margin-top:12px}.survey-q-actions{gap:10px;padding-top:16px;margin-top:20px}.survey-card,.survey-intro,.survey-question{overflow-wrap:anywhere}
.safe-message-wrap{position:relative;min-height:48px;min-width:160px}.safe-message-wrap:not(.revealed)>:first-child{filter:blur(6px);opacity:.4;pointer-events:none;user-select:none}.safe-message-toggle{font-size:12px!important;min-height:30px!important;padding:5px 9px!important;white-space:normal;color:var(--ink)!important;background:var(--light)!important;border:1px solid var(--line)!important}.safe-message-wrap:not(.revealed)>.safe-message-toggle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:max-content;max-width:100%}.safe-message-wrap.revealed>.safe-message-toggle{display:block;margin:6px 0 0 auto}
.ql-editor .ql-file-image{display:block;margin:12px 0;padding:0;max-width:100%;white-space:normal}
.ql-file-image img{display:block;max-width:100%;height:auto;max-height:none;border-radius:8px;object-fit:contain}
.rich-read .ql-file-image img{cursor:zoom-in}
.editor-body .ql-file-image img{max-width:min(100%,720px)}
.ql-file-image:focus-within{outline:2px solid var(--green);outline-offset:3px}
.inline-photo-upload{display:inline-flex;align-items:center;gap:6px}
.upload-list{max-height:280px;overflow:auto;align-items:start}.upload-image-chip{max-width:100%}.upload-chip>span{min-width:0;overflow-wrap:anywhere}
.chat-attachments{display:flex!important;flex-direction:column;gap:8px;max-width:100%}
.chat-photo-album{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;width:340px;max-width:100%;border-radius:9px;overflow:hidden}
.chat-photo-album:has(>.chat-photo-tile:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
.chat-photo-album.single-photo{display:block;width:fit-content}
.chat-photo-tile{display:block;position:relative;min-width:0;min-height:0!important;width:100%;aspect-ratio:1;padding:0!important;border:0;background:var(--light);border-radius:0;overflow:hidden;cursor:zoom-in}
.chat-photo-tile img{display:block;width:100%;height:100%;object-fit:cover}
.single-photo .chat-photo-tile{width:auto;max-width:100%;aspect-ratio:auto;background:transparent}
.single-photo img{width:auto;height:auto;max-width:340px;max-height:480px;object-fit:contain}
.photo-message .message-bubble{background:transparent;border:0;padding:0;box-shadow:none}
.photo-message .message-bubble>.attachment-grid{margin:0}
.photo-message .message-bubble>.message-reply-quote{padding:8px 10px;background:var(--light)}
.photo-gallery-nav{display:flex;gap:16px;align-items:center;justify-content:center;grid-column:1/-1}.photo-gallery-nav button{font-size:24px;min-width:42px}
.photo-error{display:block;padding:20px;color:var(--muted);font-size:12px}
@media(max-width:760px){.chat-photo-album{width:min(300px,100%)}.single-photo img{max-width:100%;max-height:400px}.upload-list{max-height:210px}.upload-chip button{min-height:32px}.ql-editor .ql-file-image{margin:10px 0}}
@media print{.ql-file-image{break-inside:avoid}.ql-file-image img{max-height:240mm!important;object-fit:contain}}
.storage-panel{margin-top:24px}.storage-panel>summary{font-weight:700;cursor:pointer}.storage-users{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;max-height:280px;overflow:auto;margin:18px 0}.storage-person{background:var(--light);color:var(--ink);padding:12px;text-align:left;border:1px solid var(--line)}.storage-person strong,.storage-person span{display:block;font-size:13px}.storage-person span{color:var(--muted);margin-top:4px}.storage-filters,.storage-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0}.storage-filters select{width:auto;max-width:100%}.storage-filename{min-width:160px;max-width:380px;overflow-wrap:anywhere}.storage-panel td{font-size:13px}.storage-panel input[type=checkbox]{width:19px;height:19px;min-height:19px}.storage-panel .danger{color:var(--red)}
.safe-chat-dialog{width:min(520px,calc(100vw - 32px))}.safe-chat-dialog p{margin:16px 0;line-height:1.7}.safe-chat-words{display:flex;gap:8px;flex-wrap:wrap}.safe-chat-dialog .actions{margin-top:20px;gap:10px;flex-wrap:wrap}.safe-chat-settings{margin-top:20px}.safe-chat-settings>summary{cursor:pointer;font-weight:700}.safe-chat-settings form{display:grid;gap:18px;margin-top:20px}.safe-chat-settings textarea{width:100%}

/* A shared, centered viewer: opening a file never shifts the reading/chat area. */
body.file-viewer-open{overflow:hidden}
dialog.file-modal{position:fixed;inset:0;margin:auto;padding:0;width:min(1160px,calc(100vw - 40px));height:min(920px,calc(100dvh - 40px));max-width:none;max-height:calc(100dvh - 40px);overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--paper,#fff);box-shadow:0 24px 100px #0005}
dialog.file-modal[open]{display:flex;flex-direction:column}
dialog.file-modal::backdrop{background:#101917aa;backdrop-filter:blur(4px)}
.file-viewer-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 16px;padding:14px 18px;flex:none;min-width:0;background:var(--paper,#fff)}
.file-viewer-name{font-size:15px;line-height:1.5;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.file-viewer-close{font-size:26px;line-height:1;width:42px;min-height:42px;padding:4px;border-radius:50%;color:var(--ink)}
.file-viewer-header .photo-gallery-nav{gap:16px;font-size:13px}
.file-viewer-header .photo-gallery-nav button{line-height:1;min-height:40px}
.file-viewer-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;flex:none;border-top:1px solid var(--line);background:var(--paper,#fff)}
.file-viewer-footer .file-download{margin:0;font-size:13px;min-height:40px;display:inline-flex;align-items:center;text-decoration:underline;text-underline-offset:3px}
.file-modal>.file-preview{display:flex;flex-direction:column;flex:1;min-height:0;border-radius:0;border-width:1px 0 0}
.file-modal .preview-tools{flex:none;min-width:0;padding:10px 14px;gap:7px}
.file-modal .preview-action{min-height:40px;min-width:40px}
.file-modal .preview-page{min-height:40px!important;width:52px!important}
.file-modal .preview-surface{flex:1;min-height:0;max-height:none;padding:12px;overscroll-behavior:contain}
.file-modal .preview-image-surface{display:flex}
.file-modal .preview-image-box{flex:none;margin:auto}
.file-modal .preview-text{min-height:100%}
.file-modal .preview-unsupported{padding:20px}
.file-dock .file-viewer-footer{padding:8px 14px;gap:8px}
@media(max-width:1000px){.file-viewer-side{display:none!important}}
@media(max-width:600px){
  dialog.file-modal{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:14px}
  .file-modal .file-viewer-header{padding:10px 12px;gap:6px 10px}
  .file-modal .file-viewer-name{font-size:13px}
  .file-modal .preview-tools{padding:8px;gap:5px}
  .file-modal .preview-status{font-size:11px}
  .file-modal .file-viewer-footer{padding:6px 12px max(6px,env(safe-area-inset-bottom))}
  .file-modal .preview-tools .preview-action{padding:5px 8px}
  .file-modal .file-preview:has(.preview-page) .preview-tools{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
  .file-modal .file-preview:has(.preview-page) .preview-status{grid-column:1/-1;order:1;text-align:right}
  .file-modal .file-preview:has(.preview-page) .preview-action{min-width:0;padding:5px 3px}
  .file-modal .preview-page{width:100%!important}
}
@media print{dialog.file-modal{display:none!important}}
