[hidden],
.hidden {
  display: none !important;
}

.osint-main,
.osint-content,
.osint-shell {
  min-height: 0;
}

.osint-content {
  padding: 0;
}

.osint-shell {
  width: 100%;
  max-width: none;
  height: calc(100vh - var(--header-height));
}

.osint-header-target {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: min(42vw, 520px);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
}

.osint-header-target-label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.osint-header-target code {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.osint-header-target button {
  padding: 2px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--accent-primary);
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.osint-header-target button:hover {
  color: var(--accent-primary-hover);
}

.osint-target-setup {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: var(--space-6);
}

.osint-target-card {
  width: min(680px, 100%);
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.osint-target-card h2 {
  margin: var(--space-2) 0 var(--space-2);
  font-size: var(--text-2xl);
}

.osint-target-card > p {
  margin: 0 0 var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.55;
}

.osint-eyebrow,
.osint-section-label,
.osint-context-title {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--font-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.osint-eyebrow {
  color: var(--accent-primary);
}

.osint-search-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.osint-search-bar {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
}

.osint-search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.osint-search-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
}

.osint-search-input::placeholder {
  color: var(--text-muted);
}

.osint-search-btn {
  align-self: stretch;
  height: auto;
  margin: 0;
  border-radius: 0;
  padding: 0 var(--space-5);
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--accent-primary) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-primary) 16%, var(--bg-elevated));
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
}

.osint-search-btn:hover {
  background: color-mix(in srgb, var(--accent-primary) 24%, var(--bg-elevated));
}

.osint-hint {
  margin: var(--space-2) 0 0 !important;
  color: var(--text-secondary) !important;
  font-size: var(--text-xs) !important;
}

.inline-feedback {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid color-mix(in srgb, var(--accent-error) 55%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-error) 12%, transparent);
  color: var(--accent-error);
  font-size: var(--text-sm);
}

.osint-workbench {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 288px;
  height: 100%;
  overflow: hidden;
}

.osint-questions-panel,
.osint-research-panel,
.osint-trail-panel {
  min-width: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.osint-questions-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--bg-primary);
}

.osint-detection {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.osint-detection-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.osint-detection-value {
  grid-column: 1;
  color: var(--accent-primary);
  font-size: var(--text-sm);
}

.osint-detection-candidates {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.osint-change-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.osint-change-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.osint-type-picker {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.osint-picker-label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.osint-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.osint-picker-options button {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.osint-picker-options button:hover,
.osint-picker-options button.active {
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border));
  color: var(--accent-primary);
}

.osint-field-form {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.osint-field-form > p {
  margin: 4px 0 var(--space-3);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.osint-field-grid {
  display: grid;
  gap: var(--space-2);
}

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

.osint-field-label {
  color: var(--text-secondary);
  font-size: 10px;
}

.osint-field-input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
}

.osint-field-input::placeholder {
  color: var(--text-muted);
}

.osint-field-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

#routeArea {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

#routeButtons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.question-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.question-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.question-btn.active {
  border-color: color-mix(in srgb, var(--accent-primary) 28%, var(--border));
  background: color-mix(in srgb, var(--accent-primary) 9%, transparent);
  color: var(--accent-primary);
  font-weight: var(--font-medium);
}

.question-count {
  min-width: 22px;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.osint-research-panel {
  padding: var(--space-6);
  background: var(--bg-input);
}

.osint-objective {
  max-width: 880px;
  margin: 0 auto var(--space-6);
}

.osint-objective h2 {
  margin: var(--space-2) 0 var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-2xl);
  line-height: 1.2;
}

.osint-objective p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.55;
}

.osint-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.osint-coverage span {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}

.osint-coverage strong {
  color: var(--text-secondary);
}

#stageResults {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 880px;
  margin: 0 auto;
}

.osint-source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.osint-source-card:hover {
  border-color: var(--border-hover);
}

.osint-source-card.recommended {
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

.osint-source-card.locked {
  border-style: dashed;
  background: color-mix(in srgb, var(--bg-primary) 62%, var(--bg-surface));
}

.source-card-main {
  min-width: 0;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 5px;
}

.source-badge,
.source-category {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-badge {
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.source-badge.recommended {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
}

.source-badge.locked {
  background: color-mix(in srgb, var(--accent-warning) 12%, transparent);
  color: var(--accent-warning);
}

.osint-source-card h3 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: var(--text-lg);
}

.osint-source-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.source-actions {
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-2);
}

.osint-hint-chip {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-warning) 42%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-warning) 10%, transparent);
  color: var(--accent-warning);
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.osint-hint-chip:hover {
  background: color-mix(in srgb, var(--accent-warning) 17%, transparent);
}

.unlock-banner {
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent-warning) 38%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-warning) 8%, var(--bg-surface));
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.osint-unlock-banner {
  /* Compatibility hook retained for the field-aware OSINT contract. */
}

.empty-state {
  padding: var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.osint-trail-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-primary);
}

.osint-trail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.osint-trail-header h2 {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trail-actions {
  display: flex;
  gap: 3px;
}

.osint-clear-btn,
.osint-trail-btn,
.trail-entry-actions button {
  min-width: 24px;
  min-height: 24px;
  padding: 3px 5px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
}

.osint-trail-btn,
.trail-entry-actions button {
  color: var(--accent-primary);
}

.trail-entry-actions select {
  padding: 2px 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.trail-entry-actions select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.osint-clear-btn,
.trail-entry-actions .trail-remove {
  color: var(--accent-error);
}

.osint-clear-btn:hover,
.osint-trail-btn:hover,
.trail-entry-actions button:hover {
  background: var(--bg-elevated);
}

.osint-trail-empty {
  margin: var(--space-4);
  padding: var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

#reportTrail {
  display: flex;
  flex-direction: column;
}

.trail-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.trail-entry-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.trail-entry-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trail-entry-copy span,
.trail-entry-copy time {
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trail-entry-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

@media (min-width: 1181px) {
  body[data-tool-id="osint"] {
    overflow: hidden;
  }
}

@media (max-width: 1180px) {
  .osint-shell {
    height: auto;
    min-height: calc(100vh - var(--header-height));
  }

  .osint-workbench {
    grid-template-columns: 240px minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - var(--header-height));
    overflow: visible;
  }

  .osint-questions-panel,
  .osint-research-panel,
  .osint-trail-panel {
    overflow: visible;
  }

  .osint-trail-panel {
    grid-column: 1 / -1;
    min-height: 240px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 780px) {
  .header {
    padding: 0 var(--space-3);
  }

  .osint-header-target {
    display: none;
  }

  .header-right .badge {
    display: none;
  }

  .osint-workbench {
    grid-template-columns: 1fr;
  }

  .osint-questions-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  #routeButtons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .osint-research-panel {
    padding: var(--space-4);
  }

  .osint-objective h2 {
    font-size: var(--text-xl);
  }

  .osint-source-card {
    align-items: stretch;
    flex-direction: column;
  }

  .source-actions {
    justify-content: flex-end;
  }

  .osint-trail-panel {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .osint-target-setup,
  .osint-target-card {
    padding: var(--space-4);
  }

  .osint-search-bar {
    flex-direction: column;
  }

  .osint-search-btn {
    min-height: 42px;
    border-top: 1px solid color-mix(in srgb, var(--accent-primary) 45%, var(--border));
    border-left: 0;
  }

  #routeButtons {
    grid-template-columns: 1fr;
  }

  .source-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .osint-source-card {
    transition: none;
  }
}
