:root {
  --sa-bg: #f6f7f9;
  --sa-surface: #ffffff;
  --sa-border: #d8dde3;
  --sa-text: #1f2329;
  --sa-text-muted: #5f6770;
  --sa-accent: #2f6feb;
  --sa-accent-bg: #e6efff;
  --sa-hover: #f0f2f6;
  --sa-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--sa-bg);
  color: var(--sa-text);
}

.sync-artifacts-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 2rem;
  min-height: 100vh;
}

.sync-artifacts-header__eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--sa-text-muted);
}

.sync-artifacts-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.sync-artifacts-header__envmt {
  margin: 0.5rem 0 0;
  color: var(--sa-text-muted);
  font-size: 0.9rem;
}

.column-browser {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: 6px;
  overflow-x: auto;
  min-height: 60vh;
}

.column {
  display: flex;
  flex-direction: column;
  flex: 0 0 240px;
  min-width: 240px;
  border-right: 1px solid var(--sa-border);
}

.column:last-child {
  border-right: none;
}

.column__header {
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sa-text-muted);
  background: #fbfbfd;
  border-bottom: 1px solid var(--sa-border);
}

.column__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.column__item {
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  word-break: break-all;
  border-bottom: 1px solid #f1f3f6;
  transition: background-color 0.05s ease-in;
}

.column__item:hover {
  background: var(--sa-hover);
}

.column__item--active {
  background: var(--sa-accent-bg);
  color: var(--sa-accent);
  font-weight: 600;
}

.column__item--empty {
  cursor: default;
  color: var(--sa-text-muted);
  font-style: italic;
}

.column__item--empty:hover {
  background: transparent;
}

.json-viewer {
  width: min(80vw, 900px);
  max-height: 80vh;
  border: 1px solid var(--sa-border);
  border-radius: 8px;
  padding: 0;
  background: var(--sa-surface);
}

.json-viewer::backdrop {
  background: rgba(15, 20, 30, 0.45);
}

.json-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sa-border);
}

.json-viewer__title {
  margin: 0;
  font-size: 1rem;
  font-family: var(--sa-mono);
  word-break: break-all;
}

.json-viewer__close {
  border: 1px solid var(--sa-border);
  background: var(--sa-surface);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.json-viewer__close:hover {
  background: var(--sa-hover);
}

.json-viewer__body {
  margin: 0;
  padding: 1rem;
  max-height: calc(80vh - 60px);
  overflow: auto;
  background: #0f1115;
  color: #e8edf2;
  font-family: var(--sa-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre;
}

.artifact-search {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.artifact-search__form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.artifact-search__input {
  flex: 1;
  max-width: 480px;
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--sa-mono);
  border: 1px solid var(--sa-border);
  border-radius: 4px;
  background: var(--sa-surface);
  color: var(--sa-text);
  outline: none;
}

.artifact-search__input:focus {
  border-color: var(--sa-accent);
  box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.15);
}

.artifact-search__btn {
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  background: var(--sa-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.artifact-search__btn:hover {
  opacity: 0.88;
}

.artifact-search__meta {
  font-size: 0.8rem;
  color: var(--sa-text-muted);
}

.artifact-search__results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.artifact-search__result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--sa-surface);
  border: 1px solid var(--sa-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.artifact-search__result:hover {
  background: var(--sa-hover);
  border-color: var(--sa-accent);
}

.artifact-search__result-file {
  font-family: var(--sa-mono);
  color: var(--sa-text);
}

.artifact-search__result-batch {
  font-size: 0.75rem;
  color: var(--sa-text-muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .sync-artifacts-page {
    padding: 1rem;
  }

  .column {
    flex-basis: 200px;
    min-width: 200px;
  }
}
