/* AITBELLA Drive V15 — document preview layer */
.document-preview-card{
  border:1px solid rgba(30,79,216,.12);
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(247,250,255,.96));
  border-radius:22px;
  padding:16px;
  margin:16px 0;
  box-shadow:0 14px 38px rgba(11,31,78,.08);
}
.smart-doc-preview-card .doc-preview-row,
.doc-preview-mini{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid rgba(30,79,216,.10);
  background:rgba(255,255,255,.72);
  border-radius:16px;
  padding:12px;
}
.doc-preview-row b,
.doc-preview-mini b{
  display:block;
  font-size:13px;
  line-height:1.25;
  max-width:520px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.doc-preview-row small,
.doc-preview-mini small{
  display:block;
  margin-top:4px;
  color:#667085;
  font-size:12px;
}
.doc-preview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
  margin-top:12px;
}
.smart-file-actions-v15{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.smart-room-file-card-v13 .smart-file-actions-v15 .tiny-btn,
.smart-room-file-card-v13 .smart-file-actions-v15 button{
  white-space:nowrap;
}
.document-preview-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  pointer-events:none;
}
.document-preview-modal:empty{display:none;}
.document-preview-modal:not(:empty){pointer-events:auto;}
.document-preview-backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,17,39,.58);
  backdrop-filter:blur(10px);
}
.document-preview-dialog{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(1080px,calc(100vw - 28px));
  height:min(820px,calc(100vh - 28px));
  display:flex;
  flex-direction:column;
  border-radius:24px;
  overflow:hidden;
  background:#ffffff;
  color:#101828;
  box-shadow:0 30px 90px rgba(3,10,26,.35);
  border:1px solid rgba(255,255,255,.22);
}
.document-preview-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid rgba(30,79,216,.10);
  background:linear-gradient(135deg,#f8fbff,#eef5ff);
}
.document-preview-top span{
  display:inline-flex;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(30,79,216,.10);
  color:#1e4fd8;
  font-weight:800;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.document-preview-top h3{
  margin:8px 0 4px;
  font-size:18px;
  max-width:680px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.document-preview-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.document-preview-body{
  flex:1;
  overflow:auto;
  padding:18px;
  background:#f7f9fd;
}
.doc-preview-loading{
  min-height:240px;
  display:grid;
  place-items:center;
  color:#667085;
  font-weight:700;
}
.doc-pdf-frame{
  width:100%;
  height:100%;
  min-height:620px;
  border:0;
  border-radius:16px;
  background:#fff;
}
.doc-code-preview{
  margin:0;
  padding:16px;
  border-radius:16px;
  background:#0f172a;
  color:#e5e7eb;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
  font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
}
.doc-table-wrap{
  overflow:auto;
  border-radius:16px;
  border:1px solid rgba(30,79,216,.12);
  background:#fff;
}
.doc-preview-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.doc-preview-table th,
.doc-preview-table td{
  border-bottom:1px solid rgba(30,79,216,.08);
  border-right:1px solid rgba(30,79,216,.08);
  padding:9px 10px;
  text-align:left;
  vertical-align:top;
  max-width:320px;
  word-break:break-word;
}
.doc-preview-table th{
  background:#eef5ff;
  color:#1d2939;
  font-weight:800;
  position:sticky;
  top:0;
}
.docx-preview-content{
  background:#fff;
  color:#1d2939;
  border-radius:16px;
  padding:24px;
  box-shadow:inset 0 0 0 1px rgba(30,79,216,.10);
  line-height:1.65;
  max-width:850px;
  margin:0 auto;
}
.docx-preview-content img{max-width:100%;height:auto;}
body.document-preview-open{overflow:hidden;}
html[data-drive-theme="dark"] .document-preview-card{
  border-color:rgba(148,163,184,.16);
  background:linear-gradient(180deg,rgba(20,31,52,.96),rgba(15,23,42,.94));
  box-shadow:0 18px 46px rgba(0,0,0,.22);
}
html[data-drive-theme="dark"] .smart-doc-preview-card .doc-preview-row,
html[data-drive-theme="dark"] .doc-preview-mini{
  border-color:rgba(148,163,184,.16);
  background:rgba(15,23,42,.70);
}
html[data-drive-theme="dark"] .doc-preview-row small,
html[data-drive-theme="dark"] .doc-preview-mini small{color:#9aa7bd;}
html[data-drive-theme="dark"] .document-preview-dialog{
  background:#0f172a;
  color:#e5edf8;
  border-color:rgba(148,163,184,.18);
}
html[data-drive-theme="dark"] .document-preview-top{
  border-bottom-color:rgba(148,163,184,.14);
  background:linear-gradient(135deg,#15243d,#101827);
}
html[data-drive-theme="dark"] .document-preview-top span{
  background:rgba(96,165,250,.16);
  color:#93c5fd;
}
html[data-drive-theme="dark"] .document-preview-body{
  background:#0b1220;
}
html[data-drive-theme="dark"] .doc-table-wrap,
html[data-drive-theme="dark"] .docx-preview-content{
  background:#111827;
  color:#dbeafe;
  border-color:rgba(148,163,184,.18);
}
html[data-drive-theme="dark"] .doc-preview-table th{
  background:#172033;
  color:#dbeafe;
}
html[data-drive-theme="dark"] .doc-preview-table td,
html[data-drive-theme="dark"] .doc-preview-table th{
  border-color:rgba(148,163,184,.12);
}
@media (max-width: 720px){
  .document-preview-top{flex-direction:column;}
  .document-preview-dialog{height:calc(100vh - 18px);width:calc(100vw - 18px);border-radius:18px;}
  .document-preview-body{padding:12px;}
  .smart-doc-preview-card .doc-preview-row,.doc-preview-mini{align-items:flex-start;flex-direction:column;}
  .smart-file-actions-v15{justify-content:flex-start;width:100%;}
}


/* v16 document preview visibility fix */
.document-preview-card.smart-doc-preview-card{
  display:block !important;
  margin:14px 0;
  padding:16px;
  border:1px solid var(--line, #d7e7ef);
  border-radius:18px;
  background:linear-gradient(180deg, rgba(240,250,255,.95), rgba(255,255,255,.96));
}
.doc-preview-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.doc-preview-row small,.doc-preview-mini small{display:block;color:var(--muted,#60708a);margin-top:4px}
.documentPreviewButton{white-space:nowrap}
body.dark .document-preview-card.smart-doc-preview-card,
.dark .document-preview-card.smart-doc-preview-card{
  background:linear-gradient(180deg, rgba(18,35,55,.96), rgba(14,28,45,.96));
  border-color:rgba(130,170,205,.28);
}
body.dark .doc-preview-row small,
.dark .doc-preview-row small,
body.dark .doc-preview-mini small,
.dark .doc-preview-mini small{color:#a8bfd8}

/* v18 audio preview */
.audio-preview-card{
  border:1px solid rgba(20,174,210,.18);
  background:linear-gradient(180deg,rgba(240,252,255,.96),rgba(255,255,255,.98));
}
.audio-preview-player{
  margin-top:12px;
  border:1px solid rgba(20,174,210,.14);
  border-radius:18px;
  padding:14px;
  background:rgba(255,255,255,.78);
}
.audio-preview-player audio,
.bundle-audio-thumb audio{
  width:100%;
  display:block;
  margin-top:10px;
  border-radius:999px;
}
.audio-preview-title,
.bundle-audio-title{
  font-weight:800;
  font-size:13px;
  color:#101828;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bundle-audio-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:10px;
  margin-top:12px;
}
.bundle-audio-thumb{
  border:1px solid rgba(20,174,210,.14);
  border-radius:18px;
  padding:12px;
  background:rgba(255,255,255,.76);
  box-shadow:0 10px 28px rgba(11,31,78,.06);
}
.bundle-audio-thumb-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}
.bundle-audio-thumb-footer small{color:#667085;font-weight:700;}
.extra-audio-grid{margin:12px 0;}
html[data-drive-theme="dark"] .audio-preview-card{
  border-color:rgba(45,212,191,.20);
  background:linear-gradient(180deg,rgba(20,36,55,.96),rgba(13,27,45,.96));
}
html[data-drive-theme="dark"] .audio-preview-player,
html[data-drive-theme="dark"] .bundle-audio-thumb{
  border-color:rgba(45,212,191,.18);
  background:rgba(8,18,32,.72);
  box-shadow:0 18px 46px rgba(0,0,0,.24);
}
html[data-drive-theme="dark"] .audio-preview-title,
html[data-drive-theme="dark"] .bundle-audio-title{color:#e8f3ff;}
html[data-drive-theme="dark"] .bundle-audio-thumb-footer small{color:#a8bfd8;}
