/**
 * WORDLINK VALIDATOR TOOL - STYLES
 * Minimal, functional design - light mode only
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); /* Dark gradient - complements dark blue VT area */
  min-height: 100vh;
  padding: 20px;
  margin: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); /* Strong blue gradient - VT area */
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 6px;
  margin-bottom: 10px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-row-1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

h1 {
  font-size: 24px; /* Increased from 18px */
  font-weight: bold;
  color: white;
  margin: 0;
}

.subtitle {
  font-size: 11px;
  color: white;
  margin: 0;
  font-weight: normal;
}

/* Header Stats Row — Registry Dashboard (UI-011 → UI-900) */
.header-stats-row {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin: 8px 0 0 0;
  font-weight: normal;
  letter-spacing: 0.3px;
}

.registry-dashboard {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.registry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}

.registry-row-indent {
  padding-left: 20px;
}

/* Notation Settings collapsible sub-section */
.cp-subsection {
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 6px;
}

.cp-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.cp-subsection-title {
  font-weight: 600;
  font-size: 12px;
  color: #ffffff;
}

.cp-subsection-header:hover .cp-subsection-title {
  color: #e0e0ff;
}

.registry-row-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

/* Input Mode row at top of Control Panel */
.cp-input-mode-row {
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* NFC Parameters collapse header */
.nfc-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 8px;
  margin: 8px 0 0 0;
  background: rgba(8, 65, 162, 0.08);
  border: 1px solid #a0b8d8;
  border-radius: 4px;
  user-select: none;
}

.nfc-collapse-header:hover {
  background: rgba(8, 65, 162, 0.14);
}

.nfc-collapse-title {
  font-weight: 700;
  font-size: 0.9em;
  color: #ffffff;
}

.registry-group-label {
  font-size: 10px;
  margin-right: 2px;
}

.registry-item {
  white-space: nowrap;
}

.registry-item-label {
  color: rgba(255, 255, 255, 0.7);
}

.registry-item-count {
  font-weight: 600;
  color: white;
}

.registry-item-count.count-zero {
  color: rgba(255, 255, 255, 0.35);
  font-weight: normal;
}

.registry-item.planned .registry-item-label,
.registry-item.planned .registry-item-count {
  color: rgba(255, 255, 255, 0.3);
  font-weight: normal;
  font-style: italic;
}

/* Manual Add / Blacklist Panel (Manual Sub Widget) - TASK 4: Horizontal layout */
.manual-add-panel {
  background: #EFF6FF;
  border: 1px solid #CCCCCC;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-wrap: wrap;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.manual-add-panel input[type="text"] {
  width: 180px;
  padding: 6px 10px;
  border: 1px solid #CCCCCC;
  border-radius: 4px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: white;
}

.manual-ai-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1a1a1a;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

.manual-ai-toggle input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.manual-buttons {
  display: flex;
  gap: 8px;
}

.manual-btn {
  padding: 6px 12px;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

/* Manual Add button - green */
#manual-add-btn {
  background: #16a34a;
}

#manual-add-btn:hover {
  background: #15803d;
}

/* Manual Blacklist + Ask AI button - black */
#manual-blacklist-btn {
  background: #111111;
}

#manual-blacklist-btn:hover {
  background: #333333;
}

.manual-ai-result {
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  flex-basis: 100%;  /* Force new line in flex container */
}

.manual-ai-result.agrees {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.manual-ai-result.disagrees {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.manual-ai-summary {
  margin-bottom: 6px;
}

.manual-ai-ov-row {
  font-size: 11px;
  margin-bottom: 5px;
  line-height: 1.4;
}

.manual-ai-test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 3px 10px;
  font-size: 11px;
}

.manual-ai-test-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.3;
}

.manual-duplicate-result {
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  flex-basis: 100%;  /* Force new line in flex container */
}

.manual-duplicate-result.no-match {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.manual-duplicate-result.positive-match {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.manual-duplicate-result.exact-match,
.manual-duplicate-result.fuzzy-match {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.manual-confirmation {
  display: flex;
  gap: 4px;
  flex-direction: column;
  flex-basis: 100%;  /* Force new line in flex container */
}

.manual-confirm-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.manual-destinations {
  background: #252540;
  border: 1px solid #40406a;
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}

.manual-dest-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 8px;
  margin-bottom: 6px;
}

.manual-dest-group:last-child {
  margin-bottom: 0;
}

.manual-dest-group-label {
  grid-column: 1 / -1;
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7070a0;
  margin-bottom: 4px;
}

.manual-dest-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c0c0e0;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}

.manual-dest-option input[type="checkbox"] {
  accent-color: #0841a2;
  cursor: pointer;
}

.manual-confirm-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.manual-confirm-btn:hover {
  background: #f3f4f6;
  border-color: #2563eb;
}

#manual-confirm-add {
  background: #16a34a;
  color: white;
  border-color: #15803d;
}

#manual-confirm-add:hover {
  background: #15803d;
  border-color: #15803d;
}

#manual-confirm-blacklist {
  background: #111111;
  color: white;
  border-color: #000;
}

#manual-confirm-blacklist:hover {
  background: #333333;
  border-color: #000;
}

#manual-confirm-punt {
  background: #6b7280;
  color: white;
  border-color: #4b5563;
}

#manual-confirm-punt:hover {
  background: #4b5563;
  border-color: #4b5563;
}

/* Reference Link & Panel */
.manual-reference-link {
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  flex-basis: 100%;
  margin-top: 6px;
  user-select: none;
}

.manual-reference-link:hover {
  text-decoration: underline;
}

.manual-reference-panel {
  display: none;
  flex-basis: 100%;
  background: white;
  border: 1px solid #CCCCCC;
  border-radius: 4px;
  padding: 12px;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
}

.manual-reference-panel.expanded {
  display: block;
}

.manual-reference-section {
  margin-bottom: 16px;
}

.manual-reference-section:last-child {
  margin-bottom: 0;
}

.manual-reference-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #E5E5E5;
  padding-bottom: 4px;
}

.manual-reference-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 12px 0 6px 0;
}

.manual-reference-section pre {
  background: #F9FAFB;
  border: 1px solid #E5E5E5;
  border-radius: 3px;
  padding: 8px;
  font-size: 11px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.borderline-entry {
  background: #FFFBEB;
  border-left: 3px solid #F59E0B;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 3px;
}

.borderline-entry .phrase {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.borderline-entry .notes {
  font-size: 11px;
  color: #6B7280;
  font-style: italic;
}

/* Input Section */
.input-section {
  margin-bottom: 10px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 3px;
  color: white; /* Changed to white for INPUT WORDCHAIN label */
  font-size: 12px;
}

textarea {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  background-color: white; /* Keep inputs white for contrast */
  font-size: 25px; /* Increased by 30% from 19px */
  font-weight: bold;
  resize: vertical; /* User can resize vertically */
  transition: border-color 0.2s;
  min-height: 1.8em; /* ~1 row minimum */
}

/* Placeholder text for textareas - gray for visibility on white background */
textarea::placeholder {
  color: #999;
}

/* Staircase input override - larger default, user can resize, prevent horizontal scroll */
#staircase-input {
  min-height: 200px; /* Minimum height */
  height: 400px; /* Default height, user can adjust */
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre;
  word-wrap: normal;
  font-weight: bold; /* Match linear mode */
}

textarea.auto-loaded,
#wordchain-input.auto-loaded {
  font-weight: bold !important;
  line-height: 1.2;
}

textarea:focus {
  outline: none;
  border-color: #2e4c6d;
}

.button-group {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* Buttons */
.btn {
  padding: 5px 12px;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: #006400;
  color: white;
  border: 1px solid #006400;
}

.btn-primary:hover {
  background-color: #007a00;
}

.btn-primary:disabled {
  background-color: #9ca3af;
  color: #e5e7eb;
  cursor: not-allowed;
  border: 1px solid #9ca3af;
}

/* Validate button - Pine View Green (2x size — UI-900b) */
#validate-btn {
  background-color: #006400;
  color: white;
  font-weight: bold;
  font-size: 20px;
  padding: 12px 40px;
  border: 1px solid #006400;
  border-radius: 8px;
}

#validate-btn:hover {
  background-color: #007a00;
}

/* Validate button in staircase mode */
#validate-staircase-btn {
  background-color: #006400;
  color: white;
  font-weight: bold;
  font-size: 14px;
  border: 1px solid #006400;
}

#validate-staircase-btn:hover {
  background-color: #007a00;
}

.btn-secondary {
  background-color: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background-color: #d0d0d0;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2e4c6d;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Results Section */
.results-section,
.summary-section,
.actions-section {
  margin-top: 8px;
  padding: 12px;
  border-top: 1px solid #ddd;
  background-color: white; /* Keep sections white for contrast */
  border-radius: 8px;
}

h2 {
  font-size: 12px;
  font-weight: bold;
  color: #2e4c6d;
  margin-bottom: 4px;
}

.unit-result {
  background-color: #f9f9f9;
  padding: 4px 8px;
  margin-bottom: 3px;
  border-radius: 3px;
  border-left: 3px solid #ddd;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.unit-result.valid {
  border-left-color: #00d26a;
}

.unit-result.valid.medium-confidence {
  border-left-color: #fbbf24;
}

.unit-result.invalid {
  border-left-color: #ff4646;
  background-color: #fecaca;  /* Light red background matching Manual Blacklist button tone */
}

.unit-title {
  font-size: 11px;
  font-weight: bold;
  color: #333;
  min-width: 120px;
}

.unit-details {
  display: inline;
  color: #555;
}

.unit-detail {
  display: inline;
  margin: 0 6px 0 0;
  color: #555;
}

.status-icon {
  font-weight: bold;
  margin-right: 5px;
}

.valid-icon {
  color: #00d26a;
}

.invalid-icon {
  color: #ff4646;
}

.helper-word {
  color: #2e4c6d;
  font-style: italic;
}

/* Summary */
.summary-container {
  background-color: #f0f8ff;
  padding: 6px 8px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.2;
}

.summary-status {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
}

.summary-status.valid {
  color: #00d26a;
}

.summary-status.invalid {
  color: #ff4646;
}

.summary-score {
  font-size: 11px;
  margin-bottom: 4px;
  color: #2e4c6d;
}

.summary-stats {
  margin-bottom: 4px;
}

.summary-stat {
  margin: 1px 0;
  line-height: 1.2;
}

.summary-sources {
  margin-top: 4px;
}

/* Sources Grid (2-column balanced layout) */
.sources-section {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.sources-section p {
  margin-bottom: 6px;
}

.sources-grid {
  display: flex;
  gap: 16px;
  width: 100%;
}

.sources-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.source-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 4px;
  white-space: nowrap;
}

.source-name {
  color: #2e4c6d;
  font-weight: 500;
}

.source-count {
  color: #666;
  font-weight: 600;
  margin-left: 8px;
}

/* Actions Section */
.actions-section {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Settings Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 30px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

.close-btn:hover {
  color: #333;
}

.setting-item {
  margin-bottom: 25px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
}

.setting-item input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.setting-description {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: normal;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

.modal-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
}

/* Registry Modal Specific Styles - Dark Theme */
#registry-modal .modal-content {
  background-color: #0d1b2a;
  border: 2px solid #1e3f6e;
  color: #e0e0e0;
  max-width: 600px;
}

#registry-modal .modal-header {
  border-bottom: 2px solid #1e3f6e;
}

#registry-modal .modal-header h3 {
  color: #3b82f6;
  margin: 0;
}

#registry-modal .modal-close {
  color: #888;
}

#registry-modal .modal-close:hover {
  color: #3b82f6;
}

#registry-modal .modal-footer {
  border-top: 1px solid #1e3f6e;
}

.registry-section {
  margin: 15px 0;
}

.registry-section-header {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #3b82f6;
}

.registry-list {
  background: #112240;
  border: 1px solid #1e3f6e;
  border-radius: 4px;
  padding: 10px;
  max-height: 200px;
  overflow-y: auto;
}

.registry-list-item {
  padding: 4px 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #e0e0e0;
}

.registry-empty-message {
  text-align: center;
  color: #4ade80;
  font-size: 16px;
  padding: 20px;
  background: #1e3f6e;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  margin: 15px 0;
}

.registry-total {
  margin-top: 15px;
  padding: 12px;
  background: #1e3f6e;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  font-weight: 600;
  color: #60a5fa;
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  .button-group,
  .actions-section {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.text-success {
  color: #00d26a;
}

.text-error {
  color: #ff4646;
}

.text-warning {
  color: #ffd93d;
}

/* Validation Steps */
.unit-result {
  display: block;
}

.unit-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.validation-steps {
  margin-left: 20px;
  margin-top: 4px;
  padding: 6px;
  background: #f5f5f5;
  border-left: 3px solid #ccc;
  font-size: 10px;
  border-radius: 3px;
}

.validation-steps.hidden {
  display: none;
}

.validation-details {
  font-family: 'Courier New', monospace;
}

.validation-step {
  margin: 2px 0;
  padding: 1px 0;
  line-height: 1.3;
}

.validation-step strong {
  color: #333;
}

.validation-step .found {
  color: #00d26a;
  font-weight: bold;
}

.validation-step .not-found {
  color: #666;
}

.validation-step .skipped {
  color: #ffc107;
}

.validation-step .error {
  color: #ff4646;
  font-weight: bold;
}

.validation-step .checking {
  color: #007bff;
}

.api-url {
  color: #007bff;
  font-size: 9px;
  font-family: monospace;
  display: inline-block;
  margin-left: 10px;
  word-break: break-all;
}

.api-phrase {
  color: #555;
  font-size: 9px;
  font-family: monospace;
  display: inline-block;
  margin-left: 10px;
}

.packs-checked {
  color: #666;
  font-size: 9px;
  font-style: italic;
  margin-left: 10px;
}

.toggle-details {
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 10px;
  background: #e9ecef;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.toggle-details:hover {
  background: #dee2e6;
  border-color: #999;
}

.toggle-details:active {
  background: #ced4da;
}
/* ═══════════════════════════════════════════════════════════════
   INDENTED INPUT MODE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Mode Toggle Section */
.mode-toggle-section {
  background: #0841a2;
  border: 2px solid #0841a2;
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.mode-label {
  font-weight: bold;
  font-size: 11px;
  color: #d0d8f0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  transition: all 0.2s;
}

.radio-option:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.2);
}

.radio-option input[type="radio"] {
  cursor: pointer;
}

.radio-option span {
  font-size: 10px;
  font-weight: 500;
  color: #e8eeff;
}

/* Linear Preview Section */
.linear-preview-section {
  margin-bottom: 20px;
}

.linear-preview-section h3 {
  font-size: 14px;
  font-weight: bold;
  color: #2e4c6d;
  margin-bottom: 10px;
}

.preview-box {
  padding: 15px;
  background: #f8f9fa;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  min-height: 60px;
  color: #495057;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* Indented Input Section */
.indented-input-section {
  margin-bottom: 30px;
}

.indented-input-section h3 {
  font-size: 14px;
  font-weight: bold;
  color: #2e4c6d;
  margin-bottom: 10px;
}

.indented-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 15px;
  background: #ffffff;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre;
  line-height: 1.8;
  margin-bottom: 15px;
}

.indented-display:empty::before {
  content: "No units yet - start typing below!";
  color: #999;
  font-style: italic;
}

.unit-line {
  padding: 3px 0;
}

.unit-line.valid {
  color: #28a745;
  font-weight: 500;
}

.unit-line.invalid {
  color: #dc3545;
  font-weight: bold;
}

#current-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 2px solid #007bff;
}

#direction-indicator {
  font-size: 28px;
  font-weight: bold;
  color: #007bff;
  min-width: 35px;
  text-align: center;
  font-family: monospace;
}

#current-unit-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 15px;
  border: 2px solid #007bff;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  background: white;
}

#current-unit-input:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

#current-unit-input:disabled {
  background: #e9ecef;
  cursor: not-allowed;
}

#validation-status {
  min-width: 40px;
  font-size: 24px;
  text-align: center;
}

#validation-status.validating::after {
  content: "⏳";
  animation: spin 1s linear infinite;
}

#validation-status.valid::after {
  content: "✅";
}

#validation-status.invalid::after {
  content: "❌";
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#input-help {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
}

#input-help small {
  font-size: 11px;
  color: #856404;
}

/* Legend Section */
.legend-section {
  margin-top: 30px;
  margin-bottom: 20px;
  padding: 20px;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
}

.legend-section h4 {
  font-size: 14px;
  font-weight: bold;
  color: #856404;
  margin-bottom: 15px;
}

.legend-section h5 {
  font-size: 13px;
  font-weight: bold;
  color: #856404;
  margin-bottom: 10px;
  margin-top: 20px;
}

.legend-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 15px 0;
}

.legend-item {
  padding: 10px;
  background: white;
  border-radius: 4px;
  border-left: 4px solid #ffc107;
  font-size: 12px;
}

.legend-item strong {
  display: block;
  margin-bottom: 4px;
  color: #856404;
}

.legend-item code {
  background: #f8f9fa;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  color: #e83e8c;
  font-size: 12px;
}

.legend-visual {
  margin-top: 15px;
}

.example-chain {
  background: white;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.8;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #28a745;
  border: 1px solid #dee2e6;
}

.legend-visual p {
  margin-top: 8px;
  font-size: 11px;
  color: #856404;
}

/* Keyboard Key Styling */
kbd {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  color: #333;
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  padding: 3px 6px;
  white-space: nowrap;
}

/* Indented Actions */
.indented-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* Summary Box for Indented Mode */
#summary-box-indented {
  margin-top: 20px;
  padding: 15px;
  background: #d1ecf1;
  border: 2px solid #0c5460;
  border-radius: 6px;
}

#summary-box-indented h4 {
  font-size: 14px;
  font-weight: bold;
  color: #0c5460;
  margin-bottom: 10px;
}

#summary-text-indented {
  font-size: 12px;
  color: #0c5460;
  line-height: 1.6;
}

/* Error/Success Messages for Indented Mode */
.indented-message {
  padding: 12px 15px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 12px;
  animation: slideIn 0.3s ease-out;
}

.indented-message.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.indented-message.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════
   TRUE STAIR-STEP BUILDER - CONTENTEDITABLE
   ═══════════════════════════════════════════════════════════════ */

/* Grid Layout with Sidebar */
.indented-mode-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 25px;
  align-items: start;
}

.main-area {
  min-width: 0;
}

/* Legend Sidebar - Always Visible */
.legend-sidebar {
  position: sticky;
  top: 20px;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 18px;
  max-height: 80vh;
  overflow-y: auto;
}

.legend-sidebar .legend-section {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.legend-sidebar h4 {
  margin-top: 0;
  font-size: 13px;
}

/* Staircase Builder - ContentEditable */
.staircase-section {
  margin-bottom: 20px;
}

.staircase-section h3 {
  font-size: 14px;
  font-weight: bold;
  color: #2e4c6d;
  margin-bottom: 10px;
}

.staircase-input {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  padding: 20px;
  min-height: 300px;
  background: white;
  border: 2px solid #007bff;
  border-radius: 8px;
  white-space: pre-wrap;
  outline: none;
  line-height: 1.5; /* FIXED: Single-line spacing */
  color: #007bff; /* Blue for current typing */
  overflow-wrap: break-word;
  overflow-y: auto;
  max-height: 600px;
  cursor: text;
}

.staircase-input[contenteditable]:empty:before {
  content: attr(data-placeholder);
  color: #adb5bd;
  font-style: italic;
}

.staircase-input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* Unit Styling in Staircase */
.unit-valid {
  color: #28a745 !important; /* Green for valid */
  font-weight: 500;
}

.unit-invalid {
  color: #dc3545 !important; /* Red for invalid */
  font-weight: 600;
  text-decoration: underline wavy #dc3545;
}

/* Staircase Display Area (read-only, styled) */
.staircase-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  padding: 20px;
  min-height: 100px;
  background: white;
  border: 2px solid #28a745;
  border-radius: 8px 8px 0 0;
  white-space: pre;
  line-height: 1.5;
  margin-bottom: -2px;
}

.staircase-display:empty {
  display: none;
}

/* Staircase input moves to bottom when display has content */
.staircase-input {
  border-radius: 8px;
}

.staircase-display + .staircase-input {
  border-radius: 0 0 8px 8px;
  border-top: 1px dashed #007bff;
}

/* Individual lines in display */
.staircase-line {
  display: block;
  position: relative;
  line-height: 1.5;
}

/* Blue staircase background */
.stair-bg {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(0, 123, 255, 0.08);
  pointer-events: none;
  z-index: 0;
}

/* Text content sits above background */
.staircase-line .line-content {
  position: relative;
  z-index: 1;
}

/* Validation action buttons */
.staircase-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.staircase-actions button {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.staircase-actions .btn-primary {
  background: #006400;
  color: white;
  border: 1px solid #006400;
}

.staircase-actions .btn-primary:hover {
  background: #007a00;
}

.staircase-actions .btn-secondary {
  background: #6c757d;
  color: white;
}

.staircase-actions .btn-secondary:hover {
  background: #545b62;
}

/* Expandable validation details */
.unit-result {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.unit-result:hover {
  background: #f8f9fa;
  border-color: #007bff;
}

.unit-result.expanded {
  background: #e7f3ff;
  border-color: #007bff;
}

.unit-header {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.unit-status {
  font-size: 24px;
  line-height: 1;
  grid-column: 1;
}

.unit-number {
  font-size: 14px;
  color: #666;
  grid-column: 2;
}

.unit-text {
  font-size: 36px !important;
  font-weight: 600;
  text-align: center;
  grid-column: 3;
}

.unit-source {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  grid-column: 4;
}

/* NOR-003: admin-only verb lemmatization indicator */
.lemma-badge {
  font-size: 10px;
  color: #999;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  font-style: italic;
  vertical-align: middle;
}

.expand-icon {
  grid-column: 5;
}

.add-phrase-btn {
  grid-column: 4;
}

.unit-details {
  margin-top: 8px;
  font-size: 11px;
  color: #666;
}

.add-phrase-btn {
  font-size: 10px;
  padding: 2px 7px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 3px;
  color: #856404;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.add-phrase-btn:hover:not(:disabled) {
  background: #ffc107;
  color: #000;
}
.add-phrase-btn:disabled {
  cursor: default;
}

.validation-steps {
  margin-top: 4px;
  padding: 4px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 11px;
  display: none;
}

.unit-result.expanded .validation-steps {
  display: block;
}

.validation-step {
  padding: 1px 0;
  border-bottom: 1px solid #dee2e6;
}

.validation-step:last-child {
  border-bottom: none;
}

.validation-step .step-source {
  font-weight: 600;
  margin-right: 8px;
}

.validation-step .step-url {
  color: #007bff;
  font-size: 10px;
  word-break: break-all;
}

.unit-invalid {
  color: #dc3545;
  font-weight: 600;
  text-decoration: wavy underline;
}

.unit-current {
  color: #007bff;
}

/* Status Messages for Staircase */
#staircase-status {
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
}

#staircase-status.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

#staircase-status.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

#staircase-status.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

#staircase-help {
  margin-top: 10px;
  padding: 8px 12px;
  background: #e7f3ff;
  border-left: 4px solid #007bff;
  border-radius: 4px;
}

#staircase-help small {
  font-size: 11px;
  color: #004085;
}

/* Visual Indicators in Validation Steps */
.step-icon {
  font-size: 14px;
  margin-right: 5px;
  font-weight: bold;
}

.step-icon.found {
  color: #28a745;
}

.step-icon.not-found {
  color: #dc3545;
}

.step-icon.not-checked {
  color: #8b4513;
  font-size: 12px;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1200px) {
  .indented-mode-container {
    grid-template-columns: 1fr;
  }

  .legend-sidebar {
    position: static;
    max-height: none;
  }
}


/* Unit limits info */
.unit-limits-info {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: #e7f3ff;
  border-left: 4px solid #2196f3;
  border-radius: 4px;
  font-size: 14px;
  color: #1976d2;
  cursor: help;
}

.info-icon {
  margin-right: 6px;
  font-size: 16px;
}

.limits-text strong {
  color: #0d47a1;
  font-weight: 600;
}

/* Limits explanation in settings */
.limits-explanation {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 14px;
}

.limits-explanation p {
  margin: 10px 0;
}

.limits-examples {
  margin-top: 15px;
  border-top: 1px solid #dee2e6;
  padding-top: 15px;
}

.example-item {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.example-item.valid {
  background: #d4edda;
  border-left: 4px solid #28a745;
}

.example-item.invalid {
  background: #f8d7da;
  border-left: 4px solid #dc3545;
}

.example-item code {
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.example-item small {
  color: #6c757d;
  margin-left: auto;
}

.example-icon {
  font-size: 16px;
}

/* Legend limits */
.legend-limits {
  margin: 20px 0;
  padding: 15px;
  background: #fff9e6;
  border: 2px solid #ffc107;
  border-radius: 6px;
}

.legend-limits h5 {
  margin: 0 0 12px 0;
  color: #856404;
  font-size: 15px;
}

.legend-limits ul {
  margin: 10px 0;
  padding-left: 20px;
  list-style: none;
}

.legend-limits li {
  margin: 6px 0;
  font-size: 13px;
  color: #333;
}

.legend-limits li::before {
  content: "▸ ";
  color: #ffc107;
  font-weight: bold;
  margin-right: 5px;
}

.legend-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ffe58f;
  font-size: 12px;
  color: #856404;
  font-style: italic;
}

/* Unit stats in results */
.unit-stats {
  color: #6c757d !important;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  background: #f8f9fa;
  padding: 2px 8px;
  border-radius: 3px;
}

/* ========================================
   WORDCHAIN HISTORY SECTION
   ======================================== */

.wordchain-history-section {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-header h4 {
  margin: 0;
  font-size: 16px;
  color: #495057;
  font-weight: 600;
}

.btn-clear-history {
  padding: 4px 12px;
  font-size: 13px;
  background: #b91c1c;  /* Match Manual Blacklist button */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-clear-history:hover {
  background: #991b1b;  /* Match Manual Blacklist button hover */
}

.history-list {
  max-height: 362px;  /* 75% increase from 207px */
  overflow-y: auto;
  padding-right: 5px;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: #868e96;
}

.history-item {
  position: relative;
  padding: 10px 12px;
  margin: 5px 0;
  background: white;
  border-radius: 4px;
  border: 1px solid #ced4da;
  transition: all 0.2s;
}

.delete-history-item {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}

.history-item:hover .delete-history-item {
  opacity: 1;
}

.delete-history-item:hover {
  background: #c82333;
  transform: scale(1.1);
}

.history-content {
  padding-right: 35px; /* Make room for delete button */
}

.history-header:hover {
  background: rgba(231, 243, 255, 0.5);
  border-radius: 4px;
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: #6c757d;
  white-space: nowrap;
}

.history-timestamp {
  font-weight: 500;
}

.history-stats {
  font-weight: 600;
}

.history-text {
  font-family: 'Courier New', monospace;
  font-size: 22px; /* Increased by 60% from 14px */
  color: #212529;
  font-weight: 500;
  word-wrap: break-word; /* Allow wrapping */
  white-space: normal; /* Allow wrapping */
  line-height: 1.3;
}

.history-header {
  display: grid;
  grid-template-columns: 1fr auto auto; /* 3 columns: main (flexible), time/stats, details */
  gap: 15px;
  align-items: center;
  cursor: pointer;
  padding-right: 35px; /* Make room for delete button */
}

.history-expand-btn {
  font-size: 11px;
  color: #666;
  user-select: none;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 3px;
  transition: all 0.2s;
}

.history-expand-btn:hover {
  color: #007bff;
  font-weight: 600;
  background: #e7f3ff;
}

.history-validation-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #e9ecef;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 2000px;
  }
}

.load-history-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.load-history-btn:hover {
  background: #0056b3;
}

.history-info {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
  font-size: 13px;
}

/* ========================================
   COLLAPSIBLE SECTIONS
   ======================================== */

.collapsible-section {
  margin: 20px 0;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #3a3a60;  /* Match Control Panel dark blue */
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.section-header:hover {
  background: #454570;  /* Slightly lighter on hover */
}

.section-header h3 {
  margin: 0;
  font-size: 18px;
  color: #c8c8e8;  /* Light gray text to match Control Panel */
  flex-grow: 1;
}

.woo-hoo-message {
  margin-left: auto;
  margin-right: 20px;
  order: 99;
}

/* PR-002: Smarter greedy parser notice */
.smarter-greedy-notice {
  background-color: #e7f3ff;
  border-left: 3px solid #2563eb;
  padding: 8px 12px;
  margin: 12px 0;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
  border-radius: 4px;
}

.collapse-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
  padding: 0 10px;
  line-height: 1;
  color: #c8c8e8;  /* Light gray to match dark blue header */
}

.collapse-btn.collapsed {
  transform: rotate(-90deg);
}

.section-content {
  padding: 20px;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.section-content.collapsed {
  max-height: 0 !important;
  padding: 0 20px !important;
  opacity: 0;
}

.clear-btn {
  padding: 6px 12px;
  font-size: 13px;
  background: #b91c1c;  /* Match Manual Blacklist button */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

.clear-btn:hover {
  background: #991b1b;  /* Match Manual Blacklist button hover */
}

/* Invalid section styling */
.invalid-section .section-header {
  background: #3a3a60;  /* Match other section headers */
}

.invalid-section .section-header h3 {
  color: #c8c8e8;  /* Match other section headers */
}

.invalid-section .history-item {
  border-left: 4px solid #fc8181;
}

.invalid-section .history-item:hover {
  background: #fff5f5;
}

/* Validation URL styling */
.validation-url-container {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 123, 255, 0.05);
  border-radius: 4px;
}

.validation-url {
  color: #007bff;
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  display: inline-block;
}

.validation-url:hover {
  text-decoration: underline;
  color: #0056b3;
}

.validation-url:visited {
  color: #6610f2;
}

/* ═══════════════════════════════════════════════════════════
   REGISTRY WIDGET
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   CONTROL PANEL (inline collapsible)
   ═══════════════════════════════════════════════════════════ */

.control-panel {
  background: #505080;
  border: 1px solid #6a6aa0;
  border-radius: 6px;
  margin-bottom: 14px;
  overflow: visible;
}

.control-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  user-select: none;
  background: #5a5a90;
  border-radius: 6px;
  transition: background 0.15s;
}

.control-panel-header:hover {
  background: #65659a;
}

.cp-title {
  font-size: 13px;
  font-weight: 700;
  color: #c8c8e8;
  letter-spacing: 0.5px;
  flex: 1;
  text-transform: uppercase;
}

.cp-save-indicator {
  font-size: 10px;
  color: #4caf50;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.cp-save-indicator.visible {
  opacity: 1;
}

.cp-arrow {
  font-size: 11px;
  color: #aaa;
  transition: transform 0.2s;
}

.cp-arrow.open {
  transform: rotate(180deg);
}

.control-panel-body {
  display: none;
  padding: 10px 14px 12px;
  border-top: 1px solid #6a6aa0;
}

.control-panel-body.open {
  display: block;
}

.cp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cp-row:last-child {
  margin-bottom: 0;
}

.cp-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cp-item-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-label {
  font-size: 13px;
  color: #d0d0ee;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Toggle Switch */
.cp-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cp-toggle-slider {
  width: 34px;
  height: 18px;
  background: #585880;
  border-radius: 18px;
  transition: background 0.2s;
  position: relative;
  flex-shrink: 0;
}

.cp-toggle-slider::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  background: #c0c0d8;
  border-radius: 50%;
  top: 2.5px;
  left: 3px;
  transition: transform 0.2s, background 0.2s;
}

.cp-toggle input:checked + .cp-toggle-slider {
  background: #3a6ea8;
}

.cp-toggle input:checked + .cp-toggle-slider::after {
  transform: translateX(15px);
  background: #7cc4ff;
}

/* Radio Button Group */
.cp-radio-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cp-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  color: #d0d0ee;
  white-space: nowrap;
}

.cp-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #585880;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.cp-radio input[type="radio"]:checked {
  border-color: #3a6ea8;
}

.cp-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #7cc4ff;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Number input */
.cp-number {
  width: 80px;
  background: #282845;
  border: 1px solid #585880;
  border-radius: 4px;
  color: #e0e0f4;
  padding: 3px 6px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
}

.cp-number:focus {
  outline: none;
  border-color: #4a9eff;
}

/* Checkbox labels */
.cp-check {
  font-size: 11px;
  color: #d0d0ec;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.cp-check input[type="checkbox"] {
  width: 12px;
  height: 12px;
  cursor: pointer;
  accent-color: #4a9eff;
}

/* Yellow highlight for checked source checkboxes */
.source-checkbox input[type="checkbox"]:checked {
  accent-color: #fbbf24;
}

.source-checkbox input[type="checkbox"]:checked + * {
  color: #fbbf24;
  font-weight: 600;
}

.cp-check.cp-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Info tooltip */
.cp-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cp-info-icon {
  font-size: 9px;
  color: #4a9eff;
  cursor: help;
  background: transparent;
  border: 1px solid #3a6ea8;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-style: normal;
  flex-shrink: 0;
}

.cp-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0d1520;
  border: 1px solid #3a6ea8;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  color: #ccc;
  width: 300px;
  z-index: 200;
  pointer-events: none;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.cp-tooltip code {
  background: #1a2a3a;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  color: #7ecfff;
}

.cp-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #3a6ea8;
}

.cp-info-wrap:hover .cp-tooltip {
  display: block;
}

/* Control Panel Sections (V1/V2) */
.cp-section {
  margin-top: 8px;
  border-top: 1px solid #50507a;
  padding-top: 8px;
}

.cp-section:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.cp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  background: #404066;
  border-radius: 4px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.cp-section-header:hover {
  background: #4a4a76;
}

.cp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #d0d0ee;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cp-section-arrow {
  font-size: 10px;
  color: #aaa;
  transition: transform 0.2s;
}

.cp-section-body {
  padding-left: 4px;
}

/* UI-012: Borderline Mode checkbox — orange accent */
.borderline-mode-check input[type="checkbox"] {
  accent-color: #e07820;
}

/* UI-012: Content Files links */
.cp-content-link {
  display: inline-block;
  font-size: 13px;
  color: #a0b4e8;
  text-decoration: none;
  padding: 3px 8px;
  border: 1px solid #50507a;
  border-radius: 3px;
  margin-right: 6px;
  transition: background 0.15s, color 0.15s;
}

.cp-content-link:hover {
  background: #404066;
  color: #d0d8f8;
}

/* Placeholder items (V2 Coming Soon) */
.cp-placeholder {
  opacity: 0.4;
}

.cp-placeholder .cp-label {
  color: #888;
}

.cp-placeholder .cp-toggle-slider {
  background: #484860;
  cursor: not-allowed;
}

.cp-placeholder .cp-toggle-slider::after {
  background: #666;
}

/* ─── Staircase Form (Phase 1) ──────────────────────────────────── */

/* Mode indicator bar */
.sc-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  font-size: 12px;
}

/* H / V mode badge */
.sc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.sc-badge-h {
  background: #2563eb;
  color: #fff;
}

.sc-badge-v {
  background: #059669;
  color: #fff;
}

.sc-mode-hint {
  color: #334;
  font-style: italic;
  font-size: 11px;
}

/* Textarea wrapper */
.sc-textarea-wrapper {
  position: relative;
}

/* The staircase textarea */
.sc-textarea {
  width: 100%;
  min-height: 200px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px;
  background-color: #f0f8ff;
  color: #1a3a6e;
  border: 2px solid #cce4ff;
  border-radius: 6px;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
  display: block;
  tab-size: 1;
}

.sc-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.sc-textarea::placeholder {
  color: #8ab4d0;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   MARKING PATTERN & WORDCHAIN DISPLAY (L2S + S2L)
   ═══════════════════════════════════════════════════════════════ */

/* L2S: WordChain Display Card (Linear mode) */
.wordchain-display-card {
  margin-top: 20px;
  background: #000;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.wordchain-display-card .section-header {
  background: #3a3a60;  /* Match other section headers */
  padding: 12px 20px;
}

.wordchain-display-card .section-header h3 {
  font-size: 16px;
  color: #c8c8e8;  /* Match other section headers */
  margin: 0;
}

.wordchain-display-card .section-content {
  padding: 20px;
}

.display-case-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
  font-style: italic;
}

.marking-pattern-container {
  margin-bottom: 20px;
  padding: 15px;
  background: #000;
  border: none;
  border-radius: 6px;
  overflow: visible; /* Allow text to display fully, wrapping handles width */
}

.marking-pattern-container canvas {
  display: block;
}

.tight-stairs-container {
  padding: 20px;
  /* TASK 5: Ruled paper background with faint horizontal lines at 36px intervals */
  background:
    repeating-linear-gradient(
      to bottom,
      #f5f5f5 0px,
      #f5f5f5 35px,
      rgba(100, 140, 200, 0.10) 35px,
      rgba(100, 140, 200, 0.10) 36px
    );
  border: 1px solid #ddd;
  border-radius: 6px;
  min-height: 100px;
  font-family: 'Courier New', monospace;
  position: relative;
}

/* S2L: Staircase Mode Side-by-Side Layout */
.staircase-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 20px;
  align-items: start;
}

.staircase-input-section {
  flex: 1;
}

.s2l-linear-view-panel {
  background: white;
  border: 2px solid #2832C2;
  border-radius: 8px;
  padding: 15px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.s2l-header {
  font-size: 14px;
  font-weight: 700;
  color: #2832C2;
  margin-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.s2l-content {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s2l-placeholder {
  color: #999;
  font-size: 13px;
  text-align: center;
  font-style: italic;
  padding: 20px;
}

.s2l-content canvas {
  display: block;
  margin: 0 auto;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1200px) {
  .staircase-layout {
    grid-template-columns: 1fr;
  }

  .s2l-linear-view-panel {
    position: static;
    max-height: none;
  }
}

/* ===== NNN (Numbers-for-Nerds) Styles ===== */

/* NNN Quick Toggle Button */
.nnn-quick-toggle {
  padding: 6px 12px;
  font-size: 12px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.2s;
  font-weight: 500;
}

.nnn-quick-toggle:hover {
  background: #5a6268;
}

.nnn-quick-toggle.nnn-active {
  background: #007bff;
  color: #fff;
}

.nnn-quick-toggle.nnn-active:hover {
  background: #0056b3;
}

/* NNN Source Tags */
.nnn-source-tag {
  font-size: 10px;
  color: #999;
  margin-left: 4px;
  font-weight: normal;
}

/* NNN Difficulty Rating */
.nnn-difficulty {
  font-size: 0.65em;  /* UI-020: increased dot/number size */
  color: #777;        /* Medium gray — overridden by inline color */
  margin-left: 2px;
  font-weight: 900;   /* NNN-006: bold for visibility */
  opacity: 1.0;
}

/* NNN-011: Provisional superscripts (while typing, before validation) */
.nnn-sup-provisional {
  color: #888888 !important;
  opacity: 0.6;
}

/* NNN-011: Rating delay dial */
.rwt-delay-dial {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.rwt-delay-label {
  font-weight: 600;
  white-space: nowrap;
}

.rwt-delay-dial input[type="range"] {
  width: 140px;
  cursor: pointer;
  accent-color: #60a5fa;
}

.rwt-delay-value {
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* NNN-011: Inline provisional superscript container above input */
.rwt-preview-container {
  min-height: 0;
  padding: 4px 8px;
  font-size: 16px;
  line-height: 1.6;
  color: white;
  word-wrap: break-word;
  white-space: pre-wrap;
  display: none;
}

.rwt-preview-container .rwt-word {
  display: inline;
  position: relative;
}

.rwt-preview-container sup {
  font-size: 0.55em;
  font-weight: 900;
  vertical-align: super;
}

/* NNN-013: Superscript Tooltips */
.nnn-tooltip {
  position: absolute;
  z-index: 10000;
  background: rgba(30, 30, 30, 0.95);
  color: #fff;
  font-size: 12px;
  font-family: Nunito, sans-serif;
  font-weight: 600;
  line-height: 1.4;
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 320px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nnn-has-tooltip {
  cursor: help;
}

/* NNN Chain Stats */
.chain-stats {
  margin-top: 20px;
}

.chain-stats > div:last-child {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
}

/* Toast notifications (auto-dismiss after 3s) */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 400px;
  word-wrap: break-word;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-20px);
}

.toast-success {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.toast-error {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.toast-info {
  background: #dbeafe;
  border: 1px solid #3b82f6;
  color: #1e3a8a;
}

/* ========================================
   VALIDATION SOURCE TALLY
   ======================================== */

.tally-section {
  margin-top: 24px;
}

.tally-empty {
  color: #888;
  font-size: 11px;
  font-style: italic;
  padding: 12px 16px;
}

.tally-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-bottom: 1px solid #f0f4f8;
}

.tally-row:last-of-type {
  border-bottom: none;
}

.tally-source {
  min-width: 190px;
  font-size: 11px;
  color: #334155;
  font-weight: 500;
}

.tally-bar-wrap {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}

.tally-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 5px;
  transition: width 0.35s ease;
}

.tally-count {
  min-width: 32px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
}

.tally-pct {
  min-width: 36px;
  text-align: right;
  font-size: 10px;
  color: #94a3b8;
}

.tally-total {
  padding: 8px 16px;
  font-size: 10px;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  text-align: right;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   CRYSTAL BALL POPUP (PPP-050)
   ═══════════════════════════════════════════════════════════════ */

.crystal-ball-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.crystal-ball-content {
  background: #1e3a8a;
  border: 2px solid #B8860B;
  border-radius: 12px;
  padding: 40px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(184, 134, 11, 0.3);
}

.crystal-ball-icon {
  font-size: 128px;
  margin-bottom: 16px;
  animation: crystalFloat 3s ease-in-out infinite, crystalGlow 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(184, 134, 11, 0.5));
}

@keyframes crystalFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes crystalGlow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(184, 134, 11, 0.4)); }
  50% { filter: drop-shadow(0 0 28px rgba(184, 134, 11, 0.8)) drop-shadow(0 0 48px rgba(147, 107, 9, 0.3)); }
}

.crystal-ball-intro {
  color: #e0f2fe;
  font-size: 32px;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 24px;
  font-style: italic;
}

.crystal-ball-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.crystal-ball-btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.crystal-ball-btn.keep-waiting {
  background: #B8860B;
  color: white;
}

.crystal-ball-btn.keep-waiting:hover {
  background: #9a7109;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.crystal-ball-btn.cancel-validation {
  background: #dc2626;
  color: white;
}

.crystal-ball-btn.cancel-validation:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ============================================================
   Review by Brooks Panel (PPP-053 Deliverable 1)
   ============================================================ */

.review-panel {
  background: #303050;
  border: 1px solid #50507a;
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.review-panel-header {
  padding: 7px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #CC5500;
  border-bottom: 1px solid #e06600;
  border-radius: 8px 8px 0 0;
}

.review-panel-header:hover {
  background: #dd6611;
}

.review-panel-title {
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.review-badge {
  background: #F59E0B;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.review-arrow {
  margin-left: auto;
  transition: transform 0.2s;
  font-size: 9px;
  color: #aaa;
}

.review-panel-body {
  padding: 10px 14px 14px;
  background: #303050;
  border-radius: 0 0 8px 8px;
}

.review-section {
  margin-bottom: 20px;
}

/* UI-012: Review panel subsections (Match Control Panel cp-section pattern) */
.review-subsection {
  margin-bottom: 6px;
}

.review-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  background: #404066;
  border-radius: 4px;
  margin-bottom: 6px;
  transition: background 0.15s;
}

.review-subsection-header:hover {
  background: #4a4a76;
}

.review-subsection-title {
  font-size: 10px;
  font-weight: 600;
  color: #b8b8d8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.review-subsection-body {
  padding-left: 4px;
  padding-bottom: 6px;
}

.review-controls-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 8px 10px;
  background: #404066;
  border: 1px solid #50507a;
  border-radius: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #b8b8d8;
}

.control-item label {
  color: #b8b8d8;
}

.control-item select {
  padding: 3px 6px;
  border: 1px solid #50507a;
  border-radius: 4px;
  background: #303050;
  color: #c8c8e8;
  font-size: 11px;
}

/* Traffic light colors for VT API gauge */
.gauge-green { color: #10B981; }
.gauge-yellow { color: #F59E0B; }
.gauge-red { color: #EF4444; }

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-table th {
  background: #F3F4F6;
  padding: 8px;
  text-align: left;
  border-bottom: 2px solid #E5E5E5;
  font-weight: 600;
}

.review-table td {
  padding: 8px;
  border-bottom: 1px solid #E5E5E5;
  vertical-align: top;
}

.review-table tr:hover {
  background: #F9FAFB;
}

.verdict-pill {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.verdict-yes {
  background: #D1FAE5;
  color: #065F46;
}

.verdict-no {
  background: #FEF3C7;
  color: #92400E;
}

.ai-reviewed-tag {
  background: #E0E7FF;
  color: #3730A3;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  margin-left: 4px;
}

.review-decision-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-decision-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.review-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.review-pagination button {
  padding: 6px 14px;
  border: 1px solid #CCCCCC;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 13px;
}

.review-pagination button:hover {
  background: #F3F4F6;
}

.review-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.review-empty-state {
  text-align: center;
  padding: 40px;
  color: #6B7280;
  font-style: italic;
}

/* PPP-054: Three-column candidate grid */
.review-candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.review-candidate-cell {
  background: #D8D8D8;
  border: 1px solid #BFBFBF;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}

.harvest-card-quick-btn {
  font-size: 0.7em;
  padding: 2px 7px;
  border: 1px solid #999;
  border-radius: 3px;
  cursor: pointer;
  font-family: Nunito, sans-serif;
  background: #fff;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}
.harvest-card-quick-btn:hover { background: #444; color: #fff; border-color: #444; }
.harvest-card-quick-btn.selected { background: #ff9800; color: #fff; border-color: #ff9800; }
.harvest-card-quick-btn[data-destination="units-registry"].selected { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.harvest-card-quick-btn[data-decision="discard"].selected { background: #555; color: #fff; border-color: #555; }
.harvest-card-quick-btn[data-decision="skip"].selected { background: #333; color: #fff; border-color: #333; }

.review-candidate-phrase {
  font-weight: 700;
  font-size: 20px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.harvest-card-phrase {
  font-weight: 700;
  font-size: 16px;
  color: #1a1a1a;
}

/* PPP-054 Fix 2: merged AI Assessment column */
.review-candidate-ai {
  font-size: 11px;
  line-height: 1.4;
  min-height: 16px;
}

.ai-assessment-valid {
  color: #2d7a2d;
  font-style: italic;
}

.ai-assessment-invalid {
  color: #9b1c1c;
  font-style: italic;
}

.ai-assessment-none {
  color: #9CA3AF;
}

/* Queue for AI label */
.review-queue-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  margin-top: 2px;
}

/* PPP-054 Fix 1: visible radio labels */
.review-decision-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1a1a1a;
  cursor: pointer;
  margin-top: 2px;
}

/* PPP-056: Review subheading */
.review-subheading {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #E5E5E5;
}

/* PPP-056: Decision buttons replacing radio buttons */
.review-decision-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.review-decision-btn {
  display: block;
  width: 100%;
  padding: 5px 6px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
  text-align: center;
  line-height: 1.3;
}

.review-decision-btn.btn-keep {
  background: #F5C518;
  color: #000000;
}
.review-decision-btn.btn-keep.selected {
  border-color: #b8900f;
  opacity: 1;
}

.review-decision-btn.btn-ai-queue {
  background: #6B21A8;
  color: #FFFFFF;
}
.review-decision-btn.btn-ai-queue.selected {
  border-color: #3b0f5e;
  opacity: 1;
}

.review-decision-btn.btn-add-registry {
  background: #166534;
  color: #FFFFFF;
}
.review-decision-btn.btn-add-registry.selected {
  border-color: #0a3a1c;
  opacity: 1;
}

.review-decision-btn.btn-blacklist {
  background: #111111;
  color: #FFFFFF;
}
.review-decision-btn.btn-blacklist.selected {
  border-color: #555555;
  opacity: 1;
}

/* Dimmed state for unselected buttons when one is selected */
.review-decision-buttons.has-selection .review-decision-btn:not(.selected) {
  opacity: 0.4;
}

/* Default hint when no button selected */
.review-default-hint {
  font-size: 10px;
  color: #9CA3AF;
  font-style: italic;
  margin-top: 2px;
  text-align: center;
}

/* HAR-001: Harvest filter bar */
.harvest-filter-btn {
  padding: 4px 12px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #2a2a4a;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85em;
}
.harvest-filter-btn.active {
  background: #0841a2;
  color: #fff;
  border-color: #0841a2;
}
.harvest-filter-btn:hover:not(.active) {
  background: #3a3a5a;
}
.review-decision-btn.btn-discard {
  background: #555;
  color: #ccc;
}
.review-decision-btn.btn-discard.selected {
  background: #777;
  border-color: #999;
  color: #fff;
  opacity: 1;
}

/* PPP-056: Tabbed reference panel */
.ref-tabs {
  display: flex;
  border-bottom: 2px solid #E5E5E5;
  margin-bottom: 12px;
}

.ref-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.ref-tab:hover {
  color: #374151;
}

.ref-tab.active {
  color: #1a1a1a;
  border-bottom-color: #2563eb;
}

.ref-tab-content {
  display: none;
}

.ref-tab-content.active {
  display: block;
}

/* Unit Definition editor */
#unit-definition-textarea {
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid #CCCCCC;
  border-radius: 4px;
  padding: 8px;
  resize: vertical;
  box-sizing: border-box;
  background: #F9FAFB;
}

.unit-def-error {
  color: #DC2626;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}

.unit-def-success {
  color: #16a34a;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}

.unit-def-save-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: #EA580C;
  color: #000000;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.unit-def-save-btn:hover {
  background: #c2410c;
}

.unit-def-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Unit Definition confirmation modal (in-flow) */
.unit-def-modal {
  margin-top: 10px;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  background: #FFF7ED;
  padding: 16px;
}

.unit-def-modal-content p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #1a1a1a;
}

.unit-def-modal-buttons {
  display: flex;
  gap: 8px;
}

.unit-def-modal-confirm {
  padding: 8px 16px;
  background: #EA580C;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.unit-def-modal-confirm:hover {
  background: #c2410c;
}

.unit-def-modal-cancel {
  padding: 8px 16px;
  background: #9CA3AF;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.unit-def-modal-cancel:hover {
  background: #6B7280;
}

/* Borderline Registry tab section headers */
.borderline-section-header {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 12px 0 6px 0;
}

.borderline-section-header:first-child {
  margin-top: 0;
}

/* Inline cell note (e.g. "Already in Registry") */
.review-cell-note {
  font-size: 10px;
  color: #6B7280;
  font-style: italic;
  margin-top: 4px;
  text-align: center;
}

/* Mobile: single column, larger button sizing */
@media (max-width: 600px) {
  .review-candidate-grid {
    grid-template-columns: 1fr;
  }

  .review-decision-btn {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NFC Widget — Notation Form Converter (PPP-051)
   ═══════════════════════════════════════════════════════════════════════════ */

.nfc-widget {
  margin-top: 30px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}

.nfc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.nfc-header h4 {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #555;
}

.nfc-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nfc-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.nfc-btn:hover {
  background: #e8e8e8;
}

.nfc-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ddd;
  color: #555;
  font-weight: 900;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
}

.nfc-help-link:hover {
  background: #ccc;
}

/* Output display */
.nfc-output {
  padding: 16px 20px;
  min-height: 50px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ddd;
  background: #fff;
  overflow-x: auto;
}

.nfc-output .nfc-rendered {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.55rem;
  line-height: 1.5;
  color: #1a1a18;
  white-space: nowrap;
}

.nfc-output .nfc-rendered sup {
  font-family: monospace;
  font-size: 0.55em;
  font-weight: 400;
  color: #7A5900;
  vertical-align: super;
  line-height: 0;
}

.nfc-output .nfc-rendered i {
  font-style: italic;
}

.nfc-output .nfc-rendered s {
  text-decoration: line-through;
  color: #8B3A2A;
}

#nfc-output sup {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55em;
  font-weight: 400;
  color: #B8860B;
  vertical-align: super;
  line-height: 0;
}

.nfc-placeholder {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #999;
  font-style: italic;
}

/* ID rows */
.nfc-ids {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ddd;
  background: #f8f8f8;
}

.nfc-id-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-right: 1px solid #eee;
}

.nfc-id-row:last-child {
  border-right: none;
}

.nfc-id-label {
  font-family: monospace;
  font-size: 11px;
  font-weight: 600;
  color: #7A5900;
  letter-spacing: 0.05em;
}

.nfc-id-value {
  font-family: monospace;
  font-size: 12px;
  color: #333;
}

/* NFC Parameter Input Area (PPP-051b — relocated to WC input area) */
.nfc-params-area {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.nfc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nfc-row:last-child {
  border-bottom: none;
}

.nfc-field-inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nfc-field-grow {
  flex: 1;
  min-width: 200px;
}

.nfc-advanced-toggle {
  padding: 4px 0;
}

.nfc-advanced-toggle a {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 11px;
  color: #999;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nfc-advanced-toggle a:hover {
  color: #ccc;
}

.nfc-advanced-section {
  padding-bottom: 4px;
}

.nfc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nfc-field > label {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nfc-field > label input[type="checkbox"] {
  margin: 0;
}

/* Toggle buttons */
.nfc-toggle-group {
  display: flex;
  gap: 0;
}

.nfc-toggle-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid #ccc;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

.nfc-toggle-group .nfc-toggle-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.nfc-toggle-group .nfc-toggle-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.nfc-toggle-btn.active {
  background: #7A5900;
  border-color: #7A5900;
  color: #fff;
}

/* Modifier buttons */
.nfc-modifier-row {
  display: flex;
  gap: 6px;
}

.nfc-modifier-row .nfc-toggle-btn {
  border-radius: 4px;
  min-width: 36px;
  text-align: center;
}

/* Overlay grid */
.nfc-overlay-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nfc-overlay-grid .nfc-toggle-btn {
  border-radius: 4px;
  font-size: 10px;
  padding: 3px 8px;
}

/* Inputs */
.nfc-input-sm {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 160px;
}

.nfc-input-xs {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 50px;
}

.nfc-unit-count-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nfc-unit-count-row select {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Add rows */
.nfc-add-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nfc-btn-sm {
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 900;
  min-width: 28px;
}

/* Tag lists (forbidden words, excluded sources) */
.nfc-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nfc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: #e8e0d0;
  border-radius: 12px;
  color: #555;
}

.nfc-tag .nfc-tag-remove {
  cursor: pointer;
  color: #999;
  font-size: 13px;
  line-height: 1;
}

.nfc-tag .nfc-tag-remove:hover {
  color: #c00;
}

/* Waypoint list items */
.nfc-list .nfc-wp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: #444;
  padding: 2px 0;
}

.nfc-list .nfc-wp-item .nfc-tag-remove {
  cursor: pointer;
  color: #999;
  font-size: 13px;
}

.nfc-list .nfc-wp-item .nfc-tag-remove:hover {
  color: #c00;
}

/* Time row */
.nfc-time-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nfc-time-row span {
  font-weight: 900;
  color: #666;
}

/* Achievement fields */
.nfc-achiev-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

/* Responsive: single column on mobile */
@media (max-width: 700px) {
  .nfc-row {
    flex-direction: column;
    gap: 8px;
  }
  .nfc-ids {
    flex-direction: column;
  }
  .nfc-id-row {
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .nfc-id-row:last-child {
    border-bottom: none;
  }
}

/* UI-102: Player View simplified result cards */
.unit-result.pv-card {
  cursor: default;
  padding: 10px 16px;
}
.unit-result.pv-card:hover {
  border-color: #ddd;
  background: inherit;
}
.pv-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pv-status {
  font-size: 32px;
  line-height: 1;
}
.pv-unit-text {
  font-size: 32px;
  font-weight: 700;
}

/* UI-102: Player View side-by-side layout */
.pv-layout-row {
  display: flex;
  flex-direction: row;
  gap: 32px;
  align-items: flex-start;
  margin: 10px 0 14px 0;
}
.pv-steps-col {
  flex: 3;
  min-width: 0;
}
.pv-feedback-col {
  flex: 2;
  min-width: 240px;
  max-width: 400px;
}

/* UI-102: Beta Feedback Section */
.pv-feedback-section {
  background: rgba(50,50,55,0.75);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0;
}
.pv-feedback-label {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px 0;
}
.pv-feedback-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  margin: 0 0 10px 0;
}
.pv-feedback-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.09);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.pv-feedback-textarea::placeholder { color: rgba(255,255,255,0.4); }
.pv-feedback-confirm {
  color: #7fffaa;
  font-size: 13px;
  margin: 6px 0 0 0;
}

/* UI-102: Player View — global text size bump */
.pv-instructions,
.pv-feedback-section,
.pv-examples-section,
.pv-card .pv-card-header,
.pv-unit-text {
  font-size: 19px;
}

/* UI-102: Beta Tester badge */
.pv-beta-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  font-style: italic;
}

/* UI-102: Player View step instructions */
.pv-instructions {
  margin-bottom: 10px;
}
.pv-instructions p {
  margin: 4px 0;
  font-size: 19px;
  color: rgba(255,255,255,0.9);
}
.pv-welcome {
  font-size: 17px !important;
  color: rgba(255,255,255,0.8) !important;
  font-style: italic;
  margin-bottom: 6px !important;
}
.pv-unit-link {
  color: #a8d8ff;
  text-decoration: underline;
  font-size: inherit;
}
.pv-spacer {
  height: 14px;
}

/* UI-102: Unit examples table */
.pv-examples-section {
  background: rgba(80,80,100,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 0;
  margin: 12px 0;
  overflow: hidden;
}
.pv-examples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
}
.pv-examples-header:hover { background: rgba(255,255,255,0.06); }
.pv-examples-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.pv-examples-arrow {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
#pv-examples-panel-body {
  padding: 0 20px 16px 20px;
}
.pv-examples-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.pv-examples-table th,
.pv-examples-table td {
  padding: 9px 12px;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: left;
  vertical-align: top;
}
.pv-examples-table th {
  font-weight: 700;
  font-size: 15px;
  padding-bottom: 10px;
}
.pv-col-yes { color: #7fffaa; width: 18%; }
.pv-col-no  { color: #ff8a8a; width: 18%; }
.pv-col-why { color: rgba(255,255,255,0.6); width: 64%; font-style: italic; font-size: 13px; }
.pv-examples-table td:nth-child(1) { color: rgba(255,255,255,0.95); font-weight: 600; }
.pv-examples-table td:nth-child(2) { color: rgba(255,255,255,0.55); }
.pv-examples-table td:nth-child(3) { color: rgba(255,255,255,0.75); font-size: 14px; font-style: italic; }
.pv-see-more-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 16px;
  color: #a8d8ff;
  text-decoration: underline;
  cursor: pointer;
}
.pv-examples-note {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  margin: 0 0 0 0;
  font-style: italic;
}

/* UI-102: Player View — Display Case width + canvas area */
#wordchain-display-card.pv-display-active {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}
.pv-display-active .marking-pattern-container {
  background: #000 !important;
  border: none !important;
}
.pv-display-active .staircase-visual-container h4 {
  color: rgba(255,255,255,0.55) !important;
}

/* UI-102: Display Case placeholder text in Player View */
.pv-dc-placeholder-text {
  font-size: 22px;
  color: rgba(255,255,255,0.6);
}

/* UI-102: Player View spacers */
.pv-input-spacer {
  height: 18px;
}
.pv-above-btn-spacer {
  height: 18px;
}

/* UI-102: Player View — Clear button two-line layout */
#clear-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding-top: 6px;
  padding-bottom: 6px;
}
#clear-btn .pv-clear-main {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.05em;
}
#clear-btn .pv-clear-sub {
  font-size: 10px;
  font-weight: normal;
  opacity: 0.75;
}

/* UI-102: Player View spacers below button group */
.pv-btn-spacer {
  height: 18px;
}

/* UI-102: Beta Feedback admin list in Control Panel */
.beta-feedback-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 4px;
}
.beta-feedback-empty {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  margin: 0;
  font-style: italic;
}
.beta-feedback-entry {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 8px 0;
}
.beta-feedback-entry:last-child { border-bottom: none; }
.beta-feedback-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 3px;
  font-style: italic;
}
.beta-feedback-text {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  white-space: pre-wrap;
  word-break: break-word;
}

/* UI-102: Divider row hidden when all extra rows are shown */
.pv-divider-hidden td {
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  padding-bottom: 9px !important;
}

/* UI-102: Step 3 hanging indent — wrapped text aligns with "Continue" */
.pv-step-3 {
  display: flex;
  align-items: flex-start;
}
.pv-step-prefix {
  flex-shrink: 0;
  white-space: nowrap;
}
.pv-step-text {
  flex: 1;
}

/* UI-102: Thick divider below 3rd example row (marks end of default 3) */
.pv-divider-row td {
  border-bottom: 3px solid rgba(255,255,255,0.35) !important;
  padding-bottom: 12px;
}
.pv-extra-row:first-of-type td {
  padding-top: 12px;
}

/* UI-102: Step spacing — vertical gap between Step 1/2/3 */
.pv-step {
  margin-bottom: 18px !important;
}

/* UI-102: "Send Your Feedback" button — right-aligned, blue */
.pv-feedback-btn {
  display: block;
  margin-left: auto;
  background: #0841a2 !important;
  border-color: #0841a2 !important;
}
.pv-feedback-btn:hover {
  background: #063190 !important;
  border-color: #063190 !important;
}

/* UI-102: Header spacers below header line */
.pv-header-spacer {
  height: 18px;
}

/* UI-102: "Linear Format" / "Staircase Format" view labels in Player View */
.pv-display-view-label {
  margin-bottom: 12px;
  margin-top: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 600;
}

/* UI-102: PV Notation Format display (below staircase) */
.pv-notation-display {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
}
.pv-notation-label {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.pv-notation-text {
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  margin: 0;
  white-space: pre-wrap;
}

/* Display Case section-content: black background (Admin + Player View) */
#display-case-content {
  background-color: #000 !important;
}

/* UI-102: Player View toggle button (advanced users only) */
.player-view-toggle-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.player-view-toggle-btn:hover {
  background: rgba(255,255,255,0.28);
}

/* ============================================================
   UI-102: Player View — Mobile Responsive
   ============================================================ */
@media (max-width: 768px) {
  /* Stack steps + feedback vertically on mobile */
  .pv-layout-row {
    flex-direction: column;
    gap: 20px;
  }
  .pv-feedback-col {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }

  /* Display Case + What Counts panel: full width on mobile */
  #wordchain-display-card.pv-display-active {
    width: 100% !important;
    margin-left: 0;
    margin-right: 0;
  }
  #pv-examples-section {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Buttons: proportional on small screens */
  #linear-mode .button-group {
    justify-content: center !important;
    gap: 10px !important;
  }
  #validate-btn {
    width: 60vw !important;
    height: 90px !important;
  }
  #clear-btn {
    width: 30vw !important;
    height: 90px !important;
  }

  /* Input field: normal font size on mobile (already readable) */
  #wordchain-input {
    font-size: 22px !important;
  }
}

/* ============================================================
   UI-HINT-003: Hint System Styles
   ============================================================ */

#super-hint-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
}

.super-hint-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

@media (max-width: 600px) {
  #super-hint-list {
    grid-template-columns: 1fr;
  }
}

/* Hint area collapse toggles */
.hint-collapse-toggle {
  cursor: pointer;
  color: #888;
  font-size: 12px;
  float: right;
  user-select: none;
}
.hint-collapse-toggle:hover {
  color: #bbb;
}

/* ── Units Explorer (RATINGS-RESCORE-001) ────────────────────────────────── */
.ue-subsection {
  margin-bottom: 20px;
}
.ue-subsection-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.ue-subsection-title {
  font-family: Nunito, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ue-last-scored {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-style: italic;
}
.ue-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ue-search {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  font-family: Nunito, sans-serif;
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
}
.ue-search::placeholder { color: rgba(255,255,255,0.35); }
.ue-search:focus { border-color: rgba(255,255,255,0.4); }
.ue-count {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}
.ue-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
}
.ue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ue-th {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-family: Nunito, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.ue-td-word {
  padding: 5px 10px;
  font-family: Nunito, sans-serif;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ue-td-chain {
  padding: 5px 10px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ue-td-assoc {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ue-chain {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-family: Nunito, sans-serif;
  font-weight: 700;
  font-size: 12px;
  border-radius: 4px;
  padding: 1px 5px;
}
.ue-green  { background: rgba(40,145,40,0.25);  color: #6ee06e; }
.ue-amber  { background: rgba(201,162,39,0.25); color: #e8c84a; }
.ue-red    { background: rgba(200,60,60,0.25);  color: #f08080; }
.ue-assoc {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  line-height: 1.5;
}
.ue-assoc-none { color: rgba(255,255,255,0.2); }
.ue-empty {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  padding: 12px;
  margin: 0;
  text-align: center;
}
/* ── End Units Explorer ──────────────────────────────────────────────────── */
