/* Fixed-row previews with an on-demand full-text view.  The table keeps a
   stable scan rhythm while long specifications and AI notes remain available
   without forcing every row to expand. */
.quote-detail-table.preview-fixed-rows,
.import-preview-table.preview-fixed-rows,
.cost-library-table.preview-fixed-rows {
  --preview-row-height: 64px;
}

.quote-detail-table.preview-fixed-rows tbody tr,
.import-preview-table.preview-fixed-rows tbody tr,
.cost-library-table.preview-fixed-rows tbody tr {
  height: var(--preview-row-height);
}

.quote-detail-table.preview-fixed-rows tbody td,
.import-preview-table.preview-fixed-rows tbody td,
.cost-library-table.preview-fixed-rows tbody td {
  height: var(--preview-row-height);
  max-height: var(--preview-row-height);
  overflow: hidden;
  vertical-align: middle;
}

.preview-cell-content {
  display: -webkit-box;
  max-height: 3.1em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-cell-content > .table-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-preview-tooltip {
  position: fixed;
  z-index: 9999;
  width: min(440px, calc(100vw - 28px));
  max-height: min(280px, calc(100vh - 28px));
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid #7ed9e2;
  border-radius: 0;
  background: #07131d;
  color: #e9fbff;
  box-shadow: 0 12px 32px #02070dcc, 0 0 0 1px #b7f4ff24 inset;
  font: 11px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.table-preview-tooltip[hidden] { display: none; }

@media (hover: none), (max-width: 760px) {
  .quote-detail-table.preview-fixed-rows,
  .import-preview-table.preview-fixed-rows,
  .cost-library-table.preview-fixed-rows {
    --preview-row-height: 60px;
  }

  .table-preview-tooltip {
    pointer-events: none;
    width: min(360px, calc(100vw - 20px));
    max-height: min(240px, calc(100vh - 20px));
  }
}
