/* v0.10.1 YML import alignment and parsing status */

/* Match the desktop header boundaries to the two workspace columns. */
.app-header {
  grid-template-columns: auto minmax(260px, 1fr) 340px;
  gap: 14px;
}

.header-search-wrap {
  min-width: 0;
}

.header-side {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.header-side .header-actions {
  justify-content: flex-end;
}

.yml-import-drop {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed var(--panel-line-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.yml-import-drop:hover,
.yml-import-drop:focus-within,
.yml-import-drop.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.yml-import-drop.is-dragover {
  transform: translateY(-1px);
}

.yml-import-drop.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.yml-import-icon {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.yml-import-toast.is-stacked {
  top: max(78px, calc(env(safe-area-inset-top) + 64px));
}

.yml-import-toast[data-state="updated"] .vps-db-toast-indicator {
  animation: vps-db-toast-pulse 900ms ease-out 1;
}

/* Outdated-field confirmation prompt: same toast shell, but message wraps
   and an action row appears below it instead of auto-hiding. */
.yml-import-toast.has-actions {
  align-items: start;
  padding-bottom: 12px;
}

.yml-import-toast.has-actions .vps-db-toast-message {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.yml-import-toast-actions:empty {
  display: none;
}

.yml-import-toast-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.yml-import-toast-actions .text-btn {
  min-height: 30px;
}

.yml-import-toast-actions .preview-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.yml-import-toast-actions .preview-primary:hover {
  color: var(--accent-ink);
  filter: brightness(1.07);
}

@media (max-width: 900px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .header-side {
    grid-column: 2;
    grid-row: 1;
    width: min(340px, 48vw);
  }

  .header-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 680px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-side {
    display: contents;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .header-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .yml-import-drop {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }

  .yml-import-toast.is-stacked {
    top: max(72px, calc(env(safe-area-inset-top) + 64px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .yml-import-drop {
    transition: none;
  }
}
