/* Binary Converter (pillar) — page-specific styles */

/* Monospace table cells for bit patterns */
.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* Field header row: label + copy button side by side */
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.field-head label { margin-bottom: 0.25rem; }
.field-head .btn-copy { min-height: 32px; }

/* Textareas match the design-system inputs; 16px prevents iOS zoom-on-focus */
#calculator textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-white);
  transition: var(--transition);
  resize: vertical;
  min-height: 84px;
}
#calculator textarea:hover { border-color: var(--color-text-muted); }
#calculator textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(245, 73, 0, 0.1);
}
#calculator input[type="text"] {
  font-size: 1rem;
  font-family: var(--font-mono);
}

/* Four equal-weight base fields: stacked on mobile, row on desktop */
.base-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
}
@media (min-width: 700px) {
  .base-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .base-grid { grid-template-columns: repeat(4, 1fr); }
}

.options-row,
.controls-row { margin-top: 0.5rem; }

.status-line {
  margin-top: 0.25rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Informational (non-error) field messages */
.error-msg.info-msg { color: var(--color-text-light); }

/* Working trace panel */
.trace-panel {
  margin-top: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  padding: 0.75rem 1rem;
}
.trace-panel summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.trace-panel summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.trace-body { padding: 0.5rem 0; }
.trace-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.trace-empty { font-size: 0.875rem; color: var(--color-text-light); }
.trace-note { font-size: 0.8125rem; color: var(--color-text-light); margin-top: 0.5rem; }
.trace-expansion {
  font-size: 0.875rem;
  overflow-wrap: break-word;
  word-break: break-word;
  margin-bottom: 0.5rem;
}
.trace-table { background: var(--color-white); }
.trace-panel .btn-copy { min-height: 36px; }

/* 400px scrollable reference tables with sticky header */
.scroll-table {
  max-height: 400px;
  overflow: auto;
}
.scroll-table .reference-table { border-radius: 0; box-shadow: none; }
.scroll-table .reference-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 2;
}

/* Filter / highlight inputs above big tables */
.table-filter { max-width: 320px; }
.table-filter input { font-size: 1rem; }

/* Highlighted rows (word highlight, jump-to-value) */
.reference-table tr.row-hit,
.reference-table tr.row-hit td {
  background: rgba(245, 73, 0, 0.12);
}
