/* ==========================================================================
   .scaffold-card — ranking table that appears directly under the search bar.
   Renders the table-first response. Estimated cells are muted and clickable
   in edit mode; verified cells render normally.
   ========================================================================== */

.scaffold-card {
  max-width: 960px;
  margin: 0 auto 1rem;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.scaffold-card[hidden] { display: none; }

.scaffold-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}
.scaffold-label { font-weight: 600; opacity: 0.85; }
.scaffold-status { flex: 1; color: var(--text-muted, #a1a1aa); font-style: italic; }
.scaffold-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #10b981;
  font-size: 0.78rem;
  font-style: normal;
}
.scaffold-progress::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: scaffold-pulse 1.5s ease-in-out infinite;
}
@keyframes scaffold-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.scaffold-cancel {
  cursor: pointer;
  padding: 0 0.4rem;
  border-radius: 4px;
  opacity: 0.5;
}
.scaffold-cancel:hover { opacity: 1; background: rgba(255, 255, 255, 0.06); }

.scaffold-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.scaffold-table[hidden] { display: none; }
.scaffold-table th,
.scaffold-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.scaffold-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}
.scaffold-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.scaffold-table td.estimated {
  color: var(--text-muted, #a1a1aa);
  font-style: italic;
}
.scaffold-table.editable td.editable {
  cursor: text;
  position: relative;
}
.scaffold-table.editable td.editable:hover {
  background: rgba(255, 255, 255, 0.06);
  outline: 1px dashed rgba(255, 255, 255, 0.18);
  outline-offset: -1px;
}
.scaffold-table td.editing {
  padding: 0;
}
.scaffold-cell-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.55rem;
  background: rgba(0, 0, 0, 0.3);
  color: inherit;
  border: 1px solid rgba(96, 165, 250, 0.6);
  outline: none;
  font: inherit;
}

.scaffold-followup {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.scaffold-followup[hidden] { display: none; }
.scaffold-followup-prompt {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #a1a1aa);
}
.scaffold-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.scaffold-suggestion {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #93c5fd;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.scaffold-suggestion:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.6);
}

/* Clickable column headers in scaffold table */
.scaffold-table th[data-column] {
  transition: background 0.15s, color 0.15s;
}
.scaffold-table.editable th[data-column] {
  cursor: pointer;
}
.scaffold-table.editable th[data-column]:hover {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}

/* Fill Table actions */
.scaffold-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.scaffold-actions[hidden] { display: none; }
.scaffold-fill-btn {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  border: none;
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.scaffold-fill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}
.scaffold-fill-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.scaffold-fill-prompt {
  flex: 1;
  min-width: 180px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text, #fff);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
}
.scaffold-fill-prompt:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}
.scaffold-fill-status {
  width: 100%;
  font-size: 0.82rem;
  line-height: 1.4;
  min-height: 1.2em;
}
.fill-streaming {
  color: #67e8f9;
  font-style: italic;
}
.fill-streaming::after {
  content: "▍";
  animation: scaffold-blink 1s steps(2) infinite;
}
.fill-done {
  color: #10b981;
  font-weight: 600;
}
.fill-error {
  color: #ef4444;
}
@keyframes scaffold-blink { 50% { opacity: 0; } }