.office-preview-panel {
  grid-area: 2 / 3 / 3 / 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  margin: 1px 8px 8px 0;
  overflow: hidden;
  border: 1px solid var(--cds-border);
  border-radius: var(--cds-radius-card);
  background: var(--cds-surface-1);
  box-shadow: var(--cds-ring);
}
.office-preview-panel .office-preview-dialog {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.office-preview-panel .office-preview-toolbar { gap: 4px; padding: 7px 7px 7px 11px; }
.office-preview-panel .office-preview-status { display: none; }
.office-preview-panel .office-preview-icon-button { width: 29px; }
.office-preview-panel .office-preview-button { padding: 0 7px; margin: 0; }
.office-preview-panel .office-preview-document { min-width: 0; }
.office-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px;
  background: rgba(18, 21, 25, .66);
  backdrop-filter: blur(3px);
}
.office-preview-dialog {
  display: flex;
  flex-direction: column;
  width: min(1440px, 100%);
  height: min(980px, 100%);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--cds-border);
  border-radius: 12px;
  background: #fafaf9;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .25);
}
.office-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  flex: none;
  padding: 8px 13px;
  border-bottom: 1px solid var(--cds-border);
  background: #fff;
}
.office-preview-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 13px;
  color: var(--cds-text-primary);
}
.office-preview-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.office-preview-name .office-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--cds-text-secondary);
}
.office-preview-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
}
.office-preview-status {
  margin-right: 9px;
  font-size: 12px;
  color: var(--cds-text-muted);
  font-variant-numeric: tabular-nums;
}
.office-preview-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cds-text-primary);
}
.office-preview-icon-button .office-icon {
  width: 17px;
  height: 17px;
}
.office-preview-icon-button:hover:not(:disabled),
.office-preview-button:hover:not(:disabled) {
  background: var(--cds-fill-ghost-hover);
}
.office-preview-icon-button:disabled { opacity: .25; cursor: default; }
.office-preview-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  margin: 0 4px;
  padding: 0 10px;
  border: 1px solid var(--cds-border);
  background: #fff;
  color: var(--cds-text-primary);
  border-radius: 7px;
}
.office-preview-button .office-icon { width: 16px; height: 16px; }
.office-preview-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
}
.office-preview-loading,
.office-preview-empty {
  min-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  font-size: 13px;
  color: var(--cds-text-muted);
}
.office-preview-empty .office-icon { width: 35px; height: 35px; color: var(--cds-text-muted); }
.office-preview-empty h3 { font-size: 15px; color: var(--cds-text-primary); font-weight: 600; }
.office-preview-empty p { max-width: 450px; }
.office-preview-document { display: flex; flex: 1; min-height: 100%; flex-direction: column; align-items: center; }
.office-preview-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}
.office-preview-pdf {
  flex: 1;
  align-self: stretch;
  min-height: 100%;
  width: 100%;
  border: 0;
  background: #fff;
}
.office-preview-media {
  width: 100%;
  max-height: 100%;
  margin: auto;
  background: #101010;
}
.office-preview-audio {
  width: min(620px, 90%);
  margin: auto;
}
.office-preview-text {
  flex: 1;
  align-self: stretch;
  width: min(100%, 1100px);
  margin: 20px auto;
  padding: 20px 25px;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
  color: #252525;
  border: 1px solid var(--cds-border);
  background: #fff;
  border-radius: 8px;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.office-preview-office-document {
  display: block;
  padding: 18px 12px 30px;
}
.office-preview-docx-body { display: block; }
.office-preview-docx-body .docx-wrapper {
  background: transparent;
  padding: 0;
}
.office-preview-docx-body .docx {
  margin: 0 auto 18px;
  box-shadow: 0 2px 14px rgba(0,0,0,.09);
  background: #fff;
  max-width: 100%;
}
.office-preview-spreadsheet {
  align-items: stretch;
  min-height: 100%;
}
.office-preview-tabs {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  overflow-x: auto;
  border-bottom: 1px solid var(--cds-border);
  background: #fff;
}
.office-preview-tabs button {
  flex: none;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cds-text-secondary);
  font-size: 12px;
}
.office-preview-tabs button.selected {
  background: var(--cds-fill-brand-subtle);
  color: var(--cds-text-primary);
  font-weight: 600;
}
.office-preview-sheet-body { flex: 1; overflow: auto; }
.office-preview-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  width: max-content;
  background: #fff;
  color: #252525;
  font-size: 12px;
}
.office-preview-table th,
.office-preview-table td {
  min-width: 88px;
  max-width: 360px;
  padding: 7px 10px;
  border-right: 1px solid #e9e9e9;
  border-bottom: 1px solid #e9e9e9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
}
.office-preview-table th {
  position: sticky;
  top: 0;
  background: #f4f5f5;
  font-weight: 600;
  z-index: 1;
}
.office-preview-table tr > th:first-child {
  position: sticky;
  left: 0;
  min-width: 48px;
  width: 48px;
  text-align: center;
  background: #f4f5f5;
}
.office-preview-table thead > tr > th:first-child { z-index: 2; }
.office-preview-limited {
  color: #625c51;
  font-size: 12px;
  padding: 12px 15px;
  margin: 0;
  background: #fcf4e9;
  border-bottom: 1px solid #f0e5d5;
}
.office-preview-slides { display: block; padding: 14px; }
.office-preview-slide {
  width: min(100%, 960px);
  min-height: 280px;
  margin: 12px auto 20px;
  padding: 28px 40px;
  border: 1px solid var(--cds-border);
  background: #fff;
  box-shadow: var(--cds-shadow-sm);
}
.office-preview-slide-index { margin-bottom: 20px; font-size: 12px; color: var(--cds-text-muted); }
.office-preview-slide p { font-size: 16px; line-height: 1.6; margin: 6px 0; }
@media(max-width: 680px) {
  .office-preview-overlay { padding: 0; }
  .office-preview-dialog { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .office-preview-toolbar { padding: 7px 6px 7px 12px; gap: 3px; min-height: 51px; }
  .office-preview-name { font-size: 12px; gap: 4px; }
  .office-preview-status { display: none; }
  .office-preview-tools { gap: 0; }
  .office-preview-icon-button { width: 29px; height: 32px; }
  .office-preview-button { padding: 0 7px; margin: 0; font-size: 12px; }
  .office-preview-text { margin: 0; padding: 15px; border: 0; border-radius: 0; }
  .office-preview-office-document { padding: 8px 4px 25px; }
  .office-preview-slide { padding: 18px 15px; }
}
